From a68a5d09a09f1c16d557cdb9f8d6e44e032cc9bc Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 26 Dec 2024 21:59:11 +0000 Subject: [PATCH 1/4] docs: fix a few broken references in documentation PiperOrigin-RevId: 709845869 Source-Link: https://github.com/googleapis/googleapis/commit/baa225c2e09886cf0fb972ca286818d0e1e02675 Source-Link: https://github.com/googleapis/googleapis-gen/commit/feeb215e7422b56b339cad160e37428e54182de9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiJmZWViMjE1ZTc0MjJiNTZiMzM5Y2FkMTYwZTM3NDI4ZTU0MTgyZGU5In0= --- .../google-cloud-batch/v1/.eslintignore | 7 + .../google-cloud-batch/v1/.eslintrc.json | 3 + .../google-cloud-batch/v1/.gitignore | 14 + .../google-cloud-batch/v1/.jsdoc.js | 55 + .../google-cloud-batch/v1/.mocharc.js | 33 + .../google-cloud-batch/v1/.prettierrc.js | 22 + .../google-cloud-batch/v1/README.md | 1 + .../google-cloud-batch/v1/package.json | 58 + .../protos/google/cloud/batch/v1/batch.proto | 275 + .../v1/protos/google/cloud/batch/v1/job.proto | 693 + .../protos/google/cloud/batch/v1/task.proto | 475 + .../protos/google/cloud/batch/v1/volume.proto | 80 + .../google-cloud-batch/v1/protos/protos.d.ts | 13321 +++++ .../google-cloud-batch/v1/protos/protos.js | 35612 +++++++++++++ .../google-cloud-batch/v1/protos/protos.json | 3401 ++ .../generated/v1/batch_service.create_job.js | 92 + .../generated/v1/batch_service.delete_job.js | 79 + .../generated/v1/batch_service.get_job.js | 61 + .../generated/v1/batch_service.get_task.js | 61 + .../generated/v1/batch_service.list_jobs.js | 79 + .../generated/v1/batch_service.list_tasks.js | 79 + ...nippet_metadata_google.cloud.batch.v1.json | 303 + .../google-cloud-batch/v1/src/index.ts | 25 + .../v1/src/v1/batch_service_client.ts | 1620 + .../src/v1/batch_service_client_config.json | 68 + .../v1/src/v1/batch_service_proto_list.json | 6 + .../v1/src/v1/gapic_metadata.json | 91 + .../google-cloud-batch/v1/src/v1/index.ts | 19 + .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 32 + .../v1/system-test/install.ts | 49 + .../v1/test/gapic_batch_service_v1.ts | 1899 + .../google-cloud-batch/v1/tsconfig.json | 19 + .../google-cloud-batch/v1/webpack.config.js | 64 + .../google-cloud-batch/v1alpha/.eslintignore | 7 + .../google-cloud-batch/v1alpha/.eslintrc.json | 3 + .../google-cloud-batch/v1alpha/.gitignore | 14 + .../google-cloud-batch/v1alpha/.jsdoc.js | 55 + .../google-cloud-batch/v1alpha/.mocharc.js | 33 + .../google-cloud-batch/v1alpha/.prettierrc.js | 22 + .../google-cloud-batch/v1alpha/README.md | 1 + .../google-cloud-batch/v1alpha/package.json | 58 + .../google/cloud/batch/v1alpha/batch.proto | 587 + .../google/cloud/batch/v1alpha/job.proto | 802 + .../cloud/batch/v1alpha/notification.proto | 38 + .../batch/v1alpha/resource_allowance.proto | 208 + .../google/cloud/batch/v1alpha/task.proto | 494 + .../google/cloud/batch/v1alpha/volume.proto | 98 + .../v1alpha/protos/protos.d.ts | 16145 ++++++ .../v1alpha/protos/protos.js | 42614 ++++++++++++++++ .../v1alpha/protos/protos.json | 4203 ++ .../v1alpha/batch_service.cancel_job.js | 76 + .../v1alpha/batch_service.create_job.js | 92 + ...batch_service.create_resource_allowance.js | 93 + .../v1alpha/batch_service.delete_job.js | 79 + ...batch_service.delete_resource_allowance.js | 80 + .../v1alpha/batch_service.get_job.js | 61 + .../batch_service.get_resource_allowance.js | 61 + .../v1alpha/batch_service.get_task.js | 61 + .../v1alpha/batch_service.list_jobs.js | 79 + .../batch_service.list_resource_allowances.js | 71 + .../v1alpha/batch_service.list_tasks.js | 83 + .../v1alpha/batch_service.update_job.js | 95 + ...batch_service.update_resource_allowance.js | 88 + ...t_metadata_google.cloud.batch.v1alpha.json | 635 + .../google-cloud-batch/v1alpha/src/index.ts | 25 + .../src/v1alpha/batch_service_client.ts | 2441 + .../v1alpha/batch_service_client_config.json | 103 + .../src/v1alpha/batch_service_proto_list.json | 8 + .../v1alpha/src/v1alpha/gapic_metadata.json | 165 + .../v1alpha/src/v1alpha/index.ts | 19 + .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 32 + .../v1alpha/system-test/install.ts | 49 + .../test/gapic_batch_service_v1alpha.ts | 2938 ++ .../google-cloud-batch/v1alpha/tsconfig.json | 19 + .../v1alpha/webpack.config.js | 64 + 77 files changed, 131649 insertions(+) create mode 100644 owl-bot-staging/google-cloud-batch/v1/.eslintignore create mode 100644 owl-bot-staging/google-cloud-batch/v1/.eslintrc.json create mode 100644 owl-bot-staging/google-cloud-batch/v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-batch/v1/.jsdoc.js create mode 100644 owl-bot-staging/google-cloud-batch/v1/.mocharc.js create mode 100644 owl-bot-staging/google-cloud-batch/v1/.prettierrc.js create mode 100644 owl-bot-staging/google-cloud-batch/v1/README.md create mode 100644 owl-bot-staging/google-cloud-batch/v1/package.json create mode 100644 owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/batch.proto create mode 100644 owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/job.proto create mode 100644 owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/task.proto create mode 100644 owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/volume.proto create mode 100644 owl-bot-staging/google-cloud-batch/v1/protos/protos.d.ts create mode 100644 owl-bot-staging/google-cloud-batch/v1/protos/protos.js create mode 100644 owl-bot-staging/google-cloud-batch/v1/protos/protos.json create mode 100644 owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.create_job.js create mode 100644 owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.delete_job.js create mode 100644 owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.get_job.js create mode 100644 owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.get_task.js create mode 100644 owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.list_jobs.js create mode 100644 owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.list_tasks.js create mode 100644 owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/snippet_metadata_google.cloud.batch.v1.json create mode 100644 owl-bot-staging/google-cloud-batch/v1/src/index.ts create mode 100644 owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_client.ts create mode 100644 owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-batch/v1/src/v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-batch/v1/src/v1/index.ts create mode 100644 owl-bot-staging/google-cloud-batch/v1/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/google-cloud-batch/v1/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/google-cloud-batch/v1/system-test/install.ts create mode 100644 owl-bot-staging/google-cloud-batch/v1/test/gapic_batch_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-batch/v1/tsconfig.json create mode 100644 owl-bot-staging/google-cloud-batch/v1/webpack.config.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/.eslintignore create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/.eslintrc.json create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/.gitignore create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/.jsdoc.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/.mocharc.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/.prettierrc.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/README.md create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/package.json create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/batch.proto create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/job.proto create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/notification.proto create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/resource_allowance.proto create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/task.proto create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/volume.proto create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.d.ts create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.json create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.cancel_job.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.create_job.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.create_resource_allowance.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.delete_job.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.delete_resource_allowance.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_job.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_resource_allowance.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_task.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_jobs.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_resource_allowances.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_tasks.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.update_job.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.update_resource_allowance.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/snippet_metadata_google.cloud.batch.v1alpha.json create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/src/index.ts create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_client.ts create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/index.ts create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/system-test/install.ts create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/test/gapic_batch_service_v1alpha.ts create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/tsconfig.json create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/webpack.config.js diff --git a/owl-bot-staging/google-cloud-batch/v1/.eslintignore b/owl-bot-staging/google-cloud-batch/v1/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-cloud-batch/v1/.eslintrc.json b/owl-bot-staging/google-cloud-batch/v1/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-cloud-batch/v1/.gitignore b/owl-bot-staging/google-cloud-batch/v1/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +/.coverage +/coverage +/.nyc_output +/docs/ +/out/ +/build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/google-cloud-batch/v1/.jsdoc.js b/owl-bot-staging/google-cloud-batch/v1/.jsdoc.js new file mode 100644 index 00000000000..f3c1e45a4fc --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2024 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/batch', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-cloud-batch/v1/.mocharc.js b/owl-bot-staging/google-cloud-batch/v1/.mocharc.js new file mode 100644 index 00000000000..13b67c34edc --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/google-cloud-batch/v1/.prettierrc.js b/owl-bot-staging/google-cloud-batch/v1/.prettierrc.js new file mode 100644 index 00000000000..9a8fd690982 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/google-cloud-batch/v1/README.md b/owl-bot-staging/google-cloud-batch/v1/README.md new file mode 100644 index 00000000000..15b2fa3f3e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/README.md @@ -0,0 +1 @@ +Batch: Nodejs Client diff --git a/owl-bot-staging/google-cloud-batch/v1/package.json b/owl-bot-staging/google-cloud-batch/v1/package.json new file mode 100644 index 00000000000..d27d57773ff --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/package.json @@ -0,0 +1,58 @@ +{ + "name": "@google-cloud/batch", + "version": "0.1.0", + "description": "Batch client for Node.js", + "repository": "googleapis/nodejs-batch", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google batch", + "batch", + "batch service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^4.3.4" + }, + "devDependencies": { + "@types/mocha": "^10.0.6", + "@types/node": "^20.12.12", + "@types/sinon": "^10.0.20", + "c8": "^9.1.0", + "gapic-tools": "^0.4.2", + "gts": "5.3.0", + "jsdoc": "^4.0.3", + "jsdoc-fresh": "^3.0.0", + "jsdoc-region-tag": "^3.0.0", + "mocha": "^10.4.0", + "pack-n-play": "^2.0.3", + "sinon": "^15.2.0", + "typescript": "5.1.6" + }, + "engines": { + "node": ">=v14" + } +} diff --git a/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/batch.proto b/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/batch.proto new file mode 100644 index 00000000000..8ab94854784 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/batch.proto @@ -0,0 +1,275 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.batch.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/cloud/batch/v1/job.proto"; +import "google/cloud/batch/v1/task.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Batch.V1"; +option go_package = "cloud.google.com/go/batch/apiv1/batchpb;batchpb"; +option java_multiple_files = true; +option java_outer_classname = "BatchProto"; +option java_package = "com.google.cloud.batch.v1"; +option objc_class_prefix = "GCB"; +option php_namespace = "Google\\Cloud\\Batch\\V1"; +option ruby_package = "Google::Cloud::Batch::V1"; + +// Google Batch Service. +// The service manages user submitted batch jobs and allocates Google Compute +// Engine VM instances to run the jobs. +service BatchService { + option (google.api.default_host) = "batch.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Create a Job. + rpc CreateJob(CreateJobRequest) returns (Job) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/jobs" + body: "job" + }; + option (google.api.method_signature) = "parent,job,job_id"; + } + + // Get a Job specified by its resource name. + rpc GetJob(GetJobRequest) returns (Job) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/jobs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Delete a Job. + rpc DeleteJob(DeleteJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/jobs/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.batch.v1.OperationMetadata" + }; + } + + // List all Jobs for a project within a region. + rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/jobs" + }; + option (google.api.method_signature) = "parent"; + } + + // Return a single Task. + rpc GetTask(GetTaskRequest) returns (Task) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/jobs/*/taskGroups/*/tasks/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List Tasks associated with a job. + rpc ListTasks(ListTasksRequest) returns (ListTasksResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/jobs/*/taskGroups/*}/tasks" + }; + option (google.api.method_signature) = "parent"; + } +} + +// CreateJob Request. +message CreateJobRequest { + // Required. The parent resource name where the Job will be created. + // Pattern: "projects/{project}/locations/{location}" + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { child_type: "batch.googleapis.com/Job" } + ]; + + // ID used to uniquely identify the Job within its parent scope. + // This field should contain at most 63 characters and must start with + // lowercase characters. + // Only lowercase characters, numbers and '-' are accepted. + // The '-' character cannot be the first or the last one. + // A system generated ID will be used if the field is not set. + // + // The job.name field in the request will be ignored and the created resource + // name of the Job will be "{parent}/jobs/{job_id}". + string job_id = 2; + + // Required. The Job to create. + Job job = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// GetJob Request. +message GetJobRequest { + // Required. Job name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "batch.googleapis.com/Job" } + ]; +} + +// DeleteJob Request. +message DeleteJobRequest { + // Job name. + string name = 1; + + // Optional. Reason for this deletion. + string reason = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// ListJob Request. +message ListJobsRequest { + // Parent path. + string parent = 1; + + // List filter. + string filter = 4; + + // Optional. Sort results. Supported are "name", "name desc", "create_time", + // and "create_time desc". + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Page size. + int32 page_size = 2; + + // Page token. + string page_token = 3; +} + +// ListJob Response. +message ListJobsResponse { + // Jobs. + repeated Job jobs = 1; + + // Next page token. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// ListTasks Request. +message ListTasksRequest { + // Required. Name of a TaskGroup from which Tasks are being requested. + // Pattern: + // "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "batch.googleapis.com/TaskGroup" } + ]; + + // Task filter, null filter matches all Tasks. + // Filter string should be of the format State=TaskStatus.State e.g. + // State=RUNNING + string filter = 2; + + // Page size. + int32 page_size = 3; + + // Page token. + string page_token = 4; +} + +// ListTasks Response. +message ListTasksResponse { + // Tasks. + repeated Task tasks = 1; + + // Next page token. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request for a single Task by name. +message GetTaskRequest { + // Required. Task name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "batch.googleapis.com/Task" } + ]; +} + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/job.proto b/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/job.proto new file mode 100644 index 00000000000..a215c35b837 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/job.proto @@ -0,0 +1,693 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.batch.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/batch/v1/task.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Batch.V1"; +option go_package = "cloud.google.com/go/batch/apiv1/batchpb;batchpb"; +option java_multiple_files = true; +option java_outer_classname = "JobProto"; +option java_package = "com.google.cloud.batch.v1"; +option objc_class_prefix = "GCB"; +option php_namespace = "Google\\Cloud\\Batch\\V1"; +option ruby_package = "Google::Cloud::Batch::V1"; + +// The Cloud Batch Job description. +message Job { + option (google.api.resource) = { + type: "batch.googleapis.com/Job" + pattern: "projects/{project}/locations/{location}/jobs/{job}" + }; + + // Output only. Job name. + // For example: "projects/123456/locations/us-central1/jobs/job01". + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A system generated unique ID for the Job. + string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Priority of the Job. + // The valid value range is [0, 100). Default value is 0. + // Higher value indicates higher priority. + // A job with higher priority value is more likely to run earlier if all other + // requirements are satisfied. + int64 priority = 3; + + // Required. TaskGroups in the Job. Only one TaskGroup is supported now. + repeated TaskGroup task_groups = 4 [(google.api.field_behavior) = REQUIRED]; + + // Compute resource allocation for all TaskGroups in the Job. + AllocationPolicy allocation_policy = 7; + + // Custom labels to apply to the job and any Cloud Logging + // [LogEntry](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry) + // that it generates. + // + // Use labels to group and describe the resources they are applied to. Batch + // automatically applies predefined labels and supports multiple `labels` + // fields for each job, which each let you apply custom labels to various + // resources. Label names that start with "goog-" or "google-" are + // reserved for predefined labels. For more information about labels with + // Batch, see + // [Organize resources using + // labels](https://cloud.google.com/batch/docs/organize-resources-using-labels). + map labels = 8; + + // Output only. Job status. It is read only for users. + JobStatus status = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. When the Job was created. + google.protobuf.Timestamp create_time = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last time the Job was updated. + google.protobuf.Timestamp update_time = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Log preservation policy for the Job. + LogsPolicy logs_policy = 13; + + // Notification configurations. + repeated JobNotification notifications = 14; +} + +// LogsPolicy describes if and how a job's logs are preserved. Logs include +// information that is automatically written by the Batch service agent and any +// information that you configured the job's runnables to write to the `stdout` +// or `stderr` streams. +message LogsPolicy { + // `CloudLoggingOption` contains additional settings for Cloud Logging logs + // generated by Batch job. + message CloudLoggingOption { + // Optional. Set this field to `true` to change the [monitored resource + // type](https://cloud.google.com/monitoring/api/resources) for + // Cloud Logging logs generated by this Batch job from + // the + // [`batch.googleapis.com/Job`](https://cloud.google.com/monitoring/api/resources#tag_batch.googleapis.com/Job) + // type to the formerly used + // [`generic_task`](https://cloud.google.com/monitoring/api/resources#tag_generic_task) + // type. + bool use_generic_task_monitored_resource = 1 + [(google.api.field_behavior) = OPTIONAL]; + } + + // The destination (if any) for logs. + enum Destination { + // (Default) Logs are not preserved. + DESTINATION_UNSPECIFIED = 0; + + // Logs are streamed to Cloud Logging. Optionally, you can configure + // additional settings in the `cloudLoggingOption` field. + CLOUD_LOGGING = 1; + + // Logs are saved to the file path specified in the `logsPath` field. + PATH = 2; + } + + // If and where logs should be saved. + Destination destination = 1; + + // When `destination` is set to `PATH`, you must set this field to the path + // where you want logs to be saved. This path can point to a local directory + // on the VM or (if congifured) a directory under the mount path of any + // Cloud Storage bucket, network file system (NFS), or writable persistent + // disk that is mounted to the job. For example, if the job has a bucket with + // `mountPath` set to `/mnt/disks/my-bucket`, you can write logs to the + // root directory of the `remotePath` of that bucket by setting this field to + // `/mnt/disks/my-bucket/`. + string logs_path = 2; + + // Optional. When `destination` is set to `CLOUD_LOGGING`, you can optionally + // set this field to configure additional settings for Cloud Logging. + CloudLoggingOption cloud_logging_option = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Job status. +message JobStatus { + // VM instance status. + message InstanceStatus { + // The Compute Engine machine type. + string machine_type = 1; + + // The VM instance provisioning model. + AllocationPolicy.ProvisioningModel provisioning_model = 2; + + // The max number of tasks can be assigned to this instance type. + int64 task_pack = 3; + + // The VM boot disk. + AllocationPolicy.Disk boot_disk = 4; + } + + // Aggregated task status for a TaskGroup. + message TaskGroupStatus { + // Count of task in each state in the TaskGroup. + // The map key is task state name. + map counts = 1; + + // Status of instances allocated for the TaskGroup. + repeated InstanceStatus instances = 2; + } + + // Valid Job states. + enum State { + // Job state unspecified. + STATE_UNSPECIFIED = 0; + + // Job is admitted (validated and persisted) and waiting for resources. + QUEUED = 1; + + // Job is scheduled to run as soon as resource allocation is ready. + // The resource allocation may happen at a later time but with a high + // chance to succeed. + SCHEDULED = 2; + + // Resource allocation has been successful. At least one Task in the Job is + // RUNNING. + RUNNING = 3; + + // All Tasks in the Job have finished successfully. + SUCCEEDED = 4; + + // At least one Task in the Job has failed. + FAILED = 5; + + // The Job will be deleted, but has not been deleted yet. Typically this is + // because resources used by the Job are still being cleaned up. + DELETION_IN_PROGRESS = 6; + } + + // Job state + State state = 1; + + // Job status events + repeated StatusEvent status_events = 2; + + // Aggregated task status for each TaskGroup in the Job. + // The map key is TaskGroup ID. + map task_groups = 4; + + // The duration of time that the Job spent in status RUNNING. + google.protobuf.Duration run_duration = 5; +} + +// Notification configurations. +message JobNotification { + // Message details. + // Describe the conditions under which messages will be sent. + // If no attribute is defined, no message will be sent by default. + // One message should specify either the job or the task level attributes, + // but not both. For example, + // job level: JOB_STATE_CHANGED and/or a specified new_job_state; + // task level: TASK_STATE_CHANGED and/or a specified new_task_state. + message Message { + // The message type. + Type type = 1; + + // The new job state. + JobStatus.State new_job_state = 2; + + // The new task state. + TaskStatus.State new_task_state = 3; + } + + // The message type. + enum Type { + // Unspecified. + TYPE_UNSPECIFIED = 0; + + // Notify users that the job state has changed. + JOB_STATE_CHANGED = 1; + + // Notify users that the task state has changed. + TASK_STATE_CHANGED = 2; + } + + // The Pub/Sub topic where notifications for the job, like state + // changes, will be published. If undefined, no Pub/Sub notifications + // are sent for this job. + // + // Specify the topic using the following format: + // `projects/{project}/topics/{topic}`. + // Notably, if you want to specify a Pub/Sub topic that is in a + // different project than the job, your administrator must grant your + // project's Batch service agent permission to publish to that topic. + // + // For more information about configuring Pub/Sub notifications for + // a job, see + // https://cloud.google.com/batch/docs/enable-notifications. + string pubsub_topic = 1; + + // The attribute requirements of messages to be sent to this Pub/Sub topic. + // Without this field, no message will be sent. + Message message = 2; +} + +// A Job's resource allocation policy describes when, where, and how compute +// resources should be allocated for the Job. +message AllocationPolicy { + message LocationPolicy { + // A list of allowed location names represented by internal URLs. + // + // Each location can be a region or a zone. + // Only one region or multiple zones in one region is supported now. + // For example, + // ["regions/us-central1"] allow VMs in any zones in region us-central1. + // ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs + // in zones us-central1-a and us-central1-c. + // + // Mixing locations from different regions would cause errors. + // For example, + // ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b", + // "zones/us-west1-a"] contains locations from two distinct regions: + // us-central1 and us-west1. This combination will trigger an error. + repeated string allowed_locations = 1; + } + + // A new persistent disk or a local ssd. + // A VM can only have one local SSD setting but multiple local SSD partitions. + // See https://cloud.google.com/compute/docs/disks#pdspecs and + // https://cloud.google.com/compute/docs/disks#localssds. + message Disk { + // A data source from which a PD will be created. + oneof data_source { + // URL for a VM image to use as the data source for this disk. + // For example, the following are all valid URLs: + // + // * Specify the image by its family name: + // projects/{project}/global/images/family/{image_family} + // * Specify the image version: + // projects/{project}/global/images/{image_version} + // + // You can also use Batch customized image in short names. + // The following image values are supported for a boot disk: + // + // * `batch-debian`: use Batch Debian images. + // * `batch-cos`: use Batch Container-Optimized images. + // * `batch-hpc-rocky`: use Batch HPC Rocky Linux images. + string image = 4; + + // Name of a snapshot used as the data source. + // Snapshot is not supported as boot disk now. + string snapshot = 5; + } + + // Disk type as shown in `gcloud compute disk-types list`. + // For example, local SSD uses type "local-ssd". + // Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd" + // or "pd-standard". If not specified, "pd-standard" will be used as the + // default type for non-boot disks, "pd-balanced" will be used as the + // default type for boot disks. + string type = 1; + + // Disk size in GB. + // + // **Non-Boot Disk**: + // If the `type` specifies a persistent disk, this field + // is ignored if `data_source` is set as `image` or `snapshot`. + // If the `type` specifies a local SSD, this field should be a multiple of + // 375 GB, otherwise, the final size will be the next greater multiple of + // 375 GB. + // + // **Boot Disk**: + // Batch will calculate the boot disk size based on source + // image and task requirements if you do not speicify the size. + // If both this field and the `boot_disk_mib` field in task spec's + // `compute_resource` are defined, Batch will only honor this field. + // Also, this field should be no smaller than the source disk's + // size when the `data_source` is set as `snapshot` or `image`. + // For example, if you set an image as the `data_source` field and the + // image's default disk size 30 GB, you can only use this field to make the + // disk larger or equal to 30 GB. + int64 size_gb = 2; + + // Local SSDs are available through both "SCSI" and "NVMe" interfaces. + // If not indicated, "NVMe" will be the default one for local ssds. + // This field is ignored for persistent disks as the interface is chosen + // automatically. See + // https://cloud.google.com/compute/docs/disks/persistent-disks#choose_an_interface. + string disk_interface = 6; + } + + // A new or an existing persistent disk (PD) or a local ssd attached to a VM + // instance. + message AttachedDisk { + oneof attached { + Disk new_disk = 1; + + // Name of an existing PD. + string existing_disk = 2; + } + + // Device name that the guest operating system will see. + // It is used by Runnable.volumes field to mount disks. So please specify + // the device_name if you want Batch to help mount the disk, and it should + // match the device_name field in volumes. + string device_name = 3; + } + + // Accelerator describes Compute Engine accelerators to be attached to the VM. + message Accelerator { + // The accelerator type. For example, "nvidia-tesla-t4". + // See `gcloud compute accelerator-types list`. + string type = 1; + + // The number of accelerators of this type. + int64 count = 2; + + // Deprecated: please use instances[0].install_gpu_drivers instead. + bool install_gpu_drivers = 3 [deprecated = true]; + + // Optional. The NVIDIA GPU driver version that should be installed for this + // type. + // + // You can define the specific driver version such as "470.103.01", + // following the driver version requirements in + // https://cloud.google.com/compute/docs/gpus/install-drivers-gpu#minimum-driver. + // Batch will install the specific accelerator driver if qualified. + string driver_version = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // InstancePolicy describes an instance type and resources attached to each VM + // created by this InstancePolicy. + message InstancePolicy { + // The Compute Engine machine type. + string machine_type = 2; + + // The minimum CPU platform. + // See + // https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. + string min_cpu_platform = 3; + + // The provisioning model. + ProvisioningModel provisioning_model = 4; + + // The accelerators attached to each VM instance. + repeated Accelerator accelerators = 5; + + // Boot disk to be created and attached to each VM by this InstancePolicy. + // Boot disk will be deleted when the VM is deleted. + // Batch API now only supports booting from image. + Disk boot_disk = 8; + + // Non-boot disks to be attached for each VM created by this InstancePolicy. + // New disks will be deleted when the VM is deleted. + // A non-boot disk is a disk that can be of a device with a + // file system or a raw storage drive that is not ready for data + // storage and accessing. + repeated AttachedDisk disks = 6; + + // Optional. If not specified (default), VMs will consume any applicable + // reservation. If "NO_RESERVATION" is specified, VMs will not consume any + // reservation. Otherwise, if specified, VMs will consume only the specified + // reservation. + string reservation = 7 [(google.api.field_behavior) = OPTIONAL]; + } + + // InstancePolicyOrTemplate lets you define the type of resources to use for + // this job either with an InstancePolicy or an instance template. + // If undefined, Batch picks the type of VM to use and doesn't include + // optional VM resources such as GPUs and extra disks. + message InstancePolicyOrTemplate { + oneof policy_template { + // InstancePolicy. + InstancePolicy policy = 1; + + // Name of an instance template used to create VMs. + // Named the field as 'instance_template' instead of 'template' to avoid + // C++ keyword conflict. + // + // Batch only supports global instance templates from the same project as + // the job. + // You can specify the global instance template as a full or partial URL. + string instance_template = 2; + } + + // Set this field true if you want Batch to help fetch drivers from a third + // party location and install them for GPUs specified in + // `policy.accelerators` or `instance_template` on your behalf. Default is + // false. + // + // For Container-Optimized Image cases, Batch will install the + // accelerator driver following milestones of + // https://cloud.google.com/container-optimized-os/docs/release-notes. For + // non Container-Optimized Image cases, following + // https://github.com/GoogleCloudPlatform/compute-gpu-installation/blob/main/linux/install_gpu_driver.py. + bool install_gpu_drivers = 3; + + // Optional. Set this field true if you want Batch to install Ops Agent on + // your behalf. Default is false. + bool install_ops_agent = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Set this field to `true` if you want Batch to block + // project-level SSH keys from accessing this job's VMs. Alternatively, you + // can configure the job to specify a VM instance template that blocks + // project-level SSH keys. In either case, Batch blocks project-level SSH + // keys while creating the VMs for this job. + // + // Batch allows project-level SSH keys for a job's VMs only if all + // the following are true: + // + // + This field is undefined or set to `false`. + // + The job's VM instance template (if any) doesn't block project-level + // SSH keys. + // + // Notably, you can override this behavior by manually updating a VM to + // block or allow project-level SSH keys. For more information about + // blocking project-level SSH keys, see the Compute Engine documentation: + // https://cloud.google.com/compute/docs/connect/restrict-ssh-keys#block-keys + bool block_project_ssh_keys = 5 [(google.api.field_behavior) = OPTIONAL]; + } + + // A network interface. + message NetworkInterface { + // The URL of an existing network resource. + // You can specify the network as a full or partial URL. + // + // For example, the following are all valid URLs: + // + // * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network} + // * projects/{project}/global/networks/{network} + // * global/networks/{network} + string network = 1; + + // The URL of an existing subnetwork resource in the network. + // You can specify the subnetwork as a full or partial URL. + // + // For example, the following are all valid URLs: + // + // * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork} + // * projects/{project}/regions/{region}/subnetworks/{subnetwork} + // * regions/{region}/subnetworks/{subnetwork} + string subnetwork = 2; + + // Default is false (with an external IP address). Required if + // no external public IP address is attached to the VM. If no external + // public IP address, additional configuration is required to allow the VM + // to access Google Services. See + // https://cloud.google.com/vpc/docs/configure-private-google-access and + // https://cloud.google.com/nat/docs/gce-example#create-nat for more + // information. + bool no_external_ip_address = 3; + } + + // NetworkPolicy describes VM instance network configurations. + message NetworkPolicy { + // Network configurations. + repeated NetworkInterface network_interfaces = 1; + } + + // PlacementPolicy describes a group placement policy for the VMs controlled + // by this AllocationPolicy. + message PlacementPolicy { + // UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you + // want VMs to be located close to each other for low network latency + // between the VMs. No placement policy will be generated when collocation + // is UNSPECIFIED. + string collocation = 1; + + // When specified, causes the job to fail if more than max_distance logical + // switches are required between VMs. Batch uses the most compact possible + // placement of VMs even when max_distance is not specified. An explicit + // max_distance makes that level of compactness a strict requirement. + // Not yet implemented + int64 max_distance = 2; + } + + // Compute Engine VM instance provisioning model. + enum ProvisioningModel { + // Unspecified. + PROVISIONING_MODEL_UNSPECIFIED = 0; + + // Standard VM. + STANDARD = 1; + + // SPOT VM. + SPOT = 2; + + // Preemptible VM (PVM). + // + // Above SPOT VM is the preferable model for preemptible VM instances: the + // old preemptible VM model (indicated by this field) is the older model, + // and has been migrated to use the SPOT model as the underlying technology. + // This old model will still be supported. + PREEMPTIBLE = 3; + } + + // Location where compute resources should be allocated for the Job. + LocationPolicy location = 1; + + // Describe instances that can be created by this AllocationPolicy. + // Only instances[0] is supported now. + repeated InstancePolicyOrTemplate instances = 8; + + // Defines the service account for Batch-created VMs. If omitted, the [default + // Compute Engine service + // account](https://cloud.google.com/compute/docs/access/service-accounts#default_service_account) + // is used. Must match the service account specified in any used instance + // template configured in the Batch job. + // + // Includes the following fields: + // * email: The service account's email address. If not set, the default + // Compute Engine service account is used. + // * scopes: Additional OAuth scopes to grant the service account, beyond the + // default cloud-platform scope. (list of strings) + ServiceAccount service_account = 9; + + // Custom labels to apply to the job and all the Compute Engine resources + // that both are created by this allocation policy and support labels. + // + // Use labels to group and describe the resources they are applied to. Batch + // automatically applies predefined labels and supports multiple `labels` + // fields for each job, which each let you apply custom labels to various + // resources. Label names that start with "goog-" or "google-" are + // reserved for predefined labels. For more information about labels with + // Batch, see + // [Organize resources using + // labels](https://cloud.google.com/batch/docs/organize-resources-using-labels). + map labels = 6; + + // The network policy. + // + // If you define an instance template in the `InstancePolicyOrTemplate` field, + // Batch will use the network settings in the instance template instead of + // this field. + NetworkPolicy network = 7; + + // The placement policy. + PlacementPolicy placement = 10; + + // Optional. Tags applied to the VM instances. + // + // The tags identify valid sources or targets for network firewalls. + // Each tag must be 1-63 characters long, and comply with + // [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). + repeated string tags = 11 [(google.api.field_behavior) = OPTIONAL]; +} + +// A TaskGroup defines one or more Tasks that all share the same TaskSpec. +message TaskGroup { + option (google.api.resource) = { + type: "batch.googleapis.com/TaskGroup" + pattern: "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + }; + + // How Tasks in the TaskGroup should be scheduled relative to each other. + enum SchedulingPolicy { + // Unspecified. + SCHEDULING_POLICY_UNSPECIFIED = 0; + + // Run Tasks as soon as resources are available. + // + // Tasks might be executed in parallel depending on parallelism and + // task_count values. + AS_SOON_AS_POSSIBLE = 1; + + // Run Tasks sequentially with increased task index. + IN_ORDER = 2; + } + + // Output only. TaskGroup name. + // The system generates this field based on parent Job name. + // For example: + // "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01". + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Tasks in the group share the same task spec. + TaskSpec task_spec = 3 [(google.api.field_behavior) = REQUIRED]; + + // Number of Tasks in the TaskGroup. + // Default is 1. + int64 task_count = 4; + + // Max number of tasks that can run in parallel. + // Default to min(task_count, parallel tasks per job limit). + // See: [Job Limits](https://cloud.google.com/batch/quotas#job_limits). + // Field parallelism must be 1 if the scheduling_policy is IN_ORDER. + int64 parallelism = 5; + + // Scheduling policy for Tasks in the TaskGroup. + // The default value is AS_SOON_AS_POSSIBLE. + SchedulingPolicy scheduling_policy = 6; + + // An array of environment variable mappings, which are passed to Tasks with + // matching indices. If task_environments is used then task_count should + // not be specified in the request (and will be ignored). Task count will be + // the length of task_environments. + // + // Tasks get a BATCH_TASK_INDEX and BATCH_TASK_COUNT environment variable, in + // addition to any environment variables set in task_environments, specifying + // the number of Tasks in the Task's parent TaskGroup, and the specific Task's + // index in the TaskGroup (0 through BATCH_TASK_COUNT - 1). + repeated Environment task_environments = 9; + + // Max number of tasks that can be run on a VM at the same time. + // If not specified, the system will decide a value based on available + // compute resources on a VM and task requirements. + int64 task_count_per_node = 10; + + // When true, Batch will populate a file with a list of all VMs assigned to + // the TaskGroup and set the BATCH_HOSTS_FILE environment variable to the path + // of that file. Defaults to false. The host file supports up to 1000 VMs. + bool require_hosts_file = 11; + + // When true, Batch will configure SSH to allow passwordless login between + // VMs running the Batch tasks in the same TaskGroup. + bool permissive_ssh = 12; + + // Optional. If not set or set to false, Batch uses the root user to execute + // runnables. If set to true, Batch runs the runnables using a non-root user. + // Currently, the non-root user Batch used is generated by OS Login. For more + // information, see [About OS + // Login](https://cloud.google.com/compute/docs/oslogin). + bool run_as_non_root = 14 [(google.api.field_behavior) = OPTIONAL]; +} + +// Carries information about a Google Cloud service account. +message ServiceAccount { + // Email address of the service account. + string email = 1; + + // List of scopes to be enabled for this service account. + repeated string scopes = 2; +} diff --git a/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/task.proto b/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/task.proto new file mode 100644 index 00000000000..f9edabb2b6a --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/task.proto @@ -0,0 +1,475 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.batch.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/batch/v1/volume.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Batch.V1"; +option go_package = "cloud.google.com/go/batch/apiv1/batchpb;batchpb"; +option java_multiple_files = true; +option java_outer_classname = "TaskProto"; +option java_package = "com.google.cloud.batch.v1"; +option objc_class_prefix = "GCB"; +option php_namespace = "Google\\Cloud\\Batch\\V1"; +option ruby_package = "Google::Cloud::Batch::V1"; + +// Compute resource requirements. +// +// ComputeResource defines the amount of resources required for each task. +// Make sure your tasks have enough resources to successfully run. +// If you also define the types of resources for a job to use with the +// [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) +// field, make sure both fields are compatible with each other. +message ComputeResource { + // The milliCPU count. + // + // `cpuMilli` defines the amount of CPU resources per task in milliCPU units. + // For example, `1000` corresponds to 1 vCPU per task. If undefined, the + // default value is `2000`. + // + // If you also define the VM's machine type using the `machineType` in + // [InstancePolicy](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicy) + // field or inside the `instanceTemplate` in the + // [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) + // field, make sure the CPU resources for both fields are compatible with each + // other and with how many tasks you want to allow to run on the same VM at + // the same time. + // + // For example, if you specify the `n2-standard-2` machine type, which has 2 + // vCPUs each, you are recommended to set `cpuMilli` no more than `2000`, or + // you are recommended to run two tasks on the same VM if you set `cpuMilli` + // to `1000` or less. + int64 cpu_milli = 1; + + // Memory in MiB. + // + // `memoryMib` defines the amount of memory per task in MiB units. + // If undefined, the default value is `2000`. + // If you also define the VM's machine type using the `machineType` in + // [InstancePolicy](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicy) + // field or inside the `instanceTemplate` in the + // [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) + // field, make sure the memory resources for both fields are compatible with + // each other and with how many tasks you want to allow to run on the same VM + // at the same time. + // + // For example, if you specify the `n2-standard-2` machine type, which has 8 + // GiB each, you are recommended to set `memoryMib` to no more than `8192`, + // or you are recommended to run two tasks on the same VM if you set + // `memoryMib` to `4096` or less. + int64 memory_mib = 2; + + // Extra boot disk size in MiB for each task. + int64 boot_disk_mib = 4; +} + +// Status event. +message StatusEvent { + // Type of the event. + string type = 3; + + // Description of the event. + string description = 1; + + // The time this event occurred. + google.protobuf.Timestamp event_time = 2; + + // Task Execution. + // This field is only defined for task-level status events where the task + // fails. + TaskExecution task_execution = 4; + + // Task State. + // This field is only defined for task-level status events. + TaskStatus.State task_state = 5; +} + +// This Task Execution field includes detail information for +// task execution procedures, based on StatusEvent types. +message TaskExecution { + // The exit code of a finished task. + // + // If the task succeeded, the exit code will be 0. If the task failed but not + // due to the following reasons, the exit code will be 50000. + // + // Otherwise, it can be from different sources: + // * Batch known failures: + // https://cloud.google.com/batch/docs/troubleshooting#reserved-exit-codes. + // * Batch runnable execution failures; you can rely on Batch logs to further + // diagnose: https://cloud.google.com/batch/docs/analyze-job-using-logs. If + // there are multiple runnables failures, Batch only exposes the first error. + int32 exit_code = 1; +} + +// Status of a task. +message TaskStatus { + // Task states. + enum State { + // Unknown state. + STATE_UNSPECIFIED = 0; + + // The Task is created and waiting for resources. + PENDING = 1; + + // The Task is assigned to at least one VM. + ASSIGNED = 2; + + // The Task is running. + RUNNING = 3; + + // The Task has failed. + FAILED = 4; + + // The Task has succeeded. + SUCCEEDED = 5; + + // The Task has not been executed when the Job finishes. + UNEXECUTED = 6; + } + + // Task state. + State state = 1; + + // Detailed info about why the state is reached. + repeated StatusEvent status_events = 2; +} + +// Runnable describes instructions for executing a specific script or container +// as part of a Task. +message Runnable { + // Container runnable. + message Container { + // Required. The URI to pull the container image from. + string image_uri = 1; + + // Required for some container images. Overrides the `CMD` specified in the + // container. If there is an `ENTRYPOINT` (either in the container image or + // with the `entrypoint` field below) then these commands are appended as + // arguments to the `ENTRYPOINT`. + repeated string commands = 2; + + // Required for some container images. Overrides the `ENTRYPOINT` specified + // in the container. + string entrypoint = 3; + + // Volumes to mount (bind mount) from the host machine files or directories + // into the container, formatted to match `--volume` option for the + // `docker run` command—for example, `/foo:/bar` or `/foo:/bar:ro`. + // + // If the `TaskSpec.Volumes` field is specified but this field is not, Batch + // will mount each volume from the host machine to the container with the + // same mount path by default. In this case, the default mount option for + // containers will be read-only (`ro`) for existing persistent disks and + // read-write (`rw`) for other volume types, regardless of the original + // mount options specified in `TaskSpec.Volumes`. If you need different + // mount settings, you can explicitly configure them in this field. + repeated string volumes = 7; + + // Required for some container images. Arbitrary additional options to + // include in the `docker run` command when running this container—for + // example, `--network host`. For the `--volume` option, use the `volumes` + // field for the container. + string options = 8; + + // If set to true, external network access to and from container will be + // blocked, containers that are with block_external_network as true can + // still communicate with each other, network cannot be specified in the + // `container.options` field. + bool block_external_network = 9; + + // Required if the container image is from a private Docker registry. The + // username to login to the Docker registry that contains the image. + // + // You can either specify the username directly by using plain text or + // specify an encrypted username by using a Secret Manager secret: + // `projects/*/secrets/*/versions/*`. However, using a secret is + // recommended for enhanced security. + // + // Caution: If you specify the username using plain text, you risk the + // username being exposed to any users who can view the job or its logs. + // To avoid this risk, specify a secret that contains the username instead. + // + // Learn more about [Secret + // Manager](https://cloud.google.com/secret-manager/docs/) and [using + // Secret Manager with + // Batch](https://cloud.google.com/batch/docs/create-run-job-secret-manager). + string username = 10; + + // Required if the container image is from a private Docker registry. The + // password to login to the Docker registry that contains the image. + // + // For security, it is strongly recommended to specify an + // encrypted password by using a Secret Manager secret: + // `projects/*/secrets/*/versions/*`. + // + // Warning: If you specify the password using plain text, you risk the + // password being exposed to any users who can view the job or its logs. + // To avoid this risk, specify a secret that contains the password instead. + // + // Learn more about [Secret + // Manager](https://cloud.google.com/secret-manager/docs/) and [using + // Secret Manager with + // Batch](https://cloud.google.com/batch/docs/create-run-job-secret-manager). + string password = 11; + + // Optional. If set to true, this container runnable uses Image streaming. + // + // Use Image streaming to allow the runnable to initialize without + // waiting for the entire container image to download, which can + // significantly reduce startup time for large container images. + // + // When `enableImageStreaming` is set to true, the container + // runtime is [containerd](https://containerd.io/) instead of Docker. + // Additionally, this container runnable only supports the following + // `container` subfields: `imageUri`, + // `commands[]`, `entrypoint`, and + // `volumes[]`; any other `container` subfields are ignored. + // + // For more information about the requirements and limitations for using + // Image streaming with Batch, see the [`image-streaming` + // sample on + // GitHub](https://github.com/GoogleCloudPlatform/batch-samples/tree/main/api-samples/image-streaming). + bool enable_image_streaming = 12 [(google.api.field_behavior) = OPTIONAL]; + } + + // Script runnable. + message Script { + // Required. The source code for this script runnable. + oneof command { + // The path to a script file that is accessible from the host VM(s). + // + // Unless the script file supports the default `#!/bin/sh` shell + // interpreter, you must specify an interpreter by including a + // [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix) as the + // first line of the file. For example, to execute the script using bash, + // include `#!/bin/bash` as the first line of the file. Alternatively, + // to execute the script using Python3, include `#!/usr/bin/env python3` + // as the first line of the file. + string path = 1; + + // The text for a script. + // + // Unless the script text supports the default `#!/bin/sh` shell + // interpreter, you must specify an interpreter by including a + // [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix) at the + // beginning of the text. For example, to execute the script using bash, + // include `#!/bin/bash\n` at the beginning of the text. Alternatively, + // to execute the script using Python3, include `#!/usr/bin/env python3\n` + // at the beginning of the text. + string text = 2; + } + } + + // A barrier runnable automatically blocks the execution of subsequent + // runnables until all the tasks in the task group reach the barrier. + message Barrier { + // Barriers are identified by their index in runnable list. + // Names are not required, but if present should be an identifier. + string name = 1; + } + + // Required. The script, container, or barrier for this runnable to execute. + oneof executable { + // Container runnable. + Container container = 1; + + // Script runnable. + Script script = 2; + + // Barrier runnable. + Barrier barrier = 6; + } + + // Optional. DisplayName is an optional field that can be provided by the + // caller. If provided, it will be used in logs and other outputs to identify + // the script, making it easier for users to understand the logs. If not + // provided the index of the runnable will be used for outputs. + string display_name = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Normally, a runnable that returns a non-zero exit status fails and causes + // the task to fail. However, you can set this field to `true` to allow the + // task to continue executing its other runnables even if this runnable + // fails. + bool ignore_exit_status = 3; + + // Normally, a runnable that doesn't exit causes its task to fail. However, + // you can set this field to `true` to configure a background runnable. + // Background runnables are allowed continue running in the background while + // the task executes subsequent runnables. For example, background runnables + // are useful for providing services to other runnables or providing + // debugging-support tools like SSH servers. + // + // Specifically, background runnables are killed automatically (if they have + // not already exited) a short time after all foreground runnables have + // completed. Even though this is likely to result in a non-zero exit status + // for the background runnable, these automatic kills are not treated as task + // failures. + bool background = 4; + + // By default, after a Runnable fails, no further Runnable are executed. This + // flag indicates that this Runnable must be run even if the Task has already + // failed. This is useful for Runnables that copy output files off of the VM + // or for debugging. + // + // The always_run flag does not override the Task's overall max_run_duration. + // If the max_run_duration has expired then no further Runnables will execute, + // not even always_run Runnables. + bool always_run = 5; + + // Environment variables for this Runnable (overrides variables set for the + // whole Task or TaskGroup). + Environment environment = 7; + + // Timeout for this Runnable. + google.protobuf.Duration timeout = 8; + + // Labels for this Runnable. + map labels = 9; +} + +// Spec of a task +message TaskSpec { + // Required. The sequence of one or more runnables (executable scripts, + // executable containers, and/or barriers) for each task in this task group to + // run. Each task runs this list of runnables in order. For a task to succeed, + // all of its script and container runnables each must meet at least one of + // the following conditions: + // + // + The runnable exited with a zero status. + // + The runnable didn't finish, but you enabled its `background` subfield. + // + The runnable exited with a non-zero status, but you enabled its + // `ignore_exit_status` subfield. + repeated Runnable runnables = 8; + + // ComputeResource requirements. + ComputeResource compute_resource = 3; + + // Maximum duration the task should run before being automatically retried + // (if enabled) or automatically failed. Format the value of this field + // as a time limit in seconds followed by `s`—for example, `3600s` + // for 1 hour. The field accepts any value between 0 and the maximum listed + // for the `Duration` field type at + // https://protobuf.dev/reference/protobuf/google.protobuf/#duration; however, + // the actual maximum run time for a job will be limited to the maximum run + // time for a job listed at + // https://cloud.google.com/batch/quotas#max-job-duration. + google.protobuf.Duration max_run_duration = 4; + + // Maximum number of retries on failures. + // The default, 0, which means never retry. + // The valid value range is [0, 10]. + int32 max_retry_count = 5; + + // Lifecycle management schema when any task in a task group is failed. + // Currently we only support one lifecycle policy. + // When the lifecycle policy condition is met, + // the action in the policy will execute. + // If task execution result does not meet with the defined lifecycle + // policy, we consider it as the default policy. + // Default policy means if the exit code is 0, exit task. + // If task ends with non-zero exit code, retry the task with max_retry_count. + repeated LifecyclePolicy lifecycle_policies = 9; + + // Deprecated: please use environment(non-plural) instead. + map environments = 6 [deprecated = true]; + + // Volumes to mount before running Tasks using this TaskSpec. + repeated Volume volumes = 7; + + // Environment variables to set before running the Task. + Environment environment = 10; +} + +// LifecyclePolicy describes how to deal with task failures +// based on different conditions. +message LifecyclePolicy { + // Conditions for actions to deal with task failures. + message ActionCondition { + // Exit codes of a task execution. + // If there are more than 1 exit codes, + // when task executes with any of the exit code in the list, + // the condition is met and the action will be executed. + repeated int32 exit_codes = 1; + } + + // Action on task failures based on different conditions. + enum Action { + // Action unspecified. + ACTION_UNSPECIFIED = 0; + + // Action that tasks in the group will be scheduled to re-execute. + RETRY_TASK = 1; + + // Action that tasks in the group will be stopped immediately. + FAIL_TASK = 2; + } + + // Action to execute when ActionCondition is true. + // When RETRY_TASK is specified, we will retry failed tasks + // if we notice any exit code match and fail tasks if no match is found. + // Likewise, when FAIL_TASK is specified, we will fail tasks + // if we notice any exit code match and retry tasks if no match is found. + Action action = 1; + + // Conditions that decide why a task failure is dealt with a specific action. + ActionCondition action_condition = 2; +} + +// A Cloud Batch task. +message Task { + option (google.api.resource) = { + type: "batch.googleapis.com/Task" + pattern: "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}/tasks/{task}" + }; + + // Task name. + // The name is generated from the parent TaskGroup name and 'id' field. + // For example: + // "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01/tasks/task01". + string name = 1; + + // Task Status. + TaskStatus status = 2; +} + +// An Environment describes a collection of environment variables to set when +// executing Tasks. +message Environment { + message KMSEnvMap { + // The name of the KMS key that will be used to decrypt the cipher text. + string key_name = 1; + + // The value of the cipherText response from the `encrypt` method. + string cipher_text = 2; + } + + // A map of environment variable names to values. + map variables = 1; + + // A map of environment variable names to Secret Manager secret names. + // The VM will access the named secrets to set the value of each environment + // variable. + map secret_variables = 2; + + // An encrypted JSON dictionary where the key/value pairs correspond to + // environment variable names and their values. + KMSEnvMap encrypted_variables = 3; +} diff --git a/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/volume.proto b/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/volume.proto new file mode 100644 index 00000000000..9bf8126f634 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/volume.proto @@ -0,0 +1,80 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.batch.v1; + +option csharp_namespace = "Google.Cloud.Batch.V1"; +option go_package = "cloud.google.com/go/batch/apiv1/batchpb;batchpb"; +option java_multiple_files = true; +option java_outer_classname = "VolumeProto"; +option java_package = "com.google.cloud.batch.v1"; +option objc_class_prefix = "GCB"; +option php_namespace = "Google\\Cloud\\Batch\\V1"; +option ruby_package = "Google::Cloud::Batch::V1"; + +// Volume describes a volume and parameters for it to be mounted to a VM. +message Volume { + // The source for the volume. + oneof source { + // A Network File System (NFS) volume. For example, a + // Filestore file share. + NFS nfs = 1; + + // A Google Cloud Storage (GCS) volume. + GCS gcs = 3; + + // Device name of an attached disk volume, which should align with a + // device_name specified by + // job.allocation_policy.instances[0].policy.disks[i].device_name or + // defined by the given instance template in + // job.allocation_policy.instances[0].instance_template. + string device_name = 6; + } + + // The mount path for the volume, e.g. /mnt/disks/share. + string mount_path = 4; + + // Mount options vary based on the type of storage volume: + // + // * For a Cloud Storage bucket, all the mount options provided + // by + // the [`gcsfuse` tool](https://cloud.google.com/storage/docs/gcsfuse-cli) + // are supported. + // * For an existing persistent disk, all mount options provided by the + // [`mount` command](https://man7.org/linux/man-pages/man8/mount.8.html) + // except writing are supported. This is due to restrictions of + // [multi-writer + // mode](https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms). + // * For any other disk or a Network File System (NFS), all the + // mount options provided by the `mount` command are supported. + repeated string mount_options = 5; +} + +// Represents an NFS volume. +message NFS { + // The IP address of the NFS. + string server = 1; + + // Remote source path exported from the NFS, e.g., "/share". + string remote_path = 2; +} + +// Represents a Google Cloud Storage volume. +message GCS { + // Remote path, either a bucket name or a subdirectory of a bucket, e.g.: + // bucket_name, bucket_name/subdirectory/ + string remote_path = 1; +} diff --git a/owl-bot-staging/google-cloud-batch/v1/protos/protos.d.ts b/owl-bot-staging/google-cloud-batch/v1/protos/protos.d.ts new file mode 100644 index 00000000000..4d35440216c --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/protos/protos.d.ts @@ -0,0 +1,13321 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace batch. */ + namespace batch { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a BatchService */ + class BatchService extends $protobuf.rpc.Service { + + /** + * Constructs a new BatchService 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 BatchService 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): BatchService; + + /** + * Calls CreateJob. + * @param request CreateJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Job + */ + public createJob(request: google.cloud.batch.v1.ICreateJobRequest, callback: google.cloud.batch.v1.BatchService.CreateJobCallback): void; + + /** + * Calls CreateJob. + * @param request CreateJobRequest message or plain object + * @returns Promise + */ + public createJob(request: google.cloud.batch.v1.ICreateJobRequest): Promise; + + /** + * Calls GetJob. + * @param request GetJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Job + */ + public getJob(request: google.cloud.batch.v1.IGetJobRequest, callback: google.cloud.batch.v1.BatchService.GetJobCallback): void; + + /** + * Calls GetJob. + * @param request GetJobRequest message or plain object + * @returns Promise + */ + public getJob(request: google.cloud.batch.v1.IGetJobRequest): Promise; + + /** + * Calls DeleteJob. + * @param request DeleteJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteJob(request: google.cloud.batch.v1.IDeleteJobRequest, callback: google.cloud.batch.v1.BatchService.DeleteJobCallback): void; + + /** + * Calls DeleteJob. + * @param request DeleteJobRequest message or plain object + * @returns Promise + */ + public deleteJob(request: google.cloud.batch.v1.IDeleteJobRequest): Promise; + + /** + * Calls ListJobs. + * @param request ListJobsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListJobsResponse + */ + public listJobs(request: google.cloud.batch.v1.IListJobsRequest, callback: google.cloud.batch.v1.BatchService.ListJobsCallback): void; + + /** + * Calls ListJobs. + * @param request ListJobsRequest message or plain object + * @returns Promise + */ + public listJobs(request: google.cloud.batch.v1.IListJobsRequest): Promise; + + /** + * Calls GetTask. + * @param request GetTaskRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Task + */ + public getTask(request: google.cloud.batch.v1.IGetTaskRequest, callback: google.cloud.batch.v1.BatchService.GetTaskCallback): void; + + /** + * Calls GetTask. + * @param request GetTaskRequest message or plain object + * @returns Promise + */ + public getTask(request: google.cloud.batch.v1.IGetTaskRequest): Promise; + + /** + * Calls ListTasks. + * @param request ListTasksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTasksResponse + */ + public listTasks(request: google.cloud.batch.v1.IListTasksRequest, callback: google.cloud.batch.v1.BatchService.ListTasksCallback): void; + + /** + * Calls ListTasks. + * @param request ListTasksRequest message or plain object + * @returns Promise + */ + public listTasks(request: google.cloud.batch.v1.IListTasksRequest): Promise; + } + + namespace BatchService { + + /** + * Callback as used by {@link google.cloud.batch.v1.BatchService|createJob}. + * @param error Error, if any + * @param [response] Job + */ + type CreateJobCallback = (error: (Error|null), response?: google.cloud.batch.v1.Job) => void; + + /** + * Callback as used by {@link google.cloud.batch.v1.BatchService|getJob}. + * @param error Error, if any + * @param [response] Job + */ + type GetJobCallback = (error: (Error|null), response?: google.cloud.batch.v1.Job) => void; + + /** + * Callback as used by {@link google.cloud.batch.v1.BatchService|deleteJob}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.batch.v1.BatchService|listJobs}. + * @param error Error, if any + * @param [response] ListJobsResponse + */ + type ListJobsCallback = (error: (Error|null), response?: google.cloud.batch.v1.ListJobsResponse) => void; + + /** + * Callback as used by {@link google.cloud.batch.v1.BatchService|getTask}. + * @param error Error, if any + * @param [response] Task + */ + type GetTaskCallback = (error: (Error|null), response?: google.cloud.batch.v1.Task) => void; + + /** + * Callback as used by {@link google.cloud.batch.v1.BatchService|listTasks}. + * @param error Error, if any + * @param [response] ListTasksResponse + */ + type ListTasksCallback = (error: (Error|null), response?: google.cloud.batch.v1.ListTasksResponse) => void; + } + + /** Properties of a CreateJobRequest. */ + interface ICreateJobRequest { + + /** CreateJobRequest parent */ + parent?: (string|null); + + /** CreateJobRequest jobId */ + jobId?: (string|null); + + /** CreateJobRequest job */ + job?: (google.cloud.batch.v1.IJob|null); + + /** CreateJobRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateJobRequest. */ + class CreateJobRequest implements ICreateJobRequest { + + /** + * Constructs a new CreateJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.ICreateJobRequest); + + /** CreateJobRequest parent. */ + public parent: string; + + /** CreateJobRequest jobId. */ + public jobId: string; + + /** CreateJobRequest job. */ + public job?: (google.cloud.batch.v1.IJob|null); + + /** CreateJobRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateJobRequest instance + */ + public static create(properties?: google.cloud.batch.v1.ICreateJobRequest): google.cloud.batch.v1.CreateJobRequest; + + /** + * Encodes the specified CreateJobRequest message. Does not implicitly {@link google.cloud.batch.v1.CreateJobRequest.verify|verify} messages. + * @param message CreateJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.ICreateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.CreateJobRequest.verify|verify} messages. + * @param message CreateJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.ICreateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.CreateJobRequest; + + /** + * Decodes a CreateJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.CreateJobRequest; + + /** + * Verifies a CreateJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.CreateJobRequest; + + /** + * Creates a plain object from a CreateJobRequest message. Also converts values to other types if specified. + * @param message CreateJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.CreateJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetJobRequest. */ + interface IGetJobRequest { + + /** GetJobRequest name */ + name?: (string|null); + } + + /** Represents a GetJobRequest. */ + class GetJobRequest implements IGetJobRequest { + + /** + * Constructs a new GetJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IGetJobRequest); + + /** GetJobRequest name. */ + public name: string; + + /** + * Creates a new GetJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetJobRequest instance + */ + public static create(properties?: google.cloud.batch.v1.IGetJobRequest): google.cloud.batch.v1.GetJobRequest; + + /** + * Encodes the specified GetJobRequest message. Does not implicitly {@link google.cloud.batch.v1.GetJobRequest.verify|verify} messages. + * @param message GetJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IGetJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.GetJobRequest.verify|verify} messages. + * @param message GetJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IGetJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.GetJobRequest; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.GetJobRequest; + + /** + * Verifies a GetJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.GetJobRequest; + + /** + * Creates a plain object from a GetJobRequest message. Also converts values to other types if specified. + * @param message GetJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.GetJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteJobRequest. */ + interface IDeleteJobRequest { + + /** DeleteJobRequest name */ + name?: (string|null); + + /** DeleteJobRequest reason */ + reason?: (string|null); + + /** DeleteJobRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteJobRequest. */ + class DeleteJobRequest implements IDeleteJobRequest { + + /** + * Constructs a new DeleteJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IDeleteJobRequest); + + /** DeleteJobRequest name. */ + public name: string; + + /** DeleteJobRequest reason. */ + public reason: string; + + /** DeleteJobRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteJobRequest instance + */ + public static create(properties?: google.cloud.batch.v1.IDeleteJobRequest): google.cloud.batch.v1.DeleteJobRequest; + + /** + * Encodes the specified DeleteJobRequest message. Does not implicitly {@link google.cloud.batch.v1.DeleteJobRequest.verify|verify} messages. + * @param message DeleteJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IDeleteJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.DeleteJobRequest.verify|verify} messages. + * @param message DeleteJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IDeleteJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.DeleteJobRequest; + + /** + * Decodes a DeleteJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.DeleteJobRequest; + + /** + * Verifies a DeleteJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.DeleteJobRequest; + + /** + * Creates a plain object from a DeleteJobRequest message. Also converts values to other types if specified. + * @param message DeleteJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.DeleteJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListJobsRequest. */ + interface IListJobsRequest { + + /** ListJobsRequest parent */ + parent?: (string|null); + + /** ListJobsRequest filter */ + filter?: (string|null); + + /** ListJobsRequest orderBy */ + orderBy?: (string|null); + + /** ListJobsRequest pageSize */ + pageSize?: (number|null); + + /** ListJobsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListJobsRequest. */ + class ListJobsRequest implements IListJobsRequest { + + /** + * Constructs a new ListJobsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IListJobsRequest); + + /** ListJobsRequest parent. */ + public parent: string; + + /** ListJobsRequest filter. */ + public filter: string; + + /** ListJobsRequest orderBy. */ + public orderBy: string; + + /** ListJobsRequest pageSize. */ + public pageSize: number; + + /** ListJobsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListJobsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListJobsRequest instance + */ + public static create(properties?: google.cloud.batch.v1.IListJobsRequest): google.cloud.batch.v1.ListJobsRequest; + + /** + * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.cloud.batch.v1.ListJobsRequest.verify|verify} messages. + * @param message ListJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IListJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListJobsRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ListJobsRequest.verify|verify} messages. + * @param message ListJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IListJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.ListJobsRequest; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.ListJobsRequest; + + /** + * Verifies a ListJobsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListJobsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListJobsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.ListJobsRequest; + + /** + * Creates a plain object from a ListJobsRequest message. Also converts values to other types if specified. + * @param message ListJobsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.ListJobsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListJobsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListJobsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListJobsResponse. */ + interface IListJobsResponse { + + /** ListJobsResponse jobs */ + jobs?: (google.cloud.batch.v1.IJob[]|null); + + /** ListJobsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListJobsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListJobsResponse. */ + class ListJobsResponse implements IListJobsResponse { + + /** + * Constructs a new ListJobsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IListJobsResponse); + + /** ListJobsResponse jobs. */ + public jobs: google.cloud.batch.v1.IJob[]; + + /** ListJobsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListJobsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListJobsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListJobsResponse instance + */ + public static create(properties?: google.cloud.batch.v1.IListJobsResponse): google.cloud.batch.v1.ListJobsResponse; + + /** + * Encodes the specified ListJobsResponse message. Does not implicitly {@link google.cloud.batch.v1.ListJobsResponse.verify|verify} messages. + * @param message ListJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IListJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListJobsResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ListJobsResponse.verify|verify} messages. + * @param message ListJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IListJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.ListJobsResponse; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.ListJobsResponse; + + /** + * Verifies a ListJobsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListJobsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListJobsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.ListJobsResponse; + + /** + * Creates a plain object from a ListJobsResponse message. Also converts values to other types if specified. + * @param message ListJobsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.ListJobsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListJobsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListJobsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTasksRequest. */ + interface IListTasksRequest { + + /** ListTasksRequest parent */ + parent?: (string|null); + + /** ListTasksRequest filter */ + filter?: (string|null); + + /** ListTasksRequest pageSize */ + pageSize?: (number|null); + + /** ListTasksRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListTasksRequest. */ + class ListTasksRequest implements IListTasksRequest { + + /** + * Constructs a new ListTasksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IListTasksRequest); + + /** ListTasksRequest parent. */ + public parent: string; + + /** ListTasksRequest filter. */ + public filter: string; + + /** ListTasksRequest pageSize. */ + public pageSize: number; + + /** ListTasksRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListTasksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTasksRequest instance + */ + public static create(properties?: google.cloud.batch.v1.IListTasksRequest): google.cloud.batch.v1.ListTasksRequest; + + /** + * Encodes the specified ListTasksRequest message. Does not implicitly {@link google.cloud.batch.v1.ListTasksRequest.verify|verify} messages. + * @param message ListTasksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IListTasksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTasksRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ListTasksRequest.verify|verify} messages. + * @param message ListTasksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IListTasksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTasksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTasksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.ListTasksRequest; + + /** + * Decodes a ListTasksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTasksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.ListTasksRequest; + + /** + * Verifies a ListTasksRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTasksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTasksRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.ListTasksRequest; + + /** + * Creates a plain object from a ListTasksRequest message. Also converts values to other types if specified. + * @param message ListTasksRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.ListTasksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTasksRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTasksRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTasksResponse. */ + interface IListTasksResponse { + + /** ListTasksResponse tasks */ + tasks?: (google.cloud.batch.v1.ITask[]|null); + + /** ListTasksResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListTasksResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListTasksResponse. */ + class ListTasksResponse implements IListTasksResponse { + + /** + * Constructs a new ListTasksResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IListTasksResponse); + + /** ListTasksResponse tasks. */ + public tasks: google.cloud.batch.v1.ITask[]; + + /** ListTasksResponse nextPageToken. */ + public nextPageToken: string; + + /** ListTasksResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListTasksResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTasksResponse instance + */ + public static create(properties?: google.cloud.batch.v1.IListTasksResponse): google.cloud.batch.v1.ListTasksResponse; + + /** + * Encodes the specified ListTasksResponse message. Does not implicitly {@link google.cloud.batch.v1.ListTasksResponse.verify|verify} messages. + * @param message ListTasksResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IListTasksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTasksResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ListTasksResponse.verify|verify} messages. + * @param message ListTasksResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IListTasksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTasksResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTasksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.ListTasksResponse; + + /** + * Decodes a ListTasksResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTasksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.ListTasksResponse; + + /** + * Verifies a ListTasksResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTasksResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTasksResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.ListTasksResponse; + + /** + * Creates a plain object from a ListTasksResponse message. Also converts values to other types if specified. + * @param message ListTasksResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.ListTasksResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTasksResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTasksResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTaskRequest. */ + interface IGetTaskRequest { + + /** GetTaskRequest name */ + name?: (string|null); + } + + /** Represents a GetTaskRequest. */ + class GetTaskRequest implements IGetTaskRequest { + + /** + * Constructs a new GetTaskRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IGetTaskRequest); + + /** GetTaskRequest name. */ + public name: string; + + /** + * Creates a new GetTaskRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTaskRequest instance + */ + public static create(properties?: google.cloud.batch.v1.IGetTaskRequest): google.cloud.batch.v1.GetTaskRequest; + + /** + * Encodes the specified GetTaskRequest message. Does not implicitly {@link google.cloud.batch.v1.GetTaskRequest.verify|verify} messages. + * @param message GetTaskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IGetTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTaskRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.GetTaskRequest.verify|verify} messages. + * @param message GetTaskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IGetTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTaskRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTaskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.GetTaskRequest; + + /** + * Decodes a GetTaskRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTaskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.GetTaskRequest; + + /** + * Verifies a GetTaskRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTaskRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTaskRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.GetTaskRequest; + + /** + * Creates a plain object from a GetTaskRequest message. Also converts values to other types if specified. + * @param message GetTaskRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.GetTaskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTaskRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTaskRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IOperationMetadata); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target. */ + public target: string; + + /** OperationMetadata verb. */ + public verb: string; + + /** OperationMetadata statusMessage. */ + public statusMessage: string; + + /** OperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.batch.v1.IOperationMetadata): google.cloud.batch.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.batch.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.batch.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.OperationMetadata; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.OperationMetadata; + + /** + * Verifies an OperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.OperationMetadata; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @param message OperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Job. */ + interface IJob { + + /** Job name */ + name?: (string|null); + + /** Job uid */ + uid?: (string|null); + + /** Job priority */ + priority?: (number|Long|string|null); + + /** Job taskGroups */ + taskGroups?: (google.cloud.batch.v1.ITaskGroup[]|null); + + /** Job allocationPolicy */ + allocationPolicy?: (google.cloud.batch.v1.IAllocationPolicy|null); + + /** Job labels */ + labels?: ({ [k: string]: string }|null); + + /** Job status */ + status?: (google.cloud.batch.v1.IJobStatus|null); + + /** Job createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Job updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Job logsPolicy */ + logsPolicy?: (google.cloud.batch.v1.ILogsPolicy|null); + + /** Job notifications */ + notifications?: (google.cloud.batch.v1.IJobNotification[]|null); + } + + /** Represents a Job. */ + class Job implements IJob { + + /** + * Constructs a new Job. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IJob); + + /** Job name. */ + public name: string; + + /** Job uid. */ + public uid: string; + + /** Job priority. */ + public priority: (number|Long|string); + + /** Job taskGroups. */ + public taskGroups: google.cloud.batch.v1.ITaskGroup[]; + + /** Job allocationPolicy. */ + public allocationPolicy?: (google.cloud.batch.v1.IAllocationPolicy|null); + + /** Job labels. */ + public labels: { [k: string]: string }; + + /** Job status. */ + public status?: (google.cloud.batch.v1.IJobStatus|null); + + /** Job createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Job updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Job logsPolicy. */ + public logsPolicy?: (google.cloud.batch.v1.ILogsPolicy|null); + + /** Job notifications. */ + public notifications: google.cloud.batch.v1.IJobNotification[]; + + /** + * Creates a new Job instance using the specified properties. + * @param [properties] Properties to set + * @returns Job instance + */ + public static create(properties?: google.cloud.batch.v1.IJob): google.cloud.batch.v1.Job; + + /** + * Encodes the specified Job message. Does not implicitly {@link google.cloud.batch.v1.Job.verify|verify} messages. + * @param message Job message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Job.verify|verify} messages. + * @param message Job message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Job message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.Job; + + /** + * Decodes a Job message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.Job; + + /** + * Verifies a Job message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Job message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Job + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.Job; + + /** + * Creates a plain object from a Job message. Also converts values to other types if specified. + * @param message Job + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.Job, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Job to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Job + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LogsPolicy. */ + interface ILogsPolicy { + + /** LogsPolicy destination */ + destination?: (google.cloud.batch.v1.LogsPolicy.Destination|keyof typeof google.cloud.batch.v1.LogsPolicy.Destination|null); + + /** LogsPolicy logsPath */ + logsPath?: (string|null); + + /** LogsPolicy cloudLoggingOption */ + cloudLoggingOption?: (google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption|null); + } + + /** Represents a LogsPolicy. */ + class LogsPolicy implements ILogsPolicy { + + /** + * Constructs a new LogsPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.ILogsPolicy); + + /** LogsPolicy destination. */ + public destination: (google.cloud.batch.v1.LogsPolicy.Destination|keyof typeof google.cloud.batch.v1.LogsPolicy.Destination); + + /** LogsPolicy logsPath. */ + public logsPath: string; + + /** LogsPolicy cloudLoggingOption. */ + public cloudLoggingOption?: (google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption|null); + + /** + * Creates a new LogsPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns LogsPolicy instance + */ + public static create(properties?: google.cloud.batch.v1.ILogsPolicy): google.cloud.batch.v1.LogsPolicy; + + /** + * Encodes the specified LogsPolicy message. Does not implicitly {@link google.cloud.batch.v1.LogsPolicy.verify|verify} messages. + * @param message LogsPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.ILogsPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LogsPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.LogsPolicy.verify|verify} messages. + * @param message LogsPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.ILogsPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LogsPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LogsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.LogsPolicy; + + /** + * Decodes a LogsPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LogsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.LogsPolicy; + + /** + * Verifies a LogsPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LogsPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LogsPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.LogsPolicy; + + /** + * Creates a plain object from a LogsPolicy message. Also converts values to other types if specified. + * @param message LogsPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.LogsPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LogsPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LogsPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LogsPolicy { + + /** Properties of a CloudLoggingOption. */ + interface ICloudLoggingOption { + + /** CloudLoggingOption useGenericTaskMonitoredResource */ + useGenericTaskMonitoredResource?: (boolean|null); + } + + /** Represents a CloudLoggingOption. */ + class CloudLoggingOption implements ICloudLoggingOption { + + /** + * Constructs a new CloudLoggingOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption); + + /** CloudLoggingOption useGenericTaskMonitoredResource. */ + public useGenericTaskMonitoredResource: boolean; + + /** + * Creates a new CloudLoggingOption instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudLoggingOption instance + */ + public static create(properties?: google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption): google.cloud.batch.v1.LogsPolicy.CloudLoggingOption; + + /** + * Encodes the specified CloudLoggingOption message. Does not implicitly {@link google.cloud.batch.v1.LogsPolicy.CloudLoggingOption.verify|verify} messages. + * @param message CloudLoggingOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudLoggingOption message, length delimited. Does not implicitly {@link google.cloud.batch.v1.LogsPolicy.CloudLoggingOption.verify|verify} messages. + * @param message CloudLoggingOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudLoggingOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudLoggingOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.LogsPolicy.CloudLoggingOption; + + /** + * Decodes a CloudLoggingOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudLoggingOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.LogsPolicy.CloudLoggingOption; + + /** + * Verifies a CloudLoggingOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudLoggingOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudLoggingOption + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.LogsPolicy.CloudLoggingOption; + + /** + * Creates a plain object from a CloudLoggingOption message. Also converts values to other types if specified. + * @param message CloudLoggingOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.LogsPolicy.CloudLoggingOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudLoggingOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudLoggingOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Destination enum. */ + enum Destination { + DESTINATION_UNSPECIFIED = 0, + CLOUD_LOGGING = 1, + PATH = 2 + } + } + + /** Properties of a JobStatus. */ + interface IJobStatus { + + /** JobStatus state */ + state?: (google.cloud.batch.v1.JobStatus.State|keyof typeof google.cloud.batch.v1.JobStatus.State|null); + + /** JobStatus statusEvents */ + statusEvents?: (google.cloud.batch.v1.IStatusEvent[]|null); + + /** JobStatus taskGroups */ + taskGroups?: ({ [k: string]: google.cloud.batch.v1.JobStatus.ITaskGroupStatus }|null); + + /** JobStatus runDuration */ + runDuration?: (google.protobuf.IDuration|null); + } + + /** Represents a JobStatus. */ + class JobStatus implements IJobStatus { + + /** + * Constructs a new JobStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IJobStatus); + + /** JobStatus state. */ + public state: (google.cloud.batch.v1.JobStatus.State|keyof typeof google.cloud.batch.v1.JobStatus.State); + + /** JobStatus statusEvents. */ + public statusEvents: google.cloud.batch.v1.IStatusEvent[]; + + /** JobStatus taskGroups. */ + public taskGroups: { [k: string]: google.cloud.batch.v1.JobStatus.ITaskGroupStatus }; + + /** JobStatus runDuration. */ + public runDuration?: (google.protobuf.IDuration|null); + + /** + * Creates a new JobStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns JobStatus instance + */ + public static create(properties?: google.cloud.batch.v1.IJobStatus): google.cloud.batch.v1.JobStatus; + + /** + * Encodes the specified JobStatus message. Does not implicitly {@link google.cloud.batch.v1.JobStatus.verify|verify} messages. + * @param message JobStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IJobStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobStatus.verify|verify} messages. + * @param message JobStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IJobStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.JobStatus; + + /** + * Decodes a JobStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.JobStatus; + + /** + * Verifies a JobStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.JobStatus; + + /** + * Creates a plain object from a JobStatus message. Also converts values to other types if specified. + * @param message JobStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.JobStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace JobStatus { + + /** Properties of an InstanceStatus. */ + interface IInstanceStatus { + + /** InstanceStatus machineType */ + machineType?: (string|null); + + /** InstanceStatus provisioningModel */ + provisioningModel?: (google.cloud.batch.v1.AllocationPolicy.ProvisioningModel|keyof typeof google.cloud.batch.v1.AllocationPolicy.ProvisioningModel|null); + + /** InstanceStatus taskPack */ + taskPack?: (number|Long|string|null); + + /** InstanceStatus bootDisk */ + bootDisk?: (google.cloud.batch.v1.AllocationPolicy.IDisk|null); + } + + /** Represents an InstanceStatus. */ + class InstanceStatus implements IInstanceStatus { + + /** + * Constructs a new InstanceStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.JobStatus.IInstanceStatus); + + /** InstanceStatus machineType. */ + public machineType: string; + + /** InstanceStatus provisioningModel. */ + public provisioningModel: (google.cloud.batch.v1.AllocationPolicy.ProvisioningModel|keyof typeof google.cloud.batch.v1.AllocationPolicy.ProvisioningModel); + + /** InstanceStatus taskPack. */ + public taskPack: (number|Long|string); + + /** InstanceStatus bootDisk. */ + public bootDisk?: (google.cloud.batch.v1.AllocationPolicy.IDisk|null); + + /** + * Creates a new InstanceStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceStatus instance + */ + public static create(properties?: google.cloud.batch.v1.JobStatus.IInstanceStatus): google.cloud.batch.v1.JobStatus.InstanceStatus; + + /** + * Encodes the specified InstanceStatus message. Does not implicitly {@link google.cloud.batch.v1.JobStatus.InstanceStatus.verify|verify} messages. + * @param message InstanceStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.JobStatus.IInstanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobStatus.InstanceStatus.verify|verify} messages. + * @param message InstanceStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.JobStatus.IInstanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.JobStatus.InstanceStatus; + + /** + * Decodes an InstanceStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.JobStatus.InstanceStatus; + + /** + * Verifies an InstanceStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.JobStatus.InstanceStatus; + + /** + * Creates a plain object from an InstanceStatus message. Also converts values to other types if specified. + * @param message InstanceStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.JobStatus.InstanceStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstanceStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TaskGroupStatus. */ + interface ITaskGroupStatus { + + /** TaskGroupStatus counts */ + counts?: ({ [k: string]: (number|Long|string) }|null); + + /** TaskGroupStatus instances */ + instances?: (google.cloud.batch.v1.JobStatus.IInstanceStatus[]|null); + } + + /** Represents a TaskGroupStatus. */ + class TaskGroupStatus implements ITaskGroupStatus { + + /** + * Constructs a new TaskGroupStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.JobStatus.ITaskGroupStatus); + + /** TaskGroupStatus counts. */ + public counts: { [k: string]: (number|Long|string) }; + + /** TaskGroupStatus instances. */ + public instances: google.cloud.batch.v1.JobStatus.IInstanceStatus[]; + + /** + * Creates a new TaskGroupStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns TaskGroupStatus instance + */ + public static create(properties?: google.cloud.batch.v1.JobStatus.ITaskGroupStatus): google.cloud.batch.v1.JobStatus.TaskGroupStatus; + + /** + * Encodes the specified TaskGroupStatus message. Does not implicitly {@link google.cloud.batch.v1.JobStatus.TaskGroupStatus.verify|verify} messages. + * @param message TaskGroupStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.JobStatus.ITaskGroupStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TaskGroupStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobStatus.TaskGroupStatus.verify|verify} messages. + * @param message TaskGroupStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.JobStatus.ITaskGroupStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TaskGroupStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TaskGroupStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.JobStatus.TaskGroupStatus; + + /** + * Decodes a TaskGroupStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TaskGroupStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.JobStatus.TaskGroupStatus; + + /** + * Verifies a TaskGroupStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TaskGroupStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TaskGroupStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.JobStatus.TaskGroupStatus; + + /** + * Creates a plain object from a TaskGroupStatus message. Also converts values to other types if specified. + * @param message TaskGroupStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.JobStatus.TaskGroupStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TaskGroupStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TaskGroupStatus + * @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, + QUEUED = 1, + SCHEDULED = 2, + RUNNING = 3, + SUCCEEDED = 4, + FAILED = 5, + DELETION_IN_PROGRESS = 6 + } + } + + /** Properties of a JobNotification. */ + interface IJobNotification { + + /** JobNotification pubsubTopic */ + pubsubTopic?: (string|null); + + /** JobNotification message */ + message?: (google.cloud.batch.v1.JobNotification.IMessage|null); + } + + /** Represents a JobNotification. */ + class JobNotification implements IJobNotification { + + /** + * Constructs a new JobNotification. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IJobNotification); + + /** JobNotification pubsubTopic. */ + public pubsubTopic: string; + + /** JobNotification message. */ + public message?: (google.cloud.batch.v1.JobNotification.IMessage|null); + + /** + * Creates a new JobNotification instance using the specified properties. + * @param [properties] Properties to set + * @returns JobNotification instance + */ + public static create(properties?: google.cloud.batch.v1.IJobNotification): google.cloud.batch.v1.JobNotification; + + /** + * Encodes the specified JobNotification message. Does not implicitly {@link google.cloud.batch.v1.JobNotification.verify|verify} messages. + * @param message JobNotification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IJobNotification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobNotification message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobNotification.verify|verify} messages. + * @param message JobNotification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IJobNotification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobNotification message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobNotification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.JobNotification; + + /** + * Decodes a JobNotification message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobNotification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.JobNotification; + + /** + * Verifies a JobNotification message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobNotification message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobNotification + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.JobNotification; + + /** + * Creates a plain object from a JobNotification message. Also converts values to other types if specified. + * @param message JobNotification + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.JobNotification, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobNotification to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobNotification + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace JobNotification { + + /** Properties of a Message. */ + interface IMessage { + + /** Message type */ + type?: (google.cloud.batch.v1.JobNotification.Type|keyof typeof google.cloud.batch.v1.JobNotification.Type|null); + + /** Message newJobState */ + newJobState?: (google.cloud.batch.v1.JobStatus.State|keyof typeof google.cloud.batch.v1.JobStatus.State|null); + + /** Message newTaskState */ + newTaskState?: (google.cloud.batch.v1.TaskStatus.State|keyof typeof google.cloud.batch.v1.TaskStatus.State|null); + } + + /** Represents a Message. */ + class Message implements IMessage { + + /** + * Constructs a new Message. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.JobNotification.IMessage); + + /** Message type. */ + public type: (google.cloud.batch.v1.JobNotification.Type|keyof typeof google.cloud.batch.v1.JobNotification.Type); + + /** Message newJobState. */ + public newJobState: (google.cloud.batch.v1.JobStatus.State|keyof typeof google.cloud.batch.v1.JobStatus.State); + + /** Message newTaskState. */ + public newTaskState: (google.cloud.batch.v1.TaskStatus.State|keyof typeof google.cloud.batch.v1.TaskStatus.State); + + /** + * Creates a new Message instance using the specified properties. + * @param [properties] Properties to set + * @returns Message instance + */ + public static create(properties?: google.cloud.batch.v1.JobNotification.IMessage): google.cloud.batch.v1.JobNotification.Message; + + /** + * Encodes the specified Message message. Does not implicitly {@link google.cloud.batch.v1.JobNotification.Message.verify|verify} messages. + * @param message Message message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.JobNotification.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobNotification.Message.verify|verify} messages. + * @param message Message message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.JobNotification.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Message message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.JobNotification.Message; + + /** + * Decodes a Message message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.JobNotification.Message; + + /** + * Verifies a Message message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Message message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Message + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.JobNotification.Message; + + /** + * Creates a plain object from a Message message. Also converts values to other types if specified. + * @param message Message + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.JobNotification.Message, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Message to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Message + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + JOB_STATE_CHANGED = 1, + TASK_STATE_CHANGED = 2 + } + } + + /** Properties of an AllocationPolicy. */ + interface IAllocationPolicy { + + /** AllocationPolicy location */ + location?: (google.cloud.batch.v1.AllocationPolicy.ILocationPolicy|null); + + /** AllocationPolicy instances */ + instances?: (google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate[]|null); + + /** AllocationPolicy serviceAccount */ + serviceAccount?: (google.cloud.batch.v1.IServiceAccount|null); + + /** AllocationPolicy labels */ + labels?: ({ [k: string]: string }|null); + + /** AllocationPolicy network */ + network?: (google.cloud.batch.v1.AllocationPolicy.INetworkPolicy|null); + + /** AllocationPolicy placement */ + placement?: (google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy|null); + + /** AllocationPolicy tags */ + tags?: (string[]|null); + } + + /** Represents an AllocationPolicy. */ + class AllocationPolicy implements IAllocationPolicy { + + /** + * Constructs a new AllocationPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IAllocationPolicy); + + /** AllocationPolicy location. */ + public location?: (google.cloud.batch.v1.AllocationPolicy.ILocationPolicy|null); + + /** AllocationPolicy instances. */ + public instances: google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate[]; + + /** AllocationPolicy serviceAccount. */ + public serviceAccount?: (google.cloud.batch.v1.IServiceAccount|null); + + /** AllocationPolicy labels. */ + public labels: { [k: string]: string }; + + /** AllocationPolicy network. */ + public network?: (google.cloud.batch.v1.AllocationPolicy.INetworkPolicy|null); + + /** AllocationPolicy placement. */ + public placement?: (google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy|null); + + /** AllocationPolicy tags. */ + public tags: string[]; + + /** + * Creates a new AllocationPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns AllocationPolicy instance + */ + public static create(properties?: google.cloud.batch.v1.IAllocationPolicy): google.cloud.batch.v1.AllocationPolicy; + + /** + * Encodes the specified AllocationPolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.verify|verify} messages. + * @param message AllocationPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IAllocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AllocationPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.verify|verify} messages. + * @param message AllocationPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IAllocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AllocationPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AllocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy; + + /** + * Decodes an AllocationPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AllocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy; + + /** + * Verifies an AllocationPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AllocationPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AllocationPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy; + + /** + * Creates a plain object from an AllocationPolicy message. Also converts values to other types if specified. + * @param message AllocationPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.AllocationPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AllocationPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AllocationPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AllocationPolicy { + + /** Properties of a LocationPolicy. */ + interface ILocationPolicy { + + /** LocationPolicy allowedLocations */ + allowedLocations?: (string[]|null); + } + + /** Represents a LocationPolicy. */ + class LocationPolicy implements ILocationPolicy { + + /** + * Constructs a new LocationPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.AllocationPolicy.ILocationPolicy); + + /** LocationPolicy allowedLocations. */ + public allowedLocations: string[]; + + /** + * Creates a new LocationPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns LocationPolicy instance + */ + public static create(properties?: google.cloud.batch.v1.AllocationPolicy.ILocationPolicy): google.cloud.batch.v1.AllocationPolicy.LocationPolicy; + + /** + * Encodes the specified LocationPolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.LocationPolicy.verify|verify} messages. + * @param message LocationPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.AllocationPolicy.ILocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocationPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.LocationPolicy.verify|verify} messages. + * @param message LocationPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.AllocationPolicy.ILocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocationPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy.LocationPolicy; + + /** + * Decodes a LocationPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy.LocationPolicy; + + /** + * Verifies a LocationPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LocationPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocationPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy.LocationPolicy; + + /** + * Creates a plain object from a LocationPolicy message. Also converts values to other types if specified. + * @param message LocationPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.AllocationPolicy.LocationPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocationPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LocationPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Disk. */ + interface IDisk { + + /** Disk image */ + image?: (string|null); + + /** Disk snapshot */ + snapshot?: (string|null); + + /** Disk type */ + type?: (string|null); + + /** Disk sizeGb */ + sizeGb?: (number|Long|string|null); + + /** Disk diskInterface */ + diskInterface?: (string|null); + } + + /** Represents a Disk. */ + class Disk implements IDisk { + + /** + * Constructs a new Disk. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.AllocationPolicy.IDisk); + + /** Disk image. */ + public image?: (string|null); + + /** Disk snapshot. */ + public snapshot?: (string|null); + + /** Disk type. */ + public type: string; + + /** Disk sizeGb. */ + public sizeGb: (number|Long|string); + + /** Disk diskInterface. */ + public diskInterface: string; + + /** Disk dataSource. */ + public dataSource?: ("image"|"snapshot"); + + /** + * Creates a new Disk instance using the specified properties. + * @param [properties] Properties to set + * @returns Disk instance + */ + public static create(properties?: google.cloud.batch.v1.AllocationPolicy.IDisk): google.cloud.batch.v1.AllocationPolicy.Disk; + + /** + * Encodes the specified Disk message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.Disk.verify|verify} messages. + * @param message Disk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.AllocationPolicy.IDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Disk message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.Disk.verify|verify} messages. + * @param message Disk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.AllocationPolicy.IDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Disk message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Disk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy.Disk; + + /** + * Decodes a Disk message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Disk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy.Disk; + + /** + * Verifies a Disk message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Disk message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Disk + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy.Disk; + + /** + * Creates a plain object from a Disk message. Also converts values to other types if specified. + * @param message Disk + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.AllocationPolicy.Disk, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Disk to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Disk + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AttachedDisk. */ + interface IAttachedDisk { + + /** AttachedDisk newDisk */ + newDisk?: (google.cloud.batch.v1.AllocationPolicy.IDisk|null); + + /** AttachedDisk existingDisk */ + existingDisk?: (string|null); + + /** AttachedDisk deviceName */ + deviceName?: (string|null); + } + + /** Represents an AttachedDisk. */ + class AttachedDisk implements IAttachedDisk { + + /** + * Constructs a new AttachedDisk. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.AllocationPolicy.IAttachedDisk); + + /** AttachedDisk newDisk. */ + public newDisk?: (google.cloud.batch.v1.AllocationPolicy.IDisk|null); + + /** AttachedDisk existingDisk. */ + public existingDisk?: (string|null); + + /** AttachedDisk deviceName. */ + public deviceName: string; + + /** AttachedDisk attached. */ + public attached?: ("newDisk"|"existingDisk"); + + /** + * Creates a new AttachedDisk instance using the specified properties. + * @param [properties] Properties to set + * @returns AttachedDisk instance + */ + public static create(properties?: google.cloud.batch.v1.AllocationPolicy.IAttachedDisk): google.cloud.batch.v1.AllocationPolicy.AttachedDisk; + + /** + * Encodes the specified AttachedDisk message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.AttachedDisk.verify|verify} messages. + * @param message AttachedDisk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.AllocationPolicy.IAttachedDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttachedDisk message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.AttachedDisk.verify|verify} messages. + * @param message AttachedDisk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.AllocationPolicy.IAttachedDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttachedDisk message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttachedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy.AttachedDisk; + + /** + * Decodes an AttachedDisk message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttachedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy.AttachedDisk; + + /** + * Verifies an AttachedDisk message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AttachedDisk message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttachedDisk + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy.AttachedDisk; + + /** + * Creates a plain object from an AttachedDisk message. Also converts values to other types if specified. + * @param message AttachedDisk + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.AllocationPolicy.AttachedDisk, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttachedDisk to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AttachedDisk + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Accelerator. */ + interface IAccelerator { + + /** Accelerator type */ + type?: (string|null); + + /** Accelerator count */ + count?: (number|Long|string|null); + + /** Accelerator installGpuDrivers */ + installGpuDrivers?: (boolean|null); + + /** Accelerator driverVersion */ + driverVersion?: (string|null); + } + + /** Represents an Accelerator. */ + class Accelerator implements IAccelerator { + + /** + * Constructs a new Accelerator. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.AllocationPolicy.IAccelerator); + + /** Accelerator type. */ + public type: string; + + /** Accelerator count. */ + public count: (number|Long|string); + + /** Accelerator installGpuDrivers. */ + public installGpuDrivers: boolean; + + /** Accelerator driverVersion. */ + public driverVersion: string; + + /** + * Creates a new Accelerator instance using the specified properties. + * @param [properties] Properties to set + * @returns Accelerator instance + */ + public static create(properties?: google.cloud.batch.v1.AllocationPolicy.IAccelerator): google.cloud.batch.v1.AllocationPolicy.Accelerator; + + /** + * Encodes the specified Accelerator message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.Accelerator.verify|verify} messages. + * @param message Accelerator message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.AllocationPolicy.IAccelerator, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Accelerator message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.Accelerator.verify|verify} messages. + * @param message Accelerator message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.AllocationPolicy.IAccelerator, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Accelerator message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Accelerator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy.Accelerator; + + /** + * Decodes an Accelerator message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Accelerator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy.Accelerator; + + /** + * Verifies an Accelerator message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Accelerator message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Accelerator + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy.Accelerator; + + /** + * Creates a plain object from an Accelerator message. Also converts values to other types if specified. + * @param message Accelerator + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.AllocationPolicy.Accelerator, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Accelerator to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Accelerator + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InstancePolicy. */ + interface IInstancePolicy { + + /** InstancePolicy machineType */ + machineType?: (string|null); + + /** InstancePolicy minCpuPlatform */ + minCpuPlatform?: (string|null); + + /** InstancePolicy provisioningModel */ + provisioningModel?: (google.cloud.batch.v1.AllocationPolicy.ProvisioningModel|keyof typeof google.cloud.batch.v1.AllocationPolicy.ProvisioningModel|null); + + /** InstancePolicy accelerators */ + accelerators?: (google.cloud.batch.v1.AllocationPolicy.IAccelerator[]|null); + + /** InstancePolicy bootDisk */ + bootDisk?: (google.cloud.batch.v1.AllocationPolicy.IDisk|null); + + /** InstancePolicy disks */ + disks?: (google.cloud.batch.v1.AllocationPolicy.IAttachedDisk[]|null); + + /** InstancePolicy reservation */ + reservation?: (string|null); + } + + /** Represents an InstancePolicy. */ + class InstancePolicy implements IInstancePolicy { + + /** + * Constructs a new InstancePolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.AllocationPolicy.IInstancePolicy); + + /** InstancePolicy machineType. */ + public machineType: string; + + /** InstancePolicy minCpuPlatform. */ + public minCpuPlatform: string; + + /** InstancePolicy provisioningModel. */ + public provisioningModel: (google.cloud.batch.v1.AllocationPolicy.ProvisioningModel|keyof typeof google.cloud.batch.v1.AllocationPolicy.ProvisioningModel); + + /** InstancePolicy accelerators. */ + public accelerators: google.cloud.batch.v1.AllocationPolicy.IAccelerator[]; + + /** InstancePolicy bootDisk. */ + public bootDisk?: (google.cloud.batch.v1.AllocationPolicy.IDisk|null); + + /** InstancePolicy disks. */ + public disks: google.cloud.batch.v1.AllocationPolicy.IAttachedDisk[]; + + /** InstancePolicy reservation. */ + public reservation: string; + + /** + * Creates a new InstancePolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns InstancePolicy instance + */ + public static create(properties?: google.cloud.batch.v1.AllocationPolicy.IInstancePolicy): google.cloud.batch.v1.AllocationPolicy.InstancePolicy; + + /** + * Encodes the specified InstancePolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.InstancePolicy.verify|verify} messages. + * @param message InstancePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.AllocationPolicy.IInstancePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstancePolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.InstancePolicy.verify|verify} messages. + * @param message InstancePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.AllocationPolicy.IInstancePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstancePolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstancePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy.InstancePolicy; + + /** + * Decodes an InstancePolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstancePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy.InstancePolicy; + + /** + * Verifies an InstancePolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstancePolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstancePolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy.InstancePolicy; + + /** + * Creates a plain object from an InstancePolicy message. Also converts values to other types if specified. + * @param message InstancePolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.AllocationPolicy.InstancePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstancePolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstancePolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InstancePolicyOrTemplate. */ + interface IInstancePolicyOrTemplate { + + /** InstancePolicyOrTemplate policy */ + policy?: (google.cloud.batch.v1.AllocationPolicy.IInstancePolicy|null); + + /** InstancePolicyOrTemplate instanceTemplate */ + instanceTemplate?: (string|null); + + /** InstancePolicyOrTemplate installGpuDrivers */ + installGpuDrivers?: (boolean|null); + + /** InstancePolicyOrTemplate installOpsAgent */ + installOpsAgent?: (boolean|null); + + /** InstancePolicyOrTemplate blockProjectSshKeys */ + blockProjectSshKeys?: (boolean|null); + } + + /** Represents an InstancePolicyOrTemplate. */ + class InstancePolicyOrTemplate implements IInstancePolicyOrTemplate { + + /** + * Constructs a new InstancePolicyOrTemplate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate); + + /** InstancePolicyOrTemplate policy. */ + public policy?: (google.cloud.batch.v1.AllocationPolicy.IInstancePolicy|null); + + /** InstancePolicyOrTemplate instanceTemplate. */ + public instanceTemplate?: (string|null); + + /** InstancePolicyOrTemplate installGpuDrivers. */ + public installGpuDrivers: boolean; + + /** InstancePolicyOrTemplate installOpsAgent. */ + public installOpsAgent: boolean; + + /** InstancePolicyOrTemplate blockProjectSshKeys. */ + public blockProjectSshKeys: boolean; + + /** InstancePolicyOrTemplate policyTemplate. */ + public policyTemplate?: ("policy"|"instanceTemplate"); + + /** + * Creates a new InstancePolicyOrTemplate instance using the specified properties. + * @param [properties] Properties to set + * @returns InstancePolicyOrTemplate instance + */ + public static create(properties?: google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate): google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate; + + /** + * Encodes the specified InstancePolicyOrTemplate message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.verify|verify} messages. + * @param message InstancePolicyOrTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstancePolicyOrTemplate message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.verify|verify} messages. + * @param message InstancePolicyOrTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstancePolicyOrTemplate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstancePolicyOrTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate; + + /** + * Decodes an InstancePolicyOrTemplate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstancePolicyOrTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate; + + /** + * Verifies an InstancePolicyOrTemplate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstancePolicyOrTemplate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstancePolicyOrTemplate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate; + + /** + * Creates a plain object from an InstancePolicyOrTemplate message. Also converts values to other types if specified. + * @param message InstancePolicyOrTemplate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstancePolicyOrTemplate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstancePolicyOrTemplate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NetworkInterface. */ + interface INetworkInterface { + + /** NetworkInterface network */ + network?: (string|null); + + /** NetworkInterface subnetwork */ + subnetwork?: (string|null); + + /** NetworkInterface noExternalIpAddress */ + noExternalIpAddress?: (boolean|null); + } + + /** Represents a NetworkInterface. */ + class NetworkInterface implements INetworkInterface { + + /** + * Constructs a new NetworkInterface. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.AllocationPolicy.INetworkInterface); + + /** NetworkInterface network. */ + public network: string; + + /** NetworkInterface subnetwork. */ + public subnetwork: string; + + /** NetworkInterface noExternalIpAddress. */ + public noExternalIpAddress: boolean; + + /** + * Creates a new NetworkInterface instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkInterface instance + */ + public static create(properties?: google.cloud.batch.v1.AllocationPolicy.INetworkInterface): google.cloud.batch.v1.AllocationPolicy.NetworkInterface; + + /** + * Encodes the specified NetworkInterface message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.NetworkInterface.verify|verify} messages. + * @param message NetworkInterface message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.AllocationPolicy.INetworkInterface, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkInterface message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.NetworkInterface.verify|verify} messages. + * @param message NetworkInterface message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.AllocationPolicy.INetworkInterface, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy.NetworkInterface; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy.NetworkInterface; + + /** + * Verifies a NetworkInterface message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkInterface message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkInterface + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy.NetworkInterface; + + /** + * Creates a plain object from a NetworkInterface message. Also converts values to other types if specified. + * @param message NetworkInterface + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.AllocationPolicy.NetworkInterface, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkInterface to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NetworkInterface + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NetworkPolicy. */ + interface INetworkPolicy { + + /** NetworkPolicy networkInterfaces */ + networkInterfaces?: (google.cloud.batch.v1.AllocationPolicy.INetworkInterface[]|null); + } + + /** Represents a NetworkPolicy. */ + class NetworkPolicy implements INetworkPolicy { + + /** + * Constructs a new NetworkPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.AllocationPolicy.INetworkPolicy); + + /** NetworkPolicy networkInterfaces. */ + public networkInterfaces: google.cloud.batch.v1.AllocationPolicy.INetworkInterface[]; + + /** + * Creates a new NetworkPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkPolicy instance + */ + public static create(properties?: google.cloud.batch.v1.AllocationPolicy.INetworkPolicy): google.cloud.batch.v1.AllocationPolicy.NetworkPolicy; + + /** + * Encodes the specified NetworkPolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.verify|verify} messages. + * @param message NetworkPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.AllocationPolicy.INetworkPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.verify|verify} messages. + * @param message NetworkPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.AllocationPolicy.INetworkPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy.NetworkPolicy; + + /** + * Decodes a NetworkPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy.NetworkPolicy; + + /** + * Verifies a NetworkPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy.NetworkPolicy; + + /** + * Creates a plain object from a NetworkPolicy message. Also converts values to other types if specified. + * @param message NetworkPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.AllocationPolicy.NetworkPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NetworkPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PlacementPolicy. */ + interface IPlacementPolicy { + + /** PlacementPolicy collocation */ + collocation?: (string|null); + + /** PlacementPolicy maxDistance */ + maxDistance?: (number|Long|string|null); + } + + /** Represents a PlacementPolicy. */ + class PlacementPolicy implements IPlacementPolicy { + + /** + * Constructs a new PlacementPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy); + + /** PlacementPolicy collocation. */ + public collocation: string; + + /** PlacementPolicy maxDistance. */ + public maxDistance: (number|Long|string); + + /** + * Creates a new PlacementPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns PlacementPolicy instance + */ + public static create(properties?: google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy): google.cloud.batch.v1.AllocationPolicy.PlacementPolicy; + + /** + * Encodes the specified PlacementPolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.verify|verify} messages. + * @param message PlacementPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PlacementPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.verify|verify} messages. + * @param message PlacementPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PlacementPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PlacementPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy.PlacementPolicy; + + /** + * Decodes a PlacementPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PlacementPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy.PlacementPolicy; + + /** + * Verifies a PlacementPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PlacementPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PlacementPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy.PlacementPolicy; + + /** + * Creates a plain object from a PlacementPolicy message. Also converts values to other types if specified. + * @param message PlacementPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.AllocationPolicy.PlacementPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PlacementPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PlacementPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ProvisioningModel enum. */ + enum ProvisioningModel { + PROVISIONING_MODEL_UNSPECIFIED = 0, + STANDARD = 1, + SPOT = 2, + PREEMPTIBLE = 3 + } + } + + /** Properties of a TaskGroup. */ + interface ITaskGroup { + + /** TaskGroup name */ + name?: (string|null); + + /** TaskGroup taskSpec */ + taskSpec?: (google.cloud.batch.v1.ITaskSpec|null); + + /** TaskGroup taskCount */ + taskCount?: (number|Long|string|null); + + /** TaskGroup parallelism */ + parallelism?: (number|Long|string|null); + + /** TaskGroup schedulingPolicy */ + schedulingPolicy?: (google.cloud.batch.v1.TaskGroup.SchedulingPolicy|keyof typeof google.cloud.batch.v1.TaskGroup.SchedulingPolicy|null); + + /** TaskGroup taskEnvironments */ + taskEnvironments?: (google.cloud.batch.v1.IEnvironment[]|null); + + /** TaskGroup taskCountPerNode */ + taskCountPerNode?: (number|Long|string|null); + + /** TaskGroup requireHostsFile */ + requireHostsFile?: (boolean|null); + + /** TaskGroup permissiveSsh */ + permissiveSsh?: (boolean|null); + + /** TaskGroup runAsNonRoot */ + runAsNonRoot?: (boolean|null); + } + + /** Represents a TaskGroup. */ + class TaskGroup implements ITaskGroup { + + /** + * Constructs a new TaskGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.ITaskGroup); + + /** TaskGroup name. */ + public name: string; + + /** TaskGroup taskSpec. */ + public taskSpec?: (google.cloud.batch.v1.ITaskSpec|null); + + /** TaskGroup taskCount. */ + public taskCount: (number|Long|string); + + /** TaskGroup parallelism. */ + public parallelism: (number|Long|string); + + /** TaskGroup schedulingPolicy. */ + public schedulingPolicy: (google.cloud.batch.v1.TaskGroup.SchedulingPolicy|keyof typeof google.cloud.batch.v1.TaskGroup.SchedulingPolicy); + + /** TaskGroup taskEnvironments. */ + public taskEnvironments: google.cloud.batch.v1.IEnvironment[]; + + /** TaskGroup taskCountPerNode. */ + public taskCountPerNode: (number|Long|string); + + /** TaskGroup requireHostsFile. */ + public requireHostsFile: boolean; + + /** TaskGroup permissiveSsh. */ + public permissiveSsh: boolean; + + /** TaskGroup runAsNonRoot. */ + public runAsNonRoot: boolean; + + /** + * Creates a new TaskGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns TaskGroup instance + */ + public static create(properties?: google.cloud.batch.v1.ITaskGroup): google.cloud.batch.v1.TaskGroup; + + /** + * Encodes the specified TaskGroup message. Does not implicitly {@link google.cloud.batch.v1.TaskGroup.verify|verify} messages. + * @param message TaskGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.ITaskGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TaskGroup message, length delimited. Does not implicitly {@link google.cloud.batch.v1.TaskGroup.verify|verify} messages. + * @param message TaskGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.ITaskGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TaskGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TaskGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.TaskGroup; + + /** + * Decodes a TaskGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TaskGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.TaskGroup; + + /** + * Verifies a TaskGroup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TaskGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TaskGroup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.TaskGroup; + + /** + * Creates a plain object from a TaskGroup message. Also converts values to other types if specified. + * @param message TaskGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.TaskGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TaskGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TaskGroup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TaskGroup { + + /** SchedulingPolicy enum. */ + enum SchedulingPolicy { + SCHEDULING_POLICY_UNSPECIFIED = 0, + AS_SOON_AS_POSSIBLE = 1, + IN_ORDER = 2 + } + } + + /** Properties of a ServiceAccount. */ + interface IServiceAccount { + + /** ServiceAccount email */ + email?: (string|null); + + /** ServiceAccount scopes */ + scopes?: (string[]|null); + } + + /** Represents a ServiceAccount. */ + class ServiceAccount implements IServiceAccount { + + /** + * Constructs a new ServiceAccount. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IServiceAccount); + + /** ServiceAccount email. */ + public email: string; + + /** ServiceAccount scopes. */ + public scopes: string[]; + + /** + * Creates a new ServiceAccount instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceAccount instance + */ + public static create(properties?: google.cloud.batch.v1.IServiceAccount): google.cloud.batch.v1.ServiceAccount; + + /** + * Encodes the specified ServiceAccount message. Does not implicitly {@link google.cloud.batch.v1.ServiceAccount.verify|verify} messages. + * @param message ServiceAccount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IServiceAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceAccount message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ServiceAccount.verify|verify} messages. + * @param message ServiceAccount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IServiceAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceAccount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.ServiceAccount; + + /** + * Decodes a ServiceAccount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.ServiceAccount; + + /** + * Verifies a ServiceAccount message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceAccount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceAccount + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.ServiceAccount; + + /** + * Creates a plain object from a ServiceAccount message. Also converts values to other types if specified. + * @param message ServiceAccount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.ServiceAccount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceAccount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceAccount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ComputeResource. */ + interface IComputeResource { + + /** ComputeResource cpuMilli */ + cpuMilli?: (number|Long|string|null); + + /** ComputeResource memoryMib */ + memoryMib?: (number|Long|string|null); + + /** ComputeResource bootDiskMib */ + bootDiskMib?: (number|Long|string|null); + } + + /** Represents a ComputeResource. */ + class ComputeResource implements IComputeResource { + + /** + * Constructs a new ComputeResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IComputeResource); + + /** ComputeResource cpuMilli. */ + public cpuMilli: (number|Long|string); + + /** ComputeResource memoryMib. */ + public memoryMib: (number|Long|string); + + /** ComputeResource bootDiskMib. */ + public bootDiskMib: (number|Long|string); + + /** + * Creates a new ComputeResource instance using the specified properties. + * @param [properties] Properties to set + * @returns ComputeResource instance + */ + public static create(properties?: google.cloud.batch.v1.IComputeResource): google.cloud.batch.v1.ComputeResource; + + /** + * Encodes the specified ComputeResource message. Does not implicitly {@link google.cloud.batch.v1.ComputeResource.verify|verify} messages. + * @param message ComputeResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IComputeResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ComputeResource message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ComputeResource.verify|verify} messages. + * @param message ComputeResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IComputeResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ComputeResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ComputeResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.ComputeResource; + + /** + * Decodes a ComputeResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ComputeResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.ComputeResource; + + /** + * Verifies a ComputeResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ComputeResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ComputeResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.ComputeResource; + + /** + * Creates a plain object from a ComputeResource message. Also converts values to other types if specified. + * @param message ComputeResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.ComputeResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ComputeResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ComputeResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StatusEvent. */ + interface IStatusEvent { + + /** StatusEvent type */ + type?: (string|null); + + /** StatusEvent description */ + description?: (string|null); + + /** StatusEvent eventTime */ + eventTime?: (google.protobuf.ITimestamp|null); + + /** StatusEvent taskExecution */ + taskExecution?: (google.cloud.batch.v1.ITaskExecution|null); + + /** StatusEvent taskState */ + taskState?: (google.cloud.batch.v1.TaskStatus.State|keyof typeof google.cloud.batch.v1.TaskStatus.State|null); + } + + /** Represents a StatusEvent. */ + class StatusEvent implements IStatusEvent { + + /** + * Constructs a new StatusEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IStatusEvent); + + /** StatusEvent type. */ + public type: string; + + /** StatusEvent description. */ + public description: string; + + /** StatusEvent eventTime. */ + public eventTime?: (google.protobuf.ITimestamp|null); + + /** StatusEvent taskExecution. */ + public taskExecution?: (google.cloud.batch.v1.ITaskExecution|null); + + /** StatusEvent taskState. */ + public taskState: (google.cloud.batch.v1.TaskStatus.State|keyof typeof google.cloud.batch.v1.TaskStatus.State); + + /** + * Creates a new StatusEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns StatusEvent instance + */ + public static create(properties?: google.cloud.batch.v1.IStatusEvent): google.cloud.batch.v1.StatusEvent; + + /** + * Encodes the specified StatusEvent message. Does not implicitly {@link google.cloud.batch.v1.StatusEvent.verify|verify} messages. + * @param message StatusEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IStatusEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StatusEvent message, length delimited. Does not implicitly {@link google.cloud.batch.v1.StatusEvent.verify|verify} messages. + * @param message StatusEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IStatusEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StatusEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StatusEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.StatusEvent; + + /** + * Decodes a StatusEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StatusEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.StatusEvent; + + /** + * Verifies a StatusEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StatusEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StatusEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.StatusEvent; + + /** + * Creates a plain object from a StatusEvent message. Also converts values to other types if specified. + * @param message StatusEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.StatusEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StatusEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StatusEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TaskExecution. */ + interface ITaskExecution { + + /** TaskExecution exitCode */ + exitCode?: (number|null); + } + + /** Represents a TaskExecution. */ + class TaskExecution implements ITaskExecution { + + /** + * Constructs a new TaskExecution. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.ITaskExecution); + + /** TaskExecution exitCode. */ + public exitCode: number; + + /** + * Creates a new TaskExecution instance using the specified properties. + * @param [properties] Properties to set + * @returns TaskExecution instance + */ + public static create(properties?: google.cloud.batch.v1.ITaskExecution): google.cloud.batch.v1.TaskExecution; + + /** + * Encodes the specified TaskExecution message. Does not implicitly {@link google.cloud.batch.v1.TaskExecution.verify|verify} messages. + * @param message TaskExecution message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.ITaskExecution, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TaskExecution message, length delimited. Does not implicitly {@link google.cloud.batch.v1.TaskExecution.verify|verify} messages. + * @param message TaskExecution message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.ITaskExecution, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TaskExecution message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TaskExecution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.TaskExecution; + + /** + * Decodes a TaskExecution message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TaskExecution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.TaskExecution; + + /** + * Verifies a TaskExecution message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TaskExecution message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TaskExecution + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.TaskExecution; + + /** + * Creates a plain object from a TaskExecution message. Also converts values to other types if specified. + * @param message TaskExecution + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.TaskExecution, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TaskExecution to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TaskExecution + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TaskStatus. */ + interface ITaskStatus { + + /** TaskStatus state */ + state?: (google.cloud.batch.v1.TaskStatus.State|keyof typeof google.cloud.batch.v1.TaskStatus.State|null); + + /** TaskStatus statusEvents */ + statusEvents?: (google.cloud.batch.v1.IStatusEvent[]|null); + } + + /** Represents a TaskStatus. */ + class TaskStatus implements ITaskStatus { + + /** + * Constructs a new TaskStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.ITaskStatus); + + /** TaskStatus state. */ + public state: (google.cloud.batch.v1.TaskStatus.State|keyof typeof google.cloud.batch.v1.TaskStatus.State); + + /** TaskStatus statusEvents. */ + public statusEvents: google.cloud.batch.v1.IStatusEvent[]; + + /** + * Creates a new TaskStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns TaskStatus instance + */ + public static create(properties?: google.cloud.batch.v1.ITaskStatus): google.cloud.batch.v1.TaskStatus; + + /** + * Encodes the specified TaskStatus message. Does not implicitly {@link google.cloud.batch.v1.TaskStatus.verify|verify} messages. + * @param message TaskStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.ITaskStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TaskStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1.TaskStatus.verify|verify} messages. + * @param message TaskStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.ITaskStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TaskStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TaskStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.TaskStatus; + + /** + * Decodes a TaskStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TaskStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.TaskStatus; + + /** + * Verifies a TaskStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TaskStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TaskStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.TaskStatus; + + /** + * Creates a plain object from a TaskStatus message. Also converts values to other types if specified. + * @param message TaskStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.TaskStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TaskStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TaskStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TaskStatus { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PENDING = 1, + ASSIGNED = 2, + RUNNING = 3, + FAILED = 4, + SUCCEEDED = 5, + UNEXECUTED = 6 + } + } + + /** Properties of a Runnable. */ + interface IRunnable { + + /** Runnable container */ + container?: (google.cloud.batch.v1.Runnable.IContainer|null); + + /** Runnable script */ + script?: (google.cloud.batch.v1.Runnable.IScript|null); + + /** Runnable barrier */ + barrier?: (google.cloud.batch.v1.Runnable.IBarrier|null); + + /** Runnable displayName */ + displayName?: (string|null); + + /** Runnable ignoreExitStatus */ + ignoreExitStatus?: (boolean|null); + + /** Runnable background */ + background?: (boolean|null); + + /** Runnable alwaysRun */ + alwaysRun?: (boolean|null); + + /** Runnable environment */ + environment?: (google.cloud.batch.v1.IEnvironment|null); + + /** Runnable timeout */ + timeout?: (google.protobuf.IDuration|null); + + /** Runnable labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a Runnable. */ + class Runnable implements IRunnable { + + /** + * Constructs a new Runnable. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IRunnable); + + /** Runnable container. */ + public container?: (google.cloud.batch.v1.Runnable.IContainer|null); + + /** Runnable script. */ + public script?: (google.cloud.batch.v1.Runnable.IScript|null); + + /** Runnable barrier. */ + public barrier?: (google.cloud.batch.v1.Runnable.IBarrier|null); + + /** Runnable displayName. */ + public displayName: string; + + /** Runnable ignoreExitStatus. */ + public ignoreExitStatus: boolean; + + /** Runnable background. */ + public background: boolean; + + /** Runnable alwaysRun. */ + public alwaysRun: boolean; + + /** Runnable environment. */ + public environment?: (google.cloud.batch.v1.IEnvironment|null); + + /** Runnable timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** Runnable labels. */ + public labels: { [k: string]: string }; + + /** Runnable executable. */ + public executable?: ("container"|"script"|"barrier"); + + /** + * Creates a new Runnable instance using the specified properties. + * @param [properties] Properties to set + * @returns Runnable instance + */ + public static create(properties?: google.cloud.batch.v1.IRunnable): google.cloud.batch.v1.Runnable; + + /** + * Encodes the specified Runnable message. Does not implicitly {@link google.cloud.batch.v1.Runnable.verify|verify} messages. + * @param message Runnable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IRunnable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Runnable message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Runnable.verify|verify} messages. + * @param message Runnable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IRunnable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Runnable message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Runnable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.Runnable; + + /** + * Decodes a Runnable message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Runnable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.Runnable; + + /** + * Verifies a Runnable message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Runnable message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Runnable + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.Runnable; + + /** + * Creates a plain object from a Runnable message. Also converts values to other types if specified. + * @param message Runnable + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.Runnable, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Runnable to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Runnable + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Runnable { + + /** Properties of a Container. */ + interface IContainer { + + /** Container imageUri */ + imageUri?: (string|null); + + /** Container commands */ + commands?: (string[]|null); + + /** Container entrypoint */ + entrypoint?: (string|null); + + /** Container volumes */ + volumes?: (string[]|null); + + /** Container options */ + options?: (string|null); + + /** Container blockExternalNetwork */ + blockExternalNetwork?: (boolean|null); + + /** Container username */ + username?: (string|null); + + /** Container password */ + password?: (string|null); + + /** Container enableImageStreaming */ + enableImageStreaming?: (boolean|null); + } + + /** Represents a Container. */ + class Container implements IContainer { + + /** + * Constructs a new Container. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.Runnable.IContainer); + + /** Container imageUri. */ + public imageUri: string; + + /** Container commands. */ + public commands: string[]; + + /** Container entrypoint. */ + public entrypoint: string; + + /** Container volumes. */ + public volumes: string[]; + + /** Container options. */ + public options: string; + + /** Container blockExternalNetwork. */ + public blockExternalNetwork: boolean; + + /** Container username. */ + public username: string; + + /** Container password. */ + public password: string; + + /** Container enableImageStreaming. */ + public enableImageStreaming: boolean; + + /** + * Creates a new Container instance using the specified properties. + * @param [properties] Properties to set + * @returns Container instance + */ + public static create(properties?: google.cloud.batch.v1.Runnable.IContainer): google.cloud.batch.v1.Runnable.Container; + + /** + * Encodes the specified Container message. Does not implicitly {@link google.cloud.batch.v1.Runnable.Container.verify|verify} messages. + * @param message Container message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.Runnable.IContainer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Container message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Runnable.Container.verify|verify} messages. + * @param message Container message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.Runnable.IContainer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Container message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Container + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.Runnable.Container; + + /** + * Decodes a Container message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Container + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.Runnable.Container; + + /** + * Verifies a Container message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Container message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Container + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.Runnable.Container; + + /** + * Creates a plain object from a Container message. Also converts values to other types if specified. + * @param message Container + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.Runnable.Container, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Container to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Container + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Script. */ + interface IScript { + + /** Script path */ + path?: (string|null); + + /** Script text */ + text?: (string|null); + } + + /** Represents a Script. */ + class Script implements IScript { + + /** + * Constructs a new Script. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.Runnable.IScript); + + /** Script path. */ + public path?: (string|null); + + /** Script text. */ + public text?: (string|null); + + /** Script command. */ + public command?: ("path"|"text"); + + /** + * Creates a new Script instance using the specified properties. + * @param [properties] Properties to set + * @returns Script instance + */ + public static create(properties?: google.cloud.batch.v1.Runnable.IScript): google.cloud.batch.v1.Runnable.Script; + + /** + * Encodes the specified Script message. Does not implicitly {@link google.cloud.batch.v1.Runnable.Script.verify|verify} messages. + * @param message Script message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.Runnable.IScript, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Script message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Runnable.Script.verify|verify} messages. + * @param message Script message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.Runnable.IScript, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Script message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Script + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.Runnable.Script; + + /** + * Decodes a Script message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Script + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.Runnable.Script; + + /** + * Verifies a Script message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Script message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Script + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.Runnable.Script; + + /** + * Creates a plain object from a Script message. Also converts values to other types if specified. + * @param message Script + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.Runnable.Script, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Script to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Script + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Barrier. */ + interface IBarrier { + + /** Barrier name */ + name?: (string|null); + } + + /** Represents a Barrier. */ + class Barrier implements IBarrier { + + /** + * Constructs a new Barrier. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.Runnable.IBarrier); + + /** Barrier name. */ + public name: string; + + /** + * Creates a new Barrier instance using the specified properties. + * @param [properties] Properties to set + * @returns Barrier instance + */ + public static create(properties?: google.cloud.batch.v1.Runnable.IBarrier): google.cloud.batch.v1.Runnable.Barrier; + + /** + * Encodes the specified Barrier message. Does not implicitly {@link google.cloud.batch.v1.Runnable.Barrier.verify|verify} messages. + * @param message Barrier message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.Runnable.IBarrier, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Barrier message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Runnable.Barrier.verify|verify} messages. + * @param message Barrier message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.Runnable.IBarrier, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Barrier message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Barrier + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.Runnable.Barrier; + + /** + * Decodes a Barrier message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Barrier + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.Runnable.Barrier; + + /** + * Verifies a Barrier message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Barrier message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Barrier + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.Runnable.Barrier; + + /** + * Creates a plain object from a Barrier message. Also converts values to other types if specified. + * @param message Barrier + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.Runnable.Barrier, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Barrier to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Barrier + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TaskSpec. */ + interface ITaskSpec { + + /** TaskSpec runnables */ + runnables?: (google.cloud.batch.v1.IRunnable[]|null); + + /** TaskSpec computeResource */ + computeResource?: (google.cloud.batch.v1.IComputeResource|null); + + /** TaskSpec maxRunDuration */ + maxRunDuration?: (google.protobuf.IDuration|null); + + /** TaskSpec maxRetryCount */ + maxRetryCount?: (number|null); + + /** TaskSpec lifecyclePolicies */ + lifecyclePolicies?: (google.cloud.batch.v1.ILifecyclePolicy[]|null); + + /** TaskSpec environments */ + environments?: ({ [k: string]: string }|null); + + /** TaskSpec volumes */ + volumes?: (google.cloud.batch.v1.IVolume[]|null); + + /** TaskSpec environment */ + environment?: (google.cloud.batch.v1.IEnvironment|null); + } + + /** Represents a TaskSpec. */ + class TaskSpec implements ITaskSpec { + + /** + * Constructs a new TaskSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.ITaskSpec); + + /** TaskSpec runnables. */ + public runnables: google.cloud.batch.v1.IRunnable[]; + + /** TaskSpec computeResource. */ + public computeResource?: (google.cloud.batch.v1.IComputeResource|null); + + /** TaskSpec maxRunDuration. */ + public maxRunDuration?: (google.protobuf.IDuration|null); + + /** TaskSpec maxRetryCount. */ + public maxRetryCount: number; + + /** TaskSpec lifecyclePolicies. */ + public lifecyclePolicies: google.cloud.batch.v1.ILifecyclePolicy[]; + + /** TaskSpec environments. */ + public environments: { [k: string]: string }; + + /** TaskSpec volumes. */ + public volumes: google.cloud.batch.v1.IVolume[]; + + /** TaskSpec environment. */ + public environment?: (google.cloud.batch.v1.IEnvironment|null); + + /** + * Creates a new TaskSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns TaskSpec instance + */ + public static create(properties?: google.cloud.batch.v1.ITaskSpec): google.cloud.batch.v1.TaskSpec; + + /** + * Encodes the specified TaskSpec message. Does not implicitly {@link google.cloud.batch.v1.TaskSpec.verify|verify} messages. + * @param message TaskSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.ITaskSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TaskSpec message, length delimited. Does not implicitly {@link google.cloud.batch.v1.TaskSpec.verify|verify} messages. + * @param message TaskSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.ITaskSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TaskSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TaskSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.TaskSpec; + + /** + * Decodes a TaskSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TaskSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.TaskSpec; + + /** + * Verifies a TaskSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TaskSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TaskSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.TaskSpec; + + /** + * Creates a plain object from a TaskSpec message. Also converts values to other types if specified. + * @param message TaskSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.TaskSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TaskSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TaskSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LifecyclePolicy. */ + interface ILifecyclePolicy { + + /** LifecyclePolicy action */ + action?: (google.cloud.batch.v1.LifecyclePolicy.Action|keyof typeof google.cloud.batch.v1.LifecyclePolicy.Action|null); + + /** LifecyclePolicy actionCondition */ + actionCondition?: (google.cloud.batch.v1.LifecyclePolicy.IActionCondition|null); + } + + /** Represents a LifecyclePolicy. */ + class LifecyclePolicy implements ILifecyclePolicy { + + /** + * Constructs a new LifecyclePolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.ILifecyclePolicy); + + /** LifecyclePolicy action. */ + public action: (google.cloud.batch.v1.LifecyclePolicy.Action|keyof typeof google.cloud.batch.v1.LifecyclePolicy.Action); + + /** LifecyclePolicy actionCondition. */ + public actionCondition?: (google.cloud.batch.v1.LifecyclePolicy.IActionCondition|null); + + /** + * Creates a new LifecyclePolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns LifecyclePolicy instance + */ + public static create(properties?: google.cloud.batch.v1.ILifecyclePolicy): google.cloud.batch.v1.LifecyclePolicy; + + /** + * Encodes the specified LifecyclePolicy message. Does not implicitly {@link google.cloud.batch.v1.LifecyclePolicy.verify|verify} messages. + * @param message LifecyclePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.ILifecyclePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LifecyclePolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.LifecyclePolicy.verify|verify} messages. + * @param message LifecyclePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.ILifecyclePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LifecyclePolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LifecyclePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.LifecyclePolicy; + + /** + * Decodes a LifecyclePolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LifecyclePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.LifecyclePolicy; + + /** + * Verifies a LifecyclePolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LifecyclePolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LifecyclePolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.LifecyclePolicy; + + /** + * Creates a plain object from a LifecyclePolicy message. Also converts values to other types if specified. + * @param message LifecyclePolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.LifecyclePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LifecyclePolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LifecyclePolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LifecyclePolicy { + + /** Properties of an ActionCondition. */ + interface IActionCondition { + + /** ActionCondition exitCodes */ + exitCodes?: (number[]|null); + } + + /** Represents an ActionCondition. */ + class ActionCondition implements IActionCondition { + + /** + * Constructs a new ActionCondition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.LifecyclePolicy.IActionCondition); + + /** ActionCondition exitCodes. */ + public exitCodes: number[]; + + /** + * Creates a new ActionCondition instance using the specified properties. + * @param [properties] Properties to set + * @returns ActionCondition instance + */ + public static create(properties?: google.cloud.batch.v1.LifecyclePolicy.IActionCondition): google.cloud.batch.v1.LifecyclePolicy.ActionCondition; + + /** + * Encodes the specified ActionCondition message. Does not implicitly {@link google.cloud.batch.v1.LifecyclePolicy.ActionCondition.verify|verify} messages. + * @param message ActionCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.LifecyclePolicy.IActionCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ActionCondition message, length delimited. Does not implicitly {@link google.cloud.batch.v1.LifecyclePolicy.ActionCondition.verify|verify} messages. + * @param message ActionCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.LifecyclePolicy.IActionCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ActionCondition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ActionCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.LifecyclePolicy.ActionCondition; + + /** + * Decodes an ActionCondition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ActionCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.LifecyclePolicy.ActionCondition; + + /** + * Verifies an ActionCondition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ActionCondition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ActionCondition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.LifecyclePolicy.ActionCondition; + + /** + * Creates a plain object from an ActionCondition message. Also converts values to other types if specified. + * @param message ActionCondition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.LifecyclePolicy.ActionCondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ActionCondition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ActionCondition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + RETRY_TASK = 1, + FAIL_TASK = 2 + } + } + + /** Properties of a Task. */ + interface ITask { + + /** Task name */ + name?: (string|null); + + /** Task status */ + status?: (google.cloud.batch.v1.ITaskStatus|null); + } + + /** Represents a Task. */ + class Task implements ITask { + + /** + * Constructs a new Task. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.ITask); + + /** Task name. */ + public name: string; + + /** Task status. */ + public status?: (google.cloud.batch.v1.ITaskStatus|null); + + /** + * Creates a new Task instance using the specified properties. + * @param [properties] Properties to set + * @returns Task instance + */ + public static create(properties?: google.cloud.batch.v1.ITask): google.cloud.batch.v1.Task; + + /** + * Encodes the specified Task message. Does not implicitly {@link google.cloud.batch.v1.Task.verify|verify} messages. + * @param message Task message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.ITask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Task message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Task.verify|verify} messages. + * @param message Task message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.ITask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Task message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Task + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.Task; + + /** + * Decodes a Task message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Task + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.Task; + + /** + * Verifies a Task message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Task message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Task + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.Task; + + /** + * Creates a plain object from a Task message. Also converts values to other types if specified. + * @param message Task + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.Task, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Task to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Task + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Environment. */ + interface IEnvironment { + + /** Environment variables */ + variables?: ({ [k: string]: string }|null); + + /** Environment secretVariables */ + secretVariables?: ({ [k: string]: string }|null); + + /** Environment encryptedVariables */ + encryptedVariables?: (google.cloud.batch.v1.Environment.IKMSEnvMap|null); + } + + /** Represents an Environment. */ + class Environment implements IEnvironment { + + /** + * Constructs a new Environment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IEnvironment); + + /** Environment variables. */ + public variables: { [k: string]: string }; + + /** Environment secretVariables. */ + public secretVariables: { [k: string]: string }; + + /** Environment encryptedVariables. */ + public encryptedVariables?: (google.cloud.batch.v1.Environment.IKMSEnvMap|null); + + /** + * Creates a new Environment instance using the specified properties. + * @param [properties] Properties to set + * @returns Environment instance + */ + public static create(properties?: google.cloud.batch.v1.IEnvironment): google.cloud.batch.v1.Environment; + + /** + * Encodes the specified Environment message. Does not implicitly {@link google.cloud.batch.v1.Environment.verify|verify} messages. + * @param message Environment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Environment.verify|verify} messages. + * @param message Environment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Environment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.Environment; + + /** + * Decodes an Environment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.Environment; + + /** + * Verifies an Environment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Environment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Environment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.Environment; + + /** + * Creates a plain object from an Environment message. Also converts values to other types if specified. + * @param message Environment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.Environment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Environment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Environment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Environment { + + /** Properties of a KMSEnvMap. */ + interface IKMSEnvMap { + + /** KMSEnvMap keyName */ + keyName?: (string|null); + + /** KMSEnvMap cipherText */ + cipherText?: (string|null); + } + + /** Represents a KMSEnvMap. */ + class KMSEnvMap implements IKMSEnvMap { + + /** + * Constructs a new KMSEnvMap. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.Environment.IKMSEnvMap); + + /** KMSEnvMap keyName. */ + public keyName: string; + + /** KMSEnvMap cipherText. */ + public cipherText: string; + + /** + * Creates a new KMSEnvMap instance using the specified properties. + * @param [properties] Properties to set + * @returns KMSEnvMap instance + */ + public static create(properties?: google.cloud.batch.v1.Environment.IKMSEnvMap): google.cloud.batch.v1.Environment.KMSEnvMap; + + /** + * Encodes the specified KMSEnvMap message. Does not implicitly {@link google.cloud.batch.v1.Environment.KMSEnvMap.verify|verify} messages. + * @param message KMSEnvMap message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.Environment.IKMSEnvMap, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KMSEnvMap message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Environment.KMSEnvMap.verify|verify} messages. + * @param message KMSEnvMap message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.Environment.IKMSEnvMap, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KMSEnvMap message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KMSEnvMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.Environment.KMSEnvMap; + + /** + * Decodes a KMSEnvMap message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KMSEnvMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.Environment.KMSEnvMap; + + /** + * Verifies a KMSEnvMap message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a KMSEnvMap message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KMSEnvMap + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.Environment.KMSEnvMap; + + /** + * Creates a plain object from a KMSEnvMap message. Also converts values to other types if specified. + * @param message KMSEnvMap + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.Environment.KMSEnvMap, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KMSEnvMap to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KMSEnvMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Volume. */ + interface IVolume { + + /** Volume nfs */ + nfs?: (google.cloud.batch.v1.INFS|null); + + /** Volume gcs */ + gcs?: (google.cloud.batch.v1.IGCS|null); + + /** Volume deviceName */ + deviceName?: (string|null); + + /** Volume mountPath */ + mountPath?: (string|null); + + /** Volume mountOptions */ + mountOptions?: (string[]|null); + } + + /** Represents a Volume. */ + class Volume implements IVolume { + + /** + * Constructs a new Volume. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IVolume); + + /** Volume nfs. */ + public nfs?: (google.cloud.batch.v1.INFS|null); + + /** Volume gcs. */ + public gcs?: (google.cloud.batch.v1.IGCS|null); + + /** Volume deviceName. */ + public deviceName?: (string|null); + + /** Volume mountPath. */ + public mountPath: string; + + /** Volume mountOptions. */ + public mountOptions: string[]; + + /** Volume source. */ + public source?: ("nfs"|"gcs"|"deviceName"); + + /** + * Creates a new Volume instance using the specified properties. + * @param [properties] Properties to set + * @returns Volume instance + */ + public static create(properties?: google.cloud.batch.v1.IVolume): google.cloud.batch.v1.Volume; + + /** + * Encodes the specified Volume message. Does not implicitly {@link google.cloud.batch.v1.Volume.verify|verify} messages. + * @param message Volume message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IVolume, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Volume message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Volume.verify|verify} messages. + * @param message Volume message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IVolume, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Volume message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Volume + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.Volume; + + /** + * Decodes a Volume message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Volume + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.Volume; + + /** + * Verifies a Volume message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Volume message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Volume + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.Volume; + + /** + * Creates a plain object from a Volume message. Also converts values to other types if specified. + * @param message Volume + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.Volume, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Volume to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Volume + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NFS. */ + interface INFS { + + /** NFS server */ + server?: (string|null); + + /** NFS remotePath */ + remotePath?: (string|null); + } + + /** Represents a NFS. */ + class NFS implements INFS { + + /** + * Constructs a new NFS. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.INFS); + + /** NFS server. */ + public server: string; + + /** NFS remotePath. */ + public remotePath: string; + + /** + * Creates a new NFS instance using the specified properties. + * @param [properties] Properties to set + * @returns NFS instance + */ + public static create(properties?: google.cloud.batch.v1.INFS): google.cloud.batch.v1.NFS; + + /** + * Encodes the specified NFS message. Does not implicitly {@link google.cloud.batch.v1.NFS.verify|verify} messages. + * @param message NFS message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.INFS, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NFS message, length delimited. Does not implicitly {@link google.cloud.batch.v1.NFS.verify|verify} messages. + * @param message NFS message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.INFS, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NFS message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NFS + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.NFS; + + /** + * Decodes a NFS message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NFS + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.NFS; + + /** + * Verifies a NFS message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NFS message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NFS + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.NFS; + + /** + * Creates a plain object from a NFS message. Also converts values to other types if specified. + * @param message NFS + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.NFS, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NFS to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NFS + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GCS. */ + interface IGCS { + + /** GCS remotePath */ + remotePath?: (string|null); + } + + /** Represents a GCS. */ + class GCS implements IGCS { + + /** + * Constructs a new GCS. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IGCS); + + /** GCS remotePath. */ + public remotePath: string; + + /** + * Creates a new GCS instance using the specified properties. + * @param [properties] Properties to set + * @returns GCS instance + */ + public static create(properties?: google.cloud.batch.v1.IGCS): google.cloud.batch.v1.GCS; + + /** + * Encodes the specified GCS message. Does not implicitly {@link google.cloud.batch.v1.GCS.verify|verify} messages. + * @param message GCS message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IGCS, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GCS message, length delimited. Does not implicitly {@link google.cloud.batch.v1.GCS.verify|verify} messages. + * @param message GCS message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IGCS, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GCS message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GCS + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.GCS; + + /** + * Decodes a GCS message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GCS + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.GCS; + + /** + * Verifies a GCS message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GCS message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GCS + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.GCS; + + /** + * Creates a plain object from a GCS message. Also converts values to other types if specified. + * @param message GCS + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.GCS, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GCS to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GCS + * @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); + } + + /** Represents a CommonLanguageSettings. */ + class CommonLanguageSettings implements ICommonLanguageSettings { + + /** + * Constructs a new CommonLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICommonLanguageSettings); + + /** CommonLanguageSettings referenceDocsUri. */ + public referenceDocsUri: string; + + /** CommonLanguageSettings destinations. */ + public destinations: google.api.ClientLibraryDestination[]; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonLanguageSettings instance + */ + public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; + + /** + * Verifies a CommonLanguageSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @param message CommonLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientLibrarySettings. */ + interface IClientLibrarySettings { + + /** ClientLibrarySettings version */ + version?: (string|null); + + /** ClientLibrarySettings launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ClientLibrarySettings restNumericEnums */ + restNumericEnums?: (boolean|null); + + /** ClientLibrarySettings javaSettings */ + javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings */ + cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings */ + phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings */ + pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings */ + nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings */ + dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings */ + rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings */ + goSettings?: (google.api.IGoSettings|null); + } + + /** Represents a ClientLibrarySettings. */ + class ClientLibrarySettings implements IClientLibrarySettings { + + /** + * Constructs a new ClientLibrarySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IClientLibrarySettings); + + /** ClientLibrarySettings version. */ + public version: string; + + /** ClientLibrarySettings launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ClientLibrarySettings restNumericEnums. */ + public restNumericEnums: boolean; + + /** ClientLibrarySettings javaSettings. */ + public javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings. */ + public cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings. */ + public phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings. */ + public pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings. */ + public nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings. */ + public dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings. */ + public rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings. */ + public goSettings?: (google.api.IGoSettings|null); + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientLibrarySettings instance + */ + public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; + + /** + * Verifies a ClientLibrarySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientLibrarySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @param message ClientLibrarySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientLibrarySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Publishing. */ + interface IPublishing { + + /** Publishing methodSettings */ + methodSettings?: (google.api.IMethodSettings[]|null); + + /** Publishing newIssueUri */ + newIssueUri?: (string|null); + + /** Publishing documentationUri */ + documentationUri?: (string|null); + + /** Publishing apiShortName */ + apiShortName?: (string|null); + + /** Publishing githubLabel */ + githubLabel?: (string|null); + + /** Publishing codeownerGithubTeams */ + codeownerGithubTeams?: (string[]|null); + + /** Publishing docTagPrefix */ + docTagPrefix?: (string|null); + + /** Publishing organization */ + organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); + + /** Publishing librarySettings */ + librarySettings?: (google.api.IClientLibrarySettings[]|null); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); + + /** Publishing restReferenceDocumentationUri */ + restReferenceDocumentationUri?: (string|null); + } + + /** Represents a Publishing. */ + class Publishing implements IPublishing { + + /** + * Constructs a new Publishing. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPublishing); + + /** Publishing methodSettings. */ + public methodSettings: google.api.IMethodSettings[]; + + /** Publishing newIssueUri. */ + public newIssueUri: string; + + /** Publishing documentationUri. */ + public documentationUri: string; + + /** Publishing apiShortName. */ + public apiShortName: string; + + /** Publishing githubLabel. */ + public githubLabel: string; + + /** Publishing codeownerGithubTeams. */ + public codeownerGithubTeams: string[]; + + /** Publishing docTagPrefix. */ + public docTagPrefix: string; + + /** Publishing organization. */ + public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; + + /** Publishing restReferenceDocumentationUri. */ + public restReferenceDocumentationUri: string; + + /** + * Creates a new Publishing instance using the specified properties. + * @param [properties] Properties to set + * @returns Publishing instance + */ + public static create(properties?: google.api.IPublishing): google.api.Publishing; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; + + /** + * Verifies a Publishing message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Publishing + */ + public static fromObject(object: { [k: string]: any }): google.api.Publishing; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @param message Publishing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Publishing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Publishing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JavaSettings. */ + interface IJavaSettings { + + /** JavaSettings libraryPackage */ + libraryPackage?: (string|null); + + /** JavaSettings serviceClassNames */ + serviceClassNames?: ({ [k: string]: string }|null); + + /** JavaSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a JavaSettings. */ + class JavaSettings implements IJavaSettings { + + /** + * Constructs a new JavaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IJavaSettings); + + /** JavaSettings libraryPackage. */ + public libraryPackage: string; + + /** JavaSettings serviceClassNames. */ + public serviceClassNames: { [k: string]: string }; + + /** JavaSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new JavaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaSettings instance + */ + public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; + + /** + * Verifies a JavaSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @param message JavaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JavaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CppSettings. */ + interface ICppSettings { + + /** CppSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { + + /** + * Constructs a new CppSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICppSettings); + + /** CppSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance + */ + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; + + /** + * Verifies a CppSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CppSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @param message CppSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CppSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CppSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PhpSettings. */ + interface IPhpSettings { + + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { + + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); + + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PhpSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PhpSettings instance + */ + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; + + /** + * Verifies a PhpSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhpSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @param message PhpSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhpSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhpSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonSettings. */ + interface IPythonSettings { + + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { + + /** + * Constructs a new PythonSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPythonSettings); + + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PythonSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonSettings instance + */ + public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; + + /** + * Verifies a PythonSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeSettings. */ + interface INodeSettings { + + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { + + /** + * Constructs a new NodeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.INodeSettings); + + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance + */ + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; + + /** + * Verifies a NodeSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @param message NodeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DotnetSettings. */ + interface IDotnetSettings { + + /** DotnetSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + + /** DotnetSettings renamedResources */ + renamedResources?: ({ [k: string]: string }|null); + + /** DotnetSettings ignoredResources */ + ignoredResources?: (string[]|null); + + /** DotnetSettings forcedNamespaceAliases */ + forcedNamespaceAliases?: (string[]|null); + + /** DotnetSettings handwrittenSignatures */ + handwrittenSignatures?: (string[]|null); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** DotnetSettings renamedResources. */ + public renamedResources: { [k: string]: string }; + + /** DotnetSettings ignoredResources. */ + public ignoredResources: string[]; + + /** DotnetSettings forcedNamespaceAliases. */ + public forcedNamespaceAliases: string[]; + + /** DotnetSettings handwrittenSignatures. */ + public handwrittenSignatures: string[]; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance + */ + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; + + /** + * Verifies a DotnetSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DotnetSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @param message DotnetSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DotnetSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DotnetSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RubySettings. */ + interface IRubySettings { + + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { + + /** + * Constructs a new RubySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance + */ + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; + + /** + * Verifies a RubySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RubySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @param message RubySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RubySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RubySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoSettings. */ + interface IGoSettings { + + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { + + /** + * Constructs a new GoSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IGoSettings); + + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new GoSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GoSettings instance + */ + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; + + /** + * Verifies a GoSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @param message GoSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); + + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields */ + autoPopulatedFields?: (string[]|null); + } + + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { + + /** + * Constructs a new MethodSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; + + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields. */ + public autoPopulatedFields: string[]; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance + */ + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; + + /** + * Verifies a MethodSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @param message MethodSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodSettings { + + /** Properties of a LongRunning. */ + interface ILongRunning { + + /** LongRunning initialPollDelay */ + initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier */ + pollDelayMultiplier?: (number|null); + + /** LongRunning maxPollDelay */ + maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout */ + totalPollTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a LongRunning. */ + class LongRunning implements ILongRunning { + + /** + * Constructs a new LongRunning. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MethodSettings.ILongRunning); + + /** LongRunning initialPollDelay. */ + public initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier. */ + public pollDelayMultiplier: number; + + /** LongRunning maxPollDelay. */ + public maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout. */ + public totalPollTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new LongRunning instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunning instance + */ + public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; + + /** + * Verifies a LongRunning message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunning + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @param message LongRunning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4, + SHOPPING = 5, + GEO = 6, + GENERATIVE_AI = 7 + } + + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + + /** 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 FieldInfo. */ + interface IFieldInfo { + + /** FieldInfo format */ + format?: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format|null); + } + + /** Represents a FieldInfo. */ + class FieldInfo implements IFieldInfo { + + /** + * Constructs a new FieldInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IFieldInfo); + + /** FieldInfo format. */ + public format: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format); + + /** + * Creates a new FieldInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldInfo instance + */ + public static create(properties?: google.api.IFieldInfo): google.api.FieldInfo; + + /** + * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @param message FieldInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @param message FieldInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldInfo + * @throws {Error} If the payload is not 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.FieldInfo; + + /** + * Decodes a FieldInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldInfo + * @throws {Error} If the payload 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.FieldInfo; + + /** + * Verifies a FieldInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldInfo + */ + public static fromObject(object: { [k: string]: any }): google.api.FieldInfo; + + /** + * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. + * @param message FieldInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.FieldInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldInfo { + + /** Format enum. */ + enum Format { + FORMAT_UNSPECIFIED = 0, + UUID4 = 1, + IPV4 = 2, + IPV6 = 3, + IPV4_OR_IPV6 = 4 + } + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Edition enum. */ + enum Edition { + EDITION_UNKNOWN = 0, + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + EDITION_2023 = 1000, + EDITION_2024 = 1001, + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + EDITION_MAX = 2147483647 + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ExtensionRangeOptions declaration */ + declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); + + /** ExtensionRangeOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification */ + verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** ExtensionRangeOptions declaration. */ + public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; + + /** ExtensionRangeOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification. */ + public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExtensionRangeOptions { + + /** Properties of a Declaration. */ + interface IDeclaration { + + /** Declaration number */ + number?: (number|null); + + /** Declaration fullName */ + fullName?: (string|null); + + /** Declaration type */ + type?: (string|null); + + /** Declaration reserved */ + reserved?: (boolean|null); + + /** Declaration repeated */ + repeated?: (boolean|null); + } + + /** Represents a Declaration. */ + class Declaration implements IDeclaration { + + /** + * Constructs a new Declaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); + + /** Declaration number. */ + public number: number; + + /** Declaration fullName. */ + public fullName: string; + + /** Declaration type. */ + public type: string; + + /** Declaration reserved. */ + public reserved: boolean; + + /** Declaration repeated. */ + public repeated: boolean; + + /** + * Creates a new Declaration instance using the specified properties. + * @param [properties] Properties to set + * @returns Declaration instance + */ + public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Verifies a Declaration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Declaration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @param message Declaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Declaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Declaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VerificationState enum. */ + enum VerificationState { + DECLARATION = 0, + UNVERIFIED = 1 + } + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REPEATED = 3, + LABEL_REQUIRED = 2 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** MessageOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** MessageOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions debugRedact */ + debugRedact?: (boolean|null); + + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + + /** FieldOptions targets */ + targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); + + /** FieldOptions editionDefaults */ + editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); + + /** FieldOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.fieldInfo */ + ".google.api.fieldInfo"?: (google.api.IFieldInfo|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions debugRedact. */ + public debugRedact: boolean; + + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions targets. */ + public targets: google.protobuf.FieldOptions.OptionTargetType[]; + + /** FieldOptions editionDefaults. */ + public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; + + /** FieldOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } + + /** OptionTargetType enum. */ + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9 + } + + /** Properties of an EditionDefault. */ + interface IEditionDefault { + + /** EditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** EditionDefault value */ + value?: (string|null); + } + + /** Represents an EditionDefault. */ + class EditionDefault implements IEditionDefault { + + /** + * Constructs a new EditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); + + /** EditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** EditionDefault value. */ + public value: string; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns EditionDefault instance + */ + public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; + + /** + * Verifies an EditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @param message EditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** EnumOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** EnumOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact. */ + public debugRedact: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|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|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + } + + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { + + /** + * Constructs a new FeatureSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSet); + + /** FeatureSet fieldPresence. */ + public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); + + /** FeatureSet enumType. */ + public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); + + /** FeatureSet repeatedFieldEncoding. */ + public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); + + /** FeatureSet utf8Validation. */ + public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); + + /** FeatureSet messageEncoding. */ + public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); + + /** FeatureSet jsonFormat. */ + public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + + /** + * Creates a new FeatureSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSet instance + */ + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; + + /** + * Verifies a FeatureSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @param message FeatureSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSet { + + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } + + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } + + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } + + /** Utf8Validation enum. */ + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3 + } + + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 + } + + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + } + + /** Properties of a FeatureSetDefaults. */ + interface IFeatureSetDefaults { + + /** FeatureSetDefaults defaults */ + defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); + + /** FeatureSetDefaults minimumEdition */ + minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetDefaults maximumEdition */ + maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSetDefaults. */ + class FeatureSetDefaults implements IFeatureSetDefaults { + + /** + * Constructs a new FeatureSetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSetDefaults); + + /** FeatureSetDefaults defaults. */ + public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; + + /** FeatureSetDefaults minimumEdition. */ + public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetDefaults maximumEdition. */ + public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetDefaults instance + */ + public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; + + /** + * Verifies a FeatureSetDefaults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @param message FeatureSetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSetDefaults { + + /** Properties of a FeatureSetEditionDefault. */ + interface IFeatureSetEditionDefault { + + /** FeatureSetEditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetEditionDefault features */ + features?: (google.protobuf.IFeatureSet|null); + } + + /** Represents a FeatureSetEditionDefault. */ + class FeatureSetEditionDefault implements IFeatureSetEditionDefault { + + /** + * Constructs a new FeatureSetEditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); + + /** FeatureSetEditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetEditionDefault features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetEditionDefault instance + */ + public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Verifies a FeatureSetEditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetEditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @param message FeatureSetEditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of 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 an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|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|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/owl-bot-staging/google-cloud-batch/v1/protos/protos.js b/owl-bot-staging/google-cloud-batch/v1/protos/protos.js new file mode 100644 index 00000000000..6d87f323961 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/protos/protos.js @@ -0,0 +1,35612 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*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_batch_protos || ($protobuf.roots._google_cloud_batch_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.batch = (function() { + + /** + * Namespace batch. + * @memberof google.cloud + * @namespace + */ + var batch = {}; + + batch.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.batch + * @namespace + */ + var v1 = {}; + + v1.BatchService = (function() { + + /** + * Constructs a new BatchService service. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a BatchService + * @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 BatchService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (BatchService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = BatchService; + + /** + * Creates new BatchService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.batch.v1.BatchService + * @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 {BatchService} RPC service. Useful where requests and/or responses are streamed. + */ + BatchService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.batch.v1.BatchService|createJob}. + * @memberof google.cloud.batch.v1.BatchService + * @typedef CreateJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.batch.v1.Job} [response] Job + */ + + /** + * Calls CreateJob. + * @function createJob + * @memberof google.cloud.batch.v1.BatchService + * @instance + * @param {google.cloud.batch.v1.ICreateJobRequest} request CreateJobRequest message or plain object + * @param {google.cloud.batch.v1.BatchService.CreateJobCallback} callback Node-style callback called with the error, if any, and Job + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.createJob = function createJob(request, callback) { + return this.rpcCall(createJob, $root.google.cloud.batch.v1.CreateJobRequest, $root.google.cloud.batch.v1.Job, request, callback); + }, "name", { value: "CreateJob" }); + + /** + * Calls CreateJob. + * @function createJob + * @memberof google.cloud.batch.v1.BatchService + * @instance + * @param {google.cloud.batch.v1.ICreateJobRequest} request CreateJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.batch.v1.BatchService|getJob}. + * @memberof google.cloud.batch.v1.BatchService + * @typedef GetJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.batch.v1.Job} [response] Job + */ + + /** + * Calls GetJob. + * @function getJob + * @memberof google.cloud.batch.v1.BatchService + * @instance + * @param {google.cloud.batch.v1.IGetJobRequest} request GetJobRequest message or plain object + * @param {google.cloud.batch.v1.BatchService.GetJobCallback} callback Node-style callback called with the error, if any, and Job + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.getJob = function getJob(request, callback) { + return this.rpcCall(getJob, $root.google.cloud.batch.v1.GetJobRequest, $root.google.cloud.batch.v1.Job, request, callback); + }, "name", { value: "GetJob" }); + + /** + * Calls GetJob. + * @function getJob + * @memberof google.cloud.batch.v1.BatchService + * @instance + * @param {google.cloud.batch.v1.IGetJobRequest} request GetJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.batch.v1.BatchService|deleteJob}. + * @memberof google.cloud.batch.v1.BatchService + * @typedef DeleteJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteJob. + * @function deleteJob + * @memberof google.cloud.batch.v1.BatchService + * @instance + * @param {google.cloud.batch.v1.IDeleteJobRequest} request DeleteJobRequest message or plain object + * @param {google.cloud.batch.v1.BatchService.DeleteJobCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.deleteJob = function deleteJob(request, callback) { + return this.rpcCall(deleteJob, $root.google.cloud.batch.v1.DeleteJobRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteJob" }); + + /** + * Calls DeleteJob. + * @function deleteJob + * @memberof google.cloud.batch.v1.BatchService + * @instance + * @param {google.cloud.batch.v1.IDeleteJobRequest} request DeleteJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.batch.v1.BatchService|listJobs}. + * @memberof google.cloud.batch.v1.BatchService + * @typedef ListJobsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.batch.v1.ListJobsResponse} [response] ListJobsResponse + */ + + /** + * Calls ListJobs. + * @function listJobs + * @memberof google.cloud.batch.v1.BatchService + * @instance + * @param {google.cloud.batch.v1.IListJobsRequest} request ListJobsRequest message or plain object + * @param {google.cloud.batch.v1.BatchService.ListJobsCallback} callback Node-style callback called with the error, if any, and ListJobsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.listJobs = function listJobs(request, callback) { + return this.rpcCall(listJobs, $root.google.cloud.batch.v1.ListJobsRequest, $root.google.cloud.batch.v1.ListJobsResponse, request, callback); + }, "name", { value: "ListJobs" }); + + /** + * Calls ListJobs. + * @function listJobs + * @memberof google.cloud.batch.v1.BatchService + * @instance + * @param {google.cloud.batch.v1.IListJobsRequest} request ListJobsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.batch.v1.BatchService|getTask}. + * @memberof google.cloud.batch.v1.BatchService + * @typedef GetTaskCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.batch.v1.Task} [response] Task + */ + + /** + * Calls GetTask. + * @function getTask + * @memberof google.cloud.batch.v1.BatchService + * @instance + * @param {google.cloud.batch.v1.IGetTaskRequest} request GetTaskRequest message or plain object + * @param {google.cloud.batch.v1.BatchService.GetTaskCallback} callback Node-style callback called with the error, if any, and Task + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.getTask = function getTask(request, callback) { + return this.rpcCall(getTask, $root.google.cloud.batch.v1.GetTaskRequest, $root.google.cloud.batch.v1.Task, request, callback); + }, "name", { value: "GetTask" }); + + /** + * Calls GetTask. + * @function getTask + * @memberof google.cloud.batch.v1.BatchService + * @instance + * @param {google.cloud.batch.v1.IGetTaskRequest} request GetTaskRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.batch.v1.BatchService|listTasks}. + * @memberof google.cloud.batch.v1.BatchService + * @typedef ListTasksCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.batch.v1.ListTasksResponse} [response] ListTasksResponse + */ + + /** + * Calls ListTasks. + * @function listTasks + * @memberof google.cloud.batch.v1.BatchService + * @instance + * @param {google.cloud.batch.v1.IListTasksRequest} request ListTasksRequest message or plain object + * @param {google.cloud.batch.v1.BatchService.ListTasksCallback} callback Node-style callback called with the error, if any, and ListTasksResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.listTasks = function listTasks(request, callback) { + return this.rpcCall(listTasks, $root.google.cloud.batch.v1.ListTasksRequest, $root.google.cloud.batch.v1.ListTasksResponse, request, callback); + }, "name", { value: "ListTasks" }); + + /** + * Calls ListTasks. + * @function listTasks + * @memberof google.cloud.batch.v1.BatchService + * @instance + * @param {google.cloud.batch.v1.IListTasksRequest} request ListTasksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return BatchService; + })(); + + v1.CreateJobRequest = (function() { + + /** + * Properties of a CreateJobRequest. + * @memberof google.cloud.batch.v1 + * @interface ICreateJobRequest + * @property {string|null} [parent] CreateJobRequest parent + * @property {string|null} [jobId] CreateJobRequest jobId + * @property {google.cloud.batch.v1.IJob|null} [job] CreateJobRequest job + * @property {string|null} [requestId] CreateJobRequest requestId + */ + + /** + * Constructs a new CreateJobRequest. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a CreateJobRequest. + * @implements ICreateJobRequest + * @constructor + * @param {google.cloud.batch.v1.ICreateJobRequest=} [properties] Properties to set + */ + function CreateJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateJobRequest parent. + * @member {string} parent + * @memberof google.cloud.batch.v1.CreateJobRequest + * @instance + */ + CreateJobRequest.prototype.parent = ""; + + /** + * CreateJobRequest jobId. + * @member {string} jobId + * @memberof google.cloud.batch.v1.CreateJobRequest + * @instance + */ + CreateJobRequest.prototype.jobId = ""; + + /** + * CreateJobRequest job. + * @member {google.cloud.batch.v1.IJob|null|undefined} job + * @memberof google.cloud.batch.v1.CreateJobRequest + * @instance + */ + CreateJobRequest.prototype.job = null; + + /** + * CreateJobRequest requestId. + * @member {string} requestId + * @memberof google.cloud.batch.v1.CreateJobRequest + * @instance + */ + CreateJobRequest.prototype.requestId = ""; + + /** + * Creates a new CreateJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.CreateJobRequest + * @static + * @param {google.cloud.batch.v1.ICreateJobRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1.CreateJobRequest} CreateJobRequest instance + */ + CreateJobRequest.create = function create(properties) { + return new CreateJobRequest(properties); + }; + + /** + * Encodes the specified CreateJobRequest message. Does not implicitly {@link google.cloud.batch.v1.CreateJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.CreateJobRequest + * @static + * @param {google.cloud.batch.v1.ICreateJobRequest} message CreateJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.jobId); + if (message.job != null && Object.hasOwnProperty.call(message, "job")) + $root.google.cloud.batch.v1.Job.encode(message.job, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.CreateJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.CreateJobRequest + * @static + * @param {google.cloud.batch.v1.ICreateJobRequest} message CreateJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.CreateJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.CreateJobRequest} CreateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.CreateJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.jobId = reader.string(); + break; + } + case 3: { + message.job = $root.google.cloud.batch.v1.Job.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.CreateJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.CreateJobRequest} CreateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateJobRequest message. + * @function verify + * @memberof google.cloud.batch.v1.CreateJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.jobId != null && message.hasOwnProperty("jobId")) + if (!$util.isString(message.jobId)) + return "jobId: string expected"; + if (message.job != null && message.hasOwnProperty("job")) { + var error = $root.google.cloud.batch.v1.Job.verify(message.job); + if (error) + return "job." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.CreateJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.CreateJobRequest} CreateJobRequest + */ + CreateJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.CreateJobRequest) + return object; + var message = new $root.google.cloud.batch.v1.CreateJobRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.jobId != null) + message.jobId = String(object.jobId); + if (object.job != null) { + if (typeof object.job !== "object") + throw TypeError(".google.cloud.batch.v1.CreateJobRequest.job: object expected"); + message.job = $root.google.cloud.batch.v1.Job.fromObject(object.job); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.CreateJobRequest + * @static + * @param {google.cloud.batch.v1.CreateJobRequest} message CreateJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.jobId = ""; + object.job = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.jobId != null && message.hasOwnProperty("jobId")) + object.jobId = message.jobId; + if (message.job != null && message.hasOwnProperty("job")) + object.job = $root.google.cloud.batch.v1.Job.toObject(message.job, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.CreateJobRequest + * @instance + * @returns {Object.} JSON object + */ + CreateJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateJobRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1.CreateJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.CreateJobRequest"; + }; + + return CreateJobRequest; + })(); + + v1.GetJobRequest = (function() { + + /** + * Properties of a GetJobRequest. + * @memberof google.cloud.batch.v1 + * @interface IGetJobRequest + * @property {string|null} [name] GetJobRequest name + */ + + /** + * Constructs a new GetJobRequest. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a GetJobRequest. + * @implements IGetJobRequest + * @constructor + * @param {google.cloud.batch.v1.IGetJobRequest=} [properties] Properties to set + */ + function GetJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetJobRequest name. + * @member {string} name + * @memberof google.cloud.batch.v1.GetJobRequest + * @instance + */ + GetJobRequest.prototype.name = ""; + + /** + * Creates a new GetJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.GetJobRequest + * @static + * @param {google.cloud.batch.v1.IGetJobRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1.GetJobRequest} GetJobRequest instance + */ + GetJobRequest.create = function create(properties) { + return new GetJobRequest(properties); + }; + + /** + * Encodes the specified GetJobRequest message. Does not implicitly {@link google.cloud.batch.v1.GetJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.GetJobRequest + * @static + * @param {google.cloud.batch.v1.IGetJobRequest} message GetJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetJobRequest.encode = function encode(message, writer) { + 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 GetJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.GetJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.GetJobRequest + * @static + * @param {google.cloud.batch.v1.IGetJobRequest} message GetJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.GetJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.GetJobRequest} GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.GetJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.GetJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.GetJobRequest} GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetJobRequest message. + * @function verify + * @memberof google.cloud.batch.v1.GetJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.GetJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.GetJobRequest} GetJobRequest + */ + GetJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.GetJobRequest) + return object; + var message = new $root.google.cloud.batch.v1.GetJobRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.GetJobRequest + * @static + * @param {google.cloud.batch.v1.GetJobRequest} message GetJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetJobRequest.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 GetJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.GetJobRequest + * @instance + * @returns {Object.} JSON object + */ + GetJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetJobRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1.GetJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.GetJobRequest"; + }; + + return GetJobRequest; + })(); + + v1.DeleteJobRequest = (function() { + + /** + * Properties of a DeleteJobRequest. + * @memberof google.cloud.batch.v1 + * @interface IDeleteJobRequest + * @property {string|null} [name] DeleteJobRequest name + * @property {string|null} [reason] DeleteJobRequest reason + * @property {string|null} [requestId] DeleteJobRequest requestId + */ + + /** + * Constructs a new DeleteJobRequest. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a DeleteJobRequest. + * @implements IDeleteJobRequest + * @constructor + * @param {google.cloud.batch.v1.IDeleteJobRequest=} [properties] Properties to set + */ + function DeleteJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteJobRequest name. + * @member {string} name + * @memberof google.cloud.batch.v1.DeleteJobRequest + * @instance + */ + DeleteJobRequest.prototype.name = ""; + + /** + * DeleteJobRequest reason. + * @member {string} reason + * @memberof google.cloud.batch.v1.DeleteJobRequest + * @instance + */ + DeleteJobRequest.prototype.reason = ""; + + /** + * DeleteJobRequest requestId. + * @member {string} requestId + * @memberof google.cloud.batch.v1.DeleteJobRequest + * @instance + */ + DeleteJobRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.DeleteJobRequest + * @static + * @param {google.cloud.batch.v1.IDeleteJobRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1.DeleteJobRequest} DeleteJobRequest instance + */ + DeleteJobRequest.create = function create(properties) { + return new DeleteJobRequest(properties); + }; + + /** + * Encodes the specified DeleteJobRequest message. Does not implicitly {@link google.cloud.batch.v1.DeleteJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.DeleteJobRequest + * @static + * @param {google.cloud.batch.v1.IDeleteJobRequest} message DeleteJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.reason); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.DeleteJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.DeleteJobRequest + * @static + * @param {google.cloud.batch.v1.IDeleteJobRequest} message DeleteJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.DeleteJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.DeleteJobRequest} DeleteJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.DeleteJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.reason = reader.string(); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.DeleteJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.DeleteJobRequest} DeleteJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteJobRequest message. + * @function verify + * @memberof google.cloud.batch.v1.DeleteJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.reason != null && message.hasOwnProperty("reason")) + if (!$util.isString(message.reason)) + return "reason: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.DeleteJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.DeleteJobRequest} DeleteJobRequest + */ + DeleteJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.DeleteJobRequest) + return object; + var message = new $root.google.cloud.batch.v1.DeleteJobRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.reason != null) + message.reason = String(object.reason); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.DeleteJobRequest + * @static + * @param {google.cloud.batch.v1.DeleteJobRequest} message DeleteJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.reason = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.reason != null && message.hasOwnProperty("reason")) + object.reason = message.reason; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.DeleteJobRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteJobRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1.DeleteJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.DeleteJobRequest"; + }; + + return DeleteJobRequest; + })(); + + v1.ListJobsRequest = (function() { + + /** + * Properties of a ListJobsRequest. + * @memberof google.cloud.batch.v1 + * @interface IListJobsRequest + * @property {string|null} [parent] ListJobsRequest parent + * @property {string|null} [filter] ListJobsRequest filter + * @property {string|null} [orderBy] ListJobsRequest orderBy + * @property {number|null} [pageSize] ListJobsRequest pageSize + * @property {string|null} [pageToken] ListJobsRequest pageToken + */ + + /** + * Constructs a new ListJobsRequest. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a ListJobsRequest. + * @implements IListJobsRequest + * @constructor + * @param {google.cloud.batch.v1.IListJobsRequest=} [properties] Properties to set + */ + function ListJobsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListJobsRequest parent. + * @member {string} parent + * @memberof google.cloud.batch.v1.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.parent = ""; + + /** + * ListJobsRequest filter. + * @member {string} filter + * @memberof google.cloud.batch.v1.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.filter = ""; + + /** + * ListJobsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.batch.v1.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.orderBy = ""; + + /** + * ListJobsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.batch.v1.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.pageSize = 0; + + /** + * ListJobsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.batch.v1.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListJobsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.ListJobsRequest + * @static + * @param {google.cloud.batch.v1.IListJobsRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1.ListJobsRequest} ListJobsRequest instance + */ + ListJobsRequest.create = function create(properties) { + return new ListJobsRequest(properties); + }; + + /** + * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.cloud.batch.v1.ListJobsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.ListJobsRequest + * @static + * @param {google.cloud.batch.v1.IListJobsRequest} message ListJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListJobsRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ListJobsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.ListJobsRequest + * @static + * @param {google.cloud.batch.v1.IListJobsRequest} message ListJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.ListJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.ListJobsRequest} ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.ListJobsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.ListJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.ListJobsRequest} ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListJobsRequest message. + * @function verify + * @memberof google.cloud.batch.v1.ListJobsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListJobsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListJobsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.ListJobsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.ListJobsRequest} ListJobsRequest + */ + ListJobsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.ListJobsRequest) + return object; + var message = new $root.google.cloud.batch.v1.ListJobsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListJobsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.ListJobsRequest + * @static + * @param {google.cloud.batch.v1.ListJobsRequest} message ListJobsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListJobsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListJobsRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.ListJobsRequest + * @instance + * @returns {Object.} JSON object + */ + ListJobsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListJobsRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1.ListJobsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListJobsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.ListJobsRequest"; + }; + + return ListJobsRequest; + })(); + + v1.ListJobsResponse = (function() { + + /** + * Properties of a ListJobsResponse. + * @memberof google.cloud.batch.v1 + * @interface IListJobsResponse + * @property {Array.|null} [jobs] ListJobsResponse jobs + * @property {string|null} [nextPageToken] ListJobsResponse nextPageToken + * @property {Array.|null} [unreachable] ListJobsResponse unreachable + */ + + /** + * Constructs a new ListJobsResponse. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a ListJobsResponse. + * @implements IListJobsResponse + * @constructor + * @param {google.cloud.batch.v1.IListJobsResponse=} [properties] Properties to set + */ + function ListJobsResponse(properties) { + this.jobs = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListJobsResponse jobs. + * @member {Array.} jobs + * @memberof google.cloud.batch.v1.ListJobsResponse + * @instance + */ + ListJobsResponse.prototype.jobs = $util.emptyArray; + + /** + * ListJobsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.batch.v1.ListJobsResponse + * @instance + */ + ListJobsResponse.prototype.nextPageToken = ""; + + /** + * ListJobsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.batch.v1.ListJobsResponse + * @instance + */ + ListJobsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListJobsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.ListJobsResponse + * @static + * @param {google.cloud.batch.v1.IListJobsResponse=} [properties] Properties to set + * @returns {google.cloud.batch.v1.ListJobsResponse} ListJobsResponse instance + */ + ListJobsResponse.create = function create(properties) { + return new ListJobsResponse(properties); + }; + + /** + * Encodes the specified ListJobsResponse message. Does not implicitly {@link google.cloud.batch.v1.ListJobsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.ListJobsResponse + * @static + * @param {google.cloud.batch.v1.IListJobsResponse} message ListJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.jobs != null && message.jobs.length) + for (var i = 0; i < message.jobs.length; ++i) + $root.google.cloud.batch.v1.Job.encode(message.jobs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListJobsResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ListJobsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.ListJobsResponse + * @static + * @param {google.cloud.batch.v1.IListJobsResponse} message ListJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.ListJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.ListJobsResponse} ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.ListJobsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.jobs && message.jobs.length)) + message.jobs = []; + message.jobs.push($root.google.cloud.batch.v1.Job.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.ListJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.ListJobsResponse} ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListJobsResponse message. + * @function verify + * @memberof google.cloud.batch.v1.ListJobsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListJobsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.jobs != null && message.hasOwnProperty("jobs")) { + if (!Array.isArray(message.jobs)) + return "jobs: array expected"; + for (var i = 0; i < message.jobs.length; ++i) { + var error = $root.google.cloud.batch.v1.Job.verify(message.jobs[i]); + if (error) + return "jobs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListJobsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.ListJobsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.ListJobsResponse} ListJobsResponse + */ + ListJobsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.ListJobsResponse) + return object; + var message = new $root.google.cloud.batch.v1.ListJobsResponse(); + if (object.jobs) { + if (!Array.isArray(object.jobs)) + throw TypeError(".google.cloud.batch.v1.ListJobsResponse.jobs: array expected"); + message.jobs = []; + for (var i = 0; i < object.jobs.length; ++i) { + if (typeof object.jobs[i] !== "object") + throw TypeError(".google.cloud.batch.v1.ListJobsResponse.jobs: object expected"); + message.jobs[i] = $root.google.cloud.batch.v1.Job.fromObject(object.jobs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.batch.v1.ListJobsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListJobsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.ListJobsResponse + * @static + * @param {google.cloud.batch.v1.ListJobsResponse} message ListJobsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListJobsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.jobs = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.jobs && message.jobs.length) { + object.jobs = []; + for (var j = 0; j < message.jobs.length; ++j) + object.jobs[j] = $root.google.cloud.batch.v1.Job.toObject(message.jobs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListJobsResponse to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.ListJobsResponse + * @instance + * @returns {Object.} JSON object + */ + ListJobsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListJobsResponse + * @function getTypeUrl + * @memberof google.cloud.batch.v1.ListJobsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListJobsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.ListJobsResponse"; + }; + + return ListJobsResponse; + })(); + + v1.ListTasksRequest = (function() { + + /** + * Properties of a ListTasksRequest. + * @memberof google.cloud.batch.v1 + * @interface IListTasksRequest + * @property {string|null} [parent] ListTasksRequest parent + * @property {string|null} [filter] ListTasksRequest filter + * @property {number|null} [pageSize] ListTasksRequest pageSize + * @property {string|null} [pageToken] ListTasksRequest pageToken + */ + + /** + * Constructs a new ListTasksRequest. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a ListTasksRequest. + * @implements IListTasksRequest + * @constructor + * @param {google.cloud.batch.v1.IListTasksRequest=} [properties] Properties to set + */ + function ListTasksRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTasksRequest parent. + * @member {string} parent + * @memberof google.cloud.batch.v1.ListTasksRequest + * @instance + */ + ListTasksRequest.prototype.parent = ""; + + /** + * ListTasksRequest filter. + * @member {string} filter + * @memberof google.cloud.batch.v1.ListTasksRequest + * @instance + */ + ListTasksRequest.prototype.filter = ""; + + /** + * ListTasksRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.batch.v1.ListTasksRequest + * @instance + */ + ListTasksRequest.prototype.pageSize = 0; + + /** + * ListTasksRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.batch.v1.ListTasksRequest + * @instance + */ + ListTasksRequest.prototype.pageToken = ""; + + /** + * Creates a new ListTasksRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.ListTasksRequest + * @static + * @param {google.cloud.batch.v1.IListTasksRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1.ListTasksRequest} ListTasksRequest instance + */ + ListTasksRequest.create = function create(properties) { + return new ListTasksRequest(properties); + }; + + /** + * Encodes the specified ListTasksRequest message. Does not implicitly {@link google.cloud.batch.v1.ListTasksRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.ListTasksRequest + * @static + * @param {google.cloud.batch.v1.IListTasksRequest} message ListTasksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTasksRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListTasksRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ListTasksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.ListTasksRequest + * @static + * @param {google.cloud.batch.v1.IListTasksRequest} message ListTasksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTasksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTasksRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.ListTasksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.ListTasksRequest} ListTasksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTasksRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.ListTasksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTasksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.ListTasksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.ListTasksRequest} ListTasksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTasksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTasksRequest message. + * @function verify + * @memberof google.cloud.batch.v1.ListTasksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTasksRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListTasksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.ListTasksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.ListTasksRequest} ListTasksRequest + */ + ListTasksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.ListTasksRequest) + return object; + var message = new $root.google.cloud.batch.v1.ListTasksRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListTasksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.ListTasksRequest + * @static + * @param {google.cloud.batch.v1.ListTasksRequest} message ListTasksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTasksRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListTasksRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.ListTasksRequest + * @instance + * @returns {Object.} JSON object + */ + ListTasksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTasksRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1.ListTasksRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTasksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.ListTasksRequest"; + }; + + return ListTasksRequest; + })(); + + v1.ListTasksResponse = (function() { + + /** + * Properties of a ListTasksResponse. + * @memberof google.cloud.batch.v1 + * @interface IListTasksResponse + * @property {Array.|null} [tasks] ListTasksResponse tasks + * @property {string|null} [nextPageToken] ListTasksResponse nextPageToken + * @property {Array.|null} [unreachable] ListTasksResponse unreachable + */ + + /** + * Constructs a new ListTasksResponse. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a ListTasksResponse. + * @implements IListTasksResponse + * @constructor + * @param {google.cloud.batch.v1.IListTasksResponse=} [properties] Properties to set + */ + function ListTasksResponse(properties) { + this.tasks = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTasksResponse tasks. + * @member {Array.} tasks + * @memberof google.cloud.batch.v1.ListTasksResponse + * @instance + */ + ListTasksResponse.prototype.tasks = $util.emptyArray; + + /** + * ListTasksResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.batch.v1.ListTasksResponse + * @instance + */ + ListTasksResponse.prototype.nextPageToken = ""; + + /** + * ListTasksResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.batch.v1.ListTasksResponse + * @instance + */ + ListTasksResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListTasksResponse instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.ListTasksResponse + * @static + * @param {google.cloud.batch.v1.IListTasksResponse=} [properties] Properties to set + * @returns {google.cloud.batch.v1.ListTasksResponse} ListTasksResponse instance + */ + ListTasksResponse.create = function create(properties) { + return new ListTasksResponse(properties); + }; + + /** + * Encodes the specified ListTasksResponse message. Does not implicitly {@link google.cloud.batch.v1.ListTasksResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.ListTasksResponse + * @static + * @param {google.cloud.batch.v1.IListTasksResponse} message ListTasksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTasksResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tasks != null && message.tasks.length) + for (var i = 0; i < message.tasks.length; ++i) + $root.google.cloud.batch.v1.Task.encode(message.tasks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListTasksResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ListTasksResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.ListTasksResponse + * @static + * @param {google.cloud.batch.v1.IListTasksResponse} message ListTasksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTasksResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTasksResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.ListTasksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.ListTasksResponse} ListTasksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTasksResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.ListTasksResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.tasks && message.tasks.length)) + message.tasks = []; + message.tasks.push($root.google.cloud.batch.v1.Task.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTasksResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.ListTasksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.ListTasksResponse} ListTasksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTasksResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTasksResponse message. + * @function verify + * @memberof google.cloud.batch.v1.ListTasksResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTasksResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tasks != null && message.hasOwnProperty("tasks")) { + if (!Array.isArray(message.tasks)) + return "tasks: array expected"; + for (var i = 0; i < message.tasks.length; ++i) { + var error = $root.google.cloud.batch.v1.Task.verify(message.tasks[i]); + if (error) + return "tasks." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListTasksResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.ListTasksResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.ListTasksResponse} ListTasksResponse + */ + ListTasksResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.ListTasksResponse) + return object; + var message = new $root.google.cloud.batch.v1.ListTasksResponse(); + if (object.tasks) { + if (!Array.isArray(object.tasks)) + throw TypeError(".google.cloud.batch.v1.ListTasksResponse.tasks: array expected"); + message.tasks = []; + for (var i = 0; i < object.tasks.length; ++i) { + if (typeof object.tasks[i] !== "object") + throw TypeError(".google.cloud.batch.v1.ListTasksResponse.tasks: object expected"); + message.tasks[i] = $root.google.cloud.batch.v1.Task.fromObject(object.tasks[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.batch.v1.ListTasksResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListTasksResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.ListTasksResponse + * @static + * @param {google.cloud.batch.v1.ListTasksResponse} message ListTasksResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTasksResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.tasks = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.tasks && message.tasks.length) { + object.tasks = []; + for (var j = 0; j < message.tasks.length; ++j) + object.tasks[j] = $root.google.cloud.batch.v1.Task.toObject(message.tasks[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListTasksResponse to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.ListTasksResponse + * @instance + * @returns {Object.} JSON object + */ + ListTasksResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTasksResponse + * @function getTypeUrl + * @memberof google.cloud.batch.v1.ListTasksResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTasksResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.ListTasksResponse"; + }; + + return ListTasksResponse; + })(); + + v1.GetTaskRequest = (function() { + + /** + * Properties of a GetTaskRequest. + * @memberof google.cloud.batch.v1 + * @interface IGetTaskRequest + * @property {string|null} [name] GetTaskRequest name + */ + + /** + * Constructs a new GetTaskRequest. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a GetTaskRequest. + * @implements IGetTaskRequest + * @constructor + * @param {google.cloud.batch.v1.IGetTaskRequest=} [properties] Properties to set + */ + function GetTaskRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTaskRequest name. + * @member {string} name + * @memberof google.cloud.batch.v1.GetTaskRequest + * @instance + */ + GetTaskRequest.prototype.name = ""; + + /** + * Creates a new GetTaskRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.GetTaskRequest + * @static + * @param {google.cloud.batch.v1.IGetTaskRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1.GetTaskRequest} GetTaskRequest instance + */ + GetTaskRequest.create = function create(properties) { + return new GetTaskRequest(properties); + }; + + /** + * Encodes the specified GetTaskRequest message. Does not implicitly {@link google.cloud.batch.v1.GetTaskRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.GetTaskRequest + * @static + * @param {google.cloud.batch.v1.IGetTaskRequest} message GetTaskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTaskRequest.encode = function encode(message, writer) { + 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 GetTaskRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.GetTaskRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.GetTaskRequest + * @static + * @param {google.cloud.batch.v1.IGetTaskRequest} message GetTaskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTaskRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTaskRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.GetTaskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.GetTaskRequest} GetTaskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTaskRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.GetTaskRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTaskRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.GetTaskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.GetTaskRequest} GetTaskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTaskRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTaskRequest message. + * @function verify + * @memberof google.cloud.batch.v1.GetTaskRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTaskRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetTaskRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.GetTaskRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.GetTaskRequest} GetTaskRequest + */ + GetTaskRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.GetTaskRequest) + return object; + var message = new $root.google.cloud.batch.v1.GetTaskRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetTaskRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.GetTaskRequest + * @static + * @param {google.cloud.batch.v1.GetTaskRequest} message GetTaskRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTaskRequest.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 GetTaskRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.GetTaskRequest + * @instance + * @returns {Object.} JSON object + */ + GetTaskRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTaskRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1.GetTaskRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTaskRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.GetTaskRequest"; + }; + + return GetTaskRequest; + })(); + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.batch.v1 + * @interface IOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {string|null} [statusMessage] OperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + * @property {string|null} [apiVersion] OperationMetadata apiVersion + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.batch.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.batch.v1.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.batch.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.batch.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.batch.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.batch.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.batch.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.batch.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.batch.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.OperationMetadata + * @static + * @param {google.cloud.batch.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.batch.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.batch.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.OperationMetadata + * @static + * @param {google.cloud.batch.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, 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.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.batch.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.OperationMetadata + * @static + * @param {google.cloud.batch.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.target = reader.string(); + break; + } + case 4: { + message.verb = reader.string(); + break; + } + case 5: { + message.statusMessage = reader.string(); + break; + } + case 6: { + message.requestedCancellation = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationMetadata message. + * @function verify + * @memberof google.cloud.batch.v1.OperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (typeof message.requestedCancellation !== "boolean") + return "requestedCancellation: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.batch.v1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.batch.v1.OperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.batch.v1.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.OperationMetadata + * @static + * @param {google.cloud.batch.v1.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.target = ""; + object.verb = ""; + object.statusMessage = ""; + object.requestedCancellation = false; + object.apiVersion = ""; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationMetadata + * @function getTypeUrl + * @memberof google.cloud.batch.v1.OperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1.Job = (function() { + + /** + * Properties of a Job. + * @memberof google.cloud.batch.v1 + * @interface IJob + * @property {string|null} [name] Job name + * @property {string|null} [uid] Job uid + * @property {number|Long|null} [priority] Job priority + * @property {Array.|null} [taskGroups] Job taskGroups + * @property {google.cloud.batch.v1.IAllocationPolicy|null} [allocationPolicy] Job allocationPolicy + * @property {Object.|null} [labels] Job labels + * @property {google.cloud.batch.v1.IJobStatus|null} [status] Job status + * @property {google.protobuf.ITimestamp|null} [createTime] Job createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Job updateTime + * @property {google.cloud.batch.v1.ILogsPolicy|null} [logsPolicy] Job logsPolicy + * @property {Array.|null} [notifications] Job notifications + */ + + /** + * Constructs a new Job. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a Job. + * @implements IJob + * @constructor + * @param {google.cloud.batch.v1.IJob=} [properties] Properties to set + */ + function Job(properties) { + this.taskGroups = []; + this.labels = {}; + this.notifications = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Job name. + * @member {string} name + * @memberof google.cloud.batch.v1.Job + * @instance + */ + Job.prototype.name = ""; + + /** + * Job uid. + * @member {string} uid + * @memberof google.cloud.batch.v1.Job + * @instance + */ + Job.prototype.uid = ""; + + /** + * Job priority. + * @member {number|Long} priority + * @memberof google.cloud.batch.v1.Job + * @instance + */ + Job.prototype.priority = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Job taskGroups. + * @member {Array.} taskGroups + * @memberof google.cloud.batch.v1.Job + * @instance + */ + Job.prototype.taskGroups = $util.emptyArray; + + /** + * Job allocationPolicy. + * @member {google.cloud.batch.v1.IAllocationPolicy|null|undefined} allocationPolicy + * @memberof google.cloud.batch.v1.Job + * @instance + */ + Job.prototype.allocationPolicy = null; + + /** + * Job labels. + * @member {Object.} labels + * @memberof google.cloud.batch.v1.Job + * @instance + */ + Job.prototype.labels = $util.emptyObject; + + /** + * Job status. + * @member {google.cloud.batch.v1.IJobStatus|null|undefined} status + * @memberof google.cloud.batch.v1.Job + * @instance + */ + Job.prototype.status = null; + + /** + * Job createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.batch.v1.Job + * @instance + */ + Job.prototype.createTime = null; + + /** + * Job updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.batch.v1.Job + * @instance + */ + Job.prototype.updateTime = null; + + /** + * Job logsPolicy. + * @member {google.cloud.batch.v1.ILogsPolicy|null|undefined} logsPolicy + * @memberof google.cloud.batch.v1.Job + * @instance + */ + Job.prototype.logsPolicy = null; + + /** + * Job notifications. + * @member {Array.} notifications + * @memberof google.cloud.batch.v1.Job + * @instance + */ + Job.prototype.notifications = $util.emptyArray; + + /** + * Creates a new Job instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.Job + * @static + * @param {google.cloud.batch.v1.IJob=} [properties] Properties to set + * @returns {google.cloud.batch.v1.Job} Job instance + */ + Job.create = function create(properties) { + return new Job(properties); + }; + + /** + * Encodes the specified Job message. Does not implicitly {@link google.cloud.batch.v1.Job.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.Job + * @static + * @param {google.cloud.batch.v1.IJob} message Job message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Job.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.priority); + if (message.taskGroups != null && message.taskGroups.length) + for (var i = 0; i < message.taskGroups.length; ++i) + $root.google.cloud.batch.v1.TaskGroup.encode(message.taskGroups[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.allocationPolicy != null && Object.hasOwnProperty.call(message, "allocationPolicy")) + $root.google.cloud.batch.v1.AllocationPolicy.encode(message.allocationPolicy, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.cloud.batch.v1.JobStatus.encode(message.status, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.logsPolicy != null && Object.hasOwnProperty.call(message, "logsPolicy")) + $root.google.cloud.batch.v1.LogsPolicy.encode(message.logsPolicy, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.notifications != null && message.notifications.length) + for (var i = 0; i < message.notifications.length; ++i) + $root.google.cloud.batch.v1.JobNotification.encode(message.notifications[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Job.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.Job + * @static + * @param {google.cloud.batch.v1.IJob} message Job message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Job.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Job message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.Job + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.Job} Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Job.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Job(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.uid = reader.string(); + break; + } + case 3: { + message.priority = reader.int64(); + break; + } + case 4: { + if (!(message.taskGroups && message.taskGroups.length)) + message.taskGroups = []; + message.taskGroups.push($root.google.cloud.batch.v1.TaskGroup.decode(reader, reader.uint32())); + break; + } + case 7: { + message.allocationPolicy = $root.google.cloud.batch.v1.AllocationPolicy.decode(reader, reader.uint32()); + break; + } + case 8: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 9: { + message.status = $root.google.cloud.batch.v1.JobStatus.decode(reader, reader.uint32()); + break; + } + case 11: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 12: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 13: { + message.logsPolicy = $root.google.cloud.batch.v1.LogsPolicy.decode(reader, reader.uint32()); + break; + } + case 14: { + if (!(message.notifications && message.notifications.length)) + message.notifications = []; + message.notifications.push($root.google.cloud.batch.v1.JobNotification.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Job message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.Job + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.Job} Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Job.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Job message. + * @function verify + * @memberof google.cloud.batch.v1.Job + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Job.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.priority != null && message.hasOwnProperty("priority")) + if (!$util.isInteger(message.priority) && !(message.priority && $util.isInteger(message.priority.low) && $util.isInteger(message.priority.high))) + return "priority: integer|Long expected"; + if (message.taskGroups != null && message.hasOwnProperty("taskGroups")) { + if (!Array.isArray(message.taskGroups)) + return "taskGroups: array expected"; + for (var i = 0; i < message.taskGroups.length; ++i) { + var error = $root.google.cloud.batch.v1.TaskGroup.verify(message.taskGroups[i]); + if (error) + return "taskGroups." + error; + } + } + if (message.allocationPolicy != null && message.hasOwnProperty("allocationPolicy")) { + var error = $root.google.cloud.batch.v1.AllocationPolicy.verify(message.allocationPolicy); + if (error) + return "allocationPolicy." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.cloud.batch.v1.JobStatus.verify(message.status); + if (error) + return "status." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.logsPolicy != null && message.hasOwnProperty("logsPolicy")) { + var error = $root.google.cloud.batch.v1.LogsPolicy.verify(message.logsPolicy); + if (error) + return "logsPolicy." + error; + } + if (message.notifications != null && message.hasOwnProperty("notifications")) { + if (!Array.isArray(message.notifications)) + return "notifications: array expected"; + for (var i = 0; i < message.notifications.length; ++i) { + var error = $root.google.cloud.batch.v1.JobNotification.verify(message.notifications[i]); + if (error) + return "notifications." + error; + } + } + return null; + }; + + /** + * Creates a Job message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.Job + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.Job} Job + */ + Job.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.Job) + return object; + var message = new $root.google.cloud.batch.v1.Job(); + if (object.name != null) + message.name = String(object.name); + if (object.uid != null) + message.uid = String(object.uid); + if (object.priority != null) + if ($util.Long) + (message.priority = $util.Long.fromValue(object.priority)).unsigned = false; + else if (typeof object.priority === "string") + message.priority = parseInt(object.priority, 10); + else if (typeof object.priority === "number") + message.priority = object.priority; + else if (typeof object.priority === "object") + message.priority = new $util.LongBits(object.priority.low >>> 0, object.priority.high >>> 0).toNumber(); + if (object.taskGroups) { + if (!Array.isArray(object.taskGroups)) + throw TypeError(".google.cloud.batch.v1.Job.taskGroups: array expected"); + message.taskGroups = []; + for (var i = 0; i < object.taskGroups.length; ++i) { + if (typeof object.taskGroups[i] !== "object") + throw TypeError(".google.cloud.batch.v1.Job.taskGroups: object expected"); + message.taskGroups[i] = $root.google.cloud.batch.v1.TaskGroup.fromObject(object.taskGroups[i]); + } + } + if (object.allocationPolicy != null) { + if (typeof object.allocationPolicy !== "object") + throw TypeError(".google.cloud.batch.v1.Job.allocationPolicy: object expected"); + message.allocationPolicy = $root.google.cloud.batch.v1.AllocationPolicy.fromObject(object.allocationPolicy); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.batch.v1.Job.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.batch.v1.Job.status: object expected"); + message.status = $root.google.cloud.batch.v1.JobStatus.fromObject(object.status); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.batch.v1.Job.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.batch.v1.Job.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.logsPolicy != null) { + if (typeof object.logsPolicy !== "object") + throw TypeError(".google.cloud.batch.v1.Job.logsPolicy: object expected"); + message.logsPolicy = $root.google.cloud.batch.v1.LogsPolicy.fromObject(object.logsPolicy); + } + if (object.notifications) { + if (!Array.isArray(object.notifications)) + throw TypeError(".google.cloud.batch.v1.Job.notifications: array expected"); + message.notifications = []; + for (var i = 0; i < object.notifications.length; ++i) { + if (typeof object.notifications[i] !== "object") + throw TypeError(".google.cloud.batch.v1.Job.notifications: object expected"); + message.notifications[i] = $root.google.cloud.batch.v1.JobNotification.fromObject(object.notifications[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Job message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.Job + * @static + * @param {google.cloud.batch.v1.Job} message Job + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Job.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.taskGroups = []; + object.notifications = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.uid = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.priority = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.priority = options.longs === String ? "0" : 0; + object.allocationPolicy = null; + object.status = null; + object.createTime = null; + object.updateTime = null; + object.logsPolicy = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.priority != null && message.hasOwnProperty("priority")) + if (typeof message.priority === "number") + object.priority = options.longs === String ? String(message.priority) : message.priority; + else + object.priority = options.longs === String ? $util.Long.prototype.toString.call(message.priority) : options.longs === Number ? new $util.LongBits(message.priority.low >>> 0, message.priority.high >>> 0).toNumber() : message.priority; + if (message.taskGroups && message.taskGroups.length) { + object.taskGroups = []; + for (var j = 0; j < message.taskGroups.length; ++j) + object.taskGroups[j] = $root.google.cloud.batch.v1.TaskGroup.toObject(message.taskGroups[j], options); + } + if (message.allocationPolicy != null && message.hasOwnProperty("allocationPolicy")) + object.allocationPolicy = $root.google.cloud.batch.v1.AllocationPolicy.toObject(message.allocationPolicy, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.cloud.batch.v1.JobStatus.toObject(message.status, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.logsPolicy != null && message.hasOwnProperty("logsPolicy")) + object.logsPolicy = $root.google.cloud.batch.v1.LogsPolicy.toObject(message.logsPolicy, options); + if (message.notifications && message.notifications.length) { + object.notifications = []; + for (var j = 0; j < message.notifications.length; ++j) + object.notifications[j] = $root.google.cloud.batch.v1.JobNotification.toObject(message.notifications[j], options); + } + return object; + }; + + /** + * Converts this Job to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.Job + * @instance + * @returns {Object.} JSON object + */ + Job.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Job + * @function getTypeUrl + * @memberof google.cloud.batch.v1.Job + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Job.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.Job"; + }; + + return Job; + })(); + + v1.LogsPolicy = (function() { + + /** + * Properties of a LogsPolicy. + * @memberof google.cloud.batch.v1 + * @interface ILogsPolicy + * @property {google.cloud.batch.v1.LogsPolicy.Destination|null} [destination] LogsPolicy destination + * @property {string|null} [logsPath] LogsPolicy logsPath + * @property {google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption|null} [cloudLoggingOption] LogsPolicy cloudLoggingOption + */ + + /** + * Constructs a new LogsPolicy. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a LogsPolicy. + * @implements ILogsPolicy + * @constructor + * @param {google.cloud.batch.v1.ILogsPolicy=} [properties] Properties to set + */ + function LogsPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LogsPolicy destination. + * @member {google.cloud.batch.v1.LogsPolicy.Destination} destination + * @memberof google.cloud.batch.v1.LogsPolicy + * @instance + */ + LogsPolicy.prototype.destination = 0; + + /** + * LogsPolicy logsPath. + * @member {string} logsPath + * @memberof google.cloud.batch.v1.LogsPolicy + * @instance + */ + LogsPolicy.prototype.logsPath = ""; + + /** + * LogsPolicy cloudLoggingOption. + * @member {google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption|null|undefined} cloudLoggingOption + * @memberof google.cloud.batch.v1.LogsPolicy + * @instance + */ + LogsPolicy.prototype.cloudLoggingOption = null; + + /** + * Creates a new LogsPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.LogsPolicy + * @static + * @param {google.cloud.batch.v1.ILogsPolicy=} [properties] Properties to set + * @returns {google.cloud.batch.v1.LogsPolicy} LogsPolicy instance + */ + LogsPolicy.create = function create(properties) { + return new LogsPolicy(properties); + }; + + /** + * Encodes the specified LogsPolicy message. Does not implicitly {@link google.cloud.batch.v1.LogsPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.LogsPolicy + * @static + * @param {google.cloud.batch.v1.ILogsPolicy} message LogsPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogsPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.destination); + if (message.logsPath != null && Object.hasOwnProperty.call(message, "logsPath")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.logsPath); + if (message.cloudLoggingOption != null && Object.hasOwnProperty.call(message, "cloudLoggingOption")) + $root.google.cloud.batch.v1.LogsPolicy.CloudLoggingOption.encode(message.cloudLoggingOption, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LogsPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.LogsPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.LogsPolicy + * @static + * @param {google.cloud.batch.v1.ILogsPolicy} message LogsPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogsPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LogsPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.LogsPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.LogsPolicy} LogsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogsPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.LogsPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.destination = reader.int32(); + break; + } + case 2: { + message.logsPath = reader.string(); + break; + } + case 3: { + message.cloudLoggingOption = $root.google.cloud.batch.v1.LogsPolicy.CloudLoggingOption.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LogsPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.LogsPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.LogsPolicy} LogsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogsPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LogsPolicy message. + * @function verify + * @memberof google.cloud.batch.v1.LogsPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LogsPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.destination != null && message.hasOwnProperty("destination")) + switch (message.destination) { + default: + return "destination: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.logsPath != null && message.hasOwnProperty("logsPath")) + if (!$util.isString(message.logsPath)) + return "logsPath: string expected"; + if (message.cloudLoggingOption != null && message.hasOwnProperty("cloudLoggingOption")) { + var error = $root.google.cloud.batch.v1.LogsPolicy.CloudLoggingOption.verify(message.cloudLoggingOption); + if (error) + return "cloudLoggingOption." + error; + } + return null; + }; + + /** + * Creates a LogsPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.LogsPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.LogsPolicy} LogsPolicy + */ + LogsPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.LogsPolicy) + return object; + var message = new $root.google.cloud.batch.v1.LogsPolicy(); + switch (object.destination) { + default: + if (typeof object.destination === "number") { + message.destination = object.destination; + break; + } + break; + case "DESTINATION_UNSPECIFIED": + case 0: + message.destination = 0; + break; + case "CLOUD_LOGGING": + case 1: + message.destination = 1; + break; + case "PATH": + case 2: + message.destination = 2; + break; + } + if (object.logsPath != null) + message.logsPath = String(object.logsPath); + if (object.cloudLoggingOption != null) { + if (typeof object.cloudLoggingOption !== "object") + throw TypeError(".google.cloud.batch.v1.LogsPolicy.cloudLoggingOption: object expected"); + message.cloudLoggingOption = $root.google.cloud.batch.v1.LogsPolicy.CloudLoggingOption.fromObject(object.cloudLoggingOption); + } + return message; + }; + + /** + * Creates a plain object from a LogsPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.LogsPolicy + * @static + * @param {google.cloud.batch.v1.LogsPolicy} message LogsPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LogsPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.destination = options.enums === String ? "DESTINATION_UNSPECIFIED" : 0; + object.logsPath = ""; + object.cloudLoggingOption = null; + } + if (message.destination != null && message.hasOwnProperty("destination")) + object.destination = options.enums === String ? $root.google.cloud.batch.v1.LogsPolicy.Destination[message.destination] === undefined ? message.destination : $root.google.cloud.batch.v1.LogsPolicy.Destination[message.destination] : message.destination; + if (message.logsPath != null && message.hasOwnProperty("logsPath")) + object.logsPath = message.logsPath; + if (message.cloudLoggingOption != null && message.hasOwnProperty("cloudLoggingOption")) + object.cloudLoggingOption = $root.google.cloud.batch.v1.LogsPolicy.CloudLoggingOption.toObject(message.cloudLoggingOption, options); + return object; + }; + + /** + * Converts this LogsPolicy to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.LogsPolicy + * @instance + * @returns {Object.} JSON object + */ + LogsPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LogsPolicy + * @function getTypeUrl + * @memberof google.cloud.batch.v1.LogsPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LogsPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.LogsPolicy"; + }; + + LogsPolicy.CloudLoggingOption = (function() { + + /** + * Properties of a CloudLoggingOption. + * @memberof google.cloud.batch.v1.LogsPolicy + * @interface ICloudLoggingOption + * @property {boolean|null} [useGenericTaskMonitoredResource] CloudLoggingOption useGenericTaskMonitoredResource + */ + + /** + * Constructs a new CloudLoggingOption. + * @memberof google.cloud.batch.v1.LogsPolicy + * @classdesc Represents a CloudLoggingOption. + * @implements ICloudLoggingOption + * @constructor + * @param {google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption=} [properties] Properties to set + */ + function CloudLoggingOption(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudLoggingOption useGenericTaskMonitoredResource. + * @member {boolean} useGenericTaskMonitoredResource + * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption + * @instance + */ + CloudLoggingOption.prototype.useGenericTaskMonitoredResource = false; + + /** + * Creates a new CloudLoggingOption instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption + * @static + * @param {google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption=} [properties] Properties to set + * @returns {google.cloud.batch.v1.LogsPolicy.CloudLoggingOption} CloudLoggingOption instance + */ + CloudLoggingOption.create = function create(properties) { + return new CloudLoggingOption(properties); + }; + + /** + * Encodes the specified CloudLoggingOption message. Does not implicitly {@link google.cloud.batch.v1.LogsPolicy.CloudLoggingOption.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption + * @static + * @param {google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption} message CloudLoggingOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudLoggingOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.useGenericTaskMonitoredResource != null && Object.hasOwnProperty.call(message, "useGenericTaskMonitoredResource")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.useGenericTaskMonitoredResource); + return writer; + }; + + /** + * Encodes the specified CloudLoggingOption message, length delimited. Does not implicitly {@link google.cloud.batch.v1.LogsPolicy.CloudLoggingOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption + * @static + * @param {google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption} message CloudLoggingOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudLoggingOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudLoggingOption message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.LogsPolicy.CloudLoggingOption} CloudLoggingOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudLoggingOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.LogsPolicy.CloudLoggingOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.useGenericTaskMonitoredResource = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudLoggingOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.LogsPolicy.CloudLoggingOption} CloudLoggingOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudLoggingOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudLoggingOption message. + * @function verify + * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudLoggingOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.useGenericTaskMonitoredResource != null && message.hasOwnProperty("useGenericTaskMonitoredResource")) + if (typeof message.useGenericTaskMonitoredResource !== "boolean") + return "useGenericTaskMonitoredResource: boolean expected"; + return null; + }; + + /** + * Creates a CloudLoggingOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.LogsPolicy.CloudLoggingOption} CloudLoggingOption + */ + CloudLoggingOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.LogsPolicy.CloudLoggingOption) + return object; + var message = new $root.google.cloud.batch.v1.LogsPolicy.CloudLoggingOption(); + if (object.useGenericTaskMonitoredResource != null) + message.useGenericTaskMonitoredResource = Boolean(object.useGenericTaskMonitoredResource); + return message; + }; + + /** + * Creates a plain object from a CloudLoggingOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption + * @static + * @param {google.cloud.batch.v1.LogsPolicy.CloudLoggingOption} message CloudLoggingOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudLoggingOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.useGenericTaskMonitoredResource = false; + if (message.useGenericTaskMonitoredResource != null && message.hasOwnProperty("useGenericTaskMonitoredResource")) + object.useGenericTaskMonitoredResource = message.useGenericTaskMonitoredResource; + return object; + }; + + /** + * Converts this CloudLoggingOption to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption + * @instance + * @returns {Object.} JSON object + */ + CloudLoggingOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudLoggingOption + * @function getTypeUrl + * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudLoggingOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.LogsPolicy.CloudLoggingOption"; + }; + + return CloudLoggingOption; + })(); + + /** + * Destination enum. + * @name google.cloud.batch.v1.LogsPolicy.Destination + * @enum {number} + * @property {number} DESTINATION_UNSPECIFIED=0 DESTINATION_UNSPECIFIED value + * @property {number} CLOUD_LOGGING=1 CLOUD_LOGGING value + * @property {number} PATH=2 PATH value + */ + LogsPolicy.Destination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD_LOGGING"] = 1; + values[valuesById[2] = "PATH"] = 2; + return values; + })(); + + return LogsPolicy; + })(); + + v1.JobStatus = (function() { + + /** + * Properties of a JobStatus. + * @memberof google.cloud.batch.v1 + * @interface IJobStatus + * @property {google.cloud.batch.v1.JobStatus.State|null} [state] JobStatus state + * @property {Array.|null} [statusEvents] JobStatus statusEvents + * @property {Object.|null} [taskGroups] JobStatus taskGroups + * @property {google.protobuf.IDuration|null} [runDuration] JobStatus runDuration + */ + + /** + * Constructs a new JobStatus. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a JobStatus. + * @implements IJobStatus + * @constructor + * @param {google.cloud.batch.v1.IJobStatus=} [properties] Properties to set + */ + function JobStatus(properties) { + this.statusEvents = []; + this.taskGroups = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobStatus state. + * @member {google.cloud.batch.v1.JobStatus.State} state + * @memberof google.cloud.batch.v1.JobStatus + * @instance + */ + JobStatus.prototype.state = 0; + + /** + * JobStatus statusEvents. + * @member {Array.} statusEvents + * @memberof google.cloud.batch.v1.JobStatus + * @instance + */ + JobStatus.prototype.statusEvents = $util.emptyArray; + + /** + * JobStatus taskGroups. + * @member {Object.} taskGroups + * @memberof google.cloud.batch.v1.JobStatus + * @instance + */ + JobStatus.prototype.taskGroups = $util.emptyObject; + + /** + * JobStatus runDuration. + * @member {google.protobuf.IDuration|null|undefined} runDuration + * @memberof google.cloud.batch.v1.JobStatus + * @instance + */ + JobStatus.prototype.runDuration = null; + + /** + * Creates a new JobStatus instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.JobStatus + * @static + * @param {google.cloud.batch.v1.IJobStatus=} [properties] Properties to set + * @returns {google.cloud.batch.v1.JobStatus} JobStatus instance + */ + JobStatus.create = function create(properties) { + return new JobStatus(properties); + }; + + /** + * Encodes the specified JobStatus message. Does not implicitly {@link google.cloud.batch.v1.JobStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.JobStatus + * @static + * @param {google.cloud.batch.v1.IJobStatus} message JobStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobStatus.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); + if (message.statusEvents != null && message.statusEvents.length) + for (var i = 0; i < message.statusEvents.length; ++i) + $root.google.cloud.batch.v1.StatusEvent.encode(message.statusEvents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.taskGroups != null && Object.hasOwnProperty.call(message, "taskGroups")) + for (var keys = Object.keys(message.taskGroups), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.batch.v1.JobStatus.TaskGroupStatus.encode(message.taskGroups[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.runDuration != null && Object.hasOwnProperty.call(message, "runDuration")) + $root.google.protobuf.Duration.encode(message.runDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JobStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.JobStatus + * @static + * @param {google.cloud.batch.v1.IJobStatus} message JobStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JobStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.JobStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.JobStatus} JobStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.JobStatus(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + if (!(message.statusEvents && message.statusEvents.length)) + message.statusEvents = []; + message.statusEvents.push($root.google.cloud.batch.v1.StatusEvent.decode(reader, reader.uint32())); + break; + } + case 4: { + if (message.taskGroups === $util.emptyObject) + message.taskGroups = {}; + 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.cloud.batch.v1.JobStatus.TaskGroupStatus.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.taskGroups[key] = value; + break; + } + case 5: { + message.runDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JobStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.JobStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.JobStatus} JobStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobStatus message. + * @function verify + * @memberof google.cloud.batch.v1.JobStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.statusEvents != null && message.hasOwnProperty("statusEvents")) { + if (!Array.isArray(message.statusEvents)) + return "statusEvents: array expected"; + for (var i = 0; i < message.statusEvents.length; ++i) { + var error = $root.google.cloud.batch.v1.StatusEvent.verify(message.statusEvents[i]); + if (error) + return "statusEvents." + error; + } + } + if (message.taskGroups != null && message.hasOwnProperty("taskGroups")) { + if (!$util.isObject(message.taskGroups)) + return "taskGroups: object expected"; + var key = Object.keys(message.taskGroups); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.batch.v1.JobStatus.TaskGroupStatus.verify(message.taskGroups[key[i]]); + if (error) + return "taskGroups." + error; + } + } + if (message.runDuration != null && message.hasOwnProperty("runDuration")) { + var error = $root.google.protobuf.Duration.verify(message.runDuration); + if (error) + return "runDuration." + error; + } + return null; + }; + + /** + * Creates a JobStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.JobStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.JobStatus} JobStatus + */ + JobStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.JobStatus) + return object; + var message = new $root.google.cloud.batch.v1.JobStatus(); + 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 "QUEUED": + case 1: + message.state = 1; + break; + case "SCHEDULED": + case 2: + message.state = 2; + break; + case "RUNNING": + case 3: + message.state = 3; + break; + case "SUCCEEDED": + case 4: + message.state = 4; + break; + case "FAILED": + case 5: + message.state = 5; + break; + case "DELETION_IN_PROGRESS": + case 6: + message.state = 6; + break; + } + if (object.statusEvents) { + if (!Array.isArray(object.statusEvents)) + throw TypeError(".google.cloud.batch.v1.JobStatus.statusEvents: array expected"); + message.statusEvents = []; + for (var i = 0; i < object.statusEvents.length; ++i) { + if (typeof object.statusEvents[i] !== "object") + throw TypeError(".google.cloud.batch.v1.JobStatus.statusEvents: object expected"); + message.statusEvents[i] = $root.google.cloud.batch.v1.StatusEvent.fromObject(object.statusEvents[i]); + } + } + if (object.taskGroups) { + if (typeof object.taskGroups !== "object") + throw TypeError(".google.cloud.batch.v1.JobStatus.taskGroups: object expected"); + message.taskGroups = {}; + for (var keys = Object.keys(object.taskGroups), i = 0; i < keys.length; ++i) { + if (typeof object.taskGroups[keys[i]] !== "object") + throw TypeError(".google.cloud.batch.v1.JobStatus.taskGroups: object expected"); + message.taskGroups[keys[i]] = $root.google.cloud.batch.v1.JobStatus.TaskGroupStatus.fromObject(object.taskGroups[keys[i]]); + } + } + if (object.runDuration != null) { + if (typeof object.runDuration !== "object") + throw TypeError(".google.cloud.batch.v1.JobStatus.runDuration: object expected"); + message.runDuration = $root.google.protobuf.Duration.fromObject(object.runDuration); + } + return message; + }; + + /** + * Creates a plain object from a JobStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.JobStatus + * @static + * @param {google.cloud.batch.v1.JobStatus} message JobStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.statusEvents = []; + if (options.objects || options.defaults) + object.taskGroups = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.runDuration = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.batch.v1.JobStatus.State[message.state] === undefined ? message.state : $root.google.cloud.batch.v1.JobStatus.State[message.state] : message.state; + if (message.statusEvents && message.statusEvents.length) { + object.statusEvents = []; + for (var j = 0; j < message.statusEvents.length; ++j) + object.statusEvents[j] = $root.google.cloud.batch.v1.StatusEvent.toObject(message.statusEvents[j], options); + } + var keys2; + if (message.taskGroups && (keys2 = Object.keys(message.taskGroups)).length) { + object.taskGroups = {}; + for (var j = 0; j < keys2.length; ++j) + object.taskGroups[keys2[j]] = $root.google.cloud.batch.v1.JobStatus.TaskGroupStatus.toObject(message.taskGroups[keys2[j]], options); + } + if (message.runDuration != null && message.hasOwnProperty("runDuration")) + object.runDuration = $root.google.protobuf.Duration.toObject(message.runDuration, options); + return object; + }; + + /** + * Converts this JobStatus to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.JobStatus + * @instance + * @returns {Object.} JSON object + */ + JobStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobStatus + * @function getTypeUrl + * @memberof google.cloud.batch.v1.JobStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.JobStatus"; + }; + + JobStatus.InstanceStatus = (function() { + + /** + * Properties of an InstanceStatus. + * @memberof google.cloud.batch.v1.JobStatus + * @interface IInstanceStatus + * @property {string|null} [machineType] InstanceStatus machineType + * @property {google.cloud.batch.v1.AllocationPolicy.ProvisioningModel|null} [provisioningModel] InstanceStatus provisioningModel + * @property {number|Long|null} [taskPack] InstanceStatus taskPack + * @property {google.cloud.batch.v1.AllocationPolicy.IDisk|null} [bootDisk] InstanceStatus bootDisk + */ + + /** + * Constructs a new InstanceStatus. + * @memberof google.cloud.batch.v1.JobStatus + * @classdesc Represents an InstanceStatus. + * @implements IInstanceStatus + * @constructor + * @param {google.cloud.batch.v1.JobStatus.IInstanceStatus=} [properties] Properties to set + */ + function InstanceStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceStatus machineType. + * @member {string} machineType + * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus + * @instance + */ + InstanceStatus.prototype.machineType = ""; + + /** + * InstanceStatus provisioningModel. + * @member {google.cloud.batch.v1.AllocationPolicy.ProvisioningModel} provisioningModel + * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus + * @instance + */ + InstanceStatus.prototype.provisioningModel = 0; + + /** + * InstanceStatus taskPack. + * @member {number|Long} taskPack + * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus + * @instance + */ + InstanceStatus.prototype.taskPack = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * InstanceStatus bootDisk. + * @member {google.cloud.batch.v1.AllocationPolicy.IDisk|null|undefined} bootDisk + * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus + * @instance + */ + InstanceStatus.prototype.bootDisk = null; + + /** + * Creates a new InstanceStatus instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus + * @static + * @param {google.cloud.batch.v1.JobStatus.IInstanceStatus=} [properties] Properties to set + * @returns {google.cloud.batch.v1.JobStatus.InstanceStatus} InstanceStatus instance + */ + InstanceStatus.create = function create(properties) { + return new InstanceStatus(properties); + }; + + /** + * Encodes the specified InstanceStatus message. Does not implicitly {@link google.cloud.batch.v1.JobStatus.InstanceStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus + * @static + * @param {google.cloud.batch.v1.JobStatus.IInstanceStatus} message InstanceStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.machineType); + if (message.provisioningModel != null && Object.hasOwnProperty.call(message, "provisioningModel")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.provisioningModel); + if (message.taskPack != null && Object.hasOwnProperty.call(message, "taskPack")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.taskPack); + if (message.bootDisk != null && Object.hasOwnProperty.call(message, "bootDisk")) + $root.google.cloud.batch.v1.AllocationPolicy.Disk.encode(message.bootDisk, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstanceStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobStatus.InstanceStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus + * @static + * @param {google.cloud.batch.v1.JobStatus.IInstanceStatus} message InstanceStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.JobStatus.InstanceStatus} InstanceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.JobStatus.InstanceStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.machineType = reader.string(); + break; + } + case 2: { + message.provisioningModel = reader.int32(); + break; + } + case 3: { + message.taskPack = reader.int64(); + break; + } + case 4: { + message.bootDisk = $root.google.cloud.batch.v1.AllocationPolicy.Disk.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.JobStatus.InstanceStatus} InstanceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceStatus message. + * @function verify + * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.machineType != null && message.hasOwnProperty("machineType")) + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) + switch (message.provisioningModel) { + default: + return "provisioningModel: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.taskPack != null && message.hasOwnProperty("taskPack")) + if (!$util.isInteger(message.taskPack) && !(message.taskPack && $util.isInteger(message.taskPack.low) && $util.isInteger(message.taskPack.high))) + return "taskPack: integer|Long expected"; + if (message.bootDisk != null && message.hasOwnProperty("bootDisk")) { + var error = $root.google.cloud.batch.v1.AllocationPolicy.Disk.verify(message.bootDisk); + if (error) + return "bootDisk." + error; + } + return null; + }; + + /** + * Creates an InstanceStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.JobStatus.InstanceStatus} InstanceStatus + */ + InstanceStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.JobStatus.InstanceStatus) + return object; + var message = new $root.google.cloud.batch.v1.JobStatus.InstanceStatus(); + if (object.machineType != null) + message.machineType = String(object.machineType); + switch (object.provisioningModel) { + default: + if (typeof object.provisioningModel === "number") { + message.provisioningModel = object.provisioningModel; + break; + } + break; + case "PROVISIONING_MODEL_UNSPECIFIED": + case 0: + message.provisioningModel = 0; + break; + case "STANDARD": + case 1: + message.provisioningModel = 1; + break; + case "SPOT": + case 2: + message.provisioningModel = 2; + break; + case "PREEMPTIBLE": + case 3: + message.provisioningModel = 3; + break; + } + if (object.taskPack != null) + if ($util.Long) + (message.taskPack = $util.Long.fromValue(object.taskPack)).unsigned = false; + else if (typeof object.taskPack === "string") + message.taskPack = parseInt(object.taskPack, 10); + else if (typeof object.taskPack === "number") + message.taskPack = object.taskPack; + else if (typeof object.taskPack === "object") + message.taskPack = new $util.LongBits(object.taskPack.low >>> 0, object.taskPack.high >>> 0).toNumber(); + if (object.bootDisk != null) { + if (typeof object.bootDisk !== "object") + throw TypeError(".google.cloud.batch.v1.JobStatus.InstanceStatus.bootDisk: object expected"); + message.bootDisk = $root.google.cloud.batch.v1.AllocationPolicy.Disk.fromObject(object.bootDisk); + } + return message; + }; + + /** + * Creates a plain object from an InstanceStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus + * @static + * @param {google.cloud.batch.v1.JobStatus.InstanceStatus} message InstanceStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.machineType = ""; + object.provisioningModel = options.enums === String ? "PROVISIONING_MODEL_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.taskPack = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.taskPack = options.longs === String ? "0" : 0; + object.bootDisk = null; + } + if (message.machineType != null && message.hasOwnProperty("machineType")) + object.machineType = message.machineType; + if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) + object.provisioningModel = options.enums === String ? $root.google.cloud.batch.v1.AllocationPolicy.ProvisioningModel[message.provisioningModel] === undefined ? message.provisioningModel : $root.google.cloud.batch.v1.AllocationPolicy.ProvisioningModel[message.provisioningModel] : message.provisioningModel; + if (message.taskPack != null && message.hasOwnProperty("taskPack")) + if (typeof message.taskPack === "number") + object.taskPack = options.longs === String ? String(message.taskPack) : message.taskPack; + else + object.taskPack = options.longs === String ? $util.Long.prototype.toString.call(message.taskPack) : options.longs === Number ? new $util.LongBits(message.taskPack.low >>> 0, message.taskPack.high >>> 0).toNumber() : message.taskPack; + if (message.bootDisk != null && message.hasOwnProperty("bootDisk")) + object.bootDisk = $root.google.cloud.batch.v1.AllocationPolicy.Disk.toObject(message.bootDisk, options); + return object; + }; + + /** + * Converts this InstanceStatus to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus + * @instance + * @returns {Object.} JSON object + */ + InstanceStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstanceStatus + * @function getTypeUrl + * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstanceStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.JobStatus.InstanceStatus"; + }; + + return InstanceStatus; + })(); + + JobStatus.TaskGroupStatus = (function() { + + /** + * Properties of a TaskGroupStatus. + * @memberof google.cloud.batch.v1.JobStatus + * @interface ITaskGroupStatus + * @property {Object.|null} [counts] TaskGroupStatus counts + * @property {Array.|null} [instances] TaskGroupStatus instances + */ + + /** + * Constructs a new TaskGroupStatus. + * @memberof google.cloud.batch.v1.JobStatus + * @classdesc Represents a TaskGroupStatus. + * @implements ITaskGroupStatus + * @constructor + * @param {google.cloud.batch.v1.JobStatus.ITaskGroupStatus=} [properties] Properties to set + */ + function TaskGroupStatus(properties) { + this.counts = {}; + this.instances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TaskGroupStatus counts. + * @member {Object.} counts + * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus + * @instance + */ + TaskGroupStatus.prototype.counts = $util.emptyObject; + + /** + * TaskGroupStatus instances. + * @member {Array.} instances + * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus + * @instance + */ + TaskGroupStatus.prototype.instances = $util.emptyArray; + + /** + * Creates a new TaskGroupStatus instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus + * @static + * @param {google.cloud.batch.v1.JobStatus.ITaskGroupStatus=} [properties] Properties to set + * @returns {google.cloud.batch.v1.JobStatus.TaskGroupStatus} TaskGroupStatus instance + */ + TaskGroupStatus.create = function create(properties) { + return new TaskGroupStatus(properties); + }; + + /** + * Encodes the specified TaskGroupStatus message. Does not implicitly {@link google.cloud.batch.v1.JobStatus.TaskGroupStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus + * @static + * @param {google.cloud.batch.v1.JobStatus.ITaskGroupStatus} message TaskGroupStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskGroupStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.counts != null && Object.hasOwnProperty.call(message, "counts")) + for (var keys = Object.keys(message.counts), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int64(message.counts[keys[i]]).ldelim(); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + $root.google.cloud.batch.v1.JobStatus.InstanceStatus.encode(message.instances[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TaskGroupStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobStatus.TaskGroupStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus + * @static + * @param {google.cloud.batch.v1.JobStatus.ITaskGroupStatus} message TaskGroupStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskGroupStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TaskGroupStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.JobStatus.TaskGroupStatus} TaskGroupStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskGroupStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.JobStatus.TaskGroupStatus(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.counts === $util.emptyObject) + message.counts = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = 0; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.int64(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.counts[key] = value; + break; + } + case 2: { + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.batch.v1.JobStatus.InstanceStatus.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TaskGroupStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.JobStatus.TaskGroupStatus} TaskGroupStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskGroupStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TaskGroupStatus message. + * @function verify + * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TaskGroupStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.counts != null && message.hasOwnProperty("counts")) { + if (!$util.isObject(message.counts)) + return "counts: object expected"; + var key = Object.keys(message.counts); + for (var i = 0; i < key.length; ++i) + if (!$util.isInteger(message.counts[key[i]]) && !(message.counts[key[i]] && $util.isInteger(message.counts[key[i]].low) && $util.isInteger(message.counts[key[i]].high))) + return "counts: integer|Long{k:string} expected"; + } + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) { + var error = $root.google.cloud.batch.v1.JobStatus.InstanceStatus.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } + return null; + }; + + /** + * Creates a TaskGroupStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.JobStatus.TaskGroupStatus} TaskGroupStatus + */ + TaskGroupStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.JobStatus.TaskGroupStatus) + return object; + var message = new $root.google.cloud.batch.v1.JobStatus.TaskGroupStatus(); + if (object.counts) { + if (typeof object.counts !== "object") + throw TypeError(".google.cloud.batch.v1.JobStatus.TaskGroupStatus.counts: object expected"); + message.counts = {}; + for (var keys = Object.keys(object.counts), i = 0; i < keys.length; ++i) + if ($util.Long) + (message.counts[keys[i]] = $util.Long.fromValue(object.counts[keys[i]])).unsigned = false; + else if (typeof object.counts[keys[i]] === "string") + message.counts[keys[i]] = parseInt(object.counts[keys[i]], 10); + else if (typeof object.counts[keys[i]] === "number") + message.counts[keys[i]] = object.counts[keys[i]]; + else if (typeof object.counts[keys[i]] === "object") + message.counts[keys[i]] = new $util.LongBits(object.counts[keys[i]].low >>> 0, object.counts[keys[i]].high >>> 0).toNumber(); + } + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.batch.v1.JobStatus.TaskGroupStatus.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.cloud.batch.v1.JobStatus.TaskGroupStatus.instances: object expected"); + message.instances[i] = $root.google.cloud.batch.v1.JobStatus.InstanceStatus.fromObject(object.instances[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TaskGroupStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus + * @static + * @param {google.cloud.batch.v1.JobStatus.TaskGroupStatus} message TaskGroupStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TaskGroupStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instances = []; + if (options.objects || options.defaults) + object.counts = {}; + var keys2; + if (message.counts && (keys2 = Object.keys(message.counts)).length) { + object.counts = {}; + for (var j = 0; j < keys2.length; ++j) + if (typeof message.counts[keys2[j]] === "number") + object.counts[keys2[j]] = options.longs === String ? String(message.counts[keys2[j]]) : message.counts[keys2[j]]; + else + object.counts[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.counts[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.counts[keys2[j]].low >>> 0, message.counts[keys2[j]].high >>> 0).toNumber() : message.counts[keys2[j]]; + } + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.batch.v1.JobStatus.InstanceStatus.toObject(message.instances[j], options); + } + return object; + }; + + /** + * Converts this TaskGroupStatus to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus + * @instance + * @returns {Object.} JSON object + */ + TaskGroupStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TaskGroupStatus + * @function getTypeUrl + * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TaskGroupStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.JobStatus.TaskGroupStatus"; + }; + + return TaskGroupStatus; + })(); + + /** + * State enum. + * @name google.cloud.batch.v1.JobStatus.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} QUEUED=1 QUEUED value + * @property {number} SCHEDULED=2 SCHEDULED value + * @property {number} RUNNING=3 RUNNING value + * @property {number} SUCCEEDED=4 SUCCEEDED value + * @property {number} FAILED=5 FAILED value + * @property {number} DELETION_IN_PROGRESS=6 DELETION_IN_PROGRESS value + */ + JobStatus.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "QUEUED"] = 1; + values[valuesById[2] = "SCHEDULED"] = 2; + values[valuesById[3] = "RUNNING"] = 3; + values[valuesById[4] = "SUCCEEDED"] = 4; + values[valuesById[5] = "FAILED"] = 5; + values[valuesById[6] = "DELETION_IN_PROGRESS"] = 6; + return values; + })(); + + return JobStatus; + })(); + + v1.JobNotification = (function() { + + /** + * Properties of a JobNotification. + * @memberof google.cloud.batch.v1 + * @interface IJobNotification + * @property {string|null} [pubsubTopic] JobNotification pubsubTopic + * @property {google.cloud.batch.v1.JobNotification.IMessage|null} [message] JobNotification message + */ + + /** + * Constructs a new JobNotification. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a JobNotification. + * @implements IJobNotification + * @constructor + * @param {google.cloud.batch.v1.IJobNotification=} [properties] Properties to set + */ + function JobNotification(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobNotification pubsubTopic. + * @member {string} pubsubTopic + * @memberof google.cloud.batch.v1.JobNotification + * @instance + */ + JobNotification.prototype.pubsubTopic = ""; + + /** + * JobNotification message. + * @member {google.cloud.batch.v1.JobNotification.IMessage|null|undefined} message + * @memberof google.cloud.batch.v1.JobNotification + * @instance + */ + JobNotification.prototype.message = null; + + /** + * Creates a new JobNotification instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.JobNotification + * @static + * @param {google.cloud.batch.v1.IJobNotification=} [properties] Properties to set + * @returns {google.cloud.batch.v1.JobNotification} JobNotification instance + */ + JobNotification.create = function create(properties) { + return new JobNotification(properties); + }; + + /** + * Encodes the specified JobNotification message. Does not implicitly {@link google.cloud.batch.v1.JobNotification.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.JobNotification + * @static + * @param {google.cloud.batch.v1.IJobNotification} message JobNotification message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobNotification.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pubsubTopic != null && Object.hasOwnProperty.call(message, "pubsubTopic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pubsubTopic); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + $root.google.cloud.batch.v1.JobNotification.Message.encode(message.message, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JobNotification message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobNotification.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.JobNotification + * @static + * @param {google.cloud.batch.v1.IJobNotification} message JobNotification message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobNotification.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JobNotification message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.JobNotification + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.JobNotification} JobNotification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobNotification.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.JobNotification(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.pubsubTopic = reader.string(); + break; + } + case 2: { + message.message = $root.google.cloud.batch.v1.JobNotification.Message.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JobNotification message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.JobNotification + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.JobNotification} JobNotification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobNotification.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobNotification message. + * @function verify + * @memberof google.cloud.batch.v1.JobNotification + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobNotification.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) + if (!$util.isString(message.pubsubTopic)) + return "pubsubTopic: string expected"; + if (message.message != null && message.hasOwnProperty("message")) { + var error = $root.google.cloud.batch.v1.JobNotification.Message.verify(message.message); + if (error) + return "message." + error; + } + return null; + }; + + /** + * Creates a JobNotification message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.JobNotification + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.JobNotification} JobNotification + */ + JobNotification.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.JobNotification) + return object; + var message = new $root.google.cloud.batch.v1.JobNotification(); + if (object.pubsubTopic != null) + message.pubsubTopic = String(object.pubsubTopic); + if (object.message != null) { + if (typeof object.message !== "object") + throw TypeError(".google.cloud.batch.v1.JobNotification.message: object expected"); + message.message = $root.google.cloud.batch.v1.JobNotification.Message.fromObject(object.message); + } + return message; + }; + + /** + * Creates a plain object from a JobNotification message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.JobNotification + * @static + * @param {google.cloud.batch.v1.JobNotification} message JobNotification + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobNotification.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.pubsubTopic = ""; + object.message = null; + } + if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) + object.pubsubTopic = message.pubsubTopic; + if (message.message != null && message.hasOwnProperty("message")) + object.message = $root.google.cloud.batch.v1.JobNotification.Message.toObject(message.message, options); + return object; + }; + + /** + * Converts this JobNotification to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.JobNotification + * @instance + * @returns {Object.} JSON object + */ + JobNotification.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobNotification + * @function getTypeUrl + * @memberof google.cloud.batch.v1.JobNotification + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobNotification.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.JobNotification"; + }; + + JobNotification.Message = (function() { + + /** + * Properties of a Message. + * @memberof google.cloud.batch.v1.JobNotification + * @interface IMessage + * @property {google.cloud.batch.v1.JobNotification.Type|null} [type] Message type + * @property {google.cloud.batch.v1.JobStatus.State|null} [newJobState] Message newJobState + * @property {google.cloud.batch.v1.TaskStatus.State|null} [newTaskState] Message newTaskState + */ + + /** + * Constructs a new Message. + * @memberof google.cloud.batch.v1.JobNotification + * @classdesc Represents a Message. + * @implements IMessage + * @constructor + * @param {google.cloud.batch.v1.JobNotification.IMessage=} [properties] Properties to set + */ + function Message(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Message type. + * @member {google.cloud.batch.v1.JobNotification.Type} type + * @memberof google.cloud.batch.v1.JobNotification.Message + * @instance + */ + Message.prototype.type = 0; + + /** + * Message newJobState. + * @member {google.cloud.batch.v1.JobStatus.State} newJobState + * @memberof google.cloud.batch.v1.JobNotification.Message + * @instance + */ + Message.prototype.newJobState = 0; + + /** + * Message newTaskState. + * @member {google.cloud.batch.v1.TaskStatus.State} newTaskState + * @memberof google.cloud.batch.v1.JobNotification.Message + * @instance + */ + Message.prototype.newTaskState = 0; + + /** + * Creates a new Message instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.JobNotification.Message + * @static + * @param {google.cloud.batch.v1.JobNotification.IMessage=} [properties] Properties to set + * @returns {google.cloud.batch.v1.JobNotification.Message} Message instance + */ + Message.create = function create(properties) { + return new Message(properties); + }; + + /** + * Encodes the specified Message message. Does not implicitly {@link google.cloud.batch.v1.JobNotification.Message.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.JobNotification.Message + * @static + * @param {google.cloud.batch.v1.JobNotification.IMessage} message Message message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Message.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.newJobState != null && Object.hasOwnProperty.call(message, "newJobState")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.newJobState); + if (message.newTaskState != null && Object.hasOwnProperty.call(message, "newTaskState")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.newTaskState); + return writer; + }; + + /** + * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobNotification.Message.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.JobNotification.Message + * @static + * @param {google.cloud.batch.v1.JobNotification.IMessage} message Message message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Message.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Message message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.JobNotification.Message + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.JobNotification.Message} Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Message.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.JobNotification.Message(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.newJobState = reader.int32(); + break; + } + case 3: { + message.newTaskState = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Message message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.JobNotification.Message + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.JobNotification.Message} Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Message.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Message message. + * @function verify + * @memberof google.cloud.batch.v1.JobNotification.Message + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Message.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.newJobState != null && message.hasOwnProperty("newJobState")) + switch (message.newJobState) { + default: + return "newJobState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.newTaskState != null && message.hasOwnProperty("newTaskState")) + switch (message.newTaskState) { + default: + return "newTaskState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + return null; + }; + + /** + * Creates a Message message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.JobNotification.Message + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.JobNotification.Message} Message + */ + Message.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.JobNotification.Message) + return object; + var message = new $root.google.cloud.batch.v1.JobNotification.Message(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "JOB_STATE_CHANGED": + case 1: + message.type = 1; + break; + case "TASK_STATE_CHANGED": + case 2: + message.type = 2; + break; + } + switch (object.newJobState) { + default: + if (typeof object.newJobState === "number") { + message.newJobState = object.newJobState; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.newJobState = 0; + break; + case "QUEUED": + case 1: + message.newJobState = 1; + break; + case "SCHEDULED": + case 2: + message.newJobState = 2; + break; + case "RUNNING": + case 3: + message.newJobState = 3; + break; + case "SUCCEEDED": + case 4: + message.newJobState = 4; + break; + case "FAILED": + case 5: + message.newJobState = 5; + break; + case "DELETION_IN_PROGRESS": + case 6: + message.newJobState = 6; + break; + } + switch (object.newTaskState) { + default: + if (typeof object.newTaskState === "number") { + message.newTaskState = object.newTaskState; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.newTaskState = 0; + break; + case "PENDING": + case 1: + message.newTaskState = 1; + break; + case "ASSIGNED": + case 2: + message.newTaskState = 2; + break; + case "RUNNING": + case 3: + message.newTaskState = 3; + break; + case "FAILED": + case 4: + message.newTaskState = 4; + break; + case "SUCCEEDED": + case 5: + message.newTaskState = 5; + break; + case "UNEXECUTED": + case 6: + message.newTaskState = 6; + break; + } + return message; + }; + + /** + * Creates a plain object from a Message message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.JobNotification.Message + * @static + * @param {google.cloud.batch.v1.JobNotification.Message} message Message + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Message.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.newJobState = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.newTaskState = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.batch.v1.JobNotification.Type[message.type] === undefined ? message.type : $root.google.cloud.batch.v1.JobNotification.Type[message.type] : message.type; + if (message.newJobState != null && message.hasOwnProperty("newJobState")) + object.newJobState = options.enums === String ? $root.google.cloud.batch.v1.JobStatus.State[message.newJobState] === undefined ? message.newJobState : $root.google.cloud.batch.v1.JobStatus.State[message.newJobState] : message.newJobState; + if (message.newTaskState != null && message.hasOwnProperty("newTaskState")) + object.newTaskState = options.enums === String ? $root.google.cloud.batch.v1.TaskStatus.State[message.newTaskState] === undefined ? message.newTaskState : $root.google.cloud.batch.v1.TaskStatus.State[message.newTaskState] : message.newTaskState; + return object; + }; + + /** + * Converts this Message to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.JobNotification.Message + * @instance + * @returns {Object.} JSON object + */ + Message.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Message + * @function getTypeUrl + * @memberof google.cloud.batch.v1.JobNotification.Message + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Message.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.JobNotification.Message"; + }; + + return Message; + })(); + + /** + * Type enum. + * @name google.cloud.batch.v1.JobNotification.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} JOB_STATE_CHANGED=1 JOB_STATE_CHANGED value + * @property {number} TASK_STATE_CHANGED=2 TASK_STATE_CHANGED value + */ + JobNotification.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "JOB_STATE_CHANGED"] = 1; + values[valuesById[2] = "TASK_STATE_CHANGED"] = 2; + return values; + })(); + + return JobNotification; + })(); + + v1.AllocationPolicy = (function() { + + /** + * Properties of an AllocationPolicy. + * @memberof google.cloud.batch.v1 + * @interface IAllocationPolicy + * @property {google.cloud.batch.v1.AllocationPolicy.ILocationPolicy|null} [location] AllocationPolicy location + * @property {Array.|null} [instances] AllocationPolicy instances + * @property {google.cloud.batch.v1.IServiceAccount|null} [serviceAccount] AllocationPolicy serviceAccount + * @property {Object.|null} [labels] AllocationPolicy labels + * @property {google.cloud.batch.v1.AllocationPolicy.INetworkPolicy|null} [network] AllocationPolicy network + * @property {google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy|null} [placement] AllocationPolicy placement + * @property {Array.|null} [tags] AllocationPolicy tags + */ + + /** + * Constructs a new AllocationPolicy. + * @memberof google.cloud.batch.v1 + * @classdesc Represents an AllocationPolicy. + * @implements IAllocationPolicy + * @constructor + * @param {google.cloud.batch.v1.IAllocationPolicy=} [properties] Properties to set + */ + function AllocationPolicy(properties) { + this.instances = []; + this.labels = {}; + this.tags = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AllocationPolicy location. + * @member {google.cloud.batch.v1.AllocationPolicy.ILocationPolicy|null|undefined} location + * @memberof google.cloud.batch.v1.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.location = null; + + /** + * AllocationPolicy instances. + * @member {Array.} instances + * @memberof google.cloud.batch.v1.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.instances = $util.emptyArray; + + /** + * AllocationPolicy serviceAccount. + * @member {google.cloud.batch.v1.IServiceAccount|null|undefined} serviceAccount + * @memberof google.cloud.batch.v1.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.serviceAccount = null; + + /** + * AllocationPolicy labels. + * @member {Object.} labels + * @memberof google.cloud.batch.v1.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.labels = $util.emptyObject; + + /** + * AllocationPolicy network. + * @member {google.cloud.batch.v1.AllocationPolicy.INetworkPolicy|null|undefined} network + * @memberof google.cloud.batch.v1.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.network = null; + + /** + * AllocationPolicy placement. + * @member {google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy|null|undefined} placement + * @memberof google.cloud.batch.v1.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.placement = null; + + /** + * AllocationPolicy tags. + * @member {Array.} tags + * @memberof google.cloud.batch.v1.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.tags = $util.emptyArray; + + /** + * Creates a new AllocationPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.AllocationPolicy + * @static + * @param {google.cloud.batch.v1.IAllocationPolicy=} [properties] Properties to set + * @returns {google.cloud.batch.v1.AllocationPolicy} AllocationPolicy instance + */ + AllocationPolicy.create = function create(properties) { + return new AllocationPolicy(properties); + }; + + /** + * Encodes the specified AllocationPolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.AllocationPolicy + * @static + * @param {google.cloud.batch.v1.IAllocationPolicy} message AllocationPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllocationPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + $root.google.cloud.batch.v1.AllocationPolicy.LocationPolicy.encode(message.location, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + $root.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.encode(message.network, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.encode(message.instances[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + $root.google.cloud.batch.v1.ServiceAccount.encode(message.serviceAccount, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.placement != null && Object.hasOwnProperty.call(message, "placement")) + $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.encode(message.placement, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.tags != null && message.tags.length) + for (var i = 0; i < message.tags.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.tags[i]); + return writer; + }; + + /** + * Encodes the specified AllocationPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy + * @static + * @param {google.cloud.batch.v1.IAllocationPolicy} message AllocationPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllocationPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AllocationPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.AllocationPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.AllocationPolicy} AllocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllocationPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.location = $root.google.cloud.batch.v1.AllocationPolicy.LocationPolicy.decode(reader, reader.uint32()); + break; + } + case 8: { + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.decode(reader, reader.uint32())); + break; + } + case 9: { + message.serviceAccount = $root.google.cloud.batch.v1.ServiceAccount.decode(reader, reader.uint32()); + break; + } + case 6: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 7: { + message.network = $root.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.decode(reader, reader.uint32()); + break; + } + case 10: { + message.placement = $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.decode(reader, reader.uint32()); + break; + } + case 11: { + if (!(message.tags && message.tags.length)) + message.tags = []; + message.tags.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AllocationPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.AllocationPolicy} AllocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllocationPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AllocationPolicy message. + * @function verify + * @memberof google.cloud.batch.v1.AllocationPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AllocationPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + var error = $root.google.cloud.batch.v1.AllocationPolicy.LocationPolicy.verify(message.location); + if (error) + return "location." + error; + } + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) { + var error = $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) { + var error = $root.google.cloud.batch.v1.ServiceAccount.verify(message.serviceAccount); + if (error) + return "serviceAccount." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.network != null && message.hasOwnProperty("network")) { + var error = $root.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.verify(message.network); + if (error) + return "network." + error; + } + if (message.placement != null && message.hasOwnProperty("placement")) { + var error = $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.verify(message.placement); + if (error) + return "placement." + error; + } + if (message.tags != null && message.hasOwnProperty("tags")) { + if (!Array.isArray(message.tags)) + return "tags: array expected"; + for (var i = 0; i < message.tags.length; ++i) + if (!$util.isString(message.tags[i])) + return "tags: string[] expected"; + } + return null; + }; + + /** + * Creates an AllocationPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.AllocationPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.AllocationPolicy} AllocationPolicy + */ + AllocationPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy) + return object; + var message = new $root.google.cloud.batch.v1.AllocationPolicy(); + if (object.location != null) { + if (typeof object.location !== "object") + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.location: object expected"); + message.location = $root.google.cloud.batch.v1.AllocationPolicy.LocationPolicy.fromObject(object.location); + } + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.instances: object expected"); + message.instances[i] = $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.fromObject(object.instances[i]); + } + } + if (object.serviceAccount != null) { + if (typeof object.serviceAccount !== "object") + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.serviceAccount: object expected"); + message.serviceAccount = $root.google.cloud.batch.v1.ServiceAccount.fromObject(object.serviceAccount); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.network != null) { + if (typeof object.network !== "object") + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.network: object expected"); + message.network = $root.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.fromObject(object.network); + } + if (object.placement != null) { + if (typeof object.placement !== "object") + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.placement: object expected"); + message.placement = $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.fromObject(object.placement); + } + if (object.tags) { + if (!Array.isArray(object.tags)) + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.tags: array expected"); + message.tags = []; + for (var i = 0; i < object.tags.length; ++i) + message.tags[i] = String(object.tags[i]); + } + return message; + }; + + /** + * Creates a plain object from an AllocationPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.AllocationPolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy} message AllocationPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AllocationPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.instances = []; + object.tags = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.location = null; + object.network = null; + object.serviceAccount = null; + object.placement = null; + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = $root.google.cloud.batch.v1.AllocationPolicy.LocationPolicy.toObject(message.location, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.network != null && message.hasOwnProperty("network")) + object.network = $root.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.toObject(message.network, options); + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.toObject(message.instances[j], options); + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = $root.google.cloud.batch.v1.ServiceAccount.toObject(message.serviceAccount, options); + if (message.placement != null && message.hasOwnProperty("placement")) + object.placement = $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.toObject(message.placement, options); + if (message.tags && message.tags.length) { + object.tags = []; + for (var j = 0; j < message.tags.length; ++j) + object.tags[j] = message.tags[j]; + } + return object; + }; + + /** + * Converts this AllocationPolicy to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.AllocationPolicy + * @instance + * @returns {Object.} JSON object + */ + AllocationPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AllocationPolicy + * @function getTypeUrl + * @memberof google.cloud.batch.v1.AllocationPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AllocationPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy"; + }; + + AllocationPolicy.LocationPolicy = (function() { + + /** + * Properties of a LocationPolicy. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @interface ILocationPolicy + * @property {Array.|null} [allowedLocations] LocationPolicy allowedLocations + */ + + /** + * Constructs a new LocationPolicy. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @classdesc Represents a LocationPolicy. + * @implements ILocationPolicy + * @constructor + * @param {google.cloud.batch.v1.AllocationPolicy.ILocationPolicy=} [properties] Properties to set + */ + function LocationPolicy(properties) { + this.allowedLocations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LocationPolicy allowedLocations. + * @member {Array.} allowedLocations + * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy + * @instance + */ + LocationPolicy.prototype.allowedLocations = $util.emptyArray; + + /** + * Creates a new LocationPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.ILocationPolicy=} [properties] Properties to set + * @returns {google.cloud.batch.v1.AllocationPolicy.LocationPolicy} LocationPolicy instance + */ + LocationPolicy.create = function create(properties) { + return new LocationPolicy(properties); + }; + + /** + * Encodes the specified LocationPolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.LocationPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.ILocationPolicy} message LocationPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedLocations != null && message.allowedLocations.length) + for (var i = 0; i < message.allowedLocations.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedLocations[i]); + return writer; + }; + + /** + * Encodes the specified LocationPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.LocationPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.ILocationPolicy} message LocationPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocationPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.AllocationPolicy.LocationPolicy} LocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy.LocationPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.allowedLocations && message.allowedLocations.length)) + message.allowedLocations = []; + message.allowedLocations.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocationPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.AllocationPolicy.LocationPolicy} LocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocationPolicy message. + * @function verify + * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocationPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowedLocations != null && message.hasOwnProperty("allowedLocations")) { + if (!Array.isArray(message.allowedLocations)) + return "allowedLocations: array expected"; + for (var i = 0; i < message.allowedLocations.length; ++i) + if (!$util.isString(message.allowedLocations[i])) + return "allowedLocations: string[] expected"; + } + return null; + }; + + /** + * Creates a LocationPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.AllocationPolicy.LocationPolicy} LocationPolicy + */ + LocationPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy.LocationPolicy) + return object; + var message = new $root.google.cloud.batch.v1.AllocationPolicy.LocationPolicy(); + if (object.allowedLocations) { + if (!Array.isArray(object.allowedLocations)) + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.LocationPolicy.allowedLocations: array expected"); + message.allowedLocations = []; + for (var i = 0; i < object.allowedLocations.length; ++i) + message.allowedLocations[i] = String(object.allowedLocations[i]); + } + return message; + }; + + /** + * Creates a plain object from a LocationPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.LocationPolicy} message LocationPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocationPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedLocations = []; + if (message.allowedLocations && message.allowedLocations.length) { + object.allowedLocations = []; + for (var j = 0; j < message.allowedLocations.length; ++j) + object.allowedLocations[j] = message.allowedLocations[j]; + } + return object; + }; + + /** + * Converts this LocationPolicy to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy + * @instance + * @returns {Object.} JSON object + */ + LocationPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LocationPolicy + * @function getTypeUrl + * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LocationPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy.LocationPolicy"; + }; + + return LocationPolicy; + })(); + + AllocationPolicy.Disk = (function() { + + /** + * Properties of a Disk. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @interface IDisk + * @property {string|null} [image] Disk image + * @property {string|null} [snapshot] Disk snapshot + * @property {string|null} [type] Disk type + * @property {number|Long|null} [sizeGb] Disk sizeGb + * @property {string|null} [diskInterface] Disk diskInterface + */ + + /** + * Constructs a new Disk. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @classdesc Represents a Disk. + * @implements IDisk + * @constructor + * @param {google.cloud.batch.v1.AllocationPolicy.IDisk=} [properties] Properties to set + */ + function Disk(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Disk image. + * @member {string|null|undefined} image + * @memberof google.cloud.batch.v1.AllocationPolicy.Disk + * @instance + */ + Disk.prototype.image = null; + + /** + * Disk snapshot. + * @member {string|null|undefined} snapshot + * @memberof google.cloud.batch.v1.AllocationPolicy.Disk + * @instance + */ + Disk.prototype.snapshot = null; + + /** + * Disk type. + * @member {string} type + * @memberof google.cloud.batch.v1.AllocationPolicy.Disk + * @instance + */ + Disk.prototype.type = ""; + + /** + * Disk sizeGb. + * @member {number|Long} sizeGb + * @memberof google.cloud.batch.v1.AllocationPolicy.Disk + * @instance + */ + Disk.prototype.sizeGb = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk diskInterface. + * @member {string} diskInterface + * @memberof google.cloud.batch.v1.AllocationPolicy.Disk + * @instance + */ + Disk.prototype.diskInterface = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Disk dataSource. + * @member {"image"|"snapshot"|undefined} dataSource + * @memberof google.cloud.batch.v1.AllocationPolicy.Disk + * @instance + */ + Object.defineProperty(Disk.prototype, "dataSource", { + get: $util.oneOfGetter($oneOfFields = ["image", "snapshot"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Disk instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.AllocationPolicy.Disk + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IDisk=} [properties] Properties to set + * @returns {google.cloud.batch.v1.AllocationPolicy.Disk} Disk instance + */ + Disk.create = function create(properties) { + return new Disk(properties); + }; + + /** + * Encodes the specified Disk message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.Disk.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.AllocationPolicy.Disk + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IDisk} message Disk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Disk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.sizeGb != null && Object.hasOwnProperty.call(message, "sizeGb")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.sizeGb); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.image); + if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.snapshot); + if (message.diskInterface != null && Object.hasOwnProperty.call(message, "diskInterface")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.diskInterface); + return writer; + }; + + /** + * Encodes the specified Disk message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.Disk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.Disk + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IDisk} message Disk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Disk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Disk message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.AllocationPolicy.Disk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.AllocationPolicy.Disk} Disk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Disk.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy.Disk(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.image = reader.string(); + break; + } + case 5: { + message.snapshot = reader.string(); + break; + } + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.sizeGb = reader.int64(); + break; + } + case 6: { + message.diskInterface = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Disk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.Disk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.AllocationPolicy.Disk} Disk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Disk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Disk message. + * @function verify + * @memberof google.cloud.batch.v1.AllocationPolicy.Disk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Disk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.image != null && message.hasOwnProperty("image")) { + properties.dataSource = 1; + if (!$util.isString(message.image)) + return "image: string expected"; + } + if (message.snapshot != null && message.hasOwnProperty("snapshot")) { + if (properties.dataSource === 1) + return "dataSource: multiple values"; + properties.dataSource = 1; + if (!$util.isString(message.snapshot)) + return "snapshot: string expected"; + } + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) + if (!$util.isInteger(message.sizeGb) && !(message.sizeGb && $util.isInteger(message.sizeGb.low) && $util.isInteger(message.sizeGb.high))) + return "sizeGb: integer|Long expected"; + if (message.diskInterface != null && message.hasOwnProperty("diskInterface")) + if (!$util.isString(message.diskInterface)) + return "diskInterface: string expected"; + return null; + }; + + /** + * Creates a Disk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.AllocationPolicy.Disk + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.AllocationPolicy.Disk} Disk + */ + Disk.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy.Disk) + return object; + var message = new $root.google.cloud.batch.v1.AllocationPolicy.Disk(); + if (object.image != null) + message.image = String(object.image); + if (object.snapshot != null) + message.snapshot = String(object.snapshot); + if (object.type != null) + message.type = String(object.type); + if (object.sizeGb != null) + if ($util.Long) + (message.sizeGb = $util.Long.fromValue(object.sizeGb)).unsigned = false; + else if (typeof object.sizeGb === "string") + message.sizeGb = parseInt(object.sizeGb, 10); + else if (typeof object.sizeGb === "number") + message.sizeGb = object.sizeGb; + else if (typeof object.sizeGb === "object") + message.sizeGb = new $util.LongBits(object.sizeGb.low >>> 0, object.sizeGb.high >>> 0).toNumber(); + if (object.diskInterface != null) + message.diskInterface = String(object.diskInterface); + return message; + }; + + /** + * Creates a plain object from a Disk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.AllocationPolicy.Disk + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.Disk} message Disk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Disk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.sizeGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sizeGb = options.longs === String ? "0" : 0; + object.diskInterface = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) + if (typeof message.sizeGb === "number") + object.sizeGb = options.longs === String ? String(message.sizeGb) : message.sizeGb; + else + object.sizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.sizeGb) : options.longs === Number ? new $util.LongBits(message.sizeGb.low >>> 0, message.sizeGb.high >>> 0).toNumber() : message.sizeGb; + if (message.image != null && message.hasOwnProperty("image")) { + object.image = message.image; + if (options.oneofs) + object.dataSource = "image"; + } + if (message.snapshot != null && message.hasOwnProperty("snapshot")) { + object.snapshot = message.snapshot; + if (options.oneofs) + object.dataSource = "snapshot"; + } + if (message.diskInterface != null && message.hasOwnProperty("diskInterface")) + object.diskInterface = message.diskInterface; + return object; + }; + + /** + * Converts this Disk to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.AllocationPolicy.Disk + * @instance + * @returns {Object.} JSON object + */ + Disk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Disk + * @function getTypeUrl + * @memberof google.cloud.batch.v1.AllocationPolicy.Disk + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Disk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy.Disk"; + }; + + return Disk; + })(); + + AllocationPolicy.AttachedDisk = (function() { + + /** + * Properties of an AttachedDisk. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @interface IAttachedDisk + * @property {google.cloud.batch.v1.AllocationPolicy.IDisk|null} [newDisk] AttachedDisk newDisk + * @property {string|null} [existingDisk] AttachedDisk existingDisk + * @property {string|null} [deviceName] AttachedDisk deviceName + */ + + /** + * Constructs a new AttachedDisk. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @classdesc Represents an AttachedDisk. + * @implements IAttachedDisk + * @constructor + * @param {google.cloud.batch.v1.AllocationPolicy.IAttachedDisk=} [properties] Properties to set + */ + function AttachedDisk(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AttachedDisk newDisk. + * @member {google.cloud.batch.v1.AllocationPolicy.IDisk|null|undefined} newDisk + * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk + * @instance + */ + AttachedDisk.prototype.newDisk = null; + + /** + * AttachedDisk existingDisk. + * @member {string|null|undefined} existingDisk + * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk + * @instance + */ + AttachedDisk.prototype.existingDisk = null; + + /** + * AttachedDisk deviceName. + * @member {string} deviceName + * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk + * @instance + */ + AttachedDisk.prototype.deviceName = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AttachedDisk attached. + * @member {"newDisk"|"existingDisk"|undefined} attached + * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "attached", { + get: $util.oneOfGetter($oneOfFields = ["newDisk", "existingDisk"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AttachedDisk instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IAttachedDisk=} [properties] Properties to set + * @returns {google.cloud.batch.v1.AllocationPolicy.AttachedDisk} AttachedDisk instance + */ + AttachedDisk.create = function create(properties) { + return new AttachedDisk(properties); + }; + + /** + * Encodes the specified AttachedDisk message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.AttachedDisk.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IAttachedDisk} message AttachedDisk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttachedDisk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.newDisk != null && Object.hasOwnProperty.call(message, "newDisk")) + $root.google.cloud.batch.v1.AllocationPolicy.Disk.encode(message.newDisk, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.existingDisk != null && Object.hasOwnProperty.call(message, "existingDisk")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.existingDisk); + if (message.deviceName != null && Object.hasOwnProperty.call(message, "deviceName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.deviceName); + return writer; + }; + + /** + * Encodes the specified AttachedDisk message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.AttachedDisk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IAttachedDisk} message AttachedDisk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttachedDisk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttachedDisk message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.AllocationPolicy.AttachedDisk} AttachedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttachedDisk.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy.AttachedDisk(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.newDisk = $root.google.cloud.batch.v1.AllocationPolicy.Disk.decode(reader, reader.uint32()); + break; + } + case 2: { + message.existingDisk = reader.string(); + break; + } + case 3: { + message.deviceName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttachedDisk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.AllocationPolicy.AttachedDisk} AttachedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttachedDisk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttachedDisk message. + * @function verify + * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttachedDisk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.newDisk != null && message.hasOwnProperty("newDisk")) { + properties.attached = 1; + { + var error = $root.google.cloud.batch.v1.AllocationPolicy.Disk.verify(message.newDisk); + if (error) + return "newDisk." + error; + } + } + if (message.existingDisk != null && message.hasOwnProperty("existingDisk")) { + if (properties.attached === 1) + return "attached: multiple values"; + properties.attached = 1; + if (!$util.isString(message.existingDisk)) + return "existingDisk: string expected"; + } + if (message.deviceName != null && message.hasOwnProperty("deviceName")) + if (!$util.isString(message.deviceName)) + return "deviceName: string expected"; + return null; + }; + + /** + * Creates an AttachedDisk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.AllocationPolicy.AttachedDisk} AttachedDisk + */ + AttachedDisk.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy.AttachedDisk) + return object; + var message = new $root.google.cloud.batch.v1.AllocationPolicy.AttachedDisk(); + if (object.newDisk != null) { + if (typeof object.newDisk !== "object") + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.AttachedDisk.newDisk: object expected"); + message.newDisk = $root.google.cloud.batch.v1.AllocationPolicy.Disk.fromObject(object.newDisk); + } + if (object.existingDisk != null) + message.existingDisk = String(object.existingDisk); + if (object.deviceName != null) + message.deviceName = String(object.deviceName); + return message; + }; + + /** + * Creates a plain object from an AttachedDisk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.AttachedDisk} message AttachedDisk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttachedDisk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.deviceName = ""; + if (message.newDisk != null && message.hasOwnProperty("newDisk")) { + object.newDisk = $root.google.cloud.batch.v1.AllocationPolicy.Disk.toObject(message.newDisk, options); + if (options.oneofs) + object.attached = "newDisk"; + } + if (message.existingDisk != null && message.hasOwnProperty("existingDisk")) { + object.existingDisk = message.existingDisk; + if (options.oneofs) + object.attached = "existingDisk"; + } + if (message.deviceName != null && message.hasOwnProperty("deviceName")) + object.deviceName = message.deviceName; + return object; + }; + + /** + * Converts this AttachedDisk to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk + * @instance + * @returns {Object.} JSON object + */ + AttachedDisk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AttachedDisk + * @function getTypeUrl + * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AttachedDisk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy.AttachedDisk"; + }; + + return AttachedDisk; + })(); + + AllocationPolicy.Accelerator = (function() { + + /** + * Properties of an Accelerator. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @interface IAccelerator + * @property {string|null} [type] Accelerator type + * @property {number|Long|null} [count] Accelerator count + * @property {boolean|null} [installGpuDrivers] Accelerator installGpuDrivers + * @property {string|null} [driverVersion] Accelerator driverVersion + */ + + /** + * Constructs a new Accelerator. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @classdesc Represents an Accelerator. + * @implements IAccelerator + * @constructor + * @param {google.cloud.batch.v1.AllocationPolicy.IAccelerator=} [properties] Properties to set + */ + function Accelerator(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Accelerator type. + * @member {string} type + * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator + * @instance + */ + Accelerator.prototype.type = ""; + + /** + * Accelerator count. + * @member {number|Long} count + * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator + * @instance + */ + Accelerator.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Accelerator installGpuDrivers. + * @member {boolean} installGpuDrivers + * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator + * @instance + */ + Accelerator.prototype.installGpuDrivers = false; + + /** + * Accelerator driverVersion. + * @member {string} driverVersion + * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator + * @instance + */ + Accelerator.prototype.driverVersion = ""; + + /** + * Creates a new Accelerator instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IAccelerator=} [properties] Properties to set + * @returns {google.cloud.batch.v1.AllocationPolicy.Accelerator} Accelerator instance + */ + Accelerator.create = function create(properties) { + return new Accelerator(properties); + }; + + /** + * Encodes the specified Accelerator message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.Accelerator.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IAccelerator} message Accelerator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Accelerator.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); + if (message.installGpuDrivers != null && Object.hasOwnProperty.call(message, "installGpuDrivers")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.installGpuDrivers); + if (message.driverVersion != null && Object.hasOwnProperty.call(message, "driverVersion")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.driverVersion); + return writer; + }; + + /** + * Encodes the specified Accelerator message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.Accelerator.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IAccelerator} message Accelerator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Accelerator.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Accelerator message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.AllocationPolicy.Accelerator} Accelerator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Accelerator.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy.Accelerator(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.count = reader.int64(); + break; + } + case 3: { + message.installGpuDrivers = reader.bool(); + break; + } + case 4: { + message.driverVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Accelerator message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.AllocationPolicy.Accelerator} Accelerator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Accelerator.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Accelerator message. + * @function verify + * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Accelerator.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + if (message.installGpuDrivers != null && message.hasOwnProperty("installGpuDrivers")) + if (typeof message.installGpuDrivers !== "boolean") + return "installGpuDrivers: boolean expected"; + if (message.driverVersion != null && message.hasOwnProperty("driverVersion")) + if (!$util.isString(message.driverVersion)) + return "driverVersion: string expected"; + return null; + }; + + /** + * Creates an Accelerator message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.AllocationPolicy.Accelerator} Accelerator + */ + Accelerator.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy.Accelerator) + return object; + var message = new $root.google.cloud.batch.v1.AllocationPolicy.Accelerator(); + if (object.type != null) + message.type = String(object.type); + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + if (object.installGpuDrivers != null) + message.installGpuDrivers = Boolean(object.installGpuDrivers); + if (object.driverVersion != null) + message.driverVersion = String(object.driverVersion); + return message; + }; + + /** + * Creates a plain object from an Accelerator message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.Accelerator} message Accelerator + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Accelerator.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + object.installGpuDrivers = false; + object.driverVersion = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + if (message.installGpuDrivers != null && message.hasOwnProperty("installGpuDrivers")) + object.installGpuDrivers = message.installGpuDrivers; + if (message.driverVersion != null && message.hasOwnProperty("driverVersion")) + object.driverVersion = message.driverVersion; + return object; + }; + + /** + * Converts this Accelerator to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator + * @instance + * @returns {Object.} JSON object + */ + Accelerator.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Accelerator + * @function getTypeUrl + * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Accelerator.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy.Accelerator"; + }; + + return Accelerator; + })(); + + AllocationPolicy.InstancePolicy = (function() { + + /** + * Properties of an InstancePolicy. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @interface IInstancePolicy + * @property {string|null} [machineType] InstancePolicy machineType + * @property {string|null} [minCpuPlatform] InstancePolicy minCpuPlatform + * @property {google.cloud.batch.v1.AllocationPolicy.ProvisioningModel|null} [provisioningModel] InstancePolicy provisioningModel + * @property {Array.|null} [accelerators] InstancePolicy accelerators + * @property {google.cloud.batch.v1.AllocationPolicy.IDisk|null} [bootDisk] InstancePolicy bootDisk + * @property {Array.|null} [disks] InstancePolicy disks + * @property {string|null} [reservation] InstancePolicy reservation + */ + + /** + * Constructs a new InstancePolicy. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @classdesc Represents an InstancePolicy. + * @implements IInstancePolicy + * @constructor + * @param {google.cloud.batch.v1.AllocationPolicy.IInstancePolicy=} [properties] Properties to set + */ + function InstancePolicy(properties) { + this.accelerators = []; + this.disks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstancePolicy machineType. + * @member {string} machineType + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy + * @instance + */ + InstancePolicy.prototype.machineType = ""; + + /** + * InstancePolicy minCpuPlatform. + * @member {string} minCpuPlatform + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy + * @instance + */ + InstancePolicy.prototype.minCpuPlatform = ""; + + /** + * InstancePolicy provisioningModel. + * @member {google.cloud.batch.v1.AllocationPolicy.ProvisioningModel} provisioningModel + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy + * @instance + */ + InstancePolicy.prototype.provisioningModel = 0; + + /** + * InstancePolicy accelerators. + * @member {Array.} accelerators + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy + * @instance + */ + InstancePolicy.prototype.accelerators = $util.emptyArray; + + /** + * InstancePolicy bootDisk. + * @member {google.cloud.batch.v1.AllocationPolicy.IDisk|null|undefined} bootDisk + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy + * @instance + */ + InstancePolicy.prototype.bootDisk = null; + + /** + * InstancePolicy disks. + * @member {Array.} disks + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy + * @instance + */ + InstancePolicy.prototype.disks = $util.emptyArray; + + /** + * InstancePolicy reservation. + * @member {string} reservation + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy + * @instance + */ + InstancePolicy.prototype.reservation = ""; + + /** + * Creates a new InstancePolicy instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IInstancePolicy=} [properties] Properties to set + * @returns {google.cloud.batch.v1.AllocationPolicy.InstancePolicy} InstancePolicy instance + */ + InstancePolicy.create = function create(properties) { + return new InstancePolicy(properties); + }; + + /** + * Encodes the specified InstancePolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.InstancePolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IInstancePolicy} message InstancePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancePolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.machineType); + if (message.minCpuPlatform != null && Object.hasOwnProperty.call(message, "minCpuPlatform")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.minCpuPlatform); + if (message.provisioningModel != null && Object.hasOwnProperty.call(message, "provisioningModel")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.provisioningModel); + if (message.accelerators != null && message.accelerators.length) + for (var i = 0; i < message.accelerators.length; ++i) + $root.google.cloud.batch.v1.AllocationPolicy.Accelerator.encode(message.accelerators[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.disks != null && message.disks.length) + for (var i = 0; i < message.disks.length; ++i) + $root.google.cloud.batch.v1.AllocationPolicy.AttachedDisk.encode(message.disks[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.reservation != null && Object.hasOwnProperty.call(message, "reservation")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.reservation); + if (message.bootDisk != null && Object.hasOwnProperty.call(message, "bootDisk")) + $root.google.cloud.batch.v1.AllocationPolicy.Disk.encode(message.bootDisk, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstancePolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.InstancePolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IInstancePolicy} message InstancePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancePolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstancePolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.AllocationPolicy.InstancePolicy} InstancePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancePolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.machineType = reader.string(); + break; + } + case 3: { + message.minCpuPlatform = reader.string(); + break; + } + case 4: { + message.provisioningModel = reader.int32(); + break; + } + case 5: { + if (!(message.accelerators && message.accelerators.length)) + message.accelerators = []; + message.accelerators.push($root.google.cloud.batch.v1.AllocationPolicy.Accelerator.decode(reader, reader.uint32())); + break; + } + case 8: { + message.bootDisk = $root.google.cloud.batch.v1.AllocationPolicy.Disk.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.disks && message.disks.length)) + message.disks = []; + message.disks.push($root.google.cloud.batch.v1.AllocationPolicy.AttachedDisk.decode(reader, reader.uint32())); + break; + } + case 7: { + message.reservation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstancePolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.AllocationPolicy.InstancePolicy} InstancePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancePolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstancePolicy message. + * @function verify + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstancePolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.machineType != null && message.hasOwnProperty("machineType")) + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) + if (!$util.isString(message.minCpuPlatform)) + return "minCpuPlatform: string expected"; + if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) + switch (message.provisioningModel) { + default: + return "provisioningModel: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.accelerators != null && message.hasOwnProperty("accelerators")) { + if (!Array.isArray(message.accelerators)) + return "accelerators: array expected"; + for (var i = 0; i < message.accelerators.length; ++i) { + var error = $root.google.cloud.batch.v1.AllocationPolicy.Accelerator.verify(message.accelerators[i]); + if (error) + return "accelerators." + error; + } + } + if (message.bootDisk != null && message.hasOwnProperty("bootDisk")) { + var error = $root.google.cloud.batch.v1.AllocationPolicy.Disk.verify(message.bootDisk); + if (error) + return "bootDisk." + error; + } + if (message.disks != null && message.hasOwnProperty("disks")) { + if (!Array.isArray(message.disks)) + return "disks: array expected"; + for (var i = 0; i < message.disks.length; ++i) { + var error = $root.google.cloud.batch.v1.AllocationPolicy.AttachedDisk.verify(message.disks[i]); + if (error) + return "disks." + error; + } + } + if (message.reservation != null && message.hasOwnProperty("reservation")) + if (!$util.isString(message.reservation)) + return "reservation: string expected"; + return null; + }; + + /** + * Creates an InstancePolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.AllocationPolicy.InstancePolicy} InstancePolicy + */ + InstancePolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicy) + return object; + var message = new $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicy(); + if (object.machineType != null) + message.machineType = String(object.machineType); + if (object.minCpuPlatform != null) + message.minCpuPlatform = String(object.minCpuPlatform); + switch (object.provisioningModel) { + default: + if (typeof object.provisioningModel === "number") { + message.provisioningModel = object.provisioningModel; + break; + } + break; + case "PROVISIONING_MODEL_UNSPECIFIED": + case 0: + message.provisioningModel = 0; + break; + case "STANDARD": + case 1: + message.provisioningModel = 1; + break; + case "SPOT": + case 2: + message.provisioningModel = 2; + break; + case "PREEMPTIBLE": + case 3: + message.provisioningModel = 3; + break; + } + if (object.accelerators) { + if (!Array.isArray(object.accelerators)) + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.InstancePolicy.accelerators: array expected"); + message.accelerators = []; + for (var i = 0; i < object.accelerators.length; ++i) { + if (typeof object.accelerators[i] !== "object") + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.InstancePolicy.accelerators: object expected"); + message.accelerators[i] = $root.google.cloud.batch.v1.AllocationPolicy.Accelerator.fromObject(object.accelerators[i]); + } + } + if (object.bootDisk != null) { + if (typeof object.bootDisk !== "object") + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.InstancePolicy.bootDisk: object expected"); + message.bootDisk = $root.google.cloud.batch.v1.AllocationPolicy.Disk.fromObject(object.bootDisk); + } + if (object.disks) { + if (!Array.isArray(object.disks)) + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.InstancePolicy.disks: array expected"); + message.disks = []; + for (var i = 0; i < object.disks.length; ++i) { + if (typeof object.disks[i] !== "object") + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.InstancePolicy.disks: object expected"); + message.disks[i] = $root.google.cloud.batch.v1.AllocationPolicy.AttachedDisk.fromObject(object.disks[i]); + } + } + if (object.reservation != null) + message.reservation = String(object.reservation); + return message; + }; + + /** + * Creates a plain object from an InstancePolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.InstancePolicy} message InstancePolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstancePolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.accelerators = []; + object.disks = []; + } + if (options.defaults) { + object.machineType = ""; + object.minCpuPlatform = ""; + object.provisioningModel = options.enums === String ? "PROVISIONING_MODEL_UNSPECIFIED" : 0; + object.reservation = ""; + object.bootDisk = null; + } + if (message.machineType != null && message.hasOwnProperty("machineType")) + object.machineType = message.machineType; + if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) + object.minCpuPlatform = message.minCpuPlatform; + if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) + object.provisioningModel = options.enums === String ? $root.google.cloud.batch.v1.AllocationPolicy.ProvisioningModel[message.provisioningModel] === undefined ? message.provisioningModel : $root.google.cloud.batch.v1.AllocationPolicy.ProvisioningModel[message.provisioningModel] : message.provisioningModel; + if (message.accelerators && message.accelerators.length) { + object.accelerators = []; + for (var j = 0; j < message.accelerators.length; ++j) + object.accelerators[j] = $root.google.cloud.batch.v1.AllocationPolicy.Accelerator.toObject(message.accelerators[j], options); + } + if (message.disks && message.disks.length) { + object.disks = []; + for (var j = 0; j < message.disks.length; ++j) + object.disks[j] = $root.google.cloud.batch.v1.AllocationPolicy.AttachedDisk.toObject(message.disks[j], options); + } + if (message.reservation != null && message.hasOwnProperty("reservation")) + object.reservation = message.reservation; + if (message.bootDisk != null && message.hasOwnProperty("bootDisk")) + object.bootDisk = $root.google.cloud.batch.v1.AllocationPolicy.Disk.toObject(message.bootDisk, options); + return object; + }; + + /** + * Converts this InstancePolicy to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy + * @instance + * @returns {Object.} JSON object + */ + InstancePolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstancePolicy + * @function getTypeUrl + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstancePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy.InstancePolicy"; + }; + + return InstancePolicy; + })(); + + AllocationPolicy.InstancePolicyOrTemplate = (function() { + + /** + * Properties of an InstancePolicyOrTemplate. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @interface IInstancePolicyOrTemplate + * @property {google.cloud.batch.v1.AllocationPolicy.IInstancePolicy|null} [policy] InstancePolicyOrTemplate policy + * @property {string|null} [instanceTemplate] InstancePolicyOrTemplate instanceTemplate + * @property {boolean|null} [installGpuDrivers] InstancePolicyOrTemplate installGpuDrivers + * @property {boolean|null} [installOpsAgent] InstancePolicyOrTemplate installOpsAgent + * @property {boolean|null} [blockProjectSshKeys] InstancePolicyOrTemplate blockProjectSshKeys + */ + + /** + * Constructs a new InstancePolicyOrTemplate. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @classdesc Represents an InstancePolicyOrTemplate. + * @implements IInstancePolicyOrTemplate + * @constructor + * @param {google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate=} [properties] Properties to set + */ + function InstancePolicyOrTemplate(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstancePolicyOrTemplate policy. + * @member {google.cloud.batch.v1.AllocationPolicy.IInstancePolicy|null|undefined} policy + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + * @instance + */ + InstancePolicyOrTemplate.prototype.policy = null; + + /** + * InstancePolicyOrTemplate instanceTemplate. + * @member {string|null|undefined} instanceTemplate + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + * @instance + */ + InstancePolicyOrTemplate.prototype.instanceTemplate = null; + + /** + * InstancePolicyOrTemplate installGpuDrivers. + * @member {boolean} installGpuDrivers + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + * @instance + */ + InstancePolicyOrTemplate.prototype.installGpuDrivers = false; + + /** + * InstancePolicyOrTemplate installOpsAgent. + * @member {boolean} installOpsAgent + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + * @instance + */ + InstancePolicyOrTemplate.prototype.installOpsAgent = false; + + /** + * InstancePolicyOrTemplate blockProjectSshKeys. + * @member {boolean} blockProjectSshKeys + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + * @instance + */ + InstancePolicyOrTemplate.prototype.blockProjectSshKeys = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstancePolicyOrTemplate policyTemplate. + * @member {"policy"|"instanceTemplate"|undefined} policyTemplate + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + * @instance + */ + Object.defineProperty(InstancePolicyOrTemplate.prototype, "policyTemplate", { + get: $util.oneOfGetter($oneOfFields = ["policy", "instanceTemplate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstancePolicyOrTemplate instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate=} [properties] Properties to set + * @returns {google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate} InstancePolicyOrTemplate instance + */ + InstancePolicyOrTemplate.create = function create(properties) { + return new InstancePolicyOrTemplate(properties); + }; + + /** + * Encodes the specified InstancePolicyOrTemplate message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate} message InstancePolicyOrTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancePolicyOrTemplate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicy.encode(message.policy, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.instanceTemplate != null && Object.hasOwnProperty.call(message, "instanceTemplate")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceTemplate); + if (message.installGpuDrivers != null && Object.hasOwnProperty.call(message, "installGpuDrivers")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.installGpuDrivers); + if (message.installOpsAgent != null && Object.hasOwnProperty.call(message, "installOpsAgent")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.installOpsAgent); + if (message.blockProjectSshKeys != null && Object.hasOwnProperty.call(message, "blockProjectSshKeys")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.blockProjectSshKeys); + return writer; + }; + + /** + * Encodes the specified InstancePolicyOrTemplate message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate} message InstancePolicyOrTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancePolicyOrTemplate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstancePolicyOrTemplate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate} InstancePolicyOrTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancePolicyOrTemplate.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.policy = $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicy.decode(reader, reader.uint32()); + break; + } + case 2: { + message.instanceTemplate = reader.string(); + break; + } + case 3: { + message.installGpuDrivers = reader.bool(); + break; + } + case 4: { + message.installOpsAgent = reader.bool(); + break; + } + case 5: { + message.blockProjectSshKeys = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstancePolicyOrTemplate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate} InstancePolicyOrTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancePolicyOrTemplate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstancePolicyOrTemplate message. + * @function verify + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstancePolicyOrTemplate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.policy != null && message.hasOwnProperty("policy")) { + properties.policyTemplate = 1; + { + var error = $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicy.verify(message.policy); + if (error) + return "policy." + error; + } + } + if (message.instanceTemplate != null && message.hasOwnProperty("instanceTemplate")) { + if (properties.policyTemplate === 1) + return "policyTemplate: multiple values"; + properties.policyTemplate = 1; + if (!$util.isString(message.instanceTemplate)) + return "instanceTemplate: string expected"; + } + if (message.installGpuDrivers != null && message.hasOwnProperty("installGpuDrivers")) + if (typeof message.installGpuDrivers !== "boolean") + return "installGpuDrivers: boolean expected"; + if (message.installOpsAgent != null && message.hasOwnProperty("installOpsAgent")) + if (typeof message.installOpsAgent !== "boolean") + return "installOpsAgent: boolean expected"; + if (message.blockProjectSshKeys != null && message.hasOwnProperty("blockProjectSshKeys")) + if (typeof message.blockProjectSshKeys !== "boolean") + return "blockProjectSshKeys: boolean expected"; + return null; + }; + + /** + * Creates an InstancePolicyOrTemplate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate} InstancePolicyOrTemplate + */ + InstancePolicyOrTemplate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate) + return object; + var message = new $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate(); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.policy: object expected"); + message.policy = $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicy.fromObject(object.policy); + } + if (object.instanceTemplate != null) + message.instanceTemplate = String(object.instanceTemplate); + if (object.installGpuDrivers != null) + message.installGpuDrivers = Boolean(object.installGpuDrivers); + if (object.installOpsAgent != null) + message.installOpsAgent = Boolean(object.installOpsAgent); + if (object.blockProjectSshKeys != null) + message.blockProjectSshKeys = Boolean(object.blockProjectSshKeys); + return message; + }; + + /** + * Creates a plain object from an InstancePolicyOrTemplate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate} message InstancePolicyOrTemplate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstancePolicyOrTemplate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.installGpuDrivers = false; + object.installOpsAgent = false; + object.blockProjectSshKeys = false; + } + if (message.policy != null && message.hasOwnProperty("policy")) { + object.policy = $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicy.toObject(message.policy, options); + if (options.oneofs) + object.policyTemplate = "policy"; + } + if (message.instanceTemplate != null && message.hasOwnProperty("instanceTemplate")) { + object.instanceTemplate = message.instanceTemplate; + if (options.oneofs) + object.policyTemplate = "instanceTemplate"; + } + if (message.installGpuDrivers != null && message.hasOwnProperty("installGpuDrivers")) + object.installGpuDrivers = message.installGpuDrivers; + if (message.installOpsAgent != null && message.hasOwnProperty("installOpsAgent")) + object.installOpsAgent = message.installOpsAgent; + if (message.blockProjectSshKeys != null && message.hasOwnProperty("blockProjectSshKeys")) + object.blockProjectSshKeys = message.blockProjectSshKeys; + return object; + }; + + /** + * Converts this InstancePolicyOrTemplate to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + * @instance + * @returns {Object.} JSON object + */ + InstancePolicyOrTemplate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstancePolicyOrTemplate + * @function getTypeUrl + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstancePolicyOrTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate"; + }; + + return InstancePolicyOrTemplate; + })(); + + AllocationPolicy.NetworkInterface = (function() { + + /** + * Properties of a NetworkInterface. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @interface INetworkInterface + * @property {string|null} [network] NetworkInterface network + * @property {string|null} [subnetwork] NetworkInterface subnetwork + * @property {boolean|null} [noExternalIpAddress] NetworkInterface noExternalIpAddress + */ + + /** + * Constructs a new NetworkInterface. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @classdesc Represents a NetworkInterface. + * @implements INetworkInterface + * @constructor + * @param {google.cloud.batch.v1.AllocationPolicy.INetworkInterface=} [properties] Properties to set + */ + function NetworkInterface(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkInterface network. + * @member {string} network + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface + * @instance + */ + NetworkInterface.prototype.network = ""; + + /** + * NetworkInterface subnetwork. + * @member {string} subnetwork + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface + * @instance + */ + NetworkInterface.prototype.subnetwork = ""; + + /** + * NetworkInterface noExternalIpAddress. + * @member {boolean} noExternalIpAddress + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface + * @instance + */ + NetworkInterface.prototype.noExternalIpAddress = false; + + /** + * Creates a new NetworkInterface instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.INetworkInterface=} [properties] Properties to set + * @returns {google.cloud.batch.v1.AllocationPolicy.NetworkInterface} NetworkInterface instance + */ + NetworkInterface.create = function create(properties) { + return new NetworkInterface(properties); + }; + + /** + * Encodes the specified NetworkInterface message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.NetworkInterface.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.INetworkInterface} message NetworkInterface message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkInterface.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.network); + if (message.subnetwork != null && Object.hasOwnProperty.call(message, "subnetwork")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subnetwork); + if (message.noExternalIpAddress != null && Object.hasOwnProperty.call(message, "noExternalIpAddress")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.noExternalIpAddress); + return writer; + }; + + /** + * Encodes the specified NetworkInterface message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.NetworkInterface.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.INetworkInterface} message NetworkInterface message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkInterface.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.AllocationPolicy.NetworkInterface} NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkInterface.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy.NetworkInterface(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.network = reader.string(); + break; + } + case 2: { + message.subnetwork = reader.string(); + break; + } + case 3: { + message.noExternalIpAddress = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.AllocationPolicy.NetworkInterface} NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkInterface.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkInterface message. + * @function verify + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkInterface.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) + if (!$util.isString(message.subnetwork)) + return "subnetwork: string expected"; + if (message.noExternalIpAddress != null && message.hasOwnProperty("noExternalIpAddress")) + if (typeof message.noExternalIpAddress !== "boolean") + return "noExternalIpAddress: boolean expected"; + return null; + }; + + /** + * Creates a NetworkInterface message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.AllocationPolicy.NetworkInterface} NetworkInterface + */ + NetworkInterface.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy.NetworkInterface) + return object; + var message = new $root.google.cloud.batch.v1.AllocationPolicy.NetworkInterface(); + if (object.network != null) + message.network = String(object.network); + if (object.subnetwork != null) + message.subnetwork = String(object.subnetwork); + if (object.noExternalIpAddress != null) + message.noExternalIpAddress = Boolean(object.noExternalIpAddress); + return message; + }; + + /** + * Creates a plain object from a NetworkInterface message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.NetworkInterface} message NetworkInterface + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkInterface.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.network = ""; + object.subnetwork = ""; + object.noExternalIpAddress = false; + } + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) + object.subnetwork = message.subnetwork; + if (message.noExternalIpAddress != null && message.hasOwnProperty("noExternalIpAddress")) + object.noExternalIpAddress = message.noExternalIpAddress; + return object; + }; + + /** + * Converts this NetworkInterface to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface + * @instance + * @returns {Object.} JSON object + */ + NetworkInterface.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NetworkInterface + * @function getTypeUrl + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NetworkInterface.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy.NetworkInterface"; + }; + + return NetworkInterface; + })(); + + AllocationPolicy.NetworkPolicy = (function() { + + /** + * Properties of a NetworkPolicy. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @interface INetworkPolicy + * @property {Array.|null} [networkInterfaces] NetworkPolicy networkInterfaces + */ + + /** + * Constructs a new NetworkPolicy. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @classdesc Represents a NetworkPolicy. + * @implements INetworkPolicy + * @constructor + * @param {google.cloud.batch.v1.AllocationPolicy.INetworkPolicy=} [properties] Properties to set + */ + function NetworkPolicy(properties) { + this.networkInterfaces = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkPolicy networkInterfaces. + * @member {Array.} networkInterfaces + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy + * @instance + */ + NetworkPolicy.prototype.networkInterfaces = $util.emptyArray; + + /** + * Creates a new NetworkPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.INetworkPolicy=} [properties] Properties to set + * @returns {google.cloud.batch.v1.AllocationPolicy.NetworkPolicy} NetworkPolicy instance + */ + NetworkPolicy.create = function create(properties) { + return new NetworkPolicy(properties); + }; + + /** + * Encodes the specified NetworkPolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.INetworkPolicy} message NetworkPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.networkInterfaces != null && message.networkInterfaces.length) + for (var i = 0; i < message.networkInterfaces.length; ++i) + $root.google.cloud.batch.v1.AllocationPolicy.NetworkInterface.encode(message.networkInterfaces[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NetworkPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.INetworkPolicy} message NetworkPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.AllocationPolicy.NetworkPolicy} NetworkPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.networkInterfaces && message.networkInterfaces.length)) + message.networkInterfaces = []; + message.networkInterfaces.push($root.google.cloud.batch.v1.AllocationPolicy.NetworkInterface.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.AllocationPolicy.NetworkPolicy} NetworkPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkPolicy message. + * @function verify + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.networkInterfaces != null && message.hasOwnProperty("networkInterfaces")) { + if (!Array.isArray(message.networkInterfaces)) + return "networkInterfaces: array expected"; + for (var i = 0; i < message.networkInterfaces.length; ++i) { + var error = $root.google.cloud.batch.v1.AllocationPolicy.NetworkInterface.verify(message.networkInterfaces[i]); + if (error) + return "networkInterfaces." + error; + } + } + return null; + }; + + /** + * Creates a NetworkPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.AllocationPolicy.NetworkPolicy} NetworkPolicy + */ + NetworkPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy) + return object; + var message = new $root.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy(); + if (object.networkInterfaces) { + if (!Array.isArray(object.networkInterfaces)) + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.networkInterfaces: array expected"); + message.networkInterfaces = []; + for (var i = 0; i < object.networkInterfaces.length; ++i) { + if (typeof object.networkInterfaces[i] !== "object") + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.networkInterfaces: object expected"); + message.networkInterfaces[i] = $root.google.cloud.batch.v1.AllocationPolicy.NetworkInterface.fromObject(object.networkInterfaces[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a NetworkPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.NetworkPolicy} message NetworkPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.networkInterfaces = []; + if (message.networkInterfaces && message.networkInterfaces.length) { + object.networkInterfaces = []; + for (var j = 0; j < message.networkInterfaces.length; ++j) + object.networkInterfaces[j] = $root.google.cloud.batch.v1.AllocationPolicy.NetworkInterface.toObject(message.networkInterfaces[j], options); + } + return object; + }; + + /** + * Converts this NetworkPolicy to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy + * @instance + * @returns {Object.} JSON object + */ + NetworkPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NetworkPolicy + * @function getTypeUrl + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NetworkPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy.NetworkPolicy"; + }; + + return NetworkPolicy; + })(); + + AllocationPolicy.PlacementPolicy = (function() { + + /** + * Properties of a PlacementPolicy. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @interface IPlacementPolicy + * @property {string|null} [collocation] PlacementPolicy collocation + * @property {number|Long|null} [maxDistance] PlacementPolicy maxDistance + */ + + /** + * Constructs a new PlacementPolicy. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @classdesc Represents a PlacementPolicy. + * @implements IPlacementPolicy + * @constructor + * @param {google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy=} [properties] Properties to set + */ + function PlacementPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PlacementPolicy collocation. + * @member {string} collocation + * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy + * @instance + */ + PlacementPolicy.prototype.collocation = ""; + + /** + * PlacementPolicy maxDistance. + * @member {number|Long} maxDistance + * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy + * @instance + */ + PlacementPolicy.prototype.maxDistance = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new PlacementPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy=} [properties] Properties to set + * @returns {google.cloud.batch.v1.AllocationPolicy.PlacementPolicy} PlacementPolicy instance + */ + PlacementPolicy.create = function create(properties) { + return new PlacementPolicy(properties); + }; + + /** + * Encodes the specified PlacementPolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy} message PlacementPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlacementPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.collocation != null && Object.hasOwnProperty.call(message, "collocation")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.collocation); + if (message.maxDistance != null && Object.hasOwnProperty.call(message, "maxDistance")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.maxDistance); + return writer; + }; + + /** + * Encodes the specified PlacementPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy} message PlacementPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlacementPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PlacementPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.AllocationPolicy.PlacementPolicy} PlacementPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlacementPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.collocation = reader.string(); + break; + } + case 2: { + message.maxDistance = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PlacementPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.AllocationPolicy.PlacementPolicy} PlacementPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlacementPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PlacementPolicy message. + * @function verify + * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PlacementPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.collocation != null && message.hasOwnProperty("collocation")) + if (!$util.isString(message.collocation)) + return "collocation: string expected"; + if (message.maxDistance != null && message.hasOwnProperty("maxDistance")) + if (!$util.isInteger(message.maxDistance) && !(message.maxDistance && $util.isInteger(message.maxDistance.low) && $util.isInteger(message.maxDistance.high))) + return "maxDistance: integer|Long expected"; + return null; + }; + + /** + * Creates a PlacementPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.AllocationPolicy.PlacementPolicy} PlacementPolicy + */ + PlacementPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy) + return object; + var message = new $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy(); + if (object.collocation != null) + message.collocation = String(object.collocation); + if (object.maxDistance != null) + if ($util.Long) + (message.maxDistance = $util.Long.fromValue(object.maxDistance)).unsigned = false; + else if (typeof object.maxDistance === "string") + message.maxDistance = parseInt(object.maxDistance, 10); + else if (typeof object.maxDistance === "number") + message.maxDistance = object.maxDistance; + else if (typeof object.maxDistance === "object") + message.maxDistance = new $util.LongBits(object.maxDistance.low >>> 0, object.maxDistance.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a PlacementPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.PlacementPolicy} message PlacementPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PlacementPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.collocation = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxDistance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxDistance = options.longs === String ? "0" : 0; + } + if (message.collocation != null && message.hasOwnProperty("collocation")) + object.collocation = message.collocation; + if (message.maxDistance != null && message.hasOwnProperty("maxDistance")) + if (typeof message.maxDistance === "number") + object.maxDistance = options.longs === String ? String(message.maxDistance) : message.maxDistance; + else + object.maxDistance = options.longs === String ? $util.Long.prototype.toString.call(message.maxDistance) : options.longs === Number ? new $util.LongBits(message.maxDistance.low >>> 0, message.maxDistance.high >>> 0).toNumber() : message.maxDistance; + return object; + }; + + /** + * Converts this PlacementPolicy to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy + * @instance + * @returns {Object.} JSON object + */ + PlacementPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PlacementPolicy + * @function getTypeUrl + * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PlacementPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy.PlacementPolicy"; + }; + + return PlacementPolicy; + })(); + + /** + * ProvisioningModel enum. + * @name google.cloud.batch.v1.AllocationPolicy.ProvisioningModel + * @enum {number} + * @property {number} PROVISIONING_MODEL_UNSPECIFIED=0 PROVISIONING_MODEL_UNSPECIFIED value + * @property {number} STANDARD=1 STANDARD value + * @property {number} SPOT=2 SPOT value + * @property {number} PREEMPTIBLE=3 PREEMPTIBLE value + */ + AllocationPolicy.ProvisioningModel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PROVISIONING_MODEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "STANDARD"] = 1; + values[valuesById[2] = "SPOT"] = 2; + values[valuesById[3] = "PREEMPTIBLE"] = 3; + return values; + })(); + + return AllocationPolicy; + })(); + + v1.TaskGroup = (function() { + + /** + * Properties of a TaskGroup. + * @memberof google.cloud.batch.v1 + * @interface ITaskGroup + * @property {string|null} [name] TaskGroup name + * @property {google.cloud.batch.v1.ITaskSpec|null} [taskSpec] TaskGroup taskSpec + * @property {number|Long|null} [taskCount] TaskGroup taskCount + * @property {number|Long|null} [parallelism] TaskGroup parallelism + * @property {google.cloud.batch.v1.TaskGroup.SchedulingPolicy|null} [schedulingPolicy] TaskGroup schedulingPolicy + * @property {Array.|null} [taskEnvironments] TaskGroup taskEnvironments + * @property {number|Long|null} [taskCountPerNode] TaskGroup taskCountPerNode + * @property {boolean|null} [requireHostsFile] TaskGroup requireHostsFile + * @property {boolean|null} [permissiveSsh] TaskGroup permissiveSsh + * @property {boolean|null} [runAsNonRoot] TaskGroup runAsNonRoot + */ + + /** + * Constructs a new TaskGroup. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a TaskGroup. + * @implements ITaskGroup + * @constructor + * @param {google.cloud.batch.v1.ITaskGroup=} [properties] Properties to set + */ + function TaskGroup(properties) { + this.taskEnvironments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TaskGroup name. + * @member {string} name + * @memberof google.cloud.batch.v1.TaskGroup + * @instance + */ + TaskGroup.prototype.name = ""; + + /** + * TaskGroup taskSpec. + * @member {google.cloud.batch.v1.ITaskSpec|null|undefined} taskSpec + * @memberof google.cloud.batch.v1.TaskGroup + * @instance + */ + TaskGroup.prototype.taskSpec = null; + + /** + * TaskGroup taskCount. + * @member {number|Long} taskCount + * @memberof google.cloud.batch.v1.TaskGroup + * @instance + */ + TaskGroup.prototype.taskCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TaskGroup parallelism. + * @member {number|Long} parallelism + * @memberof google.cloud.batch.v1.TaskGroup + * @instance + */ + TaskGroup.prototype.parallelism = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TaskGroup schedulingPolicy. + * @member {google.cloud.batch.v1.TaskGroup.SchedulingPolicy} schedulingPolicy + * @memberof google.cloud.batch.v1.TaskGroup + * @instance + */ + TaskGroup.prototype.schedulingPolicy = 0; + + /** + * TaskGroup taskEnvironments. + * @member {Array.} taskEnvironments + * @memberof google.cloud.batch.v1.TaskGroup + * @instance + */ + TaskGroup.prototype.taskEnvironments = $util.emptyArray; + + /** + * TaskGroup taskCountPerNode. + * @member {number|Long} taskCountPerNode + * @memberof google.cloud.batch.v1.TaskGroup + * @instance + */ + TaskGroup.prototype.taskCountPerNode = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TaskGroup requireHostsFile. + * @member {boolean} requireHostsFile + * @memberof google.cloud.batch.v1.TaskGroup + * @instance + */ + TaskGroup.prototype.requireHostsFile = false; + + /** + * TaskGroup permissiveSsh. + * @member {boolean} permissiveSsh + * @memberof google.cloud.batch.v1.TaskGroup + * @instance + */ + TaskGroup.prototype.permissiveSsh = false; + + /** + * TaskGroup runAsNonRoot. + * @member {boolean} runAsNonRoot + * @memberof google.cloud.batch.v1.TaskGroup + * @instance + */ + TaskGroup.prototype.runAsNonRoot = false; + + /** + * Creates a new TaskGroup instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.TaskGroup + * @static + * @param {google.cloud.batch.v1.ITaskGroup=} [properties] Properties to set + * @returns {google.cloud.batch.v1.TaskGroup} TaskGroup instance + */ + TaskGroup.create = function create(properties) { + return new TaskGroup(properties); + }; + + /** + * Encodes the specified TaskGroup message. Does not implicitly {@link google.cloud.batch.v1.TaskGroup.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.TaskGroup + * @static + * @param {google.cloud.batch.v1.ITaskGroup} message TaskGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskGroup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.taskSpec != null && Object.hasOwnProperty.call(message, "taskSpec")) + $root.google.cloud.batch.v1.TaskSpec.encode(message.taskSpec, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.taskCount != null && Object.hasOwnProperty.call(message, "taskCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.taskCount); + if (message.parallelism != null && Object.hasOwnProperty.call(message, "parallelism")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.parallelism); + if (message.schedulingPolicy != null && Object.hasOwnProperty.call(message, "schedulingPolicy")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.schedulingPolicy); + if (message.taskEnvironments != null && message.taskEnvironments.length) + for (var i = 0; i < message.taskEnvironments.length; ++i) + $root.google.cloud.batch.v1.Environment.encode(message.taskEnvironments[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.taskCountPerNode != null && Object.hasOwnProperty.call(message, "taskCountPerNode")) + writer.uint32(/* id 10, wireType 0 =*/80).int64(message.taskCountPerNode); + if (message.requireHostsFile != null && Object.hasOwnProperty.call(message, "requireHostsFile")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.requireHostsFile); + if (message.permissiveSsh != null && Object.hasOwnProperty.call(message, "permissiveSsh")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.permissiveSsh); + if (message.runAsNonRoot != null && Object.hasOwnProperty.call(message, "runAsNonRoot")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.runAsNonRoot); + return writer; + }; + + /** + * Encodes the specified TaskGroup message, length delimited. Does not implicitly {@link google.cloud.batch.v1.TaskGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.TaskGroup + * @static + * @param {google.cloud.batch.v1.ITaskGroup} message TaskGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TaskGroup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.TaskGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.TaskGroup} TaskGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskGroup.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.TaskGroup(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.taskSpec = $root.google.cloud.batch.v1.TaskSpec.decode(reader, reader.uint32()); + break; + } + case 4: { + message.taskCount = reader.int64(); + break; + } + case 5: { + message.parallelism = reader.int64(); + break; + } + case 6: { + message.schedulingPolicy = reader.int32(); + break; + } + case 9: { + if (!(message.taskEnvironments && message.taskEnvironments.length)) + message.taskEnvironments = []; + message.taskEnvironments.push($root.google.cloud.batch.v1.Environment.decode(reader, reader.uint32())); + break; + } + case 10: { + message.taskCountPerNode = reader.int64(); + break; + } + case 11: { + message.requireHostsFile = reader.bool(); + break; + } + case 12: { + message.permissiveSsh = reader.bool(); + break; + } + case 14: { + message.runAsNonRoot = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TaskGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.TaskGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.TaskGroup} TaskGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TaskGroup message. + * @function verify + * @memberof google.cloud.batch.v1.TaskGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TaskGroup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.taskSpec != null && message.hasOwnProperty("taskSpec")) { + var error = $root.google.cloud.batch.v1.TaskSpec.verify(message.taskSpec); + if (error) + return "taskSpec." + error; + } + if (message.taskCount != null && message.hasOwnProperty("taskCount")) + if (!$util.isInteger(message.taskCount) && !(message.taskCount && $util.isInteger(message.taskCount.low) && $util.isInteger(message.taskCount.high))) + return "taskCount: integer|Long expected"; + if (message.parallelism != null && message.hasOwnProperty("parallelism")) + if (!$util.isInteger(message.parallelism) && !(message.parallelism && $util.isInteger(message.parallelism.low) && $util.isInteger(message.parallelism.high))) + return "parallelism: integer|Long expected"; + if (message.schedulingPolicy != null && message.hasOwnProperty("schedulingPolicy")) + switch (message.schedulingPolicy) { + default: + return "schedulingPolicy: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.taskEnvironments != null && message.hasOwnProperty("taskEnvironments")) { + if (!Array.isArray(message.taskEnvironments)) + return "taskEnvironments: array expected"; + for (var i = 0; i < message.taskEnvironments.length; ++i) { + var error = $root.google.cloud.batch.v1.Environment.verify(message.taskEnvironments[i]); + if (error) + return "taskEnvironments." + error; + } + } + if (message.taskCountPerNode != null && message.hasOwnProperty("taskCountPerNode")) + if (!$util.isInteger(message.taskCountPerNode) && !(message.taskCountPerNode && $util.isInteger(message.taskCountPerNode.low) && $util.isInteger(message.taskCountPerNode.high))) + return "taskCountPerNode: integer|Long expected"; + if (message.requireHostsFile != null && message.hasOwnProperty("requireHostsFile")) + if (typeof message.requireHostsFile !== "boolean") + return "requireHostsFile: boolean expected"; + if (message.permissiveSsh != null && message.hasOwnProperty("permissiveSsh")) + if (typeof message.permissiveSsh !== "boolean") + return "permissiveSsh: boolean expected"; + if (message.runAsNonRoot != null && message.hasOwnProperty("runAsNonRoot")) + if (typeof message.runAsNonRoot !== "boolean") + return "runAsNonRoot: boolean expected"; + return null; + }; + + /** + * Creates a TaskGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.TaskGroup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.TaskGroup} TaskGroup + */ + TaskGroup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.TaskGroup) + return object; + var message = new $root.google.cloud.batch.v1.TaskGroup(); + if (object.name != null) + message.name = String(object.name); + if (object.taskSpec != null) { + if (typeof object.taskSpec !== "object") + throw TypeError(".google.cloud.batch.v1.TaskGroup.taskSpec: object expected"); + message.taskSpec = $root.google.cloud.batch.v1.TaskSpec.fromObject(object.taskSpec); + } + if (object.taskCount != null) + if ($util.Long) + (message.taskCount = $util.Long.fromValue(object.taskCount)).unsigned = false; + else if (typeof object.taskCount === "string") + message.taskCount = parseInt(object.taskCount, 10); + else if (typeof object.taskCount === "number") + message.taskCount = object.taskCount; + else if (typeof object.taskCount === "object") + message.taskCount = new $util.LongBits(object.taskCount.low >>> 0, object.taskCount.high >>> 0).toNumber(); + if (object.parallelism != null) + if ($util.Long) + (message.parallelism = $util.Long.fromValue(object.parallelism)).unsigned = false; + else if (typeof object.parallelism === "string") + message.parallelism = parseInt(object.parallelism, 10); + else if (typeof object.parallelism === "number") + message.parallelism = object.parallelism; + else if (typeof object.parallelism === "object") + message.parallelism = new $util.LongBits(object.parallelism.low >>> 0, object.parallelism.high >>> 0).toNumber(); + switch (object.schedulingPolicy) { + default: + if (typeof object.schedulingPolicy === "number") { + message.schedulingPolicy = object.schedulingPolicy; + break; + } + break; + case "SCHEDULING_POLICY_UNSPECIFIED": + case 0: + message.schedulingPolicy = 0; + break; + case "AS_SOON_AS_POSSIBLE": + case 1: + message.schedulingPolicy = 1; + break; + case "IN_ORDER": + case 2: + message.schedulingPolicy = 2; + break; + } + if (object.taskEnvironments) { + if (!Array.isArray(object.taskEnvironments)) + throw TypeError(".google.cloud.batch.v1.TaskGroup.taskEnvironments: array expected"); + message.taskEnvironments = []; + for (var i = 0; i < object.taskEnvironments.length; ++i) { + if (typeof object.taskEnvironments[i] !== "object") + throw TypeError(".google.cloud.batch.v1.TaskGroup.taskEnvironments: object expected"); + message.taskEnvironments[i] = $root.google.cloud.batch.v1.Environment.fromObject(object.taskEnvironments[i]); + } + } + if (object.taskCountPerNode != null) + if ($util.Long) + (message.taskCountPerNode = $util.Long.fromValue(object.taskCountPerNode)).unsigned = false; + else if (typeof object.taskCountPerNode === "string") + message.taskCountPerNode = parseInt(object.taskCountPerNode, 10); + else if (typeof object.taskCountPerNode === "number") + message.taskCountPerNode = object.taskCountPerNode; + else if (typeof object.taskCountPerNode === "object") + message.taskCountPerNode = new $util.LongBits(object.taskCountPerNode.low >>> 0, object.taskCountPerNode.high >>> 0).toNumber(); + if (object.requireHostsFile != null) + message.requireHostsFile = Boolean(object.requireHostsFile); + if (object.permissiveSsh != null) + message.permissiveSsh = Boolean(object.permissiveSsh); + if (object.runAsNonRoot != null) + message.runAsNonRoot = Boolean(object.runAsNonRoot); + return message; + }; + + /** + * Creates a plain object from a TaskGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.TaskGroup + * @static + * @param {google.cloud.batch.v1.TaskGroup} message TaskGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TaskGroup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.taskEnvironments = []; + if (options.defaults) { + object.name = ""; + object.taskSpec = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.taskCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.taskCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.parallelism = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.parallelism = options.longs === String ? "0" : 0; + object.schedulingPolicy = options.enums === String ? "SCHEDULING_POLICY_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.taskCountPerNode = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.taskCountPerNode = options.longs === String ? "0" : 0; + object.requireHostsFile = false; + object.permissiveSsh = false; + object.runAsNonRoot = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.taskSpec != null && message.hasOwnProperty("taskSpec")) + object.taskSpec = $root.google.cloud.batch.v1.TaskSpec.toObject(message.taskSpec, options); + if (message.taskCount != null && message.hasOwnProperty("taskCount")) + if (typeof message.taskCount === "number") + object.taskCount = options.longs === String ? String(message.taskCount) : message.taskCount; + else + object.taskCount = options.longs === String ? $util.Long.prototype.toString.call(message.taskCount) : options.longs === Number ? new $util.LongBits(message.taskCount.low >>> 0, message.taskCount.high >>> 0).toNumber() : message.taskCount; + if (message.parallelism != null && message.hasOwnProperty("parallelism")) + if (typeof message.parallelism === "number") + object.parallelism = options.longs === String ? String(message.parallelism) : message.parallelism; + else + object.parallelism = options.longs === String ? $util.Long.prototype.toString.call(message.parallelism) : options.longs === Number ? new $util.LongBits(message.parallelism.low >>> 0, message.parallelism.high >>> 0).toNumber() : message.parallelism; + if (message.schedulingPolicy != null && message.hasOwnProperty("schedulingPolicy")) + object.schedulingPolicy = options.enums === String ? $root.google.cloud.batch.v1.TaskGroup.SchedulingPolicy[message.schedulingPolicy] === undefined ? message.schedulingPolicy : $root.google.cloud.batch.v1.TaskGroup.SchedulingPolicy[message.schedulingPolicy] : message.schedulingPolicy; + if (message.taskEnvironments && message.taskEnvironments.length) { + object.taskEnvironments = []; + for (var j = 0; j < message.taskEnvironments.length; ++j) + object.taskEnvironments[j] = $root.google.cloud.batch.v1.Environment.toObject(message.taskEnvironments[j], options); + } + if (message.taskCountPerNode != null && message.hasOwnProperty("taskCountPerNode")) + if (typeof message.taskCountPerNode === "number") + object.taskCountPerNode = options.longs === String ? String(message.taskCountPerNode) : message.taskCountPerNode; + else + object.taskCountPerNode = options.longs === String ? $util.Long.prototype.toString.call(message.taskCountPerNode) : options.longs === Number ? new $util.LongBits(message.taskCountPerNode.low >>> 0, message.taskCountPerNode.high >>> 0).toNumber() : message.taskCountPerNode; + if (message.requireHostsFile != null && message.hasOwnProperty("requireHostsFile")) + object.requireHostsFile = message.requireHostsFile; + if (message.permissiveSsh != null && message.hasOwnProperty("permissiveSsh")) + object.permissiveSsh = message.permissiveSsh; + if (message.runAsNonRoot != null && message.hasOwnProperty("runAsNonRoot")) + object.runAsNonRoot = message.runAsNonRoot; + return object; + }; + + /** + * Converts this TaskGroup to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.TaskGroup + * @instance + * @returns {Object.} JSON object + */ + TaskGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TaskGroup + * @function getTypeUrl + * @memberof google.cloud.batch.v1.TaskGroup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TaskGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.TaskGroup"; + }; + + /** + * SchedulingPolicy enum. + * @name google.cloud.batch.v1.TaskGroup.SchedulingPolicy + * @enum {number} + * @property {number} SCHEDULING_POLICY_UNSPECIFIED=0 SCHEDULING_POLICY_UNSPECIFIED value + * @property {number} AS_SOON_AS_POSSIBLE=1 AS_SOON_AS_POSSIBLE value + * @property {number} IN_ORDER=2 IN_ORDER value + */ + TaskGroup.SchedulingPolicy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SCHEDULING_POLICY_UNSPECIFIED"] = 0; + values[valuesById[1] = "AS_SOON_AS_POSSIBLE"] = 1; + values[valuesById[2] = "IN_ORDER"] = 2; + return values; + })(); + + return TaskGroup; + })(); + + v1.ServiceAccount = (function() { + + /** + * Properties of a ServiceAccount. + * @memberof google.cloud.batch.v1 + * @interface IServiceAccount + * @property {string|null} [email] ServiceAccount email + * @property {Array.|null} [scopes] ServiceAccount scopes + */ + + /** + * Constructs a new ServiceAccount. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a ServiceAccount. + * @implements IServiceAccount + * @constructor + * @param {google.cloud.batch.v1.IServiceAccount=} [properties] Properties to set + */ + function ServiceAccount(properties) { + this.scopes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceAccount email. + * @member {string} email + * @memberof google.cloud.batch.v1.ServiceAccount + * @instance + */ + ServiceAccount.prototype.email = ""; + + /** + * ServiceAccount scopes. + * @member {Array.} scopes + * @memberof google.cloud.batch.v1.ServiceAccount + * @instance + */ + ServiceAccount.prototype.scopes = $util.emptyArray; + + /** + * Creates a new ServiceAccount instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.ServiceAccount + * @static + * @param {google.cloud.batch.v1.IServiceAccount=} [properties] Properties to set + * @returns {google.cloud.batch.v1.ServiceAccount} ServiceAccount instance + */ + ServiceAccount.create = function create(properties) { + return new ServiceAccount(properties); + }; + + /** + * Encodes the specified ServiceAccount message. Does not implicitly {@link google.cloud.batch.v1.ServiceAccount.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.ServiceAccount + * @static + * @param {google.cloud.batch.v1.IServiceAccount} message ServiceAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAccount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.email != null && Object.hasOwnProperty.call(message, "email")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.email); + if (message.scopes != null && message.scopes.length) + for (var i = 0; i < message.scopes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.scopes[i]); + return writer; + }; + + /** + * Encodes the specified ServiceAccount message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ServiceAccount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.ServiceAccount + * @static + * @param {google.cloud.batch.v1.IServiceAccount} message ServiceAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAccount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceAccount message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.ServiceAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.ServiceAccount} ServiceAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAccount.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.ServiceAccount(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.email = reader.string(); + break; + } + case 2: { + if (!(message.scopes && message.scopes.length)) + message.scopes = []; + message.scopes.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceAccount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.ServiceAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.ServiceAccount} ServiceAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAccount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceAccount message. + * @function verify + * @memberof google.cloud.batch.v1.ServiceAccount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceAccount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.email != null && message.hasOwnProperty("email")) + if (!$util.isString(message.email)) + return "email: string expected"; + if (message.scopes != null && message.hasOwnProperty("scopes")) { + if (!Array.isArray(message.scopes)) + return "scopes: array expected"; + for (var i = 0; i < message.scopes.length; ++i) + if (!$util.isString(message.scopes[i])) + return "scopes: string[] expected"; + } + return null; + }; + + /** + * Creates a ServiceAccount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.ServiceAccount + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.ServiceAccount} ServiceAccount + */ + ServiceAccount.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.ServiceAccount) + return object; + var message = new $root.google.cloud.batch.v1.ServiceAccount(); + if (object.email != null) + message.email = String(object.email); + if (object.scopes) { + if (!Array.isArray(object.scopes)) + throw TypeError(".google.cloud.batch.v1.ServiceAccount.scopes: array expected"); + message.scopes = []; + for (var i = 0; i < object.scopes.length; ++i) + message.scopes[i] = String(object.scopes[i]); + } + return message; + }; + + /** + * Creates a plain object from a ServiceAccount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.ServiceAccount + * @static + * @param {google.cloud.batch.v1.ServiceAccount} message ServiceAccount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceAccount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.scopes = []; + if (options.defaults) + object.email = ""; + if (message.email != null && message.hasOwnProperty("email")) + object.email = message.email; + if (message.scopes && message.scopes.length) { + object.scopes = []; + for (var j = 0; j < message.scopes.length; ++j) + object.scopes[j] = message.scopes[j]; + } + return object; + }; + + /** + * Converts this ServiceAccount to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.ServiceAccount + * @instance + * @returns {Object.} JSON object + */ + ServiceAccount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceAccount + * @function getTypeUrl + * @memberof google.cloud.batch.v1.ServiceAccount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceAccount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.ServiceAccount"; + }; + + return ServiceAccount; + })(); + + v1.ComputeResource = (function() { + + /** + * Properties of a ComputeResource. + * @memberof google.cloud.batch.v1 + * @interface IComputeResource + * @property {number|Long|null} [cpuMilli] ComputeResource cpuMilli + * @property {number|Long|null} [memoryMib] ComputeResource memoryMib + * @property {number|Long|null} [bootDiskMib] ComputeResource bootDiskMib + */ + + /** + * Constructs a new ComputeResource. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a ComputeResource. + * @implements IComputeResource + * @constructor + * @param {google.cloud.batch.v1.IComputeResource=} [properties] Properties to set + */ + function ComputeResource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ComputeResource cpuMilli. + * @member {number|Long} cpuMilli + * @memberof google.cloud.batch.v1.ComputeResource + * @instance + */ + ComputeResource.prototype.cpuMilli = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ComputeResource memoryMib. + * @member {number|Long} memoryMib + * @memberof google.cloud.batch.v1.ComputeResource + * @instance + */ + ComputeResource.prototype.memoryMib = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ComputeResource bootDiskMib. + * @member {number|Long} bootDiskMib + * @memberof google.cloud.batch.v1.ComputeResource + * @instance + */ + ComputeResource.prototype.bootDiskMib = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ComputeResource instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.ComputeResource + * @static + * @param {google.cloud.batch.v1.IComputeResource=} [properties] Properties to set + * @returns {google.cloud.batch.v1.ComputeResource} ComputeResource instance + */ + ComputeResource.create = function create(properties) { + return new ComputeResource(properties); + }; + + /** + * Encodes the specified ComputeResource message. Does not implicitly {@link google.cloud.batch.v1.ComputeResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.ComputeResource + * @static + * @param {google.cloud.batch.v1.IComputeResource} message ComputeResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cpuMilli != null && Object.hasOwnProperty.call(message, "cpuMilli")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.cpuMilli); + if (message.memoryMib != null && Object.hasOwnProperty.call(message, "memoryMib")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.memoryMib); + if (message.bootDiskMib != null && Object.hasOwnProperty.call(message, "bootDiskMib")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.bootDiskMib); + return writer; + }; + + /** + * Encodes the specified ComputeResource message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ComputeResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.ComputeResource + * @static + * @param {google.cloud.batch.v1.IComputeResource} message ComputeResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ComputeResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.ComputeResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.ComputeResource} ComputeResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeResource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.ComputeResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cpuMilli = reader.int64(); + break; + } + case 2: { + message.memoryMib = reader.int64(); + break; + } + case 4: { + message.bootDiskMib = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ComputeResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.ComputeResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.ComputeResource} ComputeResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ComputeResource message. + * @function verify + * @memberof google.cloud.batch.v1.ComputeResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ComputeResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cpuMilli != null && message.hasOwnProperty("cpuMilli")) + if (!$util.isInteger(message.cpuMilli) && !(message.cpuMilli && $util.isInteger(message.cpuMilli.low) && $util.isInteger(message.cpuMilli.high))) + return "cpuMilli: integer|Long expected"; + if (message.memoryMib != null && message.hasOwnProperty("memoryMib")) + if (!$util.isInteger(message.memoryMib) && !(message.memoryMib && $util.isInteger(message.memoryMib.low) && $util.isInteger(message.memoryMib.high))) + return "memoryMib: integer|Long expected"; + if (message.bootDiskMib != null && message.hasOwnProperty("bootDiskMib")) + if (!$util.isInteger(message.bootDiskMib) && !(message.bootDiskMib && $util.isInteger(message.bootDiskMib.low) && $util.isInteger(message.bootDiskMib.high))) + return "bootDiskMib: integer|Long expected"; + return null; + }; + + /** + * Creates a ComputeResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.ComputeResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.ComputeResource} ComputeResource + */ + ComputeResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.ComputeResource) + return object; + var message = new $root.google.cloud.batch.v1.ComputeResource(); + if (object.cpuMilli != null) + if ($util.Long) + (message.cpuMilli = $util.Long.fromValue(object.cpuMilli)).unsigned = false; + else if (typeof object.cpuMilli === "string") + message.cpuMilli = parseInt(object.cpuMilli, 10); + else if (typeof object.cpuMilli === "number") + message.cpuMilli = object.cpuMilli; + else if (typeof object.cpuMilli === "object") + message.cpuMilli = new $util.LongBits(object.cpuMilli.low >>> 0, object.cpuMilli.high >>> 0).toNumber(); + if (object.memoryMib != null) + if ($util.Long) + (message.memoryMib = $util.Long.fromValue(object.memoryMib)).unsigned = false; + else if (typeof object.memoryMib === "string") + message.memoryMib = parseInt(object.memoryMib, 10); + else if (typeof object.memoryMib === "number") + message.memoryMib = object.memoryMib; + else if (typeof object.memoryMib === "object") + message.memoryMib = new $util.LongBits(object.memoryMib.low >>> 0, object.memoryMib.high >>> 0).toNumber(); + if (object.bootDiskMib != null) + if ($util.Long) + (message.bootDiskMib = $util.Long.fromValue(object.bootDiskMib)).unsigned = false; + else if (typeof object.bootDiskMib === "string") + message.bootDiskMib = parseInt(object.bootDiskMib, 10); + else if (typeof object.bootDiskMib === "number") + message.bootDiskMib = object.bootDiskMib; + else if (typeof object.bootDiskMib === "object") + message.bootDiskMib = new $util.LongBits(object.bootDiskMib.low >>> 0, object.bootDiskMib.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ComputeResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.ComputeResource + * @static + * @param {google.cloud.batch.v1.ComputeResource} message ComputeResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ComputeResource.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.cpuMilli = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.cpuMilli = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.memoryMib = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.memoryMib = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bootDiskMib = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bootDiskMib = options.longs === String ? "0" : 0; + } + if (message.cpuMilli != null && message.hasOwnProperty("cpuMilli")) + if (typeof message.cpuMilli === "number") + object.cpuMilli = options.longs === String ? String(message.cpuMilli) : message.cpuMilli; + else + object.cpuMilli = options.longs === String ? $util.Long.prototype.toString.call(message.cpuMilli) : options.longs === Number ? new $util.LongBits(message.cpuMilli.low >>> 0, message.cpuMilli.high >>> 0).toNumber() : message.cpuMilli; + if (message.memoryMib != null && message.hasOwnProperty("memoryMib")) + if (typeof message.memoryMib === "number") + object.memoryMib = options.longs === String ? String(message.memoryMib) : message.memoryMib; + else + object.memoryMib = options.longs === String ? $util.Long.prototype.toString.call(message.memoryMib) : options.longs === Number ? new $util.LongBits(message.memoryMib.low >>> 0, message.memoryMib.high >>> 0).toNumber() : message.memoryMib; + if (message.bootDiskMib != null && message.hasOwnProperty("bootDiskMib")) + if (typeof message.bootDiskMib === "number") + object.bootDiskMib = options.longs === String ? String(message.bootDiskMib) : message.bootDiskMib; + else + object.bootDiskMib = options.longs === String ? $util.Long.prototype.toString.call(message.bootDiskMib) : options.longs === Number ? new $util.LongBits(message.bootDiskMib.low >>> 0, message.bootDiskMib.high >>> 0).toNumber() : message.bootDiskMib; + return object; + }; + + /** + * Converts this ComputeResource to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.ComputeResource + * @instance + * @returns {Object.} JSON object + */ + ComputeResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ComputeResource + * @function getTypeUrl + * @memberof google.cloud.batch.v1.ComputeResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ComputeResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.ComputeResource"; + }; + + return ComputeResource; + })(); + + v1.StatusEvent = (function() { + + /** + * Properties of a StatusEvent. + * @memberof google.cloud.batch.v1 + * @interface IStatusEvent + * @property {string|null} [type] StatusEvent type + * @property {string|null} [description] StatusEvent description + * @property {google.protobuf.ITimestamp|null} [eventTime] StatusEvent eventTime + * @property {google.cloud.batch.v1.ITaskExecution|null} [taskExecution] StatusEvent taskExecution + * @property {google.cloud.batch.v1.TaskStatus.State|null} [taskState] StatusEvent taskState + */ + + /** + * Constructs a new StatusEvent. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a StatusEvent. + * @implements IStatusEvent + * @constructor + * @param {google.cloud.batch.v1.IStatusEvent=} [properties] Properties to set + */ + function StatusEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StatusEvent type. + * @member {string} type + * @memberof google.cloud.batch.v1.StatusEvent + * @instance + */ + StatusEvent.prototype.type = ""; + + /** + * StatusEvent description. + * @member {string} description + * @memberof google.cloud.batch.v1.StatusEvent + * @instance + */ + StatusEvent.prototype.description = ""; + + /** + * StatusEvent eventTime. + * @member {google.protobuf.ITimestamp|null|undefined} eventTime + * @memberof google.cloud.batch.v1.StatusEvent + * @instance + */ + StatusEvent.prototype.eventTime = null; + + /** + * StatusEvent taskExecution. + * @member {google.cloud.batch.v1.ITaskExecution|null|undefined} taskExecution + * @memberof google.cloud.batch.v1.StatusEvent + * @instance + */ + StatusEvent.prototype.taskExecution = null; + + /** + * StatusEvent taskState. + * @member {google.cloud.batch.v1.TaskStatus.State} taskState + * @memberof google.cloud.batch.v1.StatusEvent + * @instance + */ + StatusEvent.prototype.taskState = 0; + + /** + * Creates a new StatusEvent instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.StatusEvent + * @static + * @param {google.cloud.batch.v1.IStatusEvent=} [properties] Properties to set + * @returns {google.cloud.batch.v1.StatusEvent} StatusEvent instance + */ + StatusEvent.create = function create(properties) { + return new StatusEvent(properties); + }; + + /** + * Encodes the specified StatusEvent message. Does not implicitly {@link google.cloud.batch.v1.StatusEvent.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.StatusEvent + * @static + * @param {google.cloud.batch.v1.IStatusEvent} message StatusEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StatusEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); + if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) + $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.taskExecution != null && Object.hasOwnProperty.call(message, "taskExecution")) + $root.google.cloud.batch.v1.TaskExecution.encode(message.taskExecution, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.taskState != null && Object.hasOwnProperty.call(message, "taskState")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.taskState); + return writer; + }; + + /** + * Encodes the specified StatusEvent message, length delimited. Does not implicitly {@link google.cloud.batch.v1.StatusEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.StatusEvent + * @static + * @param {google.cloud.batch.v1.IStatusEvent} message StatusEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StatusEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StatusEvent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.StatusEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.StatusEvent} StatusEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StatusEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.StatusEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.type = reader.string(); + break; + } + case 1: { + message.description = reader.string(); + break; + } + case 2: { + message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.taskExecution = $root.google.cloud.batch.v1.TaskExecution.decode(reader, reader.uint32()); + break; + } + case 5: { + message.taskState = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StatusEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.StatusEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.StatusEvent} StatusEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StatusEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StatusEvent message. + * @function verify + * @memberof google.cloud.batch.v1.StatusEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StatusEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.eventTime != null && message.hasOwnProperty("eventTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.eventTime); + if (error) + return "eventTime." + error; + } + if (message.taskExecution != null && message.hasOwnProperty("taskExecution")) { + var error = $root.google.cloud.batch.v1.TaskExecution.verify(message.taskExecution); + if (error) + return "taskExecution." + error; + } + if (message.taskState != null && message.hasOwnProperty("taskState")) + switch (message.taskState) { + default: + return "taskState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + return null; + }; + + /** + * Creates a StatusEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.StatusEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.StatusEvent} StatusEvent + */ + StatusEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.StatusEvent) + return object; + var message = new $root.google.cloud.batch.v1.StatusEvent(); + if (object.type != null) + message.type = String(object.type); + if (object.description != null) + message.description = String(object.description); + if (object.eventTime != null) { + if (typeof object.eventTime !== "object") + throw TypeError(".google.cloud.batch.v1.StatusEvent.eventTime: object expected"); + message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); + } + if (object.taskExecution != null) { + if (typeof object.taskExecution !== "object") + throw TypeError(".google.cloud.batch.v1.StatusEvent.taskExecution: object expected"); + message.taskExecution = $root.google.cloud.batch.v1.TaskExecution.fromObject(object.taskExecution); + } + switch (object.taskState) { + default: + if (typeof object.taskState === "number") { + message.taskState = object.taskState; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.taskState = 0; + break; + case "PENDING": + case 1: + message.taskState = 1; + break; + case "ASSIGNED": + case 2: + message.taskState = 2; + break; + case "RUNNING": + case 3: + message.taskState = 3; + break; + case "FAILED": + case 4: + message.taskState = 4; + break; + case "SUCCEEDED": + case 5: + message.taskState = 5; + break; + case "UNEXECUTED": + case 6: + message.taskState = 6; + break; + } + return message; + }; + + /** + * Creates a plain object from a StatusEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.StatusEvent + * @static + * @param {google.cloud.batch.v1.StatusEvent} message StatusEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StatusEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.description = ""; + object.eventTime = null; + object.type = ""; + object.taskExecution = null; + object.taskState = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.eventTime != null && message.hasOwnProperty("eventTime")) + object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.taskExecution != null && message.hasOwnProperty("taskExecution")) + object.taskExecution = $root.google.cloud.batch.v1.TaskExecution.toObject(message.taskExecution, options); + if (message.taskState != null && message.hasOwnProperty("taskState")) + object.taskState = options.enums === String ? $root.google.cloud.batch.v1.TaskStatus.State[message.taskState] === undefined ? message.taskState : $root.google.cloud.batch.v1.TaskStatus.State[message.taskState] : message.taskState; + return object; + }; + + /** + * Converts this StatusEvent to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.StatusEvent + * @instance + * @returns {Object.} JSON object + */ + StatusEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StatusEvent + * @function getTypeUrl + * @memberof google.cloud.batch.v1.StatusEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StatusEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.StatusEvent"; + }; + + return StatusEvent; + })(); + + v1.TaskExecution = (function() { + + /** + * Properties of a TaskExecution. + * @memberof google.cloud.batch.v1 + * @interface ITaskExecution + * @property {number|null} [exitCode] TaskExecution exitCode + */ + + /** + * Constructs a new TaskExecution. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a TaskExecution. + * @implements ITaskExecution + * @constructor + * @param {google.cloud.batch.v1.ITaskExecution=} [properties] Properties to set + */ + function TaskExecution(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TaskExecution exitCode. + * @member {number} exitCode + * @memberof google.cloud.batch.v1.TaskExecution + * @instance + */ + TaskExecution.prototype.exitCode = 0; + + /** + * Creates a new TaskExecution instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.TaskExecution + * @static + * @param {google.cloud.batch.v1.ITaskExecution=} [properties] Properties to set + * @returns {google.cloud.batch.v1.TaskExecution} TaskExecution instance + */ + TaskExecution.create = function create(properties) { + return new TaskExecution(properties); + }; + + /** + * Encodes the specified TaskExecution message. Does not implicitly {@link google.cloud.batch.v1.TaskExecution.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.TaskExecution + * @static + * @param {google.cloud.batch.v1.ITaskExecution} message TaskExecution message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskExecution.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.exitCode != null && Object.hasOwnProperty.call(message, "exitCode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.exitCode); + return writer; + }; + + /** + * Encodes the specified TaskExecution message, length delimited. Does not implicitly {@link google.cloud.batch.v1.TaskExecution.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.TaskExecution + * @static + * @param {google.cloud.batch.v1.ITaskExecution} message TaskExecution message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskExecution.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TaskExecution message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.TaskExecution + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.TaskExecution} TaskExecution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskExecution.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.TaskExecution(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.exitCode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TaskExecution message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.TaskExecution + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.TaskExecution} TaskExecution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskExecution.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TaskExecution message. + * @function verify + * @memberof google.cloud.batch.v1.TaskExecution + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TaskExecution.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.exitCode != null && message.hasOwnProperty("exitCode")) + if (!$util.isInteger(message.exitCode)) + return "exitCode: integer expected"; + return null; + }; + + /** + * Creates a TaskExecution message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.TaskExecution + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.TaskExecution} TaskExecution + */ + TaskExecution.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.TaskExecution) + return object; + var message = new $root.google.cloud.batch.v1.TaskExecution(); + if (object.exitCode != null) + message.exitCode = object.exitCode | 0; + return message; + }; + + /** + * Creates a plain object from a TaskExecution message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.TaskExecution + * @static + * @param {google.cloud.batch.v1.TaskExecution} message TaskExecution + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TaskExecution.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.exitCode = 0; + if (message.exitCode != null && message.hasOwnProperty("exitCode")) + object.exitCode = message.exitCode; + return object; + }; + + /** + * Converts this TaskExecution to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.TaskExecution + * @instance + * @returns {Object.} JSON object + */ + TaskExecution.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TaskExecution + * @function getTypeUrl + * @memberof google.cloud.batch.v1.TaskExecution + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TaskExecution.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.TaskExecution"; + }; + + return TaskExecution; + })(); + + v1.TaskStatus = (function() { + + /** + * Properties of a TaskStatus. + * @memberof google.cloud.batch.v1 + * @interface ITaskStatus + * @property {google.cloud.batch.v1.TaskStatus.State|null} [state] TaskStatus state + * @property {Array.|null} [statusEvents] TaskStatus statusEvents + */ + + /** + * Constructs a new TaskStatus. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a TaskStatus. + * @implements ITaskStatus + * @constructor + * @param {google.cloud.batch.v1.ITaskStatus=} [properties] Properties to set + */ + function TaskStatus(properties) { + this.statusEvents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TaskStatus state. + * @member {google.cloud.batch.v1.TaskStatus.State} state + * @memberof google.cloud.batch.v1.TaskStatus + * @instance + */ + TaskStatus.prototype.state = 0; + + /** + * TaskStatus statusEvents. + * @member {Array.} statusEvents + * @memberof google.cloud.batch.v1.TaskStatus + * @instance + */ + TaskStatus.prototype.statusEvents = $util.emptyArray; + + /** + * Creates a new TaskStatus instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.TaskStatus + * @static + * @param {google.cloud.batch.v1.ITaskStatus=} [properties] Properties to set + * @returns {google.cloud.batch.v1.TaskStatus} TaskStatus instance + */ + TaskStatus.create = function create(properties) { + return new TaskStatus(properties); + }; + + /** + * Encodes the specified TaskStatus message. Does not implicitly {@link google.cloud.batch.v1.TaskStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.TaskStatus + * @static + * @param {google.cloud.batch.v1.ITaskStatus} message TaskStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskStatus.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); + if (message.statusEvents != null && message.statusEvents.length) + for (var i = 0; i < message.statusEvents.length; ++i) + $root.google.cloud.batch.v1.StatusEvent.encode(message.statusEvents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TaskStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1.TaskStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.TaskStatus + * @static + * @param {google.cloud.batch.v1.ITaskStatus} message TaskStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TaskStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.TaskStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.TaskStatus} TaskStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.TaskStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + if (!(message.statusEvents && message.statusEvents.length)) + message.statusEvents = []; + message.statusEvents.push($root.google.cloud.batch.v1.StatusEvent.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TaskStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.TaskStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.TaskStatus} TaskStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TaskStatus message. + * @function verify + * @memberof google.cloud.batch.v1.TaskStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TaskStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.statusEvents != null && message.hasOwnProperty("statusEvents")) { + if (!Array.isArray(message.statusEvents)) + return "statusEvents: array expected"; + for (var i = 0; i < message.statusEvents.length; ++i) { + var error = $root.google.cloud.batch.v1.StatusEvent.verify(message.statusEvents[i]); + if (error) + return "statusEvents." + error; + } + } + return null; + }; + + /** + * Creates a TaskStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.TaskStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.TaskStatus} TaskStatus + */ + TaskStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.TaskStatus) + return object; + var message = new $root.google.cloud.batch.v1.TaskStatus(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING": + case 1: + message.state = 1; + break; + case "ASSIGNED": + case 2: + message.state = 2; + break; + case "RUNNING": + case 3: + message.state = 3; + break; + case "FAILED": + case 4: + message.state = 4; + break; + case "SUCCEEDED": + case 5: + message.state = 5; + break; + case "UNEXECUTED": + case 6: + message.state = 6; + break; + } + if (object.statusEvents) { + if (!Array.isArray(object.statusEvents)) + throw TypeError(".google.cloud.batch.v1.TaskStatus.statusEvents: array expected"); + message.statusEvents = []; + for (var i = 0; i < object.statusEvents.length; ++i) { + if (typeof object.statusEvents[i] !== "object") + throw TypeError(".google.cloud.batch.v1.TaskStatus.statusEvents: object expected"); + message.statusEvents[i] = $root.google.cloud.batch.v1.StatusEvent.fromObject(object.statusEvents[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TaskStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.TaskStatus + * @static + * @param {google.cloud.batch.v1.TaskStatus} message TaskStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TaskStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.statusEvents = []; + if (options.defaults) + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.batch.v1.TaskStatus.State[message.state] === undefined ? message.state : $root.google.cloud.batch.v1.TaskStatus.State[message.state] : message.state; + if (message.statusEvents && message.statusEvents.length) { + object.statusEvents = []; + for (var j = 0; j < message.statusEvents.length; ++j) + object.statusEvents[j] = $root.google.cloud.batch.v1.StatusEvent.toObject(message.statusEvents[j], options); + } + return object; + }; + + /** + * Converts this TaskStatus to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.TaskStatus + * @instance + * @returns {Object.} JSON object + */ + TaskStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TaskStatus + * @function getTypeUrl + * @memberof google.cloud.batch.v1.TaskStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TaskStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.TaskStatus"; + }; + + /** + * State enum. + * @name google.cloud.batch.v1.TaskStatus.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PENDING=1 PENDING value + * @property {number} ASSIGNED=2 ASSIGNED value + * @property {number} RUNNING=3 RUNNING value + * @property {number} FAILED=4 FAILED value + * @property {number} SUCCEEDED=5 SUCCEEDED value + * @property {number} UNEXECUTED=6 UNEXECUTED value + */ + TaskStatus.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "ASSIGNED"] = 2; + values[valuesById[3] = "RUNNING"] = 3; + values[valuesById[4] = "FAILED"] = 4; + values[valuesById[5] = "SUCCEEDED"] = 5; + values[valuesById[6] = "UNEXECUTED"] = 6; + return values; + })(); + + return TaskStatus; + })(); + + v1.Runnable = (function() { + + /** + * Properties of a Runnable. + * @memberof google.cloud.batch.v1 + * @interface IRunnable + * @property {google.cloud.batch.v1.Runnable.IContainer|null} [container] Runnable container + * @property {google.cloud.batch.v1.Runnable.IScript|null} [script] Runnable script + * @property {google.cloud.batch.v1.Runnable.IBarrier|null} [barrier] Runnable barrier + * @property {string|null} [displayName] Runnable displayName + * @property {boolean|null} [ignoreExitStatus] Runnable ignoreExitStatus + * @property {boolean|null} [background] Runnable background + * @property {boolean|null} [alwaysRun] Runnable alwaysRun + * @property {google.cloud.batch.v1.IEnvironment|null} [environment] Runnable environment + * @property {google.protobuf.IDuration|null} [timeout] Runnable timeout + * @property {Object.|null} [labels] Runnable labels + */ + + /** + * Constructs a new Runnable. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a Runnable. + * @implements IRunnable + * @constructor + * @param {google.cloud.batch.v1.IRunnable=} [properties] Properties to set + */ + function Runnable(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Runnable container. + * @member {google.cloud.batch.v1.Runnable.IContainer|null|undefined} container + * @memberof google.cloud.batch.v1.Runnable + * @instance + */ + Runnable.prototype.container = null; + + /** + * Runnable script. + * @member {google.cloud.batch.v1.Runnable.IScript|null|undefined} script + * @memberof google.cloud.batch.v1.Runnable + * @instance + */ + Runnable.prototype.script = null; + + /** + * Runnable barrier. + * @member {google.cloud.batch.v1.Runnable.IBarrier|null|undefined} barrier + * @memberof google.cloud.batch.v1.Runnable + * @instance + */ + Runnable.prototype.barrier = null; + + /** + * Runnable displayName. + * @member {string} displayName + * @memberof google.cloud.batch.v1.Runnable + * @instance + */ + Runnable.prototype.displayName = ""; + + /** + * Runnable ignoreExitStatus. + * @member {boolean} ignoreExitStatus + * @memberof google.cloud.batch.v1.Runnable + * @instance + */ + Runnable.prototype.ignoreExitStatus = false; + + /** + * Runnable background. + * @member {boolean} background + * @memberof google.cloud.batch.v1.Runnable + * @instance + */ + Runnable.prototype.background = false; + + /** + * Runnable alwaysRun. + * @member {boolean} alwaysRun + * @memberof google.cloud.batch.v1.Runnable + * @instance + */ + Runnable.prototype.alwaysRun = false; + + /** + * Runnable environment. + * @member {google.cloud.batch.v1.IEnvironment|null|undefined} environment + * @memberof google.cloud.batch.v1.Runnable + * @instance + */ + Runnable.prototype.environment = null; + + /** + * Runnable timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.cloud.batch.v1.Runnable + * @instance + */ + Runnable.prototype.timeout = null; + + /** + * Runnable labels. + * @member {Object.} labels + * @memberof google.cloud.batch.v1.Runnable + * @instance + */ + Runnable.prototype.labels = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Runnable executable. + * @member {"container"|"script"|"barrier"|undefined} executable + * @memberof google.cloud.batch.v1.Runnable + * @instance + */ + Object.defineProperty(Runnable.prototype, "executable", { + get: $util.oneOfGetter($oneOfFields = ["container", "script", "barrier"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Runnable instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.Runnable + * @static + * @param {google.cloud.batch.v1.IRunnable=} [properties] Properties to set + * @returns {google.cloud.batch.v1.Runnable} Runnable instance + */ + Runnable.create = function create(properties) { + return new Runnable(properties); + }; + + /** + * Encodes the specified Runnable message. Does not implicitly {@link google.cloud.batch.v1.Runnable.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.Runnable + * @static + * @param {google.cloud.batch.v1.IRunnable} message Runnable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Runnable.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.container != null && Object.hasOwnProperty.call(message, "container")) + $root.google.cloud.batch.v1.Runnable.Container.encode(message.container, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.script != null && Object.hasOwnProperty.call(message, "script")) + $root.google.cloud.batch.v1.Runnable.Script.encode(message.script, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.ignoreExitStatus != null && Object.hasOwnProperty.call(message, "ignoreExitStatus")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.ignoreExitStatus); + if (message.background != null && Object.hasOwnProperty.call(message, "background")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.background); + if (message.alwaysRun != null && Object.hasOwnProperty.call(message, "alwaysRun")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.alwaysRun); + if (message.barrier != null && Object.hasOwnProperty.call(message, "barrier")) + $root.google.cloud.batch.v1.Runnable.Barrier.encode(message.barrier, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + $root.google.cloud.batch.v1.Environment.encode(message.environment, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + 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 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified Runnable message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Runnable.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.Runnable + * @static + * @param {google.cloud.batch.v1.IRunnable} message Runnable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Runnable.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Runnable message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.Runnable + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.Runnable} Runnable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Runnable.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Runnable(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.container = $root.google.cloud.batch.v1.Runnable.Container.decode(reader, reader.uint32()); + break; + } + case 2: { + message.script = $root.google.cloud.batch.v1.Runnable.Script.decode(reader, reader.uint32()); + break; + } + case 6: { + message.barrier = $root.google.cloud.batch.v1.Runnable.Barrier.decode(reader, reader.uint32()); + break; + } + case 10: { + message.displayName = reader.string(); + break; + } + case 3: { + message.ignoreExitStatus = reader.bool(); + break; + } + case 4: { + message.background = reader.bool(); + break; + } + case 5: { + message.alwaysRun = reader.bool(); + break; + } + case 7: { + message.environment = $root.google.cloud.batch.v1.Environment.decode(reader, reader.uint32()); + break; + } + case 8: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 9: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Runnable message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.Runnable + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.Runnable} Runnable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Runnable.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Runnable message. + * @function verify + * @memberof google.cloud.batch.v1.Runnable + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Runnable.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.container != null && message.hasOwnProperty("container")) { + properties.executable = 1; + { + var error = $root.google.cloud.batch.v1.Runnable.Container.verify(message.container); + if (error) + return "container." + error; + } + } + if (message.script != null && message.hasOwnProperty("script")) { + if (properties.executable === 1) + return "executable: multiple values"; + properties.executable = 1; + { + var error = $root.google.cloud.batch.v1.Runnable.Script.verify(message.script); + if (error) + return "script." + error; + } + } + if (message.barrier != null && message.hasOwnProperty("barrier")) { + if (properties.executable === 1) + return "executable: multiple values"; + properties.executable = 1; + { + var error = $root.google.cloud.batch.v1.Runnable.Barrier.verify(message.barrier); + if (error) + return "barrier." + error; + } + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.ignoreExitStatus != null && message.hasOwnProperty("ignoreExitStatus")) + if (typeof message.ignoreExitStatus !== "boolean") + return "ignoreExitStatus: boolean expected"; + if (message.background != null && message.hasOwnProperty("background")) + if (typeof message.background !== "boolean") + return "background: boolean expected"; + if (message.alwaysRun != null && message.hasOwnProperty("alwaysRun")) + if (typeof message.alwaysRun !== "boolean") + return "alwaysRun: boolean expected"; + if (message.environment != null && message.hasOwnProperty("environment")) { + var error = $root.google.cloud.batch.v1.Environment.verify(message.environment); + if (error) + return "environment." + error; + } + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a Runnable message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.Runnable + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.Runnable} Runnable + */ + Runnable.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.Runnable) + return object; + var message = new $root.google.cloud.batch.v1.Runnable(); + if (object.container != null) { + if (typeof object.container !== "object") + throw TypeError(".google.cloud.batch.v1.Runnable.container: object expected"); + message.container = $root.google.cloud.batch.v1.Runnable.Container.fromObject(object.container); + } + if (object.script != null) { + if (typeof object.script !== "object") + throw TypeError(".google.cloud.batch.v1.Runnable.script: object expected"); + message.script = $root.google.cloud.batch.v1.Runnable.Script.fromObject(object.script); + } + if (object.barrier != null) { + if (typeof object.barrier !== "object") + throw TypeError(".google.cloud.batch.v1.Runnable.barrier: object expected"); + message.barrier = $root.google.cloud.batch.v1.Runnable.Barrier.fromObject(object.barrier); + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.ignoreExitStatus != null) + message.ignoreExitStatus = Boolean(object.ignoreExitStatus); + if (object.background != null) + message.background = Boolean(object.background); + if (object.alwaysRun != null) + message.alwaysRun = Boolean(object.alwaysRun); + if (object.environment != null) { + if (typeof object.environment !== "object") + throw TypeError(".google.cloud.batch.v1.Runnable.environment: object expected"); + message.environment = $root.google.cloud.batch.v1.Environment.fromObject(object.environment); + } + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.cloud.batch.v1.Runnable.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.batch.v1.Runnable.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a Runnable message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.Runnable + * @static + * @param {google.cloud.batch.v1.Runnable} message Runnable + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Runnable.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.ignoreExitStatus = false; + object.background = false; + object.alwaysRun = false; + object.environment = null; + object.timeout = null; + object.displayName = ""; + } + if (message.container != null && message.hasOwnProperty("container")) { + object.container = $root.google.cloud.batch.v1.Runnable.Container.toObject(message.container, options); + if (options.oneofs) + object.executable = "container"; + } + if (message.script != null && message.hasOwnProperty("script")) { + object.script = $root.google.cloud.batch.v1.Runnable.Script.toObject(message.script, options); + if (options.oneofs) + object.executable = "script"; + } + if (message.ignoreExitStatus != null && message.hasOwnProperty("ignoreExitStatus")) + object.ignoreExitStatus = message.ignoreExitStatus; + if (message.background != null && message.hasOwnProperty("background")) + object.background = message.background; + if (message.alwaysRun != null && message.hasOwnProperty("alwaysRun")) + object.alwaysRun = message.alwaysRun; + if (message.barrier != null && message.hasOwnProperty("barrier")) { + object.barrier = $root.google.cloud.batch.v1.Runnable.Barrier.toObject(message.barrier, options); + if (options.oneofs) + object.executable = "barrier"; + } + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = $root.google.cloud.batch.v1.Environment.toObject(message.environment, options); + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this Runnable to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.Runnable + * @instance + * @returns {Object.} JSON object + */ + Runnable.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Runnable + * @function getTypeUrl + * @memberof google.cloud.batch.v1.Runnable + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Runnable.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.Runnable"; + }; + + Runnable.Container = (function() { + + /** + * Properties of a Container. + * @memberof google.cloud.batch.v1.Runnable + * @interface IContainer + * @property {string|null} [imageUri] Container imageUri + * @property {Array.|null} [commands] Container commands + * @property {string|null} [entrypoint] Container entrypoint + * @property {Array.|null} [volumes] Container volumes + * @property {string|null} [options] Container options + * @property {boolean|null} [blockExternalNetwork] Container blockExternalNetwork + * @property {string|null} [username] Container username + * @property {string|null} [password] Container password + * @property {boolean|null} [enableImageStreaming] Container enableImageStreaming + */ + + /** + * Constructs a new Container. + * @memberof google.cloud.batch.v1.Runnable + * @classdesc Represents a Container. + * @implements IContainer + * @constructor + * @param {google.cloud.batch.v1.Runnable.IContainer=} [properties] Properties to set + */ + function Container(properties) { + this.commands = []; + this.volumes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Container imageUri. + * @member {string} imageUri + * @memberof google.cloud.batch.v1.Runnable.Container + * @instance + */ + Container.prototype.imageUri = ""; + + /** + * Container commands. + * @member {Array.} commands + * @memberof google.cloud.batch.v1.Runnable.Container + * @instance + */ + Container.prototype.commands = $util.emptyArray; + + /** + * Container entrypoint. + * @member {string} entrypoint + * @memberof google.cloud.batch.v1.Runnable.Container + * @instance + */ + Container.prototype.entrypoint = ""; + + /** + * Container volumes. + * @member {Array.} volumes + * @memberof google.cloud.batch.v1.Runnable.Container + * @instance + */ + Container.prototype.volumes = $util.emptyArray; + + /** + * Container options. + * @member {string} options + * @memberof google.cloud.batch.v1.Runnable.Container + * @instance + */ + Container.prototype.options = ""; + + /** + * Container blockExternalNetwork. + * @member {boolean} blockExternalNetwork + * @memberof google.cloud.batch.v1.Runnable.Container + * @instance + */ + Container.prototype.blockExternalNetwork = false; + + /** + * Container username. + * @member {string} username + * @memberof google.cloud.batch.v1.Runnable.Container + * @instance + */ + Container.prototype.username = ""; + + /** + * Container password. + * @member {string} password + * @memberof google.cloud.batch.v1.Runnable.Container + * @instance + */ + Container.prototype.password = ""; + + /** + * Container enableImageStreaming. + * @member {boolean} enableImageStreaming + * @memberof google.cloud.batch.v1.Runnable.Container + * @instance + */ + Container.prototype.enableImageStreaming = false; + + /** + * Creates a new Container instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.Runnable.Container + * @static + * @param {google.cloud.batch.v1.Runnable.IContainer=} [properties] Properties to set + * @returns {google.cloud.batch.v1.Runnable.Container} Container instance + */ + Container.create = function create(properties) { + return new Container(properties); + }; + + /** + * Encodes the specified Container message. Does not implicitly {@link google.cloud.batch.v1.Runnable.Container.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.Runnable.Container + * @static + * @param {google.cloud.batch.v1.Runnable.IContainer} message Container message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Container.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.imageUri != null && Object.hasOwnProperty.call(message, "imageUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.imageUri); + if (message.commands != null && message.commands.length) + for (var i = 0; i < message.commands.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.commands[i]); + if (message.entrypoint != null && Object.hasOwnProperty.call(message, "entrypoint")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.entrypoint); + if (message.volumes != null && message.volumes.length) + for (var i = 0; i < message.volumes.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.volumes[i]); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.options); + if (message.blockExternalNetwork != null && Object.hasOwnProperty.call(message, "blockExternalNetwork")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.blockExternalNetwork); + if (message.username != null && Object.hasOwnProperty.call(message, "username")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.username); + if (message.password != null && Object.hasOwnProperty.call(message, "password")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.password); + if (message.enableImageStreaming != null && Object.hasOwnProperty.call(message, "enableImageStreaming")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.enableImageStreaming); + return writer; + }; + + /** + * Encodes the specified Container message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Runnable.Container.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.Runnable.Container + * @static + * @param {google.cloud.batch.v1.Runnable.IContainer} message Container message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Container.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Container message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.Runnable.Container + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.Runnable.Container} Container + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Container.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Runnable.Container(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.imageUri = reader.string(); + break; + } + case 2: { + if (!(message.commands && message.commands.length)) + message.commands = []; + message.commands.push(reader.string()); + break; + } + case 3: { + message.entrypoint = reader.string(); + break; + } + case 7: { + if (!(message.volumes && message.volumes.length)) + message.volumes = []; + message.volumes.push(reader.string()); + break; + } + case 8: { + message.options = reader.string(); + break; + } + case 9: { + message.blockExternalNetwork = reader.bool(); + break; + } + case 10: { + message.username = reader.string(); + break; + } + case 11: { + message.password = reader.string(); + break; + } + case 12: { + message.enableImageStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Container message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.Runnable.Container + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.Runnable.Container} Container + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Container.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Container message. + * @function verify + * @memberof google.cloud.batch.v1.Runnable.Container + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Container.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + if (!$util.isString(message.imageUri)) + return "imageUri: string expected"; + if (message.commands != null && message.hasOwnProperty("commands")) { + if (!Array.isArray(message.commands)) + return "commands: array expected"; + for (var i = 0; i < message.commands.length; ++i) + if (!$util.isString(message.commands[i])) + return "commands: string[] expected"; + } + if (message.entrypoint != null && message.hasOwnProperty("entrypoint")) + if (!$util.isString(message.entrypoint)) + return "entrypoint: string expected"; + if (message.volumes != null && message.hasOwnProperty("volumes")) { + if (!Array.isArray(message.volumes)) + return "volumes: array expected"; + for (var i = 0; i < message.volumes.length; ++i) + if (!$util.isString(message.volumes[i])) + return "volumes: string[] expected"; + } + if (message.options != null && message.hasOwnProperty("options")) + if (!$util.isString(message.options)) + return "options: string expected"; + if (message.blockExternalNetwork != null && message.hasOwnProperty("blockExternalNetwork")) + if (typeof message.blockExternalNetwork !== "boolean") + return "blockExternalNetwork: boolean expected"; + if (message.username != null && message.hasOwnProperty("username")) + if (!$util.isString(message.username)) + return "username: string expected"; + if (message.password != null && message.hasOwnProperty("password")) + if (!$util.isString(message.password)) + return "password: string expected"; + if (message.enableImageStreaming != null && message.hasOwnProperty("enableImageStreaming")) + if (typeof message.enableImageStreaming !== "boolean") + return "enableImageStreaming: boolean expected"; + return null; + }; + + /** + * Creates a Container message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.Runnable.Container + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.Runnable.Container} Container + */ + Container.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.Runnable.Container) + return object; + var message = new $root.google.cloud.batch.v1.Runnable.Container(); + if (object.imageUri != null) + message.imageUri = String(object.imageUri); + if (object.commands) { + if (!Array.isArray(object.commands)) + throw TypeError(".google.cloud.batch.v1.Runnable.Container.commands: array expected"); + message.commands = []; + for (var i = 0; i < object.commands.length; ++i) + message.commands[i] = String(object.commands[i]); + } + if (object.entrypoint != null) + message.entrypoint = String(object.entrypoint); + if (object.volumes) { + if (!Array.isArray(object.volumes)) + throw TypeError(".google.cloud.batch.v1.Runnable.Container.volumes: array expected"); + message.volumes = []; + for (var i = 0; i < object.volumes.length; ++i) + message.volumes[i] = String(object.volumes[i]); + } + if (object.options != null) + message.options = String(object.options); + if (object.blockExternalNetwork != null) + message.blockExternalNetwork = Boolean(object.blockExternalNetwork); + if (object.username != null) + message.username = String(object.username); + if (object.password != null) + message.password = String(object.password); + if (object.enableImageStreaming != null) + message.enableImageStreaming = Boolean(object.enableImageStreaming); + return message; + }; + + /** + * Creates a plain object from a Container message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.Runnable.Container + * @static + * @param {google.cloud.batch.v1.Runnable.Container} message Container + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Container.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.commands = []; + object.volumes = []; + } + if (options.defaults) { + object.imageUri = ""; + object.entrypoint = ""; + object.options = ""; + object.blockExternalNetwork = false; + object.username = ""; + object.password = ""; + object.enableImageStreaming = false; + } + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + object.imageUri = message.imageUri; + if (message.commands && message.commands.length) { + object.commands = []; + for (var j = 0; j < message.commands.length; ++j) + object.commands[j] = message.commands[j]; + } + if (message.entrypoint != null && message.hasOwnProperty("entrypoint")) + object.entrypoint = message.entrypoint; + if (message.volumes && message.volumes.length) { + object.volumes = []; + for (var j = 0; j < message.volumes.length; ++j) + object.volumes[j] = message.volumes[j]; + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = message.options; + if (message.blockExternalNetwork != null && message.hasOwnProperty("blockExternalNetwork")) + object.blockExternalNetwork = message.blockExternalNetwork; + if (message.username != null && message.hasOwnProperty("username")) + object.username = message.username; + if (message.password != null && message.hasOwnProperty("password")) + object.password = message.password; + if (message.enableImageStreaming != null && message.hasOwnProperty("enableImageStreaming")) + object.enableImageStreaming = message.enableImageStreaming; + return object; + }; + + /** + * Converts this Container to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.Runnable.Container + * @instance + * @returns {Object.} JSON object + */ + Container.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Container + * @function getTypeUrl + * @memberof google.cloud.batch.v1.Runnable.Container + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Container.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.Runnable.Container"; + }; + + return Container; + })(); + + Runnable.Script = (function() { + + /** + * Properties of a Script. + * @memberof google.cloud.batch.v1.Runnable + * @interface IScript + * @property {string|null} [path] Script path + * @property {string|null} [text] Script text + */ + + /** + * Constructs a new Script. + * @memberof google.cloud.batch.v1.Runnable + * @classdesc Represents a Script. + * @implements IScript + * @constructor + * @param {google.cloud.batch.v1.Runnable.IScript=} [properties] Properties to set + */ + function Script(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Script path. + * @member {string|null|undefined} path + * @memberof google.cloud.batch.v1.Runnable.Script + * @instance + */ + Script.prototype.path = null; + + /** + * Script text. + * @member {string|null|undefined} text + * @memberof google.cloud.batch.v1.Runnable.Script + * @instance + */ + Script.prototype.text = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Script command. + * @member {"path"|"text"|undefined} command + * @memberof google.cloud.batch.v1.Runnable.Script + * @instance + */ + Object.defineProperty(Script.prototype, "command", { + get: $util.oneOfGetter($oneOfFields = ["path", "text"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Script instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.Runnable.Script + * @static + * @param {google.cloud.batch.v1.Runnable.IScript=} [properties] Properties to set + * @returns {google.cloud.batch.v1.Runnable.Script} Script instance + */ + Script.create = function create(properties) { + return new Script(properties); + }; + + /** + * Encodes the specified Script message. Does not implicitly {@link google.cloud.batch.v1.Runnable.Script.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.Runnable.Script + * @static + * @param {google.cloud.batch.v1.Runnable.IScript} message Script message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Script.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.path); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.text); + return writer; + }; + + /** + * Encodes the specified Script message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Runnable.Script.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.Runnable.Script + * @static + * @param {google.cloud.batch.v1.Runnable.IScript} message Script message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Script.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Script message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.Runnable.Script + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.Runnable.Script} Script + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Script.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Runnable.Script(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.path = reader.string(); + break; + } + case 2: { + message.text = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Script message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.Runnable.Script + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.Runnable.Script} Script + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Script.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Script message. + * @function verify + * @memberof google.cloud.batch.v1.Runnable.Script + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Script.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.path != null && message.hasOwnProperty("path")) { + properties.command = 1; + if (!$util.isString(message.path)) + return "path: string expected"; + } + if (message.text != null && message.hasOwnProperty("text")) { + if (properties.command === 1) + return "command: multiple values"; + properties.command = 1; + if (!$util.isString(message.text)) + return "text: string expected"; + } + return null; + }; + + /** + * Creates a Script message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.Runnable.Script + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.Runnable.Script} Script + */ + Script.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.Runnable.Script) + return object; + var message = new $root.google.cloud.batch.v1.Runnable.Script(); + if (object.path != null) + message.path = String(object.path); + if (object.text != null) + message.text = String(object.text); + return message; + }; + + /** + * Creates a plain object from a Script message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.Runnable.Script + * @static + * @param {google.cloud.batch.v1.Runnable.Script} message Script + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Script.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.path != null && message.hasOwnProperty("path")) { + object.path = message.path; + if (options.oneofs) + object.command = "path"; + } + if (message.text != null && message.hasOwnProperty("text")) { + object.text = message.text; + if (options.oneofs) + object.command = "text"; + } + return object; + }; + + /** + * Converts this Script to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.Runnable.Script + * @instance + * @returns {Object.} JSON object + */ + Script.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Script + * @function getTypeUrl + * @memberof google.cloud.batch.v1.Runnable.Script + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Script.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.Runnable.Script"; + }; + + return Script; + })(); + + Runnable.Barrier = (function() { + + /** + * Properties of a Barrier. + * @memberof google.cloud.batch.v1.Runnable + * @interface IBarrier + * @property {string|null} [name] Barrier name + */ + + /** + * Constructs a new Barrier. + * @memberof google.cloud.batch.v1.Runnable + * @classdesc Represents a Barrier. + * @implements IBarrier + * @constructor + * @param {google.cloud.batch.v1.Runnable.IBarrier=} [properties] Properties to set + */ + function Barrier(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Barrier name. + * @member {string} name + * @memberof google.cloud.batch.v1.Runnable.Barrier + * @instance + */ + Barrier.prototype.name = ""; + + /** + * Creates a new Barrier instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.Runnable.Barrier + * @static + * @param {google.cloud.batch.v1.Runnable.IBarrier=} [properties] Properties to set + * @returns {google.cloud.batch.v1.Runnable.Barrier} Barrier instance + */ + Barrier.create = function create(properties) { + return new Barrier(properties); + }; + + /** + * Encodes the specified Barrier message. Does not implicitly {@link google.cloud.batch.v1.Runnable.Barrier.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.Runnable.Barrier + * @static + * @param {google.cloud.batch.v1.Runnable.IBarrier} message Barrier message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Barrier.encode = function encode(message, writer) { + 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 Barrier message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Runnable.Barrier.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.Runnable.Barrier + * @static + * @param {google.cloud.batch.v1.Runnable.IBarrier} message Barrier message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Barrier.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Barrier message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.Runnable.Barrier + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.Runnable.Barrier} Barrier + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Barrier.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Runnable.Barrier(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Barrier message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.Runnable.Barrier + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.Runnable.Barrier} Barrier + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Barrier.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Barrier message. + * @function verify + * @memberof google.cloud.batch.v1.Runnable.Barrier + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Barrier.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a Barrier message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.Runnable.Barrier + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.Runnable.Barrier} Barrier + */ + Barrier.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.Runnable.Barrier) + return object; + var message = new $root.google.cloud.batch.v1.Runnable.Barrier(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a Barrier message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.Runnable.Barrier + * @static + * @param {google.cloud.batch.v1.Runnable.Barrier} message Barrier + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Barrier.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 Barrier to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.Runnable.Barrier + * @instance + * @returns {Object.} JSON object + */ + Barrier.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Barrier + * @function getTypeUrl + * @memberof google.cloud.batch.v1.Runnable.Barrier + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Barrier.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.Runnable.Barrier"; + }; + + return Barrier; + })(); + + return Runnable; + })(); + + v1.TaskSpec = (function() { + + /** + * Properties of a TaskSpec. + * @memberof google.cloud.batch.v1 + * @interface ITaskSpec + * @property {Array.|null} [runnables] TaskSpec runnables + * @property {google.cloud.batch.v1.IComputeResource|null} [computeResource] TaskSpec computeResource + * @property {google.protobuf.IDuration|null} [maxRunDuration] TaskSpec maxRunDuration + * @property {number|null} [maxRetryCount] TaskSpec maxRetryCount + * @property {Array.|null} [lifecyclePolicies] TaskSpec lifecyclePolicies + * @property {Object.|null} [environments] TaskSpec environments + * @property {Array.|null} [volumes] TaskSpec volumes + * @property {google.cloud.batch.v1.IEnvironment|null} [environment] TaskSpec environment + */ + + /** + * Constructs a new TaskSpec. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a TaskSpec. + * @implements ITaskSpec + * @constructor + * @param {google.cloud.batch.v1.ITaskSpec=} [properties] Properties to set + */ + function TaskSpec(properties) { + this.runnables = []; + this.lifecyclePolicies = []; + this.environments = {}; + this.volumes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TaskSpec runnables. + * @member {Array.} runnables + * @memberof google.cloud.batch.v1.TaskSpec + * @instance + */ + TaskSpec.prototype.runnables = $util.emptyArray; + + /** + * TaskSpec computeResource. + * @member {google.cloud.batch.v1.IComputeResource|null|undefined} computeResource + * @memberof google.cloud.batch.v1.TaskSpec + * @instance + */ + TaskSpec.prototype.computeResource = null; + + /** + * TaskSpec maxRunDuration. + * @member {google.protobuf.IDuration|null|undefined} maxRunDuration + * @memberof google.cloud.batch.v1.TaskSpec + * @instance + */ + TaskSpec.prototype.maxRunDuration = null; + + /** + * TaskSpec maxRetryCount. + * @member {number} maxRetryCount + * @memberof google.cloud.batch.v1.TaskSpec + * @instance + */ + TaskSpec.prototype.maxRetryCount = 0; + + /** + * TaskSpec lifecyclePolicies. + * @member {Array.} lifecyclePolicies + * @memberof google.cloud.batch.v1.TaskSpec + * @instance + */ + TaskSpec.prototype.lifecyclePolicies = $util.emptyArray; + + /** + * TaskSpec environments. + * @member {Object.} environments + * @memberof google.cloud.batch.v1.TaskSpec + * @instance + */ + TaskSpec.prototype.environments = $util.emptyObject; + + /** + * TaskSpec volumes. + * @member {Array.} volumes + * @memberof google.cloud.batch.v1.TaskSpec + * @instance + */ + TaskSpec.prototype.volumes = $util.emptyArray; + + /** + * TaskSpec environment. + * @member {google.cloud.batch.v1.IEnvironment|null|undefined} environment + * @memberof google.cloud.batch.v1.TaskSpec + * @instance + */ + TaskSpec.prototype.environment = null; + + /** + * Creates a new TaskSpec instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.TaskSpec + * @static + * @param {google.cloud.batch.v1.ITaskSpec=} [properties] Properties to set + * @returns {google.cloud.batch.v1.TaskSpec} TaskSpec instance + */ + TaskSpec.create = function create(properties) { + return new TaskSpec(properties); + }; + + /** + * Encodes the specified TaskSpec message. Does not implicitly {@link google.cloud.batch.v1.TaskSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.TaskSpec + * @static + * @param {google.cloud.batch.v1.ITaskSpec} message TaskSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.computeResource != null && Object.hasOwnProperty.call(message, "computeResource")) + $root.google.cloud.batch.v1.ComputeResource.encode(message.computeResource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.maxRunDuration != null && Object.hasOwnProperty.call(message, "maxRunDuration")) + $root.google.protobuf.Duration.encode(message.maxRunDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.maxRetryCount != null && Object.hasOwnProperty.call(message, "maxRetryCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxRetryCount); + if (message.environments != null && Object.hasOwnProperty.call(message, "environments")) + for (var keys = Object.keys(message.environments), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.environments[keys[i]]).ldelim(); + if (message.volumes != null && message.volumes.length) + for (var i = 0; i < message.volumes.length; ++i) + $root.google.cloud.batch.v1.Volume.encode(message.volumes[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.runnables != null && message.runnables.length) + for (var i = 0; i < message.runnables.length; ++i) + $root.google.cloud.batch.v1.Runnable.encode(message.runnables[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.lifecyclePolicies != null && message.lifecyclePolicies.length) + for (var i = 0; i < message.lifecyclePolicies.length; ++i) + $root.google.cloud.batch.v1.LifecyclePolicy.encode(message.lifecyclePolicies[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + $root.google.cloud.batch.v1.Environment.encode(message.environment, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TaskSpec message, length delimited. Does not implicitly {@link google.cloud.batch.v1.TaskSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.TaskSpec + * @static + * @param {google.cloud.batch.v1.ITaskSpec} message TaskSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TaskSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.TaskSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.TaskSpec} TaskSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.TaskSpec(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 8: { + if (!(message.runnables && message.runnables.length)) + message.runnables = []; + message.runnables.push($root.google.cloud.batch.v1.Runnable.decode(reader, reader.uint32())); + break; + } + case 3: { + message.computeResource = $root.google.cloud.batch.v1.ComputeResource.decode(reader, reader.uint32()); + break; + } + case 4: { + message.maxRunDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.maxRetryCount = reader.int32(); + break; + } + case 9: { + if (!(message.lifecyclePolicies && message.lifecyclePolicies.length)) + message.lifecyclePolicies = []; + message.lifecyclePolicies.push($root.google.cloud.batch.v1.LifecyclePolicy.decode(reader, reader.uint32())); + break; + } + case 6: { + if (message.environments === $util.emptyObject) + message.environments = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.environments[key] = value; + break; + } + case 7: { + if (!(message.volumes && message.volumes.length)) + message.volumes = []; + message.volumes.push($root.google.cloud.batch.v1.Volume.decode(reader, reader.uint32())); + break; + } + case 10: { + message.environment = $root.google.cloud.batch.v1.Environment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TaskSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.TaskSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.TaskSpec} TaskSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TaskSpec message. + * @function verify + * @memberof google.cloud.batch.v1.TaskSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TaskSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.runnables != null && message.hasOwnProperty("runnables")) { + if (!Array.isArray(message.runnables)) + return "runnables: array expected"; + for (var i = 0; i < message.runnables.length; ++i) { + var error = $root.google.cloud.batch.v1.Runnable.verify(message.runnables[i]); + if (error) + return "runnables." + error; + } + } + if (message.computeResource != null && message.hasOwnProperty("computeResource")) { + var error = $root.google.cloud.batch.v1.ComputeResource.verify(message.computeResource); + if (error) + return "computeResource." + error; + } + if (message.maxRunDuration != null && message.hasOwnProperty("maxRunDuration")) { + var error = $root.google.protobuf.Duration.verify(message.maxRunDuration); + if (error) + return "maxRunDuration." + error; + } + if (message.maxRetryCount != null && message.hasOwnProperty("maxRetryCount")) + if (!$util.isInteger(message.maxRetryCount)) + return "maxRetryCount: integer expected"; + if (message.lifecyclePolicies != null && message.hasOwnProperty("lifecyclePolicies")) { + if (!Array.isArray(message.lifecyclePolicies)) + return "lifecyclePolicies: array expected"; + for (var i = 0; i < message.lifecyclePolicies.length; ++i) { + var error = $root.google.cloud.batch.v1.LifecyclePolicy.verify(message.lifecyclePolicies[i]); + if (error) + return "lifecyclePolicies." + error; + } + } + if (message.environments != null && message.hasOwnProperty("environments")) { + if (!$util.isObject(message.environments)) + return "environments: object expected"; + var key = Object.keys(message.environments); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.environments[key[i]])) + return "environments: string{k:string} expected"; + } + if (message.volumes != null && message.hasOwnProperty("volumes")) { + if (!Array.isArray(message.volumes)) + return "volumes: array expected"; + for (var i = 0; i < message.volumes.length; ++i) { + var error = $root.google.cloud.batch.v1.Volume.verify(message.volumes[i]); + if (error) + return "volumes." + error; + } + } + if (message.environment != null && message.hasOwnProperty("environment")) { + var error = $root.google.cloud.batch.v1.Environment.verify(message.environment); + if (error) + return "environment." + error; + } + return null; + }; + + /** + * Creates a TaskSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.TaskSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.TaskSpec} TaskSpec + */ + TaskSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.TaskSpec) + return object; + var message = new $root.google.cloud.batch.v1.TaskSpec(); + if (object.runnables) { + if (!Array.isArray(object.runnables)) + throw TypeError(".google.cloud.batch.v1.TaskSpec.runnables: array expected"); + message.runnables = []; + for (var i = 0; i < object.runnables.length; ++i) { + if (typeof object.runnables[i] !== "object") + throw TypeError(".google.cloud.batch.v1.TaskSpec.runnables: object expected"); + message.runnables[i] = $root.google.cloud.batch.v1.Runnable.fromObject(object.runnables[i]); + } + } + if (object.computeResource != null) { + if (typeof object.computeResource !== "object") + throw TypeError(".google.cloud.batch.v1.TaskSpec.computeResource: object expected"); + message.computeResource = $root.google.cloud.batch.v1.ComputeResource.fromObject(object.computeResource); + } + if (object.maxRunDuration != null) { + if (typeof object.maxRunDuration !== "object") + throw TypeError(".google.cloud.batch.v1.TaskSpec.maxRunDuration: object expected"); + message.maxRunDuration = $root.google.protobuf.Duration.fromObject(object.maxRunDuration); + } + if (object.maxRetryCount != null) + message.maxRetryCount = object.maxRetryCount | 0; + if (object.lifecyclePolicies) { + if (!Array.isArray(object.lifecyclePolicies)) + throw TypeError(".google.cloud.batch.v1.TaskSpec.lifecyclePolicies: array expected"); + message.lifecyclePolicies = []; + for (var i = 0; i < object.lifecyclePolicies.length; ++i) { + if (typeof object.lifecyclePolicies[i] !== "object") + throw TypeError(".google.cloud.batch.v1.TaskSpec.lifecyclePolicies: object expected"); + message.lifecyclePolicies[i] = $root.google.cloud.batch.v1.LifecyclePolicy.fromObject(object.lifecyclePolicies[i]); + } + } + if (object.environments) { + if (typeof object.environments !== "object") + throw TypeError(".google.cloud.batch.v1.TaskSpec.environments: object expected"); + message.environments = {}; + for (var keys = Object.keys(object.environments), i = 0; i < keys.length; ++i) + message.environments[keys[i]] = String(object.environments[keys[i]]); + } + if (object.volumes) { + if (!Array.isArray(object.volumes)) + throw TypeError(".google.cloud.batch.v1.TaskSpec.volumes: array expected"); + message.volumes = []; + for (var i = 0; i < object.volumes.length; ++i) { + if (typeof object.volumes[i] !== "object") + throw TypeError(".google.cloud.batch.v1.TaskSpec.volumes: object expected"); + message.volumes[i] = $root.google.cloud.batch.v1.Volume.fromObject(object.volumes[i]); + } + } + if (object.environment != null) { + if (typeof object.environment !== "object") + throw TypeError(".google.cloud.batch.v1.TaskSpec.environment: object expected"); + message.environment = $root.google.cloud.batch.v1.Environment.fromObject(object.environment); + } + return message; + }; + + /** + * Creates a plain object from a TaskSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.TaskSpec + * @static + * @param {google.cloud.batch.v1.TaskSpec} message TaskSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TaskSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.volumes = []; + object.runnables = []; + object.lifecyclePolicies = []; + } + if (options.objects || options.defaults) + object.environments = {}; + if (options.defaults) { + object.computeResource = null; + object.maxRunDuration = null; + object.maxRetryCount = 0; + object.environment = null; + } + if (message.computeResource != null && message.hasOwnProperty("computeResource")) + object.computeResource = $root.google.cloud.batch.v1.ComputeResource.toObject(message.computeResource, options); + if (message.maxRunDuration != null && message.hasOwnProperty("maxRunDuration")) + object.maxRunDuration = $root.google.protobuf.Duration.toObject(message.maxRunDuration, options); + if (message.maxRetryCount != null && message.hasOwnProperty("maxRetryCount")) + object.maxRetryCount = message.maxRetryCount; + var keys2; + if (message.environments && (keys2 = Object.keys(message.environments)).length) { + object.environments = {}; + for (var j = 0; j < keys2.length; ++j) + object.environments[keys2[j]] = message.environments[keys2[j]]; + } + if (message.volumes && message.volumes.length) { + object.volumes = []; + for (var j = 0; j < message.volumes.length; ++j) + object.volumes[j] = $root.google.cloud.batch.v1.Volume.toObject(message.volumes[j], options); + } + if (message.runnables && message.runnables.length) { + object.runnables = []; + for (var j = 0; j < message.runnables.length; ++j) + object.runnables[j] = $root.google.cloud.batch.v1.Runnable.toObject(message.runnables[j], options); + } + if (message.lifecyclePolicies && message.lifecyclePolicies.length) { + object.lifecyclePolicies = []; + for (var j = 0; j < message.lifecyclePolicies.length; ++j) + object.lifecyclePolicies[j] = $root.google.cloud.batch.v1.LifecyclePolicy.toObject(message.lifecyclePolicies[j], options); + } + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = $root.google.cloud.batch.v1.Environment.toObject(message.environment, options); + return object; + }; + + /** + * Converts this TaskSpec to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.TaskSpec + * @instance + * @returns {Object.} JSON object + */ + TaskSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TaskSpec + * @function getTypeUrl + * @memberof google.cloud.batch.v1.TaskSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TaskSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.TaskSpec"; + }; + + return TaskSpec; + })(); + + v1.LifecyclePolicy = (function() { + + /** + * Properties of a LifecyclePolicy. + * @memberof google.cloud.batch.v1 + * @interface ILifecyclePolicy + * @property {google.cloud.batch.v1.LifecyclePolicy.Action|null} [action] LifecyclePolicy action + * @property {google.cloud.batch.v1.LifecyclePolicy.IActionCondition|null} [actionCondition] LifecyclePolicy actionCondition + */ + + /** + * Constructs a new LifecyclePolicy. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a LifecyclePolicy. + * @implements ILifecyclePolicy + * @constructor + * @param {google.cloud.batch.v1.ILifecyclePolicy=} [properties] Properties to set + */ + function LifecyclePolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LifecyclePolicy action. + * @member {google.cloud.batch.v1.LifecyclePolicy.Action} action + * @memberof google.cloud.batch.v1.LifecyclePolicy + * @instance + */ + LifecyclePolicy.prototype.action = 0; + + /** + * LifecyclePolicy actionCondition. + * @member {google.cloud.batch.v1.LifecyclePolicy.IActionCondition|null|undefined} actionCondition + * @memberof google.cloud.batch.v1.LifecyclePolicy + * @instance + */ + LifecyclePolicy.prototype.actionCondition = null; + + /** + * Creates a new LifecyclePolicy instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.LifecyclePolicy + * @static + * @param {google.cloud.batch.v1.ILifecyclePolicy=} [properties] Properties to set + * @returns {google.cloud.batch.v1.LifecyclePolicy} LifecyclePolicy instance + */ + LifecyclePolicy.create = function create(properties) { + return new LifecyclePolicy(properties); + }; + + /** + * Encodes the specified LifecyclePolicy message. Does not implicitly {@link google.cloud.batch.v1.LifecyclePolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.LifecyclePolicy + * @static + * @param {google.cloud.batch.v1.ILifecyclePolicy} message LifecyclePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LifecyclePolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.actionCondition != null && Object.hasOwnProperty.call(message, "actionCondition")) + $root.google.cloud.batch.v1.LifecyclePolicy.ActionCondition.encode(message.actionCondition, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LifecyclePolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.LifecyclePolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.LifecyclePolicy + * @static + * @param {google.cloud.batch.v1.ILifecyclePolicy} message LifecyclePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LifecyclePolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LifecyclePolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.LifecyclePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.LifecyclePolicy} LifecyclePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LifecyclePolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.LifecyclePolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.actionCondition = $root.google.cloud.batch.v1.LifecyclePolicy.ActionCondition.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LifecyclePolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.LifecyclePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.LifecyclePolicy} LifecyclePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LifecyclePolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LifecyclePolicy message. + * @function verify + * @memberof google.cloud.batch.v1.LifecyclePolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LifecyclePolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.actionCondition != null && message.hasOwnProperty("actionCondition")) { + var error = $root.google.cloud.batch.v1.LifecyclePolicy.ActionCondition.verify(message.actionCondition); + if (error) + return "actionCondition." + error; + } + return null; + }; + + /** + * Creates a LifecyclePolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.LifecyclePolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.LifecyclePolicy} LifecyclePolicy + */ + LifecyclePolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.LifecyclePolicy) + return object; + var message = new $root.google.cloud.batch.v1.LifecyclePolicy(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "RETRY_TASK": + case 1: + message.action = 1; + break; + case "FAIL_TASK": + case 2: + message.action = 2; + break; + } + if (object.actionCondition != null) { + if (typeof object.actionCondition !== "object") + throw TypeError(".google.cloud.batch.v1.LifecyclePolicy.actionCondition: object expected"); + message.actionCondition = $root.google.cloud.batch.v1.LifecyclePolicy.ActionCondition.fromObject(object.actionCondition); + } + return message; + }; + + /** + * Creates a plain object from a LifecyclePolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.LifecyclePolicy + * @static + * @param {google.cloud.batch.v1.LifecyclePolicy} message LifecyclePolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LifecyclePolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.actionCondition = null; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.cloud.batch.v1.LifecyclePolicy.Action[message.action] === undefined ? message.action : $root.google.cloud.batch.v1.LifecyclePolicy.Action[message.action] : message.action; + if (message.actionCondition != null && message.hasOwnProperty("actionCondition")) + object.actionCondition = $root.google.cloud.batch.v1.LifecyclePolicy.ActionCondition.toObject(message.actionCondition, options); + return object; + }; + + /** + * Converts this LifecyclePolicy to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.LifecyclePolicy + * @instance + * @returns {Object.} JSON object + */ + LifecyclePolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LifecyclePolicy + * @function getTypeUrl + * @memberof google.cloud.batch.v1.LifecyclePolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LifecyclePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.LifecyclePolicy"; + }; + + LifecyclePolicy.ActionCondition = (function() { + + /** + * Properties of an ActionCondition. + * @memberof google.cloud.batch.v1.LifecyclePolicy + * @interface IActionCondition + * @property {Array.|null} [exitCodes] ActionCondition exitCodes + */ + + /** + * Constructs a new ActionCondition. + * @memberof google.cloud.batch.v1.LifecyclePolicy + * @classdesc Represents an ActionCondition. + * @implements IActionCondition + * @constructor + * @param {google.cloud.batch.v1.LifecyclePolicy.IActionCondition=} [properties] Properties to set + */ + function ActionCondition(properties) { + this.exitCodes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ActionCondition exitCodes. + * @member {Array.} exitCodes + * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition + * @instance + */ + ActionCondition.prototype.exitCodes = $util.emptyArray; + + /** + * Creates a new ActionCondition instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition + * @static + * @param {google.cloud.batch.v1.LifecyclePolicy.IActionCondition=} [properties] Properties to set + * @returns {google.cloud.batch.v1.LifecyclePolicy.ActionCondition} ActionCondition instance + */ + ActionCondition.create = function create(properties) { + return new ActionCondition(properties); + }; + + /** + * Encodes the specified ActionCondition message. Does not implicitly {@link google.cloud.batch.v1.LifecyclePolicy.ActionCondition.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition + * @static + * @param {google.cloud.batch.v1.LifecyclePolicy.IActionCondition} message ActionCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActionCondition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.exitCodes != null && message.exitCodes.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.exitCodes.length; ++i) + writer.int32(message.exitCodes[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ActionCondition message, length delimited. Does not implicitly {@link google.cloud.batch.v1.LifecyclePolicy.ActionCondition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition + * @static + * @param {google.cloud.batch.v1.LifecyclePolicy.IActionCondition} message ActionCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActionCondition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ActionCondition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.LifecyclePolicy.ActionCondition} ActionCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActionCondition.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.LifecyclePolicy.ActionCondition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.exitCodes && message.exitCodes.length)) + message.exitCodes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.exitCodes.push(reader.int32()); + } else + message.exitCodes.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ActionCondition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.LifecyclePolicy.ActionCondition} ActionCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActionCondition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ActionCondition message. + * @function verify + * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ActionCondition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.exitCodes != null && message.hasOwnProperty("exitCodes")) { + if (!Array.isArray(message.exitCodes)) + return "exitCodes: array expected"; + for (var i = 0; i < message.exitCodes.length; ++i) + if (!$util.isInteger(message.exitCodes[i])) + return "exitCodes: integer[] expected"; + } + return null; + }; + + /** + * Creates an ActionCondition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.LifecyclePolicy.ActionCondition} ActionCondition + */ + ActionCondition.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.LifecyclePolicy.ActionCondition) + return object; + var message = new $root.google.cloud.batch.v1.LifecyclePolicy.ActionCondition(); + if (object.exitCodes) { + if (!Array.isArray(object.exitCodes)) + throw TypeError(".google.cloud.batch.v1.LifecyclePolicy.ActionCondition.exitCodes: array expected"); + message.exitCodes = []; + for (var i = 0; i < object.exitCodes.length; ++i) + message.exitCodes[i] = object.exitCodes[i] | 0; + } + return message; + }; + + /** + * Creates a plain object from an ActionCondition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition + * @static + * @param {google.cloud.batch.v1.LifecyclePolicy.ActionCondition} message ActionCondition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ActionCondition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.exitCodes = []; + if (message.exitCodes && message.exitCodes.length) { + object.exitCodes = []; + for (var j = 0; j < message.exitCodes.length; ++j) + object.exitCodes[j] = message.exitCodes[j]; + } + return object; + }; + + /** + * Converts this ActionCondition to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition + * @instance + * @returns {Object.} JSON object + */ + ActionCondition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ActionCondition + * @function getTypeUrl + * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ActionCondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.LifecyclePolicy.ActionCondition"; + }; + + return ActionCondition; + })(); + + /** + * Action enum. + * @name google.cloud.batch.v1.LifecyclePolicy.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} RETRY_TASK=1 RETRY_TASK value + * @property {number} FAIL_TASK=2 FAIL_TASK value + */ + LifecyclePolicy.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "RETRY_TASK"] = 1; + values[valuesById[2] = "FAIL_TASK"] = 2; + return values; + })(); + + return LifecyclePolicy; + })(); + + v1.Task = (function() { + + /** + * Properties of a Task. + * @memberof google.cloud.batch.v1 + * @interface ITask + * @property {string|null} [name] Task name + * @property {google.cloud.batch.v1.ITaskStatus|null} [status] Task status + */ + + /** + * Constructs a new Task. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a Task. + * @implements ITask + * @constructor + * @param {google.cloud.batch.v1.ITask=} [properties] Properties to set + */ + function Task(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Task name. + * @member {string} name + * @memberof google.cloud.batch.v1.Task + * @instance + */ + Task.prototype.name = ""; + + /** + * Task status. + * @member {google.cloud.batch.v1.ITaskStatus|null|undefined} status + * @memberof google.cloud.batch.v1.Task + * @instance + */ + Task.prototype.status = null; + + /** + * Creates a new Task instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.Task + * @static + * @param {google.cloud.batch.v1.ITask=} [properties] Properties to set + * @returns {google.cloud.batch.v1.Task} Task instance + */ + Task.create = function create(properties) { + return new Task(properties); + }; + + /** + * Encodes the specified Task message. Does not implicitly {@link google.cloud.batch.v1.Task.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.Task + * @static + * @param {google.cloud.batch.v1.ITask} message Task message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Task.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.cloud.batch.v1.TaskStatus.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Task message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Task.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.Task + * @static + * @param {google.cloud.batch.v1.ITask} message Task message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Task.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Task message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.Task + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.Task} Task + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Task.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Task(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.status = $root.google.cloud.batch.v1.TaskStatus.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Task message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.Task + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.Task} Task + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Task.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Task message. + * @function verify + * @memberof google.cloud.batch.v1.Task + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Task.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.cloud.batch.v1.TaskStatus.verify(message.status); + if (error) + return "status." + error; + } + return null; + }; + + /** + * Creates a Task message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.Task + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.Task} Task + */ + Task.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.Task) + return object; + var message = new $root.google.cloud.batch.v1.Task(); + if (object.name != null) + message.name = String(object.name); + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.batch.v1.Task.status: object expected"); + message.status = $root.google.cloud.batch.v1.TaskStatus.fromObject(object.status); + } + return message; + }; + + /** + * Creates a plain object from a Task message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.Task + * @static + * @param {google.cloud.batch.v1.Task} message Task + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Task.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.status = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.cloud.batch.v1.TaskStatus.toObject(message.status, options); + return object; + }; + + /** + * Converts this Task to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.Task + * @instance + * @returns {Object.} JSON object + */ + Task.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Task + * @function getTypeUrl + * @memberof google.cloud.batch.v1.Task + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Task.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.Task"; + }; + + return Task; + })(); + + v1.Environment = (function() { + + /** + * Properties of an Environment. + * @memberof google.cloud.batch.v1 + * @interface IEnvironment + * @property {Object.|null} [variables] Environment variables + * @property {Object.|null} [secretVariables] Environment secretVariables + * @property {google.cloud.batch.v1.Environment.IKMSEnvMap|null} [encryptedVariables] Environment encryptedVariables + */ + + /** + * Constructs a new Environment. + * @memberof google.cloud.batch.v1 + * @classdesc Represents an Environment. + * @implements IEnvironment + * @constructor + * @param {google.cloud.batch.v1.IEnvironment=} [properties] Properties to set + */ + function Environment(properties) { + this.variables = {}; + this.secretVariables = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Environment variables. + * @member {Object.} variables + * @memberof google.cloud.batch.v1.Environment + * @instance + */ + Environment.prototype.variables = $util.emptyObject; + + /** + * Environment secretVariables. + * @member {Object.} secretVariables + * @memberof google.cloud.batch.v1.Environment + * @instance + */ + Environment.prototype.secretVariables = $util.emptyObject; + + /** + * Environment encryptedVariables. + * @member {google.cloud.batch.v1.Environment.IKMSEnvMap|null|undefined} encryptedVariables + * @memberof google.cloud.batch.v1.Environment + * @instance + */ + Environment.prototype.encryptedVariables = null; + + /** + * Creates a new Environment instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.Environment + * @static + * @param {google.cloud.batch.v1.IEnvironment=} [properties] Properties to set + * @returns {google.cloud.batch.v1.Environment} Environment instance + */ + Environment.create = function create(properties) { + return new Environment(properties); + }; + + /** + * Encodes the specified Environment message. Does not implicitly {@link google.cloud.batch.v1.Environment.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.Environment + * @static + * @param {google.cloud.batch.v1.IEnvironment} message Environment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Environment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.variables != null && Object.hasOwnProperty.call(message, "variables")) + for (var keys = Object.keys(message.variables), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.variables[keys[i]]).ldelim(); + if (message.secretVariables != null && Object.hasOwnProperty.call(message, "secretVariables")) + for (var keys = Object.keys(message.secretVariables), 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.secretVariables[keys[i]]).ldelim(); + if (message.encryptedVariables != null && Object.hasOwnProperty.call(message, "encryptedVariables")) + $root.google.cloud.batch.v1.Environment.KMSEnvMap.encode(message.encryptedVariables, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Environment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.Environment + * @static + * @param {google.cloud.batch.v1.IEnvironment} message Environment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Environment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Environment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.Environment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.Environment} Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Environment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Environment(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.variables === $util.emptyObject) + message.variables = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.variables[key] = value; + break; + } + case 2: { + if (message.secretVariables === $util.emptyObject) + message.secretVariables = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.secretVariables[key] = value; + break; + } + case 3: { + message.encryptedVariables = $root.google.cloud.batch.v1.Environment.KMSEnvMap.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Environment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.Environment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.Environment} Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Environment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Environment message. + * @function verify + * @memberof google.cloud.batch.v1.Environment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Environment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.variables != null && message.hasOwnProperty("variables")) { + if (!$util.isObject(message.variables)) + return "variables: object expected"; + var key = Object.keys(message.variables); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.variables[key[i]])) + return "variables: string{k:string} expected"; + } + if (message.secretVariables != null && message.hasOwnProperty("secretVariables")) { + if (!$util.isObject(message.secretVariables)) + return "secretVariables: object expected"; + var key = Object.keys(message.secretVariables); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.secretVariables[key[i]])) + return "secretVariables: string{k:string} expected"; + } + if (message.encryptedVariables != null && message.hasOwnProperty("encryptedVariables")) { + var error = $root.google.cloud.batch.v1.Environment.KMSEnvMap.verify(message.encryptedVariables); + if (error) + return "encryptedVariables." + error; + } + return null; + }; + + /** + * Creates an Environment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.Environment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.Environment} Environment + */ + Environment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.Environment) + return object; + var message = new $root.google.cloud.batch.v1.Environment(); + if (object.variables) { + if (typeof object.variables !== "object") + throw TypeError(".google.cloud.batch.v1.Environment.variables: object expected"); + message.variables = {}; + for (var keys = Object.keys(object.variables), i = 0; i < keys.length; ++i) + message.variables[keys[i]] = String(object.variables[keys[i]]); + } + if (object.secretVariables) { + if (typeof object.secretVariables !== "object") + throw TypeError(".google.cloud.batch.v1.Environment.secretVariables: object expected"); + message.secretVariables = {}; + for (var keys = Object.keys(object.secretVariables), i = 0; i < keys.length; ++i) + message.secretVariables[keys[i]] = String(object.secretVariables[keys[i]]); + } + if (object.encryptedVariables != null) { + if (typeof object.encryptedVariables !== "object") + throw TypeError(".google.cloud.batch.v1.Environment.encryptedVariables: object expected"); + message.encryptedVariables = $root.google.cloud.batch.v1.Environment.KMSEnvMap.fromObject(object.encryptedVariables); + } + return message; + }; + + /** + * Creates a plain object from an Environment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.Environment + * @static + * @param {google.cloud.batch.v1.Environment} message Environment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Environment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.variables = {}; + object.secretVariables = {}; + } + if (options.defaults) + object.encryptedVariables = null; + var keys2; + if (message.variables && (keys2 = Object.keys(message.variables)).length) { + object.variables = {}; + for (var j = 0; j < keys2.length; ++j) + object.variables[keys2[j]] = message.variables[keys2[j]]; + } + if (message.secretVariables && (keys2 = Object.keys(message.secretVariables)).length) { + object.secretVariables = {}; + for (var j = 0; j < keys2.length; ++j) + object.secretVariables[keys2[j]] = message.secretVariables[keys2[j]]; + } + if (message.encryptedVariables != null && message.hasOwnProperty("encryptedVariables")) + object.encryptedVariables = $root.google.cloud.batch.v1.Environment.KMSEnvMap.toObject(message.encryptedVariables, options); + return object; + }; + + /** + * Converts this Environment to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.Environment + * @instance + * @returns {Object.} JSON object + */ + Environment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Environment + * @function getTypeUrl + * @memberof google.cloud.batch.v1.Environment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Environment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.Environment"; + }; + + Environment.KMSEnvMap = (function() { + + /** + * Properties of a KMSEnvMap. + * @memberof google.cloud.batch.v1.Environment + * @interface IKMSEnvMap + * @property {string|null} [keyName] KMSEnvMap keyName + * @property {string|null} [cipherText] KMSEnvMap cipherText + */ + + /** + * Constructs a new KMSEnvMap. + * @memberof google.cloud.batch.v1.Environment + * @classdesc Represents a KMSEnvMap. + * @implements IKMSEnvMap + * @constructor + * @param {google.cloud.batch.v1.Environment.IKMSEnvMap=} [properties] Properties to set + */ + function KMSEnvMap(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KMSEnvMap keyName. + * @member {string} keyName + * @memberof google.cloud.batch.v1.Environment.KMSEnvMap + * @instance + */ + KMSEnvMap.prototype.keyName = ""; + + /** + * KMSEnvMap cipherText. + * @member {string} cipherText + * @memberof google.cloud.batch.v1.Environment.KMSEnvMap + * @instance + */ + KMSEnvMap.prototype.cipherText = ""; + + /** + * Creates a new KMSEnvMap instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.Environment.KMSEnvMap + * @static + * @param {google.cloud.batch.v1.Environment.IKMSEnvMap=} [properties] Properties to set + * @returns {google.cloud.batch.v1.Environment.KMSEnvMap} KMSEnvMap instance + */ + KMSEnvMap.create = function create(properties) { + return new KMSEnvMap(properties); + }; + + /** + * Encodes the specified KMSEnvMap message. Does not implicitly {@link google.cloud.batch.v1.Environment.KMSEnvMap.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.Environment.KMSEnvMap + * @static + * @param {google.cloud.batch.v1.Environment.IKMSEnvMap} message KMSEnvMap message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KMSEnvMap.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keyName != null && Object.hasOwnProperty.call(message, "keyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.keyName); + if (message.cipherText != null && Object.hasOwnProperty.call(message, "cipherText")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.cipherText); + return writer; + }; + + /** + * Encodes the specified KMSEnvMap message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Environment.KMSEnvMap.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.Environment.KMSEnvMap + * @static + * @param {google.cloud.batch.v1.Environment.IKMSEnvMap} message KMSEnvMap message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KMSEnvMap.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KMSEnvMap message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.Environment.KMSEnvMap + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.Environment.KMSEnvMap} KMSEnvMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KMSEnvMap.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Environment.KMSEnvMap(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.keyName = reader.string(); + break; + } + case 2: { + message.cipherText = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KMSEnvMap message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.Environment.KMSEnvMap + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.Environment.KMSEnvMap} KMSEnvMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KMSEnvMap.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KMSEnvMap message. + * @function verify + * @memberof google.cloud.batch.v1.Environment.KMSEnvMap + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KMSEnvMap.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keyName != null && message.hasOwnProperty("keyName")) + if (!$util.isString(message.keyName)) + return "keyName: string expected"; + if (message.cipherText != null && message.hasOwnProperty("cipherText")) + if (!$util.isString(message.cipherText)) + return "cipherText: string expected"; + return null; + }; + + /** + * Creates a KMSEnvMap message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.Environment.KMSEnvMap + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.Environment.KMSEnvMap} KMSEnvMap + */ + KMSEnvMap.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.Environment.KMSEnvMap) + return object; + var message = new $root.google.cloud.batch.v1.Environment.KMSEnvMap(); + if (object.keyName != null) + message.keyName = String(object.keyName); + if (object.cipherText != null) + message.cipherText = String(object.cipherText); + return message; + }; + + /** + * Creates a plain object from a KMSEnvMap message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.Environment.KMSEnvMap + * @static + * @param {google.cloud.batch.v1.Environment.KMSEnvMap} message KMSEnvMap + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KMSEnvMap.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.keyName = ""; + object.cipherText = ""; + } + if (message.keyName != null && message.hasOwnProperty("keyName")) + object.keyName = message.keyName; + if (message.cipherText != null && message.hasOwnProperty("cipherText")) + object.cipherText = message.cipherText; + return object; + }; + + /** + * Converts this KMSEnvMap to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.Environment.KMSEnvMap + * @instance + * @returns {Object.} JSON object + */ + KMSEnvMap.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KMSEnvMap + * @function getTypeUrl + * @memberof google.cloud.batch.v1.Environment.KMSEnvMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KMSEnvMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.Environment.KMSEnvMap"; + }; + + return KMSEnvMap; + })(); + + return Environment; + })(); + + v1.Volume = (function() { + + /** + * Properties of a Volume. + * @memberof google.cloud.batch.v1 + * @interface IVolume + * @property {google.cloud.batch.v1.INFS|null} [nfs] Volume nfs + * @property {google.cloud.batch.v1.IGCS|null} [gcs] Volume gcs + * @property {string|null} [deviceName] Volume deviceName + * @property {string|null} [mountPath] Volume mountPath + * @property {Array.|null} [mountOptions] Volume mountOptions + */ + + /** + * Constructs a new Volume. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a Volume. + * @implements IVolume + * @constructor + * @param {google.cloud.batch.v1.IVolume=} [properties] Properties to set + */ + function Volume(properties) { + this.mountOptions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Volume nfs. + * @member {google.cloud.batch.v1.INFS|null|undefined} nfs + * @memberof google.cloud.batch.v1.Volume + * @instance + */ + Volume.prototype.nfs = null; + + /** + * Volume gcs. + * @member {google.cloud.batch.v1.IGCS|null|undefined} gcs + * @memberof google.cloud.batch.v1.Volume + * @instance + */ + Volume.prototype.gcs = null; + + /** + * Volume deviceName. + * @member {string|null|undefined} deviceName + * @memberof google.cloud.batch.v1.Volume + * @instance + */ + Volume.prototype.deviceName = null; + + /** + * Volume mountPath. + * @member {string} mountPath + * @memberof google.cloud.batch.v1.Volume + * @instance + */ + Volume.prototype.mountPath = ""; + + /** + * Volume mountOptions. + * @member {Array.} mountOptions + * @memberof google.cloud.batch.v1.Volume + * @instance + */ + Volume.prototype.mountOptions = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Volume source. + * @member {"nfs"|"gcs"|"deviceName"|undefined} source + * @memberof google.cloud.batch.v1.Volume + * @instance + */ + Object.defineProperty(Volume.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["nfs", "gcs", "deviceName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Volume instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.Volume + * @static + * @param {google.cloud.batch.v1.IVolume=} [properties] Properties to set + * @returns {google.cloud.batch.v1.Volume} Volume instance + */ + Volume.create = function create(properties) { + return new Volume(properties); + }; + + /** + * Encodes the specified Volume message. Does not implicitly {@link google.cloud.batch.v1.Volume.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.Volume + * @static + * @param {google.cloud.batch.v1.IVolume} message Volume message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Volume.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nfs != null && Object.hasOwnProperty.call(message, "nfs")) + $root.google.cloud.batch.v1.NFS.encode(message.nfs, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.gcs != null && Object.hasOwnProperty.call(message, "gcs")) + $root.google.cloud.batch.v1.GCS.encode(message.gcs, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.mountPath != null && Object.hasOwnProperty.call(message, "mountPath")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.mountPath); + if (message.mountOptions != null && message.mountOptions.length) + for (var i = 0; i < message.mountOptions.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.mountOptions[i]); + if (message.deviceName != null && Object.hasOwnProperty.call(message, "deviceName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.deviceName); + return writer; + }; + + /** + * Encodes the specified Volume message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Volume.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.Volume + * @static + * @param {google.cloud.batch.v1.IVolume} message Volume message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Volume.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Volume message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.Volume + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.Volume} Volume + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Volume.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Volume(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nfs = $root.google.cloud.batch.v1.NFS.decode(reader, reader.uint32()); + break; + } + case 3: { + message.gcs = $root.google.cloud.batch.v1.GCS.decode(reader, reader.uint32()); + break; + } + case 6: { + message.deviceName = reader.string(); + break; + } + case 4: { + message.mountPath = reader.string(); + break; + } + case 5: { + if (!(message.mountOptions && message.mountOptions.length)) + message.mountOptions = []; + message.mountOptions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Volume message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.Volume + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.Volume} Volume + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Volume.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Volume message. + * @function verify + * @memberof google.cloud.batch.v1.Volume + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Volume.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nfs != null && message.hasOwnProperty("nfs")) { + properties.source = 1; + { + var error = $root.google.cloud.batch.v1.NFS.verify(message.nfs); + if (error) + return "nfs." + error; + } + } + if (message.gcs != null && message.hasOwnProperty("gcs")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.batch.v1.GCS.verify(message.gcs); + if (error) + return "gcs." + error; + } + } + if (message.deviceName != null && message.hasOwnProperty("deviceName")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!$util.isString(message.deviceName)) + return "deviceName: string expected"; + } + if (message.mountPath != null && message.hasOwnProperty("mountPath")) + if (!$util.isString(message.mountPath)) + return "mountPath: string expected"; + if (message.mountOptions != null && message.hasOwnProperty("mountOptions")) { + if (!Array.isArray(message.mountOptions)) + return "mountOptions: array expected"; + for (var i = 0; i < message.mountOptions.length; ++i) + if (!$util.isString(message.mountOptions[i])) + return "mountOptions: string[] expected"; + } + return null; + }; + + /** + * Creates a Volume message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.Volume + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.Volume} Volume + */ + Volume.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.Volume) + return object; + var message = new $root.google.cloud.batch.v1.Volume(); + if (object.nfs != null) { + if (typeof object.nfs !== "object") + throw TypeError(".google.cloud.batch.v1.Volume.nfs: object expected"); + message.nfs = $root.google.cloud.batch.v1.NFS.fromObject(object.nfs); + } + if (object.gcs != null) { + if (typeof object.gcs !== "object") + throw TypeError(".google.cloud.batch.v1.Volume.gcs: object expected"); + message.gcs = $root.google.cloud.batch.v1.GCS.fromObject(object.gcs); + } + if (object.deviceName != null) + message.deviceName = String(object.deviceName); + if (object.mountPath != null) + message.mountPath = String(object.mountPath); + if (object.mountOptions) { + if (!Array.isArray(object.mountOptions)) + throw TypeError(".google.cloud.batch.v1.Volume.mountOptions: array expected"); + message.mountOptions = []; + for (var i = 0; i < object.mountOptions.length; ++i) + message.mountOptions[i] = String(object.mountOptions[i]); + } + return message; + }; + + /** + * Creates a plain object from a Volume message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.Volume + * @static + * @param {google.cloud.batch.v1.Volume} message Volume + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Volume.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.mountOptions = []; + if (options.defaults) + object.mountPath = ""; + if (message.nfs != null && message.hasOwnProperty("nfs")) { + object.nfs = $root.google.cloud.batch.v1.NFS.toObject(message.nfs, options); + if (options.oneofs) + object.source = "nfs"; + } + if (message.gcs != null && message.hasOwnProperty("gcs")) { + object.gcs = $root.google.cloud.batch.v1.GCS.toObject(message.gcs, options); + if (options.oneofs) + object.source = "gcs"; + } + if (message.mountPath != null && message.hasOwnProperty("mountPath")) + object.mountPath = message.mountPath; + if (message.mountOptions && message.mountOptions.length) { + object.mountOptions = []; + for (var j = 0; j < message.mountOptions.length; ++j) + object.mountOptions[j] = message.mountOptions[j]; + } + if (message.deviceName != null && message.hasOwnProperty("deviceName")) { + object.deviceName = message.deviceName; + if (options.oneofs) + object.source = "deviceName"; + } + return object; + }; + + /** + * Converts this Volume to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.Volume + * @instance + * @returns {Object.} JSON object + */ + Volume.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Volume + * @function getTypeUrl + * @memberof google.cloud.batch.v1.Volume + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Volume.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.Volume"; + }; + + return Volume; + })(); + + v1.NFS = (function() { + + /** + * Properties of a NFS. + * @memberof google.cloud.batch.v1 + * @interface INFS + * @property {string|null} [server] NFS server + * @property {string|null} [remotePath] NFS remotePath + */ + + /** + * Constructs a new NFS. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a NFS. + * @implements INFS + * @constructor + * @param {google.cloud.batch.v1.INFS=} [properties] Properties to set + */ + function NFS(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NFS server. + * @member {string} server + * @memberof google.cloud.batch.v1.NFS + * @instance + */ + NFS.prototype.server = ""; + + /** + * NFS remotePath. + * @member {string} remotePath + * @memberof google.cloud.batch.v1.NFS + * @instance + */ + NFS.prototype.remotePath = ""; + + /** + * Creates a new NFS instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.NFS + * @static + * @param {google.cloud.batch.v1.INFS=} [properties] Properties to set + * @returns {google.cloud.batch.v1.NFS} NFS instance + */ + NFS.create = function create(properties) { + return new NFS(properties); + }; + + /** + * Encodes the specified NFS message. Does not implicitly {@link google.cloud.batch.v1.NFS.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.NFS + * @static + * @param {google.cloud.batch.v1.INFS} message NFS message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NFS.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.server != null && Object.hasOwnProperty.call(message, "server")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.server); + if (message.remotePath != null && Object.hasOwnProperty.call(message, "remotePath")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.remotePath); + return writer; + }; + + /** + * Encodes the specified NFS message, length delimited. Does not implicitly {@link google.cloud.batch.v1.NFS.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.NFS + * @static + * @param {google.cloud.batch.v1.INFS} message NFS message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NFS.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NFS message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.NFS + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.NFS} NFS + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NFS.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.NFS(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.server = reader.string(); + break; + } + case 2: { + message.remotePath = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NFS message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.NFS + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.NFS} NFS + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NFS.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NFS message. + * @function verify + * @memberof google.cloud.batch.v1.NFS + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NFS.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.server != null && message.hasOwnProperty("server")) + if (!$util.isString(message.server)) + return "server: string expected"; + if (message.remotePath != null && message.hasOwnProperty("remotePath")) + if (!$util.isString(message.remotePath)) + return "remotePath: string expected"; + return null; + }; + + /** + * Creates a NFS message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.NFS + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.NFS} NFS + */ + NFS.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.NFS) + return object; + var message = new $root.google.cloud.batch.v1.NFS(); + if (object.server != null) + message.server = String(object.server); + if (object.remotePath != null) + message.remotePath = String(object.remotePath); + return message; + }; + + /** + * Creates a plain object from a NFS message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.NFS + * @static + * @param {google.cloud.batch.v1.NFS} message NFS + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NFS.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.server = ""; + object.remotePath = ""; + } + if (message.server != null && message.hasOwnProperty("server")) + object.server = message.server; + if (message.remotePath != null && message.hasOwnProperty("remotePath")) + object.remotePath = message.remotePath; + return object; + }; + + /** + * Converts this NFS to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.NFS + * @instance + * @returns {Object.} JSON object + */ + NFS.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NFS + * @function getTypeUrl + * @memberof google.cloud.batch.v1.NFS + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NFS.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.NFS"; + }; + + return NFS; + })(); + + v1.GCS = (function() { + + /** + * Properties of a GCS. + * @memberof google.cloud.batch.v1 + * @interface IGCS + * @property {string|null} [remotePath] GCS remotePath + */ + + /** + * Constructs a new GCS. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a GCS. + * @implements IGCS + * @constructor + * @param {google.cloud.batch.v1.IGCS=} [properties] Properties to set + */ + function GCS(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GCS remotePath. + * @member {string} remotePath + * @memberof google.cloud.batch.v1.GCS + * @instance + */ + GCS.prototype.remotePath = ""; + + /** + * Creates a new GCS instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.GCS + * @static + * @param {google.cloud.batch.v1.IGCS=} [properties] Properties to set + * @returns {google.cloud.batch.v1.GCS} GCS instance + */ + GCS.create = function create(properties) { + return new GCS(properties); + }; + + /** + * Encodes the specified GCS message. Does not implicitly {@link google.cloud.batch.v1.GCS.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.GCS + * @static + * @param {google.cloud.batch.v1.IGCS} message GCS message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GCS.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.remotePath != null && Object.hasOwnProperty.call(message, "remotePath")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.remotePath); + return writer; + }; + + /** + * Encodes the specified GCS message, length delimited. Does not implicitly {@link google.cloud.batch.v1.GCS.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.GCS + * @static + * @param {google.cloud.batch.v1.IGCS} message GCS message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GCS.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GCS message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.GCS + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.GCS} GCS + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GCS.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.GCS(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.remotePath = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GCS message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.GCS + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.GCS} GCS + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GCS.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GCS message. + * @function verify + * @memberof google.cloud.batch.v1.GCS + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GCS.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.remotePath != null && message.hasOwnProperty("remotePath")) + if (!$util.isString(message.remotePath)) + return "remotePath: string expected"; + return null; + }; + + /** + * Creates a GCS message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.GCS + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.GCS} GCS + */ + GCS.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.GCS) + return object; + var message = new $root.google.cloud.batch.v1.GCS(); + if (object.remotePath != null) + message.remotePath = String(object.remotePath); + return message; + }; + + /** + * Creates a plain object from a GCS message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.GCS + * @static + * @param {google.cloud.batch.v1.GCS} message GCS + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GCS.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.remotePath = ""; + if (message.remotePath != null && message.hasOwnProperty("remotePath")) + object.remotePath = message.remotePath; + return object; + }; + + /** + * Converts this GCS to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.GCS + * @instance + * @returns {Object.} JSON object + */ + GCS.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GCS + * @function getTypeUrl + * @memberof google.cloud.batch.v1.GCS + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GCS.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.GCS"; + }; + + return GCS; + })(); + + return v1; + })(); + + return batch; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + */ + + /** + * Constructs a new CommonLanguageSettings. + * @memberof google.api + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings + * @constructor + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + */ + function CommonLanguageSettings(properties) { + this.destinations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.referenceDocsUri = ""; + + /** + * CommonLanguageSettings destinations. + * @member {Array.} destinations + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.destinations = $util.emptyArray; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @function create + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance + */ + CommonLanguageSettings.create = function create(properties) { + return new CommonLanguageSettings(properties); + }; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); + if (message.destinations != null && message.destinations.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.destinations.length; ++i) + writer.int32(message.destinations[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLanguageSettings message. + * @function verify + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLanguageSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + if (!$util.isString(message.referenceDocsUri)) + return "referenceDocsUri: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + switch (message.destinations[i]) { + default: + return "destinations: enum value[] expected"; + case 0: + case 10: + case 20: + break; + } + } + return null; + }; + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + */ + CommonLanguageSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CommonLanguageSettings) + return object; + var message = new $root.google.api.CommonLanguageSettings(); + if (object.referenceDocsUri != null) + message.referenceDocsUri = String(object.referenceDocsUri); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + switch (object.destinations[i]) { + default: + if (typeof object.destinations[i] === "number") { + message.destinations[i] = object.destinations[i]; + break; + } + case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": + case 0: + message.destinations[i] = 0; + break; + case "GITHUB": + case 10: + message.destinations[i] = 10; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) + object.referenceDocsUri = ""; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + object.referenceDocsUri = message.referenceDocsUri; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + } + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + api.ClientLibrarySettings = (function() { + + /** + * Properties of a ClientLibrarySettings. + * @memberof google.api + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings + */ + + /** + * Constructs a new ClientLibrarySettings. + * @memberof google.api + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings + * @constructor + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + */ + function ClientLibrarySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && message.hasOwnProperty("goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (typeof object.javaSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); + } + if (object.cppSettings != null) { + if (typeof object.cppSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); + } + if (object.phpSettings != null) { + if (typeof object.phpSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); + } + if (object.pythonSettings != null) { + if (typeof object.pythonSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); + } + if (object.nodeSettings != null) { + if (typeof object.nodeSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); + } + if (object.dotnetSettings != null) { + if (typeof object.dotnetSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); + } + if (object.rubySettings != null) { + if (typeof object.rubySettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); + } + if (object.goSettings != null) { + if (typeof object.goSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); + } + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); + if (message.goSettings != null && message.hasOwnProperty("goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); + return object; + }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @memberof google.api + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + + /** + * Publishing restReferenceDocumentationUri. + * @member {string} restReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.restReferenceDocumentationUri = ""; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); + break; + } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } + case 111: { + message.restReferenceDocumentationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); + if (error) + return "librarySettings." + error; + } + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + if (!$util.isString(message.restReferenceDocumentationUri)) + return "restReferenceDocumentationUri: string expected"; + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Publishing) + return object; + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (typeof object.methodSettings[i] !== "object") + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + case "SHOPPING": + case 5: + message.organization = 5; + break; + case "GEO": + case 6: + message.organization = 6; + break; + case "GENERATIVE_AI": + case 7: + message.organization = 7; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (typeof object.librarySettings[i] !== "object") + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); + } + } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); + if (object.restReferenceDocumentationUri != null) + message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + object.protoReferenceDocumentationUri = ""; + object.restReferenceDocumentationUri = ""; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.JavaSettings) + return object; + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (typeof object.serviceClassNames !== "object") + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CppSettings) + return object; + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PhpSettings) + return object; + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + */ + + /** + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings + * @constructor + * @param {google.api.IPythonSettings=} [properties] Properties to set + */ + function PythonSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings) + return object; + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.NodeSettings) + return object; + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + * @property {Object.|null} [renamedServices] DotnetSettings renamedServices + * @property {Object.|null} [renamedResources] DotnetSettings renamedResources + * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources + * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases + * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(properties) { + this.renamedServices = {}; + this.renamedResources = {}; + this.ignoredResources = []; + this.forcedNamespaceAliases = []; + this.handwrittenSignatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * DotnetSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedServices = $util.emptyObject; + + /** + * DotnetSettings renamedResources. + * @member {Object.} renamedResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedResources = $util.emptyObject; + + /** + * DotnetSettings ignoredResources. + * @member {Array.} ignoredResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + + /** + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + + /** + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) + for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); + if (message.ignoredResources != null && message.ignoredResources.length) + for (var i = 0; i < message.ignoredResources.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); + if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); + if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } + case 3: { + if (message.renamedResources === $util.emptyObject) + message.renamedResources = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedResources[key] = value; + break; + } + case 4: { + if (!(message.ignoredResources && message.ignoredResources.length)) + message.ignoredResources = []; + message.ignoredResources.push(reader.string()); + break; + } + case 5: { + if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) + message.forcedNamespaceAliases = []; + message.forcedNamespaceAliases.push(reader.string()); + break; + } + case 6: { + if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) + message.handwrittenSignatures = []; + message.handwrittenSignatures.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { + if (!$util.isObject(message.renamedResources)) + return "renamedResources: object expected"; + var key = Object.keys(message.renamedResources); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedResources[key[i]])) + return "renamedResources: string{k:string} expected"; + } + if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { + if (!Array.isArray(message.ignoredResources)) + return "ignoredResources: array expected"; + for (var i = 0; i < message.ignoredResources.length; ++i) + if (!$util.isString(message.ignoredResources[i])) + return "ignoredResources: string[] expected"; + } + if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { + if (!Array.isArray(message.forcedNamespaceAliases)) + return "forcedNamespaceAliases: array expected"; + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + if (!$util.isString(message.forcedNamespaceAliases[i])) + return "forcedNamespaceAliases: string[] expected"; + } + if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { + if (!Array.isArray(message.handwrittenSignatures)) + return "handwrittenSignatures: array expected"; + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + if (!$util.isString(message.handwrittenSignatures[i])) + return "handwrittenSignatures: string[] expected"; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + if (object.renamedResources) { + if (typeof object.renamedResources !== "object") + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) + message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); + } + if (object.ignoredResources) { + if (!Array.isArray(object.ignoredResources)) + throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); + message.ignoredResources = []; + for (var i = 0; i < object.ignoredResources.length; ++i) + message.ignoredResources[i] = String(object.ignoredResources[i]); + } + if (object.forcedNamespaceAliases) { + if (!Array.isArray(object.forcedNamespaceAliases)) + throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); + message.forcedNamespaceAliases = []; + for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) + message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); + } + if (object.handwrittenSignatures) { + if (!Array.isArray(object.handwrittenSignatures)) + throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); + message.handwrittenSignatures = []; + for (var i = 0; i < object.handwrittenSignatures.length; ++i) + message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; + } + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; + } + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { + object.renamedResources = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + } + if (message.ignoredResources && message.ignoredResources.length) { + object.ignoredResources = []; + for (var j = 0; j < message.ignoredResources.length; ++j) + object.ignoredResources[j] = message.ignoredResources[j]; + } + if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { + object.forcedNamespaceAliases = []; + for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) + object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + } + if (message.handwrittenSignatures && message.handwrittenSignatures.length) { + object.handwrittenSignatures = []; + for (var j = 0; j < message.handwrittenSignatures.length; ++j) + object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; + } + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RubySettings) + return object; + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings + * @constructor + * @param {google.api.IGoSettings=} [properties] Properties to set + */ + function GoSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.common = null; + + /** + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.GoSettings) + return object; + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(properties) { + this.autoPopulatedFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) + message.autoPopulatedFields = []; + message.autoPopulatedFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); + if (error) + return "longRunning." + error; + } + if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { + if (!Array.isArray(message.autoPopulatedFields)) + return "autoPopulatedFields: array expected"; + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + if (!$util.isString(message.autoPopulatedFields[i])) + return "autoPopulatedFields: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings) + return object; + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (typeof object.longRunning !== "object") + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); + } + if (object.autoPopulatedFields) { + if (!Array.isArray(object.autoPopulatedFields)) + throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); + message.autoPopulatedFields = []; + for (var i = 0; i < object.autoPopulatedFields.length; ++i) + message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.autoPopulatedFields = []; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); + if (message.autoPopulatedFields && message.autoPopulatedFields.length) { + object.autoPopulatedFields = []; + for (var j = 0; j < message.autoPopulatedFields.length; ++j) + object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; + } + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (typeof object.initialPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (typeof object.maxPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); + } + if (object.totalPollTimeout != null) { + if (typeof object.totalPollTimeout !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + * @property {number} SHOPPING=5 SHOPPING value + * @property {number} GEO=6 GEO value + * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + values[valuesById[5] = "SHOPPING"] = 5; + values[valuesById[6] = "GEO"] = 6; + values[valuesById[7] = "GENERATIVE_AI"] = 7; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + + /** + * 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.FieldInfo = (function() { + + /** + * Properties of a FieldInfo. + * @memberof google.api + * @interface IFieldInfo + * @property {google.api.FieldInfo.Format|null} [format] FieldInfo format + */ + + /** + * Constructs a new FieldInfo. + * @memberof google.api + * @classdesc Represents a FieldInfo. + * @implements IFieldInfo + * @constructor + * @param {google.api.IFieldInfo=} [properties] Properties to set + */ + function FieldInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldInfo format. + * @member {google.api.FieldInfo.Format} format + * @memberof google.api.FieldInfo + * @instance + */ + FieldInfo.prototype.format = 0; + + /** + * Creates a new FieldInfo instance using the specified properties. + * @function create + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo=} [properties] Properties to set + * @returns {google.api.FieldInfo} FieldInfo instance + */ + FieldInfo.create = function create(properties) { + return new FieldInfo(properties); + }; + + /** + * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @function encode + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.format); + return writer; + }; + + /** + * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldInfo message from the specified reader or buffer. + * @function decode + * @memberof google.api.FieldInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.FieldInfo} FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.FieldInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.format = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.FieldInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.FieldInfo} FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldInfo message. + * @function verify + * @memberof google.api.FieldInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.format != null && message.hasOwnProperty("format")) + switch (message.format) { + default: + return "format: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.FieldInfo + * @static + * @param {Object.} object Plain object + * @returns {google.api.FieldInfo} FieldInfo + */ + FieldInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.FieldInfo) + return object; + var message = new $root.google.api.FieldInfo(); + switch (object.format) { + default: + if (typeof object.format === "number") { + message.format = object.format; + break; + } + break; + case "FORMAT_UNSPECIFIED": + case 0: + message.format = 0; + break; + case "UUID4": + case 1: + message.format = 1; + break; + case "IPV4": + case 2: + message.format = 2; + break; + case "IPV6": + case 3: + message.format = 3; + break; + case "IPV4_OR_IPV6": + case 4: + message.format = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.FieldInfo + * @static + * @param {google.api.FieldInfo} message FieldInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.format = options.enums === String ? "FORMAT_UNSPECIFIED" : 0; + if (message.format != null && message.hasOwnProperty("format")) + object.format = options.enums === String ? $root.google.api.FieldInfo.Format[message.format] === undefined ? message.format : $root.google.api.FieldInfo.Format[message.format] : message.format; + return object; + }; + + /** + * Converts this FieldInfo to JSON. + * @function toJSON + * @memberof google.api.FieldInfo + * @instance + * @returns {Object.} JSON object + */ + FieldInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldInfo + * @function getTypeUrl + * @memberof google.api.FieldInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.FieldInfo"; + }; + + /** + * Format enum. + * @name google.api.FieldInfo.Format + * @enum {number} + * @property {number} FORMAT_UNSPECIFIED=0 FORMAT_UNSPECIFIED value + * @property {number} UUID4=1 UUID4 value + * @property {number} IPV4=2 IPV4 value + * @property {number} IPV6=3 IPV6 value + * @property {number} IPV4_OR_IPV6=4 IPV4_OR_IPV6 value + */ + FieldInfo.Format = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "UUID4"] = 1; + values[valuesById[2] = "IPV4"] = 2; + values[valuesById[3] = "IPV6"] = 3; + values[valuesById[4] = "IPV4_OR_IPV6"] = 4; + return values; + })(); + + return FieldInfo; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value + * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value + * @property {number} EDITION_2023=1000 EDITION_2023 value + * @property {number} EDITION_2024=1001 EDITION_2024 value + * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value + * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value + * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value + * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value + * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value + * @property {number} EDITION_MAX=2147483647 EDITION_MAX value + */ + protobuf.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[998] = "EDITION_PROTO2"] = 998; + values[valuesById[999] = "EDITION_PROTO3"] = 999; + values[valuesById[1000] = "EDITION_2023"] = 1000; + values[valuesById[1001] = "EDITION_2024"] = 1001; + values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; + values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; + values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; + values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; + values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; + values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; + return values; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = 0; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 14: { + message.edition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + this.declaration = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.verification = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message.declaration != null && message.hasOwnProperty("declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); + if (error) + return "declaration." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.verification != null && message.hasOwnProperty("verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (typeof object.declaration[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); + } + if (message.verification != null && message.hasOwnProperty("verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.fullName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 5: { + message.reserved = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Declaration message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Declaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && message.hasOwnProperty("reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + return null; + }; + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + */ + Declaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + if (object.number != null) + message.number = object.number | 0; + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.type != null) + message.type = String(object.type); + if (object.reserved != null) + message.reserved = Boolean(object.reserved); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + return message; + }; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Declaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.reserved != null && message.hasOwnProperty("reserved")) + object.reserved = message.reserved; + if (message.repeated != null && message.hasOwnProperty("repeated")) + object.repeated = message.repeated; + return object; + }; + + /** + * Converts this Declaration to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + * @returns {Object.} JSON object + */ + Declaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Declaration + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; + }; + + return Declaration; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 3: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.features = null; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FileOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + object.features = null; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * MessageOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.features = null; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 12: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {Array.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IFieldInfo|null} [".google.api.fieldInfo"] FieldOptions .google.api.fieldInfo + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.targets = []; + this.editionDefaults = []; + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions targets. + * @member {Array.} targets + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.targets = $util.emptyArray; + + /** + * FieldOptions editionDefaults. + * @member {Array.} editionDefaults + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.editionDefaults = $util.emptyArray; + + /** + * FieldOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.features = null; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldInfo. + * @member {google.api.IFieldInfo|null|undefined} .google.api.fieldInfo + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldInfo"] = null; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); + if (message.editionDefaults != null && message.editionDefaults.length) + for (var i = 0; i < message.editionDefaults.length; ++i) + $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + if (message[".google.api.fieldInfo"] != null && Object.hasOwnProperty.call(message, ".google.api.fieldInfo")) + $root.google.api.FieldInfo.encode(message[".google.api.fieldInfo"], writer.uint32(/* id 291403980, wireType 2 =*/2331231842).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 19: { + if (!(message.targets && message.targets.length)) + message.targets = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targets.push(reader.int32()); + } else + message.targets.push(reader.int32()); + break; + } + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 291403980: { + message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.decode(reader, reader.uint32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && message.hasOwnProperty("retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.targets != null && message.hasOwnProperty("targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) + switch (message.targets[i]) { + default: + return "targets: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + } + if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { + if (!Array.isArray(message.editionDefaults)) + return "editionDefaults: array expected"; + for (var i = 0; i < message.editionDefaults.length; ++i) { + var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); + if (error) + return "editionDefaults." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) { + var error = $root.google.api.FieldInfo.verify(message[".google.api.fieldInfo"]); + if (error) + return ".google.api.fieldInfo." + error; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) + switch (object.targets[i]) { + default: + if (typeof object.targets[i] === "number") { + message.targets[i] = object.targets[i]; + break; + } + case "TARGET_TYPE_UNKNOWN": + case 0: + message.targets[i] = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.targets[i] = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.targets[i] = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.targets[i] = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.targets[i] = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.targets[i] = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.targets[i] = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.targets[i] = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.targets[i] = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.targets[i] = 9; + break; + } + } + if (object.editionDefaults) { + if (!Array.isArray(object.editionDefaults)) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); + message.editionDefaults = []; + for (var i = 0; i < object.editionDefaults.length; ++i) { + if (typeof object.editionDefaults[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); + message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FieldOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + break; + } + } + if (object[".google.api.fieldInfo"] != null) { + if (typeof object[".google.api.fieldInfo"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldInfo: object expected"); + message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.fromObject(object[".google.api.fieldInfo"]); + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targets = []; + object.editionDefaults = []; + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object.debugRedact = false; + object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; + object.features = null; + object[".google.api.resourceReference"] = null; + object[".google.api.fieldInfo"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.retention != null && message.hasOwnProperty("retention")) + object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; + if (message.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; + } + if (message.editionDefaults && message.editionDefaults.length) { + object.editionDefaults = []; + for (var j = 0; j < message.editionDefaults.length; ++j) + object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) + object[".google.api.fieldInfo"] = $root.google.api.FieldInfo.toObject(message[".google.api.fieldInfo"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.features = null; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.features = null; + + /** + * EnumValueOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.debugRedact = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.debugRedact = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object.debugRedact = false; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + case 525000001: { + message[".google.api.apiVersion"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.features = null; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 35: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MethodOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object.features = null; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + */ + + /** + * Constructs a new FeatureSet. + * @memberof google.protobuf + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet + * @constructor + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + */ + function FeatureSet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.fieldPresence = 0; + + /** + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enumType = 0; + + /** + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.repeatedFieldEncoding = 0; + + /** + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.utf8Validation = 0; + + /** + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.messageEncoding = 0; + + /** + * FeatureSet jsonFormat. + * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.jsonFormat = 0; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance + */ + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); + }; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fieldPresence = reader.int32(); + break; + } + case 2: { + message.enumType = reader.int32(); + break; + } + case 3: { + message.repeatedFieldEncoding = reader.int32(); + break; + } + case 4: { + message.utf8Validation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + switch (message.fieldPresence) { + default: + return "fieldPresence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) + switch (message.enumType) { + default: + return "enumType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + switch (message.repeatedFieldEncoding) { + default: + return "repeatedFieldEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + switch (message.utf8Validation) { + default: + return "utf8Validation: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + switch (message.messageEncoding) { + default: + return "messageEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + switch (message.jsonFormat) { + default: + return "jsonFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet} FeatureSet + */ + FeatureSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { + default: + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; + break; + } + break; + case "FIELD_PRESENCE_UNKNOWN": + case 0: + message.fieldPresence = 0; + break; + case "EXPLICIT": + case 1: + message.fieldPresence = 1; + break; + case "IMPLICIT": + case 2: + message.fieldPresence = 2; + break; + case "LEGACY_REQUIRED": + case 3: + message.fieldPresence = 3; + break; + } + switch (object.enumType) { + default: + if (typeof object.enumType === "number") { + message.enumType = object.enumType; + break; + } + break; + case "ENUM_TYPE_UNKNOWN": + case 0: + message.enumType = 0; + break; + case "OPEN": + case 1: + message.enumType = 1; + break; + case "CLOSED": + case 2: + message.enumType = 2; + break; + } + switch (object.repeatedFieldEncoding) { + default: + if (typeof object.repeatedFieldEncoding === "number") { + message.repeatedFieldEncoding = object.repeatedFieldEncoding; + break; + } + break; + case "REPEATED_FIELD_ENCODING_UNKNOWN": + case 0: + message.repeatedFieldEncoding = 0; + break; + case "PACKED": + case 1: + message.repeatedFieldEncoding = 1; + break; + case "EXPANDED": + case 2: + message.repeatedFieldEncoding = 2; + break; + } + switch (object.utf8Validation) { + default: + if (typeof object.utf8Validation === "number") { + message.utf8Validation = object.utf8Validation; + break; + } + break; + case "UTF8_VALIDATION_UNKNOWN": + case 0: + message.utf8Validation = 0; + break; + case "VERIFY": + case 2: + message.utf8Validation = 2; + break; + case "NONE": + case 3: + message.utf8Validation = 3; + break; + } + switch (object.messageEncoding) { + default: + if (typeof object.messageEncoding === "number") { + message.messageEncoding = object.messageEncoding; + break; + } + break; + case "MESSAGE_ENCODING_UNKNOWN": + case 0: + message.messageEncoding = 0; + break; + case "LENGTH_PREFIXED": + case 1: + message.messageEncoding = 1; + break; + case "DELIMITED": + case 2: + message.messageEncoding = 2; + break; + } + switch (object.jsonFormat) { + default: + if (typeof object.jsonFormat === "number") { + message.jsonFormat = object.jsonFormat; + break; + } + break; + case "JSON_FORMAT_UNKNOWN": + case 0: + message.jsonFormat = 0; + break; + case "ALLOW": + case 1: + message.jsonFormat = 1; + break; + case "LEGACY_BEST_EFFORT": + case 2: + message.jsonFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.FeatureSet} message FeatureSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; + object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; + object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; + object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + } + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; + if (message.enumType != null && message.hasOwnProperty("enumType")) + object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + return object; + }; + + /** + * Converts this FeatureSet to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet + * @instance + * @returns {Object.} JSON object + */ + FeatureSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSet + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet"; + }; + + /** + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence + * @enum {number} + * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value + * @property {number} EXPLICIT=1 EXPLICIT value + * @property {number} IMPLICIT=2 IMPLICIT value + * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value + */ + FeatureSet.FieldPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; + values[valuesById[1] = "EXPLICIT"] = 1; + values[valuesById[2] = "IMPLICIT"] = 2; + values[valuesById[3] = "LEGACY_REQUIRED"] = 3; + return values; + })(); + + /** + * EnumType enum. + * @name google.protobuf.FeatureSet.EnumType + * @enum {number} + * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + FeatureSet.EnumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * RepeatedFieldEncoding enum. + * @name google.protobuf.FeatureSet.RepeatedFieldEncoding + * @enum {number} + * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value + * @property {number} PACKED=1 PACKED value + * @property {number} EXPANDED=2 EXPANDED value + */ + FeatureSet.RepeatedFieldEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "PACKED"] = 1; + values[valuesById[2] = "EXPANDED"] = 2; + return values; + })(); + + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition + */ + + /** + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.defaults && message.defaults.length)) + message.defaults = []; + message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); + break; + } + case 4: { + message.minimumEdition = reader.int32(); + break; + } + case 5: { + message.maximumEdition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetDefaults message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetDefaults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaults != null && message.hasOwnProperty("defaults")) { + if (!Array.isArray(message.defaults)) + return "defaults: array expected"; + for (var i = 0; i < message.defaults.length; ++i) { + var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); + if (error) + return "defaults." + error; + } + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + switch (message.minimumEdition) { + default: + return "minimumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + switch (message.maximumEdition) { + default: + return "maximumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + */ + FeatureSetDefaults.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults(); + if (object.defaults) { + if (!Array.isArray(object.defaults)) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); + message.defaults = []; + for (var i = 0; i < object.defaults.length; ++i) { + if (typeof object.defaults[i] !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); + message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); + } + } + switch (object.minimumEdition) { + default: + if (typeof object.minimumEdition === "number") { + message.minimumEdition = object.minimumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.minimumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.minimumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.minimumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.minimumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.minimumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.minimumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.minimumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.minimumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.minimumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.minimumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.minimumEdition = 2147483647; + break; + } + switch (object.maximumEdition) { + default: + if (typeof object.maximumEdition === "number") { + message.maximumEdition = object.maximumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.maximumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.maximumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.maximumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.maximumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.maximumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.maximumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.maximumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.maximumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.maximumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.maximumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.maximumEdition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetDefaults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; + if (options.defaults) { + object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.defaults && message.defaults.length) { + object.defaults = []; + for (var j = 0; j < message.defaults.length; ++j) + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; + return object; + }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults + * @instance + * @returns {Object.} JSON object + */ + FeatureSetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetDefaults + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; + }; + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + + /** + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + */ + + /** + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault + * @constructor + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + */ + function FeatureSetEditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.edition = 0; + + /** + * FeatureSetEditionDefault features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.features = null; + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance + */ + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); + }; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetEditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + return null; + }; + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + */ + FeatureSetEditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetEditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.features = null; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + return protobuf; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/owl-bot-staging/google-cloud-batch/v1/protos/protos.json b/owl-bot-staging/google-cloud-batch/v1/protos/protos.json new file mode 100644 index 00000000000..f6488c2185f --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/protos/protos.json @@ -0,0 +1,3401 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "batch": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.Batch.V1", + "go_package": "cloud.google.com/go/batch/apiv1/batchpb;batchpb", + "java_multiple_files": true, + "java_outer_classname": "VolumeProto", + "java_package": "com.google.cloud.batch.v1", + "objc_class_prefix": "GCB", + "php_namespace": "Google\\Cloud\\Batch\\V1", + "ruby_package": "Google::Cloud::Batch::V1" + }, + "nested": { + "BatchService": { + "options": { + "(google.api.default_host)": "batch.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateJob": { + "requestType": "CreateJobRequest", + "responseType": "Job", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/jobs", + "(google.api.http).body": "job", + "(google.api.method_signature)": "parent,job,job_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/jobs", + "body": "job" + } + }, + { + "(google.api.method_signature)": "parent,job,job_id" + } + ] + }, + "GetJob": { + "requestType": "GetJobRequest", + "responseType": "Job", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/jobs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/jobs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteJob": { + "requestType": "DeleteJobRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/jobs/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.batch.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/jobs/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.batch.v1.OperationMetadata" + } + } + ] + }, + "ListJobs": { + "requestType": "ListJobsRequest", + "responseType": "ListJobsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/jobs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/jobs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetTask": { + "requestType": "GetTaskRequest", + "responseType": "Task", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/jobs/*/taskGroups/*/tasks/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/jobs/*/taskGroups/*/tasks/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListTasks": { + "requestType": "ListTasksRequest", + "responseType": "ListTasksResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/jobs/*/taskGroups/*}/tasks", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/jobs/*/taskGroups/*}/tasks" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "CreateJobRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "batch.googleapis.com/Job" + } + }, + "jobId": { + "type": "string", + "id": 2 + }, + "job": { + "type": "Job", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "batch.googleapis.com/Job" + } + } + } + }, + "DeleteJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "reason": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListJobsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListJobsResponse": { + "fields": { + "jobs": { + "rule": "repeated", + "type": "Job", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "ListTasksRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "batch.googleapis.com/TaskGroup" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListTasksResponse": { + "fields": { + "tasks": { + "rule": "repeated", + "type": "Task", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetTaskRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "batch.googleapis.com/Task" + } + } + } + }, + "OperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "target": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusMessage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiVersion": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Job": { + "options": { + "(google.api.resource).type": "batch.googleapis.com/Job", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/jobs/{job}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "uid": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "priority": { + "type": "int64", + "id": 3 + }, + "taskGroups": { + "rule": "repeated", + "type": "TaskGroup", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "allocationPolicy": { + "type": "AllocationPolicy", + "id": 7 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 8 + }, + "status": { + "type": "JobStatus", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "logsPolicy": { + "type": "LogsPolicy", + "id": 13 + }, + "notifications": { + "rule": "repeated", + "type": "JobNotification", + "id": 14 + } + } + }, + "LogsPolicy": { + "fields": { + "destination": { + "type": "Destination", + "id": 1 + }, + "logsPath": { + "type": "string", + "id": 2 + }, + "cloudLoggingOption": { + "type": "CloudLoggingOption", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "CloudLoggingOption": { + "fields": { + "useGenericTaskMonitoredResource": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Destination": { + "values": { + "DESTINATION_UNSPECIFIED": 0, + "CLOUD_LOGGING": 1, + "PATH": 2 + } + } + } + }, + "JobStatus": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "statusEvents": { + "rule": "repeated", + "type": "StatusEvent", + "id": 2 + }, + "taskGroups": { + "keyType": "string", + "type": "TaskGroupStatus", + "id": 4 + }, + "runDuration": { + "type": "google.protobuf.Duration", + "id": 5 + } + }, + "nested": { + "InstanceStatus": { + "fields": { + "machineType": { + "type": "string", + "id": 1 + }, + "provisioningModel": { + "type": "AllocationPolicy.ProvisioningModel", + "id": 2 + }, + "taskPack": { + "type": "int64", + "id": 3 + }, + "bootDisk": { + "type": "AllocationPolicy.Disk", + "id": 4 + } + } + }, + "TaskGroupStatus": { + "fields": { + "counts": { + "keyType": "string", + "type": "int64", + "id": 1 + }, + "instances": { + "rule": "repeated", + "type": "InstanceStatus", + "id": 2 + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "QUEUED": 1, + "SCHEDULED": 2, + "RUNNING": 3, + "SUCCEEDED": 4, + "FAILED": 5, + "DELETION_IN_PROGRESS": 6 + } + } + } + }, + "JobNotification": { + "fields": { + "pubsubTopic": { + "type": "string", + "id": 1 + }, + "message": { + "type": "Message", + "id": 2 + } + }, + "nested": { + "Message": { + "fields": { + "type": { + "type": "Type", + "id": 1 + }, + "newJobState": { + "type": "JobStatus.State", + "id": 2 + }, + "newTaskState": { + "type": "TaskStatus.State", + "id": 3 + } + } + }, + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "JOB_STATE_CHANGED": 1, + "TASK_STATE_CHANGED": 2 + } + } + } + }, + "AllocationPolicy": { + "fields": { + "location": { + "type": "LocationPolicy", + "id": 1 + }, + "instances": { + "rule": "repeated", + "type": "InstancePolicyOrTemplate", + "id": 8 + }, + "serviceAccount": { + "type": "ServiceAccount", + "id": 9 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 6 + }, + "network": { + "type": "NetworkPolicy", + "id": 7 + }, + "placement": { + "type": "PlacementPolicy", + "id": 10 + }, + "tags": { + "rule": "repeated", + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "LocationPolicy": { + "fields": { + "allowedLocations": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Disk": { + "oneofs": { + "dataSource": { + "oneof": [ + "image", + "snapshot" + ] + } + }, + "fields": { + "image": { + "type": "string", + "id": 4 + }, + "snapshot": { + "type": "string", + "id": 5 + }, + "type": { + "type": "string", + "id": 1 + }, + "sizeGb": { + "type": "int64", + "id": 2 + }, + "diskInterface": { + "type": "string", + "id": 6 + } + } + }, + "AttachedDisk": { + "oneofs": { + "attached": { + "oneof": [ + "newDisk", + "existingDisk" + ] + } + }, + "fields": { + "newDisk": { + "type": "Disk", + "id": 1 + }, + "existingDisk": { + "type": "string", + "id": 2 + }, + "deviceName": { + "type": "string", + "id": 3 + } + } + }, + "Accelerator": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "count": { + "type": "int64", + "id": 2 + }, + "installGpuDrivers": { + "type": "bool", + "id": 3, + "options": { + "deprecated": true + } + }, + "driverVersion": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "InstancePolicy": { + "fields": { + "machineType": { + "type": "string", + "id": 2 + }, + "minCpuPlatform": { + "type": "string", + "id": 3 + }, + "provisioningModel": { + "type": "ProvisioningModel", + "id": 4 + }, + "accelerators": { + "rule": "repeated", + "type": "Accelerator", + "id": 5 + }, + "bootDisk": { + "type": "Disk", + "id": 8 + }, + "disks": { + "rule": "repeated", + "type": "AttachedDisk", + "id": 6 + }, + "reservation": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "InstancePolicyOrTemplate": { + "oneofs": { + "policyTemplate": { + "oneof": [ + "policy", + "instanceTemplate" + ] + } + }, + "fields": { + "policy": { + "type": "InstancePolicy", + "id": 1 + }, + "instanceTemplate": { + "type": "string", + "id": 2 + }, + "installGpuDrivers": { + "type": "bool", + "id": 3 + }, + "installOpsAgent": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "blockProjectSshKeys": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "NetworkInterface": { + "fields": { + "network": { + "type": "string", + "id": 1 + }, + "subnetwork": { + "type": "string", + "id": 2 + }, + "noExternalIpAddress": { + "type": "bool", + "id": 3 + } + } + }, + "NetworkPolicy": { + "fields": { + "networkInterfaces": { + "rule": "repeated", + "type": "NetworkInterface", + "id": 1 + } + } + }, + "PlacementPolicy": { + "fields": { + "collocation": { + "type": "string", + "id": 1 + }, + "maxDistance": { + "type": "int64", + "id": 2 + } + } + }, + "ProvisioningModel": { + "values": { + "PROVISIONING_MODEL_UNSPECIFIED": 0, + "STANDARD": 1, + "SPOT": 2, + "PREEMPTIBLE": 3 + } + } + } + }, + "TaskGroup": { + "options": { + "(google.api.resource).type": "batch.googleapis.com/TaskGroup", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "taskSpec": { + "type": "TaskSpec", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "taskCount": { + "type": "int64", + "id": 4 + }, + "parallelism": { + "type": "int64", + "id": 5 + }, + "schedulingPolicy": { + "type": "SchedulingPolicy", + "id": 6 + }, + "taskEnvironments": { + "rule": "repeated", + "type": "Environment", + "id": 9 + }, + "taskCountPerNode": { + "type": "int64", + "id": 10 + }, + "requireHostsFile": { + "type": "bool", + "id": 11 + }, + "permissiveSsh": { + "type": "bool", + "id": 12 + }, + "runAsNonRoot": { + "type": "bool", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "SchedulingPolicy": { + "values": { + "SCHEDULING_POLICY_UNSPECIFIED": 0, + "AS_SOON_AS_POSSIBLE": 1, + "IN_ORDER": 2 + } + } + } + }, + "ServiceAccount": { + "fields": { + "email": { + "type": "string", + "id": 1 + }, + "scopes": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "ComputeResource": { + "fields": { + "cpuMilli": { + "type": "int64", + "id": 1 + }, + "memoryMib": { + "type": "int64", + "id": 2 + }, + "bootDiskMib": { + "type": "int64", + "id": 4 + } + } + }, + "StatusEvent": { + "fields": { + "type": { + "type": "string", + "id": 3 + }, + "description": { + "type": "string", + "id": 1 + }, + "eventTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "taskExecution": { + "type": "TaskExecution", + "id": 4 + }, + "taskState": { + "type": "TaskStatus.State", + "id": 5 + } + } + }, + "TaskExecution": { + "fields": { + "exitCode": { + "type": "int32", + "id": 1 + } + } + }, + "TaskStatus": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "statusEvents": { + "rule": "repeated", + "type": "StatusEvent", + "id": 2 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PENDING": 1, + "ASSIGNED": 2, + "RUNNING": 3, + "FAILED": 4, + "SUCCEEDED": 5, + "UNEXECUTED": 6 + } + } + } + }, + "Runnable": { + "oneofs": { + "executable": { + "oneof": [ + "container", + "script", + "barrier" + ] + } + }, + "fields": { + "container": { + "type": "Container", + "id": 1 + }, + "script": { + "type": "Script", + "id": 2 + }, + "barrier": { + "type": "Barrier", + "id": 6 + }, + "displayName": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ignoreExitStatus": { + "type": "bool", + "id": 3 + }, + "background": { + "type": "bool", + "id": 4 + }, + "alwaysRun": { + "type": "bool", + "id": 5 + }, + "environment": { + "type": "Environment", + "id": 7 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 8 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 9 + } + }, + "nested": { + "Container": { + "fields": { + "imageUri": { + "type": "string", + "id": 1 + }, + "commands": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "entrypoint": { + "type": "string", + "id": 3 + }, + "volumes": { + "rule": "repeated", + "type": "string", + "id": 7 + }, + "options": { + "type": "string", + "id": 8 + }, + "blockExternalNetwork": { + "type": "bool", + "id": 9 + }, + "username": { + "type": "string", + "id": 10 + }, + "password": { + "type": "string", + "id": 11 + }, + "enableImageStreaming": { + "type": "bool", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Script": { + "oneofs": { + "command": { + "oneof": [ + "path", + "text" + ] + } + }, + "fields": { + "path": { + "type": "string", + "id": 1 + }, + "text": { + "type": "string", + "id": 2 + } + } + }, + "Barrier": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + } + } + }, + "TaskSpec": { + "fields": { + "runnables": { + "rule": "repeated", + "type": "Runnable", + "id": 8 + }, + "computeResource": { + "type": "ComputeResource", + "id": 3 + }, + "maxRunDuration": { + "type": "google.protobuf.Duration", + "id": 4 + }, + "maxRetryCount": { + "type": "int32", + "id": 5 + }, + "lifecyclePolicies": { + "rule": "repeated", + "type": "LifecyclePolicy", + "id": 9 + }, + "environments": { + "keyType": "string", + "type": "string", + "id": 6, + "options": { + "deprecated": true + } + }, + "volumes": { + "rule": "repeated", + "type": "Volume", + "id": 7 + }, + "environment": { + "type": "Environment", + "id": 10 + } + } + }, + "LifecyclePolicy": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "actionCondition": { + "type": "ActionCondition", + "id": 2 + } + }, + "nested": { + "ActionCondition": { + "fields": { + "exitCodes": { + "rule": "repeated", + "type": "int32", + "id": 1 + } + } + }, + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "RETRY_TASK": 1, + "FAIL_TASK": 2 + } + } + } + }, + "Task": { + "options": { + "(google.api.resource).type": "batch.googleapis.com/Task", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}/tasks/{task}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "status": { + "type": "TaskStatus", + "id": 2 + } + } + }, + "Environment": { + "fields": { + "variables": { + "keyType": "string", + "type": "string", + "id": 1 + }, + "secretVariables": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "encryptedVariables": { + "type": "KMSEnvMap", + "id": 3 + } + }, + "nested": { + "KMSEnvMap": { + "fields": { + "keyName": { + "type": "string", + "id": 1 + }, + "cipherText": { + "type": "string", + "id": 2 + } + } + } + } + }, + "Volume": { + "oneofs": { + "source": { + "oneof": [ + "nfs", + "gcs", + "deviceName" + ] + } + }, + "fields": { + "nfs": { + "type": "NFS", + "id": 1 + }, + "gcs": { + "type": "GCS", + "id": 3 + }, + "deviceName": { + "type": "string", + "id": 6 + }, + "mountPath": { + "type": "string", + "id": 4 + }, + "mountOptions": { + "rule": "repeated", + "type": "string", + "id": 5 + } + } + }, + "NFS": { + "fields": { + "server": { + "type": "string", + "id": 1 + }, + "remotePath": { + "type": "string", + "id": 2 + } + } + }, + "GCS": { + "fields": { + "remotePath": { + "type": "string", + "id": 1 + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ResourceProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "apiVersion": { + "type": "string", + "id": 525000001, + "extend": "google.protobuf.ServiceOptions" + }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 + }, + "restReferenceDocumentationUri": { + "type": "string", + "id": 111 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "renamedResources": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "ignoredResources": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "forcedNamespaceAliases": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "handwrittenSignatures": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + }, + "autoPopulatedFields": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "PACKAGE_MANAGER": 20 + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + }, + "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 + } + }, + "fieldInfo": { + "type": "google.api.FieldInfo", + "id": 291403980, + "extend": "google.protobuf.FieldOptions" + }, + "FieldInfo": { + "fields": { + "format": { + "type": "Format", + "id": 1 + } + }, + "nested": { + "Format": { + "values": { + "FORMAT_UNSPECIFIED": 0, + "UUID4": 1, + "IPV4": 2, + "IPV6": 3, + "IPV4_OR_IPV6": 4 + } + } + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "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": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "Edition": { + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, + "FileDescriptorProto": { + "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, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "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": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "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": { + "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": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "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": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "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": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19, + "options": { + "packed": false + } + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 18, + 18 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "value": { + "type": "string", + "id": 2 + } + } + } + } + }, + "OneofOptions": { + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "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": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "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": { + "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": { + "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": { + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO2", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + } + }, + "extensions": [ + [ + 1000, + 1000 + ], + [ + 1001, + 1001 + ], + [ + 1002, + 1002 + ], + [ + 9990, + 9990 + ], + [ + 9995, + 9999 + ], + [ + 10000, + 10000 + ] + ], + "reserved": [ + [ + 999, + 999 + ] + ], + "nested": { + "FieldPresence": { + "values": { + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3 + } + }, + "EnumType": { + "values": { + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "RepeatedFieldEncoding": { + "values": { + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2 + } + }, + "Utf8Validation": { + "values": { + "UTF8_VALIDATION_UNKNOWN": 0, + "VERIFY": 2, + "NONE": 3 + } + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + } + } + }, + "FeatureSetDefaults": { + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "features": { + "type": "FeatureSet", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Timestamp": { + "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": {} + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.create_job.js b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.create_job.js new file mode 100644 index 00000000000..ceffce87c28 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.create_job.js @@ -0,0 +1,92 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, job) { + // [START batch_v1_generated_BatchService_CreateJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name where the Job will be created. + * Pattern: "projects/{project}/locations/{location}" + */ + // const parent = 'abc123' + /** + * ID used to uniquely identify the Job within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and '-' are accepted. + * The '-' character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The job.name field in the request will be ignored and the created resource + * name of the Job will be "{parent}/jobs/{job_id}". + */ + // const jobId = 'abc123' + /** + * Required. The Job to create. + */ + // const job = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callCreateJob() { + // Construct request + const request = { + parent, + job, + }; + + // Run request + const response = await batchClient.createJob(request); + console.log(response); + } + + callCreateJob(); + // [END batch_v1_generated_BatchService_CreateJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.delete_job.js b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.delete_job.js new file mode 100644 index 00000000000..056a8d9bce4 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.delete_job.js @@ -0,0 +1,79 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START batch_v1_generated_BatchService_DeleteJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Job name. + */ + // const name = 'abc123' + /** + * Optional. Reason for this deletion. + */ + // const reason = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callDeleteJob() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await batchClient.deleteJob(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteJob(); + // [END batch_v1_generated_BatchService_DeleteJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.get_job.js b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.get_job.js new file mode 100644 index 00000000000..0e68cdffae5 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.get_job.js @@ -0,0 +1,61 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START batch_v1_generated_BatchService_GetJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Job name. + */ + // const name = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callGetJob() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await batchClient.getJob(request); + console.log(response); + } + + callGetJob(); + // [END batch_v1_generated_BatchService_GetJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.get_task.js b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.get_task.js new file mode 100644 index 00000000000..3b6d00367e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.get_task.js @@ -0,0 +1,61 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START batch_v1_generated_BatchService_GetTask_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Task name. + */ + // const name = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callGetTask() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await batchClient.getTask(request); + console.log(response); + } + + callGetTask(); + // [END batch_v1_generated_BatchService_GetTask_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.list_jobs.js b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.list_jobs.js new file mode 100644 index 00000000000..cfd8edc4cf8 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.list_jobs.js @@ -0,0 +1,79 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START batch_v1_generated_BatchService_ListJobs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Parent path. + */ + // const parent = 'abc123' + /** + * List filter. + */ + // const filter = 'abc123' + /** + * Optional. Sort results. Supported are "name", "name desc", "create_time", + * and "create_time desc". + */ + // const orderBy = 'abc123' + /** + * Page size. + */ + // const pageSize = 1234 + /** + * Page token. + */ + // const pageToken = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callListJobs() { + // Construct request + const request = { + }; + + // Run request + const iterable = batchClient.listJobsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListJobs(); + // [END batch_v1_generated_BatchService_ListJobs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.list_tasks.js b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.list_tasks.js new file mode 100644 index 00000000000..d0546798f89 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.list_tasks.js @@ -0,0 +1,79 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START batch_v1_generated_BatchService_ListTasks_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of a TaskGroup from which Tasks are being requested. + * Pattern: + * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + */ + // const parent = 'abc123' + /** + * Task filter, null filter matches all Tasks. + * Filter string should be of the format State=TaskStatus.State e.g. + * State=RUNNING + */ + // const filter = 'abc123' + /** + * Page size. + */ + // const pageSize = 1234 + /** + * Page token. + */ + // const pageToken = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callListTasks() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = batchClient.listTasksAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTasks(); + // [END batch_v1_generated_BatchService_ListTasks_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/snippet_metadata_google.cloud.batch.v1.json b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/snippet_metadata_google.cloud.batch.v1.json new file mode 100644 index 00000000000..fd2ad4716e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/snippet_metadata_google.cloud.batch.v1.json @@ -0,0 +1,303 @@ +{ + "clientLibrary": { + "name": "nodejs-batch", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.batch.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "batch_v1_generated_BatchService_CreateJob_async", + "title": "BatchService createJob Sample", + "origin": "API_DEFINITION", + "description": " Create a Job.", + "canonical": true, + "file": "batch_service.create_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 84, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateJob", + "fullName": "google.cloud.batch.v1.BatchService.CreateJob", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "job_id", + "type": "TYPE_STRING" + }, + { + "name": "job", + "type": ".google.cloud.batch.v1.Job" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.batch.v1.Job", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1.BatchServiceClient" + }, + "method": { + "shortName": "CreateJob", + "fullName": "google.cloud.batch.v1.BatchService.CreateJob", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1.BatchService" + } + } + } + }, + { + "regionTag": "batch_v1_generated_BatchService_GetJob_async", + "title": "BatchService getJob Sample", + "origin": "API_DEFINITION", + "description": " Get a Job specified by its resource name.", + "canonical": true, + "file": "batch_service.get_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetJob", + "fullName": "google.cloud.batch.v1.BatchService.GetJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.batch.v1.Job", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1.BatchServiceClient" + }, + "method": { + "shortName": "GetJob", + "fullName": "google.cloud.batch.v1.BatchService.GetJob", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1.BatchService" + } + } + } + }, + { + "regionTag": "batch_v1_generated_BatchService_DeleteJob_async", + "title": "BatchService deleteJob Sample", + "origin": "API_DEFINITION", + "description": " Delete a Job.", + "canonical": true, + "file": "batch_service.delete_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteJob", + "fullName": "google.cloud.batch.v1.BatchService.DeleteJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "reason", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1.BatchServiceClient" + }, + "method": { + "shortName": "DeleteJob", + "fullName": "google.cloud.batch.v1.BatchService.DeleteJob", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1.BatchService" + } + } + } + }, + { + "regionTag": "batch_v1_generated_BatchService_ListJobs_async", + "title": "BatchService listJobs Sample", + "origin": "API_DEFINITION", + "description": " List all Jobs for a project within a region.", + "canonical": true, + "file": "batch_service.list_jobs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListJobs", + "fullName": "google.cloud.batch.v1.BatchService.ListJobs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.batch.v1.ListJobsResponse", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1.BatchServiceClient" + }, + "method": { + "shortName": "ListJobs", + "fullName": "google.cloud.batch.v1.BatchService.ListJobs", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1.BatchService" + } + } + } + }, + { + "regionTag": "batch_v1_generated_BatchService_GetTask_async", + "title": "BatchService getTask Sample", + "origin": "API_DEFINITION", + "description": " Return a single Task.", + "canonical": true, + "file": "batch_service.get_task.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetTask", + "fullName": "google.cloud.batch.v1.BatchService.GetTask", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.batch.v1.Task", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1.BatchServiceClient" + }, + "method": { + "shortName": "GetTask", + "fullName": "google.cloud.batch.v1.BatchService.GetTask", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1.BatchService" + } + } + } + }, + { + "regionTag": "batch_v1_generated_BatchService_ListTasks_async", + "title": "BatchService listTasks Sample", + "origin": "API_DEFINITION", + "description": " List Tasks associated with a job.", + "canonical": true, + "file": "batch_service.list_tasks.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListTasks", + "fullName": "google.cloud.batch.v1.BatchService.ListTasks", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.batch.v1.ListTasksResponse", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1.BatchServiceClient" + }, + "method": { + "shortName": "ListTasks", + "fullName": "google.cloud.batch.v1.BatchService.ListTasks", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1.BatchService" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-cloud-batch/v1/src/index.ts b/owl-bot-staging/google-cloud-batch/v1/src/index.ts new file mode 100644 index 00000000000..5a38d7beb99 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; +const BatchServiceClient = v1.BatchServiceClient; +type BatchServiceClient = v1.BatchServiceClient; +export {v1, BatchServiceClient}; +export default {v1, BatchServiceClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_client.ts b/owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_client.ts new file mode 100644 index 00000000000..d858efc2bf3 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_client.ts @@ -0,0 +1,1620 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v1/batch_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './batch_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Google Batch Service. + * The service manages user submitted batch jobs and allocates Google Compute + * Engine VM instances to run the jobs. + * @class + * @memberof v1 + */ +export class BatchServiceClient { + 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; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + batchServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of BatchServiceClient. + * + * @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://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @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 BatchServiceClient({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 BatchServiceClient; + 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 = 'batch.' + 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; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + jobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/jobs/{job}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + taskPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}/tasks/{task}' + ), + taskGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}' + ), + }; + + // 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 = { + listJobs: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'jobs'), + listTasks: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'tasks') + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v1/{name=projects/*/locations/*}',},{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1/{name=projects/*}/locations',},{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',body: '*',},{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/locations/*}/operations',}]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const deleteJobResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteJobMetadata = protoFilesRoot.lookup( + '.google.cloud.batch.v1.OperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + deleteJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteJobResponse.decode.bind(deleteJobResponse), + deleteJobMetadata.decode.bind(deleteJobMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.batch.v1.BatchService', 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.batchServiceStub) { + return this.batchServiceStub; + } + + // Put together the "service stub" for + // google.cloud.batch.v1.BatchService. + this.batchServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.batch.v1.BatchService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.batch.v1.BatchService, + 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 batchServiceStubMethods = + ['createJob', 'getJob', 'deleteJob', 'listJobs', 'getTask', 'listTasks']; + for (const methodName of batchServiceStubMethods) { + const callPromise = this.batchServiceStub.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.batchServiceStub; + } + + /** + * 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 'batch.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 'batch.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' + ]; + } + + 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 -- + // ------------------- +/** + * Create a Job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name where the Job will be created. + * Pattern: "projects/{project}/locations/{location}" + * @param {string} request.jobId + * ID used to uniquely identify the Job within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and '-' are accepted. + * The '-' character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * + * The job.name field in the request will be ignored and the created resource + * name of the Job will be "{parent}/jobs/{job_id}". + * @param {google.cloud.batch.v1.Job} request.job + * Required. The Job to create. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1.Job|Job}. + * 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/batch_service.create_job.js + * region_tag:batch_v1_generated_BatchService_CreateJob_async + */ + createJob( + request?: protos.google.cloud.batch.v1.ICreateJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.batch.v1.IJob, + protos.google.cloud.batch.v1.ICreateJobRequest|undefined, {}|undefined + ]>; + createJob( + request: protos.google.cloud.batch.v1.ICreateJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.batch.v1.IJob, + protos.google.cloud.batch.v1.ICreateJobRequest|null|undefined, + {}|null|undefined>): void; + createJob( + request: protos.google.cloud.batch.v1.ICreateJobRequest, + callback: Callback< + protos.google.cloud.batch.v1.IJob, + protos.google.cloud.batch.v1.ICreateJobRequest|null|undefined, + {}|null|undefined>): void; + createJob( + request?: protos.google.cloud.batch.v1.ICreateJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.batch.v1.IJob, + protos.google.cloud.batch.v1.ICreateJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.batch.v1.IJob, + protos.google.cloud.batch.v1.ICreateJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.batch.v1.IJob, + protos.google.cloud.batch.v1.ICreateJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createJob(request, options, callback); + } +/** + * Get a Job specified by its resource name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Job name. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1.Job|Job}. + * 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/batch_service.get_job.js + * region_tag:batch_v1_generated_BatchService_GetJob_async + */ + getJob( + request?: protos.google.cloud.batch.v1.IGetJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.batch.v1.IJob, + protos.google.cloud.batch.v1.IGetJobRequest|undefined, {}|undefined + ]>; + getJob( + request: protos.google.cloud.batch.v1.IGetJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.batch.v1.IJob, + protos.google.cloud.batch.v1.IGetJobRequest|null|undefined, + {}|null|undefined>): void; + getJob( + request: protos.google.cloud.batch.v1.IGetJobRequest, + callback: Callback< + protos.google.cloud.batch.v1.IJob, + protos.google.cloud.batch.v1.IGetJobRequest|null|undefined, + {}|null|undefined>): void; + getJob( + request?: protos.google.cloud.batch.v1.IGetJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.batch.v1.IJob, + protos.google.cloud.batch.v1.IGetJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.batch.v1.IJob, + protos.google.cloud.batch.v1.IGetJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.batch.v1.IJob, + protos.google.cloud.batch.v1.IGetJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getJob(request, options, callback); + } +/** + * Return a single Task. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Task name. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1.Task|Task}. + * 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/batch_service.get_task.js + * region_tag:batch_v1_generated_BatchService_GetTask_async + */ + getTask( + request?: protos.google.cloud.batch.v1.IGetTaskRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.batch.v1.ITask, + protos.google.cloud.batch.v1.IGetTaskRequest|undefined, {}|undefined + ]>; + getTask( + request: protos.google.cloud.batch.v1.IGetTaskRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.batch.v1.ITask, + protos.google.cloud.batch.v1.IGetTaskRequest|null|undefined, + {}|null|undefined>): void; + getTask( + request: protos.google.cloud.batch.v1.IGetTaskRequest, + callback: Callback< + protos.google.cloud.batch.v1.ITask, + protos.google.cloud.batch.v1.IGetTaskRequest|null|undefined, + {}|null|undefined>): void; + getTask( + request?: protos.google.cloud.batch.v1.IGetTaskRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.batch.v1.ITask, + protos.google.cloud.batch.v1.IGetTaskRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.batch.v1.ITask, + protos.google.cloud.batch.v1.IGetTaskRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.batch.v1.ITask, + protos.google.cloud.batch.v1.IGetTaskRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getTask(request, options, callback); + } + +/** + * Delete a Job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Job name. + * @param {string} [request.reason] + * Optional. Reason for this deletion. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/batch_service.delete_job.js + * region_tag:batch_v1_generated_BatchService_DeleteJob_async + */ + deleteJob( + request?: protos.google.cloud.batch.v1.IDeleteJobRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteJob( + request: protos.google.cloud.batch.v1.IDeleteJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteJob( + request: protos.google.cloud.batch.v1.IDeleteJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteJob( + request?: protos.google.cloud.batch.v1.IDeleteJobRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteJob(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteJob()`. + * @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/batch_service.delete_job.js + * region_tag:batch_v1_generated_BatchService_DeleteJob_async + */ + async checkDeleteJobProgress(name: string): Promise>{ + 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.deleteJob, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * List all Jobs for a project within a region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Parent path. + * @param {string} request.filter + * List filter. + * @param {string} [request.orderBy] + * Optional. Sort results. Supported are "name", "name desc", "create_time", + * and "create_time desc". + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.batch.v1.Job|Job}. + * 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 `listJobsAsync()` + * 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. + */ + listJobs( + request?: protos.google.cloud.batch.v1.IListJobsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.batch.v1.IJob[], + protos.google.cloud.batch.v1.IListJobsRequest|null, + protos.google.cloud.batch.v1.IListJobsResponse + ]>; + listJobs( + request: protos.google.cloud.batch.v1.IListJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.batch.v1.IListJobsRequest, + protos.google.cloud.batch.v1.IListJobsResponse|null|undefined, + protos.google.cloud.batch.v1.IJob>): void; + listJobs( + request: protos.google.cloud.batch.v1.IListJobsRequest, + callback: PaginationCallback< + protos.google.cloud.batch.v1.IListJobsRequest, + protos.google.cloud.batch.v1.IListJobsResponse|null|undefined, + protos.google.cloud.batch.v1.IJob>): void; + listJobs( + request?: protos.google.cloud.batch.v1.IListJobsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.batch.v1.IListJobsRequest, + protos.google.cloud.batch.v1.IListJobsResponse|null|undefined, + protos.google.cloud.batch.v1.IJob>, + callback?: PaginationCallback< + protos.google.cloud.batch.v1.IListJobsRequest, + protos.google.cloud.batch.v1.IListJobsResponse|null|undefined, + protos.google.cloud.batch.v1.IJob>): + Promise<[ + protos.google.cloud.batch.v1.IJob[], + protos.google.cloud.batch.v1.IListJobsRequest|null, + protos.google.cloud.batch.v1.IListJobsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listJobs(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Parent path. + * @param {string} request.filter + * List filter. + * @param {string} [request.orderBy] + * Optional. Sort results. Supported are "name", "name desc", "create_time", + * and "create_time desc". + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.batch.v1.Job|Job} 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 `listJobsAsync()` + * 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. + */ + listJobsStream( + request?: protos.google.cloud.batch.v1.IListJobsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listJobs.createStream( + this.innerApiCalls.listJobs as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listJobs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Parent path. + * @param {string} request.filter + * List filter. + * @param {string} [request.orderBy] + * Optional. Sort results. Supported are "name", "name desc", "create_time", + * and "create_time desc". + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.batch.v1.Job|Job}. 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/batch_service.list_jobs.js + * region_tag:batch_v1_generated_BatchService_ListJobs_async + */ + listJobsAsync( + request?: protos.google.cloud.batch.v1.IListJobsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listJobs.asyncIterate( + this.innerApiCalls['listJobs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List Tasks associated with a job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of a TaskGroup from which Tasks are being requested. + * Pattern: + * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + * @param {string} request.filter + * Task filter, null filter matches all Tasks. + * Filter string should be of the format State=TaskStatus.State e.g. + * State=RUNNING + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.batch.v1.Task|Task}. + * 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 `listTasksAsync()` + * 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. + */ + listTasks( + request?: protos.google.cloud.batch.v1.IListTasksRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.batch.v1.ITask[], + protos.google.cloud.batch.v1.IListTasksRequest|null, + protos.google.cloud.batch.v1.IListTasksResponse + ]>; + listTasks( + request: protos.google.cloud.batch.v1.IListTasksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.batch.v1.IListTasksRequest, + protos.google.cloud.batch.v1.IListTasksResponse|null|undefined, + protos.google.cloud.batch.v1.ITask>): void; + listTasks( + request: protos.google.cloud.batch.v1.IListTasksRequest, + callback: PaginationCallback< + protos.google.cloud.batch.v1.IListTasksRequest, + protos.google.cloud.batch.v1.IListTasksResponse|null|undefined, + protos.google.cloud.batch.v1.ITask>): void; + listTasks( + request?: protos.google.cloud.batch.v1.IListTasksRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.batch.v1.IListTasksRequest, + protos.google.cloud.batch.v1.IListTasksResponse|null|undefined, + protos.google.cloud.batch.v1.ITask>, + callback?: PaginationCallback< + protos.google.cloud.batch.v1.IListTasksRequest, + protos.google.cloud.batch.v1.IListTasksResponse|null|undefined, + protos.google.cloud.batch.v1.ITask>): + Promise<[ + protos.google.cloud.batch.v1.ITask[], + protos.google.cloud.batch.v1.IListTasksRequest|null, + protos.google.cloud.batch.v1.IListTasksResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listTasks(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of a TaskGroup from which Tasks are being requested. + * Pattern: + * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + * @param {string} request.filter + * Task filter, null filter matches all Tasks. + * Filter string should be of the format State=TaskStatus.State e.g. + * State=RUNNING + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.batch.v1.Task|Task} 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 `listTasksAsync()` + * 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. + */ + listTasksStream( + request?: protos.google.cloud.batch.v1.IListTasksRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listTasks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTasks.createStream( + this.innerApiCalls.listTasks as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listTasks`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of a TaskGroup from which Tasks are being requested. + * Pattern: + * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + * @param {string} request.filter + * Task filter, null filter matches all Tasks. + * Filter string should be of the format State=TaskStatus.State e.g. + * State=RUNNING + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.batch.v1.Task|Task}. 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/batch_service.list_tasks.js + * region_tag:batch_v1_generated_BatchService_ListTasks_async + */ + listTasksAsync( + request?: protos.google.cloud.batch.v1.IListTasksRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listTasks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTasks.asyncIterate( + this.innerApiCalls['listTasks'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * 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, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@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 { + 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, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@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, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified job resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} job + * @returns {string} Resource name string. + */ + jobPath(project:string,location:string,job:string) { + return this.pathTemplates.jobPathTemplate.render({ + project: project, + location: location, + job: job, + }); + } + + /** + * Parse the project from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the project. + */ + matchProjectFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).project; + } + + /** + * Parse the location from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the location. + */ + matchLocationFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).location; + } + + /** + * Parse the job from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the job. + */ + matchJobFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).job; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified task resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} job + * @param {string} task_group + * @param {string} task + * @returns {string} Resource name string. + */ + taskPath(project:string,location:string,job:string,taskGroup:string,task:string) { + return this.pathTemplates.taskPathTemplate.render({ + project: project, + location: location, + job: job, + task_group: taskGroup, + task: task, + }); + } + + /** + * Parse the project from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).project; + } + + /** + * Parse the location from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).location; + } + + /** + * Parse the job from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the job. + */ + matchJobFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).job; + } + + /** + * Parse the task_group from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the task_group. + */ + matchTaskGroupFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).task_group; + } + + /** + * Parse the task from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the task. + */ + matchTaskFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).task; + } + + /** + * Return a fully-qualified taskGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} job + * @param {string} task_group + * @returns {string} Resource name string. + */ + taskGroupPath(project:string,location:string,job:string,taskGroup:string) { + return this.pathTemplates.taskGroupPathTemplate.render({ + project: project, + location: location, + job: job, + task_group: taskGroup, + }); + } + + /** + * Parse the project from TaskGroup resource. + * + * @param {string} taskGroupName + * A fully-qualified path representing TaskGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTaskGroupName(taskGroupName: string) { + return this.pathTemplates.taskGroupPathTemplate.match(taskGroupName).project; + } + + /** + * Parse the location from TaskGroup resource. + * + * @param {string} taskGroupName + * A fully-qualified path representing TaskGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTaskGroupName(taskGroupName: string) { + return this.pathTemplates.taskGroupPathTemplate.match(taskGroupName).location; + } + + /** + * Parse the job from TaskGroup resource. + * + * @param {string} taskGroupName + * A fully-qualified path representing TaskGroup resource. + * @returns {string} A string representing the job. + */ + matchJobFromTaskGroupName(taskGroupName: string) { + return this.pathTemplates.taskGroupPathTemplate.match(taskGroupName).job; + } + + /** + * Parse the task_group from TaskGroup resource. + * + * @param {string} taskGroupName + * A fully-qualified path representing TaskGroup resource. + * @returns {string} A string representing the task_group. + */ + matchTaskGroupFromTaskGroupName(taskGroupName: string) { + return this.pathTemplates.taskGroupPathTemplate.match(taskGroupName).task_group; + } + + /** + * 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.batchServiceStub && !this._terminated) { + return this.batchServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.locationsClient.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_client_config.json b/owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_client_config.json new file mode 100644 index 00000000000..be602f6e2eb --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_client_config.json @@ -0,0 +1,68 @@ +{ + "interfaces": { + "google.cloud.batch.v1.BatchService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "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 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetJob": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListJobs": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetTask": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListTasks": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_proto_list.json b/owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_proto_list.json new file mode 100644 index 00000000000..d9013a506a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_proto_list.json @@ -0,0 +1,6 @@ +[ + "../../protos/google/cloud/batch/v1/batch.proto", + "../../protos/google/cloud/batch/v1/job.proto", + "../../protos/google/cloud/batch/v1/task.proto", + "../../protos/google/cloud/batch/v1/volume.proto" +] diff --git a/owl-bot-staging/google-cloud-batch/v1/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-batch/v1/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..914e910ca19 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/src/v1/gapic_metadata.json @@ -0,0 +1,91 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.batch.v1", + "libraryPackage": "@google-cloud/batch", + "services": { + "BatchService": { + "clients": { + "grpc": { + "libraryClient": "BatchServiceClient", + "rpcs": { + "CreateJob": { + "methods": [ + "createJob" + ] + }, + "GetJob": { + "methods": [ + "getJob" + ] + }, + "GetTask": { + "methods": [ + "getTask" + ] + }, + "DeleteJob": { + "methods": [ + "deleteJob" + ] + }, + "ListJobs": { + "methods": [ + "listJobs", + "listJobsStream", + "listJobsAsync" + ] + }, + "ListTasks": { + "methods": [ + "listTasks", + "listTasksStream", + "listTasksAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "BatchServiceClient", + "rpcs": { + "CreateJob": { + "methods": [ + "createJob" + ] + }, + "GetJob": { + "methods": [ + "getJob" + ] + }, + "GetTask": { + "methods": [ + "getTask" + ] + }, + "DeleteJob": { + "methods": [ + "deleteJob" + ] + }, + "ListJobs": { + "methods": [ + "listJobs", + "listJobsStream", + "listJobsAsync" + ] + }, + "ListTasks": { + "methods": [ + "listTasks", + "listTasksStream", + "listTasksAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-batch/v1/src/v1/index.ts b/owl-bot-staging/google-cloud-batch/v1/src/v1/index.ts new file mode 100644 index 00000000000..fb53b495001 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {BatchServiceClient} from './batch_service_client'; diff --git a/owl-bot-staging/google-cloud-batch/v1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-batch/v1/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..b9ac0eb683e --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const batch = require('@google-cloud/batch'); + +function main() { + const batchServiceClient = new batch.BatchServiceClient(); +} + +main(); diff --git a/owl-bot-staging/google-cloud-batch/v1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-batch/v1/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..c43e51952e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 {BatchServiceClient} from '@google-cloud/batch'; + +// check that the client class type name can be used +function doStuffWithBatchServiceClient(client: BatchServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const batchServiceClient = new BatchServiceClient(); + doStuffWithBatchServiceClient(batchServiceClient); +} + +main(); diff --git a/owl-bot-staging/google-cloud-batch/v1/system-test/install.ts b/owl-bot-staging/google-cloud-batch/v1/system-test/install.ts new file mode 100644 index 00000000000..fd5bfdc71d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/owl-bot-staging/google-cloud-batch/v1/test/gapic_batch_service_v1.ts b/owl-bot-staging/google-cloud-batch/v1/test/gapic_batch_service_v1.ts new file mode 100644 index 00000000000..6ad80d6c51e --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/test/gapic_batch_service_v1.ts @@ -0,0 +1,1899 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 batchserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos, LocationProtos} 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.BatchServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new batchserviceModule.v1.BatchServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'batch.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new batchserviceModule.v1.BatchServiceClient(); + 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 = batchserviceModule.v1.BatchServiceClient.servicePath; + assert.strictEqual(servicePath, 'batch.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = batchserviceModule.v1.BatchServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'batch.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new batchserviceModule.v1.BatchServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'batch.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new batchserviceModule.v1.BatchServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'batch.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 batchserviceModule.v1.BatchServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'batch.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 batchserviceModule.v1.BatchServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'batch.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 batchserviceModule.v1.BatchServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = batchserviceModule.v1.BatchServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new batchserviceModule.v1.BatchServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.batchServiceStub, undefined); + await client.initialize(); + assert(client.batchServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.batchServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.batchServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new batchserviceModule.v1.BatchServiceClient({ + 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 batchserviceModule.v1.BatchServiceClient({ + 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('createJob', () => { + it('invokes createJob without error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.CreateJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.CreateJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1.Job() + ); + client.innerApiCalls.createJob = stubSimpleCall(expectedResponse); + const [response] = await client.createJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createJob without error using callback', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.CreateJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.CreateJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1.Job() + ); + client.innerApiCalls.createJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createJob( + request, + (err?: Error|null, result?: protos.google.cloud.batch.v1.IJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createJob with error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.CreateJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.CreateJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createJob(request), expectedError); + const actualRequest = (client.innerApiCalls.createJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createJob with closed client', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.CreateJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.CreateJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createJob(request), expectedError); + }); + }); + + describe('getJob', () => { + it('invokes getJob without error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.GetJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.GetJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1.Job() + ); + client.innerApiCalls.getJob = stubSimpleCall(expectedResponse); + const [response] = await client.getJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJob without error using callback', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.GetJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.GetJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1.Job() + ); + client.innerApiCalls.getJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getJob( + request, + (err?: Error|null, result?: protos.google.cloud.batch.v1.IJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJob with error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.GetJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.GetJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getJob(request), expectedError); + const actualRequest = (client.innerApiCalls.getJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJob with closed client', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.GetJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.GetJobRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getJob(request), expectedError); + }); + }); + + describe('getTask', () => { + it('invokes getTask without error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.GetTaskRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.GetTaskRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1.Task() + ); + client.innerApiCalls.getTask = stubSimpleCall(expectedResponse); + const [response] = await client.getTask(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getTask as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTask as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTask without error using callback', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.GetTaskRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.GetTaskRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1.Task() + ); + client.innerApiCalls.getTask = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTask( + request, + (err?: Error|null, result?: protos.google.cloud.batch.v1.ITask|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getTask as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTask as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTask with error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.GetTaskRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.GetTaskRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTask = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTask(request), expectedError); + const actualRequest = (client.innerApiCalls.getTask as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTask as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTask with closed client', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.GetTaskRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.GetTaskRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTask(request), expectedError); + }); + }); + + describe('deleteJob', () => { + it('invokes deleteJob without error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.DeleteJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.DeleteJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteJob = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteJob without error using callback', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.DeleteJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.DeleteJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteJob = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteJob( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteJob with call error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.DeleteJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.DeleteJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteJob(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteJob with LRO error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.DeleteJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.DeleteJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteJobProgress without error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkDeleteJobProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteJobProgress with error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteJobProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listJobs', () => { + it('invokes listJobs without error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.ListJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.ListJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1.Job()), + generateSampleMessage(new protos.google.cloud.batch.v1.Job()), + generateSampleMessage(new protos.google.cloud.batch.v1.Job()), + ]; + client.innerApiCalls.listJobs = stubSimpleCall(expectedResponse); + const [response] = await client.listJobs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobs without error using callback', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.ListJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.ListJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1.Job()), + generateSampleMessage(new protos.google.cloud.batch.v1.Job()), + generateSampleMessage(new protos.google.cloud.batch.v1.Job()), + ]; + client.innerApiCalls.listJobs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listJobs( + request, + (err?: Error|null, result?: protos.google.cloud.batch.v1.IJob[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobs with error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.ListJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.ListJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listJobs(request), expectedError); + const actualRequest = (client.innerApiCalls.listJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobsStream without error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.ListJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.ListJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1.Job()), + generateSampleMessage(new protos.google.cloud.batch.v1.Job()), + generateSampleMessage(new protos.google.cloud.batch.v1.Job()), + ]; + client.descriptors.page.listJobs.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.batch.v1.Job[] = []; + stream.on('data', (response: protos.google.cloud.batch.v1.Job) => { + 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.listJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listJobs, request)); + assert( + (client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listJobsStream with error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.ListJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.ListJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listJobs.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.batch.v1.Job[] = []; + stream.on('data', (response: protos.google.cloud.batch.v1.Job) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listJobs, request)); + assert( + (client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listJobs without error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.ListJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.ListJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1.Job()), + generateSampleMessage(new protos.google.cloud.batch.v1.Job()), + generateSampleMessage(new protos.google.cloud.batch.v1.Job()), + ]; + client.descriptors.page.listJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.batch.v1.IJob[] = []; + const iterable = client.listJobsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listJobs with error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.ListJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.ListJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listJobsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.batch.v1.IJob[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listTasks', () => { + it('invokes listTasks without error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.ListTasksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.ListTasksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1.Task()), + generateSampleMessage(new protos.google.cloud.batch.v1.Task()), + generateSampleMessage(new protos.google.cloud.batch.v1.Task()), + ]; + client.innerApiCalls.listTasks = stubSimpleCall(expectedResponse); + const [response] = await client.listTasks(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listTasks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTasks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTasks without error using callback', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.ListTasksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.ListTasksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1.Task()), + generateSampleMessage(new protos.google.cloud.batch.v1.Task()), + generateSampleMessage(new protos.google.cloud.batch.v1.Task()), + ]; + client.innerApiCalls.listTasks = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTasks( + request, + (err?: Error|null, result?: protos.google.cloud.batch.v1.ITask[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listTasks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTasks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTasks with error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.ListTasksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.ListTasksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTasks = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTasks(request), expectedError); + const actualRequest = (client.innerApiCalls.listTasks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTasks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTasksStream without error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.ListTasksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.ListTasksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1.Task()), + generateSampleMessage(new protos.google.cloud.batch.v1.Task()), + generateSampleMessage(new protos.google.cloud.batch.v1.Task()), + ]; + client.descriptors.page.listTasks.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listTasksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.batch.v1.Task[] = []; + stream.on('data', (response: protos.google.cloud.batch.v1.Task) => { + 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.listTasks.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTasks, request)); + assert( + (client.descriptors.page.listTasks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listTasksStream with error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.ListTasksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.ListTasksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTasks.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listTasksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.batch.v1.Task[] = []; + stream.on('data', (response: protos.google.cloud.batch.v1.Task) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listTasks.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTasks, request)); + assert( + (client.descriptors.page.listTasks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTasks without error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.ListTasksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.ListTasksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1.Task()), + generateSampleMessage(new protos.google.cloud.batch.v1.Task()), + generateSampleMessage(new protos.google.cloud.batch.v1.Task()), + ]; + client.descriptors.page.listTasks.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.batch.v1.ITask[] = []; + const iterable = client.listTasksAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTasks.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listTasks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTasks with error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.ListTasksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.ListTasksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTasks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTasksAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.batch.v1.ITask[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTasks.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listTasks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation without error using callback', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.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 batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + 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 batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + 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 batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + 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 batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('job', () => { + const fakePath = "/rendered/path/job"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + job: "jobValue", + }; + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.jobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.jobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('jobPath', () => { + const result = client.jobPath("projectValue", "locationValue", "jobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.jobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromJobName', () => { + const result = client.matchProjectFromJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromJobName', () => { + const result = client.matchLocationFromJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchJobFromJobName', () => { + const result = client.matchJobFromJobName(fakePath); + assert.strictEqual(result, "jobValue"); + assert((client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('task', () => { + const fakePath = "/rendered/path/task"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + job: "jobValue", + task_group: "taskGroupValue", + task: "taskValue", + }; + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.taskPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.taskPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('taskPath', () => { + const result = client.taskPath("projectValue", "locationValue", "jobValue", "taskGroupValue", "taskValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.taskPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTaskName', () => { + const result = client.matchProjectFromTaskName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.taskPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTaskName', () => { + const result = client.matchLocationFromTaskName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.taskPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchJobFromTaskName', () => { + const result = client.matchJobFromTaskName(fakePath); + assert.strictEqual(result, "jobValue"); + assert((client.pathTemplates.taskPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTaskGroupFromTaskName', () => { + const result = client.matchTaskGroupFromTaskName(fakePath); + assert.strictEqual(result, "taskGroupValue"); + assert((client.pathTemplates.taskPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTaskFromTaskName', () => { + const result = client.matchTaskFromTaskName(fakePath); + assert.strictEqual(result, "taskValue"); + assert((client.pathTemplates.taskPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('taskGroup', () => { + const fakePath = "/rendered/path/taskGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + job: "jobValue", + task_group: "taskGroupValue", + }; + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.taskGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.taskGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('taskGroupPath', () => { + const result = client.taskGroupPath("projectValue", "locationValue", "jobValue", "taskGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.taskGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTaskGroupName', () => { + const result = client.matchProjectFromTaskGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.taskGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTaskGroupName', () => { + const result = client.matchLocationFromTaskGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.taskGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchJobFromTaskGroupName', () => { + const result = client.matchJobFromTaskGroupName(fakePath); + assert.strictEqual(result, "jobValue"); + assert((client.pathTemplates.taskGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTaskGroupFromTaskGroupName', () => { + const result = client.matchTaskGroupFromTaskGroupName(fakePath); + assert.strictEqual(result, "taskGroupValue"); + assert((client.pathTemplates.taskGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-batch/v1/tsconfig.json b/owl-bot-staging/google-cloud-batch/v1/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/owl-bot-staging/google-cloud-batch/v1/webpack.config.js b/owl-bot-staging/google-cloud-batch/v1/webpack.config.js new file mode 100644 index 00000000000..04a4c53960a --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'BatchService', + filename: './batch-service.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/.eslintignore b/owl-bot-staging/google-cloud-batch/v1alpha/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/.eslintrc.json b/owl-bot-staging/google-cloud-batch/v1alpha/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/.gitignore b/owl-bot-staging/google-cloud-batch/v1alpha/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +/.coverage +/coverage +/.nyc_output +/docs/ +/out/ +/build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/.jsdoc.js b/owl-bot-staging/google-cloud-batch/v1alpha/.jsdoc.js new file mode 100644 index 00000000000..f3c1e45a4fc --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2024 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/batch', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/.mocharc.js b/owl-bot-staging/google-cloud-batch/v1alpha/.mocharc.js new file mode 100644 index 00000000000..13b67c34edc --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/.prettierrc.js b/owl-bot-staging/google-cloud-batch/v1alpha/.prettierrc.js new file mode 100644 index 00000000000..9a8fd690982 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/README.md b/owl-bot-staging/google-cloud-batch/v1alpha/README.md new file mode 100644 index 00000000000..15b2fa3f3e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/README.md @@ -0,0 +1 @@ +Batch: Nodejs Client diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/package.json b/owl-bot-staging/google-cloud-batch/v1alpha/package.json new file mode 100644 index 00000000000..d27d57773ff --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/package.json @@ -0,0 +1,58 @@ +{ + "name": "@google-cloud/batch", + "version": "0.1.0", + "description": "Batch client for Node.js", + "repository": "googleapis/nodejs-batch", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google batch", + "batch", + "batch service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^4.3.4" + }, + "devDependencies": { + "@types/mocha": "^10.0.6", + "@types/node": "^20.12.12", + "@types/sinon": "^10.0.20", + "c8": "^9.1.0", + "gapic-tools": "^0.4.2", + "gts": "5.3.0", + "jsdoc": "^4.0.3", + "jsdoc-fresh": "^3.0.0", + "jsdoc-region-tag": "^3.0.0", + "mocha": "^10.4.0", + "pack-n-play": "^2.0.3", + "sinon": "^15.2.0", + "typescript": "5.1.6" + }, + "engines": { + "node": ">=v14" + } +} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/batch.proto b/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/batch.proto new file mode 100644 index 00000000000..7591e92c08e --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/batch.proto @@ -0,0 +1,587 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.batch.v1alpha; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/cloud/batch/v1alpha/job.proto"; +import "google/cloud/batch/v1alpha/resource_allowance.proto"; +import "google/cloud/batch/v1alpha/task.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Batch.V1Alpha"; +option go_package = "cloud.google.com/go/batch/apiv1alpha/batchpb;batchpb"; +option java_multiple_files = true; +option java_outer_classname = "BatchProto"; +option java_package = "com.google.cloud.batch.v1alpha"; +option objc_class_prefix = "GCB"; +option php_namespace = "Google\\Cloud\\Batch\\V1alpha"; +option ruby_package = "Google::Cloud::Batch::V1alpha"; + +// Google Batch Service. +// The service manages user submitted batch jobs and allocates Google Compute +// Engine VM instances to run the jobs. +service BatchService { + option (google.api.default_host) = "batch.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Create a Job. + rpc CreateJob(CreateJobRequest) returns (Job) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*}/jobs" + body: "job" + }; + option (google.api.method_signature) = "parent,job,job_id"; + } + + // Get a Job specified by its resource name. + rpc GetJob(GetJobRequest) returns (Job) { + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/locations/*/jobs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Delete a Job. + rpc DeleteJob(DeleteJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1alpha/{name=projects/*/locations/*/jobs/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.batch.v1alpha.OperationMetadata" + }; + } + + // Cancel a Job. + rpc CancelJob(CancelJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{name=projects/*/locations/*/jobs/*}:cancel" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.batch.v1alpha.CancelJobResponse" + metadata_type: "google.cloud.batch.v1alpha.OperationMetadata" + }; + } + + // Update a Job. + rpc UpdateJob(UpdateJobRequest) returns (Job) { + option (google.api.http) = { + patch: "/v1alpha/{job.name=projects/*/locations/*/jobs/*}" + body: "job" + }; + option (google.api.method_signature) = "job,update_mask"; + } + + // List all Jobs for a project within a region. + rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*/locations/*}/jobs" + }; + option (google.api.method_signature) = "parent"; + } + + // Return a single Task. + rpc GetTask(GetTaskRequest) returns (Task) { + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/locations/*/jobs/*/taskGroups/*/tasks/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List Tasks associated with a job. + rpc ListTasks(ListTasksRequest) returns (ListTasksResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*/locations/*/jobs/*/taskGroups/*}/tasks" + }; + option (google.api.method_signature) = "parent"; + } + + // Create a Resource Allowance. + rpc CreateResourceAllowance(CreateResourceAllowanceRequest) + returns (ResourceAllowance) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*}/resourceAllowances" + body: "resource_allowance" + }; + option (google.api.method_signature) = + "parent,resource_allowance,resource_allowance_id"; + } + + // Get a ResourceAllowance specified by its resource name. + rpc GetResourceAllowance(GetResourceAllowanceRequest) + returns (ResourceAllowance) { + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/locations/*/resourceAllowances/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Delete a ResourceAllowance. + rpc DeleteResourceAllowance(DeleteResourceAllowanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1alpha/{name=projects/*/locations/*/resourceAllowances/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.batch.v1alpha.OperationMetadata" + }; + } + + // List all ResourceAllowances for a project within a region. + rpc ListResourceAllowances(ListResourceAllowancesRequest) + returns (ListResourceAllowancesResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*/locations/*}/resourceAllowances" + }; + option (google.api.method_signature) = "parent"; + } + + // Update a Resource Allowance. + rpc UpdateResourceAllowance(UpdateResourceAllowanceRequest) + returns (ResourceAllowance) { + option (google.api.http) = { + patch: "/v1alpha/{resource_allowance.name=projects/*/locations/*/resourceAllowances/*}" + body: "resource_allowance" + }; + option (google.api.method_signature) = "resource_allowance,update_mask"; + } +} + +// CreateJob Request. +message CreateJobRequest { + // Required. The parent resource name where the Job will be created. + // Pattern: "projects/{project}/locations/{location}" + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { child_type: "batch.googleapis.com/Job" } + ]; + + // ID used to uniquely identify the Job within its parent scope. + // This field should contain at most 63 characters and must start with + // lowercase characters. + // Only lowercase characters, numbers and '-' are accepted. + // The '-' character cannot be the first or the last one. + // A system generated ID will be used if the field is not set. + // + // The job.name field in the request will be ignored and the created resource + // name of the Job will be "{parent}/jobs/{job_id}". + string job_id = 2; + + // Required. The Job to create. + Job job = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// GetJob Request. +message GetJobRequest { + // Required. Job name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "batch.googleapis.com/Job" } + ]; +} + +// DeleteJob Request. +message DeleteJobRequest { + // Job name. + string name = 1; + + // Optional. Reason for this deletion. + string reason = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// CancelJob Request. +message CancelJobRequest { + // Required. Job name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "batch.googleapis.com/Job" } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Response to the CancelJob request. +message CancelJobResponse {} + +// UpdateJob Request. +message UpdateJobRequest { + // Required. The Job to update. + // Only fields specified in `updateMask` are updated. + Job job = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Mask of fields to update. + // + // The `jobs.patch` method can only be used while a job is in the `QUEUED`, + // `SCHEDULED`, or `RUNNING` state and currently only supports increasing the + // value of the first `taskCount` field in the job's `taskGroups` field. + // Therefore, you must set the value of `updateMask` to `taskGroups`. Any + // other job fields in the update request will be ignored. + // + // For example, to update a job's `taskCount` to `2`, set `updateMask` to + // `taskGroups` and use the following request body: + // ``` + // { + // "taskGroups":[{ + // "taskCount": 2 + // }] + // } + // ``` + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// ListJob Request. +message ListJobsRequest { + // Parent path. + string parent = 1; + + // List filter. + string filter = 4; + + // Optional. Sort results. Supported are "name", "name desc", "create_time", + // and "create_time desc". + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Page size. + int32 page_size = 2; + + // Page token. + string page_token = 3; +} + +// ListJob Response. +message ListJobsResponse { + // Jobs. + repeated Job jobs = 1; + + // Next page token. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// ListTasks Request. +message ListTasksRequest { + // Required. Name of a TaskGroup from which Tasks are being requested. + // Pattern: + // "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "batch.googleapis.com/TaskGroup" } + ]; + + // Task filter, null filter matches all Tasks. + // Filter string should be of the format State=TaskStatus.State e.g. + // State=RUNNING + string filter = 2; + + // Not implemented. + string order_by = 5; + + // Page size. + int32 page_size = 3; + + // Page token. + string page_token = 4; +} + +// ListTasks Response. +message ListTasksResponse { + // Tasks. + repeated Task tasks = 1; + + // Next page token. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request for a single Task by name. +message GetTaskRequest { + // Required. Task name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "batch.googleapis.com/Task" } + ]; +} + +// CreateResourceAllowance Request. +message CreateResourceAllowanceRequest { + // Required. The parent resource name where the ResourceAllowance will be + // created. Pattern: "projects/{project}/locations/{location}" + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "batch.googleapis.com/ResourceAllowance" + } + ]; + + // ID used to uniquely identify the ResourceAllowance within its parent scope. + // This field should contain at most 63 characters and must start with + // lowercase characters. + // Only lowercase characters, numbers and '-' are accepted. + // The '-' character cannot be the first or the last one. + // A system generated ID will be used if the field is not set. + // + // The resource_allowance.name field in the request will be ignored and the + // created resource name of the ResourceAllowance will be + // "{parent}/resourceAllowances/{resource_allowance_id}". + string resource_allowance_id = 2; + + // Required. The ResourceAllowance to create. + ResourceAllowance resource_allowance = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// GetResourceAllowance Request. +message GetResourceAllowanceRequest { + // Required. ResourceAllowance name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "batch.googleapis.com/ResourceAllowance" + } + ]; +} + +// DeleteResourceAllowance Request. +message DeleteResourceAllowanceRequest { + // Required. ResourceAllowance name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "batch.googleapis.com/ResourceAllowance" + } + ]; + + // Optional. Reason for this deletion. + string reason = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// ListResourceAllowances Request. +message ListResourceAllowancesRequest { + // Required. Parent path. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "batch.googleapis.com/ResourceAllowance" + } + ]; + + // Optional. Page size. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// ListResourceAllowances Response. +message ListResourceAllowancesResponse { + // ResourceAllowances. + repeated ResourceAllowance resource_allowances = 1; + + // Next page token. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// UpdateResourceAllowance Request. +message UpdateResourceAllowanceRequest { + // Required. The ResourceAllowance to update. + // Update description. + // Only fields specified in `update_mask` are updated. + ResourceAllowance resource_allowance = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Mask of fields to update. + // + // Field mask is used to specify the fields to be overwritten in the + // ResourceAllowance resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + // + // UpdateResourceAllowance request now only supports update on `limit` field. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have + // [google.longrunning.Operation.error][google.longrunning.Operation.error] + // value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/job.proto b/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/job.proto new file mode 100644 index 00000000000..8ab62c01f9a --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/job.proto @@ -0,0 +1,802 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.batch.v1alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/batch/v1alpha/task.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Batch.V1Alpha"; +option go_package = "cloud.google.com/go/batch/apiv1alpha/batchpb;batchpb"; +option java_multiple_files = true; +option java_outer_classname = "JobProto"; +option java_package = "com.google.cloud.batch.v1alpha"; +option objc_class_prefix = "GCB"; +option php_namespace = "Google\\Cloud\\Batch\\V1alpha"; +option ruby_package = "Google::Cloud::Batch::V1alpha"; + +// The Cloud Batch Job description. +message Job { + option (google.api.resource) = { + type: "batch.googleapis.com/Job" + pattern: "projects/{project}/locations/{location}/jobs/{job}" + }; + + // The order that TaskGroups are scheduled relative to each other. + // + // Not yet implemented. + enum SchedulingPolicy { + // Unspecified. + SCHEDULING_POLICY_UNSPECIFIED = 0; + + // Run all TaskGroups as soon as possible. + AS_SOON_AS_POSSIBLE = 1; + } + + // Output only. Job name. + // For example: "projects/123456/locations/us-central1/jobs/job01". + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A system generated unique ID for the Job. + string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Priority of the Job. + // The valid value range is [0, 100). Default value is 0. + // Higher value indicates higher priority. + // A job with higher priority value is more likely to run earlier if all other + // requirements are satisfied. + int64 priority = 3; + + // Required. TaskGroups in the Job. Only one TaskGroup is supported now. + repeated TaskGroup task_groups = 4 [(google.api.field_behavior) = REQUIRED]; + + // Scheduling policy for TaskGroups in the job. + SchedulingPolicy scheduling_policy = 5; + + // At least one of the dependencies must be satisfied before the Job is + // scheduled to run. + // Only one JobDependency is supported now. + // Not yet implemented. + repeated JobDependency dependencies = 6; + + // Compute resource allocation for all TaskGroups in the Job. + AllocationPolicy allocation_policy = 7; + + // Custom labels to apply to the job and any Cloud Logging + // [LogEntry](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry) + // that it generates. + // + // Use labels to group and describe the resources they are applied to. Batch + // automatically applies predefined labels and supports multiple `labels` + // fields for each job, which each let you apply custom labels to various + // resources. Label names that start with "goog-" or "google-" are + // reserved for predefined labels. For more information about labels with + // Batch, see + // [Organize resources using + // labels](https://cloud.google.com/batch/docs/organize-resources-using-labels). + map labels = 8; + + // Output only. Job status. It is read only for users. + JobStatus status = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Deprecated: please use notifications instead. + JobNotification notification = 10 [deprecated = true]; + + // Output only. When the Job was created. + google.protobuf.Timestamp create_time = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last time the Job was updated. + google.protobuf.Timestamp update_time = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Log preservation policy for the Job. + LogsPolicy logs_policy = 13; + + // Notification configurations. + repeated JobNotification notifications = 14; +} + +// LogsPolicy describes if and how a job's logs are preserved. Logs include +// information that is automatically written by the Batch service agent and any +// information that you configured the job's runnables to write to the `stdout` +// or `stderr` streams. +message LogsPolicy { + // `CloudLoggingOption` contains additional settings for Cloud Logging logs + // generated by Batch job. + message CloudLoggingOption { + // Optional. Set this field to `true` to change the [monitored resource + // type](https://cloud.google.com/monitoring/api/resources) for + // Cloud Logging logs generated by this Batch job from + // the + // [`batch.googleapis.com/Job`](https://cloud.google.com/monitoring/api/resources#tag_batch.googleapis.com/Job) + // type to the formerly used + // [`generic_task`](https://cloud.google.com/monitoring/api/resources#tag_generic_task) + // type. + bool use_generic_task_monitored_resource = 1 + [(google.api.field_behavior) = OPTIONAL]; + } + + // The destination (if any) for logs. + enum Destination { + // (Default) Logs are not preserved. + DESTINATION_UNSPECIFIED = 0; + + // Logs are streamed to Cloud Logging. Optionally, you can configure + // additional settings in the `cloudLoggingOption` field. + CLOUD_LOGGING = 1; + + // Logs are saved to the file path specified in the `logsPath` field. + PATH = 2; + } + + // If and where logs should be saved. + Destination destination = 1; + + // When `destination` is set to `PATH`, you must set this field to the path + // where you want logs to be saved. This path can point to a local directory + // on the VM or (if congifured) a directory under the mount path of any + // Cloud Storage bucket, network file system (NFS), or writable persistent + // disk that is mounted to the job. For example, if the job has a bucket with + // `mountPath` set to `/mnt/disks/my-bucket`, you can write logs to the + // root directory of the `remotePath` of that bucket by setting this field to + // `/mnt/disks/my-bucket/`. + string logs_path = 2; + + // Optional. When `destination` is set to `CLOUD_LOGGING`, you can optionally + // set this field to configure additional settings for Cloud Logging. + CloudLoggingOption cloud_logging_option = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// JobDependency describes the state of other Jobs that the start of this Job +// depends on. +// All dependent Jobs must have been submitted in the same region. +message JobDependency { + // Dependency type. + enum Type { + // Unspecified. + TYPE_UNSPECIFIED = 0; + + // The dependent Job has succeeded. + SUCCEEDED = 1; + + // The dependent Job has failed. + FAILED = 2; + + // SUCCEEDED or FAILED. + FINISHED = 3; + } + + // Each item maps a Job name to a Type. + // All items must be satisfied for the JobDependency to be satisfied (the AND + // operation). + // Once a condition for one item becomes true, it won't go back to false + // even the dependent Job state changes again. + map items = 1; +} + +// Job status. +message JobStatus { + // VM instance status. + message InstanceStatus { + // The Compute Engine machine type. + string machine_type = 1; + + // The VM instance provisioning model. + AllocationPolicy.ProvisioningModel provisioning_model = 2; + + // The max number of tasks can be assigned to this instance type. + int64 task_pack = 3; + + // The VM boot disk. + AllocationPolicy.Disk boot_disk = 4; + } + + // Aggregated task status for a TaskGroup. + message TaskGroupStatus { + // Count of task in each state in the TaskGroup. + // The map key is task state name. + map counts = 1; + + // Status of instances allocated for the TaskGroup. + repeated InstanceStatus instances = 2; + } + + // Valid Job states. + enum State { + // Job state unspecified. + STATE_UNSPECIFIED = 0; + + // Job is admitted (validated and persisted) and waiting for resources. + QUEUED = 1; + + // Job is scheduled to run as soon as resource allocation is ready. + // The resource allocation may happen at a later time but with a high + // chance to succeed. + SCHEDULED = 2; + + // Resource allocation has been successful. At least one Task in the Job is + // RUNNING. + RUNNING = 3; + + // All Tasks in the Job have finished successfully. + SUCCEEDED = 4; + + // At least one Task in the Job has failed. + FAILED = 5; + + // The Job will be deleted, but has not been deleted yet. Typically this is + // because resources used by the Job are still being cleaned up. + DELETION_IN_PROGRESS = 6; + + // The Job cancellation is in progress, this is because the resources used + // by the Job are still being cleaned up. + CANCELLATION_IN_PROGRESS = 7; + + // The Job has been cancelled, the task executions were stopped and the + // resources were cleaned up. + CANCELLED = 8; + } + + // Job state + State state = 1; + + // Job status events + repeated StatusEvent status_events = 2; + + // Aggregated task status for each TaskGroup in the Job. + // The map key is TaskGroup ID. + map task_groups = 4; + + // The duration of time that the Job spent in status RUNNING. + google.protobuf.Duration run_duration = 5; + + // The resource usage of the job. + ResourceUsage resource_usage = 6; +} + +// ResourceUsage describes the resource usage of the job. +message ResourceUsage { + // The CPU core hours that the job consumes. + double core_hours = 1; +} + +// Notification configurations. +message JobNotification { + // Message details. + // Describe the conditions under which messages will be sent. + // If no attribute is defined, no message will be sent by default. + // One message should specify either the job or the task level attributes, + // but not both. For example, + // job level: JOB_STATE_CHANGED and/or a specified new_job_state; + // task level: TASK_STATE_CHANGED and/or a specified new_task_state. + message Message { + // The message type. + Type type = 1; + + // The new job state. + JobStatus.State new_job_state = 2; + + // The new task state. + TaskStatus.State new_task_state = 3; + } + + // The message type. + enum Type { + // Unspecified. + TYPE_UNSPECIFIED = 0; + + // Notify users that the job state has changed. + JOB_STATE_CHANGED = 1; + + // Notify users that the task state has changed. + TASK_STATE_CHANGED = 2; + } + + // The Pub/Sub topic where notifications for the job, like state + // changes, will be published. If undefined, no Pub/Sub notifications + // are sent for this job. + // + // Specify the topic using the following format: + // `projects/{project}/topics/{topic}`. + // Notably, if you want to specify a Pub/Sub topic that is in a + // different project than the job, your administrator must grant your + // project's Batch service agent permission to publish to that topic. + // + // For more information about configuring Pub/Sub notifications for + // a job, see + // https://cloud.google.com/batch/docs/enable-notifications. + string pubsub_topic = 1; + + // The attribute requirements of messages to be sent to this Pub/Sub topic. + // Without this field, no message will be sent. + Message message = 2; +} + +// A Job's resource allocation policy describes when, where, and how compute +// resources should be allocated for the Job. +message AllocationPolicy { + message LocationPolicy { + // A list of allowed location names represented by internal URLs. + // + // Each location can be a region or a zone. + // Only one region or multiple zones in one region is supported now. + // For example, + // ["regions/us-central1"] allow VMs in any zones in region us-central1. + // ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs + // in zones us-central1-a and us-central1-c. + // + // Mixing locations from different regions would cause errors. + // For example, + // ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b", + // "zones/us-west1-a"] contains locations from two distinct regions: + // us-central1 and us-west1. This combination will trigger an error. + repeated string allowed_locations = 1; + + // A list of denied location names. + // + // Not yet implemented. + repeated string denied_locations = 2; + } + + // A new persistent disk or a local ssd. + // A VM can only have one local SSD setting but multiple local SSD partitions. + // See https://cloud.google.com/compute/docs/disks#pdspecs and + // https://cloud.google.com/compute/docs/disks#localssds. + message Disk { + // A data source from which a PD will be created. + oneof data_source { + // URL for a VM image to use as the data source for this disk. + // For example, the following are all valid URLs: + // + // * Specify the image by its family name: + // projects/{project}/global/images/family/{image_family} + // * Specify the image version: + // projects/{project}/global/images/{image_version} + // + // You can also use Batch customized image in short names. + // The following image values are supported for a boot disk: + // + // * `batch-debian`: use Batch Debian images. + // * `batch-cos`: use Batch Container-Optimized images. + // * `batch-hpc-rocky`: use Batch HPC Rocky Linux images. + string image = 4; + + // Name of a snapshot used as the data source. + // Snapshot is not supported as boot disk now. + string snapshot = 5; + } + + // Disk type as shown in `gcloud compute disk-types list`. + // For example, local SSD uses type "local-ssd". + // Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd" + // or "pd-standard". If not specified, "pd-standard" will be used as the + // default type for non-boot disks, "pd-balanced" will be used as the + // default type for boot disks. + string type = 1; + + // Disk size in GB. + // + // **Non-Boot Disk**: + // If the `type` specifies a persistent disk, this field + // is ignored if `data_source` is set as `image` or `snapshot`. + // If the `type` specifies a local SSD, this field should be a multiple of + // 375 GB, otherwise, the final size will be the next greater multiple of + // 375 GB. + // + // **Boot Disk**: + // Batch will calculate the boot disk size based on source + // image and task requirements if you do not speicify the size. + // If both this field and the `boot_disk_mib` field in task spec's + // `compute_resource` are defined, Batch will only honor this field. + // Also, this field should be no smaller than the source disk's + // size when the `data_source` is set as `snapshot` or `image`. + // For example, if you set an image as the `data_source` field and the + // image's default disk size 30 GB, you can only use this field to make the + // disk larger or equal to 30 GB. + int64 size_gb = 2; + + // Local SSDs are available through both "SCSI" and "NVMe" interfaces. + // If not indicated, "NVMe" will be the default one for local ssds. + // This field is ignored for persistent disks as the interface is chosen + // automatically. See + // https://cloud.google.com/compute/docs/disks/persistent-disks#choose_an_interface. + string disk_interface = 6; + } + + // A new or an existing persistent disk (PD) or a local ssd attached to a VM + // instance. + message AttachedDisk { + oneof attached { + Disk new_disk = 1; + + // Name of an existing PD. + string existing_disk = 2; + } + + // Device name that the guest operating system will see. + // It is used by Runnable.volumes field to mount disks. So please specify + // the device_name if you want Batch to help mount the disk, and it should + // match the device_name field in volumes. + string device_name = 3; + } + + // Accelerator describes Compute Engine accelerators to be attached to the VM. + message Accelerator { + // The accelerator type. For example, "nvidia-tesla-t4". + // See `gcloud compute accelerator-types list`. + string type = 1; + + // The number of accelerators of this type. + int64 count = 2; + + // Deprecated: please use instances[0].install_gpu_drivers instead. + bool install_gpu_drivers = 3 [deprecated = true]; + + // Optional. The NVIDIA GPU driver version that should be installed for this + // type. + // + // You can define the specific driver version such as "470.103.01", + // following the driver version requirements in + // https://cloud.google.com/compute/docs/gpus/install-drivers-gpu#minimum-driver. + // Batch will install the specific accelerator driver if qualified. + string driver_version = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // InstancePolicy describes an instance type and resources attached to each VM + // created by this InstancePolicy. + message InstancePolicy { + // Deprecated: please use machine_type instead. + repeated string allowed_machine_types = 1 [deprecated = true]; + + // The Compute Engine machine type. + string machine_type = 2; + + // The minimum CPU platform. + // See + // https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. + string min_cpu_platform = 3; + + // The provisioning model. + ProvisioningModel provisioning_model = 4; + + // The accelerators attached to each VM instance. + repeated Accelerator accelerators = 5; + + // Boot disk to be created and attached to each VM by this InstancePolicy. + // Boot disk will be deleted when the VM is deleted. + // Batch API now only supports booting from image. + Disk boot_disk = 8; + + // Non-boot disks to be attached for each VM created by this InstancePolicy. + // New disks will be deleted when the VM is deleted. + // A non-boot disk is a disk that can be of a device with a + // file system or a raw storage drive that is not ready for data + // storage and accessing. + repeated AttachedDisk disks = 6; + + // Optional. If not specified (default), VMs will consume any applicable + // reservation. If "NO_RESERVATION" is specified, VMs will not consume any + // reservation. Otherwise, if specified, VMs will consume only the specified + // reservation. + string reservation = 7 [(google.api.field_behavior) = OPTIONAL]; + } + + // InstancePolicyOrTemplate lets you define the type of resources to use for + // this job either with an InstancePolicy or an instance template. + // If undefined, Batch picks the type of VM to use and doesn't include + // optional VM resources such as GPUs and extra disks. + message InstancePolicyOrTemplate { + oneof policy_template { + // InstancePolicy. + InstancePolicy policy = 1; + + // Name of an instance template used to create VMs. + // Named the field as 'instance_template' instead of 'template' to avoid + // C++ keyword conflict. + // + // Batch only supports global instance templates from the same project as + // the job. + // You can specify the global instance template as a full or partial URL. + string instance_template = 2; + } + + // Set this field true if you want Batch to help fetch drivers from a third + // party location and install them for GPUs specified in + // `policy.accelerators` or `instance_template` on your behalf. Default is + // false. + // + // For Container-Optimized Image cases, Batch will install the + // accelerator driver following milestones of + // https://cloud.google.com/container-optimized-os/docs/release-notes. For + // non Container-Optimized Image cases, following + // https://github.com/GoogleCloudPlatform/compute-gpu-installation/blob/main/linux/install_gpu_driver.py. + bool install_gpu_drivers = 3; + + // Optional. Set this field true if you want Batch to install Ops Agent on + // your behalf. Default is false. + bool install_ops_agent = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Set this field to `true` if you want Batch to block + // project-level SSH keys from accessing this job's VMs. Alternatively, you + // can configure the job to specify a VM instance template that blocks + // project-level SSH keys. In either case, Batch blocks project-level SSH + // keys while creating the VMs for this job. + // + // Batch allows project-level SSH keys for a job's VMs only if all + // the following are true: + // + // + This field is undefined or set to `false`. + // + The job's VM instance template (if any) doesn't block project-level + // SSH keys. + // + // Notably, you can override this behavior by manually updating a VM to + // block or allow project-level SSH keys. For more information about + // blocking project-level SSH keys, see the Compute Engine documentation: + // https://cloud.google.com/compute/docs/connect/restrict-ssh-keys#block-keys + bool block_project_ssh_keys = 5 [(google.api.field_behavior) = OPTIONAL]; + } + + // A network interface. + message NetworkInterface { + // The URL of an existing network resource. + // You can specify the network as a full or partial URL. + // + // For example, the following are all valid URLs: + // + // * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network} + // * projects/{project}/global/networks/{network} + // * global/networks/{network} + string network = 1; + + // The URL of an existing subnetwork resource in the network. + // You can specify the subnetwork as a full or partial URL. + // + // For example, the following are all valid URLs: + // + // * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork} + // * projects/{project}/regions/{region}/subnetworks/{subnetwork} + // * regions/{region}/subnetworks/{subnetwork} + string subnetwork = 2; + + // Default is false (with an external IP address). Required if + // no external public IP address is attached to the VM. If no external + // public IP address, additional configuration is required to allow the VM + // to access Google Services. See + // https://cloud.google.com/vpc/docs/configure-private-google-access and + // https://cloud.google.com/nat/docs/gce-example#create-nat for more + // information. + bool no_external_ip_address = 3; + } + + // NetworkPolicy describes VM instance network configurations. + message NetworkPolicy { + // Network configurations. + repeated NetworkInterface network_interfaces = 1; + } + + // PlacementPolicy describes a group placement policy for the VMs controlled + // by this AllocationPolicy. + message PlacementPolicy { + // UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you + // want VMs to be located close to each other for low network latency + // between the VMs. No placement policy will be generated when collocation + // is UNSPECIFIED. + string collocation = 1; + + // When specified, causes the job to fail if more than max_distance logical + // switches are required between VMs. Batch uses the most compact possible + // placement of VMs even when max_distance is not specified. An explicit + // max_distance makes that level of compactness a strict requirement. + // Not yet implemented + int64 max_distance = 2; + } + + // Compute Engine VM instance provisioning model. + enum ProvisioningModel { + // Unspecified. + PROVISIONING_MODEL_UNSPECIFIED = 0; + + // Standard VM. + STANDARD = 1; + + // SPOT VM. + SPOT = 2; + + // Preemptible VM (PVM). + // + // Above SPOT VM is the preferable model for preemptible VM instances: the + // old preemptible VM model (indicated by this field) is the older model, + // and has been migrated to use the SPOT model as the underlying technology. + // This old model will still be supported. + PREEMPTIBLE = 3; + } + + // Location where compute resources should be allocated for the Job. + LocationPolicy location = 1; + + // Deprecated: please use instances[0].policy instead. + InstancePolicy instance = 2 [deprecated = true]; + + // Describe instances that can be created by this AllocationPolicy. + // Only instances[0] is supported now. + repeated InstancePolicyOrTemplate instances = 8; + + // Deprecated: please use instances[0].template instead. + repeated string instance_templates = 3 [deprecated = true]; + + // Deprecated: please use instances[0].policy.provisioning_model instead. + repeated ProvisioningModel provisioning_models = 4 [deprecated = true]; + + // Deprecated: please use service_account instead. + string service_account_email = 5 [deprecated = true]; + + // Defines the service account for Batch-created VMs. If omitted, the [default + // Compute Engine service + // account](https://cloud.google.com/compute/docs/access/service-accounts#default_service_account) + // is used. Must match the service account specified in any used instance + // template configured in the Batch job. + // + // Includes the following fields: + // * email: The service account's email address. If not set, the default + // Compute Engine service account is used. + // * scopes: Additional OAuth scopes to grant the service account, beyond the + // default cloud-platform scope. (list of strings) + ServiceAccount service_account = 9; + + // Custom labels to apply to the job and all the Compute Engine resources + // that both are created by this allocation policy and support labels. + // + // Use labels to group and describe the resources they are applied to. Batch + // automatically applies predefined labels and supports multiple `labels` + // fields for each job, which each let you apply custom labels to various + // resources. Label names that start with "goog-" or "google-" are + // reserved for predefined labels. For more information about labels with + // Batch, see + // [Organize resources using + // labels](https://cloud.google.com/batch/docs/organize-resources-using-labels). + map labels = 6; + + // The network policy. + // + // If you define an instance template in the `InstancePolicyOrTemplate` field, + // Batch will use the network settings in the instance template instead of + // this field. + NetworkPolicy network = 7; + + // The placement policy. + PlacementPolicy placement = 10; + + // Optional. Tags applied to the VM instances. + // + // The tags identify valid sources or targets for network firewalls. + // Each tag must be 1-63 characters long, and comply with + // [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). + repeated string tags = 11 [(google.api.field_behavior) = OPTIONAL]; +} + +// A TaskGroup defines one or more Tasks that all share the same TaskSpec. +message TaskGroup { + option (google.api.resource) = { + type: "batch.googleapis.com/TaskGroup" + pattern: "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + }; + + // How Tasks in the TaskGroup should be scheduled relative to each other. + enum SchedulingPolicy { + // Unspecified. + SCHEDULING_POLICY_UNSPECIFIED = 0; + + // Run Tasks as soon as resources are available. + // + // Tasks might be executed in parallel depending on parallelism and + // task_count values. + AS_SOON_AS_POSSIBLE = 1; + + // Run Tasks sequentially with increased task index. + IN_ORDER = 2; + } + + // Output only. TaskGroup name. + // The system generates this field based on parent Job name. + // For example: + // "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01". + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Tasks in the group share the same task spec. + TaskSpec task_spec = 3 [(google.api.field_behavior) = REQUIRED]; + + // Number of Tasks in the TaskGroup. + // Default is 1. + int64 task_count = 4; + + // Max number of tasks that can run in parallel. + // Default to min(task_count, parallel tasks per job limit). + // See: [Job Limits](https://cloud.google.com/batch/quotas#job_limits). + // Field parallelism must be 1 if the scheduling_policy is IN_ORDER. + int64 parallelism = 5; + + // Scheduling policy for Tasks in the TaskGroup. + // The default value is AS_SOON_AS_POSSIBLE. + SchedulingPolicy scheduling_policy = 6; + + // Compute resource allocation for the TaskGroup. + // If specified, it overrides resources in Job. + AllocationPolicy allocation_policy = 7; + + // Labels for the TaskGroup. + // Labels could be user provided or system generated. + // You can assign up to 64 labels. [Google Compute Engine label + // restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions) + // apply. + // Label names that start with "goog-" or "google-" are reserved. + map labels = 8; + + // An array of environment variable mappings, which are passed to Tasks with + // matching indices. If task_environments is used then task_count should + // not be specified in the request (and will be ignored). Task count will be + // the length of task_environments. + // + // Tasks get a BATCH_TASK_INDEX and BATCH_TASK_COUNT environment variable, in + // addition to any environment variables set in task_environments, specifying + // the number of Tasks in the Task's parent TaskGroup, and the specific Task's + // index in the TaskGroup (0 through BATCH_TASK_COUNT - 1). + repeated Environment task_environments = 9; + + // Max number of tasks that can be run on a VM at the same time. + // If not specified, the system will decide a value based on available + // compute resources on a VM and task requirements. + int64 task_count_per_node = 10; + + // When true, Batch will populate a file with a list of all VMs assigned to + // the TaskGroup and set the BATCH_HOSTS_FILE environment variable to the path + // of that file. Defaults to false. The host file supports up to 1000 VMs. + bool require_hosts_file = 11; + + // When true, Batch will configure SSH to allow passwordless login between + // VMs running the Batch tasks in the same TaskGroup. + bool permissive_ssh = 12; + + // Optional. If not set or set to false, Batch uses the root user to execute + // runnables. If set to true, Batch runs the runnables using a non-root user. + // Currently, the non-root user Batch used is generated by OS Login. For more + // information, see [About OS + // Login](https://cloud.google.com/compute/docs/oslogin). + bool run_as_non_root = 14 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. ServiceAccount used by tasks within the task group for the access + // to other Cloud resources. This allows tasks to operate with permissions + // distinct from the service account for the VM set at `AllocationPolicy`. Use + // this field when tasks require different access rights than those of the VM. + // + // Specify the service account's `email` field. Ensure `scopes` + // include any necessary permissions for tasks, in addition to the default + // 'cloud-platform' scope. + ServiceAccount service_account = 15 [(google.api.field_behavior) = OPTIONAL]; +} + +// Carries information about a Google Cloud service account. +message ServiceAccount { + // Email address of the service account. + string email = 1; + + // List of scopes to be enabled for this service account. + repeated string scopes = 2; +} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/notification.proto b/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/notification.proto new file mode 100644 index 00000000000..6eedfc615c5 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/notification.proto @@ -0,0 +1,38 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.batch.v1alpha; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.Batch.V1Alpha"; +option go_package = "cloud.google.com/go/batch/apiv1alpha/batchpb;batchpb"; +option java_multiple_files = true; +option java_outer_classname = "NotificationProto"; +option java_package = "com.google.cloud.batch.v1alpha"; +option objc_class_prefix = "GCB"; +option php_namespace = "Google\\Cloud\\Batch\\V1alpha"; +option ruby_package = "Google::Cloud::Batch::V1alpha"; + +// Notification on resource state change. +message Notification { + // Required. The Pub/Sub topic where notifications like the resource allowance + // state changes will be published. The topic must exist in the same project + // as the job and billings will be charged to this project. If not specified, + // no Pub/Sub messages will be sent. Topic format: + // `projects/{project}/topics/{topic}`. + string pubsub_topic = 1 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/resource_allowance.proto b/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/resource_allowance.proto new file mode 100644 index 00000000000..988271f5802 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/resource_allowance.proto @@ -0,0 +1,208 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.batch.v1alpha; + +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/cloud/batch/v1alpha/notification.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/interval.proto"; + +option csharp_namespace = "Google.Cloud.Batch.V1Alpha"; +option go_package = "cloud.google.com/go/batch/apiv1alpha/batchpb;batchpb"; +option java_multiple_files = true; +option java_outer_classname = "ResourceAllowanceProto"; +option java_package = "com.google.cloud.batch.v1alpha"; +option objc_class_prefix = "GCB"; +option php_namespace = "Google\\Cloud\\Batch\\V1alpha"; +option ruby_package = "Google::Cloud::Batch::V1alpha"; + +// A `CalendarPeriod` represents the abstract concept of a time period that +// has a canonical start. All calendar times begin at 12 AM US and Canadian +// Pacific Time (UTC-8). +enum CalendarPeriod { + // Unspecified. + CALENDAR_PERIOD_UNSPECIFIED = 0; + + // The month starts on the first date of the month and resets at the beginning + // of each month. + MONTH = 1; + + // The quarter starts on dates January 1, April 1, July 1, and October 1 of + // each year and resets at the beginning of the next quarter. + QUARTER = 2; + + // The year starts on January 1 and resets at the beginning of the next year. + YEAR = 3; + + // The week period starts and resets every Monday. + WEEK = 4; + + // The day starts at 12:00am. + DAY = 5; +} + +// ResourceAllowance valid state. +enum ResourceAllowanceState { + // Unspecified. + RESOURCE_ALLOWANCE_STATE_UNSPECIFIED = 0; + + // ResourceAllowance is active and in use. + RESOURCE_ALLOWANCE_ACTIVE = 1; + + // ResourceAllowance limit is reached. + RESOURCE_ALLOWANCE_DEPLETED = 2; +} + +// The Resource Allowance description for Cloud Batch. +// Only one Resource Allowance is supported now under a specific location and +// project. +message ResourceAllowance { + option (google.api.resource) = { + type: "batch.googleapis.com/ResourceAllowance" + pattern: "projects/{project}/locations/{location}/resourceAllowances/{resource_allowance}" + plural: "resourceAllowances" + singular: "resourceAllowance" + }; + + // ResourceAllowance detail. + oneof resource_allowance { + // The detail of usage resource allowance. + UsageResourceAllowance usage_resource_allowance = 4; + } + + // Identifier. ResourceAllowance name. + // For example: + // "projects/123456/locations/us-central1/resourceAllowances/resource-allowance-1". + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. A system generated unique ID (in UUID4 format) for the + // ResourceAllowance. + string uid = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Output only. Time when the ResourceAllowance was created. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Labels are attributes that can be set and used by both the + // user and by Batch. Labels must meet the following constraints: + // + // * Keys and values can contain only lowercase letters, numeric characters, + // underscores, and dashes. + // * All characters must use UTF-8 encoding, and international characters are + // allowed. + // * Keys must start with a lowercase letter or international character. + // * Each resource is limited to a maximum of 64 labels. + // + // Both keys and values are additionally constrained to be <= 128 bytes. + map labels = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Notification configurations. + repeated Notification notifications = 6 + [(google.api.field_behavior) = OPTIONAL]; +} + +// UsageResourceAllowance describes the detail of usage resource allowance. +message UsageResourceAllowance { + // Required. Spec of a usage ResourceAllowance. + UsageResourceAllowanceSpec spec = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Status of a usage ResourceAllowance. + UsageResourceAllowanceStatus status = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Spec of a usage ResourceAllowance. +message UsageResourceAllowanceSpec { + // UsageResourceAllowance limitation. + message Limit { + oneof duration { + // Optional. A CalendarPeriod represents the abstract concept of a time + // period that has a canonical start. + CalendarPeriod calendar_period = 1 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. Limit value of a UsageResourceAllowance within its one + // duration. + // + // Limit cannot be a negative value. Default is 0. + // For example, you can set `limit` as 10000.0 with duration of the current + // month by setting `calendar_period` field as monthly. That means in your + // current month, 10000.0 is the core hour limitation that your resources + // are allowed to consume. + optional double limit = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. Spec type is unique for each usage ResourceAllowance. + // Batch now only supports type as "cpu-core-hours" for CPU usage consumption + // tracking. + string type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Threshold of a UsageResourceAllowance limiting how many resources + // can be consumed for each type. + Limit limit = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Status of a usage ResourceAllowance. +message UsageResourceAllowanceStatus { + // UsageResourceAllowanceStatus detail about usage consumption. + message LimitStatus { + // Output only. The consumption interval. + google.type.Interval consumption_interval = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Limit value of a UsageResourceAllowance within its one + // duration. + optional double limit = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Accumulated consumption during `consumption_interval`. + optional double consumed = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + message PeriodConsumption { + // Output only. The consumption interval. + google.type.Interval consumption_interval = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Accumulated consumption during `consumption_interval`. + optional double consumed = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // ConsumptionReport is the report of ResourceAllowance consumptions in a time + // period. + message ConsumptionReport { + // Output only. ResourceAllowance consumptions in the latest calendar + // period. Key is the calendar period in string format. Batch currently + // supports HOUR, DAY, MONTH and YEAR. + map latest_period_consumptions = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. ResourceAllowance state. + ResourceAllowanceState state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. ResourceAllowance consumption status for usage resources. + LimitStatus limit_status = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The report of ResourceAllowance consumptions in a time period. + ConsumptionReport report = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/task.proto b/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/task.proto new file mode 100644 index 00000000000..08a20f499dd --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/task.proto @@ -0,0 +1,494 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.batch.v1alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/batch/v1alpha/volume.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Batch.V1Alpha"; +option go_package = "cloud.google.com/go/batch/apiv1alpha/batchpb;batchpb"; +option java_multiple_files = true; +option java_outer_classname = "TaskProto"; +option java_package = "com.google.cloud.batch.v1alpha"; +option objc_class_prefix = "GCB"; +option php_namespace = "Google\\Cloud\\Batch\\V1alpha"; +option ruby_package = "Google::Cloud::Batch::V1alpha"; + +// Compute resource requirements. +// +// ComputeResource defines the amount of resources required for each task. +// Make sure your tasks have enough resources to successfully run. +// If you also define the types of resources for a job to use with the +// [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) +// field, make sure both fields are compatible with each other. +message ComputeResource { + // The milliCPU count. + // + // `cpuMilli` defines the amount of CPU resources per task in milliCPU units. + // For example, `1000` corresponds to 1 vCPU per task. If undefined, the + // default value is `2000`. + // + // If you also define the VM's machine type using the `machineType` in + // [InstancePolicy](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicy) + // field or inside the `instanceTemplate` in the + // [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) + // field, make sure the CPU resources for both fields are compatible with each + // other and with how many tasks you want to allow to run on the same VM at + // the same time. + // + // For example, if you specify the `n2-standard-2` machine type, which has 2 + // vCPUs each, you are recommended to set `cpuMilli` no more than `2000`, or + // you are recommended to run two tasks on the same VM if you set `cpuMilli` + // to `1000` or less. + int64 cpu_milli = 1; + + // Memory in MiB. + // + // `memoryMib` defines the amount of memory per task in MiB units. + // If undefined, the default value is `2000`. + // If you also define the VM's machine type using the `machineType` in + // [InstancePolicy](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicy) + // field or inside the `instanceTemplate` in the + // [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) + // field, make sure the memory resources for both fields are compatible with + // each other and with how many tasks you want to allow to run on the same VM + // at the same time. + // + // For example, if you specify the `n2-standard-2` machine type, which has 8 + // GiB each, you are recommended to set `memoryMib` to no more than `8192`, + // or you are recommended to run two tasks on the same VM if you set + // `memoryMib` to `4096` or less. + int64 memory_mib = 2; + + // The GPU count. + // + // Not yet implemented. + int64 gpu_count = 3; + + // Extra boot disk size in MiB for each task. + int64 boot_disk_mib = 4; +} + +// Status event. +message StatusEvent { + // Type of the event. + string type = 3; + + // Description of the event. + string description = 1; + + // The time this event occurred. + google.protobuf.Timestamp event_time = 2; + + // Task Execution. + // This field is only defined for task-level status events where the task + // fails. + TaskExecution task_execution = 4; + + // Task State. + // This field is only defined for task-level status events. + TaskStatus.State task_state = 5; +} + +// This Task Execution field includes detail information for +// task execution procedures, based on StatusEvent types. +message TaskExecution { + // The exit code of a finished task. + // + // If the task succeeded, the exit code will be 0. If the task failed but not + // due to the following reasons, the exit code will be 50000. + // + // Otherwise, it can be from different sources: + // * Batch known failures: + // https://cloud.google.com/batch/docs/troubleshooting#reserved-exit-codes. + // * Batch runnable execution failures; you can rely on Batch logs to further + // diagnose: https://cloud.google.com/batch/docs/analyze-job-using-logs. If + // there are multiple runnables failures, Batch only exposes the first error. + int32 exit_code = 1; + + // Optional. The tail end of any content written to standard error by the task + // execution. This field will be populated only when the execution failed. + string stderr_snippet = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Status of a task. +message TaskStatus { + // Task states. + enum State { + // Unknown state. + STATE_UNSPECIFIED = 0; + + // The Task is created and waiting for resources. + PENDING = 1; + + // The Task is assigned to at least one VM. + ASSIGNED = 2; + + // The Task is running. + RUNNING = 3; + + // The Task has failed. + FAILED = 4; + + // The Task has succeeded. + SUCCEEDED = 5; + + // The Task has not been executed when the Job finishes. + UNEXECUTED = 6; + } + + // Task state. + State state = 1; + + // Detailed info about why the state is reached. + repeated StatusEvent status_events = 2; + + // The resource usage of the task. + TaskResourceUsage resource_usage = 3; +} + +// TaskResourceUsage describes the resource usage of the task. +message TaskResourceUsage { + // The CPU core hours the task consumes based on task requirement and run + // time. + double core_hours = 1; +} + +// Runnable describes instructions for executing a specific script or container +// as part of a Task. +message Runnable { + // Container runnable. + message Container { + // Required. The URI to pull the container image from. + string image_uri = 1; + + // Required for some container images. Overrides the `CMD` specified in the + // container. If there is an `ENTRYPOINT` (either in the container image or + // with the `entrypoint` field below) then these commands are appended as + // arguments to the `ENTRYPOINT`. + repeated string commands = 2; + + // Required for some container images. Overrides the `ENTRYPOINT` specified + // in the container. + string entrypoint = 3; + + // Volumes to mount (bind mount) from the host machine files or directories + // into the container, formatted to match `--volume` option for the + // `docker run` command—for example, `/foo:/bar` or `/foo:/bar:ro`. + // + // If the `TaskSpec.Volumes` field is specified but this field is not, Batch + // will mount each volume from the host machine to the container with the + // same mount path by default. In this case, the default mount option for + // containers will be read-only (`ro`) for existing persistent disks and + // read-write (`rw`) for other volume types, regardless of the original + // mount options specified in `TaskSpec.Volumes`. If you need different + // mount settings, you can explicitly configure them in this field. + repeated string volumes = 7; + + // Required for some container images. Arbitrary additional options to + // include in the `docker run` command when running this container—for + // example, `--network host`. For the `--volume` option, use the `volumes` + // field for the container. + string options = 8; + + // If set to true, external network access to and from container will be + // blocked, containers that are with block_external_network as true can + // still communicate with each other, network cannot be specified in the + // `container.options` field. + bool block_external_network = 9; + + // Required if the container image is from a private Docker registry. The + // username to login to the Docker registry that contains the image. + // + // You can either specify the username directly by using plain text or + // specify an encrypted username by using a Secret Manager secret: + // `projects/*/secrets/*/versions/*`. However, using a secret is + // recommended for enhanced security. + // + // Caution: If you specify the username using plain text, you risk the + // username being exposed to any users who can view the job or its logs. + // To avoid this risk, specify a secret that contains the username instead. + // + // Learn more about [Secret + // Manager](https://cloud.google.com/secret-manager/docs/) and [using + // Secret Manager with + // Batch](https://cloud.google.com/batch/docs/create-run-job-secret-manager). + string username = 10; + + // Required if the container image is from a private Docker registry. The + // password to login to the Docker registry that contains the image. + // + // For security, it is strongly recommended to specify an + // encrypted password by using a Secret Manager secret: + // `projects/*/secrets/*/versions/*`. + // + // Warning: If you specify the password using plain text, you risk the + // password being exposed to any users who can view the job or its logs. + // To avoid this risk, specify a secret that contains the password instead. + // + // Learn more about [Secret + // Manager](https://cloud.google.com/secret-manager/docs/) and [using + // Secret Manager with + // Batch](https://cloud.google.com/batch/docs/create-run-job-secret-manager). + string password = 11; + + // Optional. If set to true, this container runnable uses Image streaming. + // + // Use Image streaming to allow the runnable to initialize without + // waiting for the entire container image to download, which can + // significantly reduce startup time for large container images. + // + // When `enableImageStreaming` is set to true, the container + // runtime is [containerd](https://containerd.io/) instead of Docker. + // Additionally, this container runnable only supports the following + // `container` subfields: `imageUri`, + // `commands[]`, `entrypoint`, and + // `volumes[]`; any other `container` subfields are ignored. + // + // For more information about the requirements and limitations for using + // Image streaming with Batch, see the [`image-streaming` + // sample on + // GitHub](https://github.com/GoogleCloudPlatform/batch-samples/tree/main/api-samples/image-streaming). + bool enable_image_streaming = 12 [(google.api.field_behavior) = OPTIONAL]; + } + + // Script runnable. + message Script { + // Required. The source code for this script runnable. + oneof command { + // The path to a script file that is accessible from the host VM(s). + // + // Unless the script file supports the default `#!/bin/sh` shell + // interpreter, you must specify an interpreter by including a + // [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix) as the + // first line of the file. For example, to execute the script using bash, + // include `#!/bin/bash` as the first line of the file. Alternatively, + // to execute the script using Python3, include `#!/usr/bin/env python3` + // as the first line of the file. + string path = 1; + + // The text for a script. + // + // Unless the script text supports the default `#!/bin/sh` shell + // interpreter, you must specify an interpreter by including a + // [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix) at the + // beginning of the text. For example, to execute the script using bash, + // include `#!/bin/bash\n` at the beginning of the text. Alternatively, + // to execute the script using Python3, include `#!/usr/bin/env python3\n` + // at the beginning of the text. + string text = 2; + } + } + + // A barrier runnable automatically blocks the execution of subsequent + // runnables until all the tasks in the task group reach the barrier. + message Barrier { + // Barriers are identified by their index in runnable list. + // Names are not required, but if present should be an identifier. + string name = 1; + } + + // Required. The script, container, or barrier for this runnable to execute. + oneof executable { + // Container runnable. + Container container = 1; + + // Script runnable. + Script script = 2; + + // Barrier runnable. + Barrier barrier = 6; + } + + // Optional. DisplayName is an optional field that can be provided by the + // caller. If provided, it will be used in logs and other outputs to identify + // the script, making it easier for users to understand the logs. If not + // provided the index of the runnable will be used for outputs. + string display_name = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Normally, a runnable that returns a non-zero exit status fails and causes + // the task to fail. However, you can set this field to `true` to allow the + // task to continue executing its other runnables even if this runnable + // fails. + bool ignore_exit_status = 3; + + // Normally, a runnable that doesn't exit causes its task to fail. However, + // you can set this field to `true` to configure a background runnable. + // Background runnables are allowed continue running in the background while + // the task executes subsequent runnables. For example, background runnables + // are useful for providing services to other runnables or providing + // debugging-support tools like SSH servers. + // + // Specifically, background runnables are killed automatically (if they have + // not already exited) a short time after all foreground runnables have + // completed. Even though this is likely to result in a non-zero exit status + // for the background runnable, these automatic kills are not treated as task + // failures. + bool background = 4; + + // By default, after a Runnable fails, no further Runnable are executed. This + // flag indicates that this Runnable must be run even if the Task has already + // failed. This is useful for Runnables that copy output files off of the VM + // or for debugging. + // + // The always_run flag does not override the Task's overall max_run_duration. + // If the max_run_duration has expired then no further Runnables will execute, + // not even always_run Runnables. + bool always_run = 5; + + // Environment variables for this Runnable (overrides variables set for the + // whole Task or TaskGroup). + Environment environment = 7; + + // Timeout for this Runnable. + google.protobuf.Duration timeout = 8; + + // Labels for this Runnable. + map labels = 9; +} + +// Spec of a task +message TaskSpec { + // Required. The sequence of one or more runnables (executable scripts, + // executable containers, and/or barriers) for each task in this task group to + // run. Each task runs this list of runnables in order. For a task to succeed, + // all of its script and container runnables each must meet at least one of + // the following conditions: + // + // + The runnable exited with a zero status. + // + The runnable didn't finish, but you enabled its `background` subfield. + // + The runnable exited with a non-zero status, but you enabled its + // `ignore_exit_status` subfield. + repeated Runnable runnables = 8; + + // ComputeResource requirements. + ComputeResource compute_resource = 3; + + // Maximum duration the task should run before being automatically retried + // (if enabled) or automatically failed. Format the value of this field + // as a time limit in seconds followed by `s`—for example, `3600s` + // for 1 hour. The field accepts any value between 0 and the maximum listed + // for the `Duration` field type at + // https://protobuf.dev/reference/protobuf/google.protobuf/#duration; however, + // the actual maximum run time for a job will be limited to the maximum run + // time for a job listed at + // https://cloud.google.com/batch/quotas#max-job-duration. + google.protobuf.Duration max_run_duration = 4; + + // Maximum number of retries on failures. + // The default, 0, which means never retry. + // The valid value range is [0, 10]. + int32 max_retry_count = 5; + + // Lifecycle management schema when any task in a task group is failed. + // Currently we only support one lifecycle policy. + // When the lifecycle policy condition is met, + // the action in the policy will execute. + // If task execution result does not meet with the defined lifecycle + // policy, we consider it as the default policy. + // Default policy means if the exit code is 0, exit task. + // If task ends with non-zero exit code, retry the task with max_retry_count. + repeated LifecyclePolicy lifecycle_policies = 9; + + // Deprecated: please use environment(non-plural) instead. + map environments = 6 [deprecated = true]; + + // Volumes to mount before running Tasks using this TaskSpec. + repeated Volume volumes = 7; + + // Environment variables to set before running the Task. + Environment environment = 10; +} + +// LifecyclePolicy describes how to deal with task failures +// based on different conditions. +message LifecyclePolicy { + // Conditions for actions to deal with task failures. + message ActionCondition { + // Exit codes of a task execution. + // If there are more than 1 exit codes, + // when task executes with any of the exit code in the list, + // the condition is met and the action will be executed. + repeated int32 exit_codes = 1; + } + + // Action on task failures based on different conditions. + enum Action { + // Action unspecified. + ACTION_UNSPECIFIED = 0; + + // Action that tasks in the group will be scheduled to re-execute. + RETRY_TASK = 1; + + // Action that tasks in the group will be stopped immediately. + FAIL_TASK = 2; + } + + // Action to execute when ActionCondition is true. + // When RETRY_TASK is specified, we will retry failed tasks + // if we notice any exit code match and fail tasks if no match is found. + // Likewise, when FAIL_TASK is specified, we will fail tasks + // if we notice any exit code match and retry tasks if no match is found. + Action action = 1; + + // Conditions that decide why a task failure is dealt with a specific action. + ActionCondition action_condition = 2; +} + +// A Cloud Batch task. +message Task { + option (google.api.resource) = { + type: "batch.googleapis.com/Task" + pattern: "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}/tasks/{task}" + }; + + // Task name. + // The name is generated from the parent TaskGroup name and 'id' field. + // For example: + // "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01/tasks/task01". + string name = 1; + + // Task Status. + TaskStatus status = 2; +} + +// An Environment describes a collection of environment variables to set when +// executing Tasks. +message Environment { + message KMSEnvMap { + // The name of the KMS key that will be used to decrypt the cipher text. + string key_name = 1; + + // The value of the cipherText response from the `encrypt` method. + string cipher_text = 2; + } + + // A map of environment variable names to values. + map variables = 1; + + // A map of environment variable names to Secret Manager secret names. + // The VM will access the named secrets to set the value of each environment + // variable. + map secret_variables = 2; + + // An encrypted JSON dictionary where the key/value pairs correspond to + // environment variable names and their values. + KMSEnvMap encrypted_variables = 3; +} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/volume.proto b/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/volume.proto new file mode 100644 index 00000000000..9256ef6faa4 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/volume.proto @@ -0,0 +1,98 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.cloud.batch.v1alpha; + +option csharp_namespace = "Google.Cloud.Batch.V1Alpha"; +option go_package = "cloud.google.com/go/batch/apiv1alpha/batchpb;batchpb"; +option java_multiple_files = true; +option java_outer_classname = "VolumeProto"; +option java_package = "com.google.cloud.batch.v1alpha"; +option objc_class_prefix = "GCB"; +option php_namespace = "Google\\Cloud\\Batch\\V1alpha"; +option ruby_package = "Google::Cloud::Batch::V1alpha"; + +// Volume describes a volume and parameters for it to be mounted to a VM. +message Volume { + // The source for the volume. + oneof source { + // A Network File System (NFS) volume. For example, a + // Filestore file share. + NFS nfs = 1; + + // Deprecated: please use device_name instead. + PD pd = 2 [deprecated = true]; + + // A Google Cloud Storage (GCS) volume. + GCS gcs = 3; + + // Device name of an attached disk volume, which should align with a + // device_name specified by + // job.allocation_policy.instances[0].policy.disks[i].device_name or + // defined by the given instance template in + // job.allocation_policy.instances[0].instance_template. + string device_name = 6; + } + + // The mount path for the volume, e.g. /mnt/disks/share. + string mount_path = 4; + + // Mount options vary based on the type of storage volume: + // + // * For a Cloud Storage bucket, all the mount options provided + // by + // the [`gcsfuse` tool](https://cloud.google.com/storage/docs/gcsfuse-cli) + // are supported. + // * For an existing persistent disk, all mount options provided by the + // [`mount` command](https://man7.org/linux/man-pages/man8/mount.8.html) + // except writing are supported. This is due to restrictions of + // [multi-writer + // mode](https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms). + // * For any other disk or a Network File System (NFS), all the + // mount options provided by the `mount` command are supported. + repeated string mount_options = 5; +} + +// Represents an NFS volume. +message NFS { + // The IP address of the NFS. + string server = 1; + + // Remote source path exported from the NFS, e.g., "/share". + string remote_path = 2; +} + +// Deprecated: please use device_name instead. +message PD { + // PD disk name, e.g. pd-1. + string disk = 1; + + // PD device name, e.g. persistent-disk-1. + string device = 2; + + // Whether this is an existing PD. Default is false. If false, i.e., new + // PD, we will format it into ext4 and mount to the given path. If true, i.e., + // existing PD, it should be in ext4 format and we will mount it to the given + // path. + bool existing = 3 [deprecated = true]; +} + +// Represents a Google Cloud Storage volume. +message GCS { + // Remote path, either a bucket name or a subdirectory of a bucket, e.g.: + // bucket_name, bucket_name/subdirectory/ + string remote_path = 1; +} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.d.ts b/owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.d.ts new file mode 100644 index 00000000000..b3108d65ff9 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.d.ts @@ -0,0 +1,16145 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace batch. */ + namespace batch { + + /** Namespace v1alpha. */ + namespace v1alpha { + + /** Represents a BatchService */ + class BatchService extends $protobuf.rpc.Service { + + /** + * Constructs a new BatchService 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 BatchService 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): BatchService; + + /** + * Calls CreateJob. + * @param request CreateJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Job + */ + public createJob(request: google.cloud.batch.v1alpha.ICreateJobRequest, callback: google.cloud.batch.v1alpha.BatchService.CreateJobCallback): void; + + /** + * Calls CreateJob. + * @param request CreateJobRequest message or plain object + * @returns Promise + */ + public createJob(request: google.cloud.batch.v1alpha.ICreateJobRequest): Promise; + + /** + * Calls GetJob. + * @param request GetJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Job + */ + public getJob(request: google.cloud.batch.v1alpha.IGetJobRequest, callback: google.cloud.batch.v1alpha.BatchService.GetJobCallback): void; + + /** + * Calls GetJob. + * @param request GetJobRequest message or plain object + * @returns Promise + */ + public getJob(request: google.cloud.batch.v1alpha.IGetJobRequest): Promise; + + /** + * Calls DeleteJob. + * @param request DeleteJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteJob(request: google.cloud.batch.v1alpha.IDeleteJobRequest, callback: google.cloud.batch.v1alpha.BatchService.DeleteJobCallback): void; + + /** + * Calls DeleteJob. + * @param request DeleteJobRequest message or plain object + * @returns Promise + */ + public deleteJob(request: google.cloud.batch.v1alpha.IDeleteJobRequest): Promise; + + /** + * Calls CancelJob. + * @param request CancelJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public cancelJob(request: google.cloud.batch.v1alpha.ICancelJobRequest, callback: google.cloud.batch.v1alpha.BatchService.CancelJobCallback): void; + + /** + * Calls CancelJob. + * @param request CancelJobRequest message or plain object + * @returns Promise + */ + public cancelJob(request: google.cloud.batch.v1alpha.ICancelJobRequest): Promise; + + /** + * Calls UpdateJob. + * @param request UpdateJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Job + */ + public updateJob(request: google.cloud.batch.v1alpha.IUpdateJobRequest, callback: google.cloud.batch.v1alpha.BatchService.UpdateJobCallback): void; + + /** + * Calls UpdateJob. + * @param request UpdateJobRequest message or plain object + * @returns Promise + */ + public updateJob(request: google.cloud.batch.v1alpha.IUpdateJobRequest): Promise; + + /** + * Calls ListJobs. + * @param request ListJobsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListJobsResponse + */ + public listJobs(request: google.cloud.batch.v1alpha.IListJobsRequest, callback: google.cloud.batch.v1alpha.BatchService.ListJobsCallback): void; + + /** + * Calls ListJobs. + * @param request ListJobsRequest message or plain object + * @returns Promise + */ + public listJobs(request: google.cloud.batch.v1alpha.IListJobsRequest): Promise; + + /** + * Calls GetTask. + * @param request GetTaskRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Task + */ + public getTask(request: google.cloud.batch.v1alpha.IGetTaskRequest, callback: google.cloud.batch.v1alpha.BatchService.GetTaskCallback): void; + + /** + * Calls GetTask. + * @param request GetTaskRequest message or plain object + * @returns Promise + */ + public getTask(request: google.cloud.batch.v1alpha.IGetTaskRequest): Promise; + + /** + * Calls ListTasks. + * @param request ListTasksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTasksResponse + */ + public listTasks(request: google.cloud.batch.v1alpha.IListTasksRequest, callback: google.cloud.batch.v1alpha.BatchService.ListTasksCallback): void; + + /** + * Calls ListTasks. + * @param request ListTasksRequest message or plain object + * @returns Promise + */ + public listTasks(request: google.cloud.batch.v1alpha.IListTasksRequest): Promise; + + /** + * Calls CreateResourceAllowance. + * @param request CreateResourceAllowanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ResourceAllowance + */ + public createResourceAllowance(request: google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest, callback: google.cloud.batch.v1alpha.BatchService.CreateResourceAllowanceCallback): void; + + /** + * Calls CreateResourceAllowance. + * @param request CreateResourceAllowanceRequest message or plain object + * @returns Promise + */ + public createResourceAllowance(request: google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest): Promise; + + /** + * Calls GetResourceAllowance. + * @param request GetResourceAllowanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ResourceAllowance + */ + public getResourceAllowance(request: google.cloud.batch.v1alpha.IGetResourceAllowanceRequest, callback: google.cloud.batch.v1alpha.BatchService.GetResourceAllowanceCallback): void; + + /** + * Calls GetResourceAllowance. + * @param request GetResourceAllowanceRequest message or plain object + * @returns Promise + */ + public getResourceAllowance(request: google.cloud.batch.v1alpha.IGetResourceAllowanceRequest): Promise; + + /** + * Calls DeleteResourceAllowance. + * @param request DeleteResourceAllowanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteResourceAllowance(request: google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest, callback: google.cloud.batch.v1alpha.BatchService.DeleteResourceAllowanceCallback): void; + + /** + * Calls DeleteResourceAllowance. + * @param request DeleteResourceAllowanceRequest message or plain object + * @returns Promise + */ + public deleteResourceAllowance(request: google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest): Promise; + + /** + * Calls ListResourceAllowances. + * @param request ListResourceAllowancesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListResourceAllowancesResponse + */ + public listResourceAllowances(request: google.cloud.batch.v1alpha.IListResourceAllowancesRequest, callback: google.cloud.batch.v1alpha.BatchService.ListResourceAllowancesCallback): void; + + /** + * Calls ListResourceAllowances. + * @param request ListResourceAllowancesRequest message or plain object + * @returns Promise + */ + public listResourceAllowances(request: google.cloud.batch.v1alpha.IListResourceAllowancesRequest): Promise; + + /** + * Calls UpdateResourceAllowance. + * @param request UpdateResourceAllowanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ResourceAllowance + */ + public updateResourceAllowance(request: google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest, callback: google.cloud.batch.v1alpha.BatchService.UpdateResourceAllowanceCallback): void; + + /** + * Calls UpdateResourceAllowance. + * @param request UpdateResourceAllowanceRequest message or plain object + * @returns Promise + */ + public updateResourceAllowance(request: google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest): Promise; + } + + namespace BatchService { + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|createJob}. + * @param error Error, if any + * @param [response] Job + */ + type CreateJobCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.Job) => void; + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|getJob}. + * @param error Error, if any + * @param [response] Job + */ + type GetJobCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.Job) => void; + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|deleteJob}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|cancelJob}. + * @param error Error, if any + * @param [response] Operation + */ + type CancelJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|updateJob}. + * @param error Error, if any + * @param [response] Job + */ + type UpdateJobCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.Job) => void; + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|listJobs}. + * @param error Error, if any + * @param [response] ListJobsResponse + */ + type ListJobsCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.ListJobsResponse) => void; + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|getTask}. + * @param error Error, if any + * @param [response] Task + */ + type GetTaskCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.Task) => void; + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|listTasks}. + * @param error Error, if any + * @param [response] ListTasksResponse + */ + type ListTasksCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.ListTasksResponse) => void; + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|createResourceAllowance}. + * @param error Error, if any + * @param [response] ResourceAllowance + */ + type CreateResourceAllowanceCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.ResourceAllowance) => void; + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|getResourceAllowance}. + * @param error Error, if any + * @param [response] ResourceAllowance + */ + type GetResourceAllowanceCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.ResourceAllowance) => void; + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|deleteResourceAllowance}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteResourceAllowanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|listResourceAllowances}. + * @param error Error, if any + * @param [response] ListResourceAllowancesResponse + */ + type ListResourceAllowancesCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.ListResourceAllowancesResponse) => void; + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|updateResourceAllowance}. + * @param error Error, if any + * @param [response] ResourceAllowance + */ + type UpdateResourceAllowanceCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.ResourceAllowance) => void; + } + + /** Properties of a CreateJobRequest. */ + interface ICreateJobRequest { + + /** CreateJobRequest parent */ + parent?: (string|null); + + /** CreateJobRequest jobId */ + jobId?: (string|null); + + /** CreateJobRequest job */ + job?: (google.cloud.batch.v1alpha.IJob|null); + + /** CreateJobRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateJobRequest. */ + class CreateJobRequest implements ICreateJobRequest { + + /** + * Constructs a new CreateJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.ICreateJobRequest); + + /** CreateJobRequest parent. */ + public parent: string; + + /** CreateJobRequest jobId. */ + public jobId: string; + + /** CreateJobRequest job. */ + public job?: (google.cloud.batch.v1alpha.IJob|null); + + /** CreateJobRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateJobRequest instance + */ + public static create(properties?: google.cloud.batch.v1alpha.ICreateJobRequest): google.cloud.batch.v1alpha.CreateJobRequest; + + /** + * Encodes the specified CreateJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.CreateJobRequest.verify|verify} messages. + * @param message CreateJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.ICreateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.CreateJobRequest.verify|verify} messages. + * @param message CreateJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.ICreateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.CreateJobRequest; + + /** + * Decodes a CreateJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.CreateJobRequest; + + /** + * Verifies a CreateJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.CreateJobRequest; + + /** + * Creates a plain object from a CreateJobRequest message. Also converts values to other types if specified. + * @param message CreateJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.CreateJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetJobRequest. */ + interface IGetJobRequest { + + /** GetJobRequest name */ + name?: (string|null); + } + + /** Represents a GetJobRequest. */ + class GetJobRequest implements IGetJobRequest { + + /** + * Constructs a new GetJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IGetJobRequest); + + /** GetJobRequest name. */ + public name: string; + + /** + * Creates a new GetJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetJobRequest instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IGetJobRequest): google.cloud.batch.v1alpha.GetJobRequest; + + /** + * Encodes the specified GetJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.GetJobRequest.verify|verify} messages. + * @param message GetJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IGetJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.GetJobRequest.verify|verify} messages. + * @param message GetJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IGetJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.GetJobRequest; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.GetJobRequest; + + /** + * Verifies a GetJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.GetJobRequest; + + /** + * Creates a plain object from a GetJobRequest message. Also converts values to other types if specified. + * @param message GetJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.GetJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteJobRequest. */ + interface IDeleteJobRequest { + + /** DeleteJobRequest name */ + name?: (string|null); + + /** DeleteJobRequest reason */ + reason?: (string|null); + + /** DeleteJobRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteJobRequest. */ + class DeleteJobRequest implements IDeleteJobRequest { + + /** + * Constructs a new DeleteJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IDeleteJobRequest); + + /** DeleteJobRequest name. */ + public name: string; + + /** DeleteJobRequest reason. */ + public reason: string; + + /** DeleteJobRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteJobRequest instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IDeleteJobRequest): google.cloud.batch.v1alpha.DeleteJobRequest; + + /** + * Encodes the specified DeleteJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.DeleteJobRequest.verify|verify} messages. + * @param message DeleteJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IDeleteJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.DeleteJobRequest.verify|verify} messages. + * @param message DeleteJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IDeleteJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.DeleteJobRequest; + + /** + * Decodes a DeleteJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.DeleteJobRequest; + + /** + * Verifies a DeleteJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.DeleteJobRequest; + + /** + * Creates a plain object from a DeleteJobRequest message. Also converts values to other types if specified. + * @param message DeleteJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.DeleteJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelJobRequest. */ + interface ICancelJobRequest { + + /** CancelJobRequest name */ + name?: (string|null); + + /** CancelJobRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CancelJobRequest. */ + class CancelJobRequest implements ICancelJobRequest { + + /** + * Constructs a new CancelJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.ICancelJobRequest); + + /** CancelJobRequest name. */ + public name: string; + + /** CancelJobRequest requestId. */ + public requestId: string; + + /** + * Creates a new CancelJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelJobRequest instance + */ + public static create(properties?: google.cloud.batch.v1alpha.ICancelJobRequest): google.cloud.batch.v1alpha.CancelJobRequest; + + /** + * Encodes the specified CancelJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.CancelJobRequest.verify|verify} messages. + * @param message CancelJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.ICancelJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.CancelJobRequest.verify|verify} messages. + * @param message CancelJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.ICancelJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.CancelJobRequest; + + /** + * Decodes a CancelJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.CancelJobRequest; + + /** + * Verifies a CancelJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.CancelJobRequest; + + /** + * Creates a plain object from a CancelJobRequest message. Also converts values to other types if specified. + * @param message CancelJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.CancelJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelJobResponse. */ + interface ICancelJobResponse { + } + + /** Represents a CancelJobResponse. */ + class CancelJobResponse implements ICancelJobResponse { + + /** + * Constructs a new CancelJobResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.ICancelJobResponse); + + /** + * Creates a new CancelJobResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelJobResponse instance + */ + public static create(properties?: google.cloud.batch.v1alpha.ICancelJobResponse): google.cloud.batch.v1alpha.CancelJobResponse; + + /** + * Encodes the specified CancelJobResponse message. Does not implicitly {@link google.cloud.batch.v1alpha.CancelJobResponse.verify|verify} messages. + * @param message CancelJobResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.ICancelJobResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelJobResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.CancelJobResponse.verify|verify} messages. + * @param message CancelJobResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.ICancelJobResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelJobResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelJobResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.CancelJobResponse; + + /** + * Decodes a CancelJobResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelJobResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.CancelJobResponse; + + /** + * Verifies a CancelJobResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelJobResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelJobResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.CancelJobResponse; + + /** + * Creates a plain object from a CancelJobResponse message. Also converts values to other types if specified. + * @param message CancelJobResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.CancelJobResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelJobResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelJobResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateJobRequest. */ + interface IUpdateJobRequest { + + /** UpdateJobRequest job */ + job?: (google.cloud.batch.v1alpha.IJob|null); + + /** UpdateJobRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateJobRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateJobRequest. */ + class UpdateJobRequest implements IUpdateJobRequest { + + /** + * Constructs a new UpdateJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IUpdateJobRequest); + + /** UpdateJobRequest job. */ + public job?: (google.cloud.batch.v1alpha.IJob|null); + + /** UpdateJobRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateJobRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateJobRequest instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IUpdateJobRequest): google.cloud.batch.v1alpha.UpdateJobRequest; + + /** + * Encodes the specified UpdateJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.UpdateJobRequest.verify|verify} messages. + * @param message UpdateJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IUpdateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UpdateJobRequest.verify|verify} messages. + * @param message UpdateJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IUpdateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.UpdateJobRequest; + + /** + * Decodes an UpdateJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.UpdateJobRequest; + + /** + * Verifies an UpdateJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.UpdateJobRequest; + + /** + * Creates a plain object from an UpdateJobRequest message. Also converts values to other types if specified. + * @param message UpdateJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.UpdateJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListJobsRequest. */ + interface IListJobsRequest { + + /** ListJobsRequest parent */ + parent?: (string|null); + + /** ListJobsRequest filter */ + filter?: (string|null); + + /** ListJobsRequest orderBy */ + orderBy?: (string|null); + + /** ListJobsRequest pageSize */ + pageSize?: (number|null); + + /** ListJobsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListJobsRequest. */ + class ListJobsRequest implements IListJobsRequest { + + /** + * Constructs a new ListJobsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IListJobsRequest); + + /** ListJobsRequest parent. */ + public parent: string; + + /** ListJobsRequest filter. */ + public filter: string; + + /** ListJobsRequest orderBy. */ + public orderBy: string; + + /** ListJobsRequest pageSize. */ + public pageSize: number; + + /** ListJobsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListJobsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListJobsRequest instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IListJobsRequest): google.cloud.batch.v1alpha.ListJobsRequest; + + /** + * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.ListJobsRequest.verify|verify} messages. + * @param message ListJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IListJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListJobsRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListJobsRequest.verify|verify} messages. + * @param message ListJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IListJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ListJobsRequest; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ListJobsRequest; + + /** + * Verifies a ListJobsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListJobsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListJobsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ListJobsRequest; + + /** + * Creates a plain object from a ListJobsRequest message. Also converts values to other types if specified. + * @param message ListJobsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.ListJobsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListJobsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListJobsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListJobsResponse. */ + interface IListJobsResponse { + + /** ListJobsResponse jobs */ + jobs?: (google.cloud.batch.v1alpha.IJob[]|null); + + /** ListJobsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListJobsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListJobsResponse. */ + class ListJobsResponse implements IListJobsResponse { + + /** + * Constructs a new ListJobsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IListJobsResponse); + + /** ListJobsResponse jobs. */ + public jobs: google.cloud.batch.v1alpha.IJob[]; + + /** ListJobsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListJobsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListJobsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListJobsResponse instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IListJobsResponse): google.cloud.batch.v1alpha.ListJobsResponse; + + /** + * Encodes the specified ListJobsResponse message. Does not implicitly {@link google.cloud.batch.v1alpha.ListJobsResponse.verify|verify} messages. + * @param message ListJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IListJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListJobsResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListJobsResponse.verify|verify} messages. + * @param message ListJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IListJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ListJobsResponse; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ListJobsResponse; + + /** + * Verifies a ListJobsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListJobsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListJobsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ListJobsResponse; + + /** + * Creates a plain object from a ListJobsResponse message. Also converts values to other types if specified. + * @param message ListJobsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.ListJobsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListJobsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListJobsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTasksRequest. */ + interface IListTasksRequest { + + /** ListTasksRequest parent */ + parent?: (string|null); + + /** ListTasksRequest filter */ + filter?: (string|null); + + /** ListTasksRequest orderBy */ + orderBy?: (string|null); + + /** ListTasksRequest pageSize */ + pageSize?: (number|null); + + /** ListTasksRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListTasksRequest. */ + class ListTasksRequest implements IListTasksRequest { + + /** + * Constructs a new ListTasksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IListTasksRequest); + + /** ListTasksRequest parent. */ + public parent: string; + + /** ListTasksRequest filter. */ + public filter: string; + + /** ListTasksRequest orderBy. */ + public orderBy: string; + + /** ListTasksRequest pageSize. */ + public pageSize: number; + + /** ListTasksRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListTasksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTasksRequest instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IListTasksRequest): google.cloud.batch.v1alpha.ListTasksRequest; + + /** + * Encodes the specified ListTasksRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.ListTasksRequest.verify|verify} messages. + * @param message ListTasksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IListTasksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTasksRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListTasksRequest.verify|verify} messages. + * @param message ListTasksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IListTasksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTasksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTasksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ListTasksRequest; + + /** + * Decodes a ListTasksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTasksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ListTasksRequest; + + /** + * Verifies a ListTasksRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTasksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTasksRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ListTasksRequest; + + /** + * Creates a plain object from a ListTasksRequest message. Also converts values to other types if specified. + * @param message ListTasksRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.ListTasksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTasksRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTasksRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTasksResponse. */ + interface IListTasksResponse { + + /** ListTasksResponse tasks */ + tasks?: (google.cloud.batch.v1alpha.ITask[]|null); + + /** ListTasksResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListTasksResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListTasksResponse. */ + class ListTasksResponse implements IListTasksResponse { + + /** + * Constructs a new ListTasksResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IListTasksResponse); + + /** ListTasksResponse tasks. */ + public tasks: google.cloud.batch.v1alpha.ITask[]; + + /** ListTasksResponse nextPageToken. */ + public nextPageToken: string; + + /** ListTasksResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListTasksResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTasksResponse instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IListTasksResponse): google.cloud.batch.v1alpha.ListTasksResponse; + + /** + * Encodes the specified ListTasksResponse message. Does not implicitly {@link google.cloud.batch.v1alpha.ListTasksResponse.verify|verify} messages. + * @param message ListTasksResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IListTasksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTasksResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListTasksResponse.verify|verify} messages. + * @param message ListTasksResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IListTasksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTasksResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTasksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ListTasksResponse; + + /** + * Decodes a ListTasksResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTasksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ListTasksResponse; + + /** + * Verifies a ListTasksResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTasksResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTasksResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ListTasksResponse; + + /** + * Creates a plain object from a ListTasksResponse message. Also converts values to other types if specified. + * @param message ListTasksResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.ListTasksResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTasksResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTasksResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTaskRequest. */ + interface IGetTaskRequest { + + /** GetTaskRequest name */ + name?: (string|null); + } + + /** Represents a GetTaskRequest. */ + class GetTaskRequest implements IGetTaskRequest { + + /** + * Constructs a new GetTaskRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IGetTaskRequest); + + /** GetTaskRequest name. */ + public name: string; + + /** + * Creates a new GetTaskRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTaskRequest instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IGetTaskRequest): google.cloud.batch.v1alpha.GetTaskRequest; + + /** + * Encodes the specified GetTaskRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.GetTaskRequest.verify|verify} messages. + * @param message GetTaskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IGetTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTaskRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.GetTaskRequest.verify|verify} messages. + * @param message GetTaskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IGetTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTaskRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTaskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.GetTaskRequest; + + /** + * Decodes a GetTaskRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTaskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.GetTaskRequest; + + /** + * Verifies a GetTaskRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTaskRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTaskRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.GetTaskRequest; + + /** + * Creates a plain object from a GetTaskRequest message. Also converts values to other types if specified. + * @param message GetTaskRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.GetTaskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTaskRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTaskRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateResourceAllowanceRequest. */ + interface ICreateResourceAllowanceRequest { + + /** CreateResourceAllowanceRequest parent */ + parent?: (string|null); + + /** CreateResourceAllowanceRequest resourceAllowanceId */ + resourceAllowanceId?: (string|null); + + /** CreateResourceAllowanceRequest resourceAllowance */ + resourceAllowance?: (google.cloud.batch.v1alpha.IResourceAllowance|null); + + /** CreateResourceAllowanceRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateResourceAllowanceRequest. */ + class CreateResourceAllowanceRequest implements ICreateResourceAllowanceRequest { + + /** + * Constructs a new CreateResourceAllowanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest); + + /** CreateResourceAllowanceRequest parent. */ + public parent: string; + + /** CreateResourceAllowanceRequest resourceAllowanceId. */ + public resourceAllowanceId: string; + + /** CreateResourceAllowanceRequest resourceAllowance. */ + public resourceAllowance?: (google.cloud.batch.v1alpha.IResourceAllowance|null); + + /** CreateResourceAllowanceRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateResourceAllowanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateResourceAllowanceRequest instance + */ + public static create(properties?: google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest): google.cloud.batch.v1alpha.CreateResourceAllowanceRequest; + + /** + * Encodes the specified CreateResourceAllowanceRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.CreateResourceAllowanceRequest.verify|verify} messages. + * @param message CreateResourceAllowanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateResourceAllowanceRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.CreateResourceAllowanceRequest.verify|verify} messages. + * @param message CreateResourceAllowanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateResourceAllowanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateResourceAllowanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.CreateResourceAllowanceRequest; + + /** + * Decodes a CreateResourceAllowanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateResourceAllowanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.CreateResourceAllowanceRequest; + + /** + * Verifies a CreateResourceAllowanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateResourceAllowanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateResourceAllowanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.CreateResourceAllowanceRequest; + + /** + * Creates a plain object from a CreateResourceAllowanceRequest message. Also converts values to other types if specified. + * @param message CreateResourceAllowanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.CreateResourceAllowanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateResourceAllowanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateResourceAllowanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetResourceAllowanceRequest. */ + interface IGetResourceAllowanceRequest { + + /** GetResourceAllowanceRequest name */ + name?: (string|null); + } + + /** Represents a GetResourceAllowanceRequest. */ + class GetResourceAllowanceRequest implements IGetResourceAllowanceRequest { + + /** + * Constructs a new GetResourceAllowanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IGetResourceAllowanceRequest); + + /** GetResourceAllowanceRequest name. */ + public name: string; + + /** + * Creates a new GetResourceAllowanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetResourceAllowanceRequest instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IGetResourceAllowanceRequest): google.cloud.batch.v1alpha.GetResourceAllowanceRequest; + + /** + * Encodes the specified GetResourceAllowanceRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.GetResourceAllowanceRequest.verify|verify} messages. + * @param message GetResourceAllowanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IGetResourceAllowanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetResourceAllowanceRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.GetResourceAllowanceRequest.verify|verify} messages. + * @param message GetResourceAllowanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IGetResourceAllowanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetResourceAllowanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetResourceAllowanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.GetResourceAllowanceRequest; + + /** + * Decodes a GetResourceAllowanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetResourceAllowanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.GetResourceAllowanceRequest; + + /** + * Verifies a GetResourceAllowanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetResourceAllowanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetResourceAllowanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.GetResourceAllowanceRequest; + + /** + * Creates a plain object from a GetResourceAllowanceRequest message. Also converts values to other types if specified. + * @param message GetResourceAllowanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.GetResourceAllowanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetResourceAllowanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetResourceAllowanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteResourceAllowanceRequest. */ + interface IDeleteResourceAllowanceRequest { + + /** DeleteResourceAllowanceRequest name */ + name?: (string|null); + + /** DeleteResourceAllowanceRequest reason */ + reason?: (string|null); + + /** DeleteResourceAllowanceRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteResourceAllowanceRequest. */ + class DeleteResourceAllowanceRequest implements IDeleteResourceAllowanceRequest { + + /** + * Constructs a new DeleteResourceAllowanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest); + + /** DeleteResourceAllowanceRequest name. */ + public name: string; + + /** DeleteResourceAllowanceRequest reason. */ + public reason: string; + + /** DeleteResourceAllowanceRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteResourceAllowanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteResourceAllowanceRequest instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest): google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest; + + /** + * Encodes the specified DeleteResourceAllowanceRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest.verify|verify} messages. + * @param message DeleteResourceAllowanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteResourceAllowanceRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest.verify|verify} messages. + * @param message DeleteResourceAllowanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteResourceAllowanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteResourceAllowanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest; + + /** + * Decodes a DeleteResourceAllowanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteResourceAllowanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest; + + /** + * Verifies a DeleteResourceAllowanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteResourceAllowanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteResourceAllowanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest; + + /** + * Creates a plain object from a DeleteResourceAllowanceRequest message. Also converts values to other types if specified. + * @param message DeleteResourceAllowanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteResourceAllowanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteResourceAllowanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListResourceAllowancesRequest. */ + interface IListResourceAllowancesRequest { + + /** ListResourceAllowancesRequest parent */ + parent?: (string|null); + + /** ListResourceAllowancesRequest pageSize */ + pageSize?: (number|null); + + /** ListResourceAllowancesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListResourceAllowancesRequest. */ + class ListResourceAllowancesRequest implements IListResourceAllowancesRequest { + + /** + * Constructs a new ListResourceAllowancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IListResourceAllowancesRequest); + + /** ListResourceAllowancesRequest parent. */ + public parent: string; + + /** ListResourceAllowancesRequest pageSize. */ + public pageSize: number; + + /** ListResourceAllowancesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListResourceAllowancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListResourceAllowancesRequest instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IListResourceAllowancesRequest): google.cloud.batch.v1alpha.ListResourceAllowancesRequest; + + /** + * Encodes the specified ListResourceAllowancesRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.ListResourceAllowancesRequest.verify|verify} messages. + * @param message ListResourceAllowancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IListResourceAllowancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListResourceAllowancesRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListResourceAllowancesRequest.verify|verify} messages. + * @param message ListResourceAllowancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IListResourceAllowancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListResourceAllowancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListResourceAllowancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ListResourceAllowancesRequest; + + /** + * Decodes a ListResourceAllowancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListResourceAllowancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ListResourceAllowancesRequest; + + /** + * Verifies a ListResourceAllowancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListResourceAllowancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListResourceAllowancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ListResourceAllowancesRequest; + + /** + * Creates a plain object from a ListResourceAllowancesRequest message. Also converts values to other types if specified. + * @param message ListResourceAllowancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.ListResourceAllowancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListResourceAllowancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListResourceAllowancesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListResourceAllowancesResponse. */ + interface IListResourceAllowancesResponse { + + /** ListResourceAllowancesResponse resourceAllowances */ + resourceAllowances?: (google.cloud.batch.v1alpha.IResourceAllowance[]|null); + + /** ListResourceAllowancesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListResourceAllowancesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListResourceAllowancesResponse. */ + class ListResourceAllowancesResponse implements IListResourceAllowancesResponse { + + /** + * Constructs a new ListResourceAllowancesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IListResourceAllowancesResponse); + + /** ListResourceAllowancesResponse resourceAllowances. */ + public resourceAllowances: google.cloud.batch.v1alpha.IResourceAllowance[]; + + /** ListResourceAllowancesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListResourceAllowancesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListResourceAllowancesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListResourceAllowancesResponse instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IListResourceAllowancesResponse): google.cloud.batch.v1alpha.ListResourceAllowancesResponse; + + /** + * Encodes the specified ListResourceAllowancesResponse message. Does not implicitly {@link google.cloud.batch.v1alpha.ListResourceAllowancesResponse.verify|verify} messages. + * @param message ListResourceAllowancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IListResourceAllowancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListResourceAllowancesResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListResourceAllowancesResponse.verify|verify} messages. + * @param message ListResourceAllowancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IListResourceAllowancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListResourceAllowancesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListResourceAllowancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ListResourceAllowancesResponse; + + /** + * Decodes a ListResourceAllowancesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListResourceAllowancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ListResourceAllowancesResponse; + + /** + * Verifies a ListResourceAllowancesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListResourceAllowancesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListResourceAllowancesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ListResourceAllowancesResponse; + + /** + * Creates a plain object from a ListResourceAllowancesResponse message. Also converts values to other types if specified. + * @param message ListResourceAllowancesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.ListResourceAllowancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListResourceAllowancesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListResourceAllowancesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateResourceAllowanceRequest. */ + interface IUpdateResourceAllowanceRequest { + + /** UpdateResourceAllowanceRequest resourceAllowance */ + resourceAllowance?: (google.cloud.batch.v1alpha.IResourceAllowance|null); + + /** UpdateResourceAllowanceRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateResourceAllowanceRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateResourceAllowanceRequest. */ + class UpdateResourceAllowanceRequest implements IUpdateResourceAllowanceRequest { + + /** + * Constructs a new UpdateResourceAllowanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest); + + /** UpdateResourceAllowanceRequest resourceAllowance. */ + public resourceAllowance?: (google.cloud.batch.v1alpha.IResourceAllowance|null); + + /** UpdateResourceAllowanceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateResourceAllowanceRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateResourceAllowanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateResourceAllowanceRequest instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest): google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest; + + /** + * Encodes the specified UpdateResourceAllowanceRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest.verify|verify} messages. + * @param message UpdateResourceAllowanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateResourceAllowanceRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest.verify|verify} messages. + * @param message UpdateResourceAllowanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateResourceAllowanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateResourceAllowanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest; + + /** + * Decodes an UpdateResourceAllowanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateResourceAllowanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest; + + /** + * Verifies an UpdateResourceAllowanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateResourceAllowanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateResourceAllowanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest; + + /** + * Creates a plain object from an UpdateResourceAllowanceRequest message. Also converts values to other types if specified. + * @param message UpdateResourceAllowanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateResourceAllowanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateResourceAllowanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IOperationMetadata); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target. */ + public target: string; + + /** OperationMetadata verb. */ + public verb: string; + + /** OperationMetadata statusMessage. */ + public statusMessage: string; + + /** OperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IOperationMetadata): google.cloud.batch.v1alpha.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.batch.v1alpha.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.OperationMetadata; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.OperationMetadata; + + /** + * Verifies an OperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.OperationMetadata; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @param message OperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Job. */ + interface IJob { + + /** Job name */ + name?: (string|null); + + /** Job uid */ + uid?: (string|null); + + /** Job priority */ + priority?: (number|Long|string|null); + + /** Job taskGroups */ + taskGroups?: (google.cloud.batch.v1alpha.ITaskGroup[]|null); + + /** Job schedulingPolicy */ + schedulingPolicy?: (google.cloud.batch.v1alpha.Job.SchedulingPolicy|keyof typeof google.cloud.batch.v1alpha.Job.SchedulingPolicy|null); + + /** Job dependencies */ + dependencies?: (google.cloud.batch.v1alpha.IJobDependency[]|null); + + /** Job allocationPolicy */ + allocationPolicy?: (google.cloud.batch.v1alpha.IAllocationPolicy|null); + + /** Job labels */ + labels?: ({ [k: string]: string }|null); + + /** Job status */ + status?: (google.cloud.batch.v1alpha.IJobStatus|null); + + /** Job notification */ + notification?: (google.cloud.batch.v1alpha.IJobNotification|null); + + /** Job createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Job updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Job logsPolicy */ + logsPolicy?: (google.cloud.batch.v1alpha.ILogsPolicy|null); + + /** Job notifications */ + notifications?: (google.cloud.batch.v1alpha.IJobNotification[]|null); + } + + /** Represents a Job. */ + class Job implements IJob { + + /** + * Constructs a new Job. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IJob); + + /** Job name. */ + public name: string; + + /** Job uid. */ + public uid: string; + + /** Job priority. */ + public priority: (number|Long|string); + + /** Job taskGroups. */ + public taskGroups: google.cloud.batch.v1alpha.ITaskGroup[]; + + /** Job schedulingPolicy. */ + public schedulingPolicy: (google.cloud.batch.v1alpha.Job.SchedulingPolicy|keyof typeof google.cloud.batch.v1alpha.Job.SchedulingPolicy); + + /** Job dependencies. */ + public dependencies: google.cloud.batch.v1alpha.IJobDependency[]; + + /** Job allocationPolicy. */ + public allocationPolicy?: (google.cloud.batch.v1alpha.IAllocationPolicy|null); + + /** Job labels. */ + public labels: { [k: string]: string }; + + /** Job status. */ + public status?: (google.cloud.batch.v1alpha.IJobStatus|null); + + /** Job notification. */ + public notification?: (google.cloud.batch.v1alpha.IJobNotification|null); + + /** Job createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Job updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Job logsPolicy. */ + public logsPolicy?: (google.cloud.batch.v1alpha.ILogsPolicy|null); + + /** Job notifications. */ + public notifications: google.cloud.batch.v1alpha.IJobNotification[]; + + /** + * Creates a new Job instance using the specified properties. + * @param [properties] Properties to set + * @returns Job instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IJob): google.cloud.batch.v1alpha.Job; + + /** + * Encodes the specified Job message. Does not implicitly {@link google.cloud.batch.v1alpha.Job.verify|verify} messages. + * @param message Job message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Job.verify|verify} messages. + * @param message Job message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Job message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Job; + + /** + * Decodes a Job message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Job; + + /** + * Verifies a Job message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Job message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Job + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Job; + + /** + * Creates a plain object from a Job message. Also converts values to other types if specified. + * @param message Job + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.Job, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Job to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Job + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Job { + + /** SchedulingPolicy enum. */ + enum SchedulingPolicy { + SCHEDULING_POLICY_UNSPECIFIED = 0, + AS_SOON_AS_POSSIBLE = 1 + } + } + + /** Properties of a LogsPolicy. */ + interface ILogsPolicy { + + /** LogsPolicy destination */ + destination?: (google.cloud.batch.v1alpha.LogsPolicy.Destination|keyof typeof google.cloud.batch.v1alpha.LogsPolicy.Destination|null); + + /** LogsPolicy logsPath */ + logsPath?: (string|null); + + /** LogsPolicy cloudLoggingOption */ + cloudLoggingOption?: (google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption|null); + } + + /** Represents a LogsPolicy. */ + class LogsPolicy implements ILogsPolicy { + + /** + * Constructs a new LogsPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.ILogsPolicy); + + /** LogsPolicy destination. */ + public destination: (google.cloud.batch.v1alpha.LogsPolicy.Destination|keyof typeof google.cloud.batch.v1alpha.LogsPolicy.Destination); + + /** LogsPolicy logsPath. */ + public logsPath: string; + + /** LogsPolicy cloudLoggingOption. */ + public cloudLoggingOption?: (google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption|null); + + /** + * Creates a new LogsPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns LogsPolicy instance + */ + public static create(properties?: google.cloud.batch.v1alpha.ILogsPolicy): google.cloud.batch.v1alpha.LogsPolicy; + + /** + * Encodes the specified LogsPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.LogsPolicy.verify|verify} messages. + * @param message LogsPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.ILogsPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LogsPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.LogsPolicy.verify|verify} messages. + * @param message LogsPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.ILogsPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LogsPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LogsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.LogsPolicy; + + /** + * Decodes a LogsPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LogsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.LogsPolicy; + + /** + * Verifies a LogsPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LogsPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LogsPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.LogsPolicy; + + /** + * Creates a plain object from a LogsPolicy message. Also converts values to other types if specified. + * @param message LogsPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.LogsPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LogsPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LogsPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LogsPolicy { + + /** Properties of a CloudLoggingOption. */ + interface ICloudLoggingOption { + + /** CloudLoggingOption useGenericTaskMonitoredResource */ + useGenericTaskMonitoredResource?: (boolean|null); + } + + /** Represents a CloudLoggingOption. */ + class CloudLoggingOption implements ICloudLoggingOption { + + /** + * Constructs a new CloudLoggingOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption); + + /** CloudLoggingOption useGenericTaskMonitoredResource. */ + public useGenericTaskMonitoredResource: boolean; + + /** + * Creates a new CloudLoggingOption instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudLoggingOption instance + */ + public static create(properties?: google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption): google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption; + + /** + * Encodes the specified CloudLoggingOption message. Does not implicitly {@link google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption.verify|verify} messages. + * @param message CloudLoggingOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudLoggingOption message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption.verify|verify} messages. + * @param message CloudLoggingOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudLoggingOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudLoggingOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption; + + /** + * Decodes a CloudLoggingOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudLoggingOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption; + + /** + * Verifies a CloudLoggingOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudLoggingOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudLoggingOption + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption; + + /** + * Creates a plain object from a CloudLoggingOption message. Also converts values to other types if specified. + * @param message CloudLoggingOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudLoggingOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudLoggingOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Destination enum. */ + enum Destination { + DESTINATION_UNSPECIFIED = 0, + CLOUD_LOGGING = 1, + PATH = 2 + } + } + + /** Properties of a JobDependency. */ + interface IJobDependency { + + /** JobDependency items */ + items?: ({ [k: string]: google.cloud.batch.v1alpha.JobDependency.Type }|null); + } + + /** Represents a JobDependency. */ + class JobDependency implements IJobDependency { + + /** + * Constructs a new JobDependency. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IJobDependency); + + /** JobDependency items. */ + public items: { [k: string]: google.cloud.batch.v1alpha.JobDependency.Type }; + + /** + * Creates a new JobDependency instance using the specified properties. + * @param [properties] Properties to set + * @returns JobDependency instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IJobDependency): google.cloud.batch.v1alpha.JobDependency; + + /** + * Encodes the specified JobDependency message. Does not implicitly {@link google.cloud.batch.v1alpha.JobDependency.verify|verify} messages. + * @param message JobDependency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IJobDependency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobDependency message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobDependency.verify|verify} messages. + * @param message JobDependency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IJobDependency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobDependency message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobDependency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.JobDependency; + + /** + * Decodes a JobDependency message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobDependency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.JobDependency; + + /** + * Verifies a JobDependency message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobDependency message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobDependency + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.JobDependency; + + /** + * Creates a plain object from a JobDependency message. Also converts values to other types if specified. + * @param message JobDependency + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.JobDependency, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobDependency to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobDependency + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace JobDependency { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + SUCCEEDED = 1, + FAILED = 2, + FINISHED = 3 + } + } + + /** Properties of a JobStatus. */ + interface IJobStatus { + + /** JobStatus state */ + state?: (google.cloud.batch.v1alpha.JobStatus.State|keyof typeof google.cloud.batch.v1alpha.JobStatus.State|null); + + /** JobStatus statusEvents */ + statusEvents?: (google.cloud.batch.v1alpha.IStatusEvent[]|null); + + /** JobStatus taskGroups */ + taskGroups?: ({ [k: string]: google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus }|null); + + /** JobStatus runDuration */ + runDuration?: (google.protobuf.IDuration|null); + + /** JobStatus resourceUsage */ + resourceUsage?: (google.cloud.batch.v1alpha.IResourceUsage|null); + } + + /** Represents a JobStatus. */ + class JobStatus implements IJobStatus { + + /** + * Constructs a new JobStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IJobStatus); + + /** JobStatus state. */ + public state: (google.cloud.batch.v1alpha.JobStatus.State|keyof typeof google.cloud.batch.v1alpha.JobStatus.State); + + /** JobStatus statusEvents. */ + public statusEvents: google.cloud.batch.v1alpha.IStatusEvent[]; + + /** JobStatus taskGroups. */ + public taskGroups: { [k: string]: google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus }; + + /** JobStatus runDuration. */ + public runDuration?: (google.protobuf.IDuration|null); + + /** JobStatus resourceUsage. */ + public resourceUsage?: (google.cloud.batch.v1alpha.IResourceUsage|null); + + /** + * Creates a new JobStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns JobStatus instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IJobStatus): google.cloud.batch.v1alpha.JobStatus; + + /** + * Encodes the specified JobStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.verify|verify} messages. + * @param message JobStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IJobStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.verify|verify} messages. + * @param message JobStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IJobStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.JobStatus; + + /** + * Decodes a JobStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.JobStatus; + + /** + * Verifies a JobStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.JobStatus; + + /** + * Creates a plain object from a JobStatus message. Also converts values to other types if specified. + * @param message JobStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.JobStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace JobStatus { + + /** Properties of an InstanceStatus. */ + interface IInstanceStatus { + + /** InstanceStatus machineType */ + machineType?: (string|null); + + /** InstanceStatus provisioningModel */ + provisioningModel?: (google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel|keyof typeof google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel|null); + + /** InstanceStatus taskPack */ + taskPack?: (number|Long|string|null); + + /** InstanceStatus bootDisk */ + bootDisk?: (google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null); + } + + /** Represents an InstanceStatus. */ + class InstanceStatus implements IInstanceStatus { + + /** + * Constructs a new InstanceStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.JobStatus.IInstanceStatus); + + /** InstanceStatus machineType. */ + public machineType: string; + + /** InstanceStatus provisioningModel. */ + public provisioningModel: (google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel|keyof typeof google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel); + + /** InstanceStatus taskPack. */ + public taskPack: (number|Long|string); + + /** InstanceStatus bootDisk. */ + public bootDisk?: (google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null); + + /** + * Creates a new InstanceStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceStatus instance + */ + public static create(properties?: google.cloud.batch.v1alpha.JobStatus.IInstanceStatus): google.cloud.batch.v1alpha.JobStatus.InstanceStatus; + + /** + * Encodes the specified InstanceStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.InstanceStatus.verify|verify} messages. + * @param message InstanceStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.JobStatus.IInstanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.InstanceStatus.verify|verify} messages. + * @param message InstanceStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.JobStatus.IInstanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.JobStatus.InstanceStatus; + + /** + * Decodes an InstanceStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.JobStatus.InstanceStatus; + + /** + * Verifies an InstanceStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.JobStatus.InstanceStatus; + + /** + * Creates a plain object from an InstanceStatus message. Also converts values to other types if specified. + * @param message InstanceStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.JobStatus.InstanceStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstanceStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TaskGroupStatus. */ + interface ITaskGroupStatus { + + /** TaskGroupStatus counts */ + counts?: ({ [k: string]: (number|Long|string) }|null); + + /** TaskGroupStatus instances */ + instances?: (google.cloud.batch.v1alpha.JobStatus.IInstanceStatus[]|null); + } + + /** Represents a TaskGroupStatus. */ + class TaskGroupStatus implements ITaskGroupStatus { + + /** + * Constructs a new TaskGroupStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus); + + /** TaskGroupStatus counts. */ + public counts: { [k: string]: (number|Long|string) }; + + /** TaskGroupStatus instances. */ + public instances: google.cloud.batch.v1alpha.JobStatus.IInstanceStatus[]; + + /** + * Creates a new TaskGroupStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns TaskGroupStatus instance + */ + public static create(properties?: google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus): google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus; + + /** + * Encodes the specified TaskGroupStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.verify|verify} messages. + * @param message TaskGroupStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TaskGroupStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.verify|verify} messages. + * @param message TaskGroupStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TaskGroupStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TaskGroupStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus; + + /** + * Decodes a TaskGroupStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TaskGroupStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus; + + /** + * Verifies a TaskGroupStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TaskGroupStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TaskGroupStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus; + + /** + * Creates a plain object from a TaskGroupStatus message. Also converts values to other types if specified. + * @param message TaskGroupStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TaskGroupStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TaskGroupStatus + * @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, + QUEUED = 1, + SCHEDULED = 2, + RUNNING = 3, + SUCCEEDED = 4, + FAILED = 5, + DELETION_IN_PROGRESS = 6, + CANCELLATION_IN_PROGRESS = 7, + CANCELLED = 8 + } + } + + /** Properties of a ResourceUsage. */ + interface IResourceUsage { + + /** ResourceUsage coreHours */ + coreHours?: (number|null); + } + + /** Represents a ResourceUsage. */ + class ResourceUsage implements IResourceUsage { + + /** + * Constructs a new ResourceUsage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IResourceUsage); + + /** ResourceUsage coreHours. */ + public coreHours: number; + + /** + * Creates a new ResourceUsage instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceUsage instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IResourceUsage): google.cloud.batch.v1alpha.ResourceUsage; + + /** + * Encodes the specified ResourceUsage message. Does not implicitly {@link google.cloud.batch.v1alpha.ResourceUsage.verify|verify} messages. + * @param message ResourceUsage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IResourceUsage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceUsage message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ResourceUsage.verify|verify} messages. + * @param message ResourceUsage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IResourceUsage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceUsage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceUsage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ResourceUsage; + + /** + * Decodes a ResourceUsage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceUsage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ResourceUsage; + + /** + * Verifies a ResourceUsage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceUsage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceUsage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ResourceUsage; + + /** + * Creates a plain object from a ResourceUsage message. Also converts values to other types if specified. + * @param message ResourceUsage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.ResourceUsage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceUsage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceUsage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JobNotification. */ + interface IJobNotification { + + /** JobNotification pubsubTopic */ + pubsubTopic?: (string|null); + + /** JobNotification message */ + message?: (google.cloud.batch.v1alpha.JobNotification.IMessage|null); + } + + /** Represents a JobNotification. */ + class JobNotification implements IJobNotification { + + /** + * Constructs a new JobNotification. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IJobNotification); + + /** JobNotification pubsubTopic. */ + public pubsubTopic: string; + + /** JobNotification message. */ + public message?: (google.cloud.batch.v1alpha.JobNotification.IMessage|null); + + /** + * Creates a new JobNotification instance using the specified properties. + * @param [properties] Properties to set + * @returns JobNotification instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IJobNotification): google.cloud.batch.v1alpha.JobNotification; + + /** + * Encodes the specified JobNotification message. Does not implicitly {@link google.cloud.batch.v1alpha.JobNotification.verify|verify} messages. + * @param message JobNotification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IJobNotification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobNotification message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobNotification.verify|verify} messages. + * @param message JobNotification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IJobNotification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobNotification message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobNotification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.JobNotification; + + /** + * Decodes a JobNotification message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobNotification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.JobNotification; + + /** + * Verifies a JobNotification message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobNotification message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobNotification + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.JobNotification; + + /** + * Creates a plain object from a JobNotification message. Also converts values to other types if specified. + * @param message JobNotification + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.JobNotification, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobNotification to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobNotification + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace JobNotification { + + /** Properties of a Message. */ + interface IMessage { + + /** Message type */ + type?: (google.cloud.batch.v1alpha.JobNotification.Type|keyof typeof google.cloud.batch.v1alpha.JobNotification.Type|null); + + /** Message newJobState */ + newJobState?: (google.cloud.batch.v1alpha.JobStatus.State|keyof typeof google.cloud.batch.v1alpha.JobStatus.State|null); + + /** Message newTaskState */ + newTaskState?: (google.cloud.batch.v1alpha.TaskStatus.State|keyof typeof google.cloud.batch.v1alpha.TaskStatus.State|null); + } + + /** Represents a Message. */ + class Message implements IMessage { + + /** + * Constructs a new Message. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.JobNotification.IMessage); + + /** Message type. */ + public type: (google.cloud.batch.v1alpha.JobNotification.Type|keyof typeof google.cloud.batch.v1alpha.JobNotification.Type); + + /** Message newJobState. */ + public newJobState: (google.cloud.batch.v1alpha.JobStatus.State|keyof typeof google.cloud.batch.v1alpha.JobStatus.State); + + /** Message newTaskState. */ + public newTaskState: (google.cloud.batch.v1alpha.TaskStatus.State|keyof typeof google.cloud.batch.v1alpha.TaskStatus.State); + + /** + * Creates a new Message instance using the specified properties. + * @param [properties] Properties to set + * @returns Message instance + */ + public static create(properties?: google.cloud.batch.v1alpha.JobNotification.IMessage): google.cloud.batch.v1alpha.JobNotification.Message; + + /** + * Encodes the specified Message message. Does not implicitly {@link google.cloud.batch.v1alpha.JobNotification.Message.verify|verify} messages. + * @param message Message message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.JobNotification.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobNotification.Message.verify|verify} messages. + * @param message Message message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.JobNotification.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Message message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.JobNotification.Message; + + /** + * Decodes a Message message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.JobNotification.Message; + + /** + * Verifies a Message message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Message message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Message + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.JobNotification.Message; + + /** + * Creates a plain object from a Message message. Also converts values to other types if specified. + * @param message Message + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.JobNotification.Message, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Message to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Message + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + JOB_STATE_CHANGED = 1, + TASK_STATE_CHANGED = 2 + } + } + + /** Properties of an AllocationPolicy. */ + interface IAllocationPolicy { + + /** AllocationPolicy location */ + location?: (google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy|null); + + /** AllocationPolicy instance */ + instance?: (google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy|null); + + /** AllocationPolicy instances */ + instances?: (google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate[]|null); + + /** AllocationPolicy instanceTemplates */ + instanceTemplates?: (string[]|null); + + /** AllocationPolicy provisioningModels */ + provisioningModels?: (google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel[]|null); + + /** AllocationPolicy serviceAccountEmail */ + serviceAccountEmail?: (string|null); + + /** AllocationPolicy serviceAccount */ + serviceAccount?: (google.cloud.batch.v1alpha.IServiceAccount|null); + + /** AllocationPolicy labels */ + labels?: ({ [k: string]: string }|null); + + /** AllocationPolicy network */ + network?: (google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy|null); + + /** AllocationPolicy placement */ + placement?: (google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy|null); + + /** AllocationPolicy tags */ + tags?: (string[]|null); + } + + /** Represents an AllocationPolicy. */ + class AllocationPolicy implements IAllocationPolicy { + + /** + * Constructs a new AllocationPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IAllocationPolicy); + + /** AllocationPolicy location. */ + public location?: (google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy|null); + + /** AllocationPolicy instance. */ + public instance?: (google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy|null); + + /** AllocationPolicy instances. */ + public instances: google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate[]; + + /** AllocationPolicy instanceTemplates. */ + public instanceTemplates: string[]; + + /** AllocationPolicy provisioningModels. */ + public provisioningModels: google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel[]; + + /** AllocationPolicy serviceAccountEmail. */ + public serviceAccountEmail: string; + + /** AllocationPolicy serviceAccount. */ + public serviceAccount?: (google.cloud.batch.v1alpha.IServiceAccount|null); + + /** AllocationPolicy labels. */ + public labels: { [k: string]: string }; + + /** AllocationPolicy network. */ + public network?: (google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy|null); + + /** AllocationPolicy placement. */ + public placement?: (google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy|null); + + /** AllocationPolicy tags. */ + public tags: string[]; + + /** + * Creates a new AllocationPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns AllocationPolicy instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IAllocationPolicy): google.cloud.batch.v1alpha.AllocationPolicy; + + /** + * Encodes the specified AllocationPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.verify|verify} messages. + * @param message AllocationPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IAllocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AllocationPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.verify|verify} messages. + * @param message AllocationPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IAllocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AllocationPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AllocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy; + + /** + * Decodes an AllocationPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AllocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy; + + /** + * Verifies an AllocationPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AllocationPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AllocationPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy; + + /** + * Creates a plain object from an AllocationPolicy message. Also converts values to other types if specified. + * @param message AllocationPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AllocationPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AllocationPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AllocationPolicy { + + /** Properties of a LocationPolicy. */ + interface ILocationPolicy { + + /** LocationPolicy allowedLocations */ + allowedLocations?: (string[]|null); + + /** LocationPolicy deniedLocations */ + deniedLocations?: (string[]|null); + } + + /** Represents a LocationPolicy. */ + class LocationPolicy implements ILocationPolicy { + + /** + * Constructs a new LocationPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy); + + /** LocationPolicy allowedLocations. */ + public allowedLocations: string[]; + + /** LocationPolicy deniedLocations. */ + public deniedLocations: string[]; + + /** + * Creates a new LocationPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns LocationPolicy instance + */ + public static create(properties?: google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy): google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy; + + /** + * Encodes the specified LocationPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.verify|verify} messages. + * @param message LocationPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocationPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.verify|verify} messages. + * @param message LocationPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocationPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy; + + /** + * Decodes a LocationPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy; + + /** + * Verifies a LocationPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LocationPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocationPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy; + + /** + * Creates a plain object from a LocationPolicy message. Also converts values to other types if specified. + * @param message LocationPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocationPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LocationPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Disk. */ + interface IDisk { + + /** Disk image */ + image?: (string|null); + + /** Disk snapshot */ + snapshot?: (string|null); + + /** Disk type */ + type?: (string|null); + + /** Disk sizeGb */ + sizeGb?: (number|Long|string|null); + + /** Disk diskInterface */ + diskInterface?: (string|null); + } + + /** Represents a Disk. */ + class Disk implements IDisk { + + /** + * Constructs a new Disk. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IDisk); + + /** Disk image. */ + public image?: (string|null); + + /** Disk snapshot. */ + public snapshot?: (string|null); + + /** Disk type. */ + public type: string; + + /** Disk sizeGb. */ + public sizeGb: (number|Long|string); + + /** Disk diskInterface. */ + public diskInterface: string; + + /** Disk dataSource. */ + public dataSource?: ("image"|"snapshot"); + + /** + * Creates a new Disk instance using the specified properties. + * @param [properties] Properties to set + * @returns Disk instance + */ + public static create(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IDisk): google.cloud.batch.v1alpha.AllocationPolicy.Disk; + + /** + * Encodes the specified Disk message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.Disk.verify|verify} messages. + * @param message Disk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.AllocationPolicy.IDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Disk message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.Disk.verify|verify} messages. + * @param message Disk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.AllocationPolicy.IDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Disk message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Disk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy.Disk; + + /** + * Decodes a Disk message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Disk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy.Disk; + + /** + * Verifies a Disk message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Disk message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Disk + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy.Disk; + + /** + * Creates a plain object from a Disk message. Also converts values to other types if specified. + * @param message Disk + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy.Disk, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Disk to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Disk + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AttachedDisk. */ + interface IAttachedDisk { + + /** AttachedDisk newDisk */ + newDisk?: (google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null); + + /** AttachedDisk existingDisk */ + existingDisk?: (string|null); + + /** AttachedDisk deviceName */ + deviceName?: (string|null); + } + + /** Represents an AttachedDisk. */ + class AttachedDisk implements IAttachedDisk { + + /** + * Constructs a new AttachedDisk. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk); + + /** AttachedDisk newDisk. */ + public newDisk?: (google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null); + + /** AttachedDisk existingDisk. */ + public existingDisk?: (string|null); + + /** AttachedDisk deviceName. */ + public deviceName: string; + + /** AttachedDisk attached. */ + public attached?: ("newDisk"|"existingDisk"); + + /** + * Creates a new AttachedDisk instance using the specified properties. + * @param [properties] Properties to set + * @returns AttachedDisk instance + */ + public static create(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk): google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk; + + /** + * Encodes the specified AttachedDisk message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.verify|verify} messages. + * @param message AttachedDisk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttachedDisk message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.verify|verify} messages. + * @param message AttachedDisk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttachedDisk message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttachedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk; + + /** + * Decodes an AttachedDisk message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttachedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk; + + /** + * Verifies an AttachedDisk message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AttachedDisk message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttachedDisk + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk; + + /** + * Creates a plain object from an AttachedDisk message. Also converts values to other types if specified. + * @param message AttachedDisk + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttachedDisk to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AttachedDisk + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Accelerator. */ + interface IAccelerator { + + /** Accelerator type */ + type?: (string|null); + + /** Accelerator count */ + count?: (number|Long|string|null); + + /** Accelerator installGpuDrivers */ + installGpuDrivers?: (boolean|null); + + /** Accelerator driverVersion */ + driverVersion?: (string|null); + } + + /** Represents an Accelerator. */ + class Accelerator implements IAccelerator { + + /** + * Constructs a new Accelerator. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator); + + /** Accelerator type. */ + public type: string; + + /** Accelerator count. */ + public count: (number|Long|string); + + /** Accelerator installGpuDrivers. */ + public installGpuDrivers: boolean; + + /** Accelerator driverVersion. */ + public driverVersion: string; + + /** + * Creates a new Accelerator instance using the specified properties. + * @param [properties] Properties to set + * @returns Accelerator instance + */ + public static create(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator): google.cloud.batch.v1alpha.AllocationPolicy.Accelerator; + + /** + * Encodes the specified Accelerator message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.verify|verify} messages. + * @param message Accelerator message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Accelerator message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.verify|verify} messages. + * @param message Accelerator message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Accelerator message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Accelerator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy.Accelerator; + + /** + * Decodes an Accelerator message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Accelerator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy.Accelerator; + + /** + * Verifies an Accelerator message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Accelerator message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Accelerator + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy.Accelerator; + + /** + * Creates a plain object from an Accelerator message. Also converts values to other types if specified. + * @param message Accelerator + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy.Accelerator, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Accelerator to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Accelerator + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InstancePolicy. */ + interface IInstancePolicy { + + /** InstancePolicy allowedMachineTypes */ + allowedMachineTypes?: (string[]|null); + + /** InstancePolicy machineType */ + machineType?: (string|null); + + /** InstancePolicy minCpuPlatform */ + minCpuPlatform?: (string|null); + + /** InstancePolicy provisioningModel */ + provisioningModel?: (google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel|keyof typeof google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel|null); + + /** InstancePolicy accelerators */ + accelerators?: (google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator[]|null); + + /** InstancePolicy bootDisk */ + bootDisk?: (google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null); + + /** InstancePolicy disks */ + disks?: (google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk[]|null); + + /** InstancePolicy reservation */ + reservation?: (string|null); + } + + /** Represents an InstancePolicy. */ + class InstancePolicy implements IInstancePolicy { + + /** + * Constructs a new InstancePolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy); + + /** InstancePolicy allowedMachineTypes. */ + public allowedMachineTypes: string[]; + + /** InstancePolicy machineType. */ + public machineType: string; + + /** InstancePolicy minCpuPlatform. */ + public minCpuPlatform: string; + + /** InstancePolicy provisioningModel. */ + public provisioningModel: (google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel|keyof typeof google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel); + + /** InstancePolicy accelerators. */ + public accelerators: google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator[]; + + /** InstancePolicy bootDisk. */ + public bootDisk?: (google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null); + + /** InstancePolicy disks. */ + public disks: google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk[]; + + /** InstancePolicy reservation. */ + public reservation: string; + + /** + * Creates a new InstancePolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns InstancePolicy instance + */ + public static create(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy): google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy; + + /** + * Encodes the specified InstancePolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.verify|verify} messages. + * @param message InstancePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstancePolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.verify|verify} messages. + * @param message InstancePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstancePolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstancePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy; + + /** + * Decodes an InstancePolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstancePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy; + + /** + * Verifies an InstancePolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstancePolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstancePolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy; + + /** + * Creates a plain object from an InstancePolicy message. Also converts values to other types if specified. + * @param message InstancePolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstancePolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstancePolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InstancePolicyOrTemplate. */ + interface IInstancePolicyOrTemplate { + + /** InstancePolicyOrTemplate policy */ + policy?: (google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy|null); + + /** InstancePolicyOrTemplate instanceTemplate */ + instanceTemplate?: (string|null); + + /** InstancePolicyOrTemplate installGpuDrivers */ + installGpuDrivers?: (boolean|null); + + /** InstancePolicyOrTemplate installOpsAgent */ + installOpsAgent?: (boolean|null); + + /** InstancePolicyOrTemplate blockProjectSshKeys */ + blockProjectSshKeys?: (boolean|null); + } + + /** Represents an InstancePolicyOrTemplate. */ + class InstancePolicyOrTemplate implements IInstancePolicyOrTemplate { + + /** + * Constructs a new InstancePolicyOrTemplate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate); + + /** InstancePolicyOrTemplate policy. */ + public policy?: (google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy|null); + + /** InstancePolicyOrTemplate instanceTemplate. */ + public instanceTemplate?: (string|null); + + /** InstancePolicyOrTemplate installGpuDrivers. */ + public installGpuDrivers: boolean; + + /** InstancePolicyOrTemplate installOpsAgent. */ + public installOpsAgent: boolean; + + /** InstancePolicyOrTemplate blockProjectSshKeys. */ + public blockProjectSshKeys: boolean; + + /** InstancePolicyOrTemplate policyTemplate. */ + public policyTemplate?: ("policy"|"instanceTemplate"); + + /** + * Creates a new InstancePolicyOrTemplate instance using the specified properties. + * @param [properties] Properties to set + * @returns InstancePolicyOrTemplate instance + */ + public static create(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate): google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate; + + /** + * Encodes the specified InstancePolicyOrTemplate message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.verify|verify} messages. + * @param message InstancePolicyOrTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstancePolicyOrTemplate message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.verify|verify} messages. + * @param message InstancePolicyOrTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstancePolicyOrTemplate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstancePolicyOrTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate; + + /** + * Decodes an InstancePolicyOrTemplate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstancePolicyOrTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate; + + /** + * Verifies an InstancePolicyOrTemplate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstancePolicyOrTemplate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstancePolicyOrTemplate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate; + + /** + * Creates a plain object from an InstancePolicyOrTemplate message. Also converts values to other types if specified. + * @param message InstancePolicyOrTemplate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstancePolicyOrTemplate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstancePolicyOrTemplate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NetworkInterface. */ + interface INetworkInterface { + + /** NetworkInterface network */ + network?: (string|null); + + /** NetworkInterface subnetwork */ + subnetwork?: (string|null); + + /** NetworkInterface noExternalIpAddress */ + noExternalIpAddress?: (boolean|null); + } + + /** Represents a NetworkInterface. */ + class NetworkInterface implements INetworkInterface { + + /** + * Constructs a new NetworkInterface. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface); + + /** NetworkInterface network. */ + public network: string; + + /** NetworkInterface subnetwork. */ + public subnetwork: string; + + /** NetworkInterface noExternalIpAddress. */ + public noExternalIpAddress: boolean; + + /** + * Creates a new NetworkInterface instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkInterface instance + */ + public static create(properties?: google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface): google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface; + + /** + * Encodes the specified NetworkInterface message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.verify|verify} messages. + * @param message NetworkInterface message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkInterface message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.verify|verify} messages. + * @param message NetworkInterface message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface; + + /** + * Verifies a NetworkInterface message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkInterface message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkInterface + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface; + + /** + * Creates a plain object from a NetworkInterface message. Also converts values to other types if specified. + * @param message NetworkInterface + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkInterface to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NetworkInterface + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NetworkPolicy. */ + interface INetworkPolicy { + + /** NetworkPolicy networkInterfaces */ + networkInterfaces?: (google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface[]|null); + } + + /** Represents a NetworkPolicy. */ + class NetworkPolicy implements INetworkPolicy { + + /** + * Constructs a new NetworkPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy); + + /** NetworkPolicy networkInterfaces. */ + public networkInterfaces: google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface[]; + + /** + * Creates a new NetworkPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkPolicy instance + */ + public static create(properties?: google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy): google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy; + + /** + * Encodes the specified NetworkPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.verify|verify} messages. + * @param message NetworkPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.verify|verify} messages. + * @param message NetworkPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy; + + /** + * Decodes a NetworkPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy; + + /** + * Verifies a NetworkPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy; + + /** + * Creates a plain object from a NetworkPolicy message. Also converts values to other types if specified. + * @param message NetworkPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NetworkPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PlacementPolicy. */ + interface IPlacementPolicy { + + /** PlacementPolicy collocation */ + collocation?: (string|null); + + /** PlacementPolicy maxDistance */ + maxDistance?: (number|Long|string|null); + } + + /** Represents a PlacementPolicy. */ + class PlacementPolicy implements IPlacementPolicy { + + /** + * Constructs a new PlacementPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy); + + /** PlacementPolicy collocation. */ + public collocation: string; + + /** PlacementPolicy maxDistance. */ + public maxDistance: (number|Long|string); + + /** + * Creates a new PlacementPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns PlacementPolicy instance + */ + public static create(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy): google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy; + + /** + * Encodes the specified PlacementPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.verify|verify} messages. + * @param message PlacementPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PlacementPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.verify|verify} messages. + * @param message PlacementPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PlacementPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PlacementPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy; + + /** + * Decodes a PlacementPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PlacementPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy; + + /** + * Verifies a PlacementPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PlacementPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PlacementPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy; + + /** + * Creates a plain object from a PlacementPolicy message. Also converts values to other types if specified. + * @param message PlacementPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PlacementPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PlacementPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ProvisioningModel enum. */ + enum ProvisioningModel { + PROVISIONING_MODEL_UNSPECIFIED = 0, + STANDARD = 1, + SPOT = 2, + PREEMPTIBLE = 3 + } + } + + /** Properties of a TaskGroup. */ + interface ITaskGroup { + + /** TaskGroup name */ + name?: (string|null); + + /** TaskGroup taskSpec */ + taskSpec?: (google.cloud.batch.v1alpha.ITaskSpec|null); + + /** TaskGroup taskCount */ + taskCount?: (number|Long|string|null); + + /** TaskGroup parallelism */ + parallelism?: (number|Long|string|null); + + /** TaskGroup schedulingPolicy */ + schedulingPolicy?: (google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy|keyof typeof google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy|null); + + /** TaskGroup allocationPolicy */ + allocationPolicy?: (google.cloud.batch.v1alpha.IAllocationPolicy|null); + + /** TaskGroup labels */ + labels?: ({ [k: string]: string }|null); + + /** TaskGroup taskEnvironments */ + taskEnvironments?: (google.cloud.batch.v1alpha.IEnvironment[]|null); + + /** TaskGroup taskCountPerNode */ + taskCountPerNode?: (number|Long|string|null); + + /** TaskGroup requireHostsFile */ + requireHostsFile?: (boolean|null); + + /** TaskGroup permissiveSsh */ + permissiveSsh?: (boolean|null); + + /** TaskGroup runAsNonRoot */ + runAsNonRoot?: (boolean|null); + + /** TaskGroup serviceAccount */ + serviceAccount?: (google.cloud.batch.v1alpha.IServiceAccount|null); + } + + /** Represents a TaskGroup. */ + class TaskGroup implements ITaskGroup { + + /** + * Constructs a new TaskGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.ITaskGroup); + + /** TaskGroup name. */ + public name: string; + + /** TaskGroup taskSpec. */ + public taskSpec?: (google.cloud.batch.v1alpha.ITaskSpec|null); + + /** TaskGroup taskCount. */ + public taskCount: (number|Long|string); + + /** TaskGroup parallelism. */ + public parallelism: (number|Long|string); + + /** TaskGroup schedulingPolicy. */ + public schedulingPolicy: (google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy|keyof typeof google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy); + + /** TaskGroup allocationPolicy. */ + public allocationPolicy?: (google.cloud.batch.v1alpha.IAllocationPolicy|null); + + /** TaskGroup labels. */ + public labels: { [k: string]: string }; + + /** TaskGroup taskEnvironments. */ + public taskEnvironments: google.cloud.batch.v1alpha.IEnvironment[]; + + /** TaskGroup taskCountPerNode. */ + public taskCountPerNode: (number|Long|string); + + /** TaskGroup requireHostsFile. */ + public requireHostsFile: boolean; + + /** TaskGroup permissiveSsh. */ + public permissiveSsh: boolean; + + /** TaskGroup runAsNonRoot. */ + public runAsNonRoot: boolean; + + /** TaskGroup serviceAccount. */ + public serviceAccount?: (google.cloud.batch.v1alpha.IServiceAccount|null); + + /** + * Creates a new TaskGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns TaskGroup instance + */ + public static create(properties?: google.cloud.batch.v1alpha.ITaskGroup): google.cloud.batch.v1alpha.TaskGroup; + + /** + * Encodes the specified TaskGroup message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskGroup.verify|verify} messages. + * @param message TaskGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.ITaskGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TaskGroup message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskGroup.verify|verify} messages. + * @param message TaskGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.ITaskGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TaskGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TaskGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.TaskGroup; + + /** + * Decodes a TaskGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TaskGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.TaskGroup; + + /** + * Verifies a TaskGroup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TaskGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TaskGroup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.TaskGroup; + + /** + * Creates a plain object from a TaskGroup message. Also converts values to other types if specified. + * @param message TaskGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.TaskGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TaskGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TaskGroup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TaskGroup { + + /** SchedulingPolicy enum. */ + enum SchedulingPolicy { + SCHEDULING_POLICY_UNSPECIFIED = 0, + AS_SOON_AS_POSSIBLE = 1, + IN_ORDER = 2 + } + } + + /** Properties of a ServiceAccount. */ + interface IServiceAccount { + + /** ServiceAccount email */ + email?: (string|null); + + /** ServiceAccount scopes */ + scopes?: (string[]|null); + } + + /** Represents a ServiceAccount. */ + class ServiceAccount implements IServiceAccount { + + /** + * Constructs a new ServiceAccount. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IServiceAccount); + + /** ServiceAccount email. */ + public email: string; + + /** ServiceAccount scopes. */ + public scopes: string[]; + + /** + * Creates a new ServiceAccount instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceAccount instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IServiceAccount): google.cloud.batch.v1alpha.ServiceAccount; + + /** + * Encodes the specified ServiceAccount message. Does not implicitly {@link google.cloud.batch.v1alpha.ServiceAccount.verify|verify} messages. + * @param message ServiceAccount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IServiceAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceAccount message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ServiceAccount.verify|verify} messages. + * @param message ServiceAccount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IServiceAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceAccount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ServiceAccount; + + /** + * Decodes a ServiceAccount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ServiceAccount; + + /** + * Verifies a ServiceAccount message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceAccount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceAccount + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ServiceAccount; + + /** + * Creates a plain object from a ServiceAccount message. Also converts values to other types if specified. + * @param message ServiceAccount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.ServiceAccount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceAccount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceAccount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ComputeResource. */ + interface IComputeResource { + + /** ComputeResource cpuMilli */ + cpuMilli?: (number|Long|string|null); + + /** ComputeResource memoryMib */ + memoryMib?: (number|Long|string|null); + + /** ComputeResource gpuCount */ + gpuCount?: (number|Long|string|null); + + /** ComputeResource bootDiskMib */ + bootDiskMib?: (number|Long|string|null); + } + + /** Represents a ComputeResource. */ + class ComputeResource implements IComputeResource { + + /** + * Constructs a new ComputeResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IComputeResource); + + /** ComputeResource cpuMilli. */ + public cpuMilli: (number|Long|string); + + /** ComputeResource memoryMib. */ + public memoryMib: (number|Long|string); + + /** ComputeResource gpuCount. */ + public gpuCount: (number|Long|string); + + /** ComputeResource bootDiskMib. */ + public bootDiskMib: (number|Long|string); + + /** + * Creates a new ComputeResource instance using the specified properties. + * @param [properties] Properties to set + * @returns ComputeResource instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IComputeResource): google.cloud.batch.v1alpha.ComputeResource; + + /** + * Encodes the specified ComputeResource message. Does not implicitly {@link google.cloud.batch.v1alpha.ComputeResource.verify|verify} messages. + * @param message ComputeResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IComputeResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ComputeResource message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ComputeResource.verify|verify} messages. + * @param message ComputeResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IComputeResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ComputeResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ComputeResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ComputeResource; + + /** + * Decodes a ComputeResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ComputeResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ComputeResource; + + /** + * Verifies a ComputeResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ComputeResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ComputeResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ComputeResource; + + /** + * Creates a plain object from a ComputeResource message. Also converts values to other types if specified. + * @param message ComputeResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.ComputeResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ComputeResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ComputeResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StatusEvent. */ + interface IStatusEvent { + + /** StatusEvent type */ + type?: (string|null); + + /** StatusEvent description */ + description?: (string|null); + + /** StatusEvent eventTime */ + eventTime?: (google.protobuf.ITimestamp|null); + + /** StatusEvent taskExecution */ + taskExecution?: (google.cloud.batch.v1alpha.ITaskExecution|null); + + /** StatusEvent taskState */ + taskState?: (google.cloud.batch.v1alpha.TaskStatus.State|keyof typeof google.cloud.batch.v1alpha.TaskStatus.State|null); + } + + /** Represents a StatusEvent. */ + class StatusEvent implements IStatusEvent { + + /** + * Constructs a new StatusEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IStatusEvent); + + /** StatusEvent type. */ + public type: string; + + /** StatusEvent description. */ + public description: string; + + /** StatusEvent eventTime. */ + public eventTime?: (google.protobuf.ITimestamp|null); + + /** StatusEvent taskExecution. */ + public taskExecution?: (google.cloud.batch.v1alpha.ITaskExecution|null); + + /** StatusEvent taskState. */ + public taskState: (google.cloud.batch.v1alpha.TaskStatus.State|keyof typeof google.cloud.batch.v1alpha.TaskStatus.State); + + /** + * Creates a new StatusEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns StatusEvent instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IStatusEvent): google.cloud.batch.v1alpha.StatusEvent; + + /** + * Encodes the specified StatusEvent message. Does not implicitly {@link google.cloud.batch.v1alpha.StatusEvent.verify|verify} messages. + * @param message StatusEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IStatusEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StatusEvent message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.StatusEvent.verify|verify} messages. + * @param message StatusEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IStatusEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StatusEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StatusEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.StatusEvent; + + /** + * Decodes a StatusEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StatusEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.StatusEvent; + + /** + * Verifies a StatusEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StatusEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StatusEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.StatusEvent; + + /** + * Creates a plain object from a StatusEvent message. Also converts values to other types if specified. + * @param message StatusEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.StatusEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StatusEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StatusEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TaskExecution. */ + interface ITaskExecution { + + /** TaskExecution exitCode */ + exitCode?: (number|null); + + /** TaskExecution stderrSnippet */ + stderrSnippet?: (string|null); + } + + /** Represents a TaskExecution. */ + class TaskExecution implements ITaskExecution { + + /** + * Constructs a new TaskExecution. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.ITaskExecution); + + /** TaskExecution exitCode. */ + public exitCode: number; + + /** TaskExecution stderrSnippet. */ + public stderrSnippet: string; + + /** + * Creates a new TaskExecution instance using the specified properties. + * @param [properties] Properties to set + * @returns TaskExecution instance + */ + public static create(properties?: google.cloud.batch.v1alpha.ITaskExecution): google.cloud.batch.v1alpha.TaskExecution; + + /** + * Encodes the specified TaskExecution message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskExecution.verify|verify} messages. + * @param message TaskExecution message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.ITaskExecution, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TaskExecution message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskExecution.verify|verify} messages. + * @param message TaskExecution message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.ITaskExecution, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TaskExecution message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TaskExecution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.TaskExecution; + + /** + * Decodes a TaskExecution message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TaskExecution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.TaskExecution; + + /** + * Verifies a TaskExecution message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TaskExecution message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TaskExecution + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.TaskExecution; + + /** + * Creates a plain object from a TaskExecution message. Also converts values to other types if specified. + * @param message TaskExecution + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.TaskExecution, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TaskExecution to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TaskExecution + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TaskStatus. */ + interface ITaskStatus { + + /** TaskStatus state */ + state?: (google.cloud.batch.v1alpha.TaskStatus.State|keyof typeof google.cloud.batch.v1alpha.TaskStatus.State|null); + + /** TaskStatus statusEvents */ + statusEvents?: (google.cloud.batch.v1alpha.IStatusEvent[]|null); + + /** TaskStatus resourceUsage */ + resourceUsage?: (google.cloud.batch.v1alpha.ITaskResourceUsage|null); + } + + /** Represents a TaskStatus. */ + class TaskStatus implements ITaskStatus { + + /** + * Constructs a new TaskStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.ITaskStatus); + + /** TaskStatus state. */ + public state: (google.cloud.batch.v1alpha.TaskStatus.State|keyof typeof google.cloud.batch.v1alpha.TaskStatus.State); + + /** TaskStatus statusEvents. */ + public statusEvents: google.cloud.batch.v1alpha.IStatusEvent[]; + + /** TaskStatus resourceUsage. */ + public resourceUsage?: (google.cloud.batch.v1alpha.ITaskResourceUsage|null); + + /** + * Creates a new TaskStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns TaskStatus instance + */ + public static create(properties?: google.cloud.batch.v1alpha.ITaskStatus): google.cloud.batch.v1alpha.TaskStatus; + + /** + * Encodes the specified TaskStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskStatus.verify|verify} messages. + * @param message TaskStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.ITaskStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TaskStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskStatus.verify|verify} messages. + * @param message TaskStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.ITaskStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TaskStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TaskStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.TaskStatus; + + /** + * Decodes a TaskStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TaskStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.TaskStatus; + + /** + * Verifies a TaskStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TaskStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TaskStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.TaskStatus; + + /** + * Creates a plain object from a TaskStatus message. Also converts values to other types if specified. + * @param message TaskStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.TaskStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TaskStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TaskStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TaskStatus { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PENDING = 1, + ASSIGNED = 2, + RUNNING = 3, + FAILED = 4, + SUCCEEDED = 5, + UNEXECUTED = 6 + } + } + + /** Properties of a TaskResourceUsage. */ + interface ITaskResourceUsage { + + /** TaskResourceUsage coreHours */ + coreHours?: (number|null); + } + + /** Represents a TaskResourceUsage. */ + class TaskResourceUsage implements ITaskResourceUsage { + + /** + * Constructs a new TaskResourceUsage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.ITaskResourceUsage); + + /** TaskResourceUsage coreHours. */ + public coreHours: number; + + /** + * Creates a new TaskResourceUsage instance using the specified properties. + * @param [properties] Properties to set + * @returns TaskResourceUsage instance + */ + public static create(properties?: google.cloud.batch.v1alpha.ITaskResourceUsage): google.cloud.batch.v1alpha.TaskResourceUsage; + + /** + * Encodes the specified TaskResourceUsage message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskResourceUsage.verify|verify} messages. + * @param message TaskResourceUsage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.ITaskResourceUsage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TaskResourceUsage message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskResourceUsage.verify|verify} messages. + * @param message TaskResourceUsage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.ITaskResourceUsage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TaskResourceUsage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TaskResourceUsage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.TaskResourceUsage; + + /** + * Decodes a TaskResourceUsage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TaskResourceUsage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.TaskResourceUsage; + + /** + * Verifies a TaskResourceUsage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TaskResourceUsage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TaskResourceUsage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.TaskResourceUsage; + + /** + * Creates a plain object from a TaskResourceUsage message. Also converts values to other types if specified. + * @param message TaskResourceUsage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.TaskResourceUsage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TaskResourceUsage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TaskResourceUsage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Runnable. */ + interface IRunnable { + + /** Runnable container */ + container?: (google.cloud.batch.v1alpha.Runnable.IContainer|null); + + /** Runnable script */ + script?: (google.cloud.batch.v1alpha.Runnable.IScript|null); + + /** Runnable barrier */ + barrier?: (google.cloud.batch.v1alpha.Runnable.IBarrier|null); + + /** Runnable displayName */ + displayName?: (string|null); + + /** Runnable ignoreExitStatus */ + ignoreExitStatus?: (boolean|null); + + /** Runnable background */ + background?: (boolean|null); + + /** Runnable alwaysRun */ + alwaysRun?: (boolean|null); + + /** Runnable environment */ + environment?: (google.cloud.batch.v1alpha.IEnvironment|null); + + /** Runnable timeout */ + timeout?: (google.protobuf.IDuration|null); + + /** Runnable labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a Runnable. */ + class Runnable implements IRunnable { + + /** + * Constructs a new Runnable. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IRunnable); + + /** Runnable container. */ + public container?: (google.cloud.batch.v1alpha.Runnable.IContainer|null); + + /** Runnable script. */ + public script?: (google.cloud.batch.v1alpha.Runnable.IScript|null); + + /** Runnable barrier. */ + public barrier?: (google.cloud.batch.v1alpha.Runnable.IBarrier|null); + + /** Runnable displayName. */ + public displayName: string; + + /** Runnable ignoreExitStatus. */ + public ignoreExitStatus: boolean; + + /** Runnable background. */ + public background: boolean; + + /** Runnable alwaysRun. */ + public alwaysRun: boolean; + + /** Runnable environment. */ + public environment?: (google.cloud.batch.v1alpha.IEnvironment|null); + + /** Runnable timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** Runnable labels. */ + public labels: { [k: string]: string }; + + /** Runnable executable. */ + public executable?: ("container"|"script"|"barrier"); + + /** + * Creates a new Runnable instance using the specified properties. + * @param [properties] Properties to set + * @returns Runnable instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IRunnable): google.cloud.batch.v1alpha.Runnable; + + /** + * Encodes the specified Runnable message. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.verify|verify} messages. + * @param message Runnable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IRunnable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Runnable message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.verify|verify} messages. + * @param message Runnable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IRunnable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Runnable message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Runnable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Runnable; + + /** + * Decodes a Runnable message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Runnable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Runnable; + + /** + * Verifies a Runnable message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Runnable message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Runnable + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Runnable; + + /** + * Creates a plain object from a Runnable message. Also converts values to other types if specified. + * @param message Runnable + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.Runnable, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Runnable to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Runnable + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Runnable { + + /** Properties of a Container. */ + interface IContainer { + + /** Container imageUri */ + imageUri?: (string|null); + + /** Container commands */ + commands?: (string[]|null); + + /** Container entrypoint */ + entrypoint?: (string|null); + + /** Container volumes */ + volumes?: (string[]|null); + + /** Container options */ + options?: (string|null); + + /** Container blockExternalNetwork */ + blockExternalNetwork?: (boolean|null); + + /** Container username */ + username?: (string|null); + + /** Container password */ + password?: (string|null); + + /** Container enableImageStreaming */ + enableImageStreaming?: (boolean|null); + } + + /** Represents a Container. */ + class Container implements IContainer { + + /** + * Constructs a new Container. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.Runnable.IContainer); + + /** Container imageUri. */ + public imageUri: string; + + /** Container commands. */ + public commands: string[]; + + /** Container entrypoint. */ + public entrypoint: string; + + /** Container volumes. */ + public volumes: string[]; + + /** Container options. */ + public options: string; + + /** Container blockExternalNetwork. */ + public blockExternalNetwork: boolean; + + /** Container username. */ + public username: string; + + /** Container password. */ + public password: string; + + /** Container enableImageStreaming. */ + public enableImageStreaming: boolean; + + /** + * Creates a new Container instance using the specified properties. + * @param [properties] Properties to set + * @returns Container instance + */ + public static create(properties?: google.cloud.batch.v1alpha.Runnable.IContainer): google.cloud.batch.v1alpha.Runnable.Container; + + /** + * Encodes the specified Container message. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Container.verify|verify} messages. + * @param message Container message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.Runnable.IContainer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Container message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Container.verify|verify} messages. + * @param message Container message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.Runnable.IContainer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Container message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Container + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Runnable.Container; + + /** + * Decodes a Container message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Container + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Runnable.Container; + + /** + * Verifies a Container message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Container message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Container + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Runnable.Container; + + /** + * Creates a plain object from a Container message. Also converts values to other types if specified. + * @param message Container + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.Runnable.Container, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Container to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Container + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Script. */ + interface IScript { + + /** Script path */ + path?: (string|null); + + /** Script text */ + text?: (string|null); + } + + /** Represents a Script. */ + class Script implements IScript { + + /** + * Constructs a new Script. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.Runnable.IScript); + + /** Script path. */ + public path?: (string|null); + + /** Script text. */ + public text?: (string|null); + + /** Script command. */ + public command?: ("path"|"text"); + + /** + * Creates a new Script instance using the specified properties. + * @param [properties] Properties to set + * @returns Script instance + */ + public static create(properties?: google.cloud.batch.v1alpha.Runnable.IScript): google.cloud.batch.v1alpha.Runnable.Script; + + /** + * Encodes the specified Script message. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Script.verify|verify} messages. + * @param message Script message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.Runnable.IScript, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Script message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Script.verify|verify} messages. + * @param message Script message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.Runnable.IScript, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Script message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Script + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Runnable.Script; + + /** + * Decodes a Script message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Script + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Runnable.Script; + + /** + * Verifies a Script message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Script message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Script + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Runnable.Script; + + /** + * Creates a plain object from a Script message. Also converts values to other types if specified. + * @param message Script + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.Runnable.Script, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Script to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Script + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Barrier. */ + interface IBarrier { + + /** Barrier name */ + name?: (string|null); + } + + /** Represents a Barrier. */ + class Barrier implements IBarrier { + + /** + * Constructs a new Barrier. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.Runnable.IBarrier); + + /** Barrier name. */ + public name: string; + + /** + * Creates a new Barrier instance using the specified properties. + * @param [properties] Properties to set + * @returns Barrier instance + */ + public static create(properties?: google.cloud.batch.v1alpha.Runnable.IBarrier): google.cloud.batch.v1alpha.Runnable.Barrier; + + /** + * Encodes the specified Barrier message. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Barrier.verify|verify} messages. + * @param message Barrier message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.Runnable.IBarrier, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Barrier message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Barrier.verify|verify} messages. + * @param message Barrier message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.Runnable.IBarrier, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Barrier message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Barrier + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Runnable.Barrier; + + /** + * Decodes a Barrier message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Barrier + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Runnable.Barrier; + + /** + * Verifies a Barrier message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Barrier message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Barrier + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Runnable.Barrier; + + /** + * Creates a plain object from a Barrier message. Also converts values to other types if specified. + * @param message Barrier + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.Runnable.Barrier, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Barrier to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Barrier + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TaskSpec. */ + interface ITaskSpec { + + /** TaskSpec runnables */ + runnables?: (google.cloud.batch.v1alpha.IRunnable[]|null); + + /** TaskSpec computeResource */ + computeResource?: (google.cloud.batch.v1alpha.IComputeResource|null); + + /** TaskSpec maxRunDuration */ + maxRunDuration?: (google.protobuf.IDuration|null); + + /** TaskSpec maxRetryCount */ + maxRetryCount?: (number|null); + + /** TaskSpec lifecyclePolicies */ + lifecyclePolicies?: (google.cloud.batch.v1alpha.ILifecyclePolicy[]|null); + + /** TaskSpec environments */ + environments?: ({ [k: string]: string }|null); + + /** TaskSpec volumes */ + volumes?: (google.cloud.batch.v1alpha.IVolume[]|null); + + /** TaskSpec environment */ + environment?: (google.cloud.batch.v1alpha.IEnvironment|null); + } + + /** Represents a TaskSpec. */ + class TaskSpec implements ITaskSpec { + + /** + * Constructs a new TaskSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.ITaskSpec); + + /** TaskSpec runnables. */ + public runnables: google.cloud.batch.v1alpha.IRunnable[]; + + /** TaskSpec computeResource. */ + public computeResource?: (google.cloud.batch.v1alpha.IComputeResource|null); + + /** TaskSpec maxRunDuration. */ + public maxRunDuration?: (google.protobuf.IDuration|null); + + /** TaskSpec maxRetryCount. */ + public maxRetryCount: number; + + /** TaskSpec lifecyclePolicies. */ + public lifecyclePolicies: google.cloud.batch.v1alpha.ILifecyclePolicy[]; + + /** TaskSpec environments. */ + public environments: { [k: string]: string }; + + /** TaskSpec volumes. */ + public volumes: google.cloud.batch.v1alpha.IVolume[]; + + /** TaskSpec environment. */ + public environment?: (google.cloud.batch.v1alpha.IEnvironment|null); + + /** + * Creates a new TaskSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns TaskSpec instance + */ + public static create(properties?: google.cloud.batch.v1alpha.ITaskSpec): google.cloud.batch.v1alpha.TaskSpec; + + /** + * Encodes the specified TaskSpec message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskSpec.verify|verify} messages. + * @param message TaskSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.ITaskSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TaskSpec message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskSpec.verify|verify} messages. + * @param message TaskSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.ITaskSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TaskSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TaskSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.TaskSpec; + + /** + * Decodes a TaskSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TaskSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.TaskSpec; + + /** + * Verifies a TaskSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TaskSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TaskSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.TaskSpec; + + /** + * Creates a plain object from a TaskSpec message. Also converts values to other types if specified. + * @param message TaskSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.TaskSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TaskSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TaskSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LifecyclePolicy. */ + interface ILifecyclePolicy { + + /** LifecyclePolicy action */ + action?: (google.cloud.batch.v1alpha.LifecyclePolicy.Action|keyof typeof google.cloud.batch.v1alpha.LifecyclePolicy.Action|null); + + /** LifecyclePolicy actionCondition */ + actionCondition?: (google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition|null); + } + + /** Represents a LifecyclePolicy. */ + class LifecyclePolicy implements ILifecyclePolicy { + + /** + * Constructs a new LifecyclePolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.ILifecyclePolicy); + + /** LifecyclePolicy action. */ + public action: (google.cloud.batch.v1alpha.LifecyclePolicy.Action|keyof typeof google.cloud.batch.v1alpha.LifecyclePolicy.Action); + + /** LifecyclePolicy actionCondition. */ + public actionCondition?: (google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition|null); + + /** + * Creates a new LifecyclePolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns LifecyclePolicy instance + */ + public static create(properties?: google.cloud.batch.v1alpha.ILifecyclePolicy): google.cloud.batch.v1alpha.LifecyclePolicy; + + /** + * Encodes the specified LifecyclePolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.LifecyclePolicy.verify|verify} messages. + * @param message LifecyclePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.ILifecyclePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LifecyclePolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.LifecyclePolicy.verify|verify} messages. + * @param message LifecyclePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.ILifecyclePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LifecyclePolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LifecyclePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.LifecyclePolicy; + + /** + * Decodes a LifecyclePolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LifecyclePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.LifecyclePolicy; + + /** + * Verifies a LifecyclePolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LifecyclePolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LifecyclePolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.LifecyclePolicy; + + /** + * Creates a plain object from a LifecyclePolicy message. Also converts values to other types if specified. + * @param message LifecyclePolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.LifecyclePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LifecyclePolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LifecyclePolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LifecyclePolicy { + + /** Properties of an ActionCondition. */ + interface IActionCondition { + + /** ActionCondition exitCodes */ + exitCodes?: (number[]|null); + } + + /** Represents an ActionCondition. */ + class ActionCondition implements IActionCondition { + + /** + * Constructs a new ActionCondition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition); + + /** ActionCondition exitCodes. */ + public exitCodes: number[]; + + /** + * Creates a new ActionCondition instance using the specified properties. + * @param [properties] Properties to set + * @returns ActionCondition instance + */ + public static create(properties?: google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition): google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition; + + /** + * Encodes the specified ActionCondition message. Does not implicitly {@link google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.verify|verify} messages. + * @param message ActionCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ActionCondition message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.verify|verify} messages. + * @param message ActionCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ActionCondition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ActionCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition; + + /** + * Decodes an ActionCondition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ActionCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition; + + /** + * Verifies an ActionCondition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ActionCondition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ActionCondition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition; + + /** + * Creates a plain object from an ActionCondition message. Also converts values to other types if specified. + * @param message ActionCondition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ActionCondition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ActionCondition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + RETRY_TASK = 1, + FAIL_TASK = 2 + } + } + + /** Properties of a Task. */ + interface ITask { + + /** Task name */ + name?: (string|null); + + /** Task status */ + status?: (google.cloud.batch.v1alpha.ITaskStatus|null); + } + + /** Represents a Task. */ + class Task implements ITask { + + /** + * Constructs a new Task. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.ITask); + + /** Task name. */ + public name: string; + + /** Task status. */ + public status?: (google.cloud.batch.v1alpha.ITaskStatus|null); + + /** + * Creates a new Task instance using the specified properties. + * @param [properties] Properties to set + * @returns Task instance + */ + public static create(properties?: google.cloud.batch.v1alpha.ITask): google.cloud.batch.v1alpha.Task; + + /** + * Encodes the specified Task message. Does not implicitly {@link google.cloud.batch.v1alpha.Task.verify|verify} messages. + * @param message Task message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.ITask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Task message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Task.verify|verify} messages. + * @param message Task message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.ITask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Task message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Task + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Task; + + /** + * Decodes a Task message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Task + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Task; + + /** + * Verifies a Task message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Task message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Task + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Task; + + /** + * Creates a plain object from a Task message. Also converts values to other types if specified. + * @param message Task + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.Task, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Task to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Task + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Environment. */ + interface IEnvironment { + + /** Environment variables */ + variables?: ({ [k: string]: string }|null); + + /** Environment secretVariables */ + secretVariables?: ({ [k: string]: string }|null); + + /** Environment encryptedVariables */ + encryptedVariables?: (google.cloud.batch.v1alpha.Environment.IKMSEnvMap|null); + } + + /** Represents an Environment. */ + class Environment implements IEnvironment { + + /** + * Constructs a new Environment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IEnvironment); + + /** Environment variables. */ + public variables: { [k: string]: string }; + + /** Environment secretVariables. */ + public secretVariables: { [k: string]: string }; + + /** Environment encryptedVariables. */ + public encryptedVariables?: (google.cloud.batch.v1alpha.Environment.IKMSEnvMap|null); + + /** + * Creates a new Environment instance using the specified properties. + * @param [properties] Properties to set + * @returns Environment instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IEnvironment): google.cloud.batch.v1alpha.Environment; + + /** + * Encodes the specified Environment message. Does not implicitly {@link google.cloud.batch.v1alpha.Environment.verify|verify} messages. + * @param message Environment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Environment.verify|verify} messages. + * @param message Environment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Environment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Environment; + + /** + * Decodes an Environment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Environment; + + /** + * Verifies an Environment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Environment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Environment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Environment; + + /** + * Creates a plain object from an Environment message. Also converts values to other types if specified. + * @param message Environment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.Environment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Environment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Environment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Environment { + + /** Properties of a KMSEnvMap. */ + interface IKMSEnvMap { + + /** KMSEnvMap keyName */ + keyName?: (string|null); + + /** KMSEnvMap cipherText */ + cipherText?: (string|null); + } + + /** Represents a KMSEnvMap. */ + class KMSEnvMap implements IKMSEnvMap { + + /** + * Constructs a new KMSEnvMap. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.Environment.IKMSEnvMap); + + /** KMSEnvMap keyName. */ + public keyName: string; + + /** KMSEnvMap cipherText. */ + public cipherText: string; + + /** + * Creates a new KMSEnvMap instance using the specified properties. + * @param [properties] Properties to set + * @returns KMSEnvMap instance + */ + public static create(properties?: google.cloud.batch.v1alpha.Environment.IKMSEnvMap): google.cloud.batch.v1alpha.Environment.KMSEnvMap; + + /** + * Encodes the specified KMSEnvMap message. Does not implicitly {@link google.cloud.batch.v1alpha.Environment.KMSEnvMap.verify|verify} messages. + * @param message KMSEnvMap message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.Environment.IKMSEnvMap, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KMSEnvMap message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Environment.KMSEnvMap.verify|verify} messages. + * @param message KMSEnvMap message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.Environment.IKMSEnvMap, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KMSEnvMap message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KMSEnvMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Environment.KMSEnvMap; + + /** + * Decodes a KMSEnvMap message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KMSEnvMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Environment.KMSEnvMap; + + /** + * Verifies a KMSEnvMap message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a KMSEnvMap message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KMSEnvMap + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Environment.KMSEnvMap; + + /** + * Creates a plain object from a KMSEnvMap message. Also converts values to other types if specified. + * @param message KMSEnvMap + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.Environment.KMSEnvMap, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KMSEnvMap to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KMSEnvMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Volume. */ + interface IVolume { + + /** Volume nfs */ + nfs?: (google.cloud.batch.v1alpha.INFS|null); + + /** Volume pd */ + pd?: (google.cloud.batch.v1alpha.IPD|null); + + /** Volume gcs */ + gcs?: (google.cloud.batch.v1alpha.IGCS|null); + + /** Volume deviceName */ + deviceName?: (string|null); + + /** Volume mountPath */ + mountPath?: (string|null); + + /** Volume mountOptions */ + mountOptions?: (string[]|null); + } + + /** Represents a Volume. */ + class Volume implements IVolume { + + /** + * Constructs a new Volume. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IVolume); + + /** Volume nfs. */ + public nfs?: (google.cloud.batch.v1alpha.INFS|null); + + /** Volume pd. */ + public pd?: (google.cloud.batch.v1alpha.IPD|null); + + /** Volume gcs. */ + public gcs?: (google.cloud.batch.v1alpha.IGCS|null); + + /** Volume deviceName. */ + public deviceName?: (string|null); + + /** Volume mountPath. */ + public mountPath: string; + + /** Volume mountOptions. */ + public mountOptions: string[]; + + /** Volume source. */ + public source?: ("nfs"|"pd"|"gcs"|"deviceName"); + + /** + * Creates a new Volume instance using the specified properties. + * @param [properties] Properties to set + * @returns Volume instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IVolume): google.cloud.batch.v1alpha.Volume; + + /** + * Encodes the specified Volume message. Does not implicitly {@link google.cloud.batch.v1alpha.Volume.verify|verify} messages. + * @param message Volume message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IVolume, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Volume message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Volume.verify|verify} messages. + * @param message Volume message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IVolume, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Volume message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Volume + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Volume; + + /** + * Decodes a Volume message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Volume + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Volume; + + /** + * Verifies a Volume message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Volume message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Volume + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Volume; + + /** + * Creates a plain object from a Volume message. Also converts values to other types if specified. + * @param message Volume + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.Volume, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Volume to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Volume + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NFS. */ + interface INFS { + + /** NFS server */ + server?: (string|null); + + /** NFS remotePath */ + remotePath?: (string|null); + } + + /** Represents a NFS. */ + class NFS implements INFS { + + /** + * Constructs a new NFS. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.INFS); + + /** NFS server. */ + public server: string; + + /** NFS remotePath. */ + public remotePath: string; + + /** + * Creates a new NFS instance using the specified properties. + * @param [properties] Properties to set + * @returns NFS instance + */ + public static create(properties?: google.cloud.batch.v1alpha.INFS): google.cloud.batch.v1alpha.NFS; + + /** + * Encodes the specified NFS message. Does not implicitly {@link google.cloud.batch.v1alpha.NFS.verify|verify} messages. + * @param message NFS message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.INFS, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NFS message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.NFS.verify|verify} messages. + * @param message NFS message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.INFS, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NFS message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NFS + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.NFS; + + /** + * Decodes a NFS message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NFS + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.NFS; + + /** + * Verifies a NFS message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NFS message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NFS + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.NFS; + + /** + * Creates a plain object from a NFS message. Also converts values to other types if specified. + * @param message NFS + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.NFS, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NFS to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NFS + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PD. */ + interface IPD { + + /** PD disk */ + disk?: (string|null); + + /** PD device */ + device?: (string|null); + + /** PD existing */ + existing?: (boolean|null); + } + + /** Represents a PD. */ + class PD implements IPD { + + /** + * Constructs a new PD. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IPD); + + /** PD disk. */ + public disk: string; + + /** PD device. */ + public device: string; + + /** PD existing. */ + public existing: boolean; + + /** + * Creates a new PD instance using the specified properties. + * @param [properties] Properties to set + * @returns PD instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IPD): google.cloud.batch.v1alpha.PD; + + /** + * Encodes the specified PD message. Does not implicitly {@link google.cloud.batch.v1alpha.PD.verify|verify} messages. + * @param message PD message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IPD, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PD message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.PD.verify|verify} messages. + * @param message PD message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IPD, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PD message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PD + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.PD; + + /** + * Decodes a PD message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PD + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.PD; + + /** + * Verifies a PD message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PD message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PD + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.PD; + + /** + * Creates a plain object from a PD message. Also converts values to other types if specified. + * @param message PD + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.PD, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PD to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PD + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GCS. */ + interface IGCS { + + /** GCS remotePath */ + remotePath?: (string|null); + } + + /** Represents a GCS. */ + class GCS implements IGCS { + + /** + * Constructs a new GCS. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IGCS); + + /** GCS remotePath. */ + public remotePath: string; + + /** + * Creates a new GCS instance using the specified properties. + * @param [properties] Properties to set + * @returns GCS instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IGCS): google.cloud.batch.v1alpha.GCS; + + /** + * Encodes the specified GCS message. Does not implicitly {@link google.cloud.batch.v1alpha.GCS.verify|verify} messages. + * @param message GCS message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IGCS, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GCS message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.GCS.verify|verify} messages. + * @param message GCS message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IGCS, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GCS message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GCS + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.GCS; + + /** + * Decodes a GCS message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GCS + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.GCS; + + /** + * Verifies a GCS message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GCS message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GCS + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.GCS; + + /** + * Creates a plain object from a GCS message. Also converts values to other types if specified. + * @param message GCS + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.GCS, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GCS to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GCS + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** CalendarPeriod enum. */ + enum CalendarPeriod { + CALENDAR_PERIOD_UNSPECIFIED = 0, + MONTH = 1, + QUARTER = 2, + YEAR = 3, + WEEK = 4, + DAY = 5 + } + + /** ResourceAllowanceState enum. */ + enum ResourceAllowanceState { + RESOURCE_ALLOWANCE_STATE_UNSPECIFIED = 0, + RESOURCE_ALLOWANCE_ACTIVE = 1, + RESOURCE_ALLOWANCE_DEPLETED = 2 + } + + /** Properties of a ResourceAllowance. */ + interface IResourceAllowance { + + /** ResourceAllowance usageResourceAllowance */ + usageResourceAllowance?: (google.cloud.batch.v1alpha.IUsageResourceAllowance|null); + + /** ResourceAllowance name */ + name?: (string|null); + + /** ResourceAllowance uid */ + uid?: (string|null); + + /** ResourceAllowance createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ResourceAllowance labels */ + labels?: ({ [k: string]: string }|null); + + /** ResourceAllowance notifications */ + notifications?: (google.cloud.batch.v1alpha.INotification[]|null); + } + + /** Represents a ResourceAllowance. */ + class ResourceAllowance implements IResourceAllowance { + + /** + * Constructs a new ResourceAllowance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IResourceAllowance); + + /** ResourceAllowance usageResourceAllowance. */ + public usageResourceAllowance?: (google.cloud.batch.v1alpha.IUsageResourceAllowance|null); + + /** ResourceAllowance name. */ + public name: string; + + /** ResourceAllowance uid. */ + public uid: string; + + /** ResourceAllowance createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ResourceAllowance labels. */ + public labels: { [k: string]: string }; + + /** ResourceAllowance notifications. */ + public notifications: google.cloud.batch.v1alpha.INotification[]; + + /** ResourceAllowance resourceAllowance. */ + public resourceAllowance?: "usageResourceAllowance"; + + /** + * Creates a new ResourceAllowance instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceAllowance instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IResourceAllowance): google.cloud.batch.v1alpha.ResourceAllowance; + + /** + * Encodes the specified ResourceAllowance message. Does not implicitly {@link google.cloud.batch.v1alpha.ResourceAllowance.verify|verify} messages. + * @param message ResourceAllowance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IResourceAllowance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceAllowance message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ResourceAllowance.verify|verify} messages. + * @param message ResourceAllowance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IResourceAllowance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceAllowance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceAllowance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ResourceAllowance; + + /** + * Decodes a ResourceAllowance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceAllowance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ResourceAllowance; + + /** + * Verifies a ResourceAllowance message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceAllowance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceAllowance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ResourceAllowance; + + /** + * Creates a plain object from a ResourceAllowance message. Also converts values to other types if specified. + * @param message ResourceAllowance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.ResourceAllowance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceAllowance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceAllowance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UsageResourceAllowance. */ + interface IUsageResourceAllowance { + + /** UsageResourceAllowance spec */ + spec?: (google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec|null); + + /** UsageResourceAllowance status */ + status?: (google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus|null); + } + + /** Represents a UsageResourceAllowance. */ + class UsageResourceAllowance implements IUsageResourceAllowance { + + /** + * Constructs a new UsageResourceAllowance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IUsageResourceAllowance); + + /** UsageResourceAllowance spec. */ + public spec?: (google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec|null); + + /** UsageResourceAllowance status. */ + public status?: (google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus|null); + + /** + * Creates a new UsageResourceAllowance instance using the specified properties. + * @param [properties] Properties to set + * @returns UsageResourceAllowance instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IUsageResourceAllowance): google.cloud.batch.v1alpha.UsageResourceAllowance; + + /** + * Encodes the specified UsageResourceAllowance message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowance.verify|verify} messages. + * @param message UsageResourceAllowance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IUsageResourceAllowance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UsageResourceAllowance message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowance.verify|verify} messages. + * @param message UsageResourceAllowance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IUsageResourceAllowance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UsageResourceAllowance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UsageResourceAllowance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.UsageResourceAllowance; + + /** + * Decodes a UsageResourceAllowance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UsageResourceAllowance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.UsageResourceAllowance; + + /** + * Verifies a UsageResourceAllowance message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UsageResourceAllowance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UsageResourceAllowance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.UsageResourceAllowance; + + /** + * Creates a plain object from a UsageResourceAllowance message. Also converts values to other types if specified. + * @param message UsageResourceAllowance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.UsageResourceAllowance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UsageResourceAllowance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UsageResourceAllowance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UsageResourceAllowanceSpec. */ + interface IUsageResourceAllowanceSpec { + + /** UsageResourceAllowanceSpec type */ + type?: (string|null); + + /** UsageResourceAllowanceSpec limit */ + limit?: (google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit|null); + } + + /** Represents a UsageResourceAllowanceSpec. */ + class UsageResourceAllowanceSpec implements IUsageResourceAllowanceSpec { + + /** + * Constructs a new UsageResourceAllowanceSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec); + + /** UsageResourceAllowanceSpec type. */ + public type: string; + + /** UsageResourceAllowanceSpec limit. */ + public limit?: (google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit|null); + + /** + * Creates a new UsageResourceAllowanceSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns UsageResourceAllowanceSpec instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec): google.cloud.batch.v1alpha.UsageResourceAllowanceSpec; + + /** + * Encodes the specified UsageResourceAllowanceSpec message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.verify|verify} messages. + * @param message UsageResourceAllowanceSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UsageResourceAllowanceSpec message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.verify|verify} messages. + * @param message UsageResourceAllowanceSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UsageResourceAllowanceSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UsageResourceAllowanceSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.UsageResourceAllowanceSpec; + + /** + * Decodes a UsageResourceAllowanceSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UsageResourceAllowanceSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.UsageResourceAllowanceSpec; + + /** + * Verifies a UsageResourceAllowanceSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UsageResourceAllowanceSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UsageResourceAllowanceSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.UsageResourceAllowanceSpec; + + /** + * Creates a plain object from a UsageResourceAllowanceSpec message. Also converts values to other types if specified. + * @param message UsageResourceAllowanceSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.UsageResourceAllowanceSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UsageResourceAllowanceSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UsageResourceAllowanceSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UsageResourceAllowanceSpec { + + /** Properties of a Limit. */ + interface ILimit { + + /** Limit calendarPeriod */ + calendarPeriod?: (google.cloud.batch.v1alpha.CalendarPeriod|keyof typeof google.cloud.batch.v1alpha.CalendarPeriod|null); + + /** Limit limit */ + limit?: (number|null); + } + + /** Represents a Limit. */ + class Limit implements ILimit { + + /** + * Constructs a new Limit. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit); + + /** Limit calendarPeriod. */ + public calendarPeriod?: (google.cloud.batch.v1alpha.CalendarPeriod|keyof typeof google.cloud.batch.v1alpha.CalendarPeriod|null); + + /** Limit limit. */ + public limit?: (number|null); + + /** Limit duration. */ + public duration?: "calendarPeriod"; + + /** Limit _limit. */ + public _limit?: "limit"; + + /** + * Creates a new Limit instance using the specified properties. + * @param [properties] Properties to set + * @returns Limit instance + */ + public static create(properties?: google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit): google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit; + + /** + * Encodes the specified Limit message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit.verify|verify} messages. + * @param message Limit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Limit message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit.verify|verify} messages. + * @param message Limit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Limit message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Limit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit; + + /** + * Decodes a Limit message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Limit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit; + + /** + * Verifies a Limit message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Limit message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Limit + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit; + + /** + * Creates a plain object from a Limit message. Also converts values to other types if specified. + * @param message Limit + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Limit to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Limit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a UsageResourceAllowanceStatus. */ + interface IUsageResourceAllowanceStatus { + + /** UsageResourceAllowanceStatus state */ + state?: (google.cloud.batch.v1alpha.ResourceAllowanceState|keyof typeof google.cloud.batch.v1alpha.ResourceAllowanceState|null); + + /** UsageResourceAllowanceStatus limitStatus */ + limitStatus?: (google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus|null); + + /** UsageResourceAllowanceStatus report */ + report?: (google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport|null); + } + + /** Represents a UsageResourceAllowanceStatus. */ + class UsageResourceAllowanceStatus implements IUsageResourceAllowanceStatus { + + /** + * Constructs a new UsageResourceAllowanceStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus); + + /** UsageResourceAllowanceStatus state. */ + public state: (google.cloud.batch.v1alpha.ResourceAllowanceState|keyof typeof google.cloud.batch.v1alpha.ResourceAllowanceState); + + /** UsageResourceAllowanceStatus limitStatus. */ + public limitStatus?: (google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus|null); + + /** UsageResourceAllowanceStatus report. */ + public report?: (google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport|null); + + /** + * Creates a new UsageResourceAllowanceStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns UsageResourceAllowanceStatus instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus; + + /** + * Encodes the specified UsageResourceAllowanceStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.verify|verify} messages. + * @param message UsageResourceAllowanceStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UsageResourceAllowanceStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.verify|verify} messages. + * @param message UsageResourceAllowanceStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UsageResourceAllowanceStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UsageResourceAllowanceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus; + + /** + * Decodes a UsageResourceAllowanceStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UsageResourceAllowanceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus; + + /** + * Verifies a UsageResourceAllowanceStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UsageResourceAllowanceStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UsageResourceAllowanceStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus; + + /** + * Creates a plain object from a UsageResourceAllowanceStatus message. Also converts values to other types if specified. + * @param message UsageResourceAllowanceStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UsageResourceAllowanceStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UsageResourceAllowanceStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UsageResourceAllowanceStatus { + + /** Properties of a LimitStatus. */ + interface ILimitStatus { + + /** LimitStatus consumptionInterval */ + consumptionInterval?: (google.type.IInterval|null); + + /** LimitStatus limit */ + limit?: (number|null); + + /** LimitStatus consumed */ + consumed?: (number|null); + } + + /** Represents a LimitStatus. */ + class LimitStatus implements ILimitStatus { + + /** + * Constructs a new LimitStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus); + + /** LimitStatus consumptionInterval. */ + public consumptionInterval?: (google.type.IInterval|null); + + /** LimitStatus limit. */ + public limit?: (number|null); + + /** LimitStatus consumed. */ + public consumed?: (number|null); + + /** LimitStatus _limit. */ + public _limit?: "limit"; + + /** LimitStatus _consumed. */ + public _consumed?: "consumed"; + + /** + * Creates a new LimitStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns LimitStatus instance + */ + public static create(properties?: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus; + + /** + * Encodes the specified LimitStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.verify|verify} messages. + * @param message LimitStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LimitStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.verify|verify} messages. + * @param message LimitStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LimitStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LimitStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus; + + /** + * Decodes a LimitStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LimitStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus; + + /** + * Verifies a LimitStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LimitStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LimitStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus; + + /** + * Creates a plain object from a LimitStatus message. Also converts values to other types if specified. + * @param message LimitStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LimitStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LimitStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PeriodConsumption. */ + interface IPeriodConsumption { + + /** PeriodConsumption consumptionInterval */ + consumptionInterval?: (google.type.IInterval|null); + + /** PeriodConsumption consumed */ + consumed?: (number|null); + } + + /** Represents a PeriodConsumption. */ + class PeriodConsumption implements IPeriodConsumption { + + /** + * Constructs a new PeriodConsumption. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption); + + /** PeriodConsumption consumptionInterval. */ + public consumptionInterval?: (google.type.IInterval|null); + + /** PeriodConsumption consumed. */ + public consumed?: (number|null); + + /** PeriodConsumption _consumed. */ + public _consumed?: "consumed"; + + /** + * Creates a new PeriodConsumption instance using the specified properties. + * @param [properties] Properties to set + * @returns PeriodConsumption instance + */ + public static create(properties?: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption; + + /** + * Encodes the specified PeriodConsumption message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.verify|verify} messages. + * @param message PeriodConsumption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PeriodConsumption message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.verify|verify} messages. + * @param message PeriodConsumption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PeriodConsumption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PeriodConsumption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption; + + /** + * Decodes a PeriodConsumption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PeriodConsumption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption; + + /** + * Verifies a PeriodConsumption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PeriodConsumption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PeriodConsumption + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption; + + /** + * Creates a plain object from a PeriodConsumption message. Also converts values to other types if specified. + * @param message PeriodConsumption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PeriodConsumption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PeriodConsumption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConsumptionReport. */ + interface IConsumptionReport { + + /** ConsumptionReport latestPeriodConsumptions */ + latestPeriodConsumptions?: ({ [k: string]: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption }|null); + } + + /** Represents a ConsumptionReport. */ + class ConsumptionReport implements IConsumptionReport { + + /** + * Constructs a new ConsumptionReport. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport); + + /** ConsumptionReport latestPeriodConsumptions. */ + public latestPeriodConsumptions: { [k: string]: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption }; + + /** + * Creates a new ConsumptionReport instance using the specified properties. + * @param [properties] Properties to set + * @returns ConsumptionReport instance + */ + public static create(properties?: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport; + + /** + * Encodes the specified ConsumptionReport message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.verify|verify} messages. + * @param message ConsumptionReport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConsumptionReport message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.verify|verify} messages. + * @param message ConsumptionReport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConsumptionReport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConsumptionReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport; + + /** + * Decodes a ConsumptionReport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConsumptionReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport; + + /** + * Verifies a ConsumptionReport message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConsumptionReport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConsumptionReport + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport; + + /** + * Creates a plain object from a ConsumptionReport message. Also converts values to other types if specified. + * @param message ConsumptionReport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConsumptionReport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConsumptionReport + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Notification. */ + interface INotification { + + /** Notification pubsubTopic */ + pubsubTopic?: (string|null); + } + + /** Represents a Notification. */ + class Notification implements INotification { + + /** + * Constructs a new Notification. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.INotification); + + /** Notification pubsubTopic. */ + public pubsubTopic: string; + + /** + * Creates a new Notification instance using the specified properties. + * @param [properties] Properties to set + * @returns Notification instance + */ + public static create(properties?: google.cloud.batch.v1alpha.INotification): google.cloud.batch.v1alpha.Notification; + + /** + * Encodes the specified Notification message. Does not implicitly {@link google.cloud.batch.v1alpha.Notification.verify|verify} messages. + * @param message Notification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.INotification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Notification message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Notification.verify|verify} messages. + * @param message Notification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.INotification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Notification message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Notification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Notification; + + /** + * Decodes a Notification message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Notification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Notification; + + /** + * Verifies a Notification message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Notification message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Notification + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Notification; + + /** + * Creates a plain object from a Notification message. Also converts values to other types if specified. + * @param message Notification + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.Notification, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Notification to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Notification + * @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); + } + + /** Represents a CommonLanguageSettings. */ + class CommonLanguageSettings implements ICommonLanguageSettings { + + /** + * Constructs a new CommonLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICommonLanguageSettings); + + /** CommonLanguageSettings referenceDocsUri. */ + public referenceDocsUri: string; + + /** CommonLanguageSettings destinations. */ + public destinations: google.api.ClientLibraryDestination[]; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonLanguageSettings instance + */ + public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; + + /** + * Verifies a CommonLanguageSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @param message CommonLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientLibrarySettings. */ + interface IClientLibrarySettings { + + /** ClientLibrarySettings version */ + version?: (string|null); + + /** ClientLibrarySettings launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ClientLibrarySettings restNumericEnums */ + restNumericEnums?: (boolean|null); + + /** ClientLibrarySettings javaSettings */ + javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings */ + cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings */ + phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings */ + pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings */ + nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings */ + dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings */ + rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings */ + goSettings?: (google.api.IGoSettings|null); + } + + /** Represents a ClientLibrarySettings. */ + class ClientLibrarySettings implements IClientLibrarySettings { + + /** + * Constructs a new ClientLibrarySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IClientLibrarySettings); + + /** ClientLibrarySettings version. */ + public version: string; + + /** ClientLibrarySettings launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ClientLibrarySettings restNumericEnums. */ + public restNumericEnums: boolean; + + /** ClientLibrarySettings javaSettings. */ + public javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings. */ + public cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings. */ + public phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings. */ + public pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings. */ + public nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings. */ + public dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings. */ + public rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings. */ + public goSettings?: (google.api.IGoSettings|null); + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientLibrarySettings instance + */ + public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; + + /** + * Verifies a ClientLibrarySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientLibrarySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @param message ClientLibrarySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientLibrarySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Publishing. */ + interface IPublishing { + + /** Publishing methodSettings */ + methodSettings?: (google.api.IMethodSettings[]|null); + + /** Publishing newIssueUri */ + newIssueUri?: (string|null); + + /** Publishing documentationUri */ + documentationUri?: (string|null); + + /** Publishing apiShortName */ + apiShortName?: (string|null); + + /** Publishing githubLabel */ + githubLabel?: (string|null); + + /** Publishing codeownerGithubTeams */ + codeownerGithubTeams?: (string[]|null); + + /** Publishing docTagPrefix */ + docTagPrefix?: (string|null); + + /** Publishing organization */ + organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); + + /** Publishing librarySettings */ + librarySettings?: (google.api.IClientLibrarySettings[]|null); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); + + /** Publishing restReferenceDocumentationUri */ + restReferenceDocumentationUri?: (string|null); + } + + /** Represents a Publishing. */ + class Publishing implements IPublishing { + + /** + * Constructs a new Publishing. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPublishing); + + /** Publishing methodSettings. */ + public methodSettings: google.api.IMethodSettings[]; + + /** Publishing newIssueUri. */ + public newIssueUri: string; + + /** Publishing documentationUri. */ + public documentationUri: string; + + /** Publishing apiShortName. */ + public apiShortName: string; + + /** Publishing githubLabel. */ + public githubLabel: string; + + /** Publishing codeownerGithubTeams. */ + public codeownerGithubTeams: string[]; + + /** Publishing docTagPrefix. */ + public docTagPrefix: string; + + /** Publishing organization. */ + public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; + + /** Publishing restReferenceDocumentationUri. */ + public restReferenceDocumentationUri: string; + + /** + * Creates a new Publishing instance using the specified properties. + * @param [properties] Properties to set + * @returns Publishing instance + */ + public static create(properties?: google.api.IPublishing): google.api.Publishing; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; + + /** + * Verifies a Publishing message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Publishing + */ + public static fromObject(object: { [k: string]: any }): google.api.Publishing; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @param message Publishing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Publishing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Publishing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JavaSettings. */ + interface IJavaSettings { + + /** JavaSettings libraryPackage */ + libraryPackage?: (string|null); + + /** JavaSettings serviceClassNames */ + serviceClassNames?: ({ [k: string]: string }|null); + + /** JavaSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a JavaSettings. */ + class JavaSettings implements IJavaSettings { + + /** + * Constructs a new JavaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IJavaSettings); + + /** JavaSettings libraryPackage. */ + public libraryPackage: string; + + /** JavaSettings serviceClassNames. */ + public serviceClassNames: { [k: string]: string }; + + /** JavaSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new JavaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaSettings instance + */ + public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; + + /** + * Verifies a JavaSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @param message JavaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JavaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CppSettings. */ + interface ICppSettings { + + /** CppSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { + + /** + * Constructs a new CppSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICppSettings); + + /** CppSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance + */ + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; + + /** + * Verifies a CppSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CppSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @param message CppSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CppSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CppSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PhpSettings. */ + interface IPhpSettings { + + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { + + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); + + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PhpSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PhpSettings instance + */ + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; + + /** + * Verifies a PhpSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhpSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @param message PhpSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhpSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhpSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonSettings. */ + interface IPythonSettings { + + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { + + /** + * Constructs a new PythonSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPythonSettings); + + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PythonSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonSettings instance + */ + public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; + + /** + * Verifies a PythonSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeSettings. */ + interface INodeSettings { + + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { + + /** + * Constructs a new NodeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.INodeSettings); + + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance + */ + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; + + /** + * Verifies a NodeSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @param message NodeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DotnetSettings. */ + interface IDotnetSettings { + + /** DotnetSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + + /** DotnetSettings renamedResources */ + renamedResources?: ({ [k: string]: string }|null); + + /** DotnetSettings ignoredResources */ + ignoredResources?: (string[]|null); + + /** DotnetSettings forcedNamespaceAliases */ + forcedNamespaceAliases?: (string[]|null); + + /** DotnetSettings handwrittenSignatures */ + handwrittenSignatures?: (string[]|null); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** DotnetSettings renamedResources. */ + public renamedResources: { [k: string]: string }; + + /** DotnetSettings ignoredResources. */ + public ignoredResources: string[]; + + /** DotnetSettings forcedNamespaceAliases. */ + public forcedNamespaceAliases: string[]; + + /** DotnetSettings handwrittenSignatures. */ + public handwrittenSignatures: string[]; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance + */ + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; + + /** + * Verifies a DotnetSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DotnetSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @param message DotnetSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DotnetSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DotnetSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RubySettings. */ + interface IRubySettings { + + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { + + /** + * Constructs a new RubySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance + */ + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; + + /** + * Verifies a RubySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RubySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @param message RubySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RubySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RubySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoSettings. */ + interface IGoSettings { + + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { + + /** + * Constructs a new GoSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IGoSettings); + + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new GoSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GoSettings instance + */ + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; + + /** + * Verifies a GoSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @param message GoSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); + + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields */ + autoPopulatedFields?: (string[]|null); + } + + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { + + /** + * Constructs a new MethodSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; + + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields. */ + public autoPopulatedFields: string[]; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance + */ + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; + + /** + * Verifies a MethodSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @param message MethodSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodSettings { + + /** Properties of a LongRunning. */ + interface ILongRunning { + + /** LongRunning initialPollDelay */ + initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier */ + pollDelayMultiplier?: (number|null); + + /** LongRunning maxPollDelay */ + maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout */ + totalPollTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a LongRunning. */ + class LongRunning implements ILongRunning { + + /** + * Constructs a new LongRunning. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MethodSettings.ILongRunning); + + /** LongRunning initialPollDelay. */ + public initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier. */ + public pollDelayMultiplier: number; + + /** LongRunning maxPollDelay. */ + public maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout. */ + public totalPollTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new LongRunning instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunning instance + */ + public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; + + /** + * Verifies a LongRunning message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunning + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @param message LongRunning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4, + SHOPPING = 5, + GEO = 6, + GENERATIVE_AI = 7 + } + + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + + /** 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 FieldInfo. */ + interface IFieldInfo { + + /** FieldInfo format */ + format?: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format|null); + } + + /** Represents a FieldInfo. */ + class FieldInfo implements IFieldInfo { + + /** + * Constructs a new FieldInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IFieldInfo); + + /** FieldInfo format. */ + public format: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format); + + /** + * Creates a new FieldInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldInfo instance + */ + public static create(properties?: google.api.IFieldInfo): google.api.FieldInfo; + + /** + * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @param message FieldInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @param message FieldInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldInfo + * @throws {Error} If the payload is not 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.FieldInfo; + + /** + * Decodes a FieldInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldInfo + * @throws {Error} If the payload 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.FieldInfo; + + /** + * Verifies a FieldInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldInfo + */ + public static fromObject(object: { [k: string]: any }): google.api.FieldInfo; + + /** + * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. + * @param message FieldInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.FieldInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldInfo { + + /** Format enum. */ + enum Format { + FORMAT_UNSPECIFIED = 0, + UUID4 = 1, + IPV4 = 2, + IPV6 = 3, + IPV4_OR_IPV6 = 4 + } + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Edition enum. */ + enum Edition { + EDITION_UNKNOWN = 0, + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + EDITION_2023 = 1000, + EDITION_2024 = 1001, + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + EDITION_MAX = 2147483647 + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ExtensionRangeOptions declaration */ + declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); + + /** ExtensionRangeOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification */ + verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** ExtensionRangeOptions declaration. */ + public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; + + /** ExtensionRangeOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification. */ + public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExtensionRangeOptions { + + /** Properties of a Declaration. */ + interface IDeclaration { + + /** Declaration number */ + number?: (number|null); + + /** Declaration fullName */ + fullName?: (string|null); + + /** Declaration type */ + type?: (string|null); + + /** Declaration reserved */ + reserved?: (boolean|null); + + /** Declaration repeated */ + repeated?: (boolean|null); + } + + /** Represents a Declaration. */ + class Declaration implements IDeclaration { + + /** + * Constructs a new Declaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); + + /** Declaration number. */ + public number: number; + + /** Declaration fullName. */ + public fullName: string; + + /** Declaration type. */ + public type: string; + + /** Declaration reserved. */ + public reserved: boolean; + + /** Declaration repeated. */ + public repeated: boolean; + + /** + * Creates a new Declaration instance using the specified properties. + * @param [properties] Properties to set + * @returns Declaration instance + */ + public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Verifies a Declaration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Declaration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @param message Declaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Declaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Declaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VerificationState enum. */ + enum VerificationState { + DECLARATION = 0, + UNVERIFIED = 1 + } + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REPEATED = 3, + LABEL_REQUIRED = 2 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** MessageOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** MessageOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions debugRedact */ + debugRedact?: (boolean|null); + + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + + /** FieldOptions targets */ + targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); + + /** FieldOptions editionDefaults */ + editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); + + /** FieldOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.fieldInfo */ + ".google.api.fieldInfo"?: (google.api.IFieldInfo|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions debugRedact. */ + public debugRedact: boolean; + + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions targets. */ + public targets: google.protobuf.FieldOptions.OptionTargetType[]; + + /** FieldOptions editionDefaults. */ + public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; + + /** FieldOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } + + /** OptionTargetType enum. */ + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9 + } + + /** Properties of an EditionDefault. */ + interface IEditionDefault { + + /** EditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** EditionDefault value */ + value?: (string|null); + } + + /** Represents an EditionDefault. */ + class EditionDefault implements IEditionDefault { + + /** + * Constructs a new EditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); + + /** EditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** EditionDefault value. */ + public value: string; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns EditionDefault instance + */ + public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; + + /** + * Verifies an EditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @param message EditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** EnumOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** EnumOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact. */ + public debugRedact: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|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|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + } + + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { + + /** + * Constructs a new FeatureSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSet); + + /** FeatureSet fieldPresence. */ + public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); + + /** FeatureSet enumType. */ + public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); + + /** FeatureSet repeatedFieldEncoding. */ + public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); + + /** FeatureSet utf8Validation. */ + public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); + + /** FeatureSet messageEncoding. */ + public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); + + /** FeatureSet jsonFormat. */ + public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + + /** + * Creates a new FeatureSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSet instance + */ + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; + + /** + * Verifies a FeatureSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @param message FeatureSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSet { + + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } + + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } + + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } + + /** Utf8Validation enum. */ + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3 + } + + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 + } + + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + } + + /** Properties of a FeatureSetDefaults. */ + interface IFeatureSetDefaults { + + /** FeatureSetDefaults defaults */ + defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); + + /** FeatureSetDefaults minimumEdition */ + minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetDefaults maximumEdition */ + maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSetDefaults. */ + class FeatureSetDefaults implements IFeatureSetDefaults { + + /** + * Constructs a new FeatureSetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSetDefaults); + + /** FeatureSetDefaults defaults. */ + public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; + + /** FeatureSetDefaults minimumEdition. */ + public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetDefaults maximumEdition. */ + public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetDefaults instance + */ + public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; + + /** + * Verifies a FeatureSetDefaults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @param message FeatureSetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSetDefaults { + + /** Properties of a FeatureSetEditionDefault. */ + interface IFeatureSetEditionDefault { + + /** FeatureSetEditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetEditionDefault features */ + features?: (google.protobuf.IFeatureSet|null); + } + + /** Represents a FeatureSetEditionDefault. */ + class FeatureSetEditionDefault implements IFeatureSetEditionDefault { + + /** + * Constructs a new FeatureSetEditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); + + /** FeatureSetEditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetEditionDefault features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetEditionDefault instance + */ + public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Verifies a FeatureSetEditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetEditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @param message FeatureSetEditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of 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 an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|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|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of an Interval. */ + interface IInterval { + + /** Interval startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Interval endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an Interval. */ + class Interval implements IInterval { + + /** + * Constructs a new Interval. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IInterval); + + /** Interval startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Interval endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Interval instance using the specified properties. + * @param [properties] Properties to set + * @returns Interval instance + */ + public static create(properties?: google.type.IInterval): google.type.Interval; + + /** + * Encodes the specified Interval message. Does not implicitly {@link google.type.Interval.verify|verify} messages. + * @param message Interval message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IInterval, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Interval message, length delimited. Does not implicitly {@link google.type.Interval.verify|verify} messages. + * @param message Interval message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IInterval, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Interval message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Interval + * @throws {Error} If the payload is not 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.Interval; + + /** + * Decodes an Interval message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Interval + * @throws {Error} If the payload 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.Interval; + + /** + * Verifies an Interval message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Interval message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Interval + */ + public static fromObject(object: { [k: string]: any }): google.type.Interval; + + /** + * Creates a plain object from an Interval message. Also converts values to other types if specified. + * @param message Interval + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Interval, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Interval to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Interval + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.js b/owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.js new file mode 100644 index 00000000000..a1f625acff8 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.js @@ -0,0 +1,42614 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*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_batch_protos || ($protobuf.roots._google_cloud_batch_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.batch = (function() { + + /** + * Namespace batch. + * @memberof google.cloud + * @namespace + */ + var batch = {}; + + batch.v1alpha = (function() { + + /** + * Namespace v1alpha. + * @memberof google.cloud.batch + * @namespace + */ + var v1alpha = {}; + + v1alpha.BatchService = (function() { + + /** + * Constructs a new BatchService service. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a BatchService + * @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 BatchService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (BatchService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = BatchService; + + /** + * Creates new BatchService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.batch.v1alpha.BatchService + * @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 {BatchService} RPC service. Useful where requests and/or responses are streamed. + */ + BatchService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|createJob}. + * @memberof google.cloud.batch.v1alpha.BatchService + * @typedef CreateJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.batch.v1alpha.Job} [response] Job + */ + + /** + * Calls CreateJob. + * @function createJob + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.ICreateJobRequest} request CreateJobRequest message or plain object + * @param {google.cloud.batch.v1alpha.BatchService.CreateJobCallback} callback Node-style callback called with the error, if any, and Job + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.createJob = function createJob(request, callback) { + return this.rpcCall(createJob, $root.google.cloud.batch.v1alpha.CreateJobRequest, $root.google.cloud.batch.v1alpha.Job, request, callback); + }, "name", { value: "CreateJob" }); + + /** + * Calls CreateJob. + * @function createJob + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.ICreateJobRequest} request CreateJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|getJob}. + * @memberof google.cloud.batch.v1alpha.BatchService + * @typedef GetJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.batch.v1alpha.Job} [response] Job + */ + + /** + * Calls GetJob. + * @function getJob + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IGetJobRequest} request GetJobRequest message or plain object + * @param {google.cloud.batch.v1alpha.BatchService.GetJobCallback} callback Node-style callback called with the error, if any, and Job + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.getJob = function getJob(request, callback) { + return this.rpcCall(getJob, $root.google.cloud.batch.v1alpha.GetJobRequest, $root.google.cloud.batch.v1alpha.Job, request, callback); + }, "name", { value: "GetJob" }); + + /** + * Calls GetJob. + * @function getJob + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IGetJobRequest} request GetJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|deleteJob}. + * @memberof google.cloud.batch.v1alpha.BatchService + * @typedef DeleteJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteJob. + * @function deleteJob + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IDeleteJobRequest} request DeleteJobRequest message or plain object + * @param {google.cloud.batch.v1alpha.BatchService.DeleteJobCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.deleteJob = function deleteJob(request, callback) { + return this.rpcCall(deleteJob, $root.google.cloud.batch.v1alpha.DeleteJobRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteJob" }); + + /** + * Calls DeleteJob. + * @function deleteJob + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IDeleteJobRequest} request DeleteJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|cancelJob}. + * @memberof google.cloud.batch.v1alpha.BatchService + * @typedef CancelJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CancelJob. + * @function cancelJob + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.ICancelJobRequest} request CancelJobRequest message or plain object + * @param {google.cloud.batch.v1alpha.BatchService.CancelJobCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.cancelJob = function cancelJob(request, callback) { + return this.rpcCall(cancelJob, $root.google.cloud.batch.v1alpha.CancelJobRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CancelJob" }); + + /** + * Calls CancelJob. + * @function cancelJob + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.ICancelJobRequest} request CancelJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|updateJob}. + * @memberof google.cloud.batch.v1alpha.BatchService + * @typedef UpdateJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.batch.v1alpha.Job} [response] Job + */ + + /** + * Calls UpdateJob. + * @function updateJob + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IUpdateJobRequest} request UpdateJobRequest message or plain object + * @param {google.cloud.batch.v1alpha.BatchService.UpdateJobCallback} callback Node-style callback called with the error, if any, and Job + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.updateJob = function updateJob(request, callback) { + return this.rpcCall(updateJob, $root.google.cloud.batch.v1alpha.UpdateJobRequest, $root.google.cloud.batch.v1alpha.Job, request, callback); + }, "name", { value: "UpdateJob" }); + + /** + * Calls UpdateJob. + * @function updateJob + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IUpdateJobRequest} request UpdateJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|listJobs}. + * @memberof google.cloud.batch.v1alpha.BatchService + * @typedef ListJobsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.batch.v1alpha.ListJobsResponse} [response] ListJobsResponse + */ + + /** + * Calls ListJobs. + * @function listJobs + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IListJobsRequest} request ListJobsRequest message or plain object + * @param {google.cloud.batch.v1alpha.BatchService.ListJobsCallback} callback Node-style callback called with the error, if any, and ListJobsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.listJobs = function listJobs(request, callback) { + return this.rpcCall(listJobs, $root.google.cloud.batch.v1alpha.ListJobsRequest, $root.google.cloud.batch.v1alpha.ListJobsResponse, request, callback); + }, "name", { value: "ListJobs" }); + + /** + * Calls ListJobs. + * @function listJobs + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IListJobsRequest} request ListJobsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|getTask}. + * @memberof google.cloud.batch.v1alpha.BatchService + * @typedef GetTaskCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.batch.v1alpha.Task} [response] Task + */ + + /** + * Calls GetTask. + * @function getTask + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IGetTaskRequest} request GetTaskRequest message or plain object + * @param {google.cloud.batch.v1alpha.BatchService.GetTaskCallback} callback Node-style callback called with the error, if any, and Task + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.getTask = function getTask(request, callback) { + return this.rpcCall(getTask, $root.google.cloud.batch.v1alpha.GetTaskRequest, $root.google.cloud.batch.v1alpha.Task, request, callback); + }, "name", { value: "GetTask" }); + + /** + * Calls GetTask. + * @function getTask + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IGetTaskRequest} request GetTaskRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|listTasks}. + * @memberof google.cloud.batch.v1alpha.BatchService + * @typedef ListTasksCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.batch.v1alpha.ListTasksResponse} [response] ListTasksResponse + */ + + /** + * Calls ListTasks. + * @function listTasks + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IListTasksRequest} request ListTasksRequest message or plain object + * @param {google.cloud.batch.v1alpha.BatchService.ListTasksCallback} callback Node-style callback called with the error, if any, and ListTasksResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.listTasks = function listTasks(request, callback) { + return this.rpcCall(listTasks, $root.google.cloud.batch.v1alpha.ListTasksRequest, $root.google.cloud.batch.v1alpha.ListTasksResponse, request, callback); + }, "name", { value: "ListTasks" }); + + /** + * Calls ListTasks. + * @function listTasks + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IListTasksRequest} request ListTasksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|createResourceAllowance}. + * @memberof google.cloud.batch.v1alpha.BatchService + * @typedef CreateResourceAllowanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.batch.v1alpha.ResourceAllowance} [response] ResourceAllowance + */ + + /** + * Calls CreateResourceAllowance. + * @function createResourceAllowance + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest} request CreateResourceAllowanceRequest message or plain object + * @param {google.cloud.batch.v1alpha.BatchService.CreateResourceAllowanceCallback} callback Node-style callback called with the error, if any, and ResourceAllowance + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.createResourceAllowance = function createResourceAllowance(request, callback) { + return this.rpcCall(createResourceAllowance, $root.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest, $root.google.cloud.batch.v1alpha.ResourceAllowance, request, callback); + }, "name", { value: "CreateResourceAllowance" }); + + /** + * Calls CreateResourceAllowance. + * @function createResourceAllowance + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest} request CreateResourceAllowanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|getResourceAllowance}. + * @memberof google.cloud.batch.v1alpha.BatchService + * @typedef GetResourceAllowanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.batch.v1alpha.ResourceAllowance} [response] ResourceAllowance + */ + + /** + * Calls GetResourceAllowance. + * @function getResourceAllowance + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IGetResourceAllowanceRequest} request GetResourceAllowanceRequest message or plain object + * @param {google.cloud.batch.v1alpha.BatchService.GetResourceAllowanceCallback} callback Node-style callback called with the error, if any, and ResourceAllowance + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.getResourceAllowance = function getResourceAllowance(request, callback) { + return this.rpcCall(getResourceAllowance, $root.google.cloud.batch.v1alpha.GetResourceAllowanceRequest, $root.google.cloud.batch.v1alpha.ResourceAllowance, request, callback); + }, "name", { value: "GetResourceAllowance" }); + + /** + * Calls GetResourceAllowance. + * @function getResourceAllowance + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IGetResourceAllowanceRequest} request GetResourceAllowanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|deleteResourceAllowance}. + * @memberof google.cloud.batch.v1alpha.BatchService + * @typedef DeleteResourceAllowanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteResourceAllowance. + * @function deleteResourceAllowance + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest} request DeleteResourceAllowanceRequest message or plain object + * @param {google.cloud.batch.v1alpha.BatchService.DeleteResourceAllowanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.deleteResourceAllowance = function deleteResourceAllowance(request, callback) { + return this.rpcCall(deleteResourceAllowance, $root.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteResourceAllowance" }); + + /** + * Calls DeleteResourceAllowance. + * @function deleteResourceAllowance + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest} request DeleteResourceAllowanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|listResourceAllowances}. + * @memberof google.cloud.batch.v1alpha.BatchService + * @typedef ListResourceAllowancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.batch.v1alpha.ListResourceAllowancesResponse} [response] ListResourceAllowancesResponse + */ + + /** + * Calls ListResourceAllowances. + * @function listResourceAllowances + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IListResourceAllowancesRequest} request ListResourceAllowancesRequest message or plain object + * @param {google.cloud.batch.v1alpha.BatchService.ListResourceAllowancesCallback} callback Node-style callback called with the error, if any, and ListResourceAllowancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.listResourceAllowances = function listResourceAllowances(request, callback) { + return this.rpcCall(listResourceAllowances, $root.google.cloud.batch.v1alpha.ListResourceAllowancesRequest, $root.google.cloud.batch.v1alpha.ListResourceAllowancesResponse, request, callback); + }, "name", { value: "ListResourceAllowances" }); + + /** + * Calls ListResourceAllowances. + * @function listResourceAllowances + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IListResourceAllowancesRequest} request ListResourceAllowancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|updateResourceAllowance}. + * @memberof google.cloud.batch.v1alpha.BatchService + * @typedef UpdateResourceAllowanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.batch.v1alpha.ResourceAllowance} [response] ResourceAllowance + */ + + /** + * Calls UpdateResourceAllowance. + * @function updateResourceAllowance + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest} request UpdateResourceAllowanceRequest message or plain object + * @param {google.cloud.batch.v1alpha.BatchService.UpdateResourceAllowanceCallback} callback Node-style callback called with the error, if any, and ResourceAllowance + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.updateResourceAllowance = function updateResourceAllowance(request, callback) { + return this.rpcCall(updateResourceAllowance, $root.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest, $root.google.cloud.batch.v1alpha.ResourceAllowance, request, callback); + }, "name", { value: "UpdateResourceAllowance" }); + + /** + * Calls UpdateResourceAllowance. + * @function updateResourceAllowance + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest} request UpdateResourceAllowanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return BatchService; + })(); + + v1alpha.CreateJobRequest = (function() { + + /** + * Properties of a CreateJobRequest. + * @memberof google.cloud.batch.v1alpha + * @interface ICreateJobRequest + * @property {string|null} [parent] CreateJobRequest parent + * @property {string|null} [jobId] CreateJobRequest jobId + * @property {google.cloud.batch.v1alpha.IJob|null} [job] CreateJobRequest job + * @property {string|null} [requestId] CreateJobRequest requestId + */ + + /** + * Constructs a new CreateJobRequest. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a CreateJobRequest. + * @implements ICreateJobRequest + * @constructor + * @param {google.cloud.batch.v1alpha.ICreateJobRequest=} [properties] Properties to set + */ + function CreateJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateJobRequest parent. + * @member {string} parent + * @memberof google.cloud.batch.v1alpha.CreateJobRequest + * @instance + */ + CreateJobRequest.prototype.parent = ""; + + /** + * CreateJobRequest jobId. + * @member {string} jobId + * @memberof google.cloud.batch.v1alpha.CreateJobRequest + * @instance + */ + CreateJobRequest.prototype.jobId = ""; + + /** + * CreateJobRequest job. + * @member {google.cloud.batch.v1alpha.IJob|null|undefined} job + * @memberof google.cloud.batch.v1alpha.CreateJobRequest + * @instance + */ + CreateJobRequest.prototype.job = null; + + /** + * CreateJobRequest requestId. + * @member {string} requestId + * @memberof google.cloud.batch.v1alpha.CreateJobRequest + * @instance + */ + CreateJobRequest.prototype.requestId = ""; + + /** + * Creates a new CreateJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.CreateJobRequest + * @static + * @param {google.cloud.batch.v1alpha.ICreateJobRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.CreateJobRequest} CreateJobRequest instance + */ + CreateJobRequest.create = function create(properties) { + return new CreateJobRequest(properties); + }; + + /** + * Encodes the specified CreateJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.CreateJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.CreateJobRequest + * @static + * @param {google.cloud.batch.v1alpha.ICreateJobRequest} message CreateJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.jobId); + if (message.job != null && Object.hasOwnProperty.call(message, "job")) + $root.google.cloud.batch.v1alpha.Job.encode(message.job, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.CreateJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.CreateJobRequest + * @static + * @param {google.cloud.batch.v1alpha.ICreateJobRequest} message CreateJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.CreateJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.CreateJobRequest} CreateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.CreateJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.jobId = reader.string(); + break; + } + case 3: { + message.job = $root.google.cloud.batch.v1alpha.Job.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.CreateJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.CreateJobRequest} CreateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateJobRequest message. + * @function verify + * @memberof google.cloud.batch.v1alpha.CreateJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.jobId != null && message.hasOwnProperty("jobId")) + if (!$util.isString(message.jobId)) + return "jobId: string expected"; + if (message.job != null && message.hasOwnProperty("job")) { + var error = $root.google.cloud.batch.v1alpha.Job.verify(message.job); + if (error) + return "job." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.CreateJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.CreateJobRequest} CreateJobRequest + */ + CreateJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.CreateJobRequest) + return object; + var message = new $root.google.cloud.batch.v1alpha.CreateJobRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.jobId != null) + message.jobId = String(object.jobId); + if (object.job != null) { + if (typeof object.job !== "object") + throw TypeError(".google.cloud.batch.v1alpha.CreateJobRequest.job: object expected"); + message.job = $root.google.cloud.batch.v1alpha.Job.fromObject(object.job); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.CreateJobRequest + * @static + * @param {google.cloud.batch.v1alpha.CreateJobRequest} message CreateJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.jobId = ""; + object.job = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.jobId != null && message.hasOwnProperty("jobId")) + object.jobId = message.jobId; + if (message.job != null && message.hasOwnProperty("job")) + object.job = $root.google.cloud.batch.v1alpha.Job.toObject(message.job, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.CreateJobRequest + * @instance + * @returns {Object.} JSON object + */ + CreateJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateJobRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.CreateJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.CreateJobRequest"; + }; + + return CreateJobRequest; + })(); + + v1alpha.GetJobRequest = (function() { + + /** + * Properties of a GetJobRequest. + * @memberof google.cloud.batch.v1alpha + * @interface IGetJobRequest + * @property {string|null} [name] GetJobRequest name + */ + + /** + * Constructs a new GetJobRequest. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a GetJobRequest. + * @implements IGetJobRequest + * @constructor + * @param {google.cloud.batch.v1alpha.IGetJobRequest=} [properties] Properties to set + */ + function GetJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetJobRequest name. + * @member {string} name + * @memberof google.cloud.batch.v1alpha.GetJobRequest + * @instance + */ + GetJobRequest.prototype.name = ""; + + /** + * Creates a new GetJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.GetJobRequest + * @static + * @param {google.cloud.batch.v1alpha.IGetJobRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.GetJobRequest} GetJobRequest instance + */ + GetJobRequest.create = function create(properties) { + return new GetJobRequest(properties); + }; + + /** + * Encodes the specified GetJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.GetJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.GetJobRequest + * @static + * @param {google.cloud.batch.v1alpha.IGetJobRequest} message GetJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetJobRequest.encode = function encode(message, writer) { + 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 GetJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.GetJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.GetJobRequest + * @static + * @param {google.cloud.batch.v1alpha.IGetJobRequest} message GetJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.GetJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.GetJobRequest} GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.GetJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.GetJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.GetJobRequest} GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetJobRequest message. + * @function verify + * @memberof google.cloud.batch.v1alpha.GetJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.GetJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.GetJobRequest} GetJobRequest + */ + GetJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.GetJobRequest) + return object; + var message = new $root.google.cloud.batch.v1alpha.GetJobRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.GetJobRequest + * @static + * @param {google.cloud.batch.v1alpha.GetJobRequest} message GetJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetJobRequest.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 GetJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.GetJobRequest + * @instance + * @returns {Object.} JSON object + */ + GetJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetJobRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.GetJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.GetJobRequest"; + }; + + return GetJobRequest; + })(); + + v1alpha.DeleteJobRequest = (function() { + + /** + * Properties of a DeleteJobRequest. + * @memberof google.cloud.batch.v1alpha + * @interface IDeleteJobRequest + * @property {string|null} [name] DeleteJobRequest name + * @property {string|null} [reason] DeleteJobRequest reason + * @property {string|null} [requestId] DeleteJobRequest requestId + */ + + /** + * Constructs a new DeleteJobRequest. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a DeleteJobRequest. + * @implements IDeleteJobRequest + * @constructor + * @param {google.cloud.batch.v1alpha.IDeleteJobRequest=} [properties] Properties to set + */ + function DeleteJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteJobRequest name. + * @member {string} name + * @memberof google.cloud.batch.v1alpha.DeleteJobRequest + * @instance + */ + DeleteJobRequest.prototype.name = ""; + + /** + * DeleteJobRequest reason. + * @member {string} reason + * @memberof google.cloud.batch.v1alpha.DeleteJobRequest + * @instance + */ + DeleteJobRequest.prototype.reason = ""; + + /** + * DeleteJobRequest requestId. + * @member {string} requestId + * @memberof google.cloud.batch.v1alpha.DeleteJobRequest + * @instance + */ + DeleteJobRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.DeleteJobRequest + * @static + * @param {google.cloud.batch.v1alpha.IDeleteJobRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.DeleteJobRequest} DeleteJobRequest instance + */ + DeleteJobRequest.create = function create(properties) { + return new DeleteJobRequest(properties); + }; + + /** + * Encodes the specified DeleteJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.DeleteJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.DeleteJobRequest + * @static + * @param {google.cloud.batch.v1alpha.IDeleteJobRequest} message DeleteJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.reason); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.DeleteJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.DeleteJobRequest + * @static + * @param {google.cloud.batch.v1alpha.IDeleteJobRequest} message DeleteJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.DeleteJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.DeleteJobRequest} DeleteJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.DeleteJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.reason = reader.string(); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.DeleteJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.DeleteJobRequest} DeleteJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteJobRequest message. + * @function verify + * @memberof google.cloud.batch.v1alpha.DeleteJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.reason != null && message.hasOwnProperty("reason")) + if (!$util.isString(message.reason)) + return "reason: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.DeleteJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.DeleteJobRequest} DeleteJobRequest + */ + DeleteJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.DeleteJobRequest) + return object; + var message = new $root.google.cloud.batch.v1alpha.DeleteJobRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.reason != null) + message.reason = String(object.reason); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.DeleteJobRequest + * @static + * @param {google.cloud.batch.v1alpha.DeleteJobRequest} message DeleteJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.reason = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.reason != null && message.hasOwnProperty("reason")) + object.reason = message.reason; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.DeleteJobRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteJobRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.DeleteJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.DeleteJobRequest"; + }; + + return DeleteJobRequest; + })(); + + v1alpha.CancelJobRequest = (function() { + + /** + * Properties of a CancelJobRequest. + * @memberof google.cloud.batch.v1alpha + * @interface ICancelJobRequest + * @property {string|null} [name] CancelJobRequest name + * @property {string|null} [requestId] CancelJobRequest requestId + */ + + /** + * Constructs a new CancelJobRequest. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a CancelJobRequest. + * @implements ICancelJobRequest + * @constructor + * @param {google.cloud.batch.v1alpha.ICancelJobRequest=} [properties] Properties to set + */ + function CancelJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelJobRequest name. + * @member {string} name + * @memberof google.cloud.batch.v1alpha.CancelJobRequest + * @instance + */ + CancelJobRequest.prototype.name = ""; + + /** + * CancelJobRequest requestId. + * @member {string} requestId + * @memberof google.cloud.batch.v1alpha.CancelJobRequest + * @instance + */ + CancelJobRequest.prototype.requestId = ""; + + /** + * Creates a new CancelJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.CancelJobRequest + * @static + * @param {google.cloud.batch.v1alpha.ICancelJobRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.CancelJobRequest} CancelJobRequest instance + */ + CancelJobRequest.create = function create(properties) { + return new CancelJobRequest(properties); + }; + + /** + * Encodes the specified CancelJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.CancelJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.CancelJobRequest + * @static + * @param {google.cloud.batch.v1alpha.ICancelJobRequest} message CancelJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CancelJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.CancelJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.CancelJobRequest + * @static + * @param {google.cloud.batch.v1alpha.ICancelJobRequest} message CancelJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.CancelJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.CancelJobRequest} CancelJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.CancelJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.CancelJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.CancelJobRequest} CancelJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelJobRequest message. + * @function verify + * @memberof google.cloud.batch.v1alpha.CancelJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CancelJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.CancelJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.CancelJobRequest} CancelJobRequest + */ + CancelJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.CancelJobRequest) + return object; + var message = new $root.google.cloud.batch.v1alpha.CancelJobRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CancelJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.CancelJobRequest + * @static + * @param {google.cloud.batch.v1alpha.CancelJobRequest} message CancelJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CancelJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.CancelJobRequest + * @instance + * @returns {Object.} JSON object + */ + CancelJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelJobRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.CancelJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.CancelJobRequest"; + }; + + return CancelJobRequest; + })(); + + v1alpha.CancelJobResponse = (function() { + + /** + * Properties of a CancelJobResponse. + * @memberof google.cloud.batch.v1alpha + * @interface ICancelJobResponse + */ + + /** + * Constructs a new CancelJobResponse. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a CancelJobResponse. + * @implements ICancelJobResponse + * @constructor + * @param {google.cloud.batch.v1alpha.ICancelJobResponse=} [properties] Properties to set + */ + function CancelJobResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new CancelJobResponse instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.CancelJobResponse + * @static + * @param {google.cloud.batch.v1alpha.ICancelJobResponse=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.CancelJobResponse} CancelJobResponse instance + */ + CancelJobResponse.create = function create(properties) { + return new CancelJobResponse(properties); + }; + + /** + * Encodes the specified CancelJobResponse message. Does not implicitly {@link google.cloud.batch.v1alpha.CancelJobResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.CancelJobResponse + * @static + * @param {google.cloud.batch.v1alpha.ICancelJobResponse} message CancelJobResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelJobResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified CancelJobResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.CancelJobResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.CancelJobResponse + * @static + * @param {google.cloud.batch.v1alpha.ICancelJobResponse} message CancelJobResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelJobResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelJobResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.CancelJobResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.CancelJobResponse} CancelJobResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelJobResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.CancelJobResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelJobResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.CancelJobResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.CancelJobResponse} CancelJobResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelJobResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelJobResponse message. + * @function verify + * @memberof google.cloud.batch.v1alpha.CancelJobResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelJobResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a CancelJobResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.CancelJobResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.CancelJobResponse} CancelJobResponse + */ + CancelJobResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.CancelJobResponse) + return object; + return new $root.google.cloud.batch.v1alpha.CancelJobResponse(); + }; + + /** + * Creates a plain object from a CancelJobResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.CancelJobResponse + * @static + * @param {google.cloud.batch.v1alpha.CancelJobResponse} message CancelJobResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelJobResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this CancelJobResponse to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.CancelJobResponse + * @instance + * @returns {Object.} JSON object + */ + CancelJobResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelJobResponse + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.CancelJobResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelJobResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.CancelJobResponse"; + }; + + return CancelJobResponse; + })(); + + v1alpha.UpdateJobRequest = (function() { + + /** + * Properties of an UpdateJobRequest. + * @memberof google.cloud.batch.v1alpha + * @interface IUpdateJobRequest + * @property {google.cloud.batch.v1alpha.IJob|null} [job] UpdateJobRequest job + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateJobRequest updateMask + * @property {string|null} [requestId] UpdateJobRequest requestId + */ + + /** + * Constructs a new UpdateJobRequest. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents an UpdateJobRequest. + * @implements IUpdateJobRequest + * @constructor + * @param {google.cloud.batch.v1alpha.IUpdateJobRequest=} [properties] Properties to set + */ + function UpdateJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateJobRequest job. + * @member {google.cloud.batch.v1alpha.IJob|null|undefined} job + * @memberof google.cloud.batch.v1alpha.UpdateJobRequest + * @instance + */ + UpdateJobRequest.prototype.job = null; + + /** + * UpdateJobRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.batch.v1alpha.UpdateJobRequest + * @instance + */ + UpdateJobRequest.prototype.updateMask = null; + + /** + * UpdateJobRequest requestId. + * @member {string} requestId + * @memberof google.cloud.batch.v1alpha.UpdateJobRequest + * @instance + */ + UpdateJobRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.UpdateJobRequest + * @static + * @param {google.cloud.batch.v1alpha.IUpdateJobRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.UpdateJobRequest} UpdateJobRequest instance + */ + UpdateJobRequest.create = function create(properties) { + return new UpdateJobRequest(properties); + }; + + /** + * Encodes the specified UpdateJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.UpdateJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.UpdateJobRequest + * @static + * @param {google.cloud.batch.v1alpha.IUpdateJobRequest} message UpdateJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.job != null && Object.hasOwnProperty.call(message, "job")) + $root.google.cloud.batch.v1alpha.Job.encode(message.job, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UpdateJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.UpdateJobRequest + * @static + * @param {google.cloud.batch.v1alpha.IUpdateJobRequest} message UpdateJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.UpdateJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.UpdateJobRequest} UpdateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.UpdateJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.job = $root.google.cloud.batch.v1alpha.Job.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.UpdateJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.UpdateJobRequest} UpdateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateJobRequest message. + * @function verify + * @memberof google.cloud.batch.v1alpha.UpdateJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.job != null && message.hasOwnProperty("job")) { + var error = $root.google.cloud.batch.v1alpha.Job.verify(message.job); + if (error) + return "job." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.UpdateJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.UpdateJobRequest} UpdateJobRequest + */ + UpdateJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.UpdateJobRequest) + return object; + var message = new $root.google.cloud.batch.v1alpha.UpdateJobRequest(); + if (object.job != null) { + if (typeof object.job !== "object") + throw TypeError(".google.cloud.batch.v1alpha.UpdateJobRequest.job: object expected"); + message.job = $root.google.cloud.batch.v1alpha.Job.fromObject(object.job); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.batch.v1alpha.UpdateJobRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.UpdateJobRequest + * @static + * @param {google.cloud.batch.v1alpha.UpdateJobRequest} message UpdateJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.job = null; + object.updateMask = null; + object.requestId = ""; + } + if (message.job != null && message.hasOwnProperty("job")) + object.job = $root.google.cloud.batch.v1alpha.Job.toObject(message.job, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.UpdateJobRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateJobRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.UpdateJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.UpdateJobRequest"; + }; + + return UpdateJobRequest; + })(); + + v1alpha.ListJobsRequest = (function() { + + /** + * Properties of a ListJobsRequest. + * @memberof google.cloud.batch.v1alpha + * @interface IListJobsRequest + * @property {string|null} [parent] ListJobsRequest parent + * @property {string|null} [filter] ListJobsRequest filter + * @property {string|null} [orderBy] ListJobsRequest orderBy + * @property {number|null} [pageSize] ListJobsRequest pageSize + * @property {string|null} [pageToken] ListJobsRequest pageToken + */ + + /** + * Constructs a new ListJobsRequest. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a ListJobsRequest. + * @implements IListJobsRequest + * @constructor + * @param {google.cloud.batch.v1alpha.IListJobsRequest=} [properties] Properties to set + */ + function ListJobsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListJobsRequest parent. + * @member {string} parent + * @memberof google.cloud.batch.v1alpha.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.parent = ""; + + /** + * ListJobsRequest filter. + * @member {string} filter + * @memberof google.cloud.batch.v1alpha.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.filter = ""; + + /** + * ListJobsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.batch.v1alpha.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.orderBy = ""; + + /** + * ListJobsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.batch.v1alpha.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.pageSize = 0; + + /** + * ListJobsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.batch.v1alpha.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListJobsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.ListJobsRequest + * @static + * @param {google.cloud.batch.v1alpha.IListJobsRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.ListJobsRequest} ListJobsRequest instance + */ + ListJobsRequest.create = function create(properties) { + return new ListJobsRequest(properties); + }; + + /** + * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.ListJobsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.ListJobsRequest + * @static + * @param {google.cloud.batch.v1alpha.IListJobsRequest} message ListJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListJobsRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListJobsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.ListJobsRequest + * @static + * @param {google.cloud.batch.v1alpha.IListJobsRequest} message ListJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.ListJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.ListJobsRequest} ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ListJobsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.ListJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.ListJobsRequest} ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListJobsRequest message. + * @function verify + * @memberof google.cloud.batch.v1alpha.ListJobsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListJobsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListJobsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.ListJobsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.ListJobsRequest} ListJobsRequest + */ + ListJobsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.ListJobsRequest) + return object; + var message = new $root.google.cloud.batch.v1alpha.ListJobsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListJobsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.ListJobsRequest + * @static + * @param {google.cloud.batch.v1alpha.ListJobsRequest} message ListJobsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListJobsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListJobsRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.ListJobsRequest + * @instance + * @returns {Object.} JSON object + */ + ListJobsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListJobsRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.ListJobsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListJobsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.ListJobsRequest"; + }; + + return ListJobsRequest; + })(); + + v1alpha.ListJobsResponse = (function() { + + /** + * Properties of a ListJobsResponse. + * @memberof google.cloud.batch.v1alpha + * @interface IListJobsResponse + * @property {Array.|null} [jobs] ListJobsResponse jobs + * @property {string|null} [nextPageToken] ListJobsResponse nextPageToken + * @property {Array.|null} [unreachable] ListJobsResponse unreachable + */ + + /** + * Constructs a new ListJobsResponse. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a ListJobsResponse. + * @implements IListJobsResponse + * @constructor + * @param {google.cloud.batch.v1alpha.IListJobsResponse=} [properties] Properties to set + */ + function ListJobsResponse(properties) { + this.jobs = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListJobsResponse jobs. + * @member {Array.} jobs + * @memberof google.cloud.batch.v1alpha.ListJobsResponse + * @instance + */ + ListJobsResponse.prototype.jobs = $util.emptyArray; + + /** + * ListJobsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.batch.v1alpha.ListJobsResponse + * @instance + */ + ListJobsResponse.prototype.nextPageToken = ""; + + /** + * ListJobsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.batch.v1alpha.ListJobsResponse + * @instance + */ + ListJobsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListJobsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.ListJobsResponse + * @static + * @param {google.cloud.batch.v1alpha.IListJobsResponse=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.ListJobsResponse} ListJobsResponse instance + */ + ListJobsResponse.create = function create(properties) { + return new ListJobsResponse(properties); + }; + + /** + * Encodes the specified ListJobsResponse message. Does not implicitly {@link google.cloud.batch.v1alpha.ListJobsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.ListJobsResponse + * @static + * @param {google.cloud.batch.v1alpha.IListJobsResponse} message ListJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.jobs != null && message.jobs.length) + for (var i = 0; i < message.jobs.length; ++i) + $root.google.cloud.batch.v1alpha.Job.encode(message.jobs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListJobsResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListJobsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.ListJobsResponse + * @static + * @param {google.cloud.batch.v1alpha.IListJobsResponse} message ListJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.ListJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.ListJobsResponse} ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ListJobsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.jobs && message.jobs.length)) + message.jobs = []; + message.jobs.push($root.google.cloud.batch.v1alpha.Job.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.ListJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.ListJobsResponse} ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListJobsResponse message. + * @function verify + * @memberof google.cloud.batch.v1alpha.ListJobsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListJobsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.jobs != null && message.hasOwnProperty("jobs")) { + if (!Array.isArray(message.jobs)) + return "jobs: array expected"; + for (var i = 0; i < message.jobs.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.Job.verify(message.jobs[i]); + if (error) + return "jobs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListJobsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.ListJobsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.ListJobsResponse} ListJobsResponse + */ + ListJobsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.ListJobsResponse) + return object; + var message = new $root.google.cloud.batch.v1alpha.ListJobsResponse(); + if (object.jobs) { + if (!Array.isArray(object.jobs)) + throw TypeError(".google.cloud.batch.v1alpha.ListJobsResponse.jobs: array expected"); + message.jobs = []; + for (var i = 0; i < object.jobs.length; ++i) { + if (typeof object.jobs[i] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.ListJobsResponse.jobs: object expected"); + message.jobs[i] = $root.google.cloud.batch.v1alpha.Job.fromObject(object.jobs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.batch.v1alpha.ListJobsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListJobsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.ListJobsResponse + * @static + * @param {google.cloud.batch.v1alpha.ListJobsResponse} message ListJobsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListJobsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.jobs = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.jobs && message.jobs.length) { + object.jobs = []; + for (var j = 0; j < message.jobs.length; ++j) + object.jobs[j] = $root.google.cloud.batch.v1alpha.Job.toObject(message.jobs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListJobsResponse to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.ListJobsResponse + * @instance + * @returns {Object.} JSON object + */ + ListJobsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListJobsResponse + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.ListJobsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListJobsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.ListJobsResponse"; + }; + + return ListJobsResponse; + })(); + + v1alpha.ListTasksRequest = (function() { + + /** + * Properties of a ListTasksRequest. + * @memberof google.cloud.batch.v1alpha + * @interface IListTasksRequest + * @property {string|null} [parent] ListTasksRequest parent + * @property {string|null} [filter] ListTasksRequest filter + * @property {string|null} [orderBy] ListTasksRequest orderBy + * @property {number|null} [pageSize] ListTasksRequest pageSize + * @property {string|null} [pageToken] ListTasksRequest pageToken + */ + + /** + * Constructs a new ListTasksRequest. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a ListTasksRequest. + * @implements IListTasksRequest + * @constructor + * @param {google.cloud.batch.v1alpha.IListTasksRequest=} [properties] Properties to set + */ + function ListTasksRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTasksRequest parent. + * @member {string} parent + * @memberof google.cloud.batch.v1alpha.ListTasksRequest + * @instance + */ + ListTasksRequest.prototype.parent = ""; + + /** + * ListTasksRequest filter. + * @member {string} filter + * @memberof google.cloud.batch.v1alpha.ListTasksRequest + * @instance + */ + ListTasksRequest.prototype.filter = ""; + + /** + * ListTasksRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.batch.v1alpha.ListTasksRequest + * @instance + */ + ListTasksRequest.prototype.orderBy = ""; + + /** + * ListTasksRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.batch.v1alpha.ListTasksRequest + * @instance + */ + ListTasksRequest.prototype.pageSize = 0; + + /** + * ListTasksRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.batch.v1alpha.ListTasksRequest + * @instance + */ + ListTasksRequest.prototype.pageToken = ""; + + /** + * Creates a new ListTasksRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.ListTasksRequest + * @static + * @param {google.cloud.batch.v1alpha.IListTasksRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.ListTasksRequest} ListTasksRequest instance + */ + ListTasksRequest.create = function create(properties) { + return new ListTasksRequest(properties); + }; + + /** + * Encodes the specified ListTasksRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.ListTasksRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.ListTasksRequest + * @static + * @param {google.cloud.batch.v1alpha.IListTasksRequest} message ListTasksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTasksRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListTasksRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListTasksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.ListTasksRequest + * @static + * @param {google.cloud.batch.v1alpha.IListTasksRequest} message ListTasksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTasksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTasksRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.ListTasksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.ListTasksRequest} ListTasksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTasksRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ListTasksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTasksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.ListTasksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.ListTasksRequest} ListTasksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTasksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTasksRequest message. + * @function verify + * @memberof google.cloud.batch.v1alpha.ListTasksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTasksRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListTasksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.ListTasksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.ListTasksRequest} ListTasksRequest + */ + ListTasksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.ListTasksRequest) + return object; + var message = new $root.google.cloud.batch.v1alpha.ListTasksRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListTasksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.ListTasksRequest + * @static + * @param {google.cloud.batch.v1alpha.ListTasksRequest} message ListTasksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTasksRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListTasksRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.ListTasksRequest + * @instance + * @returns {Object.} JSON object + */ + ListTasksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTasksRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.ListTasksRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTasksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.ListTasksRequest"; + }; + + return ListTasksRequest; + })(); + + v1alpha.ListTasksResponse = (function() { + + /** + * Properties of a ListTasksResponse. + * @memberof google.cloud.batch.v1alpha + * @interface IListTasksResponse + * @property {Array.|null} [tasks] ListTasksResponse tasks + * @property {string|null} [nextPageToken] ListTasksResponse nextPageToken + * @property {Array.|null} [unreachable] ListTasksResponse unreachable + */ + + /** + * Constructs a new ListTasksResponse. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a ListTasksResponse. + * @implements IListTasksResponse + * @constructor + * @param {google.cloud.batch.v1alpha.IListTasksResponse=} [properties] Properties to set + */ + function ListTasksResponse(properties) { + this.tasks = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTasksResponse tasks. + * @member {Array.} tasks + * @memberof google.cloud.batch.v1alpha.ListTasksResponse + * @instance + */ + ListTasksResponse.prototype.tasks = $util.emptyArray; + + /** + * ListTasksResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.batch.v1alpha.ListTasksResponse + * @instance + */ + ListTasksResponse.prototype.nextPageToken = ""; + + /** + * ListTasksResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.batch.v1alpha.ListTasksResponse + * @instance + */ + ListTasksResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListTasksResponse instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.ListTasksResponse + * @static + * @param {google.cloud.batch.v1alpha.IListTasksResponse=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.ListTasksResponse} ListTasksResponse instance + */ + ListTasksResponse.create = function create(properties) { + return new ListTasksResponse(properties); + }; + + /** + * Encodes the specified ListTasksResponse message. Does not implicitly {@link google.cloud.batch.v1alpha.ListTasksResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.ListTasksResponse + * @static + * @param {google.cloud.batch.v1alpha.IListTasksResponse} message ListTasksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTasksResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tasks != null && message.tasks.length) + for (var i = 0; i < message.tasks.length; ++i) + $root.google.cloud.batch.v1alpha.Task.encode(message.tasks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListTasksResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListTasksResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.ListTasksResponse + * @static + * @param {google.cloud.batch.v1alpha.IListTasksResponse} message ListTasksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTasksResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTasksResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.ListTasksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.ListTasksResponse} ListTasksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTasksResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ListTasksResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.tasks && message.tasks.length)) + message.tasks = []; + message.tasks.push($root.google.cloud.batch.v1alpha.Task.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTasksResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.ListTasksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.ListTasksResponse} ListTasksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTasksResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTasksResponse message. + * @function verify + * @memberof google.cloud.batch.v1alpha.ListTasksResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTasksResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tasks != null && message.hasOwnProperty("tasks")) { + if (!Array.isArray(message.tasks)) + return "tasks: array expected"; + for (var i = 0; i < message.tasks.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.Task.verify(message.tasks[i]); + if (error) + return "tasks." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListTasksResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.ListTasksResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.ListTasksResponse} ListTasksResponse + */ + ListTasksResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.ListTasksResponse) + return object; + var message = new $root.google.cloud.batch.v1alpha.ListTasksResponse(); + if (object.tasks) { + if (!Array.isArray(object.tasks)) + throw TypeError(".google.cloud.batch.v1alpha.ListTasksResponse.tasks: array expected"); + message.tasks = []; + for (var i = 0; i < object.tasks.length; ++i) { + if (typeof object.tasks[i] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.ListTasksResponse.tasks: object expected"); + message.tasks[i] = $root.google.cloud.batch.v1alpha.Task.fromObject(object.tasks[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.batch.v1alpha.ListTasksResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListTasksResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.ListTasksResponse + * @static + * @param {google.cloud.batch.v1alpha.ListTasksResponse} message ListTasksResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTasksResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.tasks = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.tasks && message.tasks.length) { + object.tasks = []; + for (var j = 0; j < message.tasks.length; ++j) + object.tasks[j] = $root.google.cloud.batch.v1alpha.Task.toObject(message.tasks[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListTasksResponse to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.ListTasksResponse + * @instance + * @returns {Object.} JSON object + */ + ListTasksResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTasksResponse + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.ListTasksResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTasksResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.ListTasksResponse"; + }; + + return ListTasksResponse; + })(); + + v1alpha.GetTaskRequest = (function() { + + /** + * Properties of a GetTaskRequest. + * @memberof google.cloud.batch.v1alpha + * @interface IGetTaskRequest + * @property {string|null} [name] GetTaskRequest name + */ + + /** + * Constructs a new GetTaskRequest. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a GetTaskRequest. + * @implements IGetTaskRequest + * @constructor + * @param {google.cloud.batch.v1alpha.IGetTaskRequest=} [properties] Properties to set + */ + function GetTaskRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTaskRequest name. + * @member {string} name + * @memberof google.cloud.batch.v1alpha.GetTaskRequest + * @instance + */ + GetTaskRequest.prototype.name = ""; + + /** + * Creates a new GetTaskRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.GetTaskRequest + * @static + * @param {google.cloud.batch.v1alpha.IGetTaskRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.GetTaskRequest} GetTaskRequest instance + */ + GetTaskRequest.create = function create(properties) { + return new GetTaskRequest(properties); + }; + + /** + * Encodes the specified GetTaskRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.GetTaskRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.GetTaskRequest + * @static + * @param {google.cloud.batch.v1alpha.IGetTaskRequest} message GetTaskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTaskRequest.encode = function encode(message, writer) { + 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 GetTaskRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.GetTaskRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.GetTaskRequest + * @static + * @param {google.cloud.batch.v1alpha.IGetTaskRequest} message GetTaskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTaskRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTaskRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.GetTaskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.GetTaskRequest} GetTaskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTaskRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.GetTaskRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTaskRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.GetTaskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.GetTaskRequest} GetTaskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTaskRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTaskRequest message. + * @function verify + * @memberof google.cloud.batch.v1alpha.GetTaskRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTaskRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetTaskRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.GetTaskRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.GetTaskRequest} GetTaskRequest + */ + GetTaskRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.GetTaskRequest) + return object; + var message = new $root.google.cloud.batch.v1alpha.GetTaskRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetTaskRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.GetTaskRequest + * @static + * @param {google.cloud.batch.v1alpha.GetTaskRequest} message GetTaskRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTaskRequest.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 GetTaskRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.GetTaskRequest + * @instance + * @returns {Object.} JSON object + */ + GetTaskRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTaskRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.GetTaskRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTaskRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.GetTaskRequest"; + }; + + return GetTaskRequest; + })(); + + v1alpha.CreateResourceAllowanceRequest = (function() { + + /** + * Properties of a CreateResourceAllowanceRequest. + * @memberof google.cloud.batch.v1alpha + * @interface ICreateResourceAllowanceRequest + * @property {string|null} [parent] CreateResourceAllowanceRequest parent + * @property {string|null} [resourceAllowanceId] CreateResourceAllowanceRequest resourceAllowanceId + * @property {google.cloud.batch.v1alpha.IResourceAllowance|null} [resourceAllowance] CreateResourceAllowanceRequest resourceAllowance + * @property {string|null} [requestId] CreateResourceAllowanceRequest requestId + */ + + /** + * Constructs a new CreateResourceAllowanceRequest. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a CreateResourceAllowanceRequest. + * @implements ICreateResourceAllowanceRequest + * @constructor + * @param {google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest=} [properties] Properties to set + */ + function CreateResourceAllowanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateResourceAllowanceRequest parent. + * @member {string} parent + * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest + * @instance + */ + CreateResourceAllowanceRequest.prototype.parent = ""; + + /** + * CreateResourceAllowanceRequest resourceAllowanceId. + * @member {string} resourceAllowanceId + * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest + * @instance + */ + CreateResourceAllowanceRequest.prototype.resourceAllowanceId = ""; + + /** + * CreateResourceAllowanceRequest resourceAllowance. + * @member {google.cloud.batch.v1alpha.IResourceAllowance|null|undefined} resourceAllowance + * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest + * @instance + */ + CreateResourceAllowanceRequest.prototype.resourceAllowance = null; + + /** + * CreateResourceAllowanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest + * @instance + */ + CreateResourceAllowanceRequest.prototype.requestId = ""; + + /** + * Creates a new CreateResourceAllowanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest + * @static + * @param {google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.CreateResourceAllowanceRequest} CreateResourceAllowanceRequest instance + */ + CreateResourceAllowanceRequest.create = function create(properties) { + return new CreateResourceAllowanceRequest(properties); + }; + + /** + * Encodes the specified CreateResourceAllowanceRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.CreateResourceAllowanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest + * @static + * @param {google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest} message CreateResourceAllowanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateResourceAllowanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.resourceAllowanceId != null && Object.hasOwnProperty.call(message, "resourceAllowanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceAllowanceId); + if (message.resourceAllowance != null && Object.hasOwnProperty.call(message, "resourceAllowance")) + $root.google.cloud.batch.v1alpha.ResourceAllowance.encode(message.resourceAllowance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateResourceAllowanceRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.CreateResourceAllowanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest + * @static + * @param {google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest} message CreateResourceAllowanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateResourceAllowanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateResourceAllowanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.CreateResourceAllowanceRequest} CreateResourceAllowanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateResourceAllowanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.resourceAllowanceId = reader.string(); + break; + } + case 3: { + message.resourceAllowance = $root.google.cloud.batch.v1alpha.ResourceAllowance.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateResourceAllowanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.CreateResourceAllowanceRequest} CreateResourceAllowanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateResourceAllowanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateResourceAllowanceRequest message. + * @function verify + * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateResourceAllowanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.resourceAllowanceId != null && message.hasOwnProperty("resourceAllowanceId")) + if (!$util.isString(message.resourceAllowanceId)) + return "resourceAllowanceId: string expected"; + if (message.resourceAllowance != null && message.hasOwnProperty("resourceAllowance")) { + var error = $root.google.cloud.batch.v1alpha.ResourceAllowance.verify(message.resourceAllowance); + if (error) + return "resourceAllowance." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateResourceAllowanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.CreateResourceAllowanceRequest} CreateResourceAllowanceRequest + */ + CreateResourceAllowanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest) + return object; + var message = new $root.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.resourceAllowanceId != null) + message.resourceAllowanceId = String(object.resourceAllowanceId); + if (object.resourceAllowance != null) { + if (typeof object.resourceAllowance !== "object") + throw TypeError(".google.cloud.batch.v1alpha.CreateResourceAllowanceRequest.resourceAllowance: object expected"); + message.resourceAllowance = $root.google.cloud.batch.v1alpha.ResourceAllowance.fromObject(object.resourceAllowance); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateResourceAllowanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest + * @static + * @param {google.cloud.batch.v1alpha.CreateResourceAllowanceRequest} message CreateResourceAllowanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateResourceAllowanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.resourceAllowanceId = ""; + object.resourceAllowance = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.resourceAllowanceId != null && message.hasOwnProperty("resourceAllowanceId")) + object.resourceAllowanceId = message.resourceAllowanceId; + if (message.resourceAllowance != null && message.hasOwnProperty("resourceAllowance")) + object.resourceAllowance = $root.google.cloud.batch.v1alpha.ResourceAllowance.toObject(message.resourceAllowance, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateResourceAllowanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateResourceAllowanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateResourceAllowanceRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateResourceAllowanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.CreateResourceAllowanceRequest"; + }; + + return CreateResourceAllowanceRequest; + })(); + + v1alpha.GetResourceAllowanceRequest = (function() { + + /** + * Properties of a GetResourceAllowanceRequest. + * @memberof google.cloud.batch.v1alpha + * @interface IGetResourceAllowanceRequest + * @property {string|null} [name] GetResourceAllowanceRequest name + */ + + /** + * Constructs a new GetResourceAllowanceRequest. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a GetResourceAllowanceRequest. + * @implements IGetResourceAllowanceRequest + * @constructor + * @param {google.cloud.batch.v1alpha.IGetResourceAllowanceRequest=} [properties] Properties to set + */ + function GetResourceAllowanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetResourceAllowanceRequest name. + * @member {string} name + * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest + * @instance + */ + GetResourceAllowanceRequest.prototype.name = ""; + + /** + * Creates a new GetResourceAllowanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest + * @static + * @param {google.cloud.batch.v1alpha.IGetResourceAllowanceRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.GetResourceAllowanceRequest} GetResourceAllowanceRequest instance + */ + GetResourceAllowanceRequest.create = function create(properties) { + return new GetResourceAllowanceRequest(properties); + }; + + /** + * Encodes the specified GetResourceAllowanceRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.GetResourceAllowanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest + * @static + * @param {google.cloud.batch.v1alpha.IGetResourceAllowanceRequest} message GetResourceAllowanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetResourceAllowanceRequest.encode = function encode(message, writer) { + 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 GetResourceAllowanceRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.GetResourceAllowanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest + * @static + * @param {google.cloud.batch.v1alpha.IGetResourceAllowanceRequest} message GetResourceAllowanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetResourceAllowanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetResourceAllowanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.GetResourceAllowanceRequest} GetResourceAllowanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetResourceAllowanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.GetResourceAllowanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetResourceAllowanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.GetResourceAllowanceRequest} GetResourceAllowanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetResourceAllowanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetResourceAllowanceRequest message. + * @function verify + * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetResourceAllowanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetResourceAllowanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.GetResourceAllowanceRequest} GetResourceAllowanceRequest + */ + GetResourceAllowanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.GetResourceAllowanceRequest) + return object; + var message = new $root.google.cloud.batch.v1alpha.GetResourceAllowanceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetResourceAllowanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest + * @static + * @param {google.cloud.batch.v1alpha.GetResourceAllowanceRequest} message GetResourceAllowanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetResourceAllowanceRequest.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 GetResourceAllowanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetResourceAllowanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetResourceAllowanceRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetResourceAllowanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.GetResourceAllowanceRequest"; + }; + + return GetResourceAllowanceRequest; + })(); + + v1alpha.DeleteResourceAllowanceRequest = (function() { + + /** + * Properties of a DeleteResourceAllowanceRequest. + * @memberof google.cloud.batch.v1alpha + * @interface IDeleteResourceAllowanceRequest + * @property {string|null} [name] DeleteResourceAllowanceRequest name + * @property {string|null} [reason] DeleteResourceAllowanceRequest reason + * @property {string|null} [requestId] DeleteResourceAllowanceRequest requestId + */ + + /** + * Constructs a new DeleteResourceAllowanceRequest. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a DeleteResourceAllowanceRequest. + * @implements IDeleteResourceAllowanceRequest + * @constructor + * @param {google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest=} [properties] Properties to set + */ + function DeleteResourceAllowanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteResourceAllowanceRequest name. + * @member {string} name + * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest + * @instance + */ + DeleteResourceAllowanceRequest.prototype.name = ""; + + /** + * DeleteResourceAllowanceRequest reason. + * @member {string} reason + * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest + * @instance + */ + DeleteResourceAllowanceRequest.prototype.reason = ""; + + /** + * DeleteResourceAllowanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest + * @instance + */ + DeleteResourceAllowanceRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteResourceAllowanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest + * @static + * @param {google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest} DeleteResourceAllowanceRequest instance + */ + DeleteResourceAllowanceRequest.create = function create(properties) { + return new DeleteResourceAllowanceRequest(properties); + }; + + /** + * Encodes the specified DeleteResourceAllowanceRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest + * @static + * @param {google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest} message DeleteResourceAllowanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteResourceAllowanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.reason); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteResourceAllowanceRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest + * @static + * @param {google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest} message DeleteResourceAllowanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteResourceAllowanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteResourceAllowanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest} DeleteResourceAllowanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteResourceAllowanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.reason = reader.string(); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteResourceAllowanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest} DeleteResourceAllowanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteResourceAllowanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteResourceAllowanceRequest message. + * @function verify + * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteResourceAllowanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.reason != null && message.hasOwnProperty("reason")) + if (!$util.isString(message.reason)) + return "reason: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteResourceAllowanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest} DeleteResourceAllowanceRequest + */ + DeleteResourceAllowanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest) + return object; + var message = new $root.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.reason != null) + message.reason = String(object.reason); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteResourceAllowanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest + * @static + * @param {google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest} message DeleteResourceAllowanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteResourceAllowanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.reason = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.reason != null && message.hasOwnProperty("reason")) + object.reason = message.reason; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteResourceAllowanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteResourceAllowanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteResourceAllowanceRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteResourceAllowanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest"; + }; + + return DeleteResourceAllowanceRequest; + })(); + + v1alpha.ListResourceAllowancesRequest = (function() { + + /** + * Properties of a ListResourceAllowancesRequest. + * @memberof google.cloud.batch.v1alpha + * @interface IListResourceAllowancesRequest + * @property {string|null} [parent] ListResourceAllowancesRequest parent + * @property {number|null} [pageSize] ListResourceAllowancesRequest pageSize + * @property {string|null} [pageToken] ListResourceAllowancesRequest pageToken + */ + + /** + * Constructs a new ListResourceAllowancesRequest. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a ListResourceAllowancesRequest. + * @implements IListResourceAllowancesRequest + * @constructor + * @param {google.cloud.batch.v1alpha.IListResourceAllowancesRequest=} [properties] Properties to set + */ + function ListResourceAllowancesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListResourceAllowancesRequest parent. + * @member {string} parent + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest + * @instance + */ + ListResourceAllowancesRequest.prototype.parent = ""; + + /** + * ListResourceAllowancesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest + * @instance + */ + ListResourceAllowancesRequest.prototype.pageSize = 0; + + /** + * ListResourceAllowancesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest + * @instance + */ + ListResourceAllowancesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListResourceAllowancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest + * @static + * @param {google.cloud.batch.v1alpha.IListResourceAllowancesRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.ListResourceAllowancesRequest} ListResourceAllowancesRequest instance + */ + ListResourceAllowancesRequest.create = function create(properties) { + return new ListResourceAllowancesRequest(properties); + }; + + /** + * Encodes the specified ListResourceAllowancesRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.ListResourceAllowancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest + * @static + * @param {google.cloud.batch.v1alpha.IListResourceAllowancesRequest} message ListResourceAllowancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListResourceAllowancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListResourceAllowancesRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListResourceAllowancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest + * @static + * @param {google.cloud.batch.v1alpha.IListResourceAllowancesRequest} message ListResourceAllowancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListResourceAllowancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListResourceAllowancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.ListResourceAllowancesRequest} ListResourceAllowancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListResourceAllowancesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ListResourceAllowancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListResourceAllowancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.ListResourceAllowancesRequest} ListResourceAllowancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListResourceAllowancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListResourceAllowancesRequest message. + * @function verify + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListResourceAllowancesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListResourceAllowancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.ListResourceAllowancesRequest} ListResourceAllowancesRequest + */ + ListResourceAllowancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.ListResourceAllowancesRequest) + return object; + var message = new $root.google.cloud.batch.v1alpha.ListResourceAllowancesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListResourceAllowancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest + * @static + * @param {google.cloud.batch.v1alpha.ListResourceAllowancesRequest} message ListResourceAllowancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListResourceAllowancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListResourceAllowancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest + * @instance + * @returns {Object.} JSON object + */ + ListResourceAllowancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListResourceAllowancesRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListResourceAllowancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.ListResourceAllowancesRequest"; + }; + + return ListResourceAllowancesRequest; + })(); + + v1alpha.ListResourceAllowancesResponse = (function() { + + /** + * Properties of a ListResourceAllowancesResponse. + * @memberof google.cloud.batch.v1alpha + * @interface IListResourceAllowancesResponse + * @property {Array.|null} [resourceAllowances] ListResourceAllowancesResponse resourceAllowances + * @property {string|null} [nextPageToken] ListResourceAllowancesResponse nextPageToken + * @property {Array.|null} [unreachable] ListResourceAllowancesResponse unreachable + */ + + /** + * Constructs a new ListResourceAllowancesResponse. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a ListResourceAllowancesResponse. + * @implements IListResourceAllowancesResponse + * @constructor + * @param {google.cloud.batch.v1alpha.IListResourceAllowancesResponse=} [properties] Properties to set + */ + function ListResourceAllowancesResponse(properties) { + this.resourceAllowances = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListResourceAllowancesResponse resourceAllowances. + * @member {Array.} resourceAllowances + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse + * @instance + */ + ListResourceAllowancesResponse.prototype.resourceAllowances = $util.emptyArray; + + /** + * ListResourceAllowancesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse + * @instance + */ + ListResourceAllowancesResponse.prototype.nextPageToken = ""; + + /** + * ListResourceAllowancesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse + * @instance + */ + ListResourceAllowancesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListResourceAllowancesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse + * @static + * @param {google.cloud.batch.v1alpha.IListResourceAllowancesResponse=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.ListResourceAllowancesResponse} ListResourceAllowancesResponse instance + */ + ListResourceAllowancesResponse.create = function create(properties) { + return new ListResourceAllowancesResponse(properties); + }; + + /** + * Encodes the specified ListResourceAllowancesResponse message. Does not implicitly {@link google.cloud.batch.v1alpha.ListResourceAllowancesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse + * @static + * @param {google.cloud.batch.v1alpha.IListResourceAllowancesResponse} message ListResourceAllowancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListResourceAllowancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceAllowances != null && message.resourceAllowances.length) + for (var i = 0; i < message.resourceAllowances.length; ++i) + $root.google.cloud.batch.v1alpha.ResourceAllowance.encode(message.resourceAllowances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListResourceAllowancesResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListResourceAllowancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse + * @static + * @param {google.cloud.batch.v1alpha.IListResourceAllowancesResponse} message ListResourceAllowancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListResourceAllowancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListResourceAllowancesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.ListResourceAllowancesResponse} ListResourceAllowancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListResourceAllowancesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ListResourceAllowancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.resourceAllowances && message.resourceAllowances.length)) + message.resourceAllowances = []; + message.resourceAllowances.push($root.google.cloud.batch.v1alpha.ResourceAllowance.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListResourceAllowancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.ListResourceAllowancesResponse} ListResourceAllowancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListResourceAllowancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListResourceAllowancesResponse message. + * @function verify + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListResourceAllowancesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceAllowances != null && message.hasOwnProperty("resourceAllowances")) { + if (!Array.isArray(message.resourceAllowances)) + return "resourceAllowances: array expected"; + for (var i = 0; i < message.resourceAllowances.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.ResourceAllowance.verify(message.resourceAllowances[i]); + if (error) + return "resourceAllowances." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListResourceAllowancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.ListResourceAllowancesResponse} ListResourceAllowancesResponse + */ + ListResourceAllowancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.ListResourceAllowancesResponse) + return object; + var message = new $root.google.cloud.batch.v1alpha.ListResourceAllowancesResponse(); + if (object.resourceAllowances) { + if (!Array.isArray(object.resourceAllowances)) + throw TypeError(".google.cloud.batch.v1alpha.ListResourceAllowancesResponse.resourceAllowances: array expected"); + message.resourceAllowances = []; + for (var i = 0; i < object.resourceAllowances.length; ++i) { + if (typeof object.resourceAllowances[i] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.ListResourceAllowancesResponse.resourceAllowances: object expected"); + message.resourceAllowances[i] = $root.google.cloud.batch.v1alpha.ResourceAllowance.fromObject(object.resourceAllowances[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.batch.v1alpha.ListResourceAllowancesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListResourceAllowancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse + * @static + * @param {google.cloud.batch.v1alpha.ListResourceAllowancesResponse} message ListResourceAllowancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListResourceAllowancesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.resourceAllowances = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.resourceAllowances && message.resourceAllowances.length) { + object.resourceAllowances = []; + for (var j = 0; j < message.resourceAllowances.length; ++j) + object.resourceAllowances[j] = $root.google.cloud.batch.v1alpha.ResourceAllowance.toObject(message.resourceAllowances[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListResourceAllowancesResponse to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse + * @instance + * @returns {Object.} JSON object + */ + ListResourceAllowancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListResourceAllowancesResponse + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListResourceAllowancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.ListResourceAllowancesResponse"; + }; + + return ListResourceAllowancesResponse; + })(); + + v1alpha.UpdateResourceAllowanceRequest = (function() { + + /** + * Properties of an UpdateResourceAllowanceRequest. + * @memberof google.cloud.batch.v1alpha + * @interface IUpdateResourceAllowanceRequest + * @property {google.cloud.batch.v1alpha.IResourceAllowance|null} [resourceAllowance] UpdateResourceAllowanceRequest resourceAllowance + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateResourceAllowanceRequest updateMask + * @property {string|null} [requestId] UpdateResourceAllowanceRequest requestId + */ + + /** + * Constructs a new UpdateResourceAllowanceRequest. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents an UpdateResourceAllowanceRequest. + * @implements IUpdateResourceAllowanceRequest + * @constructor + * @param {google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest=} [properties] Properties to set + */ + function UpdateResourceAllowanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateResourceAllowanceRequest resourceAllowance. + * @member {google.cloud.batch.v1alpha.IResourceAllowance|null|undefined} resourceAllowance + * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest + * @instance + */ + UpdateResourceAllowanceRequest.prototype.resourceAllowance = null; + + /** + * UpdateResourceAllowanceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest + * @instance + */ + UpdateResourceAllowanceRequest.prototype.updateMask = null; + + /** + * UpdateResourceAllowanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest + * @instance + */ + UpdateResourceAllowanceRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateResourceAllowanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest + * @static + * @param {google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest} UpdateResourceAllowanceRequest instance + */ + UpdateResourceAllowanceRequest.create = function create(properties) { + return new UpdateResourceAllowanceRequest(properties); + }; + + /** + * Encodes the specified UpdateResourceAllowanceRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest + * @static + * @param {google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest} message UpdateResourceAllowanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateResourceAllowanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceAllowance != null && Object.hasOwnProperty.call(message, "resourceAllowance")) + $root.google.cloud.batch.v1alpha.ResourceAllowance.encode(message.resourceAllowance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateResourceAllowanceRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest + * @static + * @param {google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest} message UpdateResourceAllowanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateResourceAllowanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateResourceAllowanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest} UpdateResourceAllowanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateResourceAllowanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.resourceAllowance = $root.google.cloud.batch.v1alpha.ResourceAllowance.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateResourceAllowanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest} UpdateResourceAllowanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateResourceAllowanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateResourceAllowanceRequest message. + * @function verify + * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateResourceAllowanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceAllowance != null && message.hasOwnProperty("resourceAllowance")) { + var error = $root.google.cloud.batch.v1alpha.ResourceAllowance.verify(message.resourceAllowance); + if (error) + return "resourceAllowance." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateResourceAllowanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest} UpdateResourceAllowanceRequest + */ + UpdateResourceAllowanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest) + return object; + var message = new $root.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest(); + if (object.resourceAllowance != null) { + if (typeof object.resourceAllowance !== "object") + throw TypeError(".google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest.resourceAllowance: object expected"); + message.resourceAllowance = $root.google.cloud.batch.v1alpha.ResourceAllowance.fromObject(object.resourceAllowance); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateResourceAllowanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest + * @static + * @param {google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest} message UpdateResourceAllowanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateResourceAllowanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resourceAllowance = null; + object.updateMask = null; + object.requestId = ""; + } + if (message.resourceAllowance != null && message.hasOwnProperty("resourceAllowance")) + object.resourceAllowance = $root.google.cloud.batch.v1alpha.ResourceAllowance.toObject(message.resourceAllowance, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateResourceAllowanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateResourceAllowanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateResourceAllowanceRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateResourceAllowanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest"; + }; + + return UpdateResourceAllowanceRequest; + })(); + + v1alpha.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.batch.v1alpha + * @interface IOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {string|null} [statusMessage] OperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + * @property {string|null} [apiVersion] OperationMetadata apiVersion + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.batch.v1alpha.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.batch.v1alpha.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.batch.v1alpha.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.batch.v1alpha.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.batch.v1alpha.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.batch.v1alpha.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.batch.v1alpha.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.batch.v1alpha.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.OperationMetadata + * @static + * @param {google.cloud.batch.v1alpha.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.batch.v1alpha.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.OperationMetadata + * @static + * @param {google.cloud.batch.v1alpha.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, 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.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.OperationMetadata + * @static + * @param {google.cloud.batch.v1alpha.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.target = reader.string(); + break; + } + case 4: { + message.verb = reader.string(); + break; + } + case 5: { + message.statusMessage = reader.string(); + break; + } + case 6: { + message.requestedCancellation = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationMetadata message. + * @function verify + * @memberof google.cloud.batch.v1alpha.OperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (typeof message.requestedCancellation !== "boolean") + return "requestedCancellation: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.OperationMetadata) + return object; + var message = new $root.google.cloud.batch.v1alpha.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.batch.v1alpha.OperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.batch.v1alpha.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.OperationMetadata + * @static + * @param {google.cloud.batch.v1alpha.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.target = ""; + object.verb = ""; + object.statusMessage = ""; + object.requestedCancellation = false; + object.apiVersion = ""; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationMetadata + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.OperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1alpha.Job = (function() { + + /** + * Properties of a Job. + * @memberof google.cloud.batch.v1alpha + * @interface IJob + * @property {string|null} [name] Job name + * @property {string|null} [uid] Job uid + * @property {number|Long|null} [priority] Job priority + * @property {Array.|null} [taskGroups] Job taskGroups + * @property {google.cloud.batch.v1alpha.Job.SchedulingPolicy|null} [schedulingPolicy] Job schedulingPolicy + * @property {Array.|null} [dependencies] Job dependencies + * @property {google.cloud.batch.v1alpha.IAllocationPolicy|null} [allocationPolicy] Job allocationPolicy + * @property {Object.|null} [labels] Job labels + * @property {google.cloud.batch.v1alpha.IJobStatus|null} [status] Job status + * @property {google.cloud.batch.v1alpha.IJobNotification|null} [notification] Job notification + * @property {google.protobuf.ITimestamp|null} [createTime] Job createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Job updateTime + * @property {google.cloud.batch.v1alpha.ILogsPolicy|null} [logsPolicy] Job logsPolicy + * @property {Array.|null} [notifications] Job notifications + */ + + /** + * Constructs a new Job. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a Job. + * @implements IJob + * @constructor + * @param {google.cloud.batch.v1alpha.IJob=} [properties] Properties to set + */ + function Job(properties) { + this.taskGroups = []; + this.dependencies = []; + this.labels = {}; + this.notifications = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Job name. + * @member {string} name + * @memberof google.cloud.batch.v1alpha.Job + * @instance + */ + Job.prototype.name = ""; + + /** + * Job uid. + * @member {string} uid + * @memberof google.cloud.batch.v1alpha.Job + * @instance + */ + Job.prototype.uid = ""; + + /** + * Job priority. + * @member {number|Long} priority + * @memberof google.cloud.batch.v1alpha.Job + * @instance + */ + Job.prototype.priority = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Job taskGroups. + * @member {Array.} taskGroups + * @memberof google.cloud.batch.v1alpha.Job + * @instance + */ + Job.prototype.taskGroups = $util.emptyArray; + + /** + * Job schedulingPolicy. + * @member {google.cloud.batch.v1alpha.Job.SchedulingPolicy} schedulingPolicy + * @memberof google.cloud.batch.v1alpha.Job + * @instance + */ + Job.prototype.schedulingPolicy = 0; + + /** + * Job dependencies. + * @member {Array.} dependencies + * @memberof google.cloud.batch.v1alpha.Job + * @instance + */ + Job.prototype.dependencies = $util.emptyArray; + + /** + * Job allocationPolicy. + * @member {google.cloud.batch.v1alpha.IAllocationPolicy|null|undefined} allocationPolicy + * @memberof google.cloud.batch.v1alpha.Job + * @instance + */ + Job.prototype.allocationPolicy = null; + + /** + * Job labels. + * @member {Object.} labels + * @memberof google.cloud.batch.v1alpha.Job + * @instance + */ + Job.prototype.labels = $util.emptyObject; + + /** + * Job status. + * @member {google.cloud.batch.v1alpha.IJobStatus|null|undefined} status + * @memberof google.cloud.batch.v1alpha.Job + * @instance + */ + Job.prototype.status = null; + + /** + * Job notification. + * @member {google.cloud.batch.v1alpha.IJobNotification|null|undefined} notification + * @memberof google.cloud.batch.v1alpha.Job + * @instance + */ + Job.prototype.notification = null; + + /** + * Job createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.batch.v1alpha.Job + * @instance + */ + Job.prototype.createTime = null; + + /** + * Job updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.batch.v1alpha.Job + * @instance + */ + Job.prototype.updateTime = null; + + /** + * Job logsPolicy. + * @member {google.cloud.batch.v1alpha.ILogsPolicy|null|undefined} logsPolicy + * @memberof google.cloud.batch.v1alpha.Job + * @instance + */ + Job.prototype.logsPolicy = null; + + /** + * Job notifications. + * @member {Array.} notifications + * @memberof google.cloud.batch.v1alpha.Job + * @instance + */ + Job.prototype.notifications = $util.emptyArray; + + /** + * Creates a new Job instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.Job + * @static + * @param {google.cloud.batch.v1alpha.IJob=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.Job} Job instance + */ + Job.create = function create(properties) { + return new Job(properties); + }; + + /** + * Encodes the specified Job message. Does not implicitly {@link google.cloud.batch.v1alpha.Job.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.Job + * @static + * @param {google.cloud.batch.v1alpha.IJob} message Job message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Job.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.priority); + if (message.taskGroups != null && message.taskGroups.length) + for (var i = 0; i < message.taskGroups.length; ++i) + $root.google.cloud.batch.v1alpha.TaskGroup.encode(message.taskGroups[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.schedulingPolicy != null && Object.hasOwnProperty.call(message, "schedulingPolicy")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.schedulingPolicy); + if (message.dependencies != null && message.dependencies.length) + for (var i = 0; i < message.dependencies.length; ++i) + $root.google.cloud.batch.v1alpha.JobDependency.encode(message.dependencies[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.allocationPolicy != null && Object.hasOwnProperty.call(message, "allocationPolicy")) + $root.google.cloud.batch.v1alpha.AllocationPolicy.encode(message.allocationPolicy, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.cloud.batch.v1alpha.JobStatus.encode(message.status, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.notification != null && Object.hasOwnProperty.call(message, "notification")) + $root.google.cloud.batch.v1alpha.JobNotification.encode(message.notification, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.logsPolicy != null && Object.hasOwnProperty.call(message, "logsPolicy")) + $root.google.cloud.batch.v1alpha.LogsPolicy.encode(message.logsPolicy, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.notifications != null && message.notifications.length) + for (var i = 0; i < message.notifications.length; ++i) + $root.google.cloud.batch.v1alpha.JobNotification.encode(message.notifications[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Job.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.Job + * @static + * @param {google.cloud.batch.v1alpha.IJob} message Job message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Job.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Job message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.Job + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.Job} Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Job.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Job(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.uid = reader.string(); + break; + } + case 3: { + message.priority = reader.int64(); + break; + } + case 4: { + if (!(message.taskGroups && message.taskGroups.length)) + message.taskGroups = []; + message.taskGroups.push($root.google.cloud.batch.v1alpha.TaskGroup.decode(reader, reader.uint32())); + break; + } + case 5: { + message.schedulingPolicy = reader.int32(); + break; + } + case 6: { + if (!(message.dependencies && message.dependencies.length)) + message.dependencies = []; + message.dependencies.push($root.google.cloud.batch.v1alpha.JobDependency.decode(reader, reader.uint32())); + break; + } + case 7: { + message.allocationPolicy = $root.google.cloud.batch.v1alpha.AllocationPolicy.decode(reader, reader.uint32()); + break; + } + case 8: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 9: { + message.status = $root.google.cloud.batch.v1alpha.JobStatus.decode(reader, reader.uint32()); + break; + } + case 10: { + message.notification = $root.google.cloud.batch.v1alpha.JobNotification.decode(reader, reader.uint32()); + break; + } + case 11: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 12: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 13: { + message.logsPolicy = $root.google.cloud.batch.v1alpha.LogsPolicy.decode(reader, reader.uint32()); + break; + } + case 14: { + if (!(message.notifications && message.notifications.length)) + message.notifications = []; + message.notifications.push($root.google.cloud.batch.v1alpha.JobNotification.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Job message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.Job + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.Job} Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Job.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Job message. + * @function verify + * @memberof google.cloud.batch.v1alpha.Job + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Job.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.priority != null && message.hasOwnProperty("priority")) + if (!$util.isInteger(message.priority) && !(message.priority && $util.isInteger(message.priority.low) && $util.isInteger(message.priority.high))) + return "priority: integer|Long expected"; + if (message.taskGroups != null && message.hasOwnProperty("taskGroups")) { + if (!Array.isArray(message.taskGroups)) + return "taskGroups: array expected"; + for (var i = 0; i < message.taskGroups.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.TaskGroup.verify(message.taskGroups[i]); + if (error) + return "taskGroups." + error; + } + } + if (message.schedulingPolicy != null && message.hasOwnProperty("schedulingPolicy")) + switch (message.schedulingPolicy) { + default: + return "schedulingPolicy: enum value expected"; + case 0: + case 1: + break; + } + if (message.dependencies != null && message.hasOwnProperty("dependencies")) { + if (!Array.isArray(message.dependencies)) + return "dependencies: array expected"; + for (var i = 0; i < message.dependencies.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.JobDependency.verify(message.dependencies[i]); + if (error) + return "dependencies." + error; + } + } + if (message.allocationPolicy != null && message.hasOwnProperty("allocationPolicy")) { + var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.verify(message.allocationPolicy); + if (error) + return "allocationPolicy." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.cloud.batch.v1alpha.JobStatus.verify(message.status); + if (error) + return "status." + error; + } + if (message.notification != null && message.hasOwnProperty("notification")) { + var error = $root.google.cloud.batch.v1alpha.JobNotification.verify(message.notification); + if (error) + return "notification." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.logsPolicy != null && message.hasOwnProperty("logsPolicy")) { + var error = $root.google.cloud.batch.v1alpha.LogsPolicy.verify(message.logsPolicy); + if (error) + return "logsPolicy." + error; + } + if (message.notifications != null && message.hasOwnProperty("notifications")) { + if (!Array.isArray(message.notifications)) + return "notifications: array expected"; + for (var i = 0; i < message.notifications.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.JobNotification.verify(message.notifications[i]); + if (error) + return "notifications." + error; + } + } + return null; + }; + + /** + * Creates a Job message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.Job + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.Job} Job + */ + Job.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.Job) + return object; + var message = new $root.google.cloud.batch.v1alpha.Job(); + if (object.name != null) + message.name = String(object.name); + if (object.uid != null) + message.uid = String(object.uid); + if (object.priority != null) + if ($util.Long) + (message.priority = $util.Long.fromValue(object.priority)).unsigned = false; + else if (typeof object.priority === "string") + message.priority = parseInt(object.priority, 10); + else if (typeof object.priority === "number") + message.priority = object.priority; + else if (typeof object.priority === "object") + message.priority = new $util.LongBits(object.priority.low >>> 0, object.priority.high >>> 0).toNumber(); + if (object.taskGroups) { + if (!Array.isArray(object.taskGroups)) + throw TypeError(".google.cloud.batch.v1alpha.Job.taskGroups: array expected"); + message.taskGroups = []; + for (var i = 0; i < object.taskGroups.length; ++i) { + if (typeof object.taskGroups[i] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Job.taskGroups: object expected"); + message.taskGroups[i] = $root.google.cloud.batch.v1alpha.TaskGroup.fromObject(object.taskGroups[i]); + } + } + switch (object.schedulingPolicy) { + default: + if (typeof object.schedulingPolicy === "number") { + message.schedulingPolicy = object.schedulingPolicy; + break; + } + break; + case "SCHEDULING_POLICY_UNSPECIFIED": + case 0: + message.schedulingPolicy = 0; + break; + case "AS_SOON_AS_POSSIBLE": + case 1: + message.schedulingPolicy = 1; + break; + } + if (object.dependencies) { + if (!Array.isArray(object.dependencies)) + throw TypeError(".google.cloud.batch.v1alpha.Job.dependencies: array expected"); + message.dependencies = []; + for (var i = 0; i < object.dependencies.length; ++i) { + if (typeof object.dependencies[i] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Job.dependencies: object expected"); + message.dependencies[i] = $root.google.cloud.batch.v1alpha.JobDependency.fromObject(object.dependencies[i]); + } + } + if (object.allocationPolicy != null) { + if (typeof object.allocationPolicy !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Job.allocationPolicy: object expected"); + message.allocationPolicy = $root.google.cloud.batch.v1alpha.AllocationPolicy.fromObject(object.allocationPolicy); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Job.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Job.status: object expected"); + message.status = $root.google.cloud.batch.v1alpha.JobStatus.fromObject(object.status); + } + if (object.notification != null) { + if (typeof object.notification !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Job.notification: object expected"); + message.notification = $root.google.cloud.batch.v1alpha.JobNotification.fromObject(object.notification); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Job.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Job.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.logsPolicy != null) { + if (typeof object.logsPolicy !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Job.logsPolicy: object expected"); + message.logsPolicy = $root.google.cloud.batch.v1alpha.LogsPolicy.fromObject(object.logsPolicy); + } + if (object.notifications) { + if (!Array.isArray(object.notifications)) + throw TypeError(".google.cloud.batch.v1alpha.Job.notifications: array expected"); + message.notifications = []; + for (var i = 0; i < object.notifications.length; ++i) { + if (typeof object.notifications[i] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Job.notifications: object expected"); + message.notifications[i] = $root.google.cloud.batch.v1alpha.JobNotification.fromObject(object.notifications[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Job message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.Job + * @static + * @param {google.cloud.batch.v1alpha.Job} message Job + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Job.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.taskGroups = []; + object.dependencies = []; + object.notifications = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.uid = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.priority = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.priority = options.longs === String ? "0" : 0; + object.schedulingPolicy = options.enums === String ? "SCHEDULING_POLICY_UNSPECIFIED" : 0; + object.allocationPolicy = null; + object.status = null; + object.notification = null; + object.createTime = null; + object.updateTime = null; + object.logsPolicy = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.priority != null && message.hasOwnProperty("priority")) + if (typeof message.priority === "number") + object.priority = options.longs === String ? String(message.priority) : message.priority; + else + object.priority = options.longs === String ? $util.Long.prototype.toString.call(message.priority) : options.longs === Number ? new $util.LongBits(message.priority.low >>> 0, message.priority.high >>> 0).toNumber() : message.priority; + if (message.taskGroups && message.taskGroups.length) { + object.taskGroups = []; + for (var j = 0; j < message.taskGroups.length; ++j) + object.taskGroups[j] = $root.google.cloud.batch.v1alpha.TaskGroup.toObject(message.taskGroups[j], options); + } + if (message.schedulingPolicy != null && message.hasOwnProperty("schedulingPolicy")) + object.schedulingPolicy = options.enums === String ? $root.google.cloud.batch.v1alpha.Job.SchedulingPolicy[message.schedulingPolicy] === undefined ? message.schedulingPolicy : $root.google.cloud.batch.v1alpha.Job.SchedulingPolicy[message.schedulingPolicy] : message.schedulingPolicy; + if (message.dependencies && message.dependencies.length) { + object.dependencies = []; + for (var j = 0; j < message.dependencies.length; ++j) + object.dependencies[j] = $root.google.cloud.batch.v1alpha.JobDependency.toObject(message.dependencies[j], options); + } + if (message.allocationPolicy != null && message.hasOwnProperty("allocationPolicy")) + object.allocationPolicy = $root.google.cloud.batch.v1alpha.AllocationPolicy.toObject(message.allocationPolicy, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.cloud.batch.v1alpha.JobStatus.toObject(message.status, options); + if (message.notification != null && message.hasOwnProperty("notification")) + object.notification = $root.google.cloud.batch.v1alpha.JobNotification.toObject(message.notification, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.logsPolicy != null && message.hasOwnProperty("logsPolicy")) + object.logsPolicy = $root.google.cloud.batch.v1alpha.LogsPolicy.toObject(message.logsPolicy, options); + if (message.notifications && message.notifications.length) { + object.notifications = []; + for (var j = 0; j < message.notifications.length; ++j) + object.notifications[j] = $root.google.cloud.batch.v1alpha.JobNotification.toObject(message.notifications[j], options); + } + return object; + }; + + /** + * Converts this Job to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.Job + * @instance + * @returns {Object.} JSON object + */ + Job.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Job + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.Job + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Job.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.Job"; + }; + + /** + * SchedulingPolicy enum. + * @name google.cloud.batch.v1alpha.Job.SchedulingPolicy + * @enum {number} + * @property {number} SCHEDULING_POLICY_UNSPECIFIED=0 SCHEDULING_POLICY_UNSPECIFIED value + * @property {number} AS_SOON_AS_POSSIBLE=1 AS_SOON_AS_POSSIBLE value + */ + Job.SchedulingPolicy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SCHEDULING_POLICY_UNSPECIFIED"] = 0; + values[valuesById[1] = "AS_SOON_AS_POSSIBLE"] = 1; + return values; + })(); + + return Job; + })(); + + v1alpha.LogsPolicy = (function() { + + /** + * Properties of a LogsPolicy. + * @memberof google.cloud.batch.v1alpha + * @interface ILogsPolicy + * @property {google.cloud.batch.v1alpha.LogsPolicy.Destination|null} [destination] LogsPolicy destination + * @property {string|null} [logsPath] LogsPolicy logsPath + * @property {google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption|null} [cloudLoggingOption] LogsPolicy cloudLoggingOption + */ + + /** + * Constructs a new LogsPolicy. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a LogsPolicy. + * @implements ILogsPolicy + * @constructor + * @param {google.cloud.batch.v1alpha.ILogsPolicy=} [properties] Properties to set + */ + function LogsPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LogsPolicy destination. + * @member {google.cloud.batch.v1alpha.LogsPolicy.Destination} destination + * @memberof google.cloud.batch.v1alpha.LogsPolicy + * @instance + */ + LogsPolicy.prototype.destination = 0; + + /** + * LogsPolicy logsPath. + * @member {string} logsPath + * @memberof google.cloud.batch.v1alpha.LogsPolicy + * @instance + */ + LogsPolicy.prototype.logsPath = ""; + + /** + * LogsPolicy cloudLoggingOption. + * @member {google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption|null|undefined} cloudLoggingOption + * @memberof google.cloud.batch.v1alpha.LogsPolicy + * @instance + */ + LogsPolicy.prototype.cloudLoggingOption = null; + + /** + * Creates a new LogsPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.LogsPolicy + * @static + * @param {google.cloud.batch.v1alpha.ILogsPolicy=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.LogsPolicy} LogsPolicy instance + */ + LogsPolicy.create = function create(properties) { + return new LogsPolicy(properties); + }; + + /** + * Encodes the specified LogsPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.LogsPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.LogsPolicy + * @static + * @param {google.cloud.batch.v1alpha.ILogsPolicy} message LogsPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogsPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.destination); + if (message.logsPath != null && Object.hasOwnProperty.call(message, "logsPath")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.logsPath); + if (message.cloudLoggingOption != null && Object.hasOwnProperty.call(message, "cloudLoggingOption")) + $root.google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption.encode(message.cloudLoggingOption, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LogsPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.LogsPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.LogsPolicy + * @static + * @param {google.cloud.batch.v1alpha.ILogsPolicy} message LogsPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogsPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LogsPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.LogsPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.LogsPolicy} LogsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogsPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.LogsPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.destination = reader.int32(); + break; + } + case 2: { + message.logsPath = reader.string(); + break; + } + case 3: { + message.cloudLoggingOption = $root.google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LogsPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.LogsPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.LogsPolicy} LogsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogsPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LogsPolicy message. + * @function verify + * @memberof google.cloud.batch.v1alpha.LogsPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LogsPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.destination != null && message.hasOwnProperty("destination")) + switch (message.destination) { + default: + return "destination: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.logsPath != null && message.hasOwnProperty("logsPath")) + if (!$util.isString(message.logsPath)) + return "logsPath: string expected"; + if (message.cloudLoggingOption != null && message.hasOwnProperty("cloudLoggingOption")) { + var error = $root.google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption.verify(message.cloudLoggingOption); + if (error) + return "cloudLoggingOption." + error; + } + return null; + }; + + /** + * Creates a LogsPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.LogsPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.LogsPolicy} LogsPolicy + */ + LogsPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.LogsPolicy) + return object; + var message = new $root.google.cloud.batch.v1alpha.LogsPolicy(); + switch (object.destination) { + default: + if (typeof object.destination === "number") { + message.destination = object.destination; + break; + } + break; + case "DESTINATION_UNSPECIFIED": + case 0: + message.destination = 0; + break; + case "CLOUD_LOGGING": + case 1: + message.destination = 1; + break; + case "PATH": + case 2: + message.destination = 2; + break; + } + if (object.logsPath != null) + message.logsPath = String(object.logsPath); + if (object.cloudLoggingOption != null) { + if (typeof object.cloudLoggingOption !== "object") + throw TypeError(".google.cloud.batch.v1alpha.LogsPolicy.cloudLoggingOption: object expected"); + message.cloudLoggingOption = $root.google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption.fromObject(object.cloudLoggingOption); + } + return message; + }; + + /** + * Creates a plain object from a LogsPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.LogsPolicy + * @static + * @param {google.cloud.batch.v1alpha.LogsPolicy} message LogsPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LogsPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.destination = options.enums === String ? "DESTINATION_UNSPECIFIED" : 0; + object.logsPath = ""; + object.cloudLoggingOption = null; + } + if (message.destination != null && message.hasOwnProperty("destination")) + object.destination = options.enums === String ? $root.google.cloud.batch.v1alpha.LogsPolicy.Destination[message.destination] === undefined ? message.destination : $root.google.cloud.batch.v1alpha.LogsPolicy.Destination[message.destination] : message.destination; + if (message.logsPath != null && message.hasOwnProperty("logsPath")) + object.logsPath = message.logsPath; + if (message.cloudLoggingOption != null && message.hasOwnProperty("cloudLoggingOption")) + object.cloudLoggingOption = $root.google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption.toObject(message.cloudLoggingOption, options); + return object; + }; + + /** + * Converts this LogsPolicy to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.LogsPolicy + * @instance + * @returns {Object.} JSON object + */ + LogsPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LogsPolicy + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.LogsPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LogsPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.LogsPolicy"; + }; + + LogsPolicy.CloudLoggingOption = (function() { + + /** + * Properties of a CloudLoggingOption. + * @memberof google.cloud.batch.v1alpha.LogsPolicy + * @interface ICloudLoggingOption + * @property {boolean|null} [useGenericTaskMonitoredResource] CloudLoggingOption useGenericTaskMonitoredResource + */ + + /** + * Constructs a new CloudLoggingOption. + * @memberof google.cloud.batch.v1alpha.LogsPolicy + * @classdesc Represents a CloudLoggingOption. + * @implements ICloudLoggingOption + * @constructor + * @param {google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption=} [properties] Properties to set + */ + function CloudLoggingOption(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudLoggingOption useGenericTaskMonitoredResource. + * @member {boolean} useGenericTaskMonitoredResource + * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption + * @instance + */ + CloudLoggingOption.prototype.useGenericTaskMonitoredResource = false; + + /** + * Creates a new CloudLoggingOption instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption + * @static + * @param {google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption} CloudLoggingOption instance + */ + CloudLoggingOption.create = function create(properties) { + return new CloudLoggingOption(properties); + }; + + /** + * Encodes the specified CloudLoggingOption message. Does not implicitly {@link google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption + * @static + * @param {google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption} message CloudLoggingOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudLoggingOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.useGenericTaskMonitoredResource != null && Object.hasOwnProperty.call(message, "useGenericTaskMonitoredResource")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.useGenericTaskMonitoredResource); + return writer; + }; + + /** + * Encodes the specified CloudLoggingOption message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption + * @static + * @param {google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption} message CloudLoggingOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudLoggingOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudLoggingOption message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption} CloudLoggingOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudLoggingOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.useGenericTaskMonitoredResource = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudLoggingOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption} CloudLoggingOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudLoggingOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudLoggingOption message. + * @function verify + * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudLoggingOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.useGenericTaskMonitoredResource != null && message.hasOwnProperty("useGenericTaskMonitoredResource")) + if (typeof message.useGenericTaskMonitoredResource !== "boolean") + return "useGenericTaskMonitoredResource: boolean expected"; + return null; + }; + + /** + * Creates a CloudLoggingOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption} CloudLoggingOption + */ + CloudLoggingOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption) + return object; + var message = new $root.google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption(); + if (object.useGenericTaskMonitoredResource != null) + message.useGenericTaskMonitoredResource = Boolean(object.useGenericTaskMonitoredResource); + return message; + }; + + /** + * Creates a plain object from a CloudLoggingOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption + * @static + * @param {google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption} message CloudLoggingOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudLoggingOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.useGenericTaskMonitoredResource = false; + if (message.useGenericTaskMonitoredResource != null && message.hasOwnProperty("useGenericTaskMonitoredResource")) + object.useGenericTaskMonitoredResource = message.useGenericTaskMonitoredResource; + return object; + }; + + /** + * Converts this CloudLoggingOption to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption + * @instance + * @returns {Object.} JSON object + */ + CloudLoggingOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudLoggingOption + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudLoggingOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption"; + }; + + return CloudLoggingOption; + })(); + + /** + * Destination enum. + * @name google.cloud.batch.v1alpha.LogsPolicy.Destination + * @enum {number} + * @property {number} DESTINATION_UNSPECIFIED=0 DESTINATION_UNSPECIFIED value + * @property {number} CLOUD_LOGGING=1 CLOUD_LOGGING value + * @property {number} PATH=2 PATH value + */ + LogsPolicy.Destination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD_LOGGING"] = 1; + values[valuesById[2] = "PATH"] = 2; + return values; + })(); + + return LogsPolicy; + })(); + + v1alpha.JobDependency = (function() { + + /** + * Properties of a JobDependency. + * @memberof google.cloud.batch.v1alpha + * @interface IJobDependency + * @property {Object.|null} [items] JobDependency items + */ + + /** + * Constructs a new JobDependency. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a JobDependency. + * @implements IJobDependency + * @constructor + * @param {google.cloud.batch.v1alpha.IJobDependency=} [properties] Properties to set + */ + function JobDependency(properties) { + this.items = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobDependency items. + * @member {Object.} items + * @memberof google.cloud.batch.v1alpha.JobDependency + * @instance + */ + JobDependency.prototype.items = $util.emptyObject; + + /** + * Creates a new JobDependency instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.JobDependency + * @static + * @param {google.cloud.batch.v1alpha.IJobDependency=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.JobDependency} JobDependency instance + */ + JobDependency.create = function create(properties) { + return new JobDependency(properties); + }; + + /** + * Encodes the specified JobDependency message. Does not implicitly {@link google.cloud.batch.v1alpha.JobDependency.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.JobDependency + * @static + * @param {google.cloud.batch.v1alpha.IJobDependency} message JobDependency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobDependency.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.items[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified JobDependency message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobDependency.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.JobDependency + * @static + * @param {google.cloud.batch.v1alpha.IJobDependency} message JobDependency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobDependency.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JobDependency message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.JobDependency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.JobDependency} JobDependency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobDependency.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.JobDependency(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.items === $util.emptyObject) + message.items = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = 0; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.int32(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JobDependency message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.JobDependency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.JobDependency} JobDependency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobDependency.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobDependency message. + * @function verify + * @memberof google.cloud.batch.v1alpha.JobDependency + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobDependency.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) + switch (message.items[key[i]]) { + default: + return "items: enum value{k:string} expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + return null; + }; + + /** + * Creates a JobDependency message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.JobDependency + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.JobDependency} JobDependency + */ + JobDependency.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.JobDependency) + return object; + var message = new $root.google.cloud.batch.v1alpha.JobDependency(); + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.batch.v1alpha.JobDependency.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) + switch (object.items[keys[i]]) { + default: + if (typeof object.items[keys[i]] === "number") { + message.items[keys[i]] = object.items[keys[i]]; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.items[keys[i]] = 0; + break; + case "SUCCEEDED": + case 1: + message.items[keys[i]] = 1; + break; + case "FAILED": + case 2: + message.items[keys[i]] = 2; + break; + case "FINISHED": + case 3: + message.items[keys[i]] = 3; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a JobDependency message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.JobDependency + * @static + * @param {google.cloud.batch.v1alpha.JobDependency} message JobDependency + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobDependency.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.items = {}; + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = options.enums === String ? $root.google.cloud.batch.v1alpha.JobDependency.Type[message.items[keys2[j]]] === undefined ? message.items[keys2[j]] : $root.google.cloud.batch.v1alpha.JobDependency.Type[message.items[keys2[j]]] : message.items[keys2[j]]; + } + return object; + }; + + /** + * Converts this JobDependency to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.JobDependency + * @instance + * @returns {Object.} JSON object + */ + JobDependency.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobDependency + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.JobDependency + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobDependency.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.JobDependency"; + }; + + /** + * Type enum. + * @name google.cloud.batch.v1alpha.JobDependency.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} SUCCEEDED=1 SUCCEEDED value + * @property {number} FAILED=2 FAILED value + * @property {number} FINISHED=3 FINISHED value + */ + JobDependency.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SUCCEEDED"] = 1; + values[valuesById[2] = "FAILED"] = 2; + values[valuesById[3] = "FINISHED"] = 3; + return values; + })(); + + return JobDependency; + })(); + + v1alpha.JobStatus = (function() { + + /** + * Properties of a JobStatus. + * @memberof google.cloud.batch.v1alpha + * @interface IJobStatus + * @property {google.cloud.batch.v1alpha.JobStatus.State|null} [state] JobStatus state + * @property {Array.|null} [statusEvents] JobStatus statusEvents + * @property {Object.|null} [taskGroups] JobStatus taskGroups + * @property {google.protobuf.IDuration|null} [runDuration] JobStatus runDuration + * @property {google.cloud.batch.v1alpha.IResourceUsage|null} [resourceUsage] JobStatus resourceUsage + */ + + /** + * Constructs a new JobStatus. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a JobStatus. + * @implements IJobStatus + * @constructor + * @param {google.cloud.batch.v1alpha.IJobStatus=} [properties] Properties to set + */ + function JobStatus(properties) { + this.statusEvents = []; + this.taskGroups = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobStatus state. + * @member {google.cloud.batch.v1alpha.JobStatus.State} state + * @memberof google.cloud.batch.v1alpha.JobStatus + * @instance + */ + JobStatus.prototype.state = 0; + + /** + * JobStatus statusEvents. + * @member {Array.} statusEvents + * @memberof google.cloud.batch.v1alpha.JobStatus + * @instance + */ + JobStatus.prototype.statusEvents = $util.emptyArray; + + /** + * JobStatus taskGroups. + * @member {Object.} taskGroups + * @memberof google.cloud.batch.v1alpha.JobStatus + * @instance + */ + JobStatus.prototype.taskGroups = $util.emptyObject; + + /** + * JobStatus runDuration. + * @member {google.protobuf.IDuration|null|undefined} runDuration + * @memberof google.cloud.batch.v1alpha.JobStatus + * @instance + */ + JobStatus.prototype.runDuration = null; + + /** + * JobStatus resourceUsage. + * @member {google.cloud.batch.v1alpha.IResourceUsage|null|undefined} resourceUsage + * @memberof google.cloud.batch.v1alpha.JobStatus + * @instance + */ + JobStatus.prototype.resourceUsage = null; + + /** + * Creates a new JobStatus instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.JobStatus + * @static + * @param {google.cloud.batch.v1alpha.IJobStatus=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.JobStatus} JobStatus instance + */ + JobStatus.create = function create(properties) { + return new JobStatus(properties); + }; + + /** + * Encodes the specified JobStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.JobStatus + * @static + * @param {google.cloud.batch.v1alpha.IJobStatus} message JobStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobStatus.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); + if (message.statusEvents != null && message.statusEvents.length) + for (var i = 0; i < message.statusEvents.length; ++i) + $root.google.cloud.batch.v1alpha.StatusEvent.encode(message.statusEvents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.taskGroups != null && Object.hasOwnProperty.call(message, "taskGroups")) + for (var keys = Object.keys(message.taskGroups), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.encode(message.taskGroups[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.runDuration != null && Object.hasOwnProperty.call(message, "runDuration")) + $root.google.protobuf.Duration.encode(message.runDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.resourceUsage != null && Object.hasOwnProperty.call(message, "resourceUsage")) + $root.google.cloud.batch.v1alpha.ResourceUsage.encode(message.resourceUsage, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JobStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.JobStatus + * @static + * @param {google.cloud.batch.v1alpha.IJobStatus} message JobStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JobStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.JobStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.JobStatus} JobStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.JobStatus(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + if (!(message.statusEvents && message.statusEvents.length)) + message.statusEvents = []; + message.statusEvents.push($root.google.cloud.batch.v1alpha.StatusEvent.decode(reader, reader.uint32())); + break; + } + case 4: { + if (message.taskGroups === $util.emptyObject) + message.taskGroups = {}; + 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.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.taskGroups[key] = value; + break; + } + case 5: { + message.runDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 6: { + message.resourceUsage = $root.google.cloud.batch.v1alpha.ResourceUsage.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JobStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.JobStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.JobStatus} JobStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobStatus message. + * @function verify + * @memberof google.cloud.batch.v1alpha.JobStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + if (message.statusEvents != null && message.hasOwnProperty("statusEvents")) { + if (!Array.isArray(message.statusEvents)) + return "statusEvents: array expected"; + for (var i = 0; i < message.statusEvents.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.StatusEvent.verify(message.statusEvents[i]); + if (error) + return "statusEvents." + error; + } + } + if (message.taskGroups != null && message.hasOwnProperty("taskGroups")) { + if (!$util.isObject(message.taskGroups)) + return "taskGroups: object expected"; + var key = Object.keys(message.taskGroups); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.verify(message.taskGroups[key[i]]); + if (error) + return "taskGroups." + error; + } + } + if (message.runDuration != null && message.hasOwnProperty("runDuration")) { + var error = $root.google.protobuf.Duration.verify(message.runDuration); + if (error) + return "runDuration." + error; + } + if (message.resourceUsage != null && message.hasOwnProperty("resourceUsage")) { + var error = $root.google.cloud.batch.v1alpha.ResourceUsage.verify(message.resourceUsage); + if (error) + return "resourceUsage." + error; + } + return null; + }; + + /** + * Creates a JobStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.JobStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.JobStatus} JobStatus + */ + JobStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.JobStatus) + return object; + var message = new $root.google.cloud.batch.v1alpha.JobStatus(); + 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 "QUEUED": + case 1: + message.state = 1; + break; + case "SCHEDULED": + case 2: + message.state = 2; + break; + case "RUNNING": + case 3: + message.state = 3; + break; + case "SUCCEEDED": + case 4: + message.state = 4; + break; + case "FAILED": + case 5: + message.state = 5; + break; + case "DELETION_IN_PROGRESS": + case 6: + message.state = 6; + break; + case "CANCELLATION_IN_PROGRESS": + case 7: + message.state = 7; + break; + case "CANCELLED": + case 8: + message.state = 8; + break; + } + if (object.statusEvents) { + if (!Array.isArray(object.statusEvents)) + throw TypeError(".google.cloud.batch.v1alpha.JobStatus.statusEvents: array expected"); + message.statusEvents = []; + for (var i = 0; i < object.statusEvents.length; ++i) { + if (typeof object.statusEvents[i] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.JobStatus.statusEvents: object expected"); + message.statusEvents[i] = $root.google.cloud.batch.v1alpha.StatusEvent.fromObject(object.statusEvents[i]); + } + } + if (object.taskGroups) { + if (typeof object.taskGroups !== "object") + throw TypeError(".google.cloud.batch.v1alpha.JobStatus.taskGroups: object expected"); + message.taskGroups = {}; + for (var keys = Object.keys(object.taskGroups), i = 0; i < keys.length; ++i) { + if (typeof object.taskGroups[keys[i]] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.JobStatus.taskGroups: object expected"); + message.taskGroups[keys[i]] = $root.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.fromObject(object.taskGroups[keys[i]]); + } + } + if (object.runDuration != null) { + if (typeof object.runDuration !== "object") + throw TypeError(".google.cloud.batch.v1alpha.JobStatus.runDuration: object expected"); + message.runDuration = $root.google.protobuf.Duration.fromObject(object.runDuration); + } + if (object.resourceUsage != null) { + if (typeof object.resourceUsage !== "object") + throw TypeError(".google.cloud.batch.v1alpha.JobStatus.resourceUsage: object expected"); + message.resourceUsage = $root.google.cloud.batch.v1alpha.ResourceUsage.fromObject(object.resourceUsage); + } + return message; + }; + + /** + * Creates a plain object from a JobStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.JobStatus + * @static + * @param {google.cloud.batch.v1alpha.JobStatus} message JobStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.statusEvents = []; + if (options.objects || options.defaults) + object.taskGroups = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.runDuration = null; + object.resourceUsage = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.batch.v1alpha.JobStatus.State[message.state] === undefined ? message.state : $root.google.cloud.batch.v1alpha.JobStatus.State[message.state] : message.state; + if (message.statusEvents && message.statusEvents.length) { + object.statusEvents = []; + for (var j = 0; j < message.statusEvents.length; ++j) + object.statusEvents[j] = $root.google.cloud.batch.v1alpha.StatusEvent.toObject(message.statusEvents[j], options); + } + var keys2; + if (message.taskGroups && (keys2 = Object.keys(message.taskGroups)).length) { + object.taskGroups = {}; + for (var j = 0; j < keys2.length; ++j) + object.taskGroups[keys2[j]] = $root.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.toObject(message.taskGroups[keys2[j]], options); + } + if (message.runDuration != null && message.hasOwnProperty("runDuration")) + object.runDuration = $root.google.protobuf.Duration.toObject(message.runDuration, options); + if (message.resourceUsage != null && message.hasOwnProperty("resourceUsage")) + object.resourceUsage = $root.google.cloud.batch.v1alpha.ResourceUsage.toObject(message.resourceUsage, options); + return object; + }; + + /** + * Converts this JobStatus to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.JobStatus + * @instance + * @returns {Object.} JSON object + */ + JobStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobStatus + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.JobStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.JobStatus"; + }; + + JobStatus.InstanceStatus = (function() { + + /** + * Properties of an InstanceStatus. + * @memberof google.cloud.batch.v1alpha.JobStatus + * @interface IInstanceStatus + * @property {string|null} [machineType] InstanceStatus machineType + * @property {google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel|null} [provisioningModel] InstanceStatus provisioningModel + * @property {number|Long|null} [taskPack] InstanceStatus taskPack + * @property {google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null} [bootDisk] InstanceStatus bootDisk + */ + + /** + * Constructs a new InstanceStatus. + * @memberof google.cloud.batch.v1alpha.JobStatus + * @classdesc Represents an InstanceStatus. + * @implements IInstanceStatus + * @constructor + * @param {google.cloud.batch.v1alpha.JobStatus.IInstanceStatus=} [properties] Properties to set + */ + function InstanceStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceStatus machineType. + * @member {string} machineType + * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus + * @instance + */ + InstanceStatus.prototype.machineType = ""; + + /** + * InstanceStatus provisioningModel. + * @member {google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel} provisioningModel + * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus + * @instance + */ + InstanceStatus.prototype.provisioningModel = 0; + + /** + * InstanceStatus taskPack. + * @member {number|Long} taskPack + * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus + * @instance + */ + InstanceStatus.prototype.taskPack = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * InstanceStatus bootDisk. + * @member {google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null|undefined} bootDisk + * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus + * @instance + */ + InstanceStatus.prototype.bootDisk = null; + + /** + * Creates a new InstanceStatus instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus + * @static + * @param {google.cloud.batch.v1alpha.JobStatus.IInstanceStatus=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.JobStatus.InstanceStatus} InstanceStatus instance + */ + InstanceStatus.create = function create(properties) { + return new InstanceStatus(properties); + }; + + /** + * Encodes the specified InstanceStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.InstanceStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus + * @static + * @param {google.cloud.batch.v1alpha.JobStatus.IInstanceStatus} message InstanceStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.machineType); + if (message.provisioningModel != null && Object.hasOwnProperty.call(message, "provisioningModel")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.provisioningModel); + if (message.taskPack != null && Object.hasOwnProperty.call(message, "taskPack")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.taskPack); + if (message.bootDisk != null && Object.hasOwnProperty.call(message, "bootDisk")) + $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.encode(message.bootDisk, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstanceStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.InstanceStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus + * @static + * @param {google.cloud.batch.v1alpha.JobStatus.IInstanceStatus} message InstanceStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.JobStatus.InstanceStatus} InstanceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.JobStatus.InstanceStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.machineType = reader.string(); + break; + } + case 2: { + message.provisioningModel = reader.int32(); + break; + } + case 3: { + message.taskPack = reader.int64(); + break; + } + case 4: { + message.bootDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.JobStatus.InstanceStatus} InstanceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceStatus message. + * @function verify + * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.machineType != null && message.hasOwnProperty("machineType")) + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) + switch (message.provisioningModel) { + default: + return "provisioningModel: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.taskPack != null && message.hasOwnProperty("taskPack")) + if (!$util.isInteger(message.taskPack) && !(message.taskPack && $util.isInteger(message.taskPack.low) && $util.isInteger(message.taskPack.high))) + return "taskPack: integer|Long expected"; + if (message.bootDisk != null && message.hasOwnProperty("bootDisk")) { + var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.verify(message.bootDisk); + if (error) + return "bootDisk." + error; + } + return null; + }; + + /** + * Creates an InstanceStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.JobStatus.InstanceStatus} InstanceStatus + */ + InstanceStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.JobStatus.InstanceStatus) + return object; + var message = new $root.google.cloud.batch.v1alpha.JobStatus.InstanceStatus(); + if (object.machineType != null) + message.machineType = String(object.machineType); + switch (object.provisioningModel) { + default: + if (typeof object.provisioningModel === "number") { + message.provisioningModel = object.provisioningModel; + break; + } + break; + case "PROVISIONING_MODEL_UNSPECIFIED": + case 0: + message.provisioningModel = 0; + break; + case "STANDARD": + case 1: + message.provisioningModel = 1; + break; + case "SPOT": + case 2: + message.provisioningModel = 2; + break; + case "PREEMPTIBLE": + case 3: + message.provisioningModel = 3; + break; + } + if (object.taskPack != null) + if ($util.Long) + (message.taskPack = $util.Long.fromValue(object.taskPack)).unsigned = false; + else if (typeof object.taskPack === "string") + message.taskPack = parseInt(object.taskPack, 10); + else if (typeof object.taskPack === "number") + message.taskPack = object.taskPack; + else if (typeof object.taskPack === "object") + message.taskPack = new $util.LongBits(object.taskPack.low >>> 0, object.taskPack.high >>> 0).toNumber(); + if (object.bootDisk != null) { + if (typeof object.bootDisk !== "object") + throw TypeError(".google.cloud.batch.v1alpha.JobStatus.InstanceStatus.bootDisk: object expected"); + message.bootDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.fromObject(object.bootDisk); + } + return message; + }; + + /** + * Creates a plain object from an InstanceStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus + * @static + * @param {google.cloud.batch.v1alpha.JobStatus.InstanceStatus} message InstanceStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.machineType = ""; + object.provisioningModel = options.enums === String ? "PROVISIONING_MODEL_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.taskPack = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.taskPack = options.longs === String ? "0" : 0; + object.bootDisk = null; + } + if (message.machineType != null && message.hasOwnProperty("machineType")) + object.machineType = message.machineType; + if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) + object.provisioningModel = options.enums === String ? $root.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel[message.provisioningModel] === undefined ? message.provisioningModel : $root.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel[message.provisioningModel] : message.provisioningModel; + if (message.taskPack != null && message.hasOwnProperty("taskPack")) + if (typeof message.taskPack === "number") + object.taskPack = options.longs === String ? String(message.taskPack) : message.taskPack; + else + object.taskPack = options.longs === String ? $util.Long.prototype.toString.call(message.taskPack) : options.longs === Number ? new $util.LongBits(message.taskPack.low >>> 0, message.taskPack.high >>> 0).toNumber() : message.taskPack; + if (message.bootDisk != null && message.hasOwnProperty("bootDisk")) + object.bootDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.toObject(message.bootDisk, options); + return object; + }; + + /** + * Converts this InstanceStatus to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus + * @instance + * @returns {Object.} JSON object + */ + InstanceStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstanceStatus + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstanceStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.JobStatus.InstanceStatus"; + }; + + return InstanceStatus; + })(); + + JobStatus.TaskGroupStatus = (function() { + + /** + * Properties of a TaskGroupStatus. + * @memberof google.cloud.batch.v1alpha.JobStatus + * @interface ITaskGroupStatus + * @property {Object.|null} [counts] TaskGroupStatus counts + * @property {Array.|null} [instances] TaskGroupStatus instances + */ + + /** + * Constructs a new TaskGroupStatus. + * @memberof google.cloud.batch.v1alpha.JobStatus + * @classdesc Represents a TaskGroupStatus. + * @implements ITaskGroupStatus + * @constructor + * @param {google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus=} [properties] Properties to set + */ + function TaskGroupStatus(properties) { + this.counts = {}; + this.instances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TaskGroupStatus counts. + * @member {Object.} counts + * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus + * @instance + */ + TaskGroupStatus.prototype.counts = $util.emptyObject; + + /** + * TaskGroupStatus instances. + * @member {Array.} instances + * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus + * @instance + */ + TaskGroupStatus.prototype.instances = $util.emptyArray; + + /** + * Creates a new TaskGroupStatus instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus + * @static + * @param {google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus} TaskGroupStatus instance + */ + TaskGroupStatus.create = function create(properties) { + return new TaskGroupStatus(properties); + }; + + /** + * Encodes the specified TaskGroupStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus + * @static + * @param {google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus} message TaskGroupStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskGroupStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.counts != null && Object.hasOwnProperty.call(message, "counts")) + for (var keys = Object.keys(message.counts), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int64(message.counts[keys[i]]).ldelim(); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + $root.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.encode(message.instances[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TaskGroupStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus + * @static + * @param {google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus} message TaskGroupStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskGroupStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TaskGroupStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus} TaskGroupStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskGroupStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.counts === $util.emptyObject) + message.counts = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = 0; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.int64(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.counts[key] = value; + break; + } + case 2: { + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TaskGroupStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus} TaskGroupStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskGroupStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TaskGroupStatus message. + * @function verify + * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TaskGroupStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.counts != null && message.hasOwnProperty("counts")) { + if (!$util.isObject(message.counts)) + return "counts: object expected"; + var key = Object.keys(message.counts); + for (var i = 0; i < key.length; ++i) + if (!$util.isInteger(message.counts[key[i]]) && !(message.counts[key[i]] && $util.isInteger(message.counts[key[i]].low) && $util.isInteger(message.counts[key[i]].high))) + return "counts: integer|Long{k:string} expected"; + } + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } + return null; + }; + + /** + * Creates a TaskGroupStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus} TaskGroupStatus + */ + TaskGroupStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus) + return object; + var message = new $root.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus(); + if (object.counts) { + if (typeof object.counts !== "object") + throw TypeError(".google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.counts: object expected"); + message.counts = {}; + for (var keys = Object.keys(object.counts), i = 0; i < keys.length; ++i) + if ($util.Long) + (message.counts[keys[i]] = $util.Long.fromValue(object.counts[keys[i]])).unsigned = false; + else if (typeof object.counts[keys[i]] === "string") + message.counts[keys[i]] = parseInt(object.counts[keys[i]], 10); + else if (typeof object.counts[keys[i]] === "number") + message.counts[keys[i]] = object.counts[keys[i]]; + else if (typeof object.counts[keys[i]] === "object") + message.counts[keys[i]] = new $util.LongBits(object.counts[keys[i]].low >>> 0, object.counts[keys[i]].high >>> 0).toNumber(); + } + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.instances: object expected"); + message.instances[i] = $root.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.fromObject(object.instances[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TaskGroupStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus + * @static + * @param {google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus} message TaskGroupStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TaskGroupStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instances = []; + if (options.objects || options.defaults) + object.counts = {}; + var keys2; + if (message.counts && (keys2 = Object.keys(message.counts)).length) { + object.counts = {}; + for (var j = 0; j < keys2.length; ++j) + if (typeof message.counts[keys2[j]] === "number") + object.counts[keys2[j]] = options.longs === String ? String(message.counts[keys2[j]]) : message.counts[keys2[j]]; + else + object.counts[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.counts[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.counts[keys2[j]].low >>> 0, message.counts[keys2[j]].high >>> 0).toNumber() : message.counts[keys2[j]]; + } + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.toObject(message.instances[j], options); + } + return object; + }; + + /** + * Converts this TaskGroupStatus to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus + * @instance + * @returns {Object.} JSON object + */ + TaskGroupStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TaskGroupStatus + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TaskGroupStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus"; + }; + + return TaskGroupStatus; + })(); + + /** + * State enum. + * @name google.cloud.batch.v1alpha.JobStatus.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} QUEUED=1 QUEUED value + * @property {number} SCHEDULED=2 SCHEDULED value + * @property {number} RUNNING=3 RUNNING value + * @property {number} SUCCEEDED=4 SUCCEEDED value + * @property {number} FAILED=5 FAILED value + * @property {number} DELETION_IN_PROGRESS=6 DELETION_IN_PROGRESS value + * @property {number} CANCELLATION_IN_PROGRESS=7 CANCELLATION_IN_PROGRESS value + * @property {number} CANCELLED=8 CANCELLED value + */ + JobStatus.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "QUEUED"] = 1; + values[valuesById[2] = "SCHEDULED"] = 2; + values[valuesById[3] = "RUNNING"] = 3; + values[valuesById[4] = "SUCCEEDED"] = 4; + values[valuesById[5] = "FAILED"] = 5; + values[valuesById[6] = "DELETION_IN_PROGRESS"] = 6; + values[valuesById[7] = "CANCELLATION_IN_PROGRESS"] = 7; + values[valuesById[8] = "CANCELLED"] = 8; + return values; + })(); + + return JobStatus; + })(); + + v1alpha.ResourceUsage = (function() { + + /** + * Properties of a ResourceUsage. + * @memberof google.cloud.batch.v1alpha + * @interface IResourceUsage + * @property {number|null} [coreHours] ResourceUsage coreHours + */ + + /** + * Constructs a new ResourceUsage. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a ResourceUsage. + * @implements IResourceUsage + * @constructor + * @param {google.cloud.batch.v1alpha.IResourceUsage=} [properties] Properties to set + */ + function ResourceUsage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceUsage coreHours. + * @member {number} coreHours + * @memberof google.cloud.batch.v1alpha.ResourceUsage + * @instance + */ + ResourceUsage.prototype.coreHours = 0; + + /** + * Creates a new ResourceUsage instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.ResourceUsage + * @static + * @param {google.cloud.batch.v1alpha.IResourceUsage=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.ResourceUsage} ResourceUsage instance + */ + ResourceUsage.create = function create(properties) { + return new ResourceUsage(properties); + }; + + /** + * Encodes the specified ResourceUsage message. Does not implicitly {@link google.cloud.batch.v1alpha.ResourceUsage.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.ResourceUsage + * @static + * @param {google.cloud.batch.v1alpha.IResourceUsage} message ResourceUsage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceUsage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.coreHours != null && Object.hasOwnProperty.call(message, "coreHours")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.coreHours); + return writer; + }; + + /** + * Encodes the specified ResourceUsage message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ResourceUsage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.ResourceUsage + * @static + * @param {google.cloud.batch.v1alpha.IResourceUsage} message ResourceUsage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceUsage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceUsage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.ResourceUsage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.ResourceUsage} ResourceUsage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceUsage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ResourceUsage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.coreHours = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceUsage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.ResourceUsage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.ResourceUsage} ResourceUsage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceUsage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceUsage message. + * @function verify + * @memberof google.cloud.batch.v1alpha.ResourceUsage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceUsage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.coreHours != null && message.hasOwnProperty("coreHours")) + if (typeof message.coreHours !== "number") + return "coreHours: number expected"; + return null; + }; + + /** + * Creates a ResourceUsage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.ResourceUsage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.ResourceUsage} ResourceUsage + */ + ResourceUsage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.ResourceUsage) + return object; + var message = new $root.google.cloud.batch.v1alpha.ResourceUsage(); + if (object.coreHours != null) + message.coreHours = Number(object.coreHours); + return message; + }; + + /** + * Creates a plain object from a ResourceUsage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.ResourceUsage + * @static + * @param {google.cloud.batch.v1alpha.ResourceUsage} message ResourceUsage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceUsage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.coreHours = 0; + if (message.coreHours != null && message.hasOwnProperty("coreHours")) + object.coreHours = options.json && !isFinite(message.coreHours) ? String(message.coreHours) : message.coreHours; + return object; + }; + + /** + * Converts this ResourceUsage to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.ResourceUsage + * @instance + * @returns {Object.} JSON object + */ + ResourceUsage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceUsage + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.ResourceUsage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceUsage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.ResourceUsage"; + }; + + return ResourceUsage; + })(); + + v1alpha.JobNotification = (function() { + + /** + * Properties of a JobNotification. + * @memberof google.cloud.batch.v1alpha + * @interface IJobNotification + * @property {string|null} [pubsubTopic] JobNotification pubsubTopic + * @property {google.cloud.batch.v1alpha.JobNotification.IMessage|null} [message] JobNotification message + */ + + /** + * Constructs a new JobNotification. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a JobNotification. + * @implements IJobNotification + * @constructor + * @param {google.cloud.batch.v1alpha.IJobNotification=} [properties] Properties to set + */ + function JobNotification(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobNotification pubsubTopic. + * @member {string} pubsubTopic + * @memberof google.cloud.batch.v1alpha.JobNotification + * @instance + */ + JobNotification.prototype.pubsubTopic = ""; + + /** + * JobNotification message. + * @member {google.cloud.batch.v1alpha.JobNotification.IMessage|null|undefined} message + * @memberof google.cloud.batch.v1alpha.JobNotification + * @instance + */ + JobNotification.prototype.message = null; + + /** + * Creates a new JobNotification instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.JobNotification + * @static + * @param {google.cloud.batch.v1alpha.IJobNotification=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.JobNotification} JobNotification instance + */ + JobNotification.create = function create(properties) { + return new JobNotification(properties); + }; + + /** + * Encodes the specified JobNotification message. Does not implicitly {@link google.cloud.batch.v1alpha.JobNotification.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.JobNotification + * @static + * @param {google.cloud.batch.v1alpha.IJobNotification} message JobNotification message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobNotification.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pubsubTopic != null && Object.hasOwnProperty.call(message, "pubsubTopic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pubsubTopic); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + $root.google.cloud.batch.v1alpha.JobNotification.Message.encode(message.message, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JobNotification message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobNotification.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.JobNotification + * @static + * @param {google.cloud.batch.v1alpha.IJobNotification} message JobNotification message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobNotification.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JobNotification message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.JobNotification + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.JobNotification} JobNotification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobNotification.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.JobNotification(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.pubsubTopic = reader.string(); + break; + } + case 2: { + message.message = $root.google.cloud.batch.v1alpha.JobNotification.Message.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JobNotification message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.JobNotification + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.JobNotification} JobNotification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobNotification.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobNotification message. + * @function verify + * @memberof google.cloud.batch.v1alpha.JobNotification + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobNotification.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) + if (!$util.isString(message.pubsubTopic)) + return "pubsubTopic: string expected"; + if (message.message != null && message.hasOwnProperty("message")) { + var error = $root.google.cloud.batch.v1alpha.JobNotification.Message.verify(message.message); + if (error) + return "message." + error; + } + return null; + }; + + /** + * Creates a JobNotification message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.JobNotification + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.JobNotification} JobNotification + */ + JobNotification.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.JobNotification) + return object; + var message = new $root.google.cloud.batch.v1alpha.JobNotification(); + if (object.pubsubTopic != null) + message.pubsubTopic = String(object.pubsubTopic); + if (object.message != null) { + if (typeof object.message !== "object") + throw TypeError(".google.cloud.batch.v1alpha.JobNotification.message: object expected"); + message.message = $root.google.cloud.batch.v1alpha.JobNotification.Message.fromObject(object.message); + } + return message; + }; + + /** + * Creates a plain object from a JobNotification message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.JobNotification + * @static + * @param {google.cloud.batch.v1alpha.JobNotification} message JobNotification + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobNotification.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.pubsubTopic = ""; + object.message = null; + } + if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) + object.pubsubTopic = message.pubsubTopic; + if (message.message != null && message.hasOwnProperty("message")) + object.message = $root.google.cloud.batch.v1alpha.JobNotification.Message.toObject(message.message, options); + return object; + }; + + /** + * Converts this JobNotification to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.JobNotification + * @instance + * @returns {Object.} JSON object + */ + JobNotification.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobNotification + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.JobNotification + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobNotification.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.JobNotification"; + }; + + JobNotification.Message = (function() { + + /** + * Properties of a Message. + * @memberof google.cloud.batch.v1alpha.JobNotification + * @interface IMessage + * @property {google.cloud.batch.v1alpha.JobNotification.Type|null} [type] Message type + * @property {google.cloud.batch.v1alpha.JobStatus.State|null} [newJobState] Message newJobState + * @property {google.cloud.batch.v1alpha.TaskStatus.State|null} [newTaskState] Message newTaskState + */ + + /** + * Constructs a new Message. + * @memberof google.cloud.batch.v1alpha.JobNotification + * @classdesc Represents a Message. + * @implements IMessage + * @constructor + * @param {google.cloud.batch.v1alpha.JobNotification.IMessage=} [properties] Properties to set + */ + function Message(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Message type. + * @member {google.cloud.batch.v1alpha.JobNotification.Type} type + * @memberof google.cloud.batch.v1alpha.JobNotification.Message + * @instance + */ + Message.prototype.type = 0; + + /** + * Message newJobState. + * @member {google.cloud.batch.v1alpha.JobStatus.State} newJobState + * @memberof google.cloud.batch.v1alpha.JobNotification.Message + * @instance + */ + Message.prototype.newJobState = 0; + + /** + * Message newTaskState. + * @member {google.cloud.batch.v1alpha.TaskStatus.State} newTaskState + * @memberof google.cloud.batch.v1alpha.JobNotification.Message + * @instance + */ + Message.prototype.newTaskState = 0; + + /** + * Creates a new Message instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.JobNotification.Message + * @static + * @param {google.cloud.batch.v1alpha.JobNotification.IMessage=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.JobNotification.Message} Message instance + */ + Message.create = function create(properties) { + return new Message(properties); + }; + + /** + * Encodes the specified Message message. Does not implicitly {@link google.cloud.batch.v1alpha.JobNotification.Message.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.JobNotification.Message + * @static + * @param {google.cloud.batch.v1alpha.JobNotification.IMessage} message Message message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Message.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.newJobState != null && Object.hasOwnProperty.call(message, "newJobState")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.newJobState); + if (message.newTaskState != null && Object.hasOwnProperty.call(message, "newTaskState")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.newTaskState); + return writer; + }; + + /** + * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobNotification.Message.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.JobNotification.Message + * @static + * @param {google.cloud.batch.v1alpha.JobNotification.IMessage} message Message message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Message.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Message message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.JobNotification.Message + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.JobNotification.Message} Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Message.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.JobNotification.Message(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.newJobState = reader.int32(); + break; + } + case 3: { + message.newTaskState = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Message message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.JobNotification.Message + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.JobNotification.Message} Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Message.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Message message. + * @function verify + * @memberof google.cloud.batch.v1alpha.JobNotification.Message + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Message.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.newJobState != null && message.hasOwnProperty("newJobState")) + switch (message.newJobState) { + default: + return "newJobState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + if (message.newTaskState != null && message.hasOwnProperty("newTaskState")) + switch (message.newTaskState) { + default: + return "newTaskState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + return null; + }; + + /** + * Creates a Message message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.JobNotification.Message + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.JobNotification.Message} Message + */ + Message.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.JobNotification.Message) + return object; + var message = new $root.google.cloud.batch.v1alpha.JobNotification.Message(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "JOB_STATE_CHANGED": + case 1: + message.type = 1; + break; + case "TASK_STATE_CHANGED": + case 2: + message.type = 2; + break; + } + switch (object.newJobState) { + default: + if (typeof object.newJobState === "number") { + message.newJobState = object.newJobState; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.newJobState = 0; + break; + case "QUEUED": + case 1: + message.newJobState = 1; + break; + case "SCHEDULED": + case 2: + message.newJobState = 2; + break; + case "RUNNING": + case 3: + message.newJobState = 3; + break; + case "SUCCEEDED": + case 4: + message.newJobState = 4; + break; + case "FAILED": + case 5: + message.newJobState = 5; + break; + case "DELETION_IN_PROGRESS": + case 6: + message.newJobState = 6; + break; + case "CANCELLATION_IN_PROGRESS": + case 7: + message.newJobState = 7; + break; + case "CANCELLED": + case 8: + message.newJobState = 8; + break; + } + switch (object.newTaskState) { + default: + if (typeof object.newTaskState === "number") { + message.newTaskState = object.newTaskState; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.newTaskState = 0; + break; + case "PENDING": + case 1: + message.newTaskState = 1; + break; + case "ASSIGNED": + case 2: + message.newTaskState = 2; + break; + case "RUNNING": + case 3: + message.newTaskState = 3; + break; + case "FAILED": + case 4: + message.newTaskState = 4; + break; + case "SUCCEEDED": + case 5: + message.newTaskState = 5; + break; + case "UNEXECUTED": + case 6: + message.newTaskState = 6; + break; + } + return message; + }; + + /** + * Creates a plain object from a Message message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.JobNotification.Message + * @static + * @param {google.cloud.batch.v1alpha.JobNotification.Message} message Message + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Message.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.newJobState = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.newTaskState = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.batch.v1alpha.JobNotification.Type[message.type] === undefined ? message.type : $root.google.cloud.batch.v1alpha.JobNotification.Type[message.type] : message.type; + if (message.newJobState != null && message.hasOwnProperty("newJobState")) + object.newJobState = options.enums === String ? $root.google.cloud.batch.v1alpha.JobStatus.State[message.newJobState] === undefined ? message.newJobState : $root.google.cloud.batch.v1alpha.JobStatus.State[message.newJobState] : message.newJobState; + if (message.newTaskState != null && message.hasOwnProperty("newTaskState")) + object.newTaskState = options.enums === String ? $root.google.cloud.batch.v1alpha.TaskStatus.State[message.newTaskState] === undefined ? message.newTaskState : $root.google.cloud.batch.v1alpha.TaskStatus.State[message.newTaskState] : message.newTaskState; + return object; + }; + + /** + * Converts this Message to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.JobNotification.Message + * @instance + * @returns {Object.} JSON object + */ + Message.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Message + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.JobNotification.Message + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Message.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.JobNotification.Message"; + }; + + return Message; + })(); + + /** + * Type enum. + * @name google.cloud.batch.v1alpha.JobNotification.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} JOB_STATE_CHANGED=1 JOB_STATE_CHANGED value + * @property {number} TASK_STATE_CHANGED=2 TASK_STATE_CHANGED value + */ + JobNotification.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "JOB_STATE_CHANGED"] = 1; + values[valuesById[2] = "TASK_STATE_CHANGED"] = 2; + return values; + })(); + + return JobNotification; + })(); + + v1alpha.AllocationPolicy = (function() { + + /** + * Properties of an AllocationPolicy. + * @memberof google.cloud.batch.v1alpha + * @interface IAllocationPolicy + * @property {google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy|null} [location] AllocationPolicy location + * @property {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy|null} [instance] AllocationPolicy instance + * @property {Array.|null} [instances] AllocationPolicy instances + * @property {Array.|null} [instanceTemplates] AllocationPolicy instanceTemplates + * @property {Array.|null} [provisioningModels] AllocationPolicy provisioningModels + * @property {string|null} [serviceAccountEmail] AllocationPolicy serviceAccountEmail + * @property {google.cloud.batch.v1alpha.IServiceAccount|null} [serviceAccount] AllocationPolicy serviceAccount + * @property {Object.|null} [labels] AllocationPolicy labels + * @property {google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy|null} [network] AllocationPolicy network + * @property {google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy|null} [placement] AllocationPolicy placement + * @property {Array.|null} [tags] AllocationPolicy tags + */ + + /** + * Constructs a new AllocationPolicy. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents an AllocationPolicy. + * @implements IAllocationPolicy + * @constructor + * @param {google.cloud.batch.v1alpha.IAllocationPolicy=} [properties] Properties to set + */ + function AllocationPolicy(properties) { + this.instances = []; + this.instanceTemplates = []; + this.provisioningModels = []; + this.labels = {}; + this.tags = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AllocationPolicy location. + * @member {google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy|null|undefined} location + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.location = null; + + /** + * AllocationPolicy instance. + * @member {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy|null|undefined} instance + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.instance = null; + + /** + * AllocationPolicy instances. + * @member {Array.} instances + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.instances = $util.emptyArray; + + /** + * AllocationPolicy instanceTemplates. + * @member {Array.} instanceTemplates + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.instanceTemplates = $util.emptyArray; + + /** + * AllocationPolicy provisioningModels. + * @member {Array.} provisioningModels + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.provisioningModels = $util.emptyArray; + + /** + * AllocationPolicy serviceAccountEmail. + * @member {string} serviceAccountEmail + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.serviceAccountEmail = ""; + + /** + * AllocationPolicy serviceAccount. + * @member {google.cloud.batch.v1alpha.IServiceAccount|null|undefined} serviceAccount + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.serviceAccount = null; + + /** + * AllocationPolicy labels. + * @member {Object.} labels + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.labels = $util.emptyObject; + + /** + * AllocationPolicy network. + * @member {google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy|null|undefined} network + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.network = null; + + /** + * AllocationPolicy placement. + * @member {google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy|null|undefined} placement + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.placement = null; + + /** + * AllocationPolicy tags. + * @member {Array.} tags + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.tags = $util.emptyArray; + + /** + * Creates a new AllocationPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @static + * @param {google.cloud.batch.v1alpha.IAllocationPolicy=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.AllocationPolicy} AllocationPolicy instance + */ + AllocationPolicy.create = function create(properties) { + return new AllocationPolicy(properties); + }; + + /** + * Encodes the specified AllocationPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @static + * @param {google.cloud.batch.v1alpha.IAllocationPolicy} message AllocationPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllocationPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + $root.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.encode(message.location, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.encode(message.instance, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.instanceTemplates != null && message.instanceTemplates.length) + for (var i = 0; i < message.instanceTemplates.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.instanceTemplates[i]); + if (message.provisioningModels != null && message.provisioningModels.length) { + writer.uint32(/* id 4, wireType 2 =*/34).fork(); + for (var i = 0; i < message.provisioningModels.length; ++i) + writer.int32(message.provisioningModels[i]); + writer.ldelim(); + } + if (message.serviceAccountEmail != null && Object.hasOwnProperty.call(message, "serviceAccountEmail")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.serviceAccountEmail); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.encode(message.network, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.encode(message.instances[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + $root.google.cloud.batch.v1alpha.ServiceAccount.encode(message.serviceAccount, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.placement != null && Object.hasOwnProperty.call(message, "placement")) + $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.encode(message.placement, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.tags != null && message.tags.length) + for (var i = 0; i < message.tags.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.tags[i]); + return writer; + }; + + /** + * Encodes the specified AllocationPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @static + * @param {google.cloud.batch.v1alpha.IAllocationPolicy} message AllocationPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllocationPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AllocationPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.AllocationPolicy} AllocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllocationPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.location = $root.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.decode(reader, reader.uint32()); + break; + } + case 2: { + message.instance = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.decode(reader, reader.uint32()); + break; + } + case 8: { + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.instanceTemplates && message.instanceTemplates.length)) + message.instanceTemplates = []; + message.instanceTemplates.push(reader.string()); + break; + } + case 4: { + if (!(message.provisioningModels && message.provisioningModels.length)) + message.provisioningModels = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.provisioningModels.push(reader.int32()); + } else + message.provisioningModels.push(reader.int32()); + break; + } + case 5: { + message.serviceAccountEmail = reader.string(); + break; + } + case 9: { + message.serviceAccount = $root.google.cloud.batch.v1alpha.ServiceAccount.decode(reader, reader.uint32()); + break; + } + case 6: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 7: { + message.network = $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.decode(reader, reader.uint32()); + break; + } + case 10: { + message.placement = $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.decode(reader, reader.uint32()); + break; + } + case 11: { + if (!(message.tags && message.tags.length)) + message.tags = []; + message.tags.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AllocationPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.AllocationPolicy} AllocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllocationPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AllocationPolicy message. + * @function verify + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AllocationPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.verify(message.location); + if (error) + return "location." + error; + } + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.verify(message.instance); + if (error) + return "instance." + error; + } + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } + if (message.instanceTemplates != null && message.hasOwnProperty("instanceTemplates")) { + if (!Array.isArray(message.instanceTemplates)) + return "instanceTemplates: array expected"; + for (var i = 0; i < message.instanceTemplates.length; ++i) + if (!$util.isString(message.instanceTemplates[i])) + return "instanceTemplates: string[] expected"; + } + if (message.provisioningModels != null && message.hasOwnProperty("provisioningModels")) { + if (!Array.isArray(message.provisioningModels)) + return "provisioningModels: array expected"; + for (var i = 0; i < message.provisioningModels.length; ++i) + switch (message.provisioningModels[i]) { + default: + return "provisioningModels: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) + if (!$util.isString(message.serviceAccountEmail)) + return "serviceAccountEmail: string expected"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) { + var error = $root.google.cloud.batch.v1alpha.ServiceAccount.verify(message.serviceAccount); + if (error) + return "serviceAccount." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.network != null && message.hasOwnProperty("network")) { + var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.verify(message.network); + if (error) + return "network." + error; + } + if (message.placement != null && message.hasOwnProperty("placement")) { + var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.verify(message.placement); + if (error) + return "placement." + error; + } + if (message.tags != null && message.hasOwnProperty("tags")) { + if (!Array.isArray(message.tags)) + return "tags: array expected"; + for (var i = 0; i < message.tags.length; ++i) + if (!$util.isString(message.tags[i])) + return "tags: string[] expected"; + } + return null; + }; + + /** + * Creates an AllocationPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.AllocationPolicy} AllocationPolicy + */ + AllocationPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy) + return object; + var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy(); + if (object.location != null) { + if (typeof object.location !== "object") + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.location: object expected"); + message.location = $root.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.fromObject(object.location); + } + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.instance: object expected"); + message.instance = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.fromObject(object.instance); + } + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.instances: object expected"); + message.instances[i] = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.fromObject(object.instances[i]); + } + } + if (object.instanceTemplates) { + if (!Array.isArray(object.instanceTemplates)) + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.instanceTemplates: array expected"); + message.instanceTemplates = []; + for (var i = 0; i < object.instanceTemplates.length; ++i) + message.instanceTemplates[i] = String(object.instanceTemplates[i]); + } + if (object.provisioningModels) { + if (!Array.isArray(object.provisioningModels)) + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.provisioningModels: array expected"); + message.provisioningModels = []; + for (var i = 0; i < object.provisioningModels.length; ++i) + switch (object.provisioningModels[i]) { + default: + if (typeof object.provisioningModels[i] === "number") { + message.provisioningModels[i] = object.provisioningModels[i]; + break; + } + case "PROVISIONING_MODEL_UNSPECIFIED": + case 0: + message.provisioningModels[i] = 0; + break; + case "STANDARD": + case 1: + message.provisioningModels[i] = 1; + break; + case "SPOT": + case 2: + message.provisioningModels[i] = 2; + break; + case "PREEMPTIBLE": + case 3: + message.provisioningModels[i] = 3; + break; + } + } + if (object.serviceAccountEmail != null) + message.serviceAccountEmail = String(object.serviceAccountEmail); + if (object.serviceAccount != null) { + if (typeof object.serviceAccount !== "object") + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.serviceAccount: object expected"); + message.serviceAccount = $root.google.cloud.batch.v1alpha.ServiceAccount.fromObject(object.serviceAccount); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.network != null) { + if (typeof object.network !== "object") + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.network: object expected"); + message.network = $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.fromObject(object.network); + } + if (object.placement != null) { + if (typeof object.placement !== "object") + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.placement: object expected"); + message.placement = $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.fromObject(object.placement); + } + if (object.tags) { + if (!Array.isArray(object.tags)) + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.tags: array expected"); + message.tags = []; + for (var i = 0; i < object.tags.length; ++i) + message.tags[i] = String(object.tags[i]); + } + return message; + }; + + /** + * Creates a plain object from an AllocationPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy} message AllocationPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AllocationPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.instanceTemplates = []; + object.provisioningModels = []; + object.instances = []; + object.tags = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.location = null; + object.instance = null; + object.serviceAccountEmail = ""; + object.network = null; + object.serviceAccount = null; + object.placement = null; + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = $root.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.toObject(message.location, options); + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.toObject(message.instance, options); + if (message.instanceTemplates && message.instanceTemplates.length) { + object.instanceTemplates = []; + for (var j = 0; j < message.instanceTemplates.length; ++j) + object.instanceTemplates[j] = message.instanceTemplates[j]; + } + if (message.provisioningModels && message.provisioningModels.length) { + object.provisioningModels = []; + for (var j = 0; j < message.provisioningModels.length; ++j) + object.provisioningModels[j] = options.enums === String ? $root.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel[message.provisioningModels[j]] === undefined ? message.provisioningModels[j] : $root.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel[message.provisioningModels[j]] : message.provisioningModels[j]; + } + if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) + object.serviceAccountEmail = message.serviceAccountEmail; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.network != null && message.hasOwnProperty("network")) + object.network = $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.toObject(message.network, options); + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.toObject(message.instances[j], options); + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = $root.google.cloud.batch.v1alpha.ServiceAccount.toObject(message.serviceAccount, options); + if (message.placement != null && message.hasOwnProperty("placement")) + object.placement = $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.toObject(message.placement, options); + if (message.tags && message.tags.length) { + object.tags = []; + for (var j = 0; j < message.tags.length; ++j) + object.tags[j] = message.tags[j]; + } + return object; + }; + + /** + * Converts this AllocationPolicy to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @instance + * @returns {Object.} JSON object + */ + AllocationPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AllocationPolicy + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AllocationPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy"; + }; + + AllocationPolicy.LocationPolicy = (function() { + + /** + * Properties of a LocationPolicy. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @interface ILocationPolicy + * @property {Array.|null} [allowedLocations] LocationPolicy allowedLocations + * @property {Array.|null} [deniedLocations] LocationPolicy deniedLocations + */ + + /** + * Constructs a new LocationPolicy. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @classdesc Represents a LocationPolicy. + * @implements ILocationPolicy + * @constructor + * @param {google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy=} [properties] Properties to set + */ + function LocationPolicy(properties) { + this.allowedLocations = []; + this.deniedLocations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LocationPolicy allowedLocations. + * @member {Array.} allowedLocations + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy + * @instance + */ + LocationPolicy.prototype.allowedLocations = $util.emptyArray; + + /** + * LocationPolicy deniedLocations. + * @member {Array.} deniedLocations + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy + * @instance + */ + LocationPolicy.prototype.deniedLocations = $util.emptyArray; + + /** + * Creates a new LocationPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy} LocationPolicy instance + */ + LocationPolicy.create = function create(properties) { + return new LocationPolicy(properties); + }; + + /** + * Encodes the specified LocationPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy} message LocationPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedLocations != null && message.allowedLocations.length) + for (var i = 0; i < message.allowedLocations.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedLocations[i]); + if (message.deniedLocations != null && message.deniedLocations.length) + for (var i = 0; i < message.deniedLocations.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.deniedLocations[i]); + return writer; + }; + + /** + * Encodes the specified LocationPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy} message LocationPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocationPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy} LocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.allowedLocations && message.allowedLocations.length)) + message.allowedLocations = []; + message.allowedLocations.push(reader.string()); + break; + } + case 2: { + if (!(message.deniedLocations && message.deniedLocations.length)) + message.deniedLocations = []; + message.deniedLocations.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocationPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy} LocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocationPolicy message. + * @function verify + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocationPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowedLocations != null && message.hasOwnProperty("allowedLocations")) { + if (!Array.isArray(message.allowedLocations)) + return "allowedLocations: array expected"; + for (var i = 0; i < message.allowedLocations.length; ++i) + if (!$util.isString(message.allowedLocations[i])) + return "allowedLocations: string[] expected"; + } + if (message.deniedLocations != null && message.hasOwnProperty("deniedLocations")) { + if (!Array.isArray(message.deniedLocations)) + return "deniedLocations: array expected"; + for (var i = 0; i < message.deniedLocations.length; ++i) + if (!$util.isString(message.deniedLocations[i])) + return "deniedLocations: string[] expected"; + } + return null; + }; + + /** + * Creates a LocationPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy} LocationPolicy + */ + LocationPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy) + return object; + var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy(); + if (object.allowedLocations) { + if (!Array.isArray(object.allowedLocations)) + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.allowedLocations: array expected"); + message.allowedLocations = []; + for (var i = 0; i < object.allowedLocations.length; ++i) + message.allowedLocations[i] = String(object.allowedLocations[i]); + } + if (object.deniedLocations) { + if (!Array.isArray(object.deniedLocations)) + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.deniedLocations: array expected"); + message.deniedLocations = []; + for (var i = 0; i < object.deniedLocations.length; ++i) + message.deniedLocations[i] = String(object.deniedLocations[i]); + } + return message; + }; + + /** + * Creates a plain object from a LocationPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy} message LocationPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocationPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.allowedLocations = []; + object.deniedLocations = []; + } + if (message.allowedLocations && message.allowedLocations.length) { + object.allowedLocations = []; + for (var j = 0; j < message.allowedLocations.length; ++j) + object.allowedLocations[j] = message.allowedLocations[j]; + } + if (message.deniedLocations && message.deniedLocations.length) { + object.deniedLocations = []; + for (var j = 0; j < message.deniedLocations.length; ++j) + object.deniedLocations[j] = message.deniedLocations[j]; + } + return object; + }; + + /** + * Converts this LocationPolicy to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy + * @instance + * @returns {Object.} JSON object + */ + LocationPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LocationPolicy + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LocationPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy"; + }; + + return LocationPolicy; + })(); + + AllocationPolicy.Disk = (function() { + + /** + * Properties of a Disk. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @interface IDisk + * @property {string|null} [image] Disk image + * @property {string|null} [snapshot] Disk snapshot + * @property {string|null} [type] Disk type + * @property {number|Long|null} [sizeGb] Disk sizeGb + * @property {string|null} [diskInterface] Disk diskInterface + */ + + /** + * Constructs a new Disk. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @classdesc Represents a Disk. + * @implements IDisk + * @constructor + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IDisk=} [properties] Properties to set + */ + function Disk(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Disk image. + * @member {string|null|undefined} image + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk + * @instance + */ + Disk.prototype.image = null; + + /** + * Disk snapshot. + * @member {string|null|undefined} snapshot + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk + * @instance + */ + Disk.prototype.snapshot = null; + + /** + * Disk type. + * @member {string} type + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk + * @instance + */ + Disk.prototype.type = ""; + + /** + * Disk sizeGb. + * @member {number|Long} sizeGb + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk + * @instance + */ + Disk.prototype.sizeGb = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk diskInterface. + * @member {string} diskInterface + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk + * @instance + */ + Disk.prototype.diskInterface = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Disk dataSource. + * @member {"image"|"snapshot"|undefined} dataSource + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk + * @instance + */ + Object.defineProperty(Disk.prototype, "dataSource", { + get: $util.oneOfGetter($oneOfFields = ["image", "snapshot"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Disk instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IDisk=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.Disk} Disk instance + */ + Disk.create = function create(properties) { + return new Disk(properties); + }; + + /** + * Encodes the specified Disk message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.Disk.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IDisk} message Disk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Disk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.sizeGb != null && Object.hasOwnProperty.call(message, "sizeGb")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.sizeGb); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.image); + if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.snapshot); + if (message.diskInterface != null && Object.hasOwnProperty.call(message, "diskInterface")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.diskInterface); + return writer; + }; + + /** + * Encodes the specified Disk message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.Disk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IDisk} message Disk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Disk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Disk message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.Disk} Disk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Disk.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.image = reader.string(); + break; + } + case 5: { + message.snapshot = reader.string(); + break; + } + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.sizeGb = reader.int64(); + break; + } + case 6: { + message.diskInterface = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Disk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.Disk} Disk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Disk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Disk message. + * @function verify + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Disk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.image != null && message.hasOwnProperty("image")) { + properties.dataSource = 1; + if (!$util.isString(message.image)) + return "image: string expected"; + } + if (message.snapshot != null && message.hasOwnProperty("snapshot")) { + if (properties.dataSource === 1) + return "dataSource: multiple values"; + properties.dataSource = 1; + if (!$util.isString(message.snapshot)) + return "snapshot: string expected"; + } + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) + if (!$util.isInteger(message.sizeGb) && !(message.sizeGb && $util.isInteger(message.sizeGb.low) && $util.isInteger(message.sizeGb.high))) + return "sizeGb: integer|Long expected"; + if (message.diskInterface != null && message.hasOwnProperty("diskInterface")) + if (!$util.isString(message.diskInterface)) + return "diskInterface: string expected"; + return null; + }; + + /** + * Creates a Disk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.Disk} Disk + */ + Disk.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk) + return object; + var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk(); + if (object.image != null) + message.image = String(object.image); + if (object.snapshot != null) + message.snapshot = String(object.snapshot); + if (object.type != null) + message.type = String(object.type); + if (object.sizeGb != null) + if ($util.Long) + (message.sizeGb = $util.Long.fromValue(object.sizeGb)).unsigned = false; + else if (typeof object.sizeGb === "string") + message.sizeGb = parseInt(object.sizeGb, 10); + else if (typeof object.sizeGb === "number") + message.sizeGb = object.sizeGb; + else if (typeof object.sizeGb === "object") + message.sizeGb = new $util.LongBits(object.sizeGb.low >>> 0, object.sizeGb.high >>> 0).toNumber(); + if (object.diskInterface != null) + message.diskInterface = String(object.diskInterface); + return message; + }; + + /** + * Creates a plain object from a Disk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.Disk} message Disk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Disk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.sizeGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sizeGb = options.longs === String ? "0" : 0; + object.diskInterface = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) + if (typeof message.sizeGb === "number") + object.sizeGb = options.longs === String ? String(message.sizeGb) : message.sizeGb; + else + object.sizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.sizeGb) : options.longs === Number ? new $util.LongBits(message.sizeGb.low >>> 0, message.sizeGb.high >>> 0).toNumber() : message.sizeGb; + if (message.image != null && message.hasOwnProperty("image")) { + object.image = message.image; + if (options.oneofs) + object.dataSource = "image"; + } + if (message.snapshot != null && message.hasOwnProperty("snapshot")) { + object.snapshot = message.snapshot; + if (options.oneofs) + object.dataSource = "snapshot"; + } + if (message.diskInterface != null && message.hasOwnProperty("diskInterface")) + object.diskInterface = message.diskInterface; + return object; + }; + + /** + * Converts this Disk to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk + * @instance + * @returns {Object.} JSON object + */ + Disk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Disk + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Disk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy.Disk"; + }; + + return Disk; + })(); + + AllocationPolicy.AttachedDisk = (function() { + + /** + * Properties of an AttachedDisk. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @interface IAttachedDisk + * @property {google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null} [newDisk] AttachedDisk newDisk + * @property {string|null} [existingDisk] AttachedDisk existingDisk + * @property {string|null} [deviceName] AttachedDisk deviceName + */ + + /** + * Constructs a new AttachedDisk. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @classdesc Represents an AttachedDisk. + * @implements IAttachedDisk + * @constructor + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk=} [properties] Properties to set + */ + function AttachedDisk(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AttachedDisk newDisk. + * @member {google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null|undefined} newDisk + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk + * @instance + */ + AttachedDisk.prototype.newDisk = null; + + /** + * AttachedDisk existingDisk. + * @member {string|null|undefined} existingDisk + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk + * @instance + */ + AttachedDisk.prototype.existingDisk = null; + + /** + * AttachedDisk deviceName. + * @member {string} deviceName + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk + * @instance + */ + AttachedDisk.prototype.deviceName = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AttachedDisk attached. + * @member {"newDisk"|"existingDisk"|undefined} attached + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "attached", { + get: $util.oneOfGetter($oneOfFields = ["newDisk", "existingDisk"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AttachedDisk instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk} AttachedDisk instance + */ + AttachedDisk.create = function create(properties) { + return new AttachedDisk(properties); + }; + + /** + * Encodes the specified AttachedDisk message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk} message AttachedDisk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttachedDisk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.newDisk != null && Object.hasOwnProperty.call(message, "newDisk")) + $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.encode(message.newDisk, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.existingDisk != null && Object.hasOwnProperty.call(message, "existingDisk")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.existingDisk); + if (message.deviceName != null && Object.hasOwnProperty.call(message, "deviceName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.deviceName); + return writer; + }; + + /** + * Encodes the specified AttachedDisk message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk} message AttachedDisk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttachedDisk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttachedDisk message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk} AttachedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttachedDisk.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.newDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.decode(reader, reader.uint32()); + break; + } + case 2: { + message.existingDisk = reader.string(); + break; + } + case 3: { + message.deviceName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttachedDisk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk} AttachedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttachedDisk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttachedDisk message. + * @function verify + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttachedDisk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.newDisk != null && message.hasOwnProperty("newDisk")) { + properties.attached = 1; + { + var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.verify(message.newDisk); + if (error) + return "newDisk." + error; + } + } + if (message.existingDisk != null && message.hasOwnProperty("existingDisk")) { + if (properties.attached === 1) + return "attached: multiple values"; + properties.attached = 1; + if (!$util.isString(message.existingDisk)) + return "existingDisk: string expected"; + } + if (message.deviceName != null && message.hasOwnProperty("deviceName")) + if (!$util.isString(message.deviceName)) + return "deviceName: string expected"; + return null; + }; + + /** + * Creates an AttachedDisk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk} AttachedDisk + */ + AttachedDisk.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk) + return object; + var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk(); + if (object.newDisk != null) { + if (typeof object.newDisk !== "object") + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.newDisk: object expected"); + message.newDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.fromObject(object.newDisk); + } + if (object.existingDisk != null) + message.existingDisk = String(object.existingDisk); + if (object.deviceName != null) + message.deviceName = String(object.deviceName); + return message; + }; + + /** + * Creates a plain object from an AttachedDisk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk} message AttachedDisk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttachedDisk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.deviceName = ""; + if (message.newDisk != null && message.hasOwnProperty("newDisk")) { + object.newDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.toObject(message.newDisk, options); + if (options.oneofs) + object.attached = "newDisk"; + } + if (message.existingDisk != null && message.hasOwnProperty("existingDisk")) { + object.existingDisk = message.existingDisk; + if (options.oneofs) + object.attached = "existingDisk"; + } + if (message.deviceName != null && message.hasOwnProperty("deviceName")) + object.deviceName = message.deviceName; + return object; + }; + + /** + * Converts this AttachedDisk to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk + * @instance + * @returns {Object.} JSON object + */ + AttachedDisk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AttachedDisk + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AttachedDisk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk"; + }; + + return AttachedDisk; + })(); + + AllocationPolicy.Accelerator = (function() { + + /** + * Properties of an Accelerator. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @interface IAccelerator + * @property {string|null} [type] Accelerator type + * @property {number|Long|null} [count] Accelerator count + * @property {boolean|null} [installGpuDrivers] Accelerator installGpuDrivers + * @property {string|null} [driverVersion] Accelerator driverVersion + */ + + /** + * Constructs a new Accelerator. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @classdesc Represents an Accelerator. + * @implements IAccelerator + * @constructor + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator=} [properties] Properties to set + */ + function Accelerator(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Accelerator type. + * @member {string} type + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator + * @instance + */ + Accelerator.prototype.type = ""; + + /** + * Accelerator count. + * @member {number|Long} count + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator + * @instance + */ + Accelerator.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Accelerator installGpuDrivers. + * @member {boolean} installGpuDrivers + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator + * @instance + */ + Accelerator.prototype.installGpuDrivers = false; + + /** + * Accelerator driverVersion. + * @member {string} driverVersion + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator + * @instance + */ + Accelerator.prototype.driverVersion = ""; + + /** + * Creates a new Accelerator instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.Accelerator} Accelerator instance + */ + Accelerator.create = function create(properties) { + return new Accelerator(properties); + }; + + /** + * Encodes the specified Accelerator message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator} message Accelerator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Accelerator.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); + if (message.installGpuDrivers != null && Object.hasOwnProperty.call(message, "installGpuDrivers")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.installGpuDrivers); + if (message.driverVersion != null && Object.hasOwnProperty.call(message, "driverVersion")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.driverVersion); + return writer; + }; + + /** + * Encodes the specified Accelerator message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator} message Accelerator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Accelerator.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Accelerator message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.Accelerator} Accelerator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Accelerator.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.count = reader.int64(); + break; + } + case 3: { + message.installGpuDrivers = reader.bool(); + break; + } + case 4: { + message.driverVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Accelerator message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.Accelerator} Accelerator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Accelerator.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Accelerator message. + * @function verify + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Accelerator.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + if (message.installGpuDrivers != null && message.hasOwnProperty("installGpuDrivers")) + if (typeof message.installGpuDrivers !== "boolean") + return "installGpuDrivers: boolean expected"; + if (message.driverVersion != null && message.hasOwnProperty("driverVersion")) + if (!$util.isString(message.driverVersion)) + return "driverVersion: string expected"; + return null; + }; + + /** + * Creates an Accelerator message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.Accelerator} Accelerator + */ + Accelerator.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator) + return object; + var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator(); + if (object.type != null) + message.type = String(object.type); + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + if (object.installGpuDrivers != null) + message.installGpuDrivers = Boolean(object.installGpuDrivers); + if (object.driverVersion != null) + message.driverVersion = String(object.driverVersion); + return message; + }; + + /** + * Creates a plain object from an Accelerator message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.Accelerator} message Accelerator + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Accelerator.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + object.installGpuDrivers = false; + object.driverVersion = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + if (message.installGpuDrivers != null && message.hasOwnProperty("installGpuDrivers")) + object.installGpuDrivers = message.installGpuDrivers; + if (message.driverVersion != null && message.hasOwnProperty("driverVersion")) + object.driverVersion = message.driverVersion; + return object; + }; + + /** + * Converts this Accelerator to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator + * @instance + * @returns {Object.} JSON object + */ + Accelerator.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Accelerator + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Accelerator.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy.Accelerator"; + }; + + return Accelerator; + })(); + + AllocationPolicy.InstancePolicy = (function() { + + /** + * Properties of an InstancePolicy. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @interface IInstancePolicy + * @property {Array.|null} [allowedMachineTypes] InstancePolicy allowedMachineTypes + * @property {string|null} [machineType] InstancePolicy machineType + * @property {string|null} [minCpuPlatform] InstancePolicy minCpuPlatform + * @property {google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel|null} [provisioningModel] InstancePolicy provisioningModel + * @property {Array.|null} [accelerators] InstancePolicy accelerators + * @property {google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null} [bootDisk] InstancePolicy bootDisk + * @property {Array.|null} [disks] InstancePolicy disks + * @property {string|null} [reservation] InstancePolicy reservation + */ + + /** + * Constructs a new InstancePolicy. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @classdesc Represents an InstancePolicy. + * @implements IInstancePolicy + * @constructor + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy=} [properties] Properties to set + */ + function InstancePolicy(properties) { + this.allowedMachineTypes = []; + this.accelerators = []; + this.disks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstancePolicy allowedMachineTypes. + * @member {Array.} allowedMachineTypes + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + * @instance + */ + InstancePolicy.prototype.allowedMachineTypes = $util.emptyArray; + + /** + * InstancePolicy machineType. + * @member {string} machineType + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + * @instance + */ + InstancePolicy.prototype.machineType = ""; + + /** + * InstancePolicy minCpuPlatform. + * @member {string} minCpuPlatform + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + * @instance + */ + InstancePolicy.prototype.minCpuPlatform = ""; + + /** + * InstancePolicy provisioningModel. + * @member {google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel} provisioningModel + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + * @instance + */ + InstancePolicy.prototype.provisioningModel = 0; + + /** + * InstancePolicy accelerators. + * @member {Array.} accelerators + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + * @instance + */ + InstancePolicy.prototype.accelerators = $util.emptyArray; + + /** + * InstancePolicy bootDisk. + * @member {google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null|undefined} bootDisk + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + * @instance + */ + InstancePolicy.prototype.bootDisk = null; + + /** + * InstancePolicy disks. + * @member {Array.} disks + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + * @instance + */ + InstancePolicy.prototype.disks = $util.emptyArray; + + /** + * InstancePolicy reservation. + * @member {string} reservation + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + * @instance + */ + InstancePolicy.prototype.reservation = ""; + + /** + * Creates a new InstancePolicy instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy} InstancePolicy instance + */ + InstancePolicy.create = function create(properties) { + return new InstancePolicy(properties); + }; + + /** + * Encodes the specified InstancePolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy} message InstancePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancePolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedMachineTypes != null && message.allowedMachineTypes.length) + for (var i = 0; i < message.allowedMachineTypes.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedMachineTypes[i]); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.machineType); + if (message.minCpuPlatform != null && Object.hasOwnProperty.call(message, "minCpuPlatform")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.minCpuPlatform); + if (message.provisioningModel != null && Object.hasOwnProperty.call(message, "provisioningModel")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.provisioningModel); + if (message.accelerators != null && message.accelerators.length) + for (var i = 0; i < message.accelerators.length; ++i) + $root.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.encode(message.accelerators[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.disks != null && message.disks.length) + for (var i = 0; i < message.disks.length; ++i) + $root.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.encode(message.disks[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.reservation != null && Object.hasOwnProperty.call(message, "reservation")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.reservation); + if (message.bootDisk != null && Object.hasOwnProperty.call(message, "bootDisk")) + $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.encode(message.bootDisk, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstancePolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy} message InstancePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancePolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstancePolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy} InstancePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancePolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.allowedMachineTypes && message.allowedMachineTypes.length)) + message.allowedMachineTypes = []; + message.allowedMachineTypes.push(reader.string()); + break; + } + case 2: { + message.machineType = reader.string(); + break; + } + case 3: { + message.minCpuPlatform = reader.string(); + break; + } + case 4: { + message.provisioningModel = reader.int32(); + break; + } + case 5: { + if (!(message.accelerators && message.accelerators.length)) + message.accelerators = []; + message.accelerators.push($root.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.decode(reader, reader.uint32())); + break; + } + case 8: { + message.bootDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.disks && message.disks.length)) + message.disks = []; + message.disks.push($root.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.decode(reader, reader.uint32())); + break; + } + case 7: { + message.reservation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstancePolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy} InstancePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancePolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstancePolicy message. + * @function verify + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstancePolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowedMachineTypes != null && message.hasOwnProperty("allowedMachineTypes")) { + if (!Array.isArray(message.allowedMachineTypes)) + return "allowedMachineTypes: array expected"; + for (var i = 0; i < message.allowedMachineTypes.length; ++i) + if (!$util.isString(message.allowedMachineTypes[i])) + return "allowedMachineTypes: string[] expected"; + } + if (message.machineType != null && message.hasOwnProperty("machineType")) + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) + if (!$util.isString(message.minCpuPlatform)) + return "minCpuPlatform: string expected"; + if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) + switch (message.provisioningModel) { + default: + return "provisioningModel: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.accelerators != null && message.hasOwnProperty("accelerators")) { + if (!Array.isArray(message.accelerators)) + return "accelerators: array expected"; + for (var i = 0; i < message.accelerators.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.verify(message.accelerators[i]); + if (error) + return "accelerators." + error; + } + } + if (message.bootDisk != null && message.hasOwnProperty("bootDisk")) { + var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.verify(message.bootDisk); + if (error) + return "bootDisk." + error; + } + if (message.disks != null && message.hasOwnProperty("disks")) { + if (!Array.isArray(message.disks)) + return "disks: array expected"; + for (var i = 0; i < message.disks.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.verify(message.disks[i]); + if (error) + return "disks." + error; + } + } + if (message.reservation != null && message.hasOwnProperty("reservation")) + if (!$util.isString(message.reservation)) + return "reservation: string expected"; + return null; + }; + + /** + * Creates an InstancePolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy} InstancePolicy + */ + InstancePolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy) + return object; + var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy(); + if (object.allowedMachineTypes) { + if (!Array.isArray(object.allowedMachineTypes)) + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.allowedMachineTypes: array expected"); + message.allowedMachineTypes = []; + for (var i = 0; i < object.allowedMachineTypes.length; ++i) + message.allowedMachineTypes[i] = String(object.allowedMachineTypes[i]); + } + if (object.machineType != null) + message.machineType = String(object.machineType); + if (object.minCpuPlatform != null) + message.minCpuPlatform = String(object.minCpuPlatform); + switch (object.provisioningModel) { + default: + if (typeof object.provisioningModel === "number") { + message.provisioningModel = object.provisioningModel; + break; + } + break; + case "PROVISIONING_MODEL_UNSPECIFIED": + case 0: + message.provisioningModel = 0; + break; + case "STANDARD": + case 1: + message.provisioningModel = 1; + break; + case "SPOT": + case 2: + message.provisioningModel = 2; + break; + case "PREEMPTIBLE": + case 3: + message.provisioningModel = 3; + break; + } + if (object.accelerators) { + if (!Array.isArray(object.accelerators)) + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.accelerators: array expected"); + message.accelerators = []; + for (var i = 0; i < object.accelerators.length; ++i) { + if (typeof object.accelerators[i] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.accelerators: object expected"); + message.accelerators[i] = $root.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.fromObject(object.accelerators[i]); + } + } + if (object.bootDisk != null) { + if (typeof object.bootDisk !== "object") + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.bootDisk: object expected"); + message.bootDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.fromObject(object.bootDisk); + } + if (object.disks) { + if (!Array.isArray(object.disks)) + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.disks: array expected"); + message.disks = []; + for (var i = 0; i < object.disks.length; ++i) { + if (typeof object.disks[i] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.disks: object expected"); + message.disks[i] = $root.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.fromObject(object.disks[i]); + } + } + if (object.reservation != null) + message.reservation = String(object.reservation); + return message; + }; + + /** + * Creates a plain object from an InstancePolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy} message InstancePolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstancePolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.allowedMachineTypes = []; + object.accelerators = []; + object.disks = []; + } + if (options.defaults) { + object.machineType = ""; + object.minCpuPlatform = ""; + object.provisioningModel = options.enums === String ? "PROVISIONING_MODEL_UNSPECIFIED" : 0; + object.reservation = ""; + object.bootDisk = null; + } + if (message.allowedMachineTypes && message.allowedMachineTypes.length) { + object.allowedMachineTypes = []; + for (var j = 0; j < message.allowedMachineTypes.length; ++j) + object.allowedMachineTypes[j] = message.allowedMachineTypes[j]; + } + if (message.machineType != null && message.hasOwnProperty("machineType")) + object.machineType = message.machineType; + if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) + object.minCpuPlatform = message.minCpuPlatform; + if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) + object.provisioningModel = options.enums === String ? $root.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel[message.provisioningModel] === undefined ? message.provisioningModel : $root.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel[message.provisioningModel] : message.provisioningModel; + if (message.accelerators && message.accelerators.length) { + object.accelerators = []; + for (var j = 0; j < message.accelerators.length; ++j) + object.accelerators[j] = $root.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.toObject(message.accelerators[j], options); + } + if (message.disks && message.disks.length) { + object.disks = []; + for (var j = 0; j < message.disks.length; ++j) + object.disks[j] = $root.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.toObject(message.disks[j], options); + } + if (message.reservation != null && message.hasOwnProperty("reservation")) + object.reservation = message.reservation; + if (message.bootDisk != null && message.hasOwnProperty("bootDisk")) + object.bootDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.toObject(message.bootDisk, options); + return object; + }; + + /** + * Converts this InstancePolicy to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + * @instance + * @returns {Object.} JSON object + */ + InstancePolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstancePolicy + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstancePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy"; + }; + + return InstancePolicy; + })(); + + AllocationPolicy.InstancePolicyOrTemplate = (function() { + + /** + * Properties of an InstancePolicyOrTemplate. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @interface IInstancePolicyOrTemplate + * @property {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy|null} [policy] InstancePolicyOrTemplate policy + * @property {string|null} [instanceTemplate] InstancePolicyOrTemplate instanceTemplate + * @property {boolean|null} [installGpuDrivers] InstancePolicyOrTemplate installGpuDrivers + * @property {boolean|null} [installOpsAgent] InstancePolicyOrTemplate installOpsAgent + * @property {boolean|null} [blockProjectSshKeys] InstancePolicyOrTemplate blockProjectSshKeys + */ + + /** + * Constructs a new InstancePolicyOrTemplate. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @classdesc Represents an InstancePolicyOrTemplate. + * @implements IInstancePolicyOrTemplate + * @constructor + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate=} [properties] Properties to set + */ + function InstancePolicyOrTemplate(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstancePolicyOrTemplate policy. + * @member {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy|null|undefined} policy + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + * @instance + */ + InstancePolicyOrTemplate.prototype.policy = null; + + /** + * InstancePolicyOrTemplate instanceTemplate. + * @member {string|null|undefined} instanceTemplate + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + * @instance + */ + InstancePolicyOrTemplate.prototype.instanceTemplate = null; + + /** + * InstancePolicyOrTemplate installGpuDrivers. + * @member {boolean} installGpuDrivers + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + * @instance + */ + InstancePolicyOrTemplate.prototype.installGpuDrivers = false; + + /** + * InstancePolicyOrTemplate installOpsAgent. + * @member {boolean} installOpsAgent + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + * @instance + */ + InstancePolicyOrTemplate.prototype.installOpsAgent = false; + + /** + * InstancePolicyOrTemplate blockProjectSshKeys. + * @member {boolean} blockProjectSshKeys + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + * @instance + */ + InstancePolicyOrTemplate.prototype.blockProjectSshKeys = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstancePolicyOrTemplate policyTemplate. + * @member {"policy"|"instanceTemplate"|undefined} policyTemplate + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + * @instance + */ + Object.defineProperty(InstancePolicyOrTemplate.prototype, "policyTemplate", { + get: $util.oneOfGetter($oneOfFields = ["policy", "instanceTemplate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstancePolicyOrTemplate instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate} InstancePolicyOrTemplate instance + */ + InstancePolicyOrTemplate.create = function create(properties) { + return new InstancePolicyOrTemplate(properties); + }; + + /** + * Encodes the specified InstancePolicyOrTemplate message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate} message InstancePolicyOrTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancePolicyOrTemplate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.encode(message.policy, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.instanceTemplate != null && Object.hasOwnProperty.call(message, "instanceTemplate")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceTemplate); + if (message.installGpuDrivers != null && Object.hasOwnProperty.call(message, "installGpuDrivers")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.installGpuDrivers); + if (message.installOpsAgent != null && Object.hasOwnProperty.call(message, "installOpsAgent")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.installOpsAgent); + if (message.blockProjectSshKeys != null && Object.hasOwnProperty.call(message, "blockProjectSshKeys")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.blockProjectSshKeys); + return writer; + }; + + /** + * Encodes the specified InstancePolicyOrTemplate message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate} message InstancePolicyOrTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancePolicyOrTemplate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstancePolicyOrTemplate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate} InstancePolicyOrTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancePolicyOrTemplate.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.policy = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.decode(reader, reader.uint32()); + break; + } + case 2: { + message.instanceTemplate = reader.string(); + break; + } + case 3: { + message.installGpuDrivers = reader.bool(); + break; + } + case 4: { + message.installOpsAgent = reader.bool(); + break; + } + case 5: { + message.blockProjectSshKeys = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstancePolicyOrTemplate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate} InstancePolicyOrTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancePolicyOrTemplate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstancePolicyOrTemplate message. + * @function verify + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstancePolicyOrTemplate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.policy != null && message.hasOwnProperty("policy")) { + properties.policyTemplate = 1; + { + var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.verify(message.policy); + if (error) + return "policy." + error; + } + } + if (message.instanceTemplate != null && message.hasOwnProperty("instanceTemplate")) { + if (properties.policyTemplate === 1) + return "policyTemplate: multiple values"; + properties.policyTemplate = 1; + if (!$util.isString(message.instanceTemplate)) + return "instanceTemplate: string expected"; + } + if (message.installGpuDrivers != null && message.hasOwnProperty("installGpuDrivers")) + if (typeof message.installGpuDrivers !== "boolean") + return "installGpuDrivers: boolean expected"; + if (message.installOpsAgent != null && message.hasOwnProperty("installOpsAgent")) + if (typeof message.installOpsAgent !== "boolean") + return "installOpsAgent: boolean expected"; + if (message.blockProjectSshKeys != null && message.hasOwnProperty("blockProjectSshKeys")) + if (typeof message.blockProjectSshKeys !== "boolean") + return "blockProjectSshKeys: boolean expected"; + return null; + }; + + /** + * Creates an InstancePolicyOrTemplate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate} InstancePolicyOrTemplate + */ + InstancePolicyOrTemplate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate) + return object; + var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate(); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.policy: object expected"); + message.policy = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.fromObject(object.policy); + } + if (object.instanceTemplate != null) + message.instanceTemplate = String(object.instanceTemplate); + if (object.installGpuDrivers != null) + message.installGpuDrivers = Boolean(object.installGpuDrivers); + if (object.installOpsAgent != null) + message.installOpsAgent = Boolean(object.installOpsAgent); + if (object.blockProjectSshKeys != null) + message.blockProjectSshKeys = Boolean(object.blockProjectSshKeys); + return message; + }; + + /** + * Creates a plain object from an InstancePolicyOrTemplate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate} message InstancePolicyOrTemplate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstancePolicyOrTemplate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.installGpuDrivers = false; + object.installOpsAgent = false; + object.blockProjectSshKeys = false; + } + if (message.policy != null && message.hasOwnProperty("policy")) { + object.policy = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.toObject(message.policy, options); + if (options.oneofs) + object.policyTemplate = "policy"; + } + if (message.instanceTemplate != null && message.hasOwnProperty("instanceTemplate")) { + object.instanceTemplate = message.instanceTemplate; + if (options.oneofs) + object.policyTemplate = "instanceTemplate"; + } + if (message.installGpuDrivers != null && message.hasOwnProperty("installGpuDrivers")) + object.installGpuDrivers = message.installGpuDrivers; + if (message.installOpsAgent != null && message.hasOwnProperty("installOpsAgent")) + object.installOpsAgent = message.installOpsAgent; + if (message.blockProjectSshKeys != null && message.hasOwnProperty("blockProjectSshKeys")) + object.blockProjectSshKeys = message.blockProjectSshKeys; + return object; + }; + + /** + * Converts this InstancePolicyOrTemplate to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + * @instance + * @returns {Object.} JSON object + */ + InstancePolicyOrTemplate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstancePolicyOrTemplate + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstancePolicyOrTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate"; + }; + + return InstancePolicyOrTemplate; + })(); + + AllocationPolicy.NetworkInterface = (function() { + + /** + * Properties of a NetworkInterface. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @interface INetworkInterface + * @property {string|null} [network] NetworkInterface network + * @property {string|null} [subnetwork] NetworkInterface subnetwork + * @property {boolean|null} [noExternalIpAddress] NetworkInterface noExternalIpAddress + */ + + /** + * Constructs a new NetworkInterface. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @classdesc Represents a NetworkInterface. + * @implements INetworkInterface + * @constructor + * @param {google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface=} [properties] Properties to set + */ + function NetworkInterface(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkInterface network. + * @member {string} network + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface + * @instance + */ + NetworkInterface.prototype.network = ""; + + /** + * NetworkInterface subnetwork. + * @member {string} subnetwork + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface + * @instance + */ + NetworkInterface.prototype.subnetwork = ""; + + /** + * NetworkInterface noExternalIpAddress. + * @member {boolean} noExternalIpAddress + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface + * @instance + */ + NetworkInterface.prototype.noExternalIpAddress = false; + + /** + * Creates a new NetworkInterface instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface} NetworkInterface instance + */ + NetworkInterface.create = function create(properties) { + return new NetworkInterface(properties); + }; + + /** + * Encodes the specified NetworkInterface message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface} message NetworkInterface message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkInterface.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.network); + if (message.subnetwork != null && Object.hasOwnProperty.call(message, "subnetwork")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subnetwork); + if (message.noExternalIpAddress != null && Object.hasOwnProperty.call(message, "noExternalIpAddress")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.noExternalIpAddress); + return writer; + }; + + /** + * Encodes the specified NetworkInterface message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface} message NetworkInterface message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkInterface.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface} NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkInterface.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.network = reader.string(); + break; + } + case 2: { + message.subnetwork = reader.string(); + break; + } + case 3: { + message.noExternalIpAddress = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface} NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkInterface.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkInterface message. + * @function verify + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkInterface.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) + if (!$util.isString(message.subnetwork)) + return "subnetwork: string expected"; + if (message.noExternalIpAddress != null && message.hasOwnProperty("noExternalIpAddress")) + if (typeof message.noExternalIpAddress !== "boolean") + return "noExternalIpAddress: boolean expected"; + return null; + }; + + /** + * Creates a NetworkInterface message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface} NetworkInterface + */ + NetworkInterface.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface) + return object; + var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface(); + if (object.network != null) + message.network = String(object.network); + if (object.subnetwork != null) + message.subnetwork = String(object.subnetwork); + if (object.noExternalIpAddress != null) + message.noExternalIpAddress = Boolean(object.noExternalIpAddress); + return message; + }; + + /** + * Creates a plain object from a NetworkInterface message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface} message NetworkInterface + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkInterface.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.network = ""; + object.subnetwork = ""; + object.noExternalIpAddress = false; + } + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) + object.subnetwork = message.subnetwork; + if (message.noExternalIpAddress != null && message.hasOwnProperty("noExternalIpAddress")) + object.noExternalIpAddress = message.noExternalIpAddress; + return object; + }; + + /** + * Converts this NetworkInterface to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface + * @instance + * @returns {Object.} JSON object + */ + NetworkInterface.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NetworkInterface + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NetworkInterface.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface"; + }; + + return NetworkInterface; + })(); + + AllocationPolicy.NetworkPolicy = (function() { + + /** + * Properties of a NetworkPolicy. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @interface INetworkPolicy + * @property {Array.|null} [networkInterfaces] NetworkPolicy networkInterfaces + */ + + /** + * Constructs a new NetworkPolicy. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @classdesc Represents a NetworkPolicy. + * @implements INetworkPolicy + * @constructor + * @param {google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy=} [properties] Properties to set + */ + function NetworkPolicy(properties) { + this.networkInterfaces = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkPolicy networkInterfaces. + * @member {Array.} networkInterfaces + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy + * @instance + */ + NetworkPolicy.prototype.networkInterfaces = $util.emptyArray; + + /** + * Creates a new NetworkPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy} NetworkPolicy instance + */ + NetworkPolicy.create = function create(properties) { + return new NetworkPolicy(properties); + }; + + /** + * Encodes the specified NetworkPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy} message NetworkPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.networkInterfaces != null && message.networkInterfaces.length) + for (var i = 0; i < message.networkInterfaces.length; ++i) + $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.encode(message.networkInterfaces[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NetworkPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy} message NetworkPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy} NetworkPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.networkInterfaces && message.networkInterfaces.length)) + message.networkInterfaces = []; + message.networkInterfaces.push($root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy} NetworkPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkPolicy message. + * @function verify + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.networkInterfaces != null && message.hasOwnProperty("networkInterfaces")) { + if (!Array.isArray(message.networkInterfaces)) + return "networkInterfaces: array expected"; + for (var i = 0; i < message.networkInterfaces.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.verify(message.networkInterfaces[i]); + if (error) + return "networkInterfaces." + error; + } + } + return null; + }; + + /** + * Creates a NetworkPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy} NetworkPolicy + */ + NetworkPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy) + return object; + var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy(); + if (object.networkInterfaces) { + if (!Array.isArray(object.networkInterfaces)) + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.networkInterfaces: array expected"); + message.networkInterfaces = []; + for (var i = 0; i < object.networkInterfaces.length; ++i) { + if (typeof object.networkInterfaces[i] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.networkInterfaces: object expected"); + message.networkInterfaces[i] = $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.fromObject(object.networkInterfaces[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a NetworkPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy} message NetworkPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.networkInterfaces = []; + if (message.networkInterfaces && message.networkInterfaces.length) { + object.networkInterfaces = []; + for (var j = 0; j < message.networkInterfaces.length; ++j) + object.networkInterfaces[j] = $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.toObject(message.networkInterfaces[j], options); + } + return object; + }; + + /** + * Converts this NetworkPolicy to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy + * @instance + * @returns {Object.} JSON object + */ + NetworkPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NetworkPolicy + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NetworkPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy"; + }; + + return NetworkPolicy; + })(); + + AllocationPolicy.PlacementPolicy = (function() { + + /** + * Properties of a PlacementPolicy. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @interface IPlacementPolicy + * @property {string|null} [collocation] PlacementPolicy collocation + * @property {number|Long|null} [maxDistance] PlacementPolicy maxDistance + */ + + /** + * Constructs a new PlacementPolicy. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @classdesc Represents a PlacementPolicy. + * @implements IPlacementPolicy + * @constructor + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy=} [properties] Properties to set + */ + function PlacementPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PlacementPolicy collocation. + * @member {string} collocation + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy + * @instance + */ + PlacementPolicy.prototype.collocation = ""; + + /** + * PlacementPolicy maxDistance. + * @member {number|Long} maxDistance + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy + * @instance + */ + PlacementPolicy.prototype.maxDistance = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new PlacementPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy} PlacementPolicy instance + */ + PlacementPolicy.create = function create(properties) { + return new PlacementPolicy(properties); + }; + + /** + * Encodes the specified PlacementPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy} message PlacementPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlacementPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.collocation != null && Object.hasOwnProperty.call(message, "collocation")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.collocation); + if (message.maxDistance != null && Object.hasOwnProperty.call(message, "maxDistance")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.maxDistance); + return writer; + }; + + /** + * Encodes the specified PlacementPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy} message PlacementPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlacementPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PlacementPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy} PlacementPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlacementPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.collocation = reader.string(); + break; + } + case 2: { + message.maxDistance = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PlacementPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy} PlacementPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlacementPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PlacementPolicy message. + * @function verify + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PlacementPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.collocation != null && message.hasOwnProperty("collocation")) + if (!$util.isString(message.collocation)) + return "collocation: string expected"; + if (message.maxDistance != null && message.hasOwnProperty("maxDistance")) + if (!$util.isInteger(message.maxDistance) && !(message.maxDistance && $util.isInteger(message.maxDistance.low) && $util.isInteger(message.maxDistance.high))) + return "maxDistance: integer|Long expected"; + return null; + }; + + /** + * Creates a PlacementPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy} PlacementPolicy + */ + PlacementPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy) + return object; + var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy(); + if (object.collocation != null) + message.collocation = String(object.collocation); + if (object.maxDistance != null) + if ($util.Long) + (message.maxDistance = $util.Long.fromValue(object.maxDistance)).unsigned = false; + else if (typeof object.maxDistance === "string") + message.maxDistance = parseInt(object.maxDistance, 10); + else if (typeof object.maxDistance === "number") + message.maxDistance = object.maxDistance; + else if (typeof object.maxDistance === "object") + message.maxDistance = new $util.LongBits(object.maxDistance.low >>> 0, object.maxDistance.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a PlacementPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy} message PlacementPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PlacementPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.collocation = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxDistance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxDistance = options.longs === String ? "0" : 0; + } + if (message.collocation != null && message.hasOwnProperty("collocation")) + object.collocation = message.collocation; + if (message.maxDistance != null && message.hasOwnProperty("maxDistance")) + if (typeof message.maxDistance === "number") + object.maxDistance = options.longs === String ? String(message.maxDistance) : message.maxDistance; + else + object.maxDistance = options.longs === String ? $util.Long.prototype.toString.call(message.maxDistance) : options.longs === Number ? new $util.LongBits(message.maxDistance.low >>> 0, message.maxDistance.high >>> 0).toNumber() : message.maxDistance; + return object; + }; + + /** + * Converts this PlacementPolicy to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy + * @instance + * @returns {Object.} JSON object + */ + PlacementPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PlacementPolicy + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PlacementPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy"; + }; + + return PlacementPolicy; + })(); + + /** + * ProvisioningModel enum. + * @name google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel + * @enum {number} + * @property {number} PROVISIONING_MODEL_UNSPECIFIED=0 PROVISIONING_MODEL_UNSPECIFIED value + * @property {number} STANDARD=1 STANDARD value + * @property {number} SPOT=2 SPOT value + * @property {number} PREEMPTIBLE=3 PREEMPTIBLE value + */ + AllocationPolicy.ProvisioningModel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PROVISIONING_MODEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "STANDARD"] = 1; + values[valuesById[2] = "SPOT"] = 2; + values[valuesById[3] = "PREEMPTIBLE"] = 3; + return values; + })(); + + return AllocationPolicy; + })(); + + v1alpha.TaskGroup = (function() { + + /** + * Properties of a TaskGroup. + * @memberof google.cloud.batch.v1alpha + * @interface ITaskGroup + * @property {string|null} [name] TaskGroup name + * @property {google.cloud.batch.v1alpha.ITaskSpec|null} [taskSpec] TaskGroup taskSpec + * @property {number|Long|null} [taskCount] TaskGroup taskCount + * @property {number|Long|null} [parallelism] TaskGroup parallelism + * @property {google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy|null} [schedulingPolicy] TaskGroup schedulingPolicy + * @property {google.cloud.batch.v1alpha.IAllocationPolicy|null} [allocationPolicy] TaskGroup allocationPolicy + * @property {Object.|null} [labels] TaskGroup labels + * @property {Array.|null} [taskEnvironments] TaskGroup taskEnvironments + * @property {number|Long|null} [taskCountPerNode] TaskGroup taskCountPerNode + * @property {boolean|null} [requireHostsFile] TaskGroup requireHostsFile + * @property {boolean|null} [permissiveSsh] TaskGroup permissiveSsh + * @property {boolean|null} [runAsNonRoot] TaskGroup runAsNonRoot + * @property {google.cloud.batch.v1alpha.IServiceAccount|null} [serviceAccount] TaskGroup serviceAccount + */ + + /** + * Constructs a new TaskGroup. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a TaskGroup. + * @implements ITaskGroup + * @constructor + * @param {google.cloud.batch.v1alpha.ITaskGroup=} [properties] Properties to set + */ + function TaskGroup(properties) { + this.labels = {}; + this.taskEnvironments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TaskGroup name. + * @member {string} name + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @instance + */ + TaskGroup.prototype.name = ""; + + /** + * TaskGroup taskSpec. + * @member {google.cloud.batch.v1alpha.ITaskSpec|null|undefined} taskSpec + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @instance + */ + TaskGroup.prototype.taskSpec = null; + + /** + * TaskGroup taskCount. + * @member {number|Long} taskCount + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @instance + */ + TaskGroup.prototype.taskCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TaskGroup parallelism. + * @member {number|Long} parallelism + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @instance + */ + TaskGroup.prototype.parallelism = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TaskGroup schedulingPolicy. + * @member {google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy} schedulingPolicy + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @instance + */ + TaskGroup.prototype.schedulingPolicy = 0; + + /** + * TaskGroup allocationPolicy. + * @member {google.cloud.batch.v1alpha.IAllocationPolicy|null|undefined} allocationPolicy + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @instance + */ + TaskGroup.prototype.allocationPolicy = null; + + /** + * TaskGroup labels. + * @member {Object.} labels + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @instance + */ + TaskGroup.prototype.labels = $util.emptyObject; + + /** + * TaskGroup taskEnvironments. + * @member {Array.} taskEnvironments + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @instance + */ + TaskGroup.prototype.taskEnvironments = $util.emptyArray; + + /** + * TaskGroup taskCountPerNode. + * @member {number|Long} taskCountPerNode + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @instance + */ + TaskGroup.prototype.taskCountPerNode = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TaskGroup requireHostsFile. + * @member {boolean} requireHostsFile + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @instance + */ + TaskGroup.prototype.requireHostsFile = false; + + /** + * TaskGroup permissiveSsh. + * @member {boolean} permissiveSsh + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @instance + */ + TaskGroup.prototype.permissiveSsh = false; + + /** + * TaskGroup runAsNonRoot. + * @member {boolean} runAsNonRoot + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @instance + */ + TaskGroup.prototype.runAsNonRoot = false; + + /** + * TaskGroup serviceAccount. + * @member {google.cloud.batch.v1alpha.IServiceAccount|null|undefined} serviceAccount + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @instance + */ + TaskGroup.prototype.serviceAccount = null; + + /** + * Creates a new TaskGroup instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @static + * @param {google.cloud.batch.v1alpha.ITaskGroup=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.TaskGroup} TaskGroup instance + */ + TaskGroup.create = function create(properties) { + return new TaskGroup(properties); + }; + + /** + * Encodes the specified TaskGroup message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskGroup.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @static + * @param {google.cloud.batch.v1alpha.ITaskGroup} message TaskGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskGroup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.taskSpec != null && Object.hasOwnProperty.call(message, "taskSpec")) + $root.google.cloud.batch.v1alpha.TaskSpec.encode(message.taskSpec, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.taskCount != null && Object.hasOwnProperty.call(message, "taskCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.taskCount); + if (message.parallelism != null && Object.hasOwnProperty.call(message, "parallelism")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.parallelism); + if (message.schedulingPolicy != null && Object.hasOwnProperty.call(message, "schedulingPolicy")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.schedulingPolicy); + if (message.allocationPolicy != null && Object.hasOwnProperty.call(message, "allocationPolicy")) + $root.google.cloud.batch.v1alpha.AllocationPolicy.encode(message.allocationPolicy, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.taskEnvironments != null && message.taskEnvironments.length) + for (var i = 0; i < message.taskEnvironments.length; ++i) + $root.google.cloud.batch.v1alpha.Environment.encode(message.taskEnvironments[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.taskCountPerNode != null && Object.hasOwnProperty.call(message, "taskCountPerNode")) + writer.uint32(/* id 10, wireType 0 =*/80).int64(message.taskCountPerNode); + if (message.requireHostsFile != null && Object.hasOwnProperty.call(message, "requireHostsFile")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.requireHostsFile); + if (message.permissiveSsh != null && Object.hasOwnProperty.call(message, "permissiveSsh")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.permissiveSsh); + if (message.runAsNonRoot != null && Object.hasOwnProperty.call(message, "runAsNonRoot")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.runAsNonRoot); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + $root.google.cloud.batch.v1alpha.ServiceAccount.encode(message.serviceAccount, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TaskGroup message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @static + * @param {google.cloud.batch.v1alpha.ITaskGroup} message TaskGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TaskGroup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.TaskGroup} TaskGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskGroup.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.TaskGroup(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.taskSpec = $root.google.cloud.batch.v1alpha.TaskSpec.decode(reader, reader.uint32()); + break; + } + case 4: { + message.taskCount = reader.int64(); + break; + } + case 5: { + message.parallelism = reader.int64(); + break; + } + case 6: { + message.schedulingPolicy = reader.int32(); + break; + } + case 7: { + message.allocationPolicy = $root.google.cloud.batch.v1alpha.AllocationPolicy.decode(reader, reader.uint32()); + break; + } + case 8: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 9: { + if (!(message.taskEnvironments && message.taskEnvironments.length)) + message.taskEnvironments = []; + message.taskEnvironments.push($root.google.cloud.batch.v1alpha.Environment.decode(reader, reader.uint32())); + break; + } + case 10: { + message.taskCountPerNode = reader.int64(); + break; + } + case 11: { + message.requireHostsFile = reader.bool(); + break; + } + case 12: { + message.permissiveSsh = reader.bool(); + break; + } + case 14: { + message.runAsNonRoot = reader.bool(); + break; + } + case 15: { + message.serviceAccount = $root.google.cloud.batch.v1alpha.ServiceAccount.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TaskGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.TaskGroup} TaskGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TaskGroup message. + * @function verify + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TaskGroup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.taskSpec != null && message.hasOwnProperty("taskSpec")) { + var error = $root.google.cloud.batch.v1alpha.TaskSpec.verify(message.taskSpec); + if (error) + return "taskSpec." + error; + } + if (message.taskCount != null && message.hasOwnProperty("taskCount")) + if (!$util.isInteger(message.taskCount) && !(message.taskCount && $util.isInteger(message.taskCount.low) && $util.isInteger(message.taskCount.high))) + return "taskCount: integer|Long expected"; + if (message.parallelism != null && message.hasOwnProperty("parallelism")) + if (!$util.isInteger(message.parallelism) && !(message.parallelism && $util.isInteger(message.parallelism.low) && $util.isInteger(message.parallelism.high))) + return "parallelism: integer|Long expected"; + if (message.schedulingPolicy != null && message.hasOwnProperty("schedulingPolicy")) + switch (message.schedulingPolicy) { + default: + return "schedulingPolicy: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.allocationPolicy != null && message.hasOwnProperty("allocationPolicy")) { + var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.verify(message.allocationPolicy); + if (error) + return "allocationPolicy." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.taskEnvironments != null && message.hasOwnProperty("taskEnvironments")) { + if (!Array.isArray(message.taskEnvironments)) + return "taskEnvironments: array expected"; + for (var i = 0; i < message.taskEnvironments.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.Environment.verify(message.taskEnvironments[i]); + if (error) + return "taskEnvironments." + error; + } + } + if (message.taskCountPerNode != null && message.hasOwnProperty("taskCountPerNode")) + if (!$util.isInteger(message.taskCountPerNode) && !(message.taskCountPerNode && $util.isInteger(message.taskCountPerNode.low) && $util.isInteger(message.taskCountPerNode.high))) + return "taskCountPerNode: integer|Long expected"; + if (message.requireHostsFile != null && message.hasOwnProperty("requireHostsFile")) + if (typeof message.requireHostsFile !== "boolean") + return "requireHostsFile: boolean expected"; + if (message.permissiveSsh != null && message.hasOwnProperty("permissiveSsh")) + if (typeof message.permissiveSsh !== "boolean") + return "permissiveSsh: boolean expected"; + if (message.runAsNonRoot != null && message.hasOwnProperty("runAsNonRoot")) + if (typeof message.runAsNonRoot !== "boolean") + return "runAsNonRoot: boolean expected"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) { + var error = $root.google.cloud.batch.v1alpha.ServiceAccount.verify(message.serviceAccount); + if (error) + return "serviceAccount." + error; + } + return null; + }; + + /** + * Creates a TaskGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.TaskGroup} TaskGroup + */ + TaskGroup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.TaskGroup) + return object; + var message = new $root.google.cloud.batch.v1alpha.TaskGroup(); + if (object.name != null) + message.name = String(object.name); + if (object.taskSpec != null) { + if (typeof object.taskSpec !== "object") + throw TypeError(".google.cloud.batch.v1alpha.TaskGroup.taskSpec: object expected"); + message.taskSpec = $root.google.cloud.batch.v1alpha.TaskSpec.fromObject(object.taskSpec); + } + if (object.taskCount != null) + if ($util.Long) + (message.taskCount = $util.Long.fromValue(object.taskCount)).unsigned = false; + else if (typeof object.taskCount === "string") + message.taskCount = parseInt(object.taskCount, 10); + else if (typeof object.taskCount === "number") + message.taskCount = object.taskCount; + else if (typeof object.taskCount === "object") + message.taskCount = new $util.LongBits(object.taskCount.low >>> 0, object.taskCount.high >>> 0).toNumber(); + if (object.parallelism != null) + if ($util.Long) + (message.parallelism = $util.Long.fromValue(object.parallelism)).unsigned = false; + else if (typeof object.parallelism === "string") + message.parallelism = parseInt(object.parallelism, 10); + else if (typeof object.parallelism === "number") + message.parallelism = object.parallelism; + else if (typeof object.parallelism === "object") + message.parallelism = new $util.LongBits(object.parallelism.low >>> 0, object.parallelism.high >>> 0).toNumber(); + switch (object.schedulingPolicy) { + default: + if (typeof object.schedulingPolicy === "number") { + message.schedulingPolicy = object.schedulingPolicy; + break; + } + break; + case "SCHEDULING_POLICY_UNSPECIFIED": + case 0: + message.schedulingPolicy = 0; + break; + case "AS_SOON_AS_POSSIBLE": + case 1: + message.schedulingPolicy = 1; + break; + case "IN_ORDER": + case 2: + message.schedulingPolicy = 2; + break; + } + if (object.allocationPolicy != null) { + if (typeof object.allocationPolicy !== "object") + throw TypeError(".google.cloud.batch.v1alpha.TaskGroup.allocationPolicy: object expected"); + message.allocationPolicy = $root.google.cloud.batch.v1alpha.AllocationPolicy.fromObject(object.allocationPolicy); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.batch.v1alpha.TaskGroup.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.taskEnvironments) { + if (!Array.isArray(object.taskEnvironments)) + throw TypeError(".google.cloud.batch.v1alpha.TaskGroup.taskEnvironments: array expected"); + message.taskEnvironments = []; + for (var i = 0; i < object.taskEnvironments.length; ++i) { + if (typeof object.taskEnvironments[i] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.TaskGroup.taskEnvironments: object expected"); + message.taskEnvironments[i] = $root.google.cloud.batch.v1alpha.Environment.fromObject(object.taskEnvironments[i]); + } + } + if (object.taskCountPerNode != null) + if ($util.Long) + (message.taskCountPerNode = $util.Long.fromValue(object.taskCountPerNode)).unsigned = false; + else if (typeof object.taskCountPerNode === "string") + message.taskCountPerNode = parseInt(object.taskCountPerNode, 10); + else if (typeof object.taskCountPerNode === "number") + message.taskCountPerNode = object.taskCountPerNode; + else if (typeof object.taskCountPerNode === "object") + message.taskCountPerNode = new $util.LongBits(object.taskCountPerNode.low >>> 0, object.taskCountPerNode.high >>> 0).toNumber(); + if (object.requireHostsFile != null) + message.requireHostsFile = Boolean(object.requireHostsFile); + if (object.permissiveSsh != null) + message.permissiveSsh = Boolean(object.permissiveSsh); + if (object.runAsNonRoot != null) + message.runAsNonRoot = Boolean(object.runAsNonRoot); + if (object.serviceAccount != null) { + if (typeof object.serviceAccount !== "object") + throw TypeError(".google.cloud.batch.v1alpha.TaskGroup.serviceAccount: object expected"); + message.serviceAccount = $root.google.cloud.batch.v1alpha.ServiceAccount.fromObject(object.serviceAccount); + } + return message; + }; + + /** + * Creates a plain object from a TaskGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @static + * @param {google.cloud.batch.v1alpha.TaskGroup} message TaskGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TaskGroup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.taskEnvironments = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.taskSpec = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.taskCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.taskCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.parallelism = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.parallelism = options.longs === String ? "0" : 0; + object.schedulingPolicy = options.enums === String ? "SCHEDULING_POLICY_UNSPECIFIED" : 0; + object.allocationPolicy = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.taskCountPerNode = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.taskCountPerNode = options.longs === String ? "0" : 0; + object.requireHostsFile = false; + object.permissiveSsh = false; + object.runAsNonRoot = false; + object.serviceAccount = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.taskSpec != null && message.hasOwnProperty("taskSpec")) + object.taskSpec = $root.google.cloud.batch.v1alpha.TaskSpec.toObject(message.taskSpec, options); + if (message.taskCount != null && message.hasOwnProperty("taskCount")) + if (typeof message.taskCount === "number") + object.taskCount = options.longs === String ? String(message.taskCount) : message.taskCount; + else + object.taskCount = options.longs === String ? $util.Long.prototype.toString.call(message.taskCount) : options.longs === Number ? new $util.LongBits(message.taskCount.low >>> 0, message.taskCount.high >>> 0).toNumber() : message.taskCount; + if (message.parallelism != null && message.hasOwnProperty("parallelism")) + if (typeof message.parallelism === "number") + object.parallelism = options.longs === String ? String(message.parallelism) : message.parallelism; + else + object.parallelism = options.longs === String ? $util.Long.prototype.toString.call(message.parallelism) : options.longs === Number ? new $util.LongBits(message.parallelism.low >>> 0, message.parallelism.high >>> 0).toNumber() : message.parallelism; + if (message.schedulingPolicy != null && message.hasOwnProperty("schedulingPolicy")) + object.schedulingPolicy = options.enums === String ? $root.google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy[message.schedulingPolicy] === undefined ? message.schedulingPolicy : $root.google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy[message.schedulingPolicy] : message.schedulingPolicy; + if (message.allocationPolicy != null && message.hasOwnProperty("allocationPolicy")) + object.allocationPolicy = $root.google.cloud.batch.v1alpha.AllocationPolicy.toObject(message.allocationPolicy, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.taskEnvironments && message.taskEnvironments.length) { + object.taskEnvironments = []; + for (var j = 0; j < message.taskEnvironments.length; ++j) + object.taskEnvironments[j] = $root.google.cloud.batch.v1alpha.Environment.toObject(message.taskEnvironments[j], options); + } + if (message.taskCountPerNode != null && message.hasOwnProperty("taskCountPerNode")) + if (typeof message.taskCountPerNode === "number") + object.taskCountPerNode = options.longs === String ? String(message.taskCountPerNode) : message.taskCountPerNode; + else + object.taskCountPerNode = options.longs === String ? $util.Long.prototype.toString.call(message.taskCountPerNode) : options.longs === Number ? new $util.LongBits(message.taskCountPerNode.low >>> 0, message.taskCountPerNode.high >>> 0).toNumber() : message.taskCountPerNode; + if (message.requireHostsFile != null && message.hasOwnProperty("requireHostsFile")) + object.requireHostsFile = message.requireHostsFile; + if (message.permissiveSsh != null && message.hasOwnProperty("permissiveSsh")) + object.permissiveSsh = message.permissiveSsh; + if (message.runAsNonRoot != null && message.hasOwnProperty("runAsNonRoot")) + object.runAsNonRoot = message.runAsNonRoot; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = $root.google.cloud.batch.v1alpha.ServiceAccount.toObject(message.serviceAccount, options); + return object; + }; + + /** + * Converts this TaskGroup to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @instance + * @returns {Object.} JSON object + */ + TaskGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TaskGroup + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TaskGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.TaskGroup"; + }; + + /** + * SchedulingPolicy enum. + * @name google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy + * @enum {number} + * @property {number} SCHEDULING_POLICY_UNSPECIFIED=0 SCHEDULING_POLICY_UNSPECIFIED value + * @property {number} AS_SOON_AS_POSSIBLE=1 AS_SOON_AS_POSSIBLE value + * @property {number} IN_ORDER=2 IN_ORDER value + */ + TaskGroup.SchedulingPolicy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SCHEDULING_POLICY_UNSPECIFIED"] = 0; + values[valuesById[1] = "AS_SOON_AS_POSSIBLE"] = 1; + values[valuesById[2] = "IN_ORDER"] = 2; + return values; + })(); + + return TaskGroup; + })(); + + v1alpha.ServiceAccount = (function() { + + /** + * Properties of a ServiceAccount. + * @memberof google.cloud.batch.v1alpha + * @interface IServiceAccount + * @property {string|null} [email] ServiceAccount email + * @property {Array.|null} [scopes] ServiceAccount scopes + */ + + /** + * Constructs a new ServiceAccount. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a ServiceAccount. + * @implements IServiceAccount + * @constructor + * @param {google.cloud.batch.v1alpha.IServiceAccount=} [properties] Properties to set + */ + function ServiceAccount(properties) { + this.scopes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceAccount email. + * @member {string} email + * @memberof google.cloud.batch.v1alpha.ServiceAccount + * @instance + */ + ServiceAccount.prototype.email = ""; + + /** + * ServiceAccount scopes. + * @member {Array.} scopes + * @memberof google.cloud.batch.v1alpha.ServiceAccount + * @instance + */ + ServiceAccount.prototype.scopes = $util.emptyArray; + + /** + * Creates a new ServiceAccount instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.ServiceAccount + * @static + * @param {google.cloud.batch.v1alpha.IServiceAccount=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.ServiceAccount} ServiceAccount instance + */ + ServiceAccount.create = function create(properties) { + return new ServiceAccount(properties); + }; + + /** + * Encodes the specified ServiceAccount message. Does not implicitly {@link google.cloud.batch.v1alpha.ServiceAccount.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.ServiceAccount + * @static + * @param {google.cloud.batch.v1alpha.IServiceAccount} message ServiceAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAccount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.email != null && Object.hasOwnProperty.call(message, "email")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.email); + if (message.scopes != null && message.scopes.length) + for (var i = 0; i < message.scopes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.scopes[i]); + return writer; + }; + + /** + * Encodes the specified ServiceAccount message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ServiceAccount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.ServiceAccount + * @static + * @param {google.cloud.batch.v1alpha.IServiceAccount} message ServiceAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAccount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceAccount message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.ServiceAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.ServiceAccount} ServiceAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAccount.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ServiceAccount(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.email = reader.string(); + break; + } + case 2: { + if (!(message.scopes && message.scopes.length)) + message.scopes = []; + message.scopes.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceAccount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.ServiceAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.ServiceAccount} ServiceAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAccount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceAccount message. + * @function verify + * @memberof google.cloud.batch.v1alpha.ServiceAccount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceAccount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.email != null && message.hasOwnProperty("email")) + if (!$util.isString(message.email)) + return "email: string expected"; + if (message.scopes != null && message.hasOwnProperty("scopes")) { + if (!Array.isArray(message.scopes)) + return "scopes: array expected"; + for (var i = 0; i < message.scopes.length; ++i) + if (!$util.isString(message.scopes[i])) + return "scopes: string[] expected"; + } + return null; + }; + + /** + * Creates a ServiceAccount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.ServiceAccount + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.ServiceAccount} ServiceAccount + */ + ServiceAccount.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.ServiceAccount) + return object; + var message = new $root.google.cloud.batch.v1alpha.ServiceAccount(); + if (object.email != null) + message.email = String(object.email); + if (object.scopes) { + if (!Array.isArray(object.scopes)) + throw TypeError(".google.cloud.batch.v1alpha.ServiceAccount.scopes: array expected"); + message.scopes = []; + for (var i = 0; i < object.scopes.length; ++i) + message.scopes[i] = String(object.scopes[i]); + } + return message; + }; + + /** + * Creates a plain object from a ServiceAccount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.ServiceAccount + * @static + * @param {google.cloud.batch.v1alpha.ServiceAccount} message ServiceAccount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceAccount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.scopes = []; + if (options.defaults) + object.email = ""; + if (message.email != null && message.hasOwnProperty("email")) + object.email = message.email; + if (message.scopes && message.scopes.length) { + object.scopes = []; + for (var j = 0; j < message.scopes.length; ++j) + object.scopes[j] = message.scopes[j]; + } + return object; + }; + + /** + * Converts this ServiceAccount to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.ServiceAccount + * @instance + * @returns {Object.} JSON object + */ + ServiceAccount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceAccount + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.ServiceAccount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceAccount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.ServiceAccount"; + }; + + return ServiceAccount; + })(); + + v1alpha.ComputeResource = (function() { + + /** + * Properties of a ComputeResource. + * @memberof google.cloud.batch.v1alpha + * @interface IComputeResource + * @property {number|Long|null} [cpuMilli] ComputeResource cpuMilli + * @property {number|Long|null} [memoryMib] ComputeResource memoryMib + * @property {number|Long|null} [gpuCount] ComputeResource gpuCount + * @property {number|Long|null} [bootDiskMib] ComputeResource bootDiskMib + */ + + /** + * Constructs a new ComputeResource. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a ComputeResource. + * @implements IComputeResource + * @constructor + * @param {google.cloud.batch.v1alpha.IComputeResource=} [properties] Properties to set + */ + function ComputeResource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ComputeResource cpuMilli. + * @member {number|Long} cpuMilli + * @memberof google.cloud.batch.v1alpha.ComputeResource + * @instance + */ + ComputeResource.prototype.cpuMilli = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ComputeResource memoryMib. + * @member {number|Long} memoryMib + * @memberof google.cloud.batch.v1alpha.ComputeResource + * @instance + */ + ComputeResource.prototype.memoryMib = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ComputeResource gpuCount. + * @member {number|Long} gpuCount + * @memberof google.cloud.batch.v1alpha.ComputeResource + * @instance + */ + ComputeResource.prototype.gpuCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ComputeResource bootDiskMib. + * @member {number|Long} bootDiskMib + * @memberof google.cloud.batch.v1alpha.ComputeResource + * @instance + */ + ComputeResource.prototype.bootDiskMib = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ComputeResource instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.ComputeResource + * @static + * @param {google.cloud.batch.v1alpha.IComputeResource=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.ComputeResource} ComputeResource instance + */ + ComputeResource.create = function create(properties) { + return new ComputeResource(properties); + }; + + /** + * Encodes the specified ComputeResource message. Does not implicitly {@link google.cloud.batch.v1alpha.ComputeResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.ComputeResource + * @static + * @param {google.cloud.batch.v1alpha.IComputeResource} message ComputeResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cpuMilli != null && Object.hasOwnProperty.call(message, "cpuMilli")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.cpuMilli); + if (message.memoryMib != null && Object.hasOwnProperty.call(message, "memoryMib")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.memoryMib); + if (message.gpuCount != null && Object.hasOwnProperty.call(message, "gpuCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.gpuCount); + if (message.bootDiskMib != null && Object.hasOwnProperty.call(message, "bootDiskMib")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.bootDiskMib); + return writer; + }; + + /** + * Encodes the specified ComputeResource message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ComputeResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.ComputeResource + * @static + * @param {google.cloud.batch.v1alpha.IComputeResource} message ComputeResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ComputeResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.ComputeResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.ComputeResource} ComputeResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeResource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ComputeResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cpuMilli = reader.int64(); + break; + } + case 2: { + message.memoryMib = reader.int64(); + break; + } + case 3: { + message.gpuCount = reader.int64(); + break; + } + case 4: { + message.bootDiskMib = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ComputeResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.ComputeResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.ComputeResource} ComputeResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ComputeResource message. + * @function verify + * @memberof google.cloud.batch.v1alpha.ComputeResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ComputeResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cpuMilli != null && message.hasOwnProperty("cpuMilli")) + if (!$util.isInteger(message.cpuMilli) && !(message.cpuMilli && $util.isInteger(message.cpuMilli.low) && $util.isInteger(message.cpuMilli.high))) + return "cpuMilli: integer|Long expected"; + if (message.memoryMib != null && message.hasOwnProperty("memoryMib")) + if (!$util.isInteger(message.memoryMib) && !(message.memoryMib && $util.isInteger(message.memoryMib.low) && $util.isInteger(message.memoryMib.high))) + return "memoryMib: integer|Long expected"; + if (message.gpuCount != null && message.hasOwnProperty("gpuCount")) + if (!$util.isInteger(message.gpuCount) && !(message.gpuCount && $util.isInteger(message.gpuCount.low) && $util.isInteger(message.gpuCount.high))) + return "gpuCount: integer|Long expected"; + if (message.bootDiskMib != null && message.hasOwnProperty("bootDiskMib")) + if (!$util.isInteger(message.bootDiskMib) && !(message.bootDiskMib && $util.isInteger(message.bootDiskMib.low) && $util.isInteger(message.bootDiskMib.high))) + return "bootDiskMib: integer|Long expected"; + return null; + }; + + /** + * Creates a ComputeResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.ComputeResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.ComputeResource} ComputeResource + */ + ComputeResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.ComputeResource) + return object; + var message = new $root.google.cloud.batch.v1alpha.ComputeResource(); + if (object.cpuMilli != null) + if ($util.Long) + (message.cpuMilli = $util.Long.fromValue(object.cpuMilli)).unsigned = false; + else if (typeof object.cpuMilli === "string") + message.cpuMilli = parseInt(object.cpuMilli, 10); + else if (typeof object.cpuMilli === "number") + message.cpuMilli = object.cpuMilli; + else if (typeof object.cpuMilli === "object") + message.cpuMilli = new $util.LongBits(object.cpuMilli.low >>> 0, object.cpuMilli.high >>> 0).toNumber(); + if (object.memoryMib != null) + if ($util.Long) + (message.memoryMib = $util.Long.fromValue(object.memoryMib)).unsigned = false; + else if (typeof object.memoryMib === "string") + message.memoryMib = parseInt(object.memoryMib, 10); + else if (typeof object.memoryMib === "number") + message.memoryMib = object.memoryMib; + else if (typeof object.memoryMib === "object") + message.memoryMib = new $util.LongBits(object.memoryMib.low >>> 0, object.memoryMib.high >>> 0).toNumber(); + if (object.gpuCount != null) + if ($util.Long) + (message.gpuCount = $util.Long.fromValue(object.gpuCount)).unsigned = false; + else if (typeof object.gpuCount === "string") + message.gpuCount = parseInt(object.gpuCount, 10); + else if (typeof object.gpuCount === "number") + message.gpuCount = object.gpuCount; + else if (typeof object.gpuCount === "object") + message.gpuCount = new $util.LongBits(object.gpuCount.low >>> 0, object.gpuCount.high >>> 0).toNumber(); + if (object.bootDiskMib != null) + if ($util.Long) + (message.bootDiskMib = $util.Long.fromValue(object.bootDiskMib)).unsigned = false; + else if (typeof object.bootDiskMib === "string") + message.bootDiskMib = parseInt(object.bootDiskMib, 10); + else if (typeof object.bootDiskMib === "number") + message.bootDiskMib = object.bootDiskMib; + else if (typeof object.bootDiskMib === "object") + message.bootDiskMib = new $util.LongBits(object.bootDiskMib.low >>> 0, object.bootDiskMib.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ComputeResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.ComputeResource + * @static + * @param {google.cloud.batch.v1alpha.ComputeResource} message ComputeResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ComputeResource.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.cpuMilli = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.cpuMilli = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.memoryMib = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.memoryMib = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.gpuCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.gpuCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bootDiskMib = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bootDiskMib = options.longs === String ? "0" : 0; + } + if (message.cpuMilli != null && message.hasOwnProperty("cpuMilli")) + if (typeof message.cpuMilli === "number") + object.cpuMilli = options.longs === String ? String(message.cpuMilli) : message.cpuMilli; + else + object.cpuMilli = options.longs === String ? $util.Long.prototype.toString.call(message.cpuMilli) : options.longs === Number ? new $util.LongBits(message.cpuMilli.low >>> 0, message.cpuMilli.high >>> 0).toNumber() : message.cpuMilli; + if (message.memoryMib != null && message.hasOwnProperty("memoryMib")) + if (typeof message.memoryMib === "number") + object.memoryMib = options.longs === String ? String(message.memoryMib) : message.memoryMib; + else + object.memoryMib = options.longs === String ? $util.Long.prototype.toString.call(message.memoryMib) : options.longs === Number ? new $util.LongBits(message.memoryMib.low >>> 0, message.memoryMib.high >>> 0).toNumber() : message.memoryMib; + if (message.gpuCount != null && message.hasOwnProperty("gpuCount")) + if (typeof message.gpuCount === "number") + object.gpuCount = options.longs === String ? String(message.gpuCount) : message.gpuCount; + else + object.gpuCount = options.longs === String ? $util.Long.prototype.toString.call(message.gpuCount) : options.longs === Number ? new $util.LongBits(message.gpuCount.low >>> 0, message.gpuCount.high >>> 0).toNumber() : message.gpuCount; + if (message.bootDiskMib != null && message.hasOwnProperty("bootDiskMib")) + if (typeof message.bootDiskMib === "number") + object.bootDiskMib = options.longs === String ? String(message.bootDiskMib) : message.bootDiskMib; + else + object.bootDiskMib = options.longs === String ? $util.Long.prototype.toString.call(message.bootDiskMib) : options.longs === Number ? new $util.LongBits(message.bootDiskMib.low >>> 0, message.bootDiskMib.high >>> 0).toNumber() : message.bootDiskMib; + return object; + }; + + /** + * Converts this ComputeResource to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.ComputeResource + * @instance + * @returns {Object.} JSON object + */ + ComputeResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ComputeResource + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.ComputeResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ComputeResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.ComputeResource"; + }; + + return ComputeResource; + })(); + + v1alpha.StatusEvent = (function() { + + /** + * Properties of a StatusEvent. + * @memberof google.cloud.batch.v1alpha + * @interface IStatusEvent + * @property {string|null} [type] StatusEvent type + * @property {string|null} [description] StatusEvent description + * @property {google.protobuf.ITimestamp|null} [eventTime] StatusEvent eventTime + * @property {google.cloud.batch.v1alpha.ITaskExecution|null} [taskExecution] StatusEvent taskExecution + * @property {google.cloud.batch.v1alpha.TaskStatus.State|null} [taskState] StatusEvent taskState + */ + + /** + * Constructs a new StatusEvent. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a StatusEvent. + * @implements IStatusEvent + * @constructor + * @param {google.cloud.batch.v1alpha.IStatusEvent=} [properties] Properties to set + */ + function StatusEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StatusEvent type. + * @member {string} type + * @memberof google.cloud.batch.v1alpha.StatusEvent + * @instance + */ + StatusEvent.prototype.type = ""; + + /** + * StatusEvent description. + * @member {string} description + * @memberof google.cloud.batch.v1alpha.StatusEvent + * @instance + */ + StatusEvent.prototype.description = ""; + + /** + * StatusEvent eventTime. + * @member {google.protobuf.ITimestamp|null|undefined} eventTime + * @memberof google.cloud.batch.v1alpha.StatusEvent + * @instance + */ + StatusEvent.prototype.eventTime = null; + + /** + * StatusEvent taskExecution. + * @member {google.cloud.batch.v1alpha.ITaskExecution|null|undefined} taskExecution + * @memberof google.cloud.batch.v1alpha.StatusEvent + * @instance + */ + StatusEvent.prototype.taskExecution = null; + + /** + * StatusEvent taskState. + * @member {google.cloud.batch.v1alpha.TaskStatus.State} taskState + * @memberof google.cloud.batch.v1alpha.StatusEvent + * @instance + */ + StatusEvent.prototype.taskState = 0; + + /** + * Creates a new StatusEvent instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.StatusEvent + * @static + * @param {google.cloud.batch.v1alpha.IStatusEvent=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.StatusEvent} StatusEvent instance + */ + StatusEvent.create = function create(properties) { + return new StatusEvent(properties); + }; + + /** + * Encodes the specified StatusEvent message. Does not implicitly {@link google.cloud.batch.v1alpha.StatusEvent.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.StatusEvent + * @static + * @param {google.cloud.batch.v1alpha.IStatusEvent} message StatusEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StatusEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); + if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) + $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.taskExecution != null && Object.hasOwnProperty.call(message, "taskExecution")) + $root.google.cloud.batch.v1alpha.TaskExecution.encode(message.taskExecution, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.taskState != null && Object.hasOwnProperty.call(message, "taskState")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.taskState); + return writer; + }; + + /** + * Encodes the specified StatusEvent message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.StatusEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.StatusEvent + * @static + * @param {google.cloud.batch.v1alpha.IStatusEvent} message StatusEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StatusEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StatusEvent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.StatusEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.StatusEvent} StatusEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StatusEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.StatusEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.type = reader.string(); + break; + } + case 1: { + message.description = reader.string(); + break; + } + case 2: { + message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.taskExecution = $root.google.cloud.batch.v1alpha.TaskExecution.decode(reader, reader.uint32()); + break; + } + case 5: { + message.taskState = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StatusEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.StatusEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.StatusEvent} StatusEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StatusEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StatusEvent message. + * @function verify + * @memberof google.cloud.batch.v1alpha.StatusEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StatusEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.eventTime != null && message.hasOwnProperty("eventTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.eventTime); + if (error) + return "eventTime." + error; + } + if (message.taskExecution != null && message.hasOwnProperty("taskExecution")) { + var error = $root.google.cloud.batch.v1alpha.TaskExecution.verify(message.taskExecution); + if (error) + return "taskExecution." + error; + } + if (message.taskState != null && message.hasOwnProperty("taskState")) + switch (message.taskState) { + default: + return "taskState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + return null; + }; + + /** + * Creates a StatusEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.StatusEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.StatusEvent} StatusEvent + */ + StatusEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.StatusEvent) + return object; + var message = new $root.google.cloud.batch.v1alpha.StatusEvent(); + if (object.type != null) + message.type = String(object.type); + if (object.description != null) + message.description = String(object.description); + if (object.eventTime != null) { + if (typeof object.eventTime !== "object") + throw TypeError(".google.cloud.batch.v1alpha.StatusEvent.eventTime: object expected"); + message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); + } + if (object.taskExecution != null) { + if (typeof object.taskExecution !== "object") + throw TypeError(".google.cloud.batch.v1alpha.StatusEvent.taskExecution: object expected"); + message.taskExecution = $root.google.cloud.batch.v1alpha.TaskExecution.fromObject(object.taskExecution); + } + switch (object.taskState) { + default: + if (typeof object.taskState === "number") { + message.taskState = object.taskState; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.taskState = 0; + break; + case "PENDING": + case 1: + message.taskState = 1; + break; + case "ASSIGNED": + case 2: + message.taskState = 2; + break; + case "RUNNING": + case 3: + message.taskState = 3; + break; + case "FAILED": + case 4: + message.taskState = 4; + break; + case "SUCCEEDED": + case 5: + message.taskState = 5; + break; + case "UNEXECUTED": + case 6: + message.taskState = 6; + break; + } + return message; + }; + + /** + * Creates a plain object from a StatusEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.StatusEvent + * @static + * @param {google.cloud.batch.v1alpha.StatusEvent} message StatusEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StatusEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.description = ""; + object.eventTime = null; + object.type = ""; + object.taskExecution = null; + object.taskState = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.eventTime != null && message.hasOwnProperty("eventTime")) + object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.taskExecution != null && message.hasOwnProperty("taskExecution")) + object.taskExecution = $root.google.cloud.batch.v1alpha.TaskExecution.toObject(message.taskExecution, options); + if (message.taskState != null && message.hasOwnProperty("taskState")) + object.taskState = options.enums === String ? $root.google.cloud.batch.v1alpha.TaskStatus.State[message.taskState] === undefined ? message.taskState : $root.google.cloud.batch.v1alpha.TaskStatus.State[message.taskState] : message.taskState; + return object; + }; + + /** + * Converts this StatusEvent to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.StatusEvent + * @instance + * @returns {Object.} JSON object + */ + StatusEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StatusEvent + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.StatusEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StatusEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.StatusEvent"; + }; + + return StatusEvent; + })(); + + v1alpha.TaskExecution = (function() { + + /** + * Properties of a TaskExecution. + * @memberof google.cloud.batch.v1alpha + * @interface ITaskExecution + * @property {number|null} [exitCode] TaskExecution exitCode + * @property {string|null} [stderrSnippet] TaskExecution stderrSnippet + */ + + /** + * Constructs a new TaskExecution. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a TaskExecution. + * @implements ITaskExecution + * @constructor + * @param {google.cloud.batch.v1alpha.ITaskExecution=} [properties] Properties to set + */ + function TaskExecution(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TaskExecution exitCode. + * @member {number} exitCode + * @memberof google.cloud.batch.v1alpha.TaskExecution + * @instance + */ + TaskExecution.prototype.exitCode = 0; + + /** + * TaskExecution stderrSnippet. + * @member {string} stderrSnippet + * @memberof google.cloud.batch.v1alpha.TaskExecution + * @instance + */ + TaskExecution.prototype.stderrSnippet = ""; + + /** + * Creates a new TaskExecution instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.TaskExecution + * @static + * @param {google.cloud.batch.v1alpha.ITaskExecution=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.TaskExecution} TaskExecution instance + */ + TaskExecution.create = function create(properties) { + return new TaskExecution(properties); + }; + + /** + * Encodes the specified TaskExecution message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskExecution.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.TaskExecution + * @static + * @param {google.cloud.batch.v1alpha.ITaskExecution} message TaskExecution message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskExecution.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.exitCode != null && Object.hasOwnProperty.call(message, "exitCode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.exitCode); + if (message.stderrSnippet != null && Object.hasOwnProperty.call(message, "stderrSnippet")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.stderrSnippet); + return writer; + }; + + /** + * Encodes the specified TaskExecution message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskExecution.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.TaskExecution + * @static + * @param {google.cloud.batch.v1alpha.ITaskExecution} message TaskExecution message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskExecution.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TaskExecution message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.TaskExecution + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.TaskExecution} TaskExecution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskExecution.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.TaskExecution(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.exitCode = reader.int32(); + break; + } + case 2: { + message.stderrSnippet = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TaskExecution message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.TaskExecution + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.TaskExecution} TaskExecution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskExecution.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TaskExecution message. + * @function verify + * @memberof google.cloud.batch.v1alpha.TaskExecution + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TaskExecution.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.exitCode != null && message.hasOwnProperty("exitCode")) + if (!$util.isInteger(message.exitCode)) + return "exitCode: integer expected"; + if (message.stderrSnippet != null && message.hasOwnProperty("stderrSnippet")) + if (!$util.isString(message.stderrSnippet)) + return "stderrSnippet: string expected"; + return null; + }; + + /** + * Creates a TaskExecution message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.TaskExecution + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.TaskExecution} TaskExecution + */ + TaskExecution.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.TaskExecution) + return object; + var message = new $root.google.cloud.batch.v1alpha.TaskExecution(); + if (object.exitCode != null) + message.exitCode = object.exitCode | 0; + if (object.stderrSnippet != null) + message.stderrSnippet = String(object.stderrSnippet); + return message; + }; + + /** + * Creates a plain object from a TaskExecution message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.TaskExecution + * @static + * @param {google.cloud.batch.v1alpha.TaskExecution} message TaskExecution + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TaskExecution.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.exitCode = 0; + object.stderrSnippet = ""; + } + if (message.exitCode != null && message.hasOwnProperty("exitCode")) + object.exitCode = message.exitCode; + if (message.stderrSnippet != null && message.hasOwnProperty("stderrSnippet")) + object.stderrSnippet = message.stderrSnippet; + return object; + }; + + /** + * Converts this TaskExecution to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.TaskExecution + * @instance + * @returns {Object.} JSON object + */ + TaskExecution.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TaskExecution + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.TaskExecution + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TaskExecution.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.TaskExecution"; + }; + + return TaskExecution; + })(); + + v1alpha.TaskStatus = (function() { + + /** + * Properties of a TaskStatus. + * @memberof google.cloud.batch.v1alpha + * @interface ITaskStatus + * @property {google.cloud.batch.v1alpha.TaskStatus.State|null} [state] TaskStatus state + * @property {Array.|null} [statusEvents] TaskStatus statusEvents + * @property {google.cloud.batch.v1alpha.ITaskResourceUsage|null} [resourceUsage] TaskStatus resourceUsage + */ + + /** + * Constructs a new TaskStatus. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a TaskStatus. + * @implements ITaskStatus + * @constructor + * @param {google.cloud.batch.v1alpha.ITaskStatus=} [properties] Properties to set + */ + function TaskStatus(properties) { + this.statusEvents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TaskStatus state. + * @member {google.cloud.batch.v1alpha.TaskStatus.State} state + * @memberof google.cloud.batch.v1alpha.TaskStatus + * @instance + */ + TaskStatus.prototype.state = 0; + + /** + * TaskStatus statusEvents. + * @member {Array.} statusEvents + * @memberof google.cloud.batch.v1alpha.TaskStatus + * @instance + */ + TaskStatus.prototype.statusEvents = $util.emptyArray; + + /** + * TaskStatus resourceUsage. + * @member {google.cloud.batch.v1alpha.ITaskResourceUsage|null|undefined} resourceUsage + * @memberof google.cloud.batch.v1alpha.TaskStatus + * @instance + */ + TaskStatus.prototype.resourceUsage = null; + + /** + * Creates a new TaskStatus instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.TaskStatus + * @static + * @param {google.cloud.batch.v1alpha.ITaskStatus=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.TaskStatus} TaskStatus instance + */ + TaskStatus.create = function create(properties) { + return new TaskStatus(properties); + }; + + /** + * Encodes the specified TaskStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.TaskStatus + * @static + * @param {google.cloud.batch.v1alpha.ITaskStatus} message TaskStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskStatus.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); + if (message.statusEvents != null && message.statusEvents.length) + for (var i = 0; i < message.statusEvents.length; ++i) + $root.google.cloud.batch.v1alpha.StatusEvent.encode(message.statusEvents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resourceUsage != null && Object.hasOwnProperty.call(message, "resourceUsage")) + $root.google.cloud.batch.v1alpha.TaskResourceUsage.encode(message.resourceUsage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TaskStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.TaskStatus + * @static + * @param {google.cloud.batch.v1alpha.ITaskStatus} message TaskStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TaskStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.TaskStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.TaskStatus} TaskStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.TaskStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + if (!(message.statusEvents && message.statusEvents.length)) + message.statusEvents = []; + message.statusEvents.push($root.google.cloud.batch.v1alpha.StatusEvent.decode(reader, reader.uint32())); + break; + } + case 3: { + message.resourceUsage = $root.google.cloud.batch.v1alpha.TaskResourceUsage.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TaskStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.TaskStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.TaskStatus} TaskStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TaskStatus message. + * @function verify + * @memberof google.cloud.batch.v1alpha.TaskStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TaskStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.statusEvents != null && message.hasOwnProperty("statusEvents")) { + if (!Array.isArray(message.statusEvents)) + return "statusEvents: array expected"; + for (var i = 0; i < message.statusEvents.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.StatusEvent.verify(message.statusEvents[i]); + if (error) + return "statusEvents." + error; + } + } + if (message.resourceUsage != null && message.hasOwnProperty("resourceUsage")) { + var error = $root.google.cloud.batch.v1alpha.TaskResourceUsage.verify(message.resourceUsage); + if (error) + return "resourceUsage." + error; + } + return null; + }; + + /** + * Creates a TaskStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.TaskStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.TaskStatus} TaskStatus + */ + TaskStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.TaskStatus) + return object; + var message = new $root.google.cloud.batch.v1alpha.TaskStatus(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING": + case 1: + message.state = 1; + break; + case "ASSIGNED": + case 2: + message.state = 2; + break; + case "RUNNING": + case 3: + message.state = 3; + break; + case "FAILED": + case 4: + message.state = 4; + break; + case "SUCCEEDED": + case 5: + message.state = 5; + break; + case "UNEXECUTED": + case 6: + message.state = 6; + break; + } + if (object.statusEvents) { + if (!Array.isArray(object.statusEvents)) + throw TypeError(".google.cloud.batch.v1alpha.TaskStatus.statusEvents: array expected"); + message.statusEvents = []; + for (var i = 0; i < object.statusEvents.length; ++i) { + if (typeof object.statusEvents[i] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.TaskStatus.statusEvents: object expected"); + message.statusEvents[i] = $root.google.cloud.batch.v1alpha.StatusEvent.fromObject(object.statusEvents[i]); + } + } + if (object.resourceUsage != null) { + if (typeof object.resourceUsage !== "object") + throw TypeError(".google.cloud.batch.v1alpha.TaskStatus.resourceUsage: object expected"); + message.resourceUsage = $root.google.cloud.batch.v1alpha.TaskResourceUsage.fromObject(object.resourceUsage); + } + return message; + }; + + /** + * Creates a plain object from a TaskStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.TaskStatus + * @static + * @param {google.cloud.batch.v1alpha.TaskStatus} message TaskStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TaskStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.statusEvents = []; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.resourceUsage = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.batch.v1alpha.TaskStatus.State[message.state] === undefined ? message.state : $root.google.cloud.batch.v1alpha.TaskStatus.State[message.state] : message.state; + if (message.statusEvents && message.statusEvents.length) { + object.statusEvents = []; + for (var j = 0; j < message.statusEvents.length; ++j) + object.statusEvents[j] = $root.google.cloud.batch.v1alpha.StatusEvent.toObject(message.statusEvents[j], options); + } + if (message.resourceUsage != null && message.hasOwnProperty("resourceUsage")) + object.resourceUsage = $root.google.cloud.batch.v1alpha.TaskResourceUsage.toObject(message.resourceUsage, options); + return object; + }; + + /** + * Converts this TaskStatus to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.TaskStatus + * @instance + * @returns {Object.} JSON object + */ + TaskStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TaskStatus + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.TaskStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TaskStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.TaskStatus"; + }; + + /** + * State enum. + * @name google.cloud.batch.v1alpha.TaskStatus.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PENDING=1 PENDING value + * @property {number} ASSIGNED=2 ASSIGNED value + * @property {number} RUNNING=3 RUNNING value + * @property {number} FAILED=4 FAILED value + * @property {number} SUCCEEDED=5 SUCCEEDED value + * @property {number} UNEXECUTED=6 UNEXECUTED value + */ + TaskStatus.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "ASSIGNED"] = 2; + values[valuesById[3] = "RUNNING"] = 3; + values[valuesById[4] = "FAILED"] = 4; + values[valuesById[5] = "SUCCEEDED"] = 5; + values[valuesById[6] = "UNEXECUTED"] = 6; + return values; + })(); + + return TaskStatus; + })(); + + v1alpha.TaskResourceUsage = (function() { + + /** + * Properties of a TaskResourceUsage. + * @memberof google.cloud.batch.v1alpha + * @interface ITaskResourceUsage + * @property {number|null} [coreHours] TaskResourceUsage coreHours + */ + + /** + * Constructs a new TaskResourceUsage. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a TaskResourceUsage. + * @implements ITaskResourceUsage + * @constructor + * @param {google.cloud.batch.v1alpha.ITaskResourceUsage=} [properties] Properties to set + */ + function TaskResourceUsage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TaskResourceUsage coreHours. + * @member {number} coreHours + * @memberof google.cloud.batch.v1alpha.TaskResourceUsage + * @instance + */ + TaskResourceUsage.prototype.coreHours = 0; + + /** + * Creates a new TaskResourceUsage instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.TaskResourceUsage + * @static + * @param {google.cloud.batch.v1alpha.ITaskResourceUsage=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.TaskResourceUsage} TaskResourceUsage instance + */ + TaskResourceUsage.create = function create(properties) { + return new TaskResourceUsage(properties); + }; + + /** + * Encodes the specified TaskResourceUsage message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskResourceUsage.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.TaskResourceUsage + * @static + * @param {google.cloud.batch.v1alpha.ITaskResourceUsage} message TaskResourceUsage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskResourceUsage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.coreHours != null && Object.hasOwnProperty.call(message, "coreHours")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.coreHours); + return writer; + }; + + /** + * Encodes the specified TaskResourceUsage message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskResourceUsage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.TaskResourceUsage + * @static + * @param {google.cloud.batch.v1alpha.ITaskResourceUsage} message TaskResourceUsage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskResourceUsage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TaskResourceUsage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.TaskResourceUsage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.TaskResourceUsage} TaskResourceUsage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskResourceUsage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.TaskResourceUsage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.coreHours = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TaskResourceUsage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.TaskResourceUsage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.TaskResourceUsage} TaskResourceUsage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskResourceUsage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TaskResourceUsage message. + * @function verify + * @memberof google.cloud.batch.v1alpha.TaskResourceUsage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TaskResourceUsage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.coreHours != null && message.hasOwnProperty("coreHours")) + if (typeof message.coreHours !== "number") + return "coreHours: number expected"; + return null; + }; + + /** + * Creates a TaskResourceUsage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.TaskResourceUsage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.TaskResourceUsage} TaskResourceUsage + */ + TaskResourceUsage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.TaskResourceUsage) + return object; + var message = new $root.google.cloud.batch.v1alpha.TaskResourceUsage(); + if (object.coreHours != null) + message.coreHours = Number(object.coreHours); + return message; + }; + + /** + * Creates a plain object from a TaskResourceUsage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.TaskResourceUsage + * @static + * @param {google.cloud.batch.v1alpha.TaskResourceUsage} message TaskResourceUsage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TaskResourceUsage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.coreHours = 0; + if (message.coreHours != null && message.hasOwnProperty("coreHours")) + object.coreHours = options.json && !isFinite(message.coreHours) ? String(message.coreHours) : message.coreHours; + return object; + }; + + /** + * Converts this TaskResourceUsage to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.TaskResourceUsage + * @instance + * @returns {Object.} JSON object + */ + TaskResourceUsage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TaskResourceUsage + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.TaskResourceUsage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TaskResourceUsage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.TaskResourceUsage"; + }; + + return TaskResourceUsage; + })(); + + v1alpha.Runnable = (function() { + + /** + * Properties of a Runnable. + * @memberof google.cloud.batch.v1alpha + * @interface IRunnable + * @property {google.cloud.batch.v1alpha.Runnable.IContainer|null} [container] Runnable container + * @property {google.cloud.batch.v1alpha.Runnable.IScript|null} [script] Runnable script + * @property {google.cloud.batch.v1alpha.Runnable.IBarrier|null} [barrier] Runnable barrier + * @property {string|null} [displayName] Runnable displayName + * @property {boolean|null} [ignoreExitStatus] Runnable ignoreExitStatus + * @property {boolean|null} [background] Runnable background + * @property {boolean|null} [alwaysRun] Runnable alwaysRun + * @property {google.cloud.batch.v1alpha.IEnvironment|null} [environment] Runnable environment + * @property {google.protobuf.IDuration|null} [timeout] Runnable timeout + * @property {Object.|null} [labels] Runnable labels + */ + + /** + * Constructs a new Runnable. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a Runnable. + * @implements IRunnable + * @constructor + * @param {google.cloud.batch.v1alpha.IRunnable=} [properties] Properties to set + */ + function Runnable(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Runnable container. + * @member {google.cloud.batch.v1alpha.Runnable.IContainer|null|undefined} container + * @memberof google.cloud.batch.v1alpha.Runnable + * @instance + */ + Runnable.prototype.container = null; + + /** + * Runnable script. + * @member {google.cloud.batch.v1alpha.Runnable.IScript|null|undefined} script + * @memberof google.cloud.batch.v1alpha.Runnable + * @instance + */ + Runnable.prototype.script = null; + + /** + * Runnable barrier. + * @member {google.cloud.batch.v1alpha.Runnable.IBarrier|null|undefined} barrier + * @memberof google.cloud.batch.v1alpha.Runnable + * @instance + */ + Runnable.prototype.barrier = null; + + /** + * Runnable displayName. + * @member {string} displayName + * @memberof google.cloud.batch.v1alpha.Runnable + * @instance + */ + Runnable.prototype.displayName = ""; + + /** + * Runnable ignoreExitStatus. + * @member {boolean} ignoreExitStatus + * @memberof google.cloud.batch.v1alpha.Runnable + * @instance + */ + Runnable.prototype.ignoreExitStatus = false; + + /** + * Runnable background. + * @member {boolean} background + * @memberof google.cloud.batch.v1alpha.Runnable + * @instance + */ + Runnable.prototype.background = false; + + /** + * Runnable alwaysRun. + * @member {boolean} alwaysRun + * @memberof google.cloud.batch.v1alpha.Runnable + * @instance + */ + Runnable.prototype.alwaysRun = false; + + /** + * Runnable environment. + * @member {google.cloud.batch.v1alpha.IEnvironment|null|undefined} environment + * @memberof google.cloud.batch.v1alpha.Runnable + * @instance + */ + Runnable.prototype.environment = null; + + /** + * Runnable timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.cloud.batch.v1alpha.Runnable + * @instance + */ + Runnable.prototype.timeout = null; + + /** + * Runnable labels. + * @member {Object.} labels + * @memberof google.cloud.batch.v1alpha.Runnable + * @instance + */ + Runnable.prototype.labels = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Runnable executable. + * @member {"container"|"script"|"barrier"|undefined} executable + * @memberof google.cloud.batch.v1alpha.Runnable + * @instance + */ + Object.defineProperty(Runnable.prototype, "executable", { + get: $util.oneOfGetter($oneOfFields = ["container", "script", "barrier"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Runnable instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.Runnable + * @static + * @param {google.cloud.batch.v1alpha.IRunnable=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.Runnable} Runnable instance + */ + Runnable.create = function create(properties) { + return new Runnable(properties); + }; + + /** + * Encodes the specified Runnable message. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.Runnable + * @static + * @param {google.cloud.batch.v1alpha.IRunnable} message Runnable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Runnable.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.container != null && Object.hasOwnProperty.call(message, "container")) + $root.google.cloud.batch.v1alpha.Runnable.Container.encode(message.container, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.script != null && Object.hasOwnProperty.call(message, "script")) + $root.google.cloud.batch.v1alpha.Runnable.Script.encode(message.script, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.ignoreExitStatus != null && Object.hasOwnProperty.call(message, "ignoreExitStatus")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.ignoreExitStatus); + if (message.background != null && Object.hasOwnProperty.call(message, "background")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.background); + if (message.alwaysRun != null && Object.hasOwnProperty.call(message, "alwaysRun")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.alwaysRun); + if (message.barrier != null && Object.hasOwnProperty.call(message, "barrier")) + $root.google.cloud.batch.v1alpha.Runnable.Barrier.encode(message.barrier, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + $root.google.cloud.batch.v1alpha.Environment.encode(message.environment, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + 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 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified Runnable message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.Runnable + * @static + * @param {google.cloud.batch.v1alpha.IRunnable} message Runnable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Runnable.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Runnable message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.Runnable + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.Runnable} Runnable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Runnable.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Runnable(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.container = $root.google.cloud.batch.v1alpha.Runnable.Container.decode(reader, reader.uint32()); + break; + } + case 2: { + message.script = $root.google.cloud.batch.v1alpha.Runnable.Script.decode(reader, reader.uint32()); + break; + } + case 6: { + message.barrier = $root.google.cloud.batch.v1alpha.Runnable.Barrier.decode(reader, reader.uint32()); + break; + } + case 10: { + message.displayName = reader.string(); + break; + } + case 3: { + message.ignoreExitStatus = reader.bool(); + break; + } + case 4: { + message.background = reader.bool(); + break; + } + case 5: { + message.alwaysRun = reader.bool(); + break; + } + case 7: { + message.environment = $root.google.cloud.batch.v1alpha.Environment.decode(reader, reader.uint32()); + break; + } + case 8: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 9: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Runnable message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.Runnable + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.Runnable} Runnable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Runnable.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Runnable message. + * @function verify + * @memberof google.cloud.batch.v1alpha.Runnable + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Runnable.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.container != null && message.hasOwnProperty("container")) { + properties.executable = 1; + { + var error = $root.google.cloud.batch.v1alpha.Runnable.Container.verify(message.container); + if (error) + return "container." + error; + } + } + if (message.script != null && message.hasOwnProperty("script")) { + if (properties.executable === 1) + return "executable: multiple values"; + properties.executable = 1; + { + var error = $root.google.cloud.batch.v1alpha.Runnable.Script.verify(message.script); + if (error) + return "script." + error; + } + } + if (message.barrier != null && message.hasOwnProperty("barrier")) { + if (properties.executable === 1) + return "executable: multiple values"; + properties.executable = 1; + { + var error = $root.google.cloud.batch.v1alpha.Runnable.Barrier.verify(message.barrier); + if (error) + return "barrier." + error; + } + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.ignoreExitStatus != null && message.hasOwnProperty("ignoreExitStatus")) + if (typeof message.ignoreExitStatus !== "boolean") + return "ignoreExitStatus: boolean expected"; + if (message.background != null && message.hasOwnProperty("background")) + if (typeof message.background !== "boolean") + return "background: boolean expected"; + if (message.alwaysRun != null && message.hasOwnProperty("alwaysRun")) + if (typeof message.alwaysRun !== "boolean") + return "alwaysRun: boolean expected"; + if (message.environment != null && message.hasOwnProperty("environment")) { + var error = $root.google.cloud.batch.v1alpha.Environment.verify(message.environment); + if (error) + return "environment." + error; + } + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a Runnable message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.Runnable + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.Runnable} Runnable + */ + Runnable.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.Runnable) + return object; + var message = new $root.google.cloud.batch.v1alpha.Runnable(); + if (object.container != null) { + if (typeof object.container !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Runnable.container: object expected"); + message.container = $root.google.cloud.batch.v1alpha.Runnable.Container.fromObject(object.container); + } + if (object.script != null) { + if (typeof object.script !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Runnable.script: object expected"); + message.script = $root.google.cloud.batch.v1alpha.Runnable.Script.fromObject(object.script); + } + if (object.barrier != null) { + if (typeof object.barrier !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Runnable.barrier: object expected"); + message.barrier = $root.google.cloud.batch.v1alpha.Runnable.Barrier.fromObject(object.barrier); + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.ignoreExitStatus != null) + message.ignoreExitStatus = Boolean(object.ignoreExitStatus); + if (object.background != null) + message.background = Boolean(object.background); + if (object.alwaysRun != null) + message.alwaysRun = Boolean(object.alwaysRun); + if (object.environment != null) { + if (typeof object.environment !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Runnable.environment: object expected"); + message.environment = $root.google.cloud.batch.v1alpha.Environment.fromObject(object.environment); + } + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Runnable.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Runnable.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a Runnable message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.Runnable + * @static + * @param {google.cloud.batch.v1alpha.Runnable} message Runnable + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Runnable.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.ignoreExitStatus = false; + object.background = false; + object.alwaysRun = false; + object.environment = null; + object.timeout = null; + object.displayName = ""; + } + if (message.container != null && message.hasOwnProperty("container")) { + object.container = $root.google.cloud.batch.v1alpha.Runnable.Container.toObject(message.container, options); + if (options.oneofs) + object.executable = "container"; + } + if (message.script != null && message.hasOwnProperty("script")) { + object.script = $root.google.cloud.batch.v1alpha.Runnable.Script.toObject(message.script, options); + if (options.oneofs) + object.executable = "script"; + } + if (message.ignoreExitStatus != null && message.hasOwnProperty("ignoreExitStatus")) + object.ignoreExitStatus = message.ignoreExitStatus; + if (message.background != null && message.hasOwnProperty("background")) + object.background = message.background; + if (message.alwaysRun != null && message.hasOwnProperty("alwaysRun")) + object.alwaysRun = message.alwaysRun; + if (message.barrier != null && message.hasOwnProperty("barrier")) { + object.barrier = $root.google.cloud.batch.v1alpha.Runnable.Barrier.toObject(message.barrier, options); + if (options.oneofs) + object.executable = "barrier"; + } + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = $root.google.cloud.batch.v1alpha.Environment.toObject(message.environment, options); + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this Runnable to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.Runnable + * @instance + * @returns {Object.} JSON object + */ + Runnable.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Runnable + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.Runnable + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Runnable.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.Runnable"; + }; + + Runnable.Container = (function() { + + /** + * Properties of a Container. + * @memberof google.cloud.batch.v1alpha.Runnable + * @interface IContainer + * @property {string|null} [imageUri] Container imageUri + * @property {Array.|null} [commands] Container commands + * @property {string|null} [entrypoint] Container entrypoint + * @property {Array.|null} [volumes] Container volumes + * @property {string|null} [options] Container options + * @property {boolean|null} [blockExternalNetwork] Container blockExternalNetwork + * @property {string|null} [username] Container username + * @property {string|null} [password] Container password + * @property {boolean|null} [enableImageStreaming] Container enableImageStreaming + */ + + /** + * Constructs a new Container. + * @memberof google.cloud.batch.v1alpha.Runnable + * @classdesc Represents a Container. + * @implements IContainer + * @constructor + * @param {google.cloud.batch.v1alpha.Runnable.IContainer=} [properties] Properties to set + */ + function Container(properties) { + this.commands = []; + this.volumes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Container imageUri. + * @member {string} imageUri + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @instance + */ + Container.prototype.imageUri = ""; + + /** + * Container commands. + * @member {Array.} commands + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @instance + */ + Container.prototype.commands = $util.emptyArray; + + /** + * Container entrypoint. + * @member {string} entrypoint + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @instance + */ + Container.prototype.entrypoint = ""; + + /** + * Container volumes. + * @member {Array.} volumes + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @instance + */ + Container.prototype.volumes = $util.emptyArray; + + /** + * Container options. + * @member {string} options + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @instance + */ + Container.prototype.options = ""; + + /** + * Container blockExternalNetwork. + * @member {boolean} blockExternalNetwork + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @instance + */ + Container.prototype.blockExternalNetwork = false; + + /** + * Container username. + * @member {string} username + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @instance + */ + Container.prototype.username = ""; + + /** + * Container password. + * @member {string} password + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @instance + */ + Container.prototype.password = ""; + + /** + * Container enableImageStreaming. + * @member {boolean} enableImageStreaming + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @instance + */ + Container.prototype.enableImageStreaming = false; + + /** + * Creates a new Container instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @static + * @param {google.cloud.batch.v1alpha.Runnable.IContainer=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.Runnable.Container} Container instance + */ + Container.create = function create(properties) { + return new Container(properties); + }; + + /** + * Encodes the specified Container message. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Container.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @static + * @param {google.cloud.batch.v1alpha.Runnable.IContainer} message Container message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Container.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.imageUri != null && Object.hasOwnProperty.call(message, "imageUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.imageUri); + if (message.commands != null && message.commands.length) + for (var i = 0; i < message.commands.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.commands[i]); + if (message.entrypoint != null && Object.hasOwnProperty.call(message, "entrypoint")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.entrypoint); + if (message.volumes != null && message.volumes.length) + for (var i = 0; i < message.volumes.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.volumes[i]); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.options); + if (message.blockExternalNetwork != null && Object.hasOwnProperty.call(message, "blockExternalNetwork")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.blockExternalNetwork); + if (message.username != null && Object.hasOwnProperty.call(message, "username")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.username); + if (message.password != null && Object.hasOwnProperty.call(message, "password")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.password); + if (message.enableImageStreaming != null && Object.hasOwnProperty.call(message, "enableImageStreaming")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.enableImageStreaming); + return writer; + }; + + /** + * Encodes the specified Container message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Container.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @static + * @param {google.cloud.batch.v1alpha.Runnable.IContainer} message Container message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Container.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Container message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.Runnable.Container} Container + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Container.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Runnable.Container(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.imageUri = reader.string(); + break; + } + case 2: { + if (!(message.commands && message.commands.length)) + message.commands = []; + message.commands.push(reader.string()); + break; + } + case 3: { + message.entrypoint = reader.string(); + break; + } + case 7: { + if (!(message.volumes && message.volumes.length)) + message.volumes = []; + message.volumes.push(reader.string()); + break; + } + case 8: { + message.options = reader.string(); + break; + } + case 9: { + message.blockExternalNetwork = reader.bool(); + break; + } + case 10: { + message.username = reader.string(); + break; + } + case 11: { + message.password = reader.string(); + break; + } + case 12: { + message.enableImageStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Container message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.Runnable.Container} Container + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Container.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Container message. + * @function verify + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Container.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + if (!$util.isString(message.imageUri)) + return "imageUri: string expected"; + if (message.commands != null && message.hasOwnProperty("commands")) { + if (!Array.isArray(message.commands)) + return "commands: array expected"; + for (var i = 0; i < message.commands.length; ++i) + if (!$util.isString(message.commands[i])) + return "commands: string[] expected"; + } + if (message.entrypoint != null && message.hasOwnProperty("entrypoint")) + if (!$util.isString(message.entrypoint)) + return "entrypoint: string expected"; + if (message.volumes != null && message.hasOwnProperty("volumes")) { + if (!Array.isArray(message.volumes)) + return "volumes: array expected"; + for (var i = 0; i < message.volumes.length; ++i) + if (!$util.isString(message.volumes[i])) + return "volumes: string[] expected"; + } + if (message.options != null && message.hasOwnProperty("options")) + if (!$util.isString(message.options)) + return "options: string expected"; + if (message.blockExternalNetwork != null && message.hasOwnProperty("blockExternalNetwork")) + if (typeof message.blockExternalNetwork !== "boolean") + return "blockExternalNetwork: boolean expected"; + if (message.username != null && message.hasOwnProperty("username")) + if (!$util.isString(message.username)) + return "username: string expected"; + if (message.password != null && message.hasOwnProperty("password")) + if (!$util.isString(message.password)) + return "password: string expected"; + if (message.enableImageStreaming != null && message.hasOwnProperty("enableImageStreaming")) + if (typeof message.enableImageStreaming !== "boolean") + return "enableImageStreaming: boolean expected"; + return null; + }; + + /** + * Creates a Container message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.Runnable.Container} Container + */ + Container.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.Runnable.Container) + return object; + var message = new $root.google.cloud.batch.v1alpha.Runnable.Container(); + if (object.imageUri != null) + message.imageUri = String(object.imageUri); + if (object.commands) { + if (!Array.isArray(object.commands)) + throw TypeError(".google.cloud.batch.v1alpha.Runnable.Container.commands: array expected"); + message.commands = []; + for (var i = 0; i < object.commands.length; ++i) + message.commands[i] = String(object.commands[i]); + } + if (object.entrypoint != null) + message.entrypoint = String(object.entrypoint); + if (object.volumes) { + if (!Array.isArray(object.volumes)) + throw TypeError(".google.cloud.batch.v1alpha.Runnable.Container.volumes: array expected"); + message.volumes = []; + for (var i = 0; i < object.volumes.length; ++i) + message.volumes[i] = String(object.volumes[i]); + } + if (object.options != null) + message.options = String(object.options); + if (object.blockExternalNetwork != null) + message.blockExternalNetwork = Boolean(object.blockExternalNetwork); + if (object.username != null) + message.username = String(object.username); + if (object.password != null) + message.password = String(object.password); + if (object.enableImageStreaming != null) + message.enableImageStreaming = Boolean(object.enableImageStreaming); + return message; + }; + + /** + * Creates a plain object from a Container message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @static + * @param {google.cloud.batch.v1alpha.Runnable.Container} message Container + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Container.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.commands = []; + object.volumes = []; + } + if (options.defaults) { + object.imageUri = ""; + object.entrypoint = ""; + object.options = ""; + object.blockExternalNetwork = false; + object.username = ""; + object.password = ""; + object.enableImageStreaming = false; + } + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + object.imageUri = message.imageUri; + if (message.commands && message.commands.length) { + object.commands = []; + for (var j = 0; j < message.commands.length; ++j) + object.commands[j] = message.commands[j]; + } + if (message.entrypoint != null && message.hasOwnProperty("entrypoint")) + object.entrypoint = message.entrypoint; + if (message.volumes && message.volumes.length) { + object.volumes = []; + for (var j = 0; j < message.volumes.length; ++j) + object.volumes[j] = message.volumes[j]; + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = message.options; + if (message.blockExternalNetwork != null && message.hasOwnProperty("blockExternalNetwork")) + object.blockExternalNetwork = message.blockExternalNetwork; + if (message.username != null && message.hasOwnProperty("username")) + object.username = message.username; + if (message.password != null && message.hasOwnProperty("password")) + object.password = message.password; + if (message.enableImageStreaming != null && message.hasOwnProperty("enableImageStreaming")) + object.enableImageStreaming = message.enableImageStreaming; + return object; + }; + + /** + * Converts this Container to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @instance + * @returns {Object.} JSON object + */ + Container.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Container + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Container.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.Runnable.Container"; + }; + + return Container; + })(); + + Runnable.Script = (function() { + + /** + * Properties of a Script. + * @memberof google.cloud.batch.v1alpha.Runnable + * @interface IScript + * @property {string|null} [path] Script path + * @property {string|null} [text] Script text + */ + + /** + * Constructs a new Script. + * @memberof google.cloud.batch.v1alpha.Runnable + * @classdesc Represents a Script. + * @implements IScript + * @constructor + * @param {google.cloud.batch.v1alpha.Runnable.IScript=} [properties] Properties to set + */ + function Script(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Script path. + * @member {string|null|undefined} path + * @memberof google.cloud.batch.v1alpha.Runnable.Script + * @instance + */ + Script.prototype.path = null; + + /** + * Script text. + * @member {string|null|undefined} text + * @memberof google.cloud.batch.v1alpha.Runnable.Script + * @instance + */ + Script.prototype.text = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Script command. + * @member {"path"|"text"|undefined} command + * @memberof google.cloud.batch.v1alpha.Runnable.Script + * @instance + */ + Object.defineProperty(Script.prototype, "command", { + get: $util.oneOfGetter($oneOfFields = ["path", "text"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Script instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.Runnable.Script + * @static + * @param {google.cloud.batch.v1alpha.Runnable.IScript=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.Runnable.Script} Script instance + */ + Script.create = function create(properties) { + return new Script(properties); + }; + + /** + * Encodes the specified Script message. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Script.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.Runnable.Script + * @static + * @param {google.cloud.batch.v1alpha.Runnable.IScript} message Script message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Script.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.path); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.text); + return writer; + }; + + /** + * Encodes the specified Script message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Script.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.Runnable.Script + * @static + * @param {google.cloud.batch.v1alpha.Runnable.IScript} message Script message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Script.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Script message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.Runnable.Script + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.Runnable.Script} Script + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Script.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Runnable.Script(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.path = reader.string(); + break; + } + case 2: { + message.text = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Script message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.Runnable.Script + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.Runnable.Script} Script + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Script.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Script message. + * @function verify + * @memberof google.cloud.batch.v1alpha.Runnable.Script + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Script.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.path != null && message.hasOwnProperty("path")) { + properties.command = 1; + if (!$util.isString(message.path)) + return "path: string expected"; + } + if (message.text != null && message.hasOwnProperty("text")) { + if (properties.command === 1) + return "command: multiple values"; + properties.command = 1; + if (!$util.isString(message.text)) + return "text: string expected"; + } + return null; + }; + + /** + * Creates a Script message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.Runnable.Script + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.Runnable.Script} Script + */ + Script.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.Runnable.Script) + return object; + var message = new $root.google.cloud.batch.v1alpha.Runnable.Script(); + if (object.path != null) + message.path = String(object.path); + if (object.text != null) + message.text = String(object.text); + return message; + }; + + /** + * Creates a plain object from a Script message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.Runnable.Script + * @static + * @param {google.cloud.batch.v1alpha.Runnable.Script} message Script + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Script.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.path != null && message.hasOwnProperty("path")) { + object.path = message.path; + if (options.oneofs) + object.command = "path"; + } + if (message.text != null && message.hasOwnProperty("text")) { + object.text = message.text; + if (options.oneofs) + object.command = "text"; + } + return object; + }; + + /** + * Converts this Script to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.Runnable.Script + * @instance + * @returns {Object.} JSON object + */ + Script.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Script + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.Runnable.Script + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Script.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.Runnable.Script"; + }; + + return Script; + })(); + + Runnable.Barrier = (function() { + + /** + * Properties of a Barrier. + * @memberof google.cloud.batch.v1alpha.Runnable + * @interface IBarrier + * @property {string|null} [name] Barrier name + */ + + /** + * Constructs a new Barrier. + * @memberof google.cloud.batch.v1alpha.Runnable + * @classdesc Represents a Barrier. + * @implements IBarrier + * @constructor + * @param {google.cloud.batch.v1alpha.Runnable.IBarrier=} [properties] Properties to set + */ + function Barrier(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Barrier name. + * @member {string} name + * @memberof google.cloud.batch.v1alpha.Runnable.Barrier + * @instance + */ + Barrier.prototype.name = ""; + + /** + * Creates a new Barrier instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.Runnable.Barrier + * @static + * @param {google.cloud.batch.v1alpha.Runnable.IBarrier=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.Runnable.Barrier} Barrier instance + */ + Barrier.create = function create(properties) { + return new Barrier(properties); + }; + + /** + * Encodes the specified Barrier message. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Barrier.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.Runnable.Barrier + * @static + * @param {google.cloud.batch.v1alpha.Runnable.IBarrier} message Barrier message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Barrier.encode = function encode(message, writer) { + 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 Barrier message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Barrier.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.Runnable.Barrier + * @static + * @param {google.cloud.batch.v1alpha.Runnable.IBarrier} message Barrier message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Barrier.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Barrier message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.Runnable.Barrier + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.Runnable.Barrier} Barrier + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Barrier.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Runnable.Barrier(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Barrier message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.Runnable.Barrier + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.Runnable.Barrier} Barrier + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Barrier.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Barrier message. + * @function verify + * @memberof google.cloud.batch.v1alpha.Runnable.Barrier + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Barrier.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a Barrier message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.Runnable.Barrier + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.Runnable.Barrier} Barrier + */ + Barrier.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.Runnable.Barrier) + return object; + var message = new $root.google.cloud.batch.v1alpha.Runnable.Barrier(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a Barrier message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.Runnable.Barrier + * @static + * @param {google.cloud.batch.v1alpha.Runnable.Barrier} message Barrier + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Barrier.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 Barrier to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.Runnable.Barrier + * @instance + * @returns {Object.} JSON object + */ + Barrier.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Barrier + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.Runnable.Barrier + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Barrier.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.Runnable.Barrier"; + }; + + return Barrier; + })(); + + return Runnable; + })(); + + v1alpha.TaskSpec = (function() { + + /** + * Properties of a TaskSpec. + * @memberof google.cloud.batch.v1alpha + * @interface ITaskSpec + * @property {Array.|null} [runnables] TaskSpec runnables + * @property {google.cloud.batch.v1alpha.IComputeResource|null} [computeResource] TaskSpec computeResource + * @property {google.protobuf.IDuration|null} [maxRunDuration] TaskSpec maxRunDuration + * @property {number|null} [maxRetryCount] TaskSpec maxRetryCount + * @property {Array.|null} [lifecyclePolicies] TaskSpec lifecyclePolicies + * @property {Object.|null} [environments] TaskSpec environments + * @property {Array.|null} [volumes] TaskSpec volumes + * @property {google.cloud.batch.v1alpha.IEnvironment|null} [environment] TaskSpec environment + */ + + /** + * Constructs a new TaskSpec. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a TaskSpec. + * @implements ITaskSpec + * @constructor + * @param {google.cloud.batch.v1alpha.ITaskSpec=} [properties] Properties to set + */ + function TaskSpec(properties) { + this.runnables = []; + this.lifecyclePolicies = []; + this.environments = {}; + this.volumes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TaskSpec runnables. + * @member {Array.} runnables + * @memberof google.cloud.batch.v1alpha.TaskSpec + * @instance + */ + TaskSpec.prototype.runnables = $util.emptyArray; + + /** + * TaskSpec computeResource. + * @member {google.cloud.batch.v1alpha.IComputeResource|null|undefined} computeResource + * @memberof google.cloud.batch.v1alpha.TaskSpec + * @instance + */ + TaskSpec.prototype.computeResource = null; + + /** + * TaskSpec maxRunDuration. + * @member {google.protobuf.IDuration|null|undefined} maxRunDuration + * @memberof google.cloud.batch.v1alpha.TaskSpec + * @instance + */ + TaskSpec.prototype.maxRunDuration = null; + + /** + * TaskSpec maxRetryCount. + * @member {number} maxRetryCount + * @memberof google.cloud.batch.v1alpha.TaskSpec + * @instance + */ + TaskSpec.prototype.maxRetryCount = 0; + + /** + * TaskSpec lifecyclePolicies. + * @member {Array.} lifecyclePolicies + * @memberof google.cloud.batch.v1alpha.TaskSpec + * @instance + */ + TaskSpec.prototype.lifecyclePolicies = $util.emptyArray; + + /** + * TaskSpec environments. + * @member {Object.} environments + * @memberof google.cloud.batch.v1alpha.TaskSpec + * @instance + */ + TaskSpec.prototype.environments = $util.emptyObject; + + /** + * TaskSpec volumes. + * @member {Array.} volumes + * @memberof google.cloud.batch.v1alpha.TaskSpec + * @instance + */ + TaskSpec.prototype.volumes = $util.emptyArray; + + /** + * TaskSpec environment. + * @member {google.cloud.batch.v1alpha.IEnvironment|null|undefined} environment + * @memberof google.cloud.batch.v1alpha.TaskSpec + * @instance + */ + TaskSpec.prototype.environment = null; + + /** + * Creates a new TaskSpec instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.TaskSpec + * @static + * @param {google.cloud.batch.v1alpha.ITaskSpec=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.TaskSpec} TaskSpec instance + */ + TaskSpec.create = function create(properties) { + return new TaskSpec(properties); + }; + + /** + * Encodes the specified TaskSpec message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.TaskSpec + * @static + * @param {google.cloud.batch.v1alpha.ITaskSpec} message TaskSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.computeResource != null && Object.hasOwnProperty.call(message, "computeResource")) + $root.google.cloud.batch.v1alpha.ComputeResource.encode(message.computeResource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.maxRunDuration != null && Object.hasOwnProperty.call(message, "maxRunDuration")) + $root.google.protobuf.Duration.encode(message.maxRunDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.maxRetryCount != null && Object.hasOwnProperty.call(message, "maxRetryCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxRetryCount); + if (message.environments != null && Object.hasOwnProperty.call(message, "environments")) + for (var keys = Object.keys(message.environments), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.environments[keys[i]]).ldelim(); + if (message.volumes != null && message.volumes.length) + for (var i = 0; i < message.volumes.length; ++i) + $root.google.cloud.batch.v1alpha.Volume.encode(message.volumes[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.runnables != null && message.runnables.length) + for (var i = 0; i < message.runnables.length; ++i) + $root.google.cloud.batch.v1alpha.Runnable.encode(message.runnables[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.lifecyclePolicies != null && message.lifecyclePolicies.length) + for (var i = 0; i < message.lifecyclePolicies.length; ++i) + $root.google.cloud.batch.v1alpha.LifecyclePolicy.encode(message.lifecyclePolicies[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + $root.google.cloud.batch.v1alpha.Environment.encode(message.environment, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TaskSpec message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.TaskSpec + * @static + * @param {google.cloud.batch.v1alpha.ITaskSpec} message TaskSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TaskSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.TaskSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.TaskSpec} TaskSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.TaskSpec(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 8: { + if (!(message.runnables && message.runnables.length)) + message.runnables = []; + message.runnables.push($root.google.cloud.batch.v1alpha.Runnable.decode(reader, reader.uint32())); + break; + } + case 3: { + message.computeResource = $root.google.cloud.batch.v1alpha.ComputeResource.decode(reader, reader.uint32()); + break; + } + case 4: { + message.maxRunDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.maxRetryCount = reader.int32(); + break; + } + case 9: { + if (!(message.lifecyclePolicies && message.lifecyclePolicies.length)) + message.lifecyclePolicies = []; + message.lifecyclePolicies.push($root.google.cloud.batch.v1alpha.LifecyclePolicy.decode(reader, reader.uint32())); + break; + } + case 6: { + if (message.environments === $util.emptyObject) + message.environments = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.environments[key] = value; + break; + } + case 7: { + if (!(message.volumes && message.volumes.length)) + message.volumes = []; + message.volumes.push($root.google.cloud.batch.v1alpha.Volume.decode(reader, reader.uint32())); + break; + } + case 10: { + message.environment = $root.google.cloud.batch.v1alpha.Environment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TaskSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.TaskSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.TaskSpec} TaskSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TaskSpec message. + * @function verify + * @memberof google.cloud.batch.v1alpha.TaskSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TaskSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.runnables != null && message.hasOwnProperty("runnables")) { + if (!Array.isArray(message.runnables)) + return "runnables: array expected"; + for (var i = 0; i < message.runnables.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.Runnable.verify(message.runnables[i]); + if (error) + return "runnables." + error; + } + } + if (message.computeResource != null && message.hasOwnProperty("computeResource")) { + var error = $root.google.cloud.batch.v1alpha.ComputeResource.verify(message.computeResource); + if (error) + return "computeResource." + error; + } + if (message.maxRunDuration != null && message.hasOwnProperty("maxRunDuration")) { + var error = $root.google.protobuf.Duration.verify(message.maxRunDuration); + if (error) + return "maxRunDuration." + error; + } + if (message.maxRetryCount != null && message.hasOwnProperty("maxRetryCount")) + if (!$util.isInteger(message.maxRetryCount)) + return "maxRetryCount: integer expected"; + if (message.lifecyclePolicies != null && message.hasOwnProperty("lifecyclePolicies")) { + if (!Array.isArray(message.lifecyclePolicies)) + return "lifecyclePolicies: array expected"; + for (var i = 0; i < message.lifecyclePolicies.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.LifecyclePolicy.verify(message.lifecyclePolicies[i]); + if (error) + return "lifecyclePolicies." + error; + } + } + if (message.environments != null && message.hasOwnProperty("environments")) { + if (!$util.isObject(message.environments)) + return "environments: object expected"; + var key = Object.keys(message.environments); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.environments[key[i]])) + return "environments: string{k:string} expected"; + } + if (message.volumes != null && message.hasOwnProperty("volumes")) { + if (!Array.isArray(message.volumes)) + return "volumes: array expected"; + for (var i = 0; i < message.volumes.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.Volume.verify(message.volumes[i]); + if (error) + return "volumes." + error; + } + } + if (message.environment != null && message.hasOwnProperty("environment")) { + var error = $root.google.cloud.batch.v1alpha.Environment.verify(message.environment); + if (error) + return "environment." + error; + } + return null; + }; + + /** + * Creates a TaskSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.TaskSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.TaskSpec} TaskSpec + */ + TaskSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.TaskSpec) + return object; + var message = new $root.google.cloud.batch.v1alpha.TaskSpec(); + if (object.runnables) { + if (!Array.isArray(object.runnables)) + throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.runnables: array expected"); + message.runnables = []; + for (var i = 0; i < object.runnables.length; ++i) { + if (typeof object.runnables[i] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.runnables: object expected"); + message.runnables[i] = $root.google.cloud.batch.v1alpha.Runnable.fromObject(object.runnables[i]); + } + } + if (object.computeResource != null) { + if (typeof object.computeResource !== "object") + throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.computeResource: object expected"); + message.computeResource = $root.google.cloud.batch.v1alpha.ComputeResource.fromObject(object.computeResource); + } + if (object.maxRunDuration != null) { + if (typeof object.maxRunDuration !== "object") + throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.maxRunDuration: object expected"); + message.maxRunDuration = $root.google.protobuf.Duration.fromObject(object.maxRunDuration); + } + if (object.maxRetryCount != null) + message.maxRetryCount = object.maxRetryCount | 0; + if (object.lifecyclePolicies) { + if (!Array.isArray(object.lifecyclePolicies)) + throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.lifecyclePolicies: array expected"); + message.lifecyclePolicies = []; + for (var i = 0; i < object.lifecyclePolicies.length; ++i) { + if (typeof object.lifecyclePolicies[i] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.lifecyclePolicies: object expected"); + message.lifecyclePolicies[i] = $root.google.cloud.batch.v1alpha.LifecyclePolicy.fromObject(object.lifecyclePolicies[i]); + } + } + if (object.environments) { + if (typeof object.environments !== "object") + throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.environments: object expected"); + message.environments = {}; + for (var keys = Object.keys(object.environments), i = 0; i < keys.length; ++i) + message.environments[keys[i]] = String(object.environments[keys[i]]); + } + if (object.volumes) { + if (!Array.isArray(object.volumes)) + throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.volumes: array expected"); + message.volumes = []; + for (var i = 0; i < object.volumes.length; ++i) { + if (typeof object.volumes[i] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.volumes: object expected"); + message.volumes[i] = $root.google.cloud.batch.v1alpha.Volume.fromObject(object.volumes[i]); + } + } + if (object.environment != null) { + if (typeof object.environment !== "object") + throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.environment: object expected"); + message.environment = $root.google.cloud.batch.v1alpha.Environment.fromObject(object.environment); + } + return message; + }; + + /** + * Creates a plain object from a TaskSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.TaskSpec + * @static + * @param {google.cloud.batch.v1alpha.TaskSpec} message TaskSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TaskSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.volumes = []; + object.runnables = []; + object.lifecyclePolicies = []; + } + if (options.objects || options.defaults) + object.environments = {}; + if (options.defaults) { + object.computeResource = null; + object.maxRunDuration = null; + object.maxRetryCount = 0; + object.environment = null; + } + if (message.computeResource != null && message.hasOwnProperty("computeResource")) + object.computeResource = $root.google.cloud.batch.v1alpha.ComputeResource.toObject(message.computeResource, options); + if (message.maxRunDuration != null && message.hasOwnProperty("maxRunDuration")) + object.maxRunDuration = $root.google.protobuf.Duration.toObject(message.maxRunDuration, options); + if (message.maxRetryCount != null && message.hasOwnProperty("maxRetryCount")) + object.maxRetryCount = message.maxRetryCount; + var keys2; + if (message.environments && (keys2 = Object.keys(message.environments)).length) { + object.environments = {}; + for (var j = 0; j < keys2.length; ++j) + object.environments[keys2[j]] = message.environments[keys2[j]]; + } + if (message.volumes && message.volumes.length) { + object.volumes = []; + for (var j = 0; j < message.volumes.length; ++j) + object.volumes[j] = $root.google.cloud.batch.v1alpha.Volume.toObject(message.volumes[j], options); + } + if (message.runnables && message.runnables.length) { + object.runnables = []; + for (var j = 0; j < message.runnables.length; ++j) + object.runnables[j] = $root.google.cloud.batch.v1alpha.Runnable.toObject(message.runnables[j], options); + } + if (message.lifecyclePolicies && message.lifecyclePolicies.length) { + object.lifecyclePolicies = []; + for (var j = 0; j < message.lifecyclePolicies.length; ++j) + object.lifecyclePolicies[j] = $root.google.cloud.batch.v1alpha.LifecyclePolicy.toObject(message.lifecyclePolicies[j], options); + } + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = $root.google.cloud.batch.v1alpha.Environment.toObject(message.environment, options); + return object; + }; + + /** + * Converts this TaskSpec to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.TaskSpec + * @instance + * @returns {Object.} JSON object + */ + TaskSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TaskSpec + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.TaskSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TaskSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.TaskSpec"; + }; + + return TaskSpec; + })(); + + v1alpha.LifecyclePolicy = (function() { + + /** + * Properties of a LifecyclePolicy. + * @memberof google.cloud.batch.v1alpha + * @interface ILifecyclePolicy + * @property {google.cloud.batch.v1alpha.LifecyclePolicy.Action|null} [action] LifecyclePolicy action + * @property {google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition|null} [actionCondition] LifecyclePolicy actionCondition + */ + + /** + * Constructs a new LifecyclePolicy. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a LifecyclePolicy. + * @implements ILifecyclePolicy + * @constructor + * @param {google.cloud.batch.v1alpha.ILifecyclePolicy=} [properties] Properties to set + */ + function LifecyclePolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LifecyclePolicy action. + * @member {google.cloud.batch.v1alpha.LifecyclePolicy.Action} action + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy + * @instance + */ + LifecyclePolicy.prototype.action = 0; + + /** + * LifecyclePolicy actionCondition. + * @member {google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition|null|undefined} actionCondition + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy + * @instance + */ + LifecyclePolicy.prototype.actionCondition = null; + + /** + * Creates a new LifecyclePolicy instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy + * @static + * @param {google.cloud.batch.v1alpha.ILifecyclePolicy=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.LifecyclePolicy} LifecyclePolicy instance + */ + LifecyclePolicy.create = function create(properties) { + return new LifecyclePolicy(properties); + }; + + /** + * Encodes the specified LifecyclePolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.LifecyclePolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy + * @static + * @param {google.cloud.batch.v1alpha.ILifecyclePolicy} message LifecyclePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LifecyclePolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.actionCondition != null && Object.hasOwnProperty.call(message, "actionCondition")) + $root.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.encode(message.actionCondition, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LifecyclePolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.LifecyclePolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy + * @static + * @param {google.cloud.batch.v1alpha.ILifecyclePolicy} message LifecyclePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LifecyclePolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LifecyclePolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.LifecyclePolicy} LifecyclePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LifecyclePolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.LifecyclePolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.actionCondition = $root.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LifecyclePolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.LifecyclePolicy} LifecyclePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LifecyclePolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LifecyclePolicy message. + * @function verify + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LifecyclePolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.actionCondition != null && message.hasOwnProperty("actionCondition")) { + var error = $root.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.verify(message.actionCondition); + if (error) + return "actionCondition." + error; + } + return null; + }; + + /** + * Creates a LifecyclePolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.LifecyclePolicy} LifecyclePolicy + */ + LifecyclePolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.LifecyclePolicy) + return object; + var message = new $root.google.cloud.batch.v1alpha.LifecyclePolicy(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "RETRY_TASK": + case 1: + message.action = 1; + break; + case "FAIL_TASK": + case 2: + message.action = 2; + break; + } + if (object.actionCondition != null) { + if (typeof object.actionCondition !== "object") + throw TypeError(".google.cloud.batch.v1alpha.LifecyclePolicy.actionCondition: object expected"); + message.actionCondition = $root.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.fromObject(object.actionCondition); + } + return message; + }; + + /** + * Creates a plain object from a LifecyclePolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy + * @static + * @param {google.cloud.batch.v1alpha.LifecyclePolicy} message LifecyclePolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LifecyclePolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.actionCondition = null; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.cloud.batch.v1alpha.LifecyclePolicy.Action[message.action] === undefined ? message.action : $root.google.cloud.batch.v1alpha.LifecyclePolicy.Action[message.action] : message.action; + if (message.actionCondition != null && message.hasOwnProperty("actionCondition")) + object.actionCondition = $root.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.toObject(message.actionCondition, options); + return object; + }; + + /** + * Converts this LifecyclePolicy to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy + * @instance + * @returns {Object.} JSON object + */ + LifecyclePolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LifecyclePolicy + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LifecyclePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.LifecyclePolicy"; + }; + + LifecyclePolicy.ActionCondition = (function() { + + /** + * Properties of an ActionCondition. + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy + * @interface IActionCondition + * @property {Array.|null} [exitCodes] ActionCondition exitCodes + */ + + /** + * Constructs a new ActionCondition. + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy + * @classdesc Represents an ActionCondition. + * @implements IActionCondition + * @constructor + * @param {google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition=} [properties] Properties to set + */ + function ActionCondition(properties) { + this.exitCodes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ActionCondition exitCodes. + * @member {Array.} exitCodes + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition + * @instance + */ + ActionCondition.prototype.exitCodes = $util.emptyArray; + + /** + * Creates a new ActionCondition instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition + * @static + * @param {google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition} ActionCondition instance + */ + ActionCondition.create = function create(properties) { + return new ActionCondition(properties); + }; + + /** + * Encodes the specified ActionCondition message. Does not implicitly {@link google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition + * @static + * @param {google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition} message ActionCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActionCondition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.exitCodes != null && message.exitCodes.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.exitCodes.length; ++i) + writer.int32(message.exitCodes[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ActionCondition message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition + * @static + * @param {google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition} message ActionCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActionCondition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ActionCondition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition} ActionCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActionCondition.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.exitCodes && message.exitCodes.length)) + message.exitCodes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.exitCodes.push(reader.int32()); + } else + message.exitCodes.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ActionCondition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition} ActionCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActionCondition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ActionCondition message. + * @function verify + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ActionCondition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.exitCodes != null && message.hasOwnProperty("exitCodes")) { + if (!Array.isArray(message.exitCodes)) + return "exitCodes: array expected"; + for (var i = 0; i < message.exitCodes.length; ++i) + if (!$util.isInteger(message.exitCodes[i])) + return "exitCodes: integer[] expected"; + } + return null; + }; + + /** + * Creates an ActionCondition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition} ActionCondition + */ + ActionCondition.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition) + return object; + var message = new $root.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition(); + if (object.exitCodes) { + if (!Array.isArray(object.exitCodes)) + throw TypeError(".google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.exitCodes: array expected"); + message.exitCodes = []; + for (var i = 0; i < object.exitCodes.length; ++i) + message.exitCodes[i] = object.exitCodes[i] | 0; + } + return message; + }; + + /** + * Creates a plain object from an ActionCondition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition + * @static + * @param {google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition} message ActionCondition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ActionCondition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.exitCodes = []; + if (message.exitCodes && message.exitCodes.length) { + object.exitCodes = []; + for (var j = 0; j < message.exitCodes.length; ++j) + object.exitCodes[j] = message.exitCodes[j]; + } + return object; + }; + + /** + * Converts this ActionCondition to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition + * @instance + * @returns {Object.} JSON object + */ + ActionCondition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ActionCondition + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ActionCondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition"; + }; + + return ActionCondition; + })(); + + /** + * Action enum. + * @name google.cloud.batch.v1alpha.LifecyclePolicy.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} RETRY_TASK=1 RETRY_TASK value + * @property {number} FAIL_TASK=2 FAIL_TASK value + */ + LifecyclePolicy.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "RETRY_TASK"] = 1; + values[valuesById[2] = "FAIL_TASK"] = 2; + return values; + })(); + + return LifecyclePolicy; + })(); + + v1alpha.Task = (function() { + + /** + * Properties of a Task. + * @memberof google.cloud.batch.v1alpha + * @interface ITask + * @property {string|null} [name] Task name + * @property {google.cloud.batch.v1alpha.ITaskStatus|null} [status] Task status + */ + + /** + * Constructs a new Task. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a Task. + * @implements ITask + * @constructor + * @param {google.cloud.batch.v1alpha.ITask=} [properties] Properties to set + */ + function Task(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Task name. + * @member {string} name + * @memberof google.cloud.batch.v1alpha.Task + * @instance + */ + Task.prototype.name = ""; + + /** + * Task status. + * @member {google.cloud.batch.v1alpha.ITaskStatus|null|undefined} status + * @memberof google.cloud.batch.v1alpha.Task + * @instance + */ + Task.prototype.status = null; + + /** + * Creates a new Task instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.Task + * @static + * @param {google.cloud.batch.v1alpha.ITask=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.Task} Task instance + */ + Task.create = function create(properties) { + return new Task(properties); + }; + + /** + * Encodes the specified Task message. Does not implicitly {@link google.cloud.batch.v1alpha.Task.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.Task + * @static + * @param {google.cloud.batch.v1alpha.ITask} message Task message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Task.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.cloud.batch.v1alpha.TaskStatus.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Task message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Task.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.Task + * @static + * @param {google.cloud.batch.v1alpha.ITask} message Task message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Task.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Task message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.Task + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.Task} Task + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Task.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Task(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.status = $root.google.cloud.batch.v1alpha.TaskStatus.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Task message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.Task + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.Task} Task + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Task.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Task message. + * @function verify + * @memberof google.cloud.batch.v1alpha.Task + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Task.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.cloud.batch.v1alpha.TaskStatus.verify(message.status); + if (error) + return "status." + error; + } + return null; + }; + + /** + * Creates a Task message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.Task + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.Task} Task + */ + Task.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.Task) + return object; + var message = new $root.google.cloud.batch.v1alpha.Task(); + if (object.name != null) + message.name = String(object.name); + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Task.status: object expected"); + message.status = $root.google.cloud.batch.v1alpha.TaskStatus.fromObject(object.status); + } + return message; + }; + + /** + * Creates a plain object from a Task message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.Task + * @static + * @param {google.cloud.batch.v1alpha.Task} message Task + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Task.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.status = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.cloud.batch.v1alpha.TaskStatus.toObject(message.status, options); + return object; + }; + + /** + * Converts this Task to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.Task + * @instance + * @returns {Object.} JSON object + */ + Task.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Task + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.Task + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Task.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.Task"; + }; + + return Task; + })(); + + v1alpha.Environment = (function() { + + /** + * Properties of an Environment. + * @memberof google.cloud.batch.v1alpha + * @interface IEnvironment + * @property {Object.|null} [variables] Environment variables + * @property {Object.|null} [secretVariables] Environment secretVariables + * @property {google.cloud.batch.v1alpha.Environment.IKMSEnvMap|null} [encryptedVariables] Environment encryptedVariables + */ + + /** + * Constructs a new Environment. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents an Environment. + * @implements IEnvironment + * @constructor + * @param {google.cloud.batch.v1alpha.IEnvironment=} [properties] Properties to set + */ + function Environment(properties) { + this.variables = {}; + this.secretVariables = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Environment variables. + * @member {Object.} variables + * @memberof google.cloud.batch.v1alpha.Environment + * @instance + */ + Environment.prototype.variables = $util.emptyObject; + + /** + * Environment secretVariables. + * @member {Object.} secretVariables + * @memberof google.cloud.batch.v1alpha.Environment + * @instance + */ + Environment.prototype.secretVariables = $util.emptyObject; + + /** + * Environment encryptedVariables. + * @member {google.cloud.batch.v1alpha.Environment.IKMSEnvMap|null|undefined} encryptedVariables + * @memberof google.cloud.batch.v1alpha.Environment + * @instance + */ + Environment.prototype.encryptedVariables = null; + + /** + * Creates a new Environment instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.Environment + * @static + * @param {google.cloud.batch.v1alpha.IEnvironment=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.Environment} Environment instance + */ + Environment.create = function create(properties) { + return new Environment(properties); + }; + + /** + * Encodes the specified Environment message. Does not implicitly {@link google.cloud.batch.v1alpha.Environment.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.Environment + * @static + * @param {google.cloud.batch.v1alpha.IEnvironment} message Environment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Environment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.variables != null && Object.hasOwnProperty.call(message, "variables")) + for (var keys = Object.keys(message.variables), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.variables[keys[i]]).ldelim(); + if (message.secretVariables != null && Object.hasOwnProperty.call(message, "secretVariables")) + for (var keys = Object.keys(message.secretVariables), 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.secretVariables[keys[i]]).ldelim(); + if (message.encryptedVariables != null && Object.hasOwnProperty.call(message, "encryptedVariables")) + $root.google.cloud.batch.v1alpha.Environment.KMSEnvMap.encode(message.encryptedVariables, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Environment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.Environment + * @static + * @param {google.cloud.batch.v1alpha.IEnvironment} message Environment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Environment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Environment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.Environment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.Environment} Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Environment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Environment(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.variables === $util.emptyObject) + message.variables = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.variables[key] = value; + break; + } + case 2: { + if (message.secretVariables === $util.emptyObject) + message.secretVariables = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.secretVariables[key] = value; + break; + } + case 3: { + message.encryptedVariables = $root.google.cloud.batch.v1alpha.Environment.KMSEnvMap.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Environment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.Environment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.Environment} Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Environment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Environment message. + * @function verify + * @memberof google.cloud.batch.v1alpha.Environment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Environment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.variables != null && message.hasOwnProperty("variables")) { + if (!$util.isObject(message.variables)) + return "variables: object expected"; + var key = Object.keys(message.variables); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.variables[key[i]])) + return "variables: string{k:string} expected"; + } + if (message.secretVariables != null && message.hasOwnProperty("secretVariables")) { + if (!$util.isObject(message.secretVariables)) + return "secretVariables: object expected"; + var key = Object.keys(message.secretVariables); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.secretVariables[key[i]])) + return "secretVariables: string{k:string} expected"; + } + if (message.encryptedVariables != null && message.hasOwnProperty("encryptedVariables")) { + var error = $root.google.cloud.batch.v1alpha.Environment.KMSEnvMap.verify(message.encryptedVariables); + if (error) + return "encryptedVariables." + error; + } + return null; + }; + + /** + * Creates an Environment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.Environment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.Environment} Environment + */ + Environment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.Environment) + return object; + var message = new $root.google.cloud.batch.v1alpha.Environment(); + if (object.variables) { + if (typeof object.variables !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Environment.variables: object expected"); + message.variables = {}; + for (var keys = Object.keys(object.variables), i = 0; i < keys.length; ++i) + message.variables[keys[i]] = String(object.variables[keys[i]]); + } + if (object.secretVariables) { + if (typeof object.secretVariables !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Environment.secretVariables: object expected"); + message.secretVariables = {}; + for (var keys = Object.keys(object.secretVariables), i = 0; i < keys.length; ++i) + message.secretVariables[keys[i]] = String(object.secretVariables[keys[i]]); + } + if (object.encryptedVariables != null) { + if (typeof object.encryptedVariables !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Environment.encryptedVariables: object expected"); + message.encryptedVariables = $root.google.cloud.batch.v1alpha.Environment.KMSEnvMap.fromObject(object.encryptedVariables); + } + return message; + }; + + /** + * Creates a plain object from an Environment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.Environment + * @static + * @param {google.cloud.batch.v1alpha.Environment} message Environment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Environment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.variables = {}; + object.secretVariables = {}; + } + if (options.defaults) + object.encryptedVariables = null; + var keys2; + if (message.variables && (keys2 = Object.keys(message.variables)).length) { + object.variables = {}; + for (var j = 0; j < keys2.length; ++j) + object.variables[keys2[j]] = message.variables[keys2[j]]; + } + if (message.secretVariables && (keys2 = Object.keys(message.secretVariables)).length) { + object.secretVariables = {}; + for (var j = 0; j < keys2.length; ++j) + object.secretVariables[keys2[j]] = message.secretVariables[keys2[j]]; + } + if (message.encryptedVariables != null && message.hasOwnProperty("encryptedVariables")) + object.encryptedVariables = $root.google.cloud.batch.v1alpha.Environment.KMSEnvMap.toObject(message.encryptedVariables, options); + return object; + }; + + /** + * Converts this Environment to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.Environment + * @instance + * @returns {Object.} JSON object + */ + Environment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Environment + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.Environment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Environment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.Environment"; + }; + + Environment.KMSEnvMap = (function() { + + /** + * Properties of a KMSEnvMap. + * @memberof google.cloud.batch.v1alpha.Environment + * @interface IKMSEnvMap + * @property {string|null} [keyName] KMSEnvMap keyName + * @property {string|null} [cipherText] KMSEnvMap cipherText + */ + + /** + * Constructs a new KMSEnvMap. + * @memberof google.cloud.batch.v1alpha.Environment + * @classdesc Represents a KMSEnvMap. + * @implements IKMSEnvMap + * @constructor + * @param {google.cloud.batch.v1alpha.Environment.IKMSEnvMap=} [properties] Properties to set + */ + function KMSEnvMap(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KMSEnvMap keyName. + * @member {string} keyName + * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap + * @instance + */ + KMSEnvMap.prototype.keyName = ""; + + /** + * KMSEnvMap cipherText. + * @member {string} cipherText + * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap + * @instance + */ + KMSEnvMap.prototype.cipherText = ""; + + /** + * Creates a new KMSEnvMap instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap + * @static + * @param {google.cloud.batch.v1alpha.Environment.IKMSEnvMap=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.Environment.KMSEnvMap} KMSEnvMap instance + */ + KMSEnvMap.create = function create(properties) { + return new KMSEnvMap(properties); + }; + + /** + * Encodes the specified KMSEnvMap message. Does not implicitly {@link google.cloud.batch.v1alpha.Environment.KMSEnvMap.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap + * @static + * @param {google.cloud.batch.v1alpha.Environment.IKMSEnvMap} message KMSEnvMap message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KMSEnvMap.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keyName != null && Object.hasOwnProperty.call(message, "keyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.keyName); + if (message.cipherText != null && Object.hasOwnProperty.call(message, "cipherText")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.cipherText); + return writer; + }; + + /** + * Encodes the specified KMSEnvMap message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Environment.KMSEnvMap.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap + * @static + * @param {google.cloud.batch.v1alpha.Environment.IKMSEnvMap} message KMSEnvMap message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KMSEnvMap.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KMSEnvMap message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.Environment.KMSEnvMap} KMSEnvMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KMSEnvMap.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Environment.KMSEnvMap(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.keyName = reader.string(); + break; + } + case 2: { + message.cipherText = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KMSEnvMap message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.Environment.KMSEnvMap} KMSEnvMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KMSEnvMap.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KMSEnvMap message. + * @function verify + * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KMSEnvMap.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keyName != null && message.hasOwnProperty("keyName")) + if (!$util.isString(message.keyName)) + return "keyName: string expected"; + if (message.cipherText != null && message.hasOwnProperty("cipherText")) + if (!$util.isString(message.cipherText)) + return "cipherText: string expected"; + return null; + }; + + /** + * Creates a KMSEnvMap message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.Environment.KMSEnvMap} KMSEnvMap + */ + KMSEnvMap.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.Environment.KMSEnvMap) + return object; + var message = new $root.google.cloud.batch.v1alpha.Environment.KMSEnvMap(); + if (object.keyName != null) + message.keyName = String(object.keyName); + if (object.cipherText != null) + message.cipherText = String(object.cipherText); + return message; + }; + + /** + * Creates a plain object from a KMSEnvMap message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap + * @static + * @param {google.cloud.batch.v1alpha.Environment.KMSEnvMap} message KMSEnvMap + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KMSEnvMap.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.keyName = ""; + object.cipherText = ""; + } + if (message.keyName != null && message.hasOwnProperty("keyName")) + object.keyName = message.keyName; + if (message.cipherText != null && message.hasOwnProperty("cipherText")) + object.cipherText = message.cipherText; + return object; + }; + + /** + * Converts this KMSEnvMap to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap + * @instance + * @returns {Object.} JSON object + */ + KMSEnvMap.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KMSEnvMap + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KMSEnvMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.Environment.KMSEnvMap"; + }; + + return KMSEnvMap; + })(); + + return Environment; + })(); + + v1alpha.Volume = (function() { + + /** + * Properties of a Volume. + * @memberof google.cloud.batch.v1alpha + * @interface IVolume + * @property {google.cloud.batch.v1alpha.INFS|null} [nfs] Volume nfs + * @property {google.cloud.batch.v1alpha.IPD|null} [pd] Volume pd + * @property {google.cloud.batch.v1alpha.IGCS|null} [gcs] Volume gcs + * @property {string|null} [deviceName] Volume deviceName + * @property {string|null} [mountPath] Volume mountPath + * @property {Array.|null} [mountOptions] Volume mountOptions + */ + + /** + * Constructs a new Volume. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a Volume. + * @implements IVolume + * @constructor + * @param {google.cloud.batch.v1alpha.IVolume=} [properties] Properties to set + */ + function Volume(properties) { + this.mountOptions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Volume nfs. + * @member {google.cloud.batch.v1alpha.INFS|null|undefined} nfs + * @memberof google.cloud.batch.v1alpha.Volume + * @instance + */ + Volume.prototype.nfs = null; + + /** + * Volume pd. + * @member {google.cloud.batch.v1alpha.IPD|null|undefined} pd + * @memberof google.cloud.batch.v1alpha.Volume + * @instance + */ + Volume.prototype.pd = null; + + /** + * Volume gcs. + * @member {google.cloud.batch.v1alpha.IGCS|null|undefined} gcs + * @memberof google.cloud.batch.v1alpha.Volume + * @instance + */ + Volume.prototype.gcs = null; + + /** + * Volume deviceName. + * @member {string|null|undefined} deviceName + * @memberof google.cloud.batch.v1alpha.Volume + * @instance + */ + Volume.prototype.deviceName = null; + + /** + * Volume mountPath. + * @member {string} mountPath + * @memberof google.cloud.batch.v1alpha.Volume + * @instance + */ + Volume.prototype.mountPath = ""; + + /** + * Volume mountOptions. + * @member {Array.} mountOptions + * @memberof google.cloud.batch.v1alpha.Volume + * @instance + */ + Volume.prototype.mountOptions = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Volume source. + * @member {"nfs"|"pd"|"gcs"|"deviceName"|undefined} source + * @memberof google.cloud.batch.v1alpha.Volume + * @instance + */ + Object.defineProperty(Volume.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["nfs", "pd", "gcs", "deviceName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Volume instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.Volume + * @static + * @param {google.cloud.batch.v1alpha.IVolume=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.Volume} Volume instance + */ + Volume.create = function create(properties) { + return new Volume(properties); + }; + + /** + * Encodes the specified Volume message. Does not implicitly {@link google.cloud.batch.v1alpha.Volume.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.Volume + * @static + * @param {google.cloud.batch.v1alpha.IVolume} message Volume message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Volume.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nfs != null && Object.hasOwnProperty.call(message, "nfs")) + $root.google.cloud.batch.v1alpha.NFS.encode(message.nfs, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pd != null && Object.hasOwnProperty.call(message, "pd")) + $root.google.cloud.batch.v1alpha.PD.encode(message.pd, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.gcs != null && Object.hasOwnProperty.call(message, "gcs")) + $root.google.cloud.batch.v1alpha.GCS.encode(message.gcs, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.mountPath != null && Object.hasOwnProperty.call(message, "mountPath")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.mountPath); + if (message.mountOptions != null && message.mountOptions.length) + for (var i = 0; i < message.mountOptions.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.mountOptions[i]); + if (message.deviceName != null && Object.hasOwnProperty.call(message, "deviceName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.deviceName); + return writer; + }; + + /** + * Encodes the specified Volume message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Volume.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.Volume + * @static + * @param {google.cloud.batch.v1alpha.IVolume} message Volume message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Volume.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Volume message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.Volume + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.Volume} Volume + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Volume.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Volume(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nfs = $root.google.cloud.batch.v1alpha.NFS.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pd = $root.google.cloud.batch.v1alpha.PD.decode(reader, reader.uint32()); + break; + } + case 3: { + message.gcs = $root.google.cloud.batch.v1alpha.GCS.decode(reader, reader.uint32()); + break; + } + case 6: { + message.deviceName = reader.string(); + break; + } + case 4: { + message.mountPath = reader.string(); + break; + } + case 5: { + if (!(message.mountOptions && message.mountOptions.length)) + message.mountOptions = []; + message.mountOptions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Volume message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.Volume + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.Volume} Volume + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Volume.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Volume message. + * @function verify + * @memberof google.cloud.batch.v1alpha.Volume + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Volume.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nfs != null && message.hasOwnProperty("nfs")) { + properties.source = 1; + { + var error = $root.google.cloud.batch.v1alpha.NFS.verify(message.nfs); + if (error) + return "nfs." + error; + } + } + if (message.pd != null && message.hasOwnProperty("pd")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.batch.v1alpha.PD.verify(message.pd); + if (error) + return "pd." + error; + } + } + if (message.gcs != null && message.hasOwnProperty("gcs")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.batch.v1alpha.GCS.verify(message.gcs); + if (error) + return "gcs." + error; + } + } + if (message.deviceName != null && message.hasOwnProperty("deviceName")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!$util.isString(message.deviceName)) + return "deviceName: string expected"; + } + if (message.mountPath != null && message.hasOwnProperty("mountPath")) + if (!$util.isString(message.mountPath)) + return "mountPath: string expected"; + if (message.mountOptions != null && message.hasOwnProperty("mountOptions")) { + if (!Array.isArray(message.mountOptions)) + return "mountOptions: array expected"; + for (var i = 0; i < message.mountOptions.length; ++i) + if (!$util.isString(message.mountOptions[i])) + return "mountOptions: string[] expected"; + } + return null; + }; + + /** + * Creates a Volume message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.Volume + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.Volume} Volume + */ + Volume.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.Volume) + return object; + var message = new $root.google.cloud.batch.v1alpha.Volume(); + if (object.nfs != null) { + if (typeof object.nfs !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Volume.nfs: object expected"); + message.nfs = $root.google.cloud.batch.v1alpha.NFS.fromObject(object.nfs); + } + if (object.pd != null) { + if (typeof object.pd !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Volume.pd: object expected"); + message.pd = $root.google.cloud.batch.v1alpha.PD.fromObject(object.pd); + } + if (object.gcs != null) { + if (typeof object.gcs !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Volume.gcs: object expected"); + message.gcs = $root.google.cloud.batch.v1alpha.GCS.fromObject(object.gcs); + } + if (object.deviceName != null) + message.deviceName = String(object.deviceName); + if (object.mountPath != null) + message.mountPath = String(object.mountPath); + if (object.mountOptions) { + if (!Array.isArray(object.mountOptions)) + throw TypeError(".google.cloud.batch.v1alpha.Volume.mountOptions: array expected"); + message.mountOptions = []; + for (var i = 0; i < object.mountOptions.length; ++i) + message.mountOptions[i] = String(object.mountOptions[i]); + } + return message; + }; + + /** + * Creates a plain object from a Volume message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.Volume + * @static + * @param {google.cloud.batch.v1alpha.Volume} message Volume + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Volume.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.mountOptions = []; + if (options.defaults) + object.mountPath = ""; + if (message.nfs != null && message.hasOwnProperty("nfs")) { + object.nfs = $root.google.cloud.batch.v1alpha.NFS.toObject(message.nfs, options); + if (options.oneofs) + object.source = "nfs"; + } + if (message.pd != null && message.hasOwnProperty("pd")) { + object.pd = $root.google.cloud.batch.v1alpha.PD.toObject(message.pd, options); + if (options.oneofs) + object.source = "pd"; + } + if (message.gcs != null && message.hasOwnProperty("gcs")) { + object.gcs = $root.google.cloud.batch.v1alpha.GCS.toObject(message.gcs, options); + if (options.oneofs) + object.source = "gcs"; + } + if (message.mountPath != null && message.hasOwnProperty("mountPath")) + object.mountPath = message.mountPath; + if (message.mountOptions && message.mountOptions.length) { + object.mountOptions = []; + for (var j = 0; j < message.mountOptions.length; ++j) + object.mountOptions[j] = message.mountOptions[j]; + } + if (message.deviceName != null && message.hasOwnProperty("deviceName")) { + object.deviceName = message.deviceName; + if (options.oneofs) + object.source = "deviceName"; + } + return object; + }; + + /** + * Converts this Volume to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.Volume + * @instance + * @returns {Object.} JSON object + */ + Volume.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Volume + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.Volume + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Volume.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.Volume"; + }; + + return Volume; + })(); + + v1alpha.NFS = (function() { + + /** + * Properties of a NFS. + * @memberof google.cloud.batch.v1alpha + * @interface INFS + * @property {string|null} [server] NFS server + * @property {string|null} [remotePath] NFS remotePath + */ + + /** + * Constructs a new NFS. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a NFS. + * @implements INFS + * @constructor + * @param {google.cloud.batch.v1alpha.INFS=} [properties] Properties to set + */ + function NFS(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NFS server. + * @member {string} server + * @memberof google.cloud.batch.v1alpha.NFS + * @instance + */ + NFS.prototype.server = ""; + + /** + * NFS remotePath. + * @member {string} remotePath + * @memberof google.cloud.batch.v1alpha.NFS + * @instance + */ + NFS.prototype.remotePath = ""; + + /** + * Creates a new NFS instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.NFS + * @static + * @param {google.cloud.batch.v1alpha.INFS=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.NFS} NFS instance + */ + NFS.create = function create(properties) { + return new NFS(properties); + }; + + /** + * Encodes the specified NFS message. Does not implicitly {@link google.cloud.batch.v1alpha.NFS.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.NFS + * @static + * @param {google.cloud.batch.v1alpha.INFS} message NFS message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NFS.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.server != null && Object.hasOwnProperty.call(message, "server")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.server); + if (message.remotePath != null && Object.hasOwnProperty.call(message, "remotePath")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.remotePath); + return writer; + }; + + /** + * Encodes the specified NFS message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.NFS.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.NFS + * @static + * @param {google.cloud.batch.v1alpha.INFS} message NFS message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NFS.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NFS message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.NFS + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.NFS} NFS + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NFS.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.NFS(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.server = reader.string(); + break; + } + case 2: { + message.remotePath = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NFS message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.NFS + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.NFS} NFS + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NFS.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NFS message. + * @function verify + * @memberof google.cloud.batch.v1alpha.NFS + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NFS.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.server != null && message.hasOwnProperty("server")) + if (!$util.isString(message.server)) + return "server: string expected"; + if (message.remotePath != null && message.hasOwnProperty("remotePath")) + if (!$util.isString(message.remotePath)) + return "remotePath: string expected"; + return null; + }; + + /** + * Creates a NFS message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.NFS + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.NFS} NFS + */ + NFS.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.NFS) + return object; + var message = new $root.google.cloud.batch.v1alpha.NFS(); + if (object.server != null) + message.server = String(object.server); + if (object.remotePath != null) + message.remotePath = String(object.remotePath); + return message; + }; + + /** + * Creates a plain object from a NFS message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.NFS + * @static + * @param {google.cloud.batch.v1alpha.NFS} message NFS + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NFS.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.server = ""; + object.remotePath = ""; + } + if (message.server != null && message.hasOwnProperty("server")) + object.server = message.server; + if (message.remotePath != null && message.hasOwnProperty("remotePath")) + object.remotePath = message.remotePath; + return object; + }; + + /** + * Converts this NFS to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.NFS + * @instance + * @returns {Object.} JSON object + */ + NFS.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NFS + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.NFS + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NFS.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.NFS"; + }; + + return NFS; + })(); + + v1alpha.PD = (function() { + + /** + * Properties of a PD. + * @memberof google.cloud.batch.v1alpha + * @interface IPD + * @property {string|null} [disk] PD disk + * @property {string|null} [device] PD device + * @property {boolean|null} [existing] PD existing + */ + + /** + * Constructs a new PD. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a PD. + * @implements IPD + * @constructor + * @param {google.cloud.batch.v1alpha.IPD=} [properties] Properties to set + */ + function PD(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PD disk. + * @member {string} disk + * @memberof google.cloud.batch.v1alpha.PD + * @instance + */ + PD.prototype.disk = ""; + + /** + * PD device. + * @member {string} device + * @memberof google.cloud.batch.v1alpha.PD + * @instance + */ + PD.prototype.device = ""; + + /** + * PD existing. + * @member {boolean} existing + * @memberof google.cloud.batch.v1alpha.PD + * @instance + */ + PD.prototype.existing = false; + + /** + * Creates a new PD instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.PD + * @static + * @param {google.cloud.batch.v1alpha.IPD=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.PD} PD instance + */ + PD.create = function create(properties) { + return new PD(properties); + }; + + /** + * Encodes the specified PD message. Does not implicitly {@link google.cloud.batch.v1alpha.PD.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.PD + * @static + * @param {google.cloud.batch.v1alpha.IPD} message PD message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PD.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.disk != null && Object.hasOwnProperty.call(message, "disk")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.disk); + if (message.device != null && Object.hasOwnProperty.call(message, "device")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.device); + if (message.existing != null && Object.hasOwnProperty.call(message, "existing")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.existing); + return writer; + }; + + /** + * Encodes the specified PD message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.PD.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.PD + * @static + * @param {google.cloud.batch.v1alpha.IPD} message PD message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PD.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PD message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.PD + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.PD} PD + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PD.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.PD(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.disk = reader.string(); + break; + } + case 2: { + message.device = reader.string(); + break; + } + case 3: { + message.existing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PD message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.PD + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.PD} PD + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PD.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PD message. + * @function verify + * @memberof google.cloud.batch.v1alpha.PD + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PD.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.disk != null && message.hasOwnProperty("disk")) + if (!$util.isString(message.disk)) + return "disk: string expected"; + if (message.device != null && message.hasOwnProperty("device")) + if (!$util.isString(message.device)) + return "device: string expected"; + if (message.existing != null && message.hasOwnProperty("existing")) + if (typeof message.existing !== "boolean") + return "existing: boolean expected"; + return null; + }; + + /** + * Creates a PD message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.PD + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.PD} PD + */ + PD.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.PD) + return object; + var message = new $root.google.cloud.batch.v1alpha.PD(); + if (object.disk != null) + message.disk = String(object.disk); + if (object.device != null) + message.device = String(object.device); + if (object.existing != null) + message.existing = Boolean(object.existing); + return message; + }; + + /** + * Creates a plain object from a PD message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.PD + * @static + * @param {google.cloud.batch.v1alpha.PD} message PD + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PD.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.disk = ""; + object.device = ""; + object.existing = false; + } + if (message.disk != null && message.hasOwnProperty("disk")) + object.disk = message.disk; + if (message.device != null && message.hasOwnProperty("device")) + object.device = message.device; + if (message.existing != null && message.hasOwnProperty("existing")) + object.existing = message.existing; + return object; + }; + + /** + * Converts this PD to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.PD + * @instance + * @returns {Object.} JSON object + */ + PD.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PD + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.PD + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PD.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.PD"; + }; + + return PD; + })(); + + v1alpha.GCS = (function() { + + /** + * Properties of a GCS. + * @memberof google.cloud.batch.v1alpha + * @interface IGCS + * @property {string|null} [remotePath] GCS remotePath + */ + + /** + * Constructs a new GCS. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a GCS. + * @implements IGCS + * @constructor + * @param {google.cloud.batch.v1alpha.IGCS=} [properties] Properties to set + */ + function GCS(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GCS remotePath. + * @member {string} remotePath + * @memberof google.cloud.batch.v1alpha.GCS + * @instance + */ + GCS.prototype.remotePath = ""; + + /** + * Creates a new GCS instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.GCS + * @static + * @param {google.cloud.batch.v1alpha.IGCS=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.GCS} GCS instance + */ + GCS.create = function create(properties) { + return new GCS(properties); + }; + + /** + * Encodes the specified GCS message. Does not implicitly {@link google.cloud.batch.v1alpha.GCS.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.GCS + * @static + * @param {google.cloud.batch.v1alpha.IGCS} message GCS message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GCS.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.remotePath != null && Object.hasOwnProperty.call(message, "remotePath")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.remotePath); + return writer; + }; + + /** + * Encodes the specified GCS message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.GCS.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.GCS + * @static + * @param {google.cloud.batch.v1alpha.IGCS} message GCS message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GCS.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GCS message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.GCS + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.GCS} GCS + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GCS.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.GCS(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.remotePath = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GCS message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.GCS + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.GCS} GCS + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GCS.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GCS message. + * @function verify + * @memberof google.cloud.batch.v1alpha.GCS + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GCS.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.remotePath != null && message.hasOwnProperty("remotePath")) + if (!$util.isString(message.remotePath)) + return "remotePath: string expected"; + return null; + }; + + /** + * Creates a GCS message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.GCS + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.GCS} GCS + */ + GCS.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.GCS) + return object; + var message = new $root.google.cloud.batch.v1alpha.GCS(); + if (object.remotePath != null) + message.remotePath = String(object.remotePath); + return message; + }; + + /** + * Creates a plain object from a GCS message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.GCS + * @static + * @param {google.cloud.batch.v1alpha.GCS} message GCS + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GCS.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.remotePath = ""; + if (message.remotePath != null && message.hasOwnProperty("remotePath")) + object.remotePath = message.remotePath; + return object; + }; + + /** + * Converts this GCS to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.GCS + * @instance + * @returns {Object.} JSON object + */ + GCS.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GCS + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.GCS + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GCS.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.GCS"; + }; + + return GCS; + })(); + + /** + * CalendarPeriod enum. + * @name google.cloud.batch.v1alpha.CalendarPeriod + * @enum {number} + * @property {number} CALENDAR_PERIOD_UNSPECIFIED=0 CALENDAR_PERIOD_UNSPECIFIED value + * @property {number} MONTH=1 MONTH value + * @property {number} QUARTER=2 QUARTER value + * @property {number} YEAR=3 YEAR value + * @property {number} WEEK=4 WEEK value + * @property {number} DAY=5 DAY value + */ + v1alpha.CalendarPeriod = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CALENDAR_PERIOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "MONTH"] = 1; + values[valuesById[2] = "QUARTER"] = 2; + values[valuesById[3] = "YEAR"] = 3; + values[valuesById[4] = "WEEK"] = 4; + values[valuesById[5] = "DAY"] = 5; + return values; + })(); + + /** + * ResourceAllowanceState enum. + * @name google.cloud.batch.v1alpha.ResourceAllowanceState + * @enum {number} + * @property {number} RESOURCE_ALLOWANCE_STATE_UNSPECIFIED=0 RESOURCE_ALLOWANCE_STATE_UNSPECIFIED value + * @property {number} RESOURCE_ALLOWANCE_ACTIVE=1 RESOURCE_ALLOWANCE_ACTIVE value + * @property {number} RESOURCE_ALLOWANCE_DEPLETED=2 RESOURCE_ALLOWANCE_DEPLETED value + */ + v1alpha.ResourceAllowanceState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESOURCE_ALLOWANCE_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESOURCE_ALLOWANCE_ACTIVE"] = 1; + values[valuesById[2] = "RESOURCE_ALLOWANCE_DEPLETED"] = 2; + return values; + })(); + + v1alpha.ResourceAllowance = (function() { + + /** + * Properties of a ResourceAllowance. + * @memberof google.cloud.batch.v1alpha + * @interface IResourceAllowance + * @property {google.cloud.batch.v1alpha.IUsageResourceAllowance|null} [usageResourceAllowance] ResourceAllowance usageResourceAllowance + * @property {string|null} [name] ResourceAllowance name + * @property {string|null} [uid] ResourceAllowance uid + * @property {google.protobuf.ITimestamp|null} [createTime] ResourceAllowance createTime + * @property {Object.|null} [labels] ResourceAllowance labels + * @property {Array.|null} [notifications] ResourceAllowance notifications + */ + + /** + * Constructs a new ResourceAllowance. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a ResourceAllowance. + * @implements IResourceAllowance + * @constructor + * @param {google.cloud.batch.v1alpha.IResourceAllowance=} [properties] Properties to set + */ + function ResourceAllowance(properties) { + this.labels = {}; + this.notifications = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceAllowance usageResourceAllowance. + * @member {google.cloud.batch.v1alpha.IUsageResourceAllowance|null|undefined} usageResourceAllowance + * @memberof google.cloud.batch.v1alpha.ResourceAllowance + * @instance + */ + ResourceAllowance.prototype.usageResourceAllowance = null; + + /** + * ResourceAllowance name. + * @member {string} name + * @memberof google.cloud.batch.v1alpha.ResourceAllowance + * @instance + */ + ResourceAllowance.prototype.name = ""; + + /** + * ResourceAllowance uid. + * @member {string} uid + * @memberof google.cloud.batch.v1alpha.ResourceAllowance + * @instance + */ + ResourceAllowance.prototype.uid = ""; + + /** + * ResourceAllowance createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.batch.v1alpha.ResourceAllowance + * @instance + */ + ResourceAllowance.prototype.createTime = null; + + /** + * ResourceAllowance labels. + * @member {Object.} labels + * @memberof google.cloud.batch.v1alpha.ResourceAllowance + * @instance + */ + ResourceAllowance.prototype.labels = $util.emptyObject; + + /** + * ResourceAllowance notifications. + * @member {Array.} notifications + * @memberof google.cloud.batch.v1alpha.ResourceAllowance + * @instance + */ + ResourceAllowance.prototype.notifications = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResourceAllowance resourceAllowance. + * @member {"usageResourceAllowance"|undefined} resourceAllowance + * @memberof google.cloud.batch.v1alpha.ResourceAllowance + * @instance + */ + Object.defineProperty(ResourceAllowance.prototype, "resourceAllowance", { + get: $util.oneOfGetter($oneOfFields = ["usageResourceAllowance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResourceAllowance instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.ResourceAllowance + * @static + * @param {google.cloud.batch.v1alpha.IResourceAllowance=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.ResourceAllowance} ResourceAllowance instance + */ + ResourceAllowance.create = function create(properties) { + return new ResourceAllowance(properties); + }; + + /** + * Encodes the specified ResourceAllowance message. Does not implicitly {@link google.cloud.batch.v1alpha.ResourceAllowance.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.ResourceAllowance + * @static + * @param {google.cloud.batch.v1alpha.IResourceAllowance} message ResourceAllowance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceAllowance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.usageResourceAllowance != null && Object.hasOwnProperty.call(message, "usageResourceAllowance")) + $root.google.cloud.batch.v1alpha.UsageResourceAllowance.encode(message.usageResourceAllowance, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.notifications != null && message.notifications.length) + for (var i = 0; i < message.notifications.length; ++i) + $root.google.cloud.batch.v1alpha.Notification.encode(message.notifications[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResourceAllowance message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ResourceAllowance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.ResourceAllowance + * @static + * @param {google.cloud.batch.v1alpha.IResourceAllowance} message ResourceAllowance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceAllowance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceAllowance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.ResourceAllowance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.ResourceAllowance} ResourceAllowance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceAllowance.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ResourceAllowance(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.usageResourceAllowance = $root.google.cloud.batch.v1alpha.UsageResourceAllowance.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.uid = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 6: { + if (!(message.notifications && message.notifications.length)) + message.notifications = []; + message.notifications.push($root.google.cloud.batch.v1alpha.Notification.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceAllowance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.ResourceAllowance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.ResourceAllowance} ResourceAllowance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceAllowance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceAllowance message. + * @function verify + * @memberof google.cloud.batch.v1alpha.ResourceAllowance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceAllowance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.usageResourceAllowance != null && message.hasOwnProperty("usageResourceAllowance")) { + properties.resourceAllowance = 1; + { + var error = $root.google.cloud.batch.v1alpha.UsageResourceAllowance.verify(message.usageResourceAllowance); + if (error) + return "usageResourceAllowance." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.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.notifications != null && message.hasOwnProperty("notifications")) { + if (!Array.isArray(message.notifications)) + return "notifications: array expected"; + for (var i = 0; i < message.notifications.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.Notification.verify(message.notifications[i]); + if (error) + return "notifications." + error; + } + } + return null; + }; + + /** + * Creates a ResourceAllowance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.ResourceAllowance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.ResourceAllowance} ResourceAllowance + */ + ResourceAllowance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.ResourceAllowance) + return object; + var message = new $root.google.cloud.batch.v1alpha.ResourceAllowance(); + if (object.usageResourceAllowance != null) { + if (typeof object.usageResourceAllowance !== "object") + throw TypeError(".google.cloud.batch.v1alpha.ResourceAllowance.usageResourceAllowance: object expected"); + message.usageResourceAllowance = $root.google.cloud.batch.v1alpha.UsageResourceAllowance.fromObject(object.usageResourceAllowance); + } + if (object.name != null) + message.name = String(object.name); + if (object.uid != null) + message.uid = String(object.uid); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.batch.v1alpha.ResourceAllowance.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.batch.v1alpha.ResourceAllowance.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.notifications) { + if (!Array.isArray(object.notifications)) + throw TypeError(".google.cloud.batch.v1alpha.ResourceAllowance.notifications: array expected"); + message.notifications = []; + for (var i = 0; i < object.notifications.length; ++i) { + if (typeof object.notifications[i] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.ResourceAllowance.notifications: object expected"); + message.notifications[i] = $root.google.cloud.batch.v1alpha.Notification.fromObject(object.notifications[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceAllowance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.ResourceAllowance + * @static + * @param {google.cloud.batch.v1alpha.ResourceAllowance} message ResourceAllowance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceAllowance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.notifications = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.uid = ""; + object.createTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.usageResourceAllowance != null && message.hasOwnProperty("usageResourceAllowance")) { + object.usageResourceAllowance = $root.google.cloud.batch.v1alpha.UsageResourceAllowance.toObject(message.usageResourceAllowance, options); + if (options.oneofs) + object.resourceAllowance = "usageResourceAllowance"; + } + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.notifications && message.notifications.length) { + object.notifications = []; + for (var j = 0; j < message.notifications.length; ++j) + object.notifications[j] = $root.google.cloud.batch.v1alpha.Notification.toObject(message.notifications[j], options); + } + return object; + }; + + /** + * Converts this ResourceAllowance to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.ResourceAllowance + * @instance + * @returns {Object.} JSON object + */ + ResourceAllowance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceAllowance + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.ResourceAllowance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceAllowance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.ResourceAllowance"; + }; + + return ResourceAllowance; + })(); + + v1alpha.UsageResourceAllowance = (function() { + + /** + * Properties of a UsageResourceAllowance. + * @memberof google.cloud.batch.v1alpha + * @interface IUsageResourceAllowance + * @property {google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec|null} [spec] UsageResourceAllowance spec + * @property {google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus|null} [status] UsageResourceAllowance status + */ + + /** + * Constructs a new UsageResourceAllowance. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a UsageResourceAllowance. + * @implements IUsageResourceAllowance + * @constructor + * @param {google.cloud.batch.v1alpha.IUsageResourceAllowance=} [properties] Properties to set + */ + function UsageResourceAllowance(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UsageResourceAllowance spec. + * @member {google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec|null|undefined} spec + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance + * @instance + */ + UsageResourceAllowance.prototype.spec = null; + + /** + * UsageResourceAllowance status. + * @member {google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus|null|undefined} status + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance + * @instance + */ + UsageResourceAllowance.prototype.status = null; + + /** + * Creates a new UsageResourceAllowance instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance + * @static + * @param {google.cloud.batch.v1alpha.IUsageResourceAllowance=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowance} UsageResourceAllowance instance + */ + UsageResourceAllowance.create = function create(properties) { + return new UsageResourceAllowance(properties); + }; + + /** + * Encodes the specified UsageResourceAllowance message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowance.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance + * @static + * @param {google.cloud.batch.v1alpha.IUsageResourceAllowance} message UsageResourceAllowance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UsageResourceAllowance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.spec != null && Object.hasOwnProperty.call(message, "spec")) + $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.encode(message.spec, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UsageResourceAllowance message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance + * @static + * @param {google.cloud.batch.v1alpha.IUsageResourceAllowance} message UsageResourceAllowance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UsageResourceAllowance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UsageResourceAllowance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowance} UsageResourceAllowance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UsageResourceAllowance.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowance(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.spec = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.decode(reader, reader.uint32()); + break; + } + case 2: { + message.status = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UsageResourceAllowance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowance} UsageResourceAllowance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UsageResourceAllowance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UsageResourceAllowance message. + * @function verify + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UsageResourceAllowance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.spec != null && message.hasOwnProperty("spec")) { + var error = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.verify(message.spec); + if (error) + return "spec." + error; + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.verify(message.status); + if (error) + return "status." + error; + } + return null; + }; + + /** + * Creates a UsageResourceAllowance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowance} UsageResourceAllowance + */ + UsageResourceAllowance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.UsageResourceAllowance) + return object; + var message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowance(); + if (object.spec != null) { + if (typeof object.spec !== "object") + throw TypeError(".google.cloud.batch.v1alpha.UsageResourceAllowance.spec: object expected"); + message.spec = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.fromObject(object.spec); + } + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.batch.v1alpha.UsageResourceAllowance.status: object expected"); + message.status = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.fromObject(object.status); + } + return message; + }; + + /** + * Creates a plain object from a UsageResourceAllowance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowance} message UsageResourceAllowance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UsageResourceAllowance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.spec = null; + object.status = null; + } + if (message.spec != null && message.hasOwnProperty("spec")) + object.spec = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.toObject(message.spec, options); + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.toObject(message.status, options); + return object; + }; + + /** + * Converts this UsageResourceAllowance to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance + * @instance + * @returns {Object.} JSON object + */ + UsageResourceAllowance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UsageResourceAllowance + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UsageResourceAllowance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.UsageResourceAllowance"; + }; + + return UsageResourceAllowance; + })(); + + v1alpha.UsageResourceAllowanceSpec = (function() { + + /** + * Properties of a UsageResourceAllowanceSpec. + * @memberof google.cloud.batch.v1alpha + * @interface IUsageResourceAllowanceSpec + * @property {string|null} [type] UsageResourceAllowanceSpec type + * @property {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit|null} [limit] UsageResourceAllowanceSpec limit + */ + + /** + * Constructs a new UsageResourceAllowanceSpec. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a UsageResourceAllowanceSpec. + * @implements IUsageResourceAllowanceSpec + * @constructor + * @param {google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec=} [properties] Properties to set + */ + function UsageResourceAllowanceSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UsageResourceAllowanceSpec type. + * @member {string} type + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec + * @instance + */ + UsageResourceAllowanceSpec.prototype.type = ""; + + /** + * UsageResourceAllowanceSpec limit. + * @member {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit|null|undefined} limit + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec + * @instance + */ + UsageResourceAllowanceSpec.prototype.limit = null; + + /** + * Creates a new UsageResourceAllowanceSpec instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec + * @static + * @param {google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec} UsageResourceAllowanceSpec instance + */ + UsageResourceAllowanceSpec.create = function create(properties) { + return new UsageResourceAllowanceSpec(properties); + }; + + /** + * Encodes the specified UsageResourceAllowanceSpec message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec + * @static + * @param {google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec} message UsageResourceAllowanceSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UsageResourceAllowanceSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit.encode(message.limit, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UsageResourceAllowanceSpec message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec + * @static + * @param {google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec} message UsageResourceAllowanceSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UsageResourceAllowanceSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UsageResourceAllowanceSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec} UsageResourceAllowanceSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UsageResourceAllowanceSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.limit = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UsageResourceAllowanceSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec} UsageResourceAllowanceSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UsageResourceAllowanceSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UsageResourceAllowanceSpec message. + * @function verify + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UsageResourceAllowanceSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.limit != null && message.hasOwnProperty("limit")) { + var error = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit.verify(message.limit); + if (error) + return "limit." + error; + } + return null; + }; + + /** + * Creates a UsageResourceAllowanceSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec} UsageResourceAllowanceSpec + */ + UsageResourceAllowanceSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec) + return object; + var message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec(); + if (object.type != null) + message.type = String(object.type); + if (object.limit != null) { + if (typeof object.limit !== "object") + throw TypeError(".google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.limit: object expected"); + message.limit = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit.fromObject(object.limit); + } + return message; + }; + + /** + * Creates a plain object from a UsageResourceAllowanceSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec} message UsageResourceAllowanceSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UsageResourceAllowanceSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.limit = null; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit.toObject(message.limit, options); + return object; + }; + + /** + * Converts this UsageResourceAllowanceSpec to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec + * @instance + * @returns {Object.} JSON object + */ + UsageResourceAllowanceSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UsageResourceAllowanceSpec + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UsageResourceAllowanceSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.UsageResourceAllowanceSpec"; + }; + + UsageResourceAllowanceSpec.Limit = (function() { + + /** + * Properties of a Limit. + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec + * @interface ILimit + * @property {google.cloud.batch.v1alpha.CalendarPeriod|null} [calendarPeriod] Limit calendarPeriod + * @property {number|null} [limit] Limit limit + */ + + /** + * Constructs a new Limit. + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec + * @classdesc Represents a Limit. + * @implements ILimit + * @constructor + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit=} [properties] Properties to set + */ + function Limit(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Limit calendarPeriod. + * @member {google.cloud.batch.v1alpha.CalendarPeriod|null|undefined} calendarPeriod + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit + * @instance + */ + Limit.prototype.calendarPeriod = null; + + /** + * Limit limit. + * @member {number|null|undefined} limit + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit + * @instance + */ + Limit.prototype.limit = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Limit duration. + * @member {"calendarPeriod"|undefined} duration + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit + * @instance + */ + Object.defineProperty(Limit.prototype, "duration", { + get: $util.oneOfGetter($oneOfFields = ["calendarPeriod"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Limit _limit. + * @member {"limit"|undefined} _limit + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit + * @instance + */ + Object.defineProperty(Limit.prototype, "_limit", { + get: $util.oneOfGetter($oneOfFields = ["limit"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Limit instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit} Limit instance + */ + Limit.create = function create(properties) { + return new Limit(properties); + }; + + /** + * Encodes the specified Limit message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit} message Limit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Limit.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.calendarPeriod != null && Object.hasOwnProperty.call(message, "calendarPeriod")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.calendarPeriod); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.limit); + return writer; + }; + + /** + * Encodes the specified Limit message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit} message Limit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Limit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Limit message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit} Limit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Limit.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.calendarPeriod = reader.int32(); + break; + } + case 2: { + message.limit = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Limit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit} Limit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Limit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Limit message. + * @function verify + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Limit.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.calendarPeriod != null && message.hasOwnProperty("calendarPeriod")) { + properties.duration = 1; + switch (message.calendarPeriod) { + default: + return "calendarPeriod: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + } + if (message.limit != null && message.hasOwnProperty("limit")) { + properties._limit = 1; + if (typeof message.limit !== "number") + return "limit: number expected"; + } + return null; + }; + + /** + * Creates a Limit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit} Limit + */ + Limit.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit) + return object; + var message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit(); + switch (object.calendarPeriod) { + default: + if (typeof object.calendarPeriod === "number") { + message.calendarPeriod = object.calendarPeriod; + break; + } + break; + case "CALENDAR_PERIOD_UNSPECIFIED": + case 0: + message.calendarPeriod = 0; + break; + case "MONTH": + case 1: + message.calendarPeriod = 1; + break; + case "QUARTER": + case 2: + message.calendarPeriod = 2; + break; + case "YEAR": + case 3: + message.calendarPeriod = 3; + break; + case "WEEK": + case 4: + message.calendarPeriod = 4; + break; + case "DAY": + case 5: + message.calendarPeriod = 5; + break; + } + if (object.limit != null) + message.limit = Number(object.limit); + return message; + }; + + /** + * Creates a plain object from a Limit message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit} message Limit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Limit.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.calendarPeriod != null && message.hasOwnProperty("calendarPeriod")) { + object.calendarPeriod = options.enums === String ? $root.google.cloud.batch.v1alpha.CalendarPeriod[message.calendarPeriod] === undefined ? message.calendarPeriod : $root.google.cloud.batch.v1alpha.CalendarPeriod[message.calendarPeriod] : message.calendarPeriod; + if (options.oneofs) + object.duration = "calendarPeriod"; + } + if (message.limit != null && message.hasOwnProperty("limit")) { + object.limit = options.json && !isFinite(message.limit) ? String(message.limit) : message.limit; + if (options.oneofs) + object._limit = "limit"; + } + return object; + }; + + /** + * Converts this Limit to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit + * @instance + * @returns {Object.} JSON object + */ + Limit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Limit + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Limit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit"; + }; + + return Limit; + })(); + + return UsageResourceAllowanceSpec; + })(); + + v1alpha.UsageResourceAllowanceStatus = (function() { + + /** + * Properties of a UsageResourceAllowanceStatus. + * @memberof google.cloud.batch.v1alpha + * @interface IUsageResourceAllowanceStatus + * @property {google.cloud.batch.v1alpha.ResourceAllowanceState|null} [state] UsageResourceAllowanceStatus state + * @property {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus|null} [limitStatus] UsageResourceAllowanceStatus limitStatus + * @property {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport|null} [report] UsageResourceAllowanceStatus report + */ + + /** + * Constructs a new UsageResourceAllowanceStatus. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a UsageResourceAllowanceStatus. + * @implements IUsageResourceAllowanceStatus + * @constructor + * @param {google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus=} [properties] Properties to set + */ + function UsageResourceAllowanceStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UsageResourceAllowanceStatus state. + * @member {google.cloud.batch.v1alpha.ResourceAllowanceState} state + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @instance + */ + UsageResourceAllowanceStatus.prototype.state = 0; + + /** + * UsageResourceAllowanceStatus limitStatus. + * @member {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus|null|undefined} limitStatus + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @instance + */ + UsageResourceAllowanceStatus.prototype.limitStatus = null; + + /** + * UsageResourceAllowanceStatus report. + * @member {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport|null|undefined} report + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @instance + */ + UsageResourceAllowanceStatus.prototype.report = null; + + /** + * Creates a new UsageResourceAllowanceStatus instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @static + * @param {google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus} UsageResourceAllowanceStatus instance + */ + UsageResourceAllowanceStatus.create = function create(properties) { + return new UsageResourceAllowanceStatus(properties); + }; + + /** + * Encodes the specified UsageResourceAllowanceStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @static + * @param {google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus} message UsageResourceAllowanceStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UsageResourceAllowanceStatus.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); + if (message.limitStatus != null && Object.hasOwnProperty.call(message, "limitStatus")) + $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.encode(message.limitStatus, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.report != null && Object.hasOwnProperty.call(message, "report")) + $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.encode(message.report, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UsageResourceAllowanceStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @static + * @param {google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus} message UsageResourceAllowanceStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UsageResourceAllowanceStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UsageResourceAllowanceStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus} UsageResourceAllowanceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UsageResourceAllowanceStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.limitStatus = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.decode(reader, reader.uint32()); + break; + } + case 3: { + message.report = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UsageResourceAllowanceStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus} UsageResourceAllowanceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UsageResourceAllowanceStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UsageResourceAllowanceStatus message. + * @function verify + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UsageResourceAllowanceStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.limitStatus != null && message.hasOwnProperty("limitStatus")) { + var error = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.verify(message.limitStatus); + if (error) + return "limitStatus." + error; + } + if (message.report != null && message.hasOwnProperty("report")) { + var error = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.verify(message.report); + if (error) + return "report." + error; + } + return null; + }; + + /** + * Creates a UsageResourceAllowanceStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus} UsageResourceAllowanceStatus + */ + UsageResourceAllowanceStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus) + return object; + var message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "RESOURCE_ALLOWANCE_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "RESOURCE_ALLOWANCE_ACTIVE": + case 1: + message.state = 1; + break; + case "RESOURCE_ALLOWANCE_DEPLETED": + case 2: + message.state = 2; + break; + } + if (object.limitStatus != null) { + if (typeof object.limitStatus !== "object") + throw TypeError(".google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.limitStatus: object expected"); + message.limitStatus = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.fromObject(object.limitStatus); + } + if (object.report != null) { + if (typeof object.report !== "object") + throw TypeError(".google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.report: object expected"); + message.report = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.fromObject(object.report); + } + return message; + }; + + /** + * Creates a plain object from a UsageResourceAllowanceStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus} message UsageResourceAllowanceStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UsageResourceAllowanceStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "RESOURCE_ALLOWANCE_STATE_UNSPECIFIED" : 0; + object.limitStatus = null; + object.report = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.batch.v1alpha.ResourceAllowanceState[message.state] === undefined ? message.state : $root.google.cloud.batch.v1alpha.ResourceAllowanceState[message.state] : message.state; + if (message.limitStatus != null && message.hasOwnProperty("limitStatus")) + object.limitStatus = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.toObject(message.limitStatus, options); + if (message.report != null && message.hasOwnProperty("report")) + object.report = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.toObject(message.report, options); + return object; + }; + + /** + * Converts this UsageResourceAllowanceStatus to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @instance + * @returns {Object.} JSON object + */ + UsageResourceAllowanceStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UsageResourceAllowanceStatus + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UsageResourceAllowanceStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.UsageResourceAllowanceStatus"; + }; + + UsageResourceAllowanceStatus.LimitStatus = (function() { + + /** + * Properties of a LimitStatus. + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @interface ILimitStatus + * @property {google.type.IInterval|null} [consumptionInterval] LimitStatus consumptionInterval + * @property {number|null} [limit] LimitStatus limit + * @property {number|null} [consumed] LimitStatus consumed + */ + + /** + * Constructs a new LimitStatus. + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @classdesc Represents a LimitStatus. + * @implements ILimitStatus + * @constructor + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus=} [properties] Properties to set + */ + function LimitStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LimitStatus consumptionInterval. + * @member {google.type.IInterval|null|undefined} consumptionInterval + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus + * @instance + */ + LimitStatus.prototype.consumptionInterval = null; + + /** + * LimitStatus limit. + * @member {number|null|undefined} limit + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus + * @instance + */ + LimitStatus.prototype.limit = null; + + /** + * LimitStatus consumed. + * @member {number|null|undefined} consumed + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus + * @instance + */ + LimitStatus.prototype.consumed = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LimitStatus _limit. + * @member {"limit"|undefined} _limit + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus + * @instance + */ + Object.defineProperty(LimitStatus.prototype, "_limit", { + get: $util.oneOfGetter($oneOfFields = ["limit"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * LimitStatus _consumed. + * @member {"consumed"|undefined} _consumed + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus + * @instance + */ + Object.defineProperty(LimitStatus.prototype, "_consumed", { + get: $util.oneOfGetter($oneOfFields = ["consumed"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LimitStatus instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus} LimitStatus instance + */ + LimitStatus.create = function create(properties) { + return new LimitStatus(properties); + }; + + /** + * Encodes the specified LimitStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus} message LimitStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LimitStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.consumptionInterval != null && Object.hasOwnProperty.call(message, "consumptionInterval")) + $root.google.type.Interval.encode(message.consumptionInterval, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.limit); + if (message.consumed != null && Object.hasOwnProperty.call(message, "consumed")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.consumed); + return writer; + }; + + /** + * Encodes the specified LimitStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus} message LimitStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LimitStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LimitStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus} LimitStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LimitStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.consumptionInterval = $root.google.type.Interval.decode(reader, reader.uint32()); + break; + } + case 2: { + message.limit = reader.double(); + break; + } + case 3: { + message.consumed = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LimitStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus} LimitStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LimitStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LimitStatus message. + * @function verify + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LimitStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.consumptionInterval != null && message.hasOwnProperty("consumptionInterval")) { + var error = $root.google.type.Interval.verify(message.consumptionInterval); + if (error) + return "consumptionInterval." + error; + } + if (message.limit != null && message.hasOwnProperty("limit")) { + properties._limit = 1; + if (typeof message.limit !== "number") + return "limit: number expected"; + } + if (message.consumed != null && message.hasOwnProperty("consumed")) { + properties._consumed = 1; + if (typeof message.consumed !== "number") + return "consumed: number expected"; + } + return null; + }; + + /** + * Creates a LimitStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus} LimitStatus + */ + LimitStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus) + return object; + var message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus(); + if (object.consumptionInterval != null) { + if (typeof object.consumptionInterval !== "object") + throw TypeError(".google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.consumptionInterval: object expected"); + message.consumptionInterval = $root.google.type.Interval.fromObject(object.consumptionInterval); + } + if (object.limit != null) + message.limit = Number(object.limit); + if (object.consumed != null) + message.consumed = Number(object.consumed); + return message; + }; + + /** + * Creates a plain object from a LimitStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus} message LimitStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LimitStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.consumptionInterval = null; + if (message.consumptionInterval != null && message.hasOwnProperty("consumptionInterval")) + object.consumptionInterval = $root.google.type.Interval.toObject(message.consumptionInterval, options); + if (message.limit != null && message.hasOwnProperty("limit")) { + object.limit = options.json && !isFinite(message.limit) ? String(message.limit) : message.limit; + if (options.oneofs) + object._limit = "limit"; + } + if (message.consumed != null && message.hasOwnProperty("consumed")) { + object.consumed = options.json && !isFinite(message.consumed) ? String(message.consumed) : message.consumed; + if (options.oneofs) + object._consumed = "consumed"; + } + return object; + }; + + /** + * Converts this LimitStatus to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus + * @instance + * @returns {Object.} JSON object + */ + LimitStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LimitStatus + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LimitStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus"; + }; + + return LimitStatus; + })(); + + UsageResourceAllowanceStatus.PeriodConsumption = (function() { + + /** + * Properties of a PeriodConsumption. + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @interface IPeriodConsumption + * @property {google.type.IInterval|null} [consumptionInterval] PeriodConsumption consumptionInterval + * @property {number|null} [consumed] PeriodConsumption consumed + */ + + /** + * Constructs a new PeriodConsumption. + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @classdesc Represents a PeriodConsumption. + * @implements IPeriodConsumption + * @constructor + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption=} [properties] Properties to set + */ + function PeriodConsumption(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PeriodConsumption consumptionInterval. + * @member {google.type.IInterval|null|undefined} consumptionInterval + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption + * @instance + */ + PeriodConsumption.prototype.consumptionInterval = null; + + /** + * PeriodConsumption consumed. + * @member {number|null|undefined} consumed + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption + * @instance + */ + PeriodConsumption.prototype.consumed = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PeriodConsumption _consumed. + * @member {"consumed"|undefined} _consumed + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption + * @instance + */ + Object.defineProperty(PeriodConsumption.prototype, "_consumed", { + get: $util.oneOfGetter($oneOfFields = ["consumed"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PeriodConsumption instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption} PeriodConsumption instance + */ + PeriodConsumption.create = function create(properties) { + return new PeriodConsumption(properties); + }; + + /** + * Encodes the specified PeriodConsumption message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption} message PeriodConsumption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PeriodConsumption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.consumptionInterval != null && Object.hasOwnProperty.call(message, "consumptionInterval")) + $root.google.type.Interval.encode(message.consumptionInterval, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.consumed != null && Object.hasOwnProperty.call(message, "consumed")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.consumed); + return writer; + }; + + /** + * Encodes the specified PeriodConsumption message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption} message PeriodConsumption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PeriodConsumption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PeriodConsumption message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption} PeriodConsumption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PeriodConsumption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.consumptionInterval = $root.google.type.Interval.decode(reader, reader.uint32()); + break; + } + case 2: { + message.consumed = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PeriodConsumption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption} PeriodConsumption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PeriodConsumption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PeriodConsumption message. + * @function verify + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PeriodConsumption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.consumptionInterval != null && message.hasOwnProperty("consumptionInterval")) { + var error = $root.google.type.Interval.verify(message.consumptionInterval); + if (error) + return "consumptionInterval." + error; + } + if (message.consumed != null && message.hasOwnProperty("consumed")) { + properties._consumed = 1; + if (typeof message.consumed !== "number") + return "consumed: number expected"; + } + return null; + }; + + /** + * Creates a PeriodConsumption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption} PeriodConsumption + */ + PeriodConsumption.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption) + return object; + var message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption(); + if (object.consumptionInterval != null) { + if (typeof object.consumptionInterval !== "object") + throw TypeError(".google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.consumptionInterval: object expected"); + message.consumptionInterval = $root.google.type.Interval.fromObject(object.consumptionInterval); + } + if (object.consumed != null) + message.consumed = Number(object.consumed); + return message; + }; + + /** + * Creates a plain object from a PeriodConsumption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption} message PeriodConsumption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PeriodConsumption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.consumptionInterval = null; + if (message.consumptionInterval != null && message.hasOwnProperty("consumptionInterval")) + object.consumptionInterval = $root.google.type.Interval.toObject(message.consumptionInterval, options); + if (message.consumed != null && message.hasOwnProperty("consumed")) { + object.consumed = options.json && !isFinite(message.consumed) ? String(message.consumed) : message.consumed; + if (options.oneofs) + object._consumed = "consumed"; + } + return object; + }; + + /** + * Converts this PeriodConsumption to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption + * @instance + * @returns {Object.} JSON object + */ + PeriodConsumption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PeriodConsumption + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PeriodConsumption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption"; + }; + + return PeriodConsumption; + })(); + + UsageResourceAllowanceStatus.ConsumptionReport = (function() { + + /** + * Properties of a ConsumptionReport. + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @interface IConsumptionReport + * @property {Object.|null} [latestPeriodConsumptions] ConsumptionReport latestPeriodConsumptions + */ + + /** + * Constructs a new ConsumptionReport. + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @classdesc Represents a ConsumptionReport. + * @implements IConsumptionReport + * @constructor + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport=} [properties] Properties to set + */ + function ConsumptionReport(properties) { + this.latestPeriodConsumptions = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConsumptionReport latestPeriodConsumptions. + * @member {Object.} latestPeriodConsumptions + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport + * @instance + */ + ConsumptionReport.prototype.latestPeriodConsumptions = $util.emptyObject; + + /** + * Creates a new ConsumptionReport instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport} ConsumptionReport instance + */ + ConsumptionReport.create = function create(properties) { + return new ConsumptionReport(properties); + }; + + /** + * Encodes the specified ConsumptionReport message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport} message ConsumptionReport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsumptionReport.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.latestPeriodConsumptions != null && Object.hasOwnProperty.call(message, "latestPeriodConsumptions")) + for (var keys = Object.keys(message.latestPeriodConsumptions), 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.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.encode(message.latestPeriodConsumptions[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ConsumptionReport message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport} message ConsumptionReport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsumptionReport.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConsumptionReport message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport} ConsumptionReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsumptionReport.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.latestPeriodConsumptions === $util.emptyObject) + message.latestPeriodConsumptions = {}; + 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.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.latestPeriodConsumptions[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConsumptionReport message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport} ConsumptionReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsumptionReport.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConsumptionReport message. + * @function verify + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConsumptionReport.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.latestPeriodConsumptions != null && message.hasOwnProperty("latestPeriodConsumptions")) { + if (!$util.isObject(message.latestPeriodConsumptions)) + return "latestPeriodConsumptions: object expected"; + var key = Object.keys(message.latestPeriodConsumptions); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.verify(message.latestPeriodConsumptions[key[i]]); + if (error) + return "latestPeriodConsumptions." + error; + } + } + return null; + }; + + /** + * Creates a ConsumptionReport message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport} ConsumptionReport + */ + ConsumptionReport.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport) + return object; + var message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport(); + if (object.latestPeriodConsumptions) { + if (typeof object.latestPeriodConsumptions !== "object") + throw TypeError(".google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.latestPeriodConsumptions: object expected"); + message.latestPeriodConsumptions = {}; + for (var keys = Object.keys(object.latestPeriodConsumptions), i = 0; i < keys.length; ++i) { + if (typeof object.latestPeriodConsumptions[keys[i]] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.latestPeriodConsumptions: object expected"); + message.latestPeriodConsumptions[keys[i]] = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.fromObject(object.latestPeriodConsumptions[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a ConsumptionReport message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport} message ConsumptionReport + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConsumptionReport.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.latestPeriodConsumptions = {}; + var keys2; + if (message.latestPeriodConsumptions && (keys2 = Object.keys(message.latestPeriodConsumptions)).length) { + object.latestPeriodConsumptions = {}; + for (var j = 0; j < keys2.length; ++j) + object.latestPeriodConsumptions[keys2[j]] = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.toObject(message.latestPeriodConsumptions[keys2[j]], options); + } + return object; + }; + + /** + * Converts this ConsumptionReport to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport + * @instance + * @returns {Object.} JSON object + */ + ConsumptionReport.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConsumptionReport + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConsumptionReport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport"; + }; + + return ConsumptionReport; + })(); + + return UsageResourceAllowanceStatus; + })(); + + v1alpha.Notification = (function() { + + /** + * Properties of a Notification. + * @memberof google.cloud.batch.v1alpha + * @interface INotification + * @property {string|null} [pubsubTopic] Notification pubsubTopic + */ + + /** + * Constructs a new Notification. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a Notification. + * @implements INotification + * @constructor + * @param {google.cloud.batch.v1alpha.INotification=} [properties] Properties to set + */ + function Notification(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Notification pubsubTopic. + * @member {string} pubsubTopic + * @memberof google.cloud.batch.v1alpha.Notification + * @instance + */ + Notification.prototype.pubsubTopic = ""; + + /** + * Creates a new Notification instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.Notification + * @static + * @param {google.cloud.batch.v1alpha.INotification=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.Notification} Notification instance + */ + Notification.create = function create(properties) { + return new Notification(properties); + }; + + /** + * Encodes the specified Notification message. Does not implicitly {@link google.cloud.batch.v1alpha.Notification.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.Notification + * @static + * @param {google.cloud.batch.v1alpha.INotification} message Notification message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Notification.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pubsubTopic != null && Object.hasOwnProperty.call(message, "pubsubTopic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pubsubTopic); + return writer; + }; + + /** + * Encodes the specified Notification message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Notification.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.Notification + * @static + * @param {google.cloud.batch.v1alpha.INotification} message Notification message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Notification.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Notification message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.Notification + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.Notification} Notification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Notification.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Notification(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.pubsubTopic = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Notification message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.Notification + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.Notification} Notification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Notification.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Notification message. + * @function verify + * @memberof google.cloud.batch.v1alpha.Notification + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Notification.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) + if (!$util.isString(message.pubsubTopic)) + return "pubsubTopic: string expected"; + return null; + }; + + /** + * Creates a Notification message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.Notification + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.Notification} Notification + */ + Notification.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.Notification) + return object; + var message = new $root.google.cloud.batch.v1alpha.Notification(); + if (object.pubsubTopic != null) + message.pubsubTopic = String(object.pubsubTopic); + return message; + }; + + /** + * Creates a plain object from a Notification message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.Notification + * @static + * @param {google.cloud.batch.v1alpha.Notification} message Notification + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Notification.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.pubsubTopic = ""; + if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) + object.pubsubTopic = message.pubsubTopic; + return object; + }; + + /** + * Converts this Notification to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.Notification + * @instance + * @returns {Object.} JSON object + */ + Notification.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Notification + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.Notification + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Notification.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.Notification"; + }; + + return Notification; + })(); + + return v1alpha; + })(); + + return batch; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + */ + + /** + * Constructs a new CommonLanguageSettings. + * @memberof google.api + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings + * @constructor + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + */ + function CommonLanguageSettings(properties) { + this.destinations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.referenceDocsUri = ""; + + /** + * CommonLanguageSettings destinations. + * @member {Array.} destinations + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.destinations = $util.emptyArray; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @function create + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance + */ + CommonLanguageSettings.create = function create(properties) { + return new CommonLanguageSettings(properties); + }; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); + if (message.destinations != null && message.destinations.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.destinations.length; ++i) + writer.int32(message.destinations[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLanguageSettings message. + * @function verify + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLanguageSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + if (!$util.isString(message.referenceDocsUri)) + return "referenceDocsUri: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + switch (message.destinations[i]) { + default: + return "destinations: enum value[] expected"; + case 0: + case 10: + case 20: + break; + } + } + return null; + }; + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + */ + CommonLanguageSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CommonLanguageSettings) + return object; + var message = new $root.google.api.CommonLanguageSettings(); + if (object.referenceDocsUri != null) + message.referenceDocsUri = String(object.referenceDocsUri); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + switch (object.destinations[i]) { + default: + if (typeof object.destinations[i] === "number") { + message.destinations[i] = object.destinations[i]; + break; + } + case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": + case 0: + message.destinations[i] = 0; + break; + case "GITHUB": + case 10: + message.destinations[i] = 10; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) + object.referenceDocsUri = ""; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + object.referenceDocsUri = message.referenceDocsUri; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + } + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + api.ClientLibrarySettings = (function() { + + /** + * Properties of a ClientLibrarySettings. + * @memberof google.api + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings + */ + + /** + * Constructs a new ClientLibrarySettings. + * @memberof google.api + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings + * @constructor + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + */ + function ClientLibrarySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && message.hasOwnProperty("goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (typeof object.javaSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); + } + if (object.cppSettings != null) { + if (typeof object.cppSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); + } + if (object.phpSettings != null) { + if (typeof object.phpSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); + } + if (object.pythonSettings != null) { + if (typeof object.pythonSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); + } + if (object.nodeSettings != null) { + if (typeof object.nodeSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); + } + if (object.dotnetSettings != null) { + if (typeof object.dotnetSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); + } + if (object.rubySettings != null) { + if (typeof object.rubySettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); + } + if (object.goSettings != null) { + if (typeof object.goSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); + } + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); + if (message.goSettings != null && message.hasOwnProperty("goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); + return object; + }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @memberof google.api + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + + /** + * Publishing restReferenceDocumentationUri. + * @member {string} restReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.restReferenceDocumentationUri = ""; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); + break; + } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } + case 111: { + message.restReferenceDocumentationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); + if (error) + return "librarySettings." + error; + } + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + if (!$util.isString(message.restReferenceDocumentationUri)) + return "restReferenceDocumentationUri: string expected"; + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Publishing) + return object; + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (typeof object.methodSettings[i] !== "object") + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + case "SHOPPING": + case 5: + message.organization = 5; + break; + case "GEO": + case 6: + message.organization = 6; + break; + case "GENERATIVE_AI": + case 7: + message.organization = 7; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (typeof object.librarySettings[i] !== "object") + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); + } + } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); + if (object.restReferenceDocumentationUri != null) + message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + object.protoReferenceDocumentationUri = ""; + object.restReferenceDocumentationUri = ""; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.JavaSettings) + return object; + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (typeof object.serviceClassNames !== "object") + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CppSettings) + return object; + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PhpSettings) + return object; + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + */ + + /** + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings + * @constructor + * @param {google.api.IPythonSettings=} [properties] Properties to set + */ + function PythonSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings) + return object; + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.NodeSettings) + return object; + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + * @property {Object.|null} [renamedServices] DotnetSettings renamedServices + * @property {Object.|null} [renamedResources] DotnetSettings renamedResources + * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources + * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases + * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(properties) { + this.renamedServices = {}; + this.renamedResources = {}; + this.ignoredResources = []; + this.forcedNamespaceAliases = []; + this.handwrittenSignatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * DotnetSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedServices = $util.emptyObject; + + /** + * DotnetSettings renamedResources. + * @member {Object.} renamedResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedResources = $util.emptyObject; + + /** + * DotnetSettings ignoredResources. + * @member {Array.} ignoredResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + + /** + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + + /** + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) + for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); + if (message.ignoredResources != null && message.ignoredResources.length) + for (var i = 0; i < message.ignoredResources.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); + if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); + if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } + case 3: { + if (message.renamedResources === $util.emptyObject) + message.renamedResources = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedResources[key] = value; + break; + } + case 4: { + if (!(message.ignoredResources && message.ignoredResources.length)) + message.ignoredResources = []; + message.ignoredResources.push(reader.string()); + break; + } + case 5: { + if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) + message.forcedNamespaceAliases = []; + message.forcedNamespaceAliases.push(reader.string()); + break; + } + case 6: { + if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) + message.handwrittenSignatures = []; + message.handwrittenSignatures.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { + if (!$util.isObject(message.renamedResources)) + return "renamedResources: object expected"; + var key = Object.keys(message.renamedResources); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedResources[key[i]])) + return "renamedResources: string{k:string} expected"; + } + if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { + if (!Array.isArray(message.ignoredResources)) + return "ignoredResources: array expected"; + for (var i = 0; i < message.ignoredResources.length; ++i) + if (!$util.isString(message.ignoredResources[i])) + return "ignoredResources: string[] expected"; + } + if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { + if (!Array.isArray(message.forcedNamespaceAliases)) + return "forcedNamespaceAliases: array expected"; + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + if (!$util.isString(message.forcedNamespaceAliases[i])) + return "forcedNamespaceAliases: string[] expected"; + } + if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { + if (!Array.isArray(message.handwrittenSignatures)) + return "handwrittenSignatures: array expected"; + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + if (!$util.isString(message.handwrittenSignatures[i])) + return "handwrittenSignatures: string[] expected"; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + if (object.renamedResources) { + if (typeof object.renamedResources !== "object") + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) + message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); + } + if (object.ignoredResources) { + if (!Array.isArray(object.ignoredResources)) + throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); + message.ignoredResources = []; + for (var i = 0; i < object.ignoredResources.length; ++i) + message.ignoredResources[i] = String(object.ignoredResources[i]); + } + if (object.forcedNamespaceAliases) { + if (!Array.isArray(object.forcedNamespaceAliases)) + throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); + message.forcedNamespaceAliases = []; + for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) + message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); + } + if (object.handwrittenSignatures) { + if (!Array.isArray(object.handwrittenSignatures)) + throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); + message.handwrittenSignatures = []; + for (var i = 0; i < object.handwrittenSignatures.length; ++i) + message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; + } + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; + } + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { + object.renamedResources = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + } + if (message.ignoredResources && message.ignoredResources.length) { + object.ignoredResources = []; + for (var j = 0; j < message.ignoredResources.length; ++j) + object.ignoredResources[j] = message.ignoredResources[j]; + } + if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { + object.forcedNamespaceAliases = []; + for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) + object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + } + if (message.handwrittenSignatures && message.handwrittenSignatures.length) { + object.handwrittenSignatures = []; + for (var j = 0; j < message.handwrittenSignatures.length; ++j) + object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; + } + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RubySettings) + return object; + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings + * @constructor + * @param {google.api.IGoSettings=} [properties] Properties to set + */ + function GoSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.common = null; + + /** + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.GoSettings) + return object; + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(properties) { + this.autoPopulatedFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) + message.autoPopulatedFields = []; + message.autoPopulatedFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); + if (error) + return "longRunning." + error; + } + if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { + if (!Array.isArray(message.autoPopulatedFields)) + return "autoPopulatedFields: array expected"; + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + if (!$util.isString(message.autoPopulatedFields[i])) + return "autoPopulatedFields: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings) + return object; + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (typeof object.longRunning !== "object") + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); + } + if (object.autoPopulatedFields) { + if (!Array.isArray(object.autoPopulatedFields)) + throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); + message.autoPopulatedFields = []; + for (var i = 0; i < object.autoPopulatedFields.length; ++i) + message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.autoPopulatedFields = []; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); + if (message.autoPopulatedFields && message.autoPopulatedFields.length) { + object.autoPopulatedFields = []; + for (var j = 0; j < message.autoPopulatedFields.length; ++j) + object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; + } + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (typeof object.initialPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (typeof object.maxPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); + } + if (object.totalPollTimeout != null) { + if (typeof object.totalPollTimeout !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + * @property {number} SHOPPING=5 SHOPPING value + * @property {number} GEO=6 GEO value + * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + values[valuesById[5] = "SHOPPING"] = 5; + values[valuesById[6] = "GEO"] = 6; + values[valuesById[7] = "GENERATIVE_AI"] = 7; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + + /** + * 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.FieldInfo = (function() { + + /** + * Properties of a FieldInfo. + * @memberof google.api + * @interface IFieldInfo + * @property {google.api.FieldInfo.Format|null} [format] FieldInfo format + */ + + /** + * Constructs a new FieldInfo. + * @memberof google.api + * @classdesc Represents a FieldInfo. + * @implements IFieldInfo + * @constructor + * @param {google.api.IFieldInfo=} [properties] Properties to set + */ + function FieldInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldInfo format. + * @member {google.api.FieldInfo.Format} format + * @memberof google.api.FieldInfo + * @instance + */ + FieldInfo.prototype.format = 0; + + /** + * Creates a new FieldInfo instance using the specified properties. + * @function create + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo=} [properties] Properties to set + * @returns {google.api.FieldInfo} FieldInfo instance + */ + FieldInfo.create = function create(properties) { + return new FieldInfo(properties); + }; + + /** + * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @function encode + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.format); + return writer; + }; + + /** + * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldInfo message from the specified reader or buffer. + * @function decode + * @memberof google.api.FieldInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.FieldInfo} FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.FieldInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.format = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.FieldInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.FieldInfo} FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldInfo message. + * @function verify + * @memberof google.api.FieldInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.format != null && message.hasOwnProperty("format")) + switch (message.format) { + default: + return "format: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.FieldInfo + * @static + * @param {Object.} object Plain object + * @returns {google.api.FieldInfo} FieldInfo + */ + FieldInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.FieldInfo) + return object; + var message = new $root.google.api.FieldInfo(); + switch (object.format) { + default: + if (typeof object.format === "number") { + message.format = object.format; + break; + } + break; + case "FORMAT_UNSPECIFIED": + case 0: + message.format = 0; + break; + case "UUID4": + case 1: + message.format = 1; + break; + case "IPV4": + case 2: + message.format = 2; + break; + case "IPV6": + case 3: + message.format = 3; + break; + case "IPV4_OR_IPV6": + case 4: + message.format = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.FieldInfo + * @static + * @param {google.api.FieldInfo} message FieldInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.format = options.enums === String ? "FORMAT_UNSPECIFIED" : 0; + if (message.format != null && message.hasOwnProperty("format")) + object.format = options.enums === String ? $root.google.api.FieldInfo.Format[message.format] === undefined ? message.format : $root.google.api.FieldInfo.Format[message.format] : message.format; + return object; + }; + + /** + * Converts this FieldInfo to JSON. + * @function toJSON + * @memberof google.api.FieldInfo + * @instance + * @returns {Object.} JSON object + */ + FieldInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldInfo + * @function getTypeUrl + * @memberof google.api.FieldInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.FieldInfo"; + }; + + /** + * Format enum. + * @name google.api.FieldInfo.Format + * @enum {number} + * @property {number} FORMAT_UNSPECIFIED=0 FORMAT_UNSPECIFIED value + * @property {number} UUID4=1 UUID4 value + * @property {number} IPV4=2 IPV4 value + * @property {number} IPV6=3 IPV6 value + * @property {number} IPV4_OR_IPV6=4 IPV4_OR_IPV6 value + */ + FieldInfo.Format = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "UUID4"] = 1; + values[valuesById[2] = "IPV4"] = 2; + values[valuesById[3] = "IPV6"] = 3; + values[valuesById[4] = "IPV4_OR_IPV6"] = 4; + return values; + })(); + + return FieldInfo; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value + * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value + * @property {number} EDITION_2023=1000 EDITION_2023 value + * @property {number} EDITION_2024=1001 EDITION_2024 value + * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value + * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value + * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value + * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value + * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value + * @property {number} EDITION_MAX=2147483647 EDITION_MAX value + */ + protobuf.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[998] = "EDITION_PROTO2"] = 998; + values[valuesById[999] = "EDITION_PROTO3"] = 999; + values[valuesById[1000] = "EDITION_2023"] = 1000; + values[valuesById[1001] = "EDITION_2024"] = 1001; + values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; + values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; + values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; + values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; + values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; + values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; + return values; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = 0; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 14: { + message.edition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + this.declaration = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.verification = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message.declaration != null && message.hasOwnProperty("declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); + if (error) + return "declaration." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.verification != null && message.hasOwnProperty("verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (typeof object.declaration[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); + } + if (message.verification != null && message.hasOwnProperty("verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.fullName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 5: { + message.reserved = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Declaration message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Declaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && message.hasOwnProperty("reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + return null; + }; + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + */ + Declaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + if (object.number != null) + message.number = object.number | 0; + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.type != null) + message.type = String(object.type); + if (object.reserved != null) + message.reserved = Boolean(object.reserved); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + return message; + }; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Declaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.reserved != null && message.hasOwnProperty("reserved")) + object.reserved = message.reserved; + if (message.repeated != null && message.hasOwnProperty("repeated")) + object.repeated = message.repeated; + return object; + }; + + /** + * Converts this Declaration to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + * @returns {Object.} JSON object + */ + Declaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Declaration + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; + }; + + return Declaration; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 3: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.features = null; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FileOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + object.features = null; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * MessageOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.features = null; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 12: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {Array.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IFieldInfo|null} [".google.api.fieldInfo"] FieldOptions .google.api.fieldInfo + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.targets = []; + this.editionDefaults = []; + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions targets. + * @member {Array.} targets + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.targets = $util.emptyArray; + + /** + * FieldOptions editionDefaults. + * @member {Array.} editionDefaults + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.editionDefaults = $util.emptyArray; + + /** + * FieldOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.features = null; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldInfo. + * @member {google.api.IFieldInfo|null|undefined} .google.api.fieldInfo + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldInfo"] = null; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); + if (message.editionDefaults != null && message.editionDefaults.length) + for (var i = 0; i < message.editionDefaults.length; ++i) + $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + if (message[".google.api.fieldInfo"] != null && Object.hasOwnProperty.call(message, ".google.api.fieldInfo")) + $root.google.api.FieldInfo.encode(message[".google.api.fieldInfo"], writer.uint32(/* id 291403980, wireType 2 =*/2331231842).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 19: { + if (!(message.targets && message.targets.length)) + message.targets = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targets.push(reader.int32()); + } else + message.targets.push(reader.int32()); + break; + } + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 291403980: { + message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.decode(reader, reader.uint32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && message.hasOwnProperty("retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.targets != null && message.hasOwnProperty("targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) + switch (message.targets[i]) { + default: + return "targets: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + } + if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { + if (!Array.isArray(message.editionDefaults)) + return "editionDefaults: array expected"; + for (var i = 0; i < message.editionDefaults.length; ++i) { + var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); + if (error) + return "editionDefaults." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) { + var error = $root.google.api.FieldInfo.verify(message[".google.api.fieldInfo"]); + if (error) + return ".google.api.fieldInfo." + error; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) + switch (object.targets[i]) { + default: + if (typeof object.targets[i] === "number") { + message.targets[i] = object.targets[i]; + break; + } + case "TARGET_TYPE_UNKNOWN": + case 0: + message.targets[i] = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.targets[i] = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.targets[i] = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.targets[i] = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.targets[i] = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.targets[i] = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.targets[i] = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.targets[i] = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.targets[i] = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.targets[i] = 9; + break; + } + } + if (object.editionDefaults) { + if (!Array.isArray(object.editionDefaults)) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); + message.editionDefaults = []; + for (var i = 0; i < object.editionDefaults.length; ++i) { + if (typeof object.editionDefaults[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); + message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FieldOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + break; + } + } + if (object[".google.api.fieldInfo"] != null) { + if (typeof object[".google.api.fieldInfo"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldInfo: object expected"); + message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.fromObject(object[".google.api.fieldInfo"]); + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targets = []; + object.editionDefaults = []; + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object.debugRedact = false; + object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; + object.features = null; + object[".google.api.resourceReference"] = null; + object[".google.api.fieldInfo"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.retention != null && message.hasOwnProperty("retention")) + object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; + if (message.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; + } + if (message.editionDefaults && message.editionDefaults.length) { + object.editionDefaults = []; + for (var j = 0; j < message.editionDefaults.length; ++j) + object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) + object[".google.api.fieldInfo"] = $root.google.api.FieldInfo.toObject(message[".google.api.fieldInfo"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.features = null; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.features = null; + + /** + * EnumValueOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.debugRedact = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.debugRedact = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object.debugRedact = false; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + case 525000001: { + message[".google.api.apiVersion"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.features = null; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 35: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MethodOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object.features = null; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + */ + + /** + * Constructs a new FeatureSet. + * @memberof google.protobuf + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet + * @constructor + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + */ + function FeatureSet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.fieldPresence = 0; + + /** + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enumType = 0; + + /** + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.repeatedFieldEncoding = 0; + + /** + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.utf8Validation = 0; + + /** + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.messageEncoding = 0; + + /** + * FeatureSet jsonFormat. + * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.jsonFormat = 0; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance + */ + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); + }; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fieldPresence = reader.int32(); + break; + } + case 2: { + message.enumType = reader.int32(); + break; + } + case 3: { + message.repeatedFieldEncoding = reader.int32(); + break; + } + case 4: { + message.utf8Validation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + switch (message.fieldPresence) { + default: + return "fieldPresence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) + switch (message.enumType) { + default: + return "enumType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + switch (message.repeatedFieldEncoding) { + default: + return "repeatedFieldEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + switch (message.utf8Validation) { + default: + return "utf8Validation: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + switch (message.messageEncoding) { + default: + return "messageEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + switch (message.jsonFormat) { + default: + return "jsonFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet} FeatureSet + */ + FeatureSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { + default: + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; + break; + } + break; + case "FIELD_PRESENCE_UNKNOWN": + case 0: + message.fieldPresence = 0; + break; + case "EXPLICIT": + case 1: + message.fieldPresence = 1; + break; + case "IMPLICIT": + case 2: + message.fieldPresence = 2; + break; + case "LEGACY_REQUIRED": + case 3: + message.fieldPresence = 3; + break; + } + switch (object.enumType) { + default: + if (typeof object.enumType === "number") { + message.enumType = object.enumType; + break; + } + break; + case "ENUM_TYPE_UNKNOWN": + case 0: + message.enumType = 0; + break; + case "OPEN": + case 1: + message.enumType = 1; + break; + case "CLOSED": + case 2: + message.enumType = 2; + break; + } + switch (object.repeatedFieldEncoding) { + default: + if (typeof object.repeatedFieldEncoding === "number") { + message.repeatedFieldEncoding = object.repeatedFieldEncoding; + break; + } + break; + case "REPEATED_FIELD_ENCODING_UNKNOWN": + case 0: + message.repeatedFieldEncoding = 0; + break; + case "PACKED": + case 1: + message.repeatedFieldEncoding = 1; + break; + case "EXPANDED": + case 2: + message.repeatedFieldEncoding = 2; + break; + } + switch (object.utf8Validation) { + default: + if (typeof object.utf8Validation === "number") { + message.utf8Validation = object.utf8Validation; + break; + } + break; + case "UTF8_VALIDATION_UNKNOWN": + case 0: + message.utf8Validation = 0; + break; + case "VERIFY": + case 2: + message.utf8Validation = 2; + break; + case "NONE": + case 3: + message.utf8Validation = 3; + break; + } + switch (object.messageEncoding) { + default: + if (typeof object.messageEncoding === "number") { + message.messageEncoding = object.messageEncoding; + break; + } + break; + case "MESSAGE_ENCODING_UNKNOWN": + case 0: + message.messageEncoding = 0; + break; + case "LENGTH_PREFIXED": + case 1: + message.messageEncoding = 1; + break; + case "DELIMITED": + case 2: + message.messageEncoding = 2; + break; + } + switch (object.jsonFormat) { + default: + if (typeof object.jsonFormat === "number") { + message.jsonFormat = object.jsonFormat; + break; + } + break; + case "JSON_FORMAT_UNKNOWN": + case 0: + message.jsonFormat = 0; + break; + case "ALLOW": + case 1: + message.jsonFormat = 1; + break; + case "LEGACY_BEST_EFFORT": + case 2: + message.jsonFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.FeatureSet} message FeatureSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; + object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; + object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; + object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + } + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; + if (message.enumType != null && message.hasOwnProperty("enumType")) + object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + return object; + }; + + /** + * Converts this FeatureSet to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet + * @instance + * @returns {Object.} JSON object + */ + FeatureSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSet + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet"; + }; + + /** + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence + * @enum {number} + * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value + * @property {number} EXPLICIT=1 EXPLICIT value + * @property {number} IMPLICIT=2 IMPLICIT value + * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value + */ + FeatureSet.FieldPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; + values[valuesById[1] = "EXPLICIT"] = 1; + values[valuesById[2] = "IMPLICIT"] = 2; + values[valuesById[3] = "LEGACY_REQUIRED"] = 3; + return values; + })(); + + /** + * EnumType enum. + * @name google.protobuf.FeatureSet.EnumType + * @enum {number} + * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + FeatureSet.EnumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * RepeatedFieldEncoding enum. + * @name google.protobuf.FeatureSet.RepeatedFieldEncoding + * @enum {number} + * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value + * @property {number} PACKED=1 PACKED value + * @property {number} EXPANDED=2 EXPANDED value + */ + FeatureSet.RepeatedFieldEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "PACKED"] = 1; + values[valuesById[2] = "EXPANDED"] = 2; + return values; + })(); + + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition + */ + + /** + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.defaults && message.defaults.length)) + message.defaults = []; + message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); + break; + } + case 4: { + message.minimumEdition = reader.int32(); + break; + } + case 5: { + message.maximumEdition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetDefaults message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetDefaults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaults != null && message.hasOwnProperty("defaults")) { + if (!Array.isArray(message.defaults)) + return "defaults: array expected"; + for (var i = 0; i < message.defaults.length; ++i) { + var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); + if (error) + return "defaults." + error; + } + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + switch (message.minimumEdition) { + default: + return "minimumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + switch (message.maximumEdition) { + default: + return "maximumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + */ + FeatureSetDefaults.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults(); + if (object.defaults) { + if (!Array.isArray(object.defaults)) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); + message.defaults = []; + for (var i = 0; i < object.defaults.length; ++i) { + if (typeof object.defaults[i] !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); + message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); + } + } + switch (object.minimumEdition) { + default: + if (typeof object.minimumEdition === "number") { + message.minimumEdition = object.minimumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.minimumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.minimumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.minimumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.minimumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.minimumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.minimumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.minimumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.minimumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.minimumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.minimumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.minimumEdition = 2147483647; + break; + } + switch (object.maximumEdition) { + default: + if (typeof object.maximumEdition === "number") { + message.maximumEdition = object.maximumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.maximumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.maximumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.maximumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.maximumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.maximumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.maximumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.maximumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.maximumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.maximumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.maximumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.maximumEdition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetDefaults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; + if (options.defaults) { + object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.defaults && message.defaults.length) { + object.defaults = []; + for (var j = 0; j < message.defaults.length; ++j) + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; + return object; + }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults + * @instance + * @returns {Object.} JSON object + */ + FeatureSetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetDefaults + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; + }; + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + + /** + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + */ + + /** + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault + * @constructor + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + */ + function FeatureSetEditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.edition = 0; + + /** + * FeatureSetEditionDefault features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.features = null; + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance + */ + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); + }; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetEditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + return null; + }; + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + */ + FeatureSetEditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetEditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.features = null; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + return protobuf; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Interval = (function() { + + /** + * Properties of an Interval. + * @memberof google.type + * @interface IInterval + * @property {google.protobuf.ITimestamp|null} [startTime] Interval startTime + * @property {google.protobuf.ITimestamp|null} [endTime] Interval endTime + */ + + /** + * Constructs a new Interval. + * @memberof google.type + * @classdesc Represents an Interval. + * @implements IInterval + * @constructor + * @param {google.type.IInterval=} [properties] Properties to set + */ + function Interval(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Interval startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.type.Interval + * @instance + */ + Interval.prototype.startTime = null; + + /** + * Interval endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.type.Interval + * @instance + */ + Interval.prototype.endTime = null; + + /** + * Creates a new Interval instance using the specified properties. + * @function create + * @memberof google.type.Interval + * @static + * @param {google.type.IInterval=} [properties] Properties to set + * @returns {google.type.Interval} Interval instance + */ + Interval.create = function create(properties) { + return new Interval(properties); + }; + + /** + * Encodes the specified Interval message. Does not implicitly {@link google.type.Interval.verify|verify} messages. + * @function encode + * @memberof google.type.Interval + * @static + * @param {google.type.IInterval} message Interval message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Interval.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(); + return writer; + }; + + /** + * Encodes the specified Interval message, length delimited. Does not implicitly {@link google.type.Interval.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Interval + * @static + * @param {google.type.IInterval} message Interval message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Interval.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Interval message from the specified reader or buffer. + * @function decode + * @memberof google.type.Interval + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Interval} Interval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Interval.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Interval(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Interval message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Interval + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Interval} Interval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Interval.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Interval message. + * @function verify + * @memberof google.type.Interval + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Interval.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates an Interval message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Interval + * @static + * @param {Object.} object Plain object + * @returns {google.type.Interval} Interval + */ + Interval.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Interval) + return object; + var message = new $root.google.type.Interval(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.type.Interval.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.type.Interval.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from an Interval message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Interval + * @static + * @param {google.type.Interval} message Interval + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Interval.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this Interval to JSON. + * @function toJSON + * @memberof google.type.Interval + * @instance + * @returns {Object.} JSON object + */ + Interval.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Interval + * @function getTypeUrl + * @memberof google.type.Interval + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Interval.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Interval"; + }; + + return Interval; + })(); + + return type; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.json b/owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.json new file mode 100644 index 00000000000..15385d6317b --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.json @@ -0,0 +1,4203 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "batch": { + "nested": { + "v1alpha": { + "options": { + "csharp_namespace": "Google.Cloud.Batch.V1Alpha", + "go_package": "cloud.google.com/go/batch/apiv1alpha/batchpb;batchpb", + "java_multiple_files": true, + "java_outer_classname": "NotificationProto", + "java_package": "com.google.cloud.batch.v1alpha", + "objc_class_prefix": "GCB", + "php_namespace": "Google\\Cloud\\Batch\\V1alpha", + "ruby_package": "Google::Cloud::Batch::V1alpha" + }, + "nested": { + "BatchService": { + "options": { + "(google.api.default_host)": "batch.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateJob": { + "requestType": "CreateJobRequest", + "responseType": "Job", + "options": { + "(google.api.http).post": "/v1alpha/{parent=projects/*/locations/*}/jobs", + "(google.api.http).body": "job", + "(google.api.method_signature)": "parent,job,job_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{parent=projects/*/locations/*}/jobs", + "body": "job" + } + }, + { + "(google.api.method_signature)": "parent,job,job_id" + } + ] + }, + "GetJob": { + "requestType": "GetJobRequest", + "responseType": "Job", + "options": { + "(google.api.http).get": "/v1alpha/{name=projects/*/locations/*/jobs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{name=projects/*/locations/*/jobs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteJob": { + "requestType": "DeleteJobRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1alpha/{name=projects/*/locations/*/jobs/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.batch.v1alpha.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1alpha/{name=projects/*/locations/*/jobs/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.batch.v1alpha.OperationMetadata" + } + } + ] + }, + "CancelJob": { + "requestType": "CancelJobRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha/{name=projects/*/locations/*/jobs/*}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.cloud.batch.v1alpha.CancelJobResponse", + "(google.longrunning.operation_info).metadata_type": "google.cloud.batch.v1alpha.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{name=projects/*/locations/*/jobs/*}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.batch.v1alpha.CancelJobResponse", + "metadata_type": "google.cloud.batch.v1alpha.OperationMetadata" + } + } + ] + }, + "UpdateJob": { + "requestType": "UpdateJobRequest", + "responseType": "Job", + "options": { + "(google.api.http).patch": "/v1alpha/{job.name=projects/*/locations/*/jobs/*}", + "(google.api.http).body": "job", + "(google.api.method_signature)": "job,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1alpha/{job.name=projects/*/locations/*/jobs/*}", + "body": "job" + } + }, + { + "(google.api.method_signature)": "job,update_mask" + } + ] + }, + "ListJobs": { + "requestType": "ListJobsRequest", + "responseType": "ListJobsResponse", + "options": { + "(google.api.http).get": "/v1alpha/{parent=projects/*/locations/*}/jobs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{parent=projects/*/locations/*}/jobs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetTask": { + "requestType": "GetTaskRequest", + "responseType": "Task", + "options": { + "(google.api.http).get": "/v1alpha/{name=projects/*/locations/*/jobs/*/taskGroups/*/tasks/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{name=projects/*/locations/*/jobs/*/taskGroups/*/tasks/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListTasks": { + "requestType": "ListTasksRequest", + "responseType": "ListTasksResponse", + "options": { + "(google.api.http).get": "/v1alpha/{parent=projects/*/locations/*/jobs/*/taskGroups/*}/tasks", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{parent=projects/*/locations/*/jobs/*/taskGroups/*}/tasks" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateResourceAllowance": { + "requestType": "CreateResourceAllowanceRequest", + "responseType": "ResourceAllowance", + "options": { + "(google.api.http).post": "/v1alpha/{parent=projects/*/locations/*}/resourceAllowances", + "(google.api.http).body": "resource_allowance", + "(google.api.method_signature)": "parent,resource_allowance,resource_allowance_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{parent=projects/*/locations/*}/resourceAllowances", + "body": "resource_allowance" + } + }, + { + "(google.api.method_signature)": "parent,resource_allowance,resource_allowance_id" + } + ] + }, + "GetResourceAllowance": { + "requestType": "GetResourceAllowanceRequest", + "responseType": "ResourceAllowance", + "options": { + "(google.api.http).get": "/v1alpha/{name=projects/*/locations/*/resourceAllowances/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{name=projects/*/locations/*/resourceAllowances/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteResourceAllowance": { + "requestType": "DeleteResourceAllowanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1alpha/{name=projects/*/locations/*/resourceAllowances/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.batch.v1alpha.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1alpha/{name=projects/*/locations/*/resourceAllowances/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.batch.v1alpha.OperationMetadata" + } + } + ] + }, + "ListResourceAllowances": { + "requestType": "ListResourceAllowancesRequest", + "responseType": "ListResourceAllowancesResponse", + "options": { + "(google.api.http).get": "/v1alpha/{parent=projects/*/locations/*}/resourceAllowances", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{parent=projects/*/locations/*}/resourceAllowances" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateResourceAllowance": { + "requestType": "UpdateResourceAllowanceRequest", + "responseType": "ResourceAllowance", + "options": { + "(google.api.http).patch": "/v1alpha/{resource_allowance.name=projects/*/locations/*/resourceAllowances/*}", + "(google.api.http).body": "resource_allowance", + "(google.api.method_signature)": "resource_allowance,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1alpha/{resource_allowance.name=projects/*/locations/*/resourceAllowances/*}", + "body": "resource_allowance" + } + }, + { + "(google.api.method_signature)": "resource_allowance,update_mask" + } + ] + } + } + }, + "CreateJobRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "batch.googleapis.com/Job" + } + }, + "jobId": { + "type": "string", + "id": 2 + }, + "job": { + "type": "Job", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "batch.googleapis.com/Job" + } + } + } + }, + "DeleteJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "reason": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CancelJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "batch.googleapis.com/Job" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CancelJobResponse": { + "fields": {} + }, + "UpdateJobRequest": { + "fields": { + "job": { + "type": "Job", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListJobsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListJobsResponse": { + "fields": { + "jobs": { + "rule": "repeated", + "type": "Job", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "ListTasksRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "batch.googleapis.com/TaskGroup" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "orderBy": { + "type": "string", + "id": 5 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListTasksResponse": { + "fields": { + "tasks": { + "rule": "repeated", + "type": "Task", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetTaskRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "batch.googleapis.com/Task" + } + } + } + }, + "CreateResourceAllowanceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "batch.googleapis.com/ResourceAllowance" + } + }, + "resourceAllowanceId": { + "type": "string", + "id": 2 + }, + "resourceAllowance": { + "type": "ResourceAllowance", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetResourceAllowanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "batch.googleapis.com/ResourceAllowance" + } + } + } + }, + "DeleteResourceAllowanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "batch.googleapis.com/ResourceAllowance" + } + }, + "reason": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListResourceAllowancesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "batch.googleapis.com/ResourceAllowance" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListResourceAllowancesResponse": { + "fields": { + "resourceAllowances": { + "rule": "repeated", + "type": "ResourceAllowance", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "UpdateResourceAllowanceRequest": { + "fields": { + "resourceAllowance": { + "type": "ResourceAllowance", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "OperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "target": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusMessage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiVersion": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Job": { + "options": { + "(google.api.resource).type": "batch.googleapis.com/Job", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/jobs/{job}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "uid": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "priority": { + "type": "int64", + "id": 3 + }, + "taskGroups": { + "rule": "repeated", + "type": "TaskGroup", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "schedulingPolicy": { + "type": "SchedulingPolicy", + "id": 5 + }, + "dependencies": { + "rule": "repeated", + "type": "JobDependency", + "id": 6 + }, + "allocationPolicy": { + "type": "AllocationPolicy", + "id": 7 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 8 + }, + "status": { + "type": "JobStatus", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "notification": { + "type": "JobNotification", + "id": 10, + "options": { + "deprecated": true + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "logsPolicy": { + "type": "LogsPolicy", + "id": 13 + }, + "notifications": { + "rule": "repeated", + "type": "JobNotification", + "id": 14 + } + }, + "nested": { + "SchedulingPolicy": { + "values": { + "SCHEDULING_POLICY_UNSPECIFIED": 0, + "AS_SOON_AS_POSSIBLE": 1 + } + } + } + }, + "LogsPolicy": { + "fields": { + "destination": { + "type": "Destination", + "id": 1 + }, + "logsPath": { + "type": "string", + "id": 2 + }, + "cloudLoggingOption": { + "type": "CloudLoggingOption", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "CloudLoggingOption": { + "fields": { + "useGenericTaskMonitoredResource": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Destination": { + "values": { + "DESTINATION_UNSPECIFIED": 0, + "CLOUD_LOGGING": 1, + "PATH": 2 + } + } + } + }, + "JobDependency": { + "fields": { + "items": { + "keyType": "string", + "type": "Type", + "id": 1 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "SUCCEEDED": 1, + "FAILED": 2, + "FINISHED": 3 + } + } + } + }, + "JobStatus": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "statusEvents": { + "rule": "repeated", + "type": "StatusEvent", + "id": 2 + }, + "taskGroups": { + "keyType": "string", + "type": "TaskGroupStatus", + "id": 4 + }, + "runDuration": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "resourceUsage": { + "type": "ResourceUsage", + "id": 6 + } + }, + "nested": { + "InstanceStatus": { + "fields": { + "machineType": { + "type": "string", + "id": 1 + }, + "provisioningModel": { + "type": "AllocationPolicy.ProvisioningModel", + "id": 2 + }, + "taskPack": { + "type": "int64", + "id": 3 + }, + "bootDisk": { + "type": "AllocationPolicy.Disk", + "id": 4 + } + } + }, + "TaskGroupStatus": { + "fields": { + "counts": { + "keyType": "string", + "type": "int64", + "id": 1 + }, + "instances": { + "rule": "repeated", + "type": "InstanceStatus", + "id": 2 + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "QUEUED": 1, + "SCHEDULED": 2, + "RUNNING": 3, + "SUCCEEDED": 4, + "FAILED": 5, + "DELETION_IN_PROGRESS": 6, + "CANCELLATION_IN_PROGRESS": 7, + "CANCELLED": 8 + } + } + } + }, + "ResourceUsage": { + "fields": { + "coreHours": { + "type": "double", + "id": 1 + } + } + }, + "JobNotification": { + "fields": { + "pubsubTopic": { + "type": "string", + "id": 1 + }, + "message": { + "type": "Message", + "id": 2 + } + }, + "nested": { + "Message": { + "fields": { + "type": { + "type": "Type", + "id": 1 + }, + "newJobState": { + "type": "JobStatus.State", + "id": 2 + }, + "newTaskState": { + "type": "TaskStatus.State", + "id": 3 + } + } + }, + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "JOB_STATE_CHANGED": 1, + "TASK_STATE_CHANGED": 2 + } + } + } + }, + "AllocationPolicy": { + "fields": { + "location": { + "type": "LocationPolicy", + "id": 1 + }, + "instance": { + "type": "InstancePolicy", + "id": 2, + "options": { + "deprecated": true + } + }, + "instances": { + "rule": "repeated", + "type": "InstancePolicyOrTemplate", + "id": 8 + }, + "instanceTemplates": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "deprecated": true + } + }, + "provisioningModels": { + "rule": "repeated", + "type": "ProvisioningModel", + "id": 4, + "options": { + "deprecated": true + } + }, + "serviceAccountEmail": { + "type": "string", + "id": 5, + "options": { + "deprecated": true + } + }, + "serviceAccount": { + "type": "ServiceAccount", + "id": 9 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 6 + }, + "network": { + "type": "NetworkPolicy", + "id": 7 + }, + "placement": { + "type": "PlacementPolicy", + "id": 10 + }, + "tags": { + "rule": "repeated", + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "LocationPolicy": { + "fields": { + "allowedLocations": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "deniedLocations": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "Disk": { + "oneofs": { + "dataSource": { + "oneof": [ + "image", + "snapshot" + ] + } + }, + "fields": { + "image": { + "type": "string", + "id": 4 + }, + "snapshot": { + "type": "string", + "id": 5 + }, + "type": { + "type": "string", + "id": 1 + }, + "sizeGb": { + "type": "int64", + "id": 2 + }, + "diskInterface": { + "type": "string", + "id": 6 + } + } + }, + "AttachedDisk": { + "oneofs": { + "attached": { + "oneof": [ + "newDisk", + "existingDisk" + ] + } + }, + "fields": { + "newDisk": { + "type": "Disk", + "id": 1 + }, + "existingDisk": { + "type": "string", + "id": 2 + }, + "deviceName": { + "type": "string", + "id": 3 + } + } + }, + "Accelerator": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "count": { + "type": "int64", + "id": 2 + }, + "installGpuDrivers": { + "type": "bool", + "id": 3, + "options": { + "deprecated": true + } + }, + "driverVersion": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "InstancePolicy": { + "fields": { + "allowedMachineTypes": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "machineType": { + "type": "string", + "id": 2 + }, + "minCpuPlatform": { + "type": "string", + "id": 3 + }, + "provisioningModel": { + "type": "ProvisioningModel", + "id": 4 + }, + "accelerators": { + "rule": "repeated", + "type": "Accelerator", + "id": 5 + }, + "bootDisk": { + "type": "Disk", + "id": 8 + }, + "disks": { + "rule": "repeated", + "type": "AttachedDisk", + "id": 6 + }, + "reservation": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "InstancePolicyOrTemplate": { + "oneofs": { + "policyTemplate": { + "oneof": [ + "policy", + "instanceTemplate" + ] + } + }, + "fields": { + "policy": { + "type": "InstancePolicy", + "id": 1 + }, + "instanceTemplate": { + "type": "string", + "id": 2 + }, + "installGpuDrivers": { + "type": "bool", + "id": 3 + }, + "installOpsAgent": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "blockProjectSshKeys": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "NetworkInterface": { + "fields": { + "network": { + "type": "string", + "id": 1 + }, + "subnetwork": { + "type": "string", + "id": 2 + }, + "noExternalIpAddress": { + "type": "bool", + "id": 3 + } + } + }, + "NetworkPolicy": { + "fields": { + "networkInterfaces": { + "rule": "repeated", + "type": "NetworkInterface", + "id": 1 + } + } + }, + "PlacementPolicy": { + "fields": { + "collocation": { + "type": "string", + "id": 1 + }, + "maxDistance": { + "type": "int64", + "id": 2 + } + } + }, + "ProvisioningModel": { + "values": { + "PROVISIONING_MODEL_UNSPECIFIED": 0, + "STANDARD": 1, + "SPOT": 2, + "PREEMPTIBLE": 3 + } + } + } + }, + "TaskGroup": { + "options": { + "(google.api.resource).type": "batch.googleapis.com/TaskGroup", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "taskSpec": { + "type": "TaskSpec", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "taskCount": { + "type": "int64", + "id": 4 + }, + "parallelism": { + "type": "int64", + "id": 5 + }, + "schedulingPolicy": { + "type": "SchedulingPolicy", + "id": 6 + }, + "allocationPolicy": { + "type": "AllocationPolicy", + "id": 7 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 8 + }, + "taskEnvironments": { + "rule": "repeated", + "type": "Environment", + "id": 9 + }, + "taskCountPerNode": { + "type": "int64", + "id": 10 + }, + "requireHostsFile": { + "type": "bool", + "id": 11 + }, + "permissiveSsh": { + "type": "bool", + "id": 12 + }, + "runAsNonRoot": { + "type": "bool", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceAccount": { + "type": "ServiceAccount", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "SchedulingPolicy": { + "values": { + "SCHEDULING_POLICY_UNSPECIFIED": 0, + "AS_SOON_AS_POSSIBLE": 1, + "IN_ORDER": 2 + } + } + } + }, + "ServiceAccount": { + "fields": { + "email": { + "type": "string", + "id": 1 + }, + "scopes": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "ComputeResource": { + "fields": { + "cpuMilli": { + "type": "int64", + "id": 1 + }, + "memoryMib": { + "type": "int64", + "id": 2 + }, + "gpuCount": { + "type": "int64", + "id": 3 + }, + "bootDiskMib": { + "type": "int64", + "id": 4 + } + } + }, + "StatusEvent": { + "fields": { + "type": { + "type": "string", + "id": 3 + }, + "description": { + "type": "string", + "id": 1 + }, + "eventTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "taskExecution": { + "type": "TaskExecution", + "id": 4 + }, + "taskState": { + "type": "TaskStatus.State", + "id": 5 + } + } + }, + "TaskExecution": { + "fields": { + "exitCode": { + "type": "int32", + "id": 1 + }, + "stderrSnippet": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "TaskStatus": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "statusEvents": { + "rule": "repeated", + "type": "StatusEvent", + "id": 2 + }, + "resourceUsage": { + "type": "TaskResourceUsage", + "id": 3 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PENDING": 1, + "ASSIGNED": 2, + "RUNNING": 3, + "FAILED": 4, + "SUCCEEDED": 5, + "UNEXECUTED": 6 + } + } + } + }, + "TaskResourceUsage": { + "fields": { + "coreHours": { + "type": "double", + "id": 1 + } + } + }, + "Runnable": { + "oneofs": { + "executable": { + "oneof": [ + "container", + "script", + "barrier" + ] + } + }, + "fields": { + "container": { + "type": "Container", + "id": 1 + }, + "script": { + "type": "Script", + "id": 2 + }, + "barrier": { + "type": "Barrier", + "id": 6 + }, + "displayName": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ignoreExitStatus": { + "type": "bool", + "id": 3 + }, + "background": { + "type": "bool", + "id": 4 + }, + "alwaysRun": { + "type": "bool", + "id": 5 + }, + "environment": { + "type": "Environment", + "id": 7 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 8 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 9 + } + }, + "nested": { + "Container": { + "fields": { + "imageUri": { + "type": "string", + "id": 1 + }, + "commands": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "entrypoint": { + "type": "string", + "id": 3 + }, + "volumes": { + "rule": "repeated", + "type": "string", + "id": 7 + }, + "options": { + "type": "string", + "id": 8 + }, + "blockExternalNetwork": { + "type": "bool", + "id": 9 + }, + "username": { + "type": "string", + "id": 10 + }, + "password": { + "type": "string", + "id": 11 + }, + "enableImageStreaming": { + "type": "bool", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Script": { + "oneofs": { + "command": { + "oneof": [ + "path", + "text" + ] + } + }, + "fields": { + "path": { + "type": "string", + "id": 1 + }, + "text": { + "type": "string", + "id": 2 + } + } + }, + "Barrier": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + } + } + }, + "TaskSpec": { + "fields": { + "runnables": { + "rule": "repeated", + "type": "Runnable", + "id": 8 + }, + "computeResource": { + "type": "ComputeResource", + "id": 3 + }, + "maxRunDuration": { + "type": "google.protobuf.Duration", + "id": 4 + }, + "maxRetryCount": { + "type": "int32", + "id": 5 + }, + "lifecyclePolicies": { + "rule": "repeated", + "type": "LifecyclePolicy", + "id": 9 + }, + "environments": { + "keyType": "string", + "type": "string", + "id": 6, + "options": { + "deprecated": true + } + }, + "volumes": { + "rule": "repeated", + "type": "Volume", + "id": 7 + }, + "environment": { + "type": "Environment", + "id": 10 + } + } + }, + "LifecyclePolicy": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "actionCondition": { + "type": "ActionCondition", + "id": 2 + } + }, + "nested": { + "ActionCondition": { + "fields": { + "exitCodes": { + "rule": "repeated", + "type": "int32", + "id": 1 + } + } + }, + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "RETRY_TASK": 1, + "FAIL_TASK": 2 + } + } + } + }, + "Task": { + "options": { + "(google.api.resource).type": "batch.googleapis.com/Task", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}/tasks/{task}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "status": { + "type": "TaskStatus", + "id": 2 + } + } + }, + "Environment": { + "fields": { + "variables": { + "keyType": "string", + "type": "string", + "id": 1 + }, + "secretVariables": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "encryptedVariables": { + "type": "KMSEnvMap", + "id": 3 + } + }, + "nested": { + "KMSEnvMap": { + "fields": { + "keyName": { + "type": "string", + "id": 1 + }, + "cipherText": { + "type": "string", + "id": 2 + } + } + } + } + }, + "Volume": { + "oneofs": { + "source": { + "oneof": [ + "nfs", + "pd", + "gcs", + "deviceName" + ] + } + }, + "fields": { + "nfs": { + "type": "NFS", + "id": 1 + }, + "pd": { + "type": "PD", + "id": 2, + "options": { + "deprecated": true + } + }, + "gcs": { + "type": "GCS", + "id": 3 + }, + "deviceName": { + "type": "string", + "id": 6 + }, + "mountPath": { + "type": "string", + "id": 4 + }, + "mountOptions": { + "rule": "repeated", + "type": "string", + "id": 5 + } + } + }, + "NFS": { + "fields": { + "server": { + "type": "string", + "id": 1 + }, + "remotePath": { + "type": "string", + "id": 2 + } + } + }, + "PD": { + "fields": { + "disk": { + "type": "string", + "id": 1 + }, + "device": { + "type": "string", + "id": 2 + }, + "existing": { + "type": "bool", + "id": 3, + "options": { + "deprecated": true + } + } + } + }, + "GCS": { + "fields": { + "remotePath": { + "type": "string", + "id": 1 + } + } + }, + "CalendarPeriod": { + "values": { + "CALENDAR_PERIOD_UNSPECIFIED": 0, + "MONTH": 1, + "QUARTER": 2, + "YEAR": 3, + "WEEK": 4, + "DAY": 5 + } + }, + "ResourceAllowanceState": { + "values": { + "RESOURCE_ALLOWANCE_STATE_UNSPECIFIED": 0, + "RESOURCE_ALLOWANCE_ACTIVE": 1, + "RESOURCE_ALLOWANCE_DEPLETED": 2 + } + }, + "ResourceAllowance": { + "options": { + "(google.api.resource).type": "batch.googleapis.com/ResourceAllowance", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/resourceAllowances/{resource_allowance}", + "(google.api.resource).plural": "resourceAllowances", + "(google.api.resource).singular": "resourceAllowance" + }, + "oneofs": { + "resourceAllowance": { + "oneof": [ + "usageResourceAllowance" + ] + } + }, + "fields": { + "usageResourceAllowance": { + "type": "UsageResourceAllowance", + "id": 4 + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "uid": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "notifications": { + "rule": "repeated", + "type": "Notification", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UsageResourceAllowance": { + "fields": { + "spec": { + "type": "UsageResourceAllowanceSpec", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "status": { + "type": "UsageResourceAllowanceStatus", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "UsageResourceAllowanceSpec": { + "fields": { + "type": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "limit": { + "type": "Limit", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "Limit": { + "oneofs": { + "duration": { + "oneof": [ + "calendarPeriod" + ] + }, + "_limit": { + "oneof": [ + "limit" + ] + } + }, + "fields": { + "calendarPeriod": { + "type": "CalendarPeriod", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "limit": { + "type": "double", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + } + } + } + } + }, + "UsageResourceAllowanceStatus": { + "fields": { + "state": { + "type": "ResourceAllowanceState", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "limitStatus": { + "type": "LimitStatus", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "report": { + "type": "ConsumptionReport", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "LimitStatus": { + "oneofs": { + "_limit": { + "oneof": [ + "limit" + ] + }, + "_consumed": { + "oneof": [ + "consumed" + ] + } + }, + "fields": { + "consumptionInterval": { + "type": "google.type.Interval", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "limit": { + "type": "double", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "consumed": { + "type": "double", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + } + } + }, + "PeriodConsumption": { + "oneofs": { + "_consumed": { + "oneof": [ + "consumed" + ] + } + }, + "fields": { + "consumptionInterval": { + "type": "google.type.Interval", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "consumed": { + "type": "double", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + } + } + }, + "ConsumptionReport": { + "fields": { + "latestPeriodConsumptions": { + "keyType": "string", + "type": "PeriodConsumption", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, + "Notification": { + "fields": { + "pubsubTopic": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ResourceProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "apiVersion": { + "type": "string", + "id": 525000001, + "extend": "google.protobuf.ServiceOptions" + }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 + }, + "restReferenceDocumentationUri": { + "type": "string", + "id": 111 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "renamedResources": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "ignoredResources": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "forcedNamespaceAliases": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "handwrittenSignatures": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + }, + "autoPopulatedFields": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "PACKAGE_MANAGER": 20 + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + }, + "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 + } + }, + "fieldInfo": { + "type": "google.api.FieldInfo", + "id": 291403980, + "extend": "google.protobuf.FieldOptions" + }, + "FieldInfo": { + "fields": { + "format": { + "type": "Format", + "id": 1 + } + }, + "nested": { + "Format": { + "values": { + "FORMAT_UNSPECIFIED": 0, + "UUID4": 1, + "IPV4": 2, + "IPV6": 3, + "IPV4_OR_IPV6": 4 + } + } + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "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": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "Edition": { + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, + "FileDescriptorProto": { + "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, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "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": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "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": { + "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": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "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": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "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": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19, + "options": { + "packed": false + } + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 18, + 18 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "value": { + "type": "string", + "id": 2 + } + } + } + } + }, + "OneofOptions": { + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "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": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "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": { + "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": { + "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": { + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO2", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + } + }, + "extensions": [ + [ + 1000, + 1000 + ], + [ + 1001, + 1001 + ], + [ + 1002, + 1002 + ], + [ + 9990, + 9990 + ], + [ + 9995, + 9999 + ], + [ + 10000, + 10000 + ] + ], + "reserved": [ + [ + 999, + 999 + ] + ], + "nested": { + "FieldPresence": { + "values": { + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3 + } + }, + "EnumType": { + "values": { + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "RepeatedFieldEncoding": { + "values": { + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2 + } + }, + "Utf8Validation": { + "values": { + "UTF8_VALIDATION_UNKNOWN": 0, + "VERIFY": 2, + "NONE": 3 + } + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + } + } + }, + "FeatureSetDefaults": { + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "features": { + "type": "FeatureSet", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "type": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/type/interval;interval", + "java_multiple_files": true, + "java_outer_classname": "IntervalProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Interval": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.cancel_job.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.cancel_job.js new file mode 100644 index 00000000000..db19d7b5b83 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.cancel_job.js @@ -0,0 +1,76 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START batch_v1alpha_generated_BatchService_CancelJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Job name. + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callCancelJob() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await batchClient.cancelJob(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCancelJob(); + // [END batch_v1alpha_generated_BatchService_CancelJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.create_job.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.create_job.js new file mode 100644 index 00000000000..29d4db9cb4e --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.create_job.js @@ -0,0 +1,92 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, job) { + // [START batch_v1alpha_generated_BatchService_CreateJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name where the Job will be created. + * Pattern: "projects/{project}/locations/{location}" + */ + // const parent = 'abc123' + /** + * ID used to uniquely identify the Job within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and '-' are accepted. + * The '-' character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The job.name field in the request will be ignored and the created resource + * name of the Job will be "{parent}/jobs/{job_id}". + */ + // const jobId = 'abc123' + /** + * Required. The Job to create. + */ + // const job = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callCreateJob() { + // Construct request + const request = { + parent, + job, + }; + + // Run request + const response = await batchClient.createJob(request); + console.log(response); + } + + callCreateJob(); + // [END batch_v1alpha_generated_BatchService_CreateJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.create_resource_allowance.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.create_resource_allowance.js new file mode 100644 index 00000000000..b5856107cd7 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.create_resource_allowance.js @@ -0,0 +1,93 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, resourceAllowance) { + // [START batch_v1alpha_generated_BatchService_CreateResourceAllowance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name where the ResourceAllowance will be + * created. Pattern: "projects/{project}/locations/{location}" + */ + // const parent = 'abc123' + /** + * ID used to uniquely identify the ResourceAllowance within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and '-' are accepted. + * The '-' character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The resource_allowance.name field in the request will be ignored and the + * created resource name of the ResourceAllowance will be + * "{parent}/resourceAllowances/{resource_allowance_id}". + */ + // const resourceAllowanceId = 'abc123' + /** + * Required. The ResourceAllowance to create. + */ + // const resourceAllowance = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callCreateResourceAllowance() { + // Construct request + const request = { + parent, + resourceAllowance, + }; + + // Run request + const response = await batchClient.createResourceAllowance(request); + console.log(response); + } + + callCreateResourceAllowance(); + // [END batch_v1alpha_generated_BatchService_CreateResourceAllowance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.delete_job.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.delete_job.js new file mode 100644 index 00000000000..3f513786b47 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.delete_job.js @@ -0,0 +1,79 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START batch_v1alpha_generated_BatchService_DeleteJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Job name. + */ + // const name = 'abc123' + /** + * Optional. Reason for this deletion. + */ + // const reason = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callDeleteJob() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await batchClient.deleteJob(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteJob(); + // [END batch_v1alpha_generated_BatchService_DeleteJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.delete_resource_allowance.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.delete_resource_allowance.js new file mode 100644 index 00000000000..5b3cf737119 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.delete_resource_allowance.js @@ -0,0 +1,80 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START batch_v1alpha_generated_BatchService_DeleteResourceAllowance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. ResourceAllowance name. + */ + // const name = 'abc123' + /** + * Optional. Reason for this deletion. + */ + // const reason = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callDeleteResourceAllowance() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await batchClient.deleteResourceAllowance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteResourceAllowance(); + // [END batch_v1alpha_generated_BatchService_DeleteResourceAllowance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_job.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_job.js new file mode 100644 index 00000000000..4a8b7580df0 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_job.js @@ -0,0 +1,61 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START batch_v1alpha_generated_BatchService_GetJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Job name. + */ + // const name = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callGetJob() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await batchClient.getJob(request); + console.log(response); + } + + callGetJob(); + // [END batch_v1alpha_generated_BatchService_GetJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_resource_allowance.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_resource_allowance.js new file mode 100644 index 00000000000..0fbe3143354 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_resource_allowance.js @@ -0,0 +1,61 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START batch_v1alpha_generated_BatchService_GetResourceAllowance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. ResourceAllowance name. + */ + // const name = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callGetResourceAllowance() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await batchClient.getResourceAllowance(request); + console.log(response); + } + + callGetResourceAllowance(); + // [END batch_v1alpha_generated_BatchService_GetResourceAllowance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_task.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_task.js new file mode 100644 index 00000000000..4de5248d352 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_task.js @@ -0,0 +1,61 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START batch_v1alpha_generated_BatchService_GetTask_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Task name. + */ + // const name = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callGetTask() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await batchClient.getTask(request); + console.log(response); + } + + callGetTask(); + // [END batch_v1alpha_generated_BatchService_GetTask_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_jobs.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_jobs.js new file mode 100644 index 00000000000..42a2ecc05b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_jobs.js @@ -0,0 +1,79 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START batch_v1alpha_generated_BatchService_ListJobs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Parent path. + */ + // const parent = 'abc123' + /** + * List filter. + */ + // const filter = 'abc123' + /** + * Optional. Sort results. Supported are "name", "name desc", "create_time", + * and "create_time desc". + */ + // const orderBy = 'abc123' + /** + * Page size. + */ + // const pageSize = 1234 + /** + * Page token. + */ + // const pageToken = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callListJobs() { + // Construct request + const request = { + }; + + // Run request + const iterable = batchClient.listJobsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListJobs(); + // [END batch_v1alpha_generated_BatchService_ListJobs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_resource_allowances.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_resource_allowances.js new file mode 100644 index 00000000000..db9329acf53 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_resource_allowances.js @@ -0,0 +1,71 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START batch_v1alpha_generated_BatchService_ListResourceAllowances_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent path. + */ + // const parent = 'abc123' + /** + * Optional. Page size. + */ + // const pageSize = 1234 + /** + * Optional. Page token. + */ + // const pageToken = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callListResourceAllowances() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = batchClient.listResourceAllowancesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListResourceAllowances(); + // [END batch_v1alpha_generated_BatchService_ListResourceAllowances_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_tasks.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_tasks.js new file mode 100644 index 00000000000..8214c4fede3 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_tasks.js @@ -0,0 +1,83 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START batch_v1alpha_generated_BatchService_ListTasks_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of a TaskGroup from which Tasks are being requested. + * Pattern: + * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + */ + // const parent = 'abc123' + /** + * Task filter, null filter matches all Tasks. + * Filter string should be of the format State=TaskStatus.State e.g. + * State=RUNNING + */ + // const filter = 'abc123' + /** + * Not implemented. + */ + // const orderBy = 'abc123' + /** + * Page size. + */ + // const pageSize = 1234 + /** + * Page token. + */ + // const pageToken = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callListTasks() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = batchClient.listTasksAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTasks(); + // [END batch_v1alpha_generated_BatchService_ListTasks_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.update_job.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.update_job.js new file mode 100644 index 00000000000..3b8066040b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.update_job.js @@ -0,0 +1,95 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(job, updateMask) { + // [START batch_v1alpha_generated_BatchService_UpdateJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The Job to update. + * Only fields specified in `updateMask` are updated. + */ + // const job = {} + /** + * Required. Mask of fields to update. + * The `jobs.patch` method can only be used while a job is in the `QUEUED`, + * `SCHEDULED`, or `RUNNING` state and currently only supports increasing the + * value of the first `taskCount` field in the job's `taskGroups` field. + * Therefore, you must set the value of `updateMask` to `taskGroups`. Any + * other job fields in the update request will be ignored. + * For example, to update a job's `taskCount` to `2`, set `updateMask` to + * `taskGroups` and use the following request body: + * ``` + * { + * "taskGroups":{ + * "taskCount": 2 + * } + * } + * ``` + */ + // const updateMask = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callUpdateJob() { + // Construct request + const request = { + job, + updateMask, + }; + + // Run request + const response = await batchClient.updateJob(request); + console.log(response); + } + + callUpdateJob(); + // [END batch_v1alpha_generated_BatchService_UpdateJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.update_resource_allowance.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.update_resource_allowance.js new file mode 100644 index 00000000000..0cdf6071c8f --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.update_resource_allowance.js @@ -0,0 +1,88 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(resourceAllowance, updateMask) { + // [START batch_v1alpha_generated_BatchService_UpdateResourceAllowance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The ResourceAllowance to update. + * Update description. + * Only fields specified in `update_mask` are updated. + */ + // const resourceAllowance = {} + /** + * Required. Mask of fields to update. + * Field mask is used to specify the fields to be overwritten in the + * ResourceAllowance resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * UpdateResourceAllowance request now only supports update on `limit` field. + */ + // const updateMask = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callUpdateResourceAllowance() { + // Construct request + const request = { + resourceAllowance, + updateMask, + }; + + // Run request + const response = await batchClient.updateResourceAllowance(request); + console.log(response); + } + + callUpdateResourceAllowance(); + // [END batch_v1alpha_generated_BatchService_UpdateResourceAllowance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/snippet_metadata_google.cloud.batch.v1alpha.json b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/snippet_metadata_google.cloud.batch.v1alpha.json new file mode 100644 index 00000000000..a02256ec594 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/snippet_metadata_google.cloud.batch.v1alpha.json @@ -0,0 +1,635 @@ +{ + "clientLibrary": { + "name": "nodejs-batch", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.batch.v1alpha", + "version": "v1alpha" + } + ] + }, + "snippets": [ + { + "regionTag": "batch_v1alpha_generated_BatchService_CreateJob_async", + "title": "BatchService createJob Sample", + "origin": "API_DEFINITION", + "description": " Create a Job.", + "canonical": true, + "file": "batch_service.create_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 84, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateJob", + "fullName": "google.cloud.batch.v1alpha.BatchService.CreateJob", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "job_id", + "type": "TYPE_STRING" + }, + { + "name": "job", + "type": ".google.cloud.batch.v1alpha.Job" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.batch.v1alpha.Job", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" + }, + "method": { + "shortName": "CreateJob", + "fullName": "google.cloud.batch.v1alpha.BatchService.CreateJob", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1alpha.BatchService" + } + } + } + }, + { + "regionTag": "batch_v1alpha_generated_BatchService_GetJob_async", + "title": "BatchService getJob Sample", + "origin": "API_DEFINITION", + "description": " Get a Job specified by its resource name.", + "canonical": true, + "file": "batch_service.get_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetJob", + "fullName": "google.cloud.batch.v1alpha.BatchService.GetJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.batch.v1alpha.Job", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" + }, + "method": { + "shortName": "GetJob", + "fullName": "google.cloud.batch.v1alpha.BatchService.GetJob", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1alpha.BatchService" + } + } + } + }, + { + "regionTag": "batch_v1alpha_generated_BatchService_DeleteJob_async", + "title": "BatchService deleteJob Sample", + "origin": "API_DEFINITION", + "description": " Delete a Job.", + "canonical": true, + "file": "batch_service.delete_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteJob", + "fullName": "google.cloud.batch.v1alpha.BatchService.DeleteJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "reason", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" + }, + "method": { + "shortName": "DeleteJob", + "fullName": "google.cloud.batch.v1alpha.BatchService.DeleteJob", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1alpha.BatchService" + } + } + } + }, + { + "regionTag": "batch_v1alpha_generated_BatchService_CancelJob_async", + "title": "BatchService cancelJob Sample", + "origin": "API_DEFINITION", + "description": " Cancel a Job.", + "canonical": true, + "file": "batch_service.cancel_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CancelJob", + "fullName": "google.cloud.batch.v1alpha.BatchService.CancelJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" + }, + "method": { + "shortName": "CancelJob", + "fullName": "google.cloud.batch.v1alpha.BatchService.CancelJob", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1alpha.BatchService" + } + } + } + }, + { + "regionTag": "batch_v1alpha_generated_BatchService_UpdateJob_async", + "title": "BatchService updateJob Sample", + "origin": "API_DEFINITION", + "description": " Update a Job.", + "canonical": true, + "file": "batch_service.update_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 87, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateJob", + "fullName": "google.cloud.batch.v1alpha.BatchService.UpdateJob", + "async": true, + "parameters": [ + { + "name": "job", + "type": ".google.cloud.batch.v1alpha.Job" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.batch.v1alpha.Job", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" + }, + "method": { + "shortName": "UpdateJob", + "fullName": "google.cloud.batch.v1alpha.BatchService.UpdateJob", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1alpha.BatchService" + } + } + } + }, + { + "regionTag": "batch_v1alpha_generated_BatchService_ListJobs_async", + "title": "BatchService listJobs Sample", + "origin": "API_DEFINITION", + "description": " List all Jobs for a project within a region.", + "canonical": true, + "file": "batch_service.list_jobs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListJobs", + "fullName": "google.cloud.batch.v1alpha.BatchService.ListJobs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.batch.v1alpha.ListJobsResponse", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" + }, + "method": { + "shortName": "ListJobs", + "fullName": "google.cloud.batch.v1alpha.BatchService.ListJobs", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1alpha.BatchService" + } + } + } + }, + { + "regionTag": "batch_v1alpha_generated_BatchService_GetTask_async", + "title": "BatchService getTask Sample", + "origin": "API_DEFINITION", + "description": " Return a single Task.", + "canonical": true, + "file": "batch_service.get_task.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetTask", + "fullName": "google.cloud.batch.v1alpha.BatchService.GetTask", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.batch.v1alpha.Task", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" + }, + "method": { + "shortName": "GetTask", + "fullName": "google.cloud.batch.v1alpha.BatchService.GetTask", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1alpha.BatchService" + } + } + } + }, + { + "regionTag": "batch_v1alpha_generated_BatchService_ListTasks_async", + "title": "BatchService listTasks Sample", + "origin": "API_DEFINITION", + "description": " List Tasks associated with a job.", + "canonical": true, + "file": "batch_service.list_tasks.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListTasks", + "fullName": "google.cloud.batch.v1alpha.BatchService.ListTasks", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.batch.v1alpha.ListTasksResponse", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" + }, + "method": { + "shortName": "ListTasks", + "fullName": "google.cloud.batch.v1alpha.BatchService.ListTasks", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1alpha.BatchService" + } + } + } + }, + { + "regionTag": "batch_v1alpha_generated_BatchService_CreateResourceAllowance_async", + "title": "BatchService createResourceAllowance Sample", + "origin": "API_DEFINITION", + "description": " Create a Resource Allowance.", + "canonical": true, + "file": "batch_service.create_resource_allowance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateResourceAllowance", + "fullName": "google.cloud.batch.v1alpha.BatchService.CreateResourceAllowance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "resource_allowance_id", + "type": "TYPE_STRING" + }, + { + "name": "resource_allowance", + "type": ".google.cloud.batch.v1alpha.ResourceAllowance" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.batch.v1alpha.ResourceAllowance", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" + }, + "method": { + "shortName": "CreateResourceAllowance", + "fullName": "google.cloud.batch.v1alpha.BatchService.CreateResourceAllowance", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1alpha.BatchService" + } + } + } + }, + { + "regionTag": "batch_v1alpha_generated_BatchService_GetResourceAllowance_async", + "title": "BatchService getResourceAllowance Sample", + "origin": "API_DEFINITION", + "description": " Get a ResourceAllowance specified by its resource name.", + "canonical": true, + "file": "batch_service.get_resource_allowance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetResourceAllowance", + "fullName": "google.cloud.batch.v1alpha.BatchService.GetResourceAllowance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.batch.v1alpha.ResourceAllowance", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" + }, + "method": { + "shortName": "GetResourceAllowance", + "fullName": "google.cloud.batch.v1alpha.BatchService.GetResourceAllowance", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1alpha.BatchService" + } + } + } + }, + { + "regionTag": "batch_v1alpha_generated_BatchService_DeleteResourceAllowance_async", + "title": "BatchService deleteResourceAllowance Sample", + "origin": "API_DEFINITION", + "description": " Delete a ResourceAllowance.", + "canonical": true, + "file": "batch_service.delete_resource_allowance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteResourceAllowance", + "fullName": "google.cloud.batch.v1alpha.BatchService.DeleteResourceAllowance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "reason", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" + }, + "method": { + "shortName": "DeleteResourceAllowance", + "fullName": "google.cloud.batch.v1alpha.BatchService.DeleteResourceAllowance", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1alpha.BatchService" + } + } + } + }, + { + "regionTag": "batch_v1alpha_generated_BatchService_ListResourceAllowances_async", + "title": "BatchService listResourceAllowances Sample", + "origin": "API_DEFINITION", + "description": " List all ResourceAllowances for a project within a region.", + "canonical": true, + "file": "batch_service.list_resource_allowances.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListResourceAllowances", + "fullName": "google.cloud.batch.v1alpha.BatchService.ListResourceAllowances", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.batch.v1alpha.ListResourceAllowancesResponse", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" + }, + "method": { + "shortName": "ListResourceAllowances", + "fullName": "google.cloud.batch.v1alpha.BatchService.ListResourceAllowances", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1alpha.BatchService" + } + } + } + }, + { + "regionTag": "batch_v1alpha_generated_BatchService_UpdateResourceAllowance_async", + "title": "BatchService updateResourceAllowance Sample", + "origin": "API_DEFINITION", + "description": " Update a Resource Allowance.", + "canonical": true, + "file": "batch_service.update_resource_allowance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateResourceAllowance", + "fullName": "google.cloud.batch.v1alpha.BatchService.UpdateResourceAllowance", + "async": true, + "parameters": [ + { + "name": "resource_allowance", + "type": ".google.cloud.batch.v1alpha.ResourceAllowance" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.batch.v1alpha.ResourceAllowance", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" + }, + "method": { + "shortName": "UpdateResourceAllowance", + "fullName": "google.cloud.batch.v1alpha.BatchService.UpdateResourceAllowance", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1alpha.BatchService" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/src/index.ts b/owl-bot-staging/google-cloud-batch/v1alpha/src/index.ts new file mode 100644 index 00000000000..8208d9bc746 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 v1alpha from './v1alpha'; +const BatchServiceClient = v1alpha.BatchServiceClient; +type BatchServiceClient = v1alpha.BatchServiceClient; +export {v1alpha, BatchServiceClient}; +export default {v1alpha, BatchServiceClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_client.ts b/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_client.ts new file mode 100644 index 00000000000..c7897648928 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_client.ts @@ -0,0 +1,2441 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v1alpha/batch_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './batch_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Google Batch Service. + * The service manages user submitted batch jobs and allocates Google Compute + * Engine VM instances to run the jobs. + * @class + * @memberof v1alpha + */ +export class BatchServiceClient { + 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; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + batchServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of BatchServiceClient. + * + * @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://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @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 BatchServiceClient({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 BatchServiceClient; + 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 = 'batch.' + 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; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + jobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/jobs/{job}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + resourceAllowancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/resourceAllowances/{resource_allowance}' + ), + taskPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}/tasks/{task}' + ), + taskGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}' + ), + }; + + // 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 = { + listJobs: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'jobs'), + listTasks: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'tasks'), + listResourceAllowances: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'resourceAllowances') + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v1alpha/{name=projects/*/locations/*}',},{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1alpha/{name=projects/*}/locations',},{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1alpha/{name=projects/*/locations/*/operations/*}:cancel',body: '*',},{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1alpha/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1alpha/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1alpha/{name=projects/*/locations/*}/operations',}]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const deleteJobResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteJobMetadata = protoFilesRoot.lookup( + '.google.cloud.batch.v1alpha.OperationMetadata') as gax.protobuf.Type; + const cancelJobResponse = protoFilesRoot.lookup( + '.google.cloud.batch.v1alpha.CancelJobResponse') as gax.protobuf.Type; + const cancelJobMetadata = protoFilesRoot.lookup( + '.google.cloud.batch.v1alpha.OperationMetadata') as gax.protobuf.Type; + const deleteResourceAllowanceResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteResourceAllowanceMetadata = protoFilesRoot.lookup( + '.google.cloud.batch.v1alpha.OperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + deleteJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteJobResponse.decode.bind(deleteJobResponse), + deleteJobMetadata.decode.bind(deleteJobMetadata)), + cancelJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + cancelJobResponse.decode.bind(cancelJobResponse), + cancelJobMetadata.decode.bind(cancelJobMetadata)), + deleteResourceAllowance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteResourceAllowanceResponse.decode.bind(deleteResourceAllowanceResponse), + deleteResourceAllowanceMetadata.decode.bind(deleteResourceAllowanceMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.batch.v1alpha.BatchService', 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.batchServiceStub) { + return this.batchServiceStub; + } + + // Put together the "service stub" for + // google.cloud.batch.v1alpha.BatchService. + this.batchServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.batch.v1alpha.BatchService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.batch.v1alpha.BatchService, + 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 batchServiceStubMethods = + ['createJob', 'getJob', 'deleteJob', 'cancelJob', 'updateJob', 'listJobs', 'getTask', 'listTasks', 'createResourceAllowance', 'getResourceAllowance', 'deleteResourceAllowance', 'listResourceAllowances', 'updateResourceAllowance']; + for (const methodName of batchServiceStubMethods) { + const callPromise = this.batchServiceStub.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.batchServiceStub; + } + + /** + * 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 'batch.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 'batch.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' + ]; + } + + 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 -- + // ------------------- +/** + * Create a Job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name where the Job will be created. + * Pattern: "projects/{project}/locations/{location}" + * @param {string} request.jobId + * ID used to uniquely identify the Job within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and '-' are accepted. + * The '-' character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * + * The job.name field in the request will be ignored and the created resource + * name of the Job will be "{parent}/jobs/{job_id}". + * @param {google.cloud.batch.v1alpha.Job} request.job + * Required. The Job to create. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1alpha.Job|Job}. + * 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/v1alpha/batch_service.create_job.js + * region_tag:batch_v1alpha_generated_BatchService_CreateJob_async + */ + createJob( + request?: protos.google.cloud.batch.v1alpha.ICreateJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.ICreateJobRequest|undefined, {}|undefined + ]>; + createJob( + request: protos.google.cloud.batch.v1alpha.ICreateJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.ICreateJobRequest|null|undefined, + {}|null|undefined>): void; + createJob( + request: protos.google.cloud.batch.v1alpha.ICreateJobRequest, + callback: Callback< + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.ICreateJobRequest|null|undefined, + {}|null|undefined>): void; + createJob( + request?: protos.google.cloud.batch.v1alpha.ICreateJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.ICreateJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.ICreateJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.ICreateJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createJob(request, options, callback); + } +/** + * Get a Job specified by its resource name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Job name. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1alpha.Job|Job}. + * 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/v1alpha/batch_service.get_job.js + * region_tag:batch_v1alpha_generated_BatchService_GetJob_async + */ + getJob( + request?: protos.google.cloud.batch.v1alpha.IGetJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.IGetJobRequest|undefined, {}|undefined + ]>; + getJob( + request: protos.google.cloud.batch.v1alpha.IGetJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.IGetJobRequest|null|undefined, + {}|null|undefined>): void; + getJob( + request: protos.google.cloud.batch.v1alpha.IGetJobRequest, + callback: Callback< + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.IGetJobRequest|null|undefined, + {}|null|undefined>): void; + getJob( + request?: protos.google.cloud.batch.v1alpha.IGetJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.IGetJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.IGetJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.IGetJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getJob(request, options, callback); + } +/** + * Update a Job. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.batch.v1alpha.Job} request.job + * Required. The Job to update. + * Only fields specified in `updateMask` are updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. + * + * The `jobs.patch` method can only be used while a job is in the `QUEUED`, + * `SCHEDULED`, or `RUNNING` state and currently only supports increasing the + * value of the first `taskCount` field in the job's `taskGroups` field. + * Therefore, you must set the value of `updateMask` to `taskGroups`. Any + * other job fields in the update request will be ignored. + * + * For example, to update a job's `taskCount` to `2`, set `updateMask` to + * `taskGroups` and use the following request body: + * ``` + * { + * "taskGroups":[{ + * "taskCount": 2 + * }] + * } + * ``` + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1alpha.Job|Job}. + * 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/v1alpha/batch_service.update_job.js + * region_tag:batch_v1alpha_generated_BatchService_UpdateJob_async + */ + updateJob( + request?: protos.google.cloud.batch.v1alpha.IUpdateJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.IUpdateJobRequest|undefined, {}|undefined + ]>; + updateJob( + request: protos.google.cloud.batch.v1alpha.IUpdateJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.IUpdateJobRequest|null|undefined, + {}|null|undefined>): void; + updateJob( + request: protos.google.cloud.batch.v1alpha.IUpdateJobRequest, + callback: Callback< + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.IUpdateJobRequest|null|undefined, + {}|null|undefined>): void; + updateJob( + request?: protos.google.cloud.batch.v1alpha.IUpdateJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.IUpdateJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.IUpdateJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.IUpdateJobRequest|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({ + 'job.name': request.job!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateJob(request, options, callback); + } +/** + * Return a single Task. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Task name. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1alpha.Task|Task}. + * 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/v1alpha/batch_service.get_task.js + * region_tag:batch_v1alpha_generated_BatchService_GetTask_async + */ + getTask( + request?: protos.google.cloud.batch.v1alpha.IGetTaskRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.batch.v1alpha.ITask, + protos.google.cloud.batch.v1alpha.IGetTaskRequest|undefined, {}|undefined + ]>; + getTask( + request: protos.google.cloud.batch.v1alpha.IGetTaskRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.batch.v1alpha.ITask, + protos.google.cloud.batch.v1alpha.IGetTaskRequest|null|undefined, + {}|null|undefined>): void; + getTask( + request: protos.google.cloud.batch.v1alpha.IGetTaskRequest, + callback: Callback< + protos.google.cloud.batch.v1alpha.ITask, + protos.google.cloud.batch.v1alpha.IGetTaskRequest|null|undefined, + {}|null|undefined>): void; + getTask( + request?: protos.google.cloud.batch.v1alpha.IGetTaskRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.batch.v1alpha.ITask, + protos.google.cloud.batch.v1alpha.IGetTaskRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.batch.v1alpha.ITask, + protos.google.cloud.batch.v1alpha.IGetTaskRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.batch.v1alpha.ITask, + protos.google.cloud.batch.v1alpha.IGetTaskRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getTask(request, options, callback); + } +/** + * Create a Resource Allowance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name where the ResourceAllowance will be + * created. Pattern: "projects/{project}/locations/{location}" + * @param {string} request.resourceAllowanceId + * ID used to uniquely identify the ResourceAllowance within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and '-' are accepted. + * The '-' character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * + * The resource_allowance.name field in the request will be ignored and the + * created resource name of the ResourceAllowance will be + * "{parent}/resourceAllowances/{resource_allowance_id}". + * @param {google.cloud.batch.v1alpha.ResourceAllowance} request.resourceAllowance + * Required. The ResourceAllowance to create. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1alpha.ResourceAllowance|ResourceAllowance}. + * 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/v1alpha/batch_service.create_resource_allowance.js + * region_tag:batch_v1alpha_generated_BatchService_CreateResourceAllowance_async + */ + createResourceAllowance( + request?: protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.batch.v1alpha.IResourceAllowance, + protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest|undefined, {}|undefined + ]>; + createResourceAllowance( + request: protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.batch.v1alpha.IResourceAllowance, + protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest|null|undefined, + {}|null|undefined>): void; + createResourceAllowance( + request: protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest, + callback: Callback< + protos.google.cloud.batch.v1alpha.IResourceAllowance, + protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest|null|undefined, + {}|null|undefined>): void; + createResourceAllowance( + request?: protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.batch.v1alpha.IResourceAllowance, + protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.batch.v1alpha.IResourceAllowance, + protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.batch.v1alpha.IResourceAllowance, + protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createResourceAllowance(request, options, callback); + } +/** + * Get a ResourceAllowance specified by its resource name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. ResourceAllowance name. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1alpha.ResourceAllowance|ResourceAllowance}. + * 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/v1alpha/batch_service.get_resource_allowance.js + * region_tag:batch_v1alpha_generated_BatchService_GetResourceAllowance_async + */ + getResourceAllowance( + request?: protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.batch.v1alpha.IResourceAllowance, + protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest|undefined, {}|undefined + ]>; + getResourceAllowance( + request: protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.batch.v1alpha.IResourceAllowance, + protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest|null|undefined, + {}|null|undefined>): void; + getResourceAllowance( + request: protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest, + callback: Callback< + protos.google.cloud.batch.v1alpha.IResourceAllowance, + protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest|null|undefined, + {}|null|undefined>): void; + getResourceAllowance( + request?: protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.batch.v1alpha.IResourceAllowance, + protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.batch.v1alpha.IResourceAllowance, + protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.batch.v1alpha.IResourceAllowance, + protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getResourceAllowance(request, options, callback); + } +/** + * Update a Resource Allowance. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.batch.v1alpha.ResourceAllowance} request.resourceAllowance + * Required. The ResourceAllowance to update. + * Update description. + * Only fields specified in `update_mask` are updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. + * + * Field mask is used to specify the fields to be overwritten in the + * ResourceAllowance resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * UpdateResourceAllowance request now only supports update on `limit` field. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1alpha.ResourceAllowance|ResourceAllowance}. + * 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/v1alpha/batch_service.update_resource_allowance.js + * region_tag:batch_v1alpha_generated_BatchService_UpdateResourceAllowance_async + */ + updateResourceAllowance( + request?: protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.batch.v1alpha.IResourceAllowance, + protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest|undefined, {}|undefined + ]>; + updateResourceAllowance( + request: protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.batch.v1alpha.IResourceAllowance, + protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest|null|undefined, + {}|null|undefined>): void; + updateResourceAllowance( + request: protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest, + callback: Callback< + protos.google.cloud.batch.v1alpha.IResourceAllowance, + protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest|null|undefined, + {}|null|undefined>): void; + updateResourceAllowance( + request?: protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.batch.v1alpha.IResourceAllowance, + protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.batch.v1alpha.IResourceAllowance, + protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.batch.v1alpha.IResourceAllowance, + protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'resource_allowance.name': request.resourceAllowance!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateResourceAllowance(request, options, callback); + } + +/** + * Delete a Job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Job name. + * @param {string} [request.reason] + * Optional. Reason for this deletion. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v1alpha/batch_service.delete_job.js + * region_tag:batch_v1alpha_generated_BatchService_DeleteJob_async + */ + deleteJob( + request?: protos.google.cloud.batch.v1alpha.IDeleteJobRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteJob( + request: protos.google.cloud.batch.v1alpha.IDeleteJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteJob( + request: protos.google.cloud.batch.v1alpha.IDeleteJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteJob( + request?: protos.google.cloud.batch.v1alpha.IDeleteJobRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteJob(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteJob()`. + * @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/v1alpha/batch_service.delete_job.js + * region_tag:batch_v1alpha_generated_BatchService_DeleteJob_async + */ + async checkDeleteJobProgress(name: string): Promise>{ + 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.deleteJob, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Cancel a Job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Job name. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v1alpha/batch_service.cancel_job.js + * region_tag:batch_v1alpha_generated_BatchService_CancelJob_async + */ + cancelJob( + request?: protos.google.cloud.batch.v1alpha.ICancelJobRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + cancelJob( + request: protos.google.cloud.batch.v1alpha.ICancelJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + cancelJob( + request: protos.google.cloud.batch.v1alpha.ICancelJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + cancelJob( + request?: protos.google.cloud.batch.v1alpha.ICancelJobRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.cancelJob(request, options, callback); + } +/** + * Check the status of the long running operation returned by `cancelJob()`. + * @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/v1alpha/batch_service.cancel_job.js + * region_tag:batch_v1alpha_generated_BatchService_CancelJob_async + */ + async checkCancelJobProgress(name: string): Promise>{ + 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.cancelJob, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Delete a ResourceAllowance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. ResourceAllowance name. + * @param {string} [request.reason] + * Optional. Reason for this deletion. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v1alpha/batch_service.delete_resource_allowance.js + * region_tag:batch_v1alpha_generated_BatchService_DeleteResourceAllowance_async + */ + deleteResourceAllowance( + request?: protos.google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteResourceAllowance( + request: protos.google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteResourceAllowance( + request: protos.google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteResourceAllowance( + request?: protos.google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteResourceAllowance(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteResourceAllowance()`. + * @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/v1alpha/batch_service.delete_resource_allowance.js + * region_tag:batch_v1alpha_generated_BatchService_DeleteResourceAllowance_async + */ + async checkDeleteResourceAllowanceProgress(name: string): Promise>{ + 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.deleteResourceAllowance, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * List all Jobs for a project within a region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Parent path. + * @param {string} request.filter + * List filter. + * @param {string} [request.orderBy] + * Optional. Sort results. Supported are "name", "name desc", "create_time", + * and "create_time desc". + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.batch.v1alpha.Job|Job}. + * 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 `listJobsAsync()` + * 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. + */ + listJobs( + request?: protos.google.cloud.batch.v1alpha.IListJobsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.batch.v1alpha.IJob[], + protos.google.cloud.batch.v1alpha.IListJobsRequest|null, + protos.google.cloud.batch.v1alpha.IListJobsResponse + ]>; + listJobs( + request: protos.google.cloud.batch.v1alpha.IListJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.batch.v1alpha.IListJobsRequest, + protos.google.cloud.batch.v1alpha.IListJobsResponse|null|undefined, + protos.google.cloud.batch.v1alpha.IJob>): void; + listJobs( + request: protos.google.cloud.batch.v1alpha.IListJobsRequest, + callback: PaginationCallback< + protos.google.cloud.batch.v1alpha.IListJobsRequest, + protos.google.cloud.batch.v1alpha.IListJobsResponse|null|undefined, + protos.google.cloud.batch.v1alpha.IJob>): void; + listJobs( + request?: protos.google.cloud.batch.v1alpha.IListJobsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.batch.v1alpha.IListJobsRequest, + protos.google.cloud.batch.v1alpha.IListJobsResponse|null|undefined, + protos.google.cloud.batch.v1alpha.IJob>, + callback?: PaginationCallback< + protos.google.cloud.batch.v1alpha.IListJobsRequest, + protos.google.cloud.batch.v1alpha.IListJobsResponse|null|undefined, + protos.google.cloud.batch.v1alpha.IJob>): + Promise<[ + protos.google.cloud.batch.v1alpha.IJob[], + protos.google.cloud.batch.v1alpha.IListJobsRequest|null, + protos.google.cloud.batch.v1alpha.IListJobsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listJobs(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Parent path. + * @param {string} request.filter + * List filter. + * @param {string} [request.orderBy] + * Optional. Sort results. Supported are "name", "name desc", "create_time", + * and "create_time desc". + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.batch.v1alpha.Job|Job} 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 `listJobsAsync()` + * 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. + */ + listJobsStream( + request?: protos.google.cloud.batch.v1alpha.IListJobsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listJobs.createStream( + this.innerApiCalls.listJobs as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listJobs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Parent path. + * @param {string} request.filter + * List filter. + * @param {string} [request.orderBy] + * Optional. Sort results. Supported are "name", "name desc", "create_time", + * and "create_time desc". + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.batch.v1alpha.Job|Job}. 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/v1alpha/batch_service.list_jobs.js + * region_tag:batch_v1alpha_generated_BatchService_ListJobs_async + */ + listJobsAsync( + request?: protos.google.cloud.batch.v1alpha.IListJobsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listJobs.asyncIterate( + this.innerApiCalls['listJobs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List Tasks associated with a job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of a TaskGroup from which Tasks are being requested. + * Pattern: + * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + * @param {string} request.filter + * Task filter, null filter matches all Tasks. + * Filter string should be of the format State=TaskStatus.State e.g. + * State=RUNNING + * @param {string} request.orderBy + * Not implemented. + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.batch.v1alpha.Task|Task}. + * 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 `listTasksAsync()` + * 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. + */ + listTasks( + request?: protos.google.cloud.batch.v1alpha.IListTasksRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.batch.v1alpha.ITask[], + protos.google.cloud.batch.v1alpha.IListTasksRequest|null, + protos.google.cloud.batch.v1alpha.IListTasksResponse + ]>; + listTasks( + request: protos.google.cloud.batch.v1alpha.IListTasksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.batch.v1alpha.IListTasksRequest, + protos.google.cloud.batch.v1alpha.IListTasksResponse|null|undefined, + protos.google.cloud.batch.v1alpha.ITask>): void; + listTasks( + request: protos.google.cloud.batch.v1alpha.IListTasksRequest, + callback: PaginationCallback< + protos.google.cloud.batch.v1alpha.IListTasksRequest, + protos.google.cloud.batch.v1alpha.IListTasksResponse|null|undefined, + protos.google.cloud.batch.v1alpha.ITask>): void; + listTasks( + request?: protos.google.cloud.batch.v1alpha.IListTasksRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.batch.v1alpha.IListTasksRequest, + protos.google.cloud.batch.v1alpha.IListTasksResponse|null|undefined, + protos.google.cloud.batch.v1alpha.ITask>, + callback?: PaginationCallback< + protos.google.cloud.batch.v1alpha.IListTasksRequest, + protos.google.cloud.batch.v1alpha.IListTasksResponse|null|undefined, + protos.google.cloud.batch.v1alpha.ITask>): + Promise<[ + protos.google.cloud.batch.v1alpha.ITask[], + protos.google.cloud.batch.v1alpha.IListTasksRequest|null, + protos.google.cloud.batch.v1alpha.IListTasksResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listTasks(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of a TaskGroup from which Tasks are being requested. + * Pattern: + * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + * @param {string} request.filter + * Task filter, null filter matches all Tasks. + * Filter string should be of the format State=TaskStatus.State e.g. + * State=RUNNING + * @param {string} request.orderBy + * Not implemented. + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.batch.v1alpha.Task|Task} 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 `listTasksAsync()` + * 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. + */ + listTasksStream( + request?: protos.google.cloud.batch.v1alpha.IListTasksRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listTasks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTasks.createStream( + this.innerApiCalls.listTasks as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listTasks`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of a TaskGroup from which Tasks are being requested. + * Pattern: + * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + * @param {string} request.filter + * Task filter, null filter matches all Tasks. + * Filter string should be of the format State=TaskStatus.State e.g. + * State=RUNNING + * @param {string} request.orderBy + * Not implemented. + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.batch.v1alpha.Task|Task}. 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/v1alpha/batch_service.list_tasks.js + * region_tag:batch_v1alpha_generated_BatchService_ListTasks_async + */ + listTasksAsync( + request?: protos.google.cloud.batch.v1alpha.IListTasksRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listTasks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTasks.asyncIterate( + this.innerApiCalls['listTasks'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List all ResourceAllowances for a project within a region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent path. + * @param {number} [request.pageSize] + * Optional. Page size. + * @param {string} [request.pageToken] + * Optional. Page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.batch.v1alpha.ResourceAllowance|ResourceAllowance}. + * 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 `listResourceAllowancesAsync()` + * 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. + */ + listResourceAllowances( + request?: protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.batch.v1alpha.IResourceAllowance[], + protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest|null, + protos.google.cloud.batch.v1alpha.IListResourceAllowancesResponse + ]>; + listResourceAllowances( + request: protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, + protos.google.cloud.batch.v1alpha.IListResourceAllowancesResponse|null|undefined, + protos.google.cloud.batch.v1alpha.IResourceAllowance>): void; + listResourceAllowances( + request: protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, + callback: PaginationCallback< + protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, + protos.google.cloud.batch.v1alpha.IListResourceAllowancesResponse|null|undefined, + protos.google.cloud.batch.v1alpha.IResourceAllowance>): void; + listResourceAllowances( + request?: protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, + protos.google.cloud.batch.v1alpha.IListResourceAllowancesResponse|null|undefined, + protos.google.cloud.batch.v1alpha.IResourceAllowance>, + callback?: PaginationCallback< + protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, + protos.google.cloud.batch.v1alpha.IListResourceAllowancesResponse|null|undefined, + protos.google.cloud.batch.v1alpha.IResourceAllowance>): + Promise<[ + protos.google.cloud.batch.v1alpha.IResourceAllowance[], + protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest|null, + protos.google.cloud.batch.v1alpha.IListResourceAllowancesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listResourceAllowances(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent path. + * @param {number} [request.pageSize] + * Optional. Page size. + * @param {string} [request.pageToken] + * Optional. Page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.batch.v1alpha.ResourceAllowance|ResourceAllowance} 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 `listResourceAllowancesAsync()` + * 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. + */ + listResourceAllowancesStream( + request?: protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listResourceAllowances']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listResourceAllowances.createStream( + this.innerApiCalls.listResourceAllowances as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listResourceAllowances`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent path. + * @param {number} [request.pageSize] + * Optional. Page size. + * @param {string} [request.pageToken] + * Optional. Page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.batch.v1alpha.ResourceAllowance|ResourceAllowance}. 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/v1alpha/batch_service.list_resource_allowances.js + * region_tag:batch_v1alpha_generated_BatchService_ListResourceAllowances_async + */ + listResourceAllowancesAsync( + request?: protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listResourceAllowances']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listResourceAllowances.asyncIterate( + this.innerApiCalls['listResourceAllowances'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * 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, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@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 { + 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, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@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, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified job resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} job + * @returns {string} Resource name string. + */ + jobPath(project:string,location:string,job:string) { + return this.pathTemplates.jobPathTemplate.render({ + project: project, + location: location, + job: job, + }); + } + + /** + * Parse the project from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the project. + */ + matchProjectFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).project; + } + + /** + * Parse the location from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the location. + */ + matchLocationFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).location; + } + + /** + * Parse the job from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the job. + */ + matchJobFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).job; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified resourceAllowance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} resource_allowance + * @returns {string} Resource name string. + */ + resourceAllowancePath(project:string,location:string,resourceAllowance:string) { + return this.pathTemplates.resourceAllowancePathTemplate.render({ + project: project, + location: location, + resource_allowance: resourceAllowance, + }); + } + + /** + * Parse the project from ResourceAllowance resource. + * + * @param {string} resourceAllowanceName + * A fully-qualified path representing ResourceAllowance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromResourceAllowanceName(resourceAllowanceName: string) { + return this.pathTemplates.resourceAllowancePathTemplate.match(resourceAllowanceName).project; + } + + /** + * Parse the location from ResourceAllowance resource. + * + * @param {string} resourceAllowanceName + * A fully-qualified path representing ResourceAllowance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromResourceAllowanceName(resourceAllowanceName: string) { + return this.pathTemplates.resourceAllowancePathTemplate.match(resourceAllowanceName).location; + } + + /** + * Parse the resource_allowance from ResourceAllowance resource. + * + * @param {string} resourceAllowanceName + * A fully-qualified path representing ResourceAllowance resource. + * @returns {string} A string representing the resource_allowance. + */ + matchResourceAllowanceFromResourceAllowanceName(resourceAllowanceName: string) { + return this.pathTemplates.resourceAllowancePathTemplate.match(resourceAllowanceName).resource_allowance; + } + + /** + * Return a fully-qualified task resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} job + * @param {string} task_group + * @param {string} task + * @returns {string} Resource name string. + */ + taskPath(project:string,location:string,job:string,taskGroup:string,task:string) { + return this.pathTemplates.taskPathTemplate.render({ + project: project, + location: location, + job: job, + task_group: taskGroup, + task: task, + }); + } + + /** + * Parse the project from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).project; + } + + /** + * Parse the location from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).location; + } + + /** + * Parse the job from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the job. + */ + matchJobFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).job; + } + + /** + * Parse the task_group from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the task_group. + */ + matchTaskGroupFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).task_group; + } + + /** + * Parse the task from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the task. + */ + matchTaskFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).task; + } + + /** + * Return a fully-qualified taskGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} job + * @param {string} task_group + * @returns {string} Resource name string. + */ + taskGroupPath(project:string,location:string,job:string,taskGroup:string) { + return this.pathTemplates.taskGroupPathTemplate.render({ + project: project, + location: location, + job: job, + task_group: taskGroup, + }); + } + + /** + * Parse the project from TaskGroup resource. + * + * @param {string} taskGroupName + * A fully-qualified path representing TaskGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTaskGroupName(taskGroupName: string) { + return this.pathTemplates.taskGroupPathTemplate.match(taskGroupName).project; + } + + /** + * Parse the location from TaskGroup resource. + * + * @param {string} taskGroupName + * A fully-qualified path representing TaskGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTaskGroupName(taskGroupName: string) { + return this.pathTemplates.taskGroupPathTemplate.match(taskGroupName).location; + } + + /** + * Parse the job from TaskGroup resource. + * + * @param {string} taskGroupName + * A fully-qualified path representing TaskGroup resource. + * @returns {string} A string representing the job. + */ + matchJobFromTaskGroupName(taskGroupName: string) { + return this.pathTemplates.taskGroupPathTemplate.match(taskGroupName).job; + } + + /** + * Parse the task_group from TaskGroup resource. + * + * @param {string} taskGroupName + * A fully-qualified path representing TaskGroup resource. + * @returns {string} A string representing the task_group. + */ + matchTaskGroupFromTaskGroupName(taskGroupName: string) { + return this.pathTemplates.taskGroupPathTemplate.match(taskGroupName).task_group; + } + + /** + * 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.batchServiceStub && !this._terminated) { + return this.batchServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.locationsClient.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_client_config.json b/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_client_config.json new file mode 100644 index 00000000000..6ac4ca807a8 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_client_config.json @@ -0,0 +1,103 @@ +{ + "interfaces": { + "google.cloud.batch.v1alpha.BatchService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "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 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetJob": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CancelJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListJobs": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetTask": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListTasks": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateResourceAllowance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetResourceAllowance": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteResourceAllowance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListResourceAllowances": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateResourceAllowance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_proto_list.json b/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_proto_list.json new file mode 100644 index 00000000000..cd5a69f0276 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_proto_list.json @@ -0,0 +1,8 @@ +[ + "../../protos/google/cloud/batch/v1alpha/batch.proto", + "../../protos/google/cloud/batch/v1alpha/job.proto", + "../../protos/google/cloud/batch/v1alpha/notification.proto", + "../../protos/google/cloud/batch/v1alpha/resource_allowance.proto", + "../../protos/google/cloud/batch/v1alpha/task.proto", + "../../protos/google/cloud/batch/v1alpha/volume.proto" +] diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/gapic_metadata.json b/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/gapic_metadata.json new file mode 100644 index 00000000000..4e922577356 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/gapic_metadata.json @@ -0,0 +1,165 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.batch.v1alpha", + "libraryPackage": "@google-cloud/batch", + "services": { + "BatchService": { + "clients": { + "grpc": { + "libraryClient": "BatchServiceClient", + "rpcs": { + "CreateJob": { + "methods": [ + "createJob" + ] + }, + "GetJob": { + "methods": [ + "getJob" + ] + }, + "UpdateJob": { + "methods": [ + "updateJob" + ] + }, + "GetTask": { + "methods": [ + "getTask" + ] + }, + "CreateResourceAllowance": { + "methods": [ + "createResourceAllowance" + ] + }, + "GetResourceAllowance": { + "methods": [ + "getResourceAllowance" + ] + }, + "UpdateResourceAllowance": { + "methods": [ + "updateResourceAllowance" + ] + }, + "DeleteJob": { + "methods": [ + "deleteJob" + ] + }, + "CancelJob": { + "methods": [ + "cancelJob" + ] + }, + "DeleteResourceAllowance": { + "methods": [ + "deleteResourceAllowance" + ] + }, + "ListJobs": { + "methods": [ + "listJobs", + "listJobsStream", + "listJobsAsync" + ] + }, + "ListTasks": { + "methods": [ + "listTasks", + "listTasksStream", + "listTasksAsync" + ] + }, + "ListResourceAllowances": { + "methods": [ + "listResourceAllowances", + "listResourceAllowancesStream", + "listResourceAllowancesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "BatchServiceClient", + "rpcs": { + "CreateJob": { + "methods": [ + "createJob" + ] + }, + "GetJob": { + "methods": [ + "getJob" + ] + }, + "UpdateJob": { + "methods": [ + "updateJob" + ] + }, + "GetTask": { + "methods": [ + "getTask" + ] + }, + "CreateResourceAllowance": { + "methods": [ + "createResourceAllowance" + ] + }, + "GetResourceAllowance": { + "methods": [ + "getResourceAllowance" + ] + }, + "UpdateResourceAllowance": { + "methods": [ + "updateResourceAllowance" + ] + }, + "DeleteJob": { + "methods": [ + "deleteJob" + ] + }, + "CancelJob": { + "methods": [ + "cancelJob" + ] + }, + "DeleteResourceAllowance": { + "methods": [ + "deleteResourceAllowance" + ] + }, + "ListJobs": { + "methods": [ + "listJobs", + "listJobsStream", + "listJobsAsync" + ] + }, + "ListTasks": { + "methods": [ + "listTasks", + "listTasksStream", + "listTasksAsync" + ] + }, + "ListResourceAllowances": { + "methods": [ + "listResourceAllowances", + "listResourceAllowancesStream", + "listResourceAllowancesAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/index.ts b/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/index.ts new file mode 100644 index 00000000000..fb53b495001 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/index.ts @@ -0,0 +1,19 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {BatchServiceClient} from './batch_service_client'; diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-batch/v1alpha/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..b9ac0eb683e --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const batch = require('@google-cloud/batch'); + +function main() { + const batchServiceClient = new batch.BatchServiceClient(); +} + +main(); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-batch/v1alpha/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..c43e51952e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 {BatchServiceClient} from '@google-cloud/batch'; + +// check that the client class type name can be used +function doStuffWithBatchServiceClient(client: BatchServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const batchServiceClient = new BatchServiceClient(); + doStuffWithBatchServiceClient(batchServiceClient); +} + +main(); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/system-test/install.ts b/owl-bot-staging/google-cloud-batch/v1alpha/system-test/install.ts new file mode 100644 index 00000000000..fd5bfdc71d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/test/gapic_batch_service_v1alpha.ts b/owl-bot-staging/google-cloud-batch/v1alpha/test/gapic_batch_service_v1alpha.ts new file mode 100644 index 00000000000..1ef8a8bde46 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/test/gapic_batch_service_v1alpha.ts @@ -0,0 +1,2938 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 batchserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos, LocationProtos} 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('v1alpha.BatchServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'batch.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient(); + 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 = batchserviceModule.v1alpha.BatchServiceClient.servicePath; + assert.strictEqual(servicePath, 'batch.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = batchserviceModule.v1alpha.BatchServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'batch.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'batch.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'batch.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 batchserviceModule.v1alpha.BatchServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'batch.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 batchserviceModule.v1alpha.BatchServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'batch.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 batchserviceModule.v1alpha.BatchServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = batchserviceModule.v1alpha.BatchServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.batchServiceStub, undefined); + await client.initialize(); + assert(client.batchServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.batchServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.batchServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + 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 batchserviceModule.v1alpha.BatchServiceClient({ + 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('createJob', () => { + it('invokes createJob without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.CreateJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.CreateJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.Job() + ); + client.innerApiCalls.createJob = stubSimpleCall(expectedResponse); + const [response] = await client.createJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createJob without error using callback', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.CreateJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.CreateJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.Job() + ); + client.innerApiCalls.createJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createJob( + request, + (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.IJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createJob with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.CreateJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.CreateJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createJob(request), expectedError); + const actualRequest = (client.innerApiCalls.createJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createJob with closed client', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.CreateJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.CreateJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createJob(request), expectedError); + }); + }); + + describe('getJob', () => { + it('invokes getJob without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.GetJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.GetJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.Job() + ); + client.innerApiCalls.getJob = stubSimpleCall(expectedResponse); + const [response] = await client.getJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJob without error using callback', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.GetJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.GetJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.Job() + ); + client.innerApiCalls.getJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getJob( + request, + (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.IJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJob with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.GetJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.GetJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getJob(request), expectedError); + const actualRequest = (client.innerApiCalls.getJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJob with closed client', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.GetJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.GetJobRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getJob(request), expectedError); + }); + }); + + describe('updateJob', () => { + it('invokes updateJob without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.UpdateJobRequest() + ); + request.job ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.UpdateJobRequest', ['job', 'name']); + request.job.name = defaultValue1; + const expectedHeaderRequestParams = `job.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.Job() + ); + client.innerApiCalls.updateJob = stubSimpleCall(expectedResponse); + const [response] = await client.updateJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateJob without error using callback', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.UpdateJobRequest() + ); + request.job ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.UpdateJobRequest', ['job', 'name']); + request.job.name = defaultValue1; + const expectedHeaderRequestParams = `job.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.Job() + ); + client.innerApiCalls.updateJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateJob( + request, + (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.IJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateJob with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.UpdateJobRequest() + ); + request.job ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.UpdateJobRequest', ['job', 'name']); + request.job.name = defaultValue1; + const expectedHeaderRequestParams = `job.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateJob(request), expectedError); + const actualRequest = (client.innerApiCalls.updateJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateJob with closed client', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.UpdateJobRequest() + ); + request.job ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.UpdateJobRequest', ['job', 'name']); + request.job.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateJob(request), expectedError); + }); + }); + + describe('getTask', () => { + it('invokes getTask without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.GetTaskRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.GetTaskRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.Task() + ); + client.innerApiCalls.getTask = stubSimpleCall(expectedResponse); + const [response] = await client.getTask(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getTask as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTask as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTask without error using callback', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.GetTaskRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.GetTaskRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.Task() + ); + client.innerApiCalls.getTask = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTask( + request, + (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.ITask|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getTask as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTask as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTask with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.GetTaskRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.GetTaskRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTask = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTask(request), expectedError); + const actualRequest = (client.innerApiCalls.getTask as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTask as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTask with closed client', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.GetTaskRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.GetTaskRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTask(request), expectedError); + }); + }); + + describe('createResourceAllowance', () => { + it('invokes createResourceAllowance without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ResourceAllowance() + ); + client.innerApiCalls.createResourceAllowance = stubSimpleCall(expectedResponse); + const [response] = await client.createResourceAllowance(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createResourceAllowance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createResourceAllowance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createResourceAllowance without error using callback', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ResourceAllowance() + ); + client.innerApiCalls.createResourceAllowance = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createResourceAllowance( + request, + (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.IResourceAllowance|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createResourceAllowance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createResourceAllowance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createResourceAllowance with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createResourceAllowance = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createResourceAllowance(request), expectedError); + const actualRequest = (client.innerApiCalls.createResourceAllowance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createResourceAllowance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createResourceAllowance with closed client', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createResourceAllowance(request), expectedError); + }); + }); + + describe('getResourceAllowance', () => { + it('invokes getResourceAllowance without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.GetResourceAllowanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.GetResourceAllowanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ResourceAllowance() + ); + client.innerApiCalls.getResourceAllowance = stubSimpleCall(expectedResponse); + const [response] = await client.getResourceAllowance(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getResourceAllowance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getResourceAllowance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getResourceAllowance without error using callback', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.GetResourceAllowanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.GetResourceAllowanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ResourceAllowance() + ); + client.innerApiCalls.getResourceAllowance = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getResourceAllowance( + request, + (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.IResourceAllowance|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getResourceAllowance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getResourceAllowance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getResourceAllowance with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.GetResourceAllowanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.GetResourceAllowanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getResourceAllowance = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getResourceAllowance(request), expectedError); + const actualRequest = (client.innerApiCalls.getResourceAllowance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getResourceAllowance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getResourceAllowance with closed client', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.GetResourceAllowanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.GetResourceAllowanceRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getResourceAllowance(request), expectedError); + }); + }); + + describe('updateResourceAllowance', () => { + it('invokes updateResourceAllowance without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest() + ); + request.resourceAllowance ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest', ['resourceAllowance', 'name']); + request.resourceAllowance.name = defaultValue1; + const expectedHeaderRequestParams = `resource_allowance.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ResourceAllowance() + ); + client.innerApiCalls.updateResourceAllowance = stubSimpleCall(expectedResponse); + const [response] = await client.updateResourceAllowance(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateResourceAllowance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateResourceAllowance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateResourceAllowance without error using callback', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest() + ); + request.resourceAllowance ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest', ['resourceAllowance', 'name']); + request.resourceAllowance.name = defaultValue1; + const expectedHeaderRequestParams = `resource_allowance.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ResourceAllowance() + ); + client.innerApiCalls.updateResourceAllowance = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateResourceAllowance( + request, + (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.IResourceAllowance|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateResourceAllowance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateResourceAllowance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateResourceAllowance with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest() + ); + request.resourceAllowance ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest', ['resourceAllowance', 'name']); + request.resourceAllowance.name = defaultValue1; + const expectedHeaderRequestParams = `resource_allowance.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateResourceAllowance = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateResourceAllowance(request), expectedError); + const actualRequest = (client.innerApiCalls.updateResourceAllowance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateResourceAllowance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateResourceAllowance with closed client', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest() + ); + request.resourceAllowance ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest', ['resourceAllowance', 'name']); + request.resourceAllowance.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateResourceAllowance(request), expectedError); + }); + }); + + describe('deleteJob', () => { + it('invokes deleteJob without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.DeleteJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.DeleteJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteJob = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteJob without error using callback', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.DeleteJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.DeleteJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteJob = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteJob( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteJob with call error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.DeleteJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.DeleteJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteJob(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteJob with LRO error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.DeleteJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.DeleteJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteJobProgress without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkDeleteJobProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteJobProgress with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteJobProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('cancelJob', () => { + it('invokes cancelJob without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.CancelJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.CancelJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.cancelJob = stubLongRunningCall(expectedResponse); + const [operation] = await client.cancelJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.cancelJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelJob without error using callback', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.CancelJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.CancelJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.cancelJob = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cancelJob( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.cancelJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelJob with call error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.CancelJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.CancelJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.cancelJob(request), expectedError); + const actualRequest = (client.innerApiCalls.cancelJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelJob with LRO error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.CancelJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.CancelJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.cancelJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.cancelJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCancelJobProgress without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkCancelJobProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCancelJobProgress with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCancelJobProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteResourceAllowance', () => { + it('invokes deleteResourceAllowance without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteResourceAllowance = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteResourceAllowance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteResourceAllowance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteResourceAllowance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteResourceAllowance without error using callback', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteResourceAllowance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteResourceAllowance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteResourceAllowance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteResourceAllowance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteResourceAllowance with call error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteResourceAllowance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteResourceAllowance(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteResourceAllowance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteResourceAllowance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteResourceAllowance with LRO error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteResourceAllowance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteResourceAllowance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteResourceAllowance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteResourceAllowance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteResourceAllowanceProgress without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkDeleteResourceAllowanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteResourceAllowanceProgress with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteResourceAllowanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listJobs', () => { + it('invokes listJobs without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), + ]; + client.innerApiCalls.listJobs = stubSimpleCall(expectedResponse); + const [response] = await client.listJobs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobs without error using callback', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), + ]; + client.innerApiCalls.listJobs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listJobs( + request, + (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.IJob[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobs with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listJobs(request), expectedError); + const actualRequest = (client.innerApiCalls.listJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobsStream without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), + ]; + client.descriptors.page.listJobs.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.batch.v1alpha.Job[] = []; + stream.on('data', (response: protos.google.cloud.batch.v1alpha.Job) => { + 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.listJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listJobs, request)); + assert( + (client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listJobsStream with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listJobs.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.batch.v1alpha.Job[] = []; + stream.on('data', (response: protos.google.cloud.batch.v1alpha.Job) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listJobs, request)); + assert( + (client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listJobs without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), + ]; + client.descriptors.page.listJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.batch.v1alpha.IJob[] = []; + const iterable = client.listJobsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listJobs with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listJobsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.batch.v1alpha.IJob[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listTasks', () => { + it('invokes listTasks without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListTasksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListTasksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), + ]; + client.innerApiCalls.listTasks = stubSimpleCall(expectedResponse); + const [response] = await client.listTasks(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listTasks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTasks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTasks without error using callback', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListTasksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListTasksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), + ]; + client.innerApiCalls.listTasks = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTasks( + request, + (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.ITask[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listTasks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTasks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTasks with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListTasksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListTasksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTasks = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTasks(request), expectedError); + const actualRequest = (client.innerApiCalls.listTasks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTasks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTasksStream without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListTasksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListTasksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), + ]; + client.descriptors.page.listTasks.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listTasksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.batch.v1alpha.Task[] = []; + stream.on('data', (response: protos.google.cloud.batch.v1alpha.Task) => { + 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.listTasks.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTasks, request)); + assert( + (client.descriptors.page.listTasks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listTasksStream with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListTasksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListTasksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTasks.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listTasksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.batch.v1alpha.Task[] = []; + stream.on('data', (response: protos.google.cloud.batch.v1alpha.Task) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listTasks.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTasks, request)); + assert( + (client.descriptors.page.listTasks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTasks without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListTasksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListTasksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), + ]; + client.descriptors.page.listTasks.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.batch.v1alpha.ITask[] = []; + const iterable = client.listTasksAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTasks.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listTasks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTasks with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListTasksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListTasksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTasks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTasksAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.batch.v1alpha.ITask[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTasks.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listTasks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listResourceAllowances', () => { + it('invokes listResourceAllowances without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListResourceAllowancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListResourceAllowancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), + ]; + client.innerApiCalls.listResourceAllowances = stubSimpleCall(expectedResponse); + const [response] = await client.listResourceAllowances(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listResourceAllowances as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listResourceAllowances as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listResourceAllowances without error using callback', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListResourceAllowancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListResourceAllowancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), + ]; + client.innerApiCalls.listResourceAllowances = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listResourceAllowances( + request, + (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.IResourceAllowance[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listResourceAllowances as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listResourceAllowances as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listResourceAllowances with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListResourceAllowancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListResourceAllowancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listResourceAllowances = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listResourceAllowances(request), expectedError); + const actualRequest = (client.innerApiCalls.listResourceAllowances as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listResourceAllowances as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listResourceAllowancesStream without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListResourceAllowancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListResourceAllowancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), + ]; + client.descriptors.page.listResourceAllowances.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listResourceAllowancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.batch.v1alpha.ResourceAllowance[] = []; + stream.on('data', (response: protos.google.cloud.batch.v1alpha.ResourceAllowance) => { + 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.listResourceAllowances.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listResourceAllowances, request)); + assert( + (client.descriptors.page.listResourceAllowances.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listResourceAllowancesStream with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListResourceAllowancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListResourceAllowancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listResourceAllowances.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listResourceAllowancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.batch.v1alpha.ResourceAllowance[] = []; + stream.on('data', (response: protos.google.cloud.batch.v1alpha.ResourceAllowance) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listResourceAllowances.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listResourceAllowances, request)); + assert( + (client.descriptors.page.listResourceAllowances.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listResourceAllowances without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListResourceAllowancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListResourceAllowancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), + ]; + client.descriptors.page.listResourceAllowances.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.batch.v1alpha.IResourceAllowance[] = []; + const iterable = client.listResourceAllowancesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listResourceAllowances.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listResourceAllowances.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listResourceAllowances with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListResourceAllowancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListResourceAllowancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listResourceAllowances.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listResourceAllowancesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.batch.v1alpha.IResourceAllowance[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listResourceAllowances.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listResourceAllowances.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation without error using callback', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.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 batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + 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 batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + 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 batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + 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 batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('job', () => { + const fakePath = "/rendered/path/job"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + job: "jobValue", + }; + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.jobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.jobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('jobPath', () => { + const result = client.jobPath("projectValue", "locationValue", "jobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.jobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromJobName', () => { + const result = client.matchProjectFromJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromJobName', () => { + const result = client.matchLocationFromJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchJobFromJobName', () => { + const result = client.matchJobFromJobName(fakePath); + assert.strictEqual(result, "jobValue"); + assert((client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('resourceAllowance', () => { + const fakePath = "/rendered/path/resourceAllowance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + resource_allowance: "resourceAllowanceValue", + }; + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.resourceAllowancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.resourceAllowancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('resourceAllowancePath', () => { + const result = client.resourceAllowancePath("projectValue", "locationValue", "resourceAllowanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.resourceAllowancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromResourceAllowanceName', () => { + const result = client.matchProjectFromResourceAllowanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.resourceAllowancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromResourceAllowanceName', () => { + const result = client.matchLocationFromResourceAllowanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.resourceAllowancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchResourceAllowanceFromResourceAllowanceName', () => { + const result = client.matchResourceAllowanceFromResourceAllowanceName(fakePath); + assert.strictEqual(result, "resourceAllowanceValue"); + assert((client.pathTemplates.resourceAllowancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('task', () => { + const fakePath = "/rendered/path/task"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + job: "jobValue", + task_group: "taskGroupValue", + task: "taskValue", + }; + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.taskPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.taskPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('taskPath', () => { + const result = client.taskPath("projectValue", "locationValue", "jobValue", "taskGroupValue", "taskValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.taskPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTaskName', () => { + const result = client.matchProjectFromTaskName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.taskPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTaskName', () => { + const result = client.matchLocationFromTaskName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.taskPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchJobFromTaskName', () => { + const result = client.matchJobFromTaskName(fakePath); + assert.strictEqual(result, "jobValue"); + assert((client.pathTemplates.taskPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTaskGroupFromTaskName', () => { + const result = client.matchTaskGroupFromTaskName(fakePath); + assert.strictEqual(result, "taskGroupValue"); + assert((client.pathTemplates.taskPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTaskFromTaskName', () => { + const result = client.matchTaskFromTaskName(fakePath); + assert.strictEqual(result, "taskValue"); + assert((client.pathTemplates.taskPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('taskGroup', () => { + const fakePath = "/rendered/path/taskGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + job: "jobValue", + task_group: "taskGroupValue", + }; + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.taskGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.taskGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('taskGroupPath', () => { + const result = client.taskGroupPath("projectValue", "locationValue", "jobValue", "taskGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.taskGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTaskGroupName', () => { + const result = client.matchProjectFromTaskGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.taskGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTaskGroupName', () => { + const result = client.matchLocationFromTaskGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.taskGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchJobFromTaskGroupName', () => { + const result = client.matchJobFromTaskGroupName(fakePath); + assert.strictEqual(result, "jobValue"); + assert((client.pathTemplates.taskGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTaskGroupFromTaskGroupName', () => { + const result = client.matchTaskGroupFromTaskGroupName(fakePath); + assert.strictEqual(result, "taskGroupValue"); + assert((client.pathTemplates.taskGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/tsconfig.json b/owl-bot-staging/google-cloud-batch/v1alpha/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/webpack.config.js b/owl-bot-staging/google-cloud-batch/v1alpha/webpack.config.js new file mode 100644 index 00000000000..04a4c53960a --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'BatchService', + filename: './batch-service.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; From 2bd55a3bb5fc28874fb01daa29a2e5adb901d55d Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 26 Dec 2024 22:06:04 +0000 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../google-cloud-batch/v1/.eslintignore | 7 - .../google-cloud-batch/v1/.eslintrc.json | 3 - .../google-cloud-batch/v1/.gitignore | 14 - .../google-cloud-batch/v1/.jsdoc.js | 55 - .../google-cloud-batch/v1/.mocharc.js | 33 - .../google-cloud-batch/v1/.prettierrc.js | 22 - .../google-cloud-batch/v1/README.md | 1 - .../google-cloud-batch/v1/package.json | 58 - .../protos/google/cloud/batch/v1/batch.proto | 275 - .../v1/protos/google/cloud/batch/v1/job.proto | 693 - .../protos/google/cloud/batch/v1/task.proto | 475 - .../protos/google/cloud/batch/v1/volume.proto | 80 - .../google-cloud-batch/v1/protos/protos.d.ts | 13321 ----- .../google-cloud-batch/v1/protos/protos.js | 35612 ------------- .../google-cloud-batch/v1/protos/protos.json | 3401 -- .../generated/v1/batch_service.create_job.js | 92 - .../generated/v1/batch_service.delete_job.js | 79 - .../generated/v1/batch_service.get_job.js | 61 - .../generated/v1/batch_service.get_task.js | 61 - .../generated/v1/batch_service.list_jobs.js | 79 - .../generated/v1/batch_service.list_tasks.js | 79 - ...nippet_metadata_google.cloud.batch.v1.json | 303 - .../google-cloud-batch/v1/src/index.ts | 25 - .../v1/src/v1/batch_service_client.ts | 1620 - .../src/v1/batch_service_client_config.json | 68 - .../v1/src/v1/batch_service_proto_list.json | 6 - .../v1/src/v1/gapic_metadata.json | 91 - .../google-cloud-batch/v1/src/v1/index.ts | 19 - .../system-test/fixtures/sample/src/index.js | 27 - .../system-test/fixtures/sample/src/index.ts | 32 - .../v1/system-test/install.ts | 49 - .../v1/test/gapic_batch_service_v1.ts | 1899 - .../google-cloud-batch/v1/tsconfig.json | 19 - .../google-cloud-batch/v1/webpack.config.js | 64 - .../google-cloud-batch/v1alpha/.eslintignore | 7 - .../google-cloud-batch/v1alpha/.eslintrc.json | 3 - .../google-cloud-batch/v1alpha/.gitignore | 14 - .../google-cloud-batch/v1alpha/.jsdoc.js | 55 - .../google-cloud-batch/v1alpha/.mocharc.js | 33 - .../google-cloud-batch/v1alpha/.prettierrc.js | 22 - .../google-cloud-batch/v1alpha/README.md | 1 - .../google-cloud-batch/v1alpha/package.json | 58 - .../google/cloud/batch/v1alpha/batch.proto | 587 - .../google/cloud/batch/v1alpha/job.proto | 802 - .../cloud/batch/v1alpha/notification.proto | 38 - .../batch/v1alpha/resource_allowance.proto | 208 - .../google/cloud/batch/v1alpha/task.proto | 494 - .../google/cloud/batch/v1alpha/volume.proto | 98 - .../v1alpha/protos/protos.d.ts | 16145 ------ .../v1alpha/protos/protos.js | 42614 ---------------- .../v1alpha/protos/protos.json | 4203 -- .../v1alpha/batch_service.cancel_job.js | 76 - .../v1alpha/batch_service.create_job.js | 92 - ...batch_service.create_resource_allowance.js | 93 - .../v1alpha/batch_service.delete_job.js | 79 - ...batch_service.delete_resource_allowance.js | 80 - .../v1alpha/batch_service.get_job.js | 61 - .../batch_service.get_resource_allowance.js | 61 - .../v1alpha/batch_service.get_task.js | 61 - .../v1alpha/batch_service.list_jobs.js | 79 - .../batch_service.list_resource_allowances.js | 71 - .../v1alpha/batch_service.list_tasks.js | 83 - .../v1alpha/batch_service.update_job.js | 95 - ...batch_service.update_resource_allowance.js | 88 - ...t_metadata_google.cloud.batch.v1alpha.json | 635 - .../google-cloud-batch/v1alpha/src/index.ts | 25 - .../src/v1alpha/batch_service_client.ts | 2441 - .../v1alpha/batch_service_client_config.json | 103 - .../src/v1alpha/batch_service_proto_list.json | 8 - .../v1alpha/src/v1alpha/gapic_metadata.json | 165 - .../v1alpha/src/v1alpha/index.ts | 19 - .../system-test/fixtures/sample/src/index.js | 27 - .../system-test/fixtures/sample/src/index.ts | 32 - .../v1alpha/system-test/install.ts | 49 - .../test/gapic_batch_service_v1alpha.ts | 2938 -- .../google-cloud-batch/v1alpha/tsconfig.json | 19 - .../v1alpha/webpack.config.js | 64 - .../google/cloud/batch/v1alpha/batch.proto | 7 +- 78 files changed, 4 insertions(+), 131652 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-batch/v1/.eslintignore delete mode 100644 owl-bot-staging/google-cloud-batch/v1/.eslintrc.json delete mode 100644 owl-bot-staging/google-cloud-batch/v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-batch/v1/.jsdoc.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1/.mocharc.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1/.prettierrc.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1/README.md delete mode 100644 owl-bot-staging/google-cloud-batch/v1/package.json delete mode 100644 owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/batch.proto delete mode 100644 owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/job.proto delete mode 100644 owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/task.proto delete mode 100644 owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/volume.proto delete mode 100644 owl-bot-staging/google-cloud-batch/v1/protos/protos.d.ts delete mode 100644 owl-bot-staging/google-cloud-batch/v1/protos/protos.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1/protos/protos.json delete mode 100644 owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.create_job.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.delete_job.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.get_job.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.get_task.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.list_jobs.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.list_tasks.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/snippet_metadata_google.cloud.batch.v1.json delete mode 100644 owl-bot-staging/google-cloud-batch/v1/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-batch/v1/src/v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-batch/v1/src/v1/index.ts delete mode 100644 owl-bot-staging/google-cloud-batch/v1/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-batch/v1/system-test/install.ts delete mode 100644 owl-bot-staging/google-cloud-batch/v1/test/gapic_batch_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-batch/v1/tsconfig.json delete mode 100644 owl-bot-staging/google-cloud-batch/v1/webpack.config.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/.eslintignore delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/.eslintrc.json delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/.gitignore delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/.jsdoc.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/.mocharc.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/.prettierrc.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/README.md delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/package.json delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/batch.proto delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/job.proto delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/notification.proto delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/resource_allowance.proto delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/task.proto delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/volume.proto delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.d.ts delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.json delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.cancel_job.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.create_job.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.create_resource_allowance.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.delete_job.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.delete_resource_allowance.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_job.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_resource_allowance.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_task.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_jobs.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_resource_allowances.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_tasks.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.update_job.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.update_resource_allowance.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/snippet_metadata_google.cloud.batch.v1alpha.json delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/index.ts delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/system-test/install.ts delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/test/gapic_batch_service_v1alpha.ts delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/tsconfig.json delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/webpack.config.js diff --git a/owl-bot-staging/google-cloud-batch/v1/.eslintignore b/owl-bot-staging/google-cloud-batch/v1/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/google-cloud-batch/v1/.eslintrc.json b/owl-bot-staging/google-cloud-batch/v1/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/google-cloud-batch/v1/.gitignore b/owl-bot-staging/google-cloud-batch/v1/.gitignore deleted file mode 100644 index d4f03a0df2e..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.log -**/node_modules -/.coverage -/coverage -/.nyc_output -/docs/ -/out/ -/build/ -system-test/secrets.js -system-test/*key.json -*.lock -.DS_Store -package-lock.json -__pycache__ diff --git a/owl-bot-staging/google-cloud-batch/v1/.jsdoc.js b/owl-bot-staging/google-cloud-batch/v1/.jsdoc.js deleted file mode 100644 index f3c1e45a4fc..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -'use strict'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2024 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/batch', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/google-cloud-batch/v1/.mocharc.js b/owl-bot-staging/google-cloud-batch/v1/.mocharc.js deleted file mode 100644 index 13b67c34edc..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/google-cloud-batch/v1/.prettierrc.js b/owl-bot-staging/google-cloud-batch/v1/.prettierrc.js deleted file mode 100644 index 9a8fd690982..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/google-cloud-batch/v1/README.md b/owl-bot-staging/google-cloud-batch/v1/README.md deleted file mode 100644 index 15b2fa3f3e4..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/README.md +++ /dev/null @@ -1 +0,0 @@ -Batch: Nodejs Client diff --git a/owl-bot-staging/google-cloud-batch/v1/package.json b/owl-bot-staging/google-cloud-batch/v1/package.json deleted file mode 100644 index d27d57773ff..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "@google-cloud/batch", - "version": "0.1.0", - "description": "Batch client for Node.js", - "repository": "googleapis/nodejs-batch", - "license": "Apache-2.0", - "author": "Google LLC", - "main": "build/src/index.js", - "files": [ - "build/src", - "build/protos" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "google batch", - "batch", - "batch service" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^4.3.4" - }, - "devDependencies": { - "@types/mocha": "^10.0.6", - "@types/node": "^20.12.12", - "@types/sinon": "^10.0.20", - "c8": "^9.1.0", - "gapic-tools": "^0.4.2", - "gts": "5.3.0", - "jsdoc": "^4.0.3", - "jsdoc-fresh": "^3.0.0", - "jsdoc-region-tag": "^3.0.0", - "mocha": "^10.4.0", - "pack-n-play": "^2.0.3", - "sinon": "^15.2.0", - "typescript": "5.1.6" - }, - "engines": { - "node": ">=v14" - } -} diff --git a/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/batch.proto b/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/batch.proto deleted file mode 100644 index 8ab94854784..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/batch.proto +++ /dev/null @@ -1,275 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.batch.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/field_info.proto"; -import "google/api/resource.proto"; -import "google/cloud/batch/v1/job.proto"; -import "google/cloud/batch/v1/task.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.Batch.V1"; -option go_package = "cloud.google.com/go/batch/apiv1/batchpb;batchpb"; -option java_multiple_files = true; -option java_outer_classname = "BatchProto"; -option java_package = "com.google.cloud.batch.v1"; -option objc_class_prefix = "GCB"; -option php_namespace = "Google\\Cloud\\Batch\\V1"; -option ruby_package = "Google::Cloud::Batch::V1"; - -// Google Batch Service. -// The service manages user submitted batch jobs and allocates Google Compute -// Engine VM instances to run the jobs. -service BatchService { - option (google.api.default_host) = "batch.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Create a Job. - rpc CreateJob(CreateJobRequest) returns (Job) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/jobs" - body: "job" - }; - option (google.api.method_signature) = "parent,job,job_id"; - } - - // Get a Job specified by its resource name. - rpc GetJob(GetJobRequest) returns (Job) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/jobs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Delete a Job. - rpc DeleteJob(DeleteJobRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/jobs/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "google.cloud.batch.v1.OperationMetadata" - }; - } - - // List all Jobs for a project within a region. - rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/jobs" - }; - option (google.api.method_signature) = "parent"; - } - - // Return a single Task. - rpc GetTask(GetTaskRequest) returns (Task) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/jobs/*/taskGroups/*/tasks/*}" - }; - option (google.api.method_signature) = "name"; - } - - // List Tasks associated with a job. - rpc ListTasks(ListTasksRequest) returns (ListTasksResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/jobs/*/taskGroups/*}/tasks" - }; - option (google.api.method_signature) = "parent"; - } -} - -// CreateJob Request. -message CreateJobRequest { - // Required. The parent resource name where the Job will be created. - // Pattern: "projects/{project}/locations/{location}" - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { child_type: "batch.googleapis.com/Job" } - ]; - - // ID used to uniquely identify the Job within its parent scope. - // This field should contain at most 63 characters and must start with - // lowercase characters. - // Only lowercase characters, numbers and '-' are accepted. - // The '-' character cannot be the first or the last one. - // A system generated ID will be used if the field is not set. - // - // The job.name field in the request will be ignored and the created resource - // name of the Job will be "{parent}/jobs/{job_id}". - string job_id = 2; - - // Required. The Job to create. - Job job = 3 [(google.api.field_behavior) = REQUIRED]; - - // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// GetJob Request. -message GetJobRequest { - // Required. Job name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "batch.googleapis.com/Job" } - ]; -} - -// DeleteJob Request. -message DeleteJobRequest { - // Job name. - string name = 1; - - // Optional. Reason for this deletion. - string reason = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// ListJob Request. -message ListJobsRequest { - // Parent path. - string parent = 1; - - // List filter. - string filter = 4; - - // Optional. Sort results. Supported are "name", "name desc", "create_time", - // and "create_time desc". - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Page size. - int32 page_size = 2; - - // Page token. - string page_token = 3; -} - -// ListJob Response. -message ListJobsResponse { - // Jobs. - repeated Job jobs = 1; - - // Next page token. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// ListTasks Request. -message ListTasksRequest { - // Required. Name of a TaskGroup from which Tasks are being requested. - // Pattern: - // "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "batch.googleapis.com/TaskGroup" } - ]; - - // Task filter, null filter matches all Tasks. - // Filter string should be of the format State=TaskStatus.State e.g. - // State=RUNNING - string filter = 2; - - // Page size. - int32 page_size = 3; - - // Page token. - string page_token = 4; -} - -// ListTasks Response. -message ListTasksResponse { - // Tasks. - repeated Task tasks = 1; - - // Next page token. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// Request for a single Task by name. -message GetTaskRequest { - // Required. Task name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "batch.googleapis.com/Task" } - ]; -} - -// Represents the metadata of the long-running operation. -message OperationMetadata { - // Output only. The time the operation was created. - google.protobuf.Timestamp create_time = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time the operation finished running. - google.protobuf.Timestamp end_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Server-defined resource path for the target of the operation. - string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Name of the verb executed by the operation. - string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Human-readable status of the operation, if any. - string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Identifies whether the user has requested cancellation - // of the operation. Operations that have successfully been cancelled - // have [Operation.error][] value with a - // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - // `Code.CANCELLED`. - bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. API version used to start the operation. - string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/job.proto b/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/job.proto deleted file mode 100644 index a215c35b837..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/job.proto +++ /dev/null @@ -1,693 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.batch.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/batch/v1/task.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.Batch.V1"; -option go_package = "cloud.google.com/go/batch/apiv1/batchpb;batchpb"; -option java_multiple_files = true; -option java_outer_classname = "JobProto"; -option java_package = "com.google.cloud.batch.v1"; -option objc_class_prefix = "GCB"; -option php_namespace = "Google\\Cloud\\Batch\\V1"; -option ruby_package = "Google::Cloud::Batch::V1"; - -// The Cloud Batch Job description. -message Job { - option (google.api.resource) = { - type: "batch.googleapis.com/Job" - pattern: "projects/{project}/locations/{location}/jobs/{job}" - }; - - // Output only. Job name. - // For example: "projects/123456/locations/us-central1/jobs/job01". - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A system generated unique ID for the Job. - string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Priority of the Job. - // The valid value range is [0, 100). Default value is 0. - // Higher value indicates higher priority. - // A job with higher priority value is more likely to run earlier if all other - // requirements are satisfied. - int64 priority = 3; - - // Required. TaskGroups in the Job. Only one TaskGroup is supported now. - repeated TaskGroup task_groups = 4 [(google.api.field_behavior) = REQUIRED]; - - // Compute resource allocation for all TaskGroups in the Job. - AllocationPolicy allocation_policy = 7; - - // Custom labels to apply to the job and any Cloud Logging - // [LogEntry](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry) - // that it generates. - // - // Use labels to group and describe the resources they are applied to. Batch - // automatically applies predefined labels and supports multiple `labels` - // fields for each job, which each let you apply custom labels to various - // resources. Label names that start with "goog-" or "google-" are - // reserved for predefined labels. For more information about labels with - // Batch, see - // [Organize resources using - // labels](https://cloud.google.com/batch/docs/organize-resources-using-labels). - map labels = 8; - - // Output only. Job status. It is read only for users. - JobStatus status = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. When the Job was created. - google.protobuf.Timestamp create_time = 11 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The last time the Job was updated. - google.protobuf.Timestamp update_time = 12 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Log preservation policy for the Job. - LogsPolicy logs_policy = 13; - - // Notification configurations. - repeated JobNotification notifications = 14; -} - -// LogsPolicy describes if and how a job's logs are preserved. Logs include -// information that is automatically written by the Batch service agent and any -// information that you configured the job's runnables to write to the `stdout` -// or `stderr` streams. -message LogsPolicy { - // `CloudLoggingOption` contains additional settings for Cloud Logging logs - // generated by Batch job. - message CloudLoggingOption { - // Optional. Set this field to `true` to change the [monitored resource - // type](https://cloud.google.com/monitoring/api/resources) for - // Cloud Logging logs generated by this Batch job from - // the - // [`batch.googleapis.com/Job`](https://cloud.google.com/monitoring/api/resources#tag_batch.googleapis.com/Job) - // type to the formerly used - // [`generic_task`](https://cloud.google.com/monitoring/api/resources#tag_generic_task) - // type. - bool use_generic_task_monitored_resource = 1 - [(google.api.field_behavior) = OPTIONAL]; - } - - // The destination (if any) for logs. - enum Destination { - // (Default) Logs are not preserved. - DESTINATION_UNSPECIFIED = 0; - - // Logs are streamed to Cloud Logging. Optionally, you can configure - // additional settings in the `cloudLoggingOption` field. - CLOUD_LOGGING = 1; - - // Logs are saved to the file path specified in the `logsPath` field. - PATH = 2; - } - - // If and where logs should be saved. - Destination destination = 1; - - // When `destination` is set to `PATH`, you must set this field to the path - // where you want logs to be saved. This path can point to a local directory - // on the VM or (if congifured) a directory under the mount path of any - // Cloud Storage bucket, network file system (NFS), or writable persistent - // disk that is mounted to the job. For example, if the job has a bucket with - // `mountPath` set to `/mnt/disks/my-bucket`, you can write logs to the - // root directory of the `remotePath` of that bucket by setting this field to - // `/mnt/disks/my-bucket/`. - string logs_path = 2; - - // Optional. When `destination` is set to `CLOUD_LOGGING`, you can optionally - // set this field to configure additional settings for Cloud Logging. - CloudLoggingOption cloud_logging_option = 3 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Job status. -message JobStatus { - // VM instance status. - message InstanceStatus { - // The Compute Engine machine type. - string machine_type = 1; - - // The VM instance provisioning model. - AllocationPolicy.ProvisioningModel provisioning_model = 2; - - // The max number of tasks can be assigned to this instance type. - int64 task_pack = 3; - - // The VM boot disk. - AllocationPolicy.Disk boot_disk = 4; - } - - // Aggregated task status for a TaskGroup. - message TaskGroupStatus { - // Count of task in each state in the TaskGroup. - // The map key is task state name. - map counts = 1; - - // Status of instances allocated for the TaskGroup. - repeated InstanceStatus instances = 2; - } - - // Valid Job states. - enum State { - // Job state unspecified. - STATE_UNSPECIFIED = 0; - - // Job is admitted (validated and persisted) and waiting for resources. - QUEUED = 1; - - // Job is scheduled to run as soon as resource allocation is ready. - // The resource allocation may happen at a later time but with a high - // chance to succeed. - SCHEDULED = 2; - - // Resource allocation has been successful. At least one Task in the Job is - // RUNNING. - RUNNING = 3; - - // All Tasks in the Job have finished successfully. - SUCCEEDED = 4; - - // At least one Task in the Job has failed. - FAILED = 5; - - // The Job will be deleted, but has not been deleted yet. Typically this is - // because resources used by the Job are still being cleaned up. - DELETION_IN_PROGRESS = 6; - } - - // Job state - State state = 1; - - // Job status events - repeated StatusEvent status_events = 2; - - // Aggregated task status for each TaskGroup in the Job. - // The map key is TaskGroup ID. - map task_groups = 4; - - // The duration of time that the Job spent in status RUNNING. - google.protobuf.Duration run_duration = 5; -} - -// Notification configurations. -message JobNotification { - // Message details. - // Describe the conditions under which messages will be sent. - // If no attribute is defined, no message will be sent by default. - // One message should specify either the job or the task level attributes, - // but not both. For example, - // job level: JOB_STATE_CHANGED and/or a specified new_job_state; - // task level: TASK_STATE_CHANGED and/or a specified new_task_state. - message Message { - // The message type. - Type type = 1; - - // The new job state. - JobStatus.State new_job_state = 2; - - // The new task state. - TaskStatus.State new_task_state = 3; - } - - // The message type. - enum Type { - // Unspecified. - TYPE_UNSPECIFIED = 0; - - // Notify users that the job state has changed. - JOB_STATE_CHANGED = 1; - - // Notify users that the task state has changed. - TASK_STATE_CHANGED = 2; - } - - // The Pub/Sub topic where notifications for the job, like state - // changes, will be published. If undefined, no Pub/Sub notifications - // are sent for this job. - // - // Specify the topic using the following format: - // `projects/{project}/topics/{topic}`. - // Notably, if you want to specify a Pub/Sub topic that is in a - // different project than the job, your administrator must grant your - // project's Batch service agent permission to publish to that topic. - // - // For more information about configuring Pub/Sub notifications for - // a job, see - // https://cloud.google.com/batch/docs/enable-notifications. - string pubsub_topic = 1; - - // The attribute requirements of messages to be sent to this Pub/Sub topic. - // Without this field, no message will be sent. - Message message = 2; -} - -// A Job's resource allocation policy describes when, where, and how compute -// resources should be allocated for the Job. -message AllocationPolicy { - message LocationPolicy { - // A list of allowed location names represented by internal URLs. - // - // Each location can be a region or a zone. - // Only one region or multiple zones in one region is supported now. - // For example, - // ["regions/us-central1"] allow VMs in any zones in region us-central1. - // ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs - // in zones us-central1-a and us-central1-c. - // - // Mixing locations from different regions would cause errors. - // For example, - // ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b", - // "zones/us-west1-a"] contains locations from two distinct regions: - // us-central1 and us-west1. This combination will trigger an error. - repeated string allowed_locations = 1; - } - - // A new persistent disk or a local ssd. - // A VM can only have one local SSD setting but multiple local SSD partitions. - // See https://cloud.google.com/compute/docs/disks#pdspecs and - // https://cloud.google.com/compute/docs/disks#localssds. - message Disk { - // A data source from which a PD will be created. - oneof data_source { - // URL for a VM image to use as the data source for this disk. - // For example, the following are all valid URLs: - // - // * Specify the image by its family name: - // projects/{project}/global/images/family/{image_family} - // * Specify the image version: - // projects/{project}/global/images/{image_version} - // - // You can also use Batch customized image in short names. - // The following image values are supported for a boot disk: - // - // * `batch-debian`: use Batch Debian images. - // * `batch-cos`: use Batch Container-Optimized images. - // * `batch-hpc-rocky`: use Batch HPC Rocky Linux images. - string image = 4; - - // Name of a snapshot used as the data source. - // Snapshot is not supported as boot disk now. - string snapshot = 5; - } - - // Disk type as shown in `gcloud compute disk-types list`. - // For example, local SSD uses type "local-ssd". - // Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd" - // or "pd-standard". If not specified, "pd-standard" will be used as the - // default type for non-boot disks, "pd-balanced" will be used as the - // default type for boot disks. - string type = 1; - - // Disk size in GB. - // - // **Non-Boot Disk**: - // If the `type` specifies a persistent disk, this field - // is ignored if `data_source` is set as `image` or `snapshot`. - // If the `type` specifies a local SSD, this field should be a multiple of - // 375 GB, otherwise, the final size will be the next greater multiple of - // 375 GB. - // - // **Boot Disk**: - // Batch will calculate the boot disk size based on source - // image and task requirements if you do not speicify the size. - // If both this field and the `boot_disk_mib` field in task spec's - // `compute_resource` are defined, Batch will only honor this field. - // Also, this field should be no smaller than the source disk's - // size when the `data_source` is set as `snapshot` or `image`. - // For example, if you set an image as the `data_source` field and the - // image's default disk size 30 GB, you can only use this field to make the - // disk larger or equal to 30 GB. - int64 size_gb = 2; - - // Local SSDs are available through both "SCSI" and "NVMe" interfaces. - // If not indicated, "NVMe" will be the default one for local ssds. - // This field is ignored for persistent disks as the interface is chosen - // automatically. See - // https://cloud.google.com/compute/docs/disks/persistent-disks#choose_an_interface. - string disk_interface = 6; - } - - // A new or an existing persistent disk (PD) or a local ssd attached to a VM - // instance. - message AttachedDisk { - oneof attached { - Disk new_disk = 1; - - // Name of an existing PD. - string existing_disk = 2; - } - - // Device name that the guest operating system will see. - // It is used by Runnable.volumes field to mount disks. So please specify - // the device_name if you want Batch to help mount the disk, and it should - // match the device_name field in volumes. - string device_name = 3; - } - - // Accelerator describes Compute Engine accelerators to be attached to the VM. - message Accelerator { - // The accelerator type. For example, "nvidia-tesla-t4". - // See `gcloud compute accelerator-types list`. - string type = 1; - - // The number of accelerators of this type. - int64 count = 2; - - // Deprecated: please use instances[0].install_gpu_drivers instead. - bool install_gpu_drivers = 3 [deprecated = true]; - - // Optional. The NVIDIA GPU driver version that should be installed for this - // type. - // - // You can define the specific driver version such as "470.103.01", - // following the driver version requirements in - // https://cloud.google.com/compute/docs/gpus/install-drivers-gpu#minimum-driver. - // Batch will install the specific accelerator driver if qualified. - string driver_version = 4 [(google.api.field_behavior) = OPTIONAL]; - } - - // InstancePolicy describes an instance type and resources attached to each VM - // created by this InstancePolicy. - message InstancePolicy { - // The Compute Engine machine type. - string machine_type = 2; - - // The minimum CPU platform. - // See - // https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. - string min_cpu_platform = 3; - - // The provisioning model. - ProvisioningModel provisioning_model = 4; - - // The accelerators attached to each VM instance. - repeated Accelerator accelerators = 5; - - // Boot disk to be created and attached to each VM by this InstancePolicy. - // Boot disk will be deleted when the VM is deleted. - // Batch API now only supports booting from image. - Disk boot_disk = 8; - - // Non-boot disks to be attached for each VM created by this InstancePolicy. - // New disks will be deleted when the VM is deleted. - // A non-boot disk is a disk that can be of a device with a - // file system or a raw storage drive that is not ready for data - // storage and accessing. - repeated AttachedDisk disks = 6; - - // Optional. If not specified (default), VMs will consume any applicable - // reservation. If "NO_RESERVATION" is specified, VMs will not consume any - // reservation. Otherwise, if specified, VMs will consume only the specified - // reservation. - string reservation = 7 [(google.api.field_behavior) = OPTIONAL]; - } - - // InstancePolicyOrTemplate lets you define the type of resources to use for - // this job either with an InstancePolicy or an instance template. - // If undefined, Batch picks the type of VM to use and doesn't include - // optional VM resources such as GPUs and extra disks. - message InstancePolicyOrTemplate { - oneof policy_template { - // InstancePolicy. - InstancePolicy policy = 1; - - // Name of an instance template used to create VMs. - // Named the field as 'instance_template' instead of 'template' to avoid - // C++ keyword conflict. - // - // Batch only supports global instance templates from the same project as - // the job. - // You can specify the global instance template as a full or partial URL. - string instance_template = 2; - } - - // Set this field true if you want Batch to help fetch drivers from a third - // party location and install them for GPUs specified in - // `policy.accelerators` or `instance_template` on your behalf. Default is - // false. - // - // For Container-Optimized Image cases, Batch will install the - // accelerator driver following milestones of - // https://cloud.google.com/container-optimized-os/docs/release-notes. For - // non Container-Optimized Image cases, following - // https://github.com/GoogleCloudPlatform/compute-gpu-installation/blob/main/linux/install_gpu_driver.py. - bool install_gpu_drivers = 3; - - // Optional. Set this field true if you want Batch to install Ops Agent on - // your behalf. Default is false. - bool install_ops_agent = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Set this field to `true` if you want Batch to block - // project-level SSH keys from accessing this job's VMs. Alternatively, you - // can configure the job to specify a VM instance template that blocks - // project-level SSH keys. In either case, Batch blocks project-level SSH - // keys while creating the VMs for this job. - // - // Batch allows project-level SSH keys for a job's VMs only if all - // the following are true: - // - // + This field is undefined or set to `false`. - // + The job's VM instance template (if any) doesn't block project-level - // SSH keys. - // - // Notably, you can override this behavior by manually updating a VM to - // block or allow project-level SSH keys. For more information about - // blocking project-level SSH keys, see the Compute Engine documentation: - // https://cloud.google.com/compute/docs/connect/restrict-ssh-keys#block-keys - bool block_project_ssh_keys = 5 [(google.api.field_behavior) = OPTIONAL]; - } - - // A network interface. - message NetworkInterface { - // The URL of an existing network resource. - // You can specify the network as a full or partial URL. - // - // For example, the following are all valid URLs: - // - // * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network} - // * projects/{project}/global/networks/{network} - // * global/networks/{network} - string network = 1; - - // The URL of an existing subnetwork resource in the network. - // You can specify the subnetwork as a full or partial URL. - // - // For example, the following are all valid URLs: - // - // * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork} - // * projects/{project}/regions/{region}/subnetworks/{subnetwork} - // * regions/{region}/subnetworks/{subnetwork} - string subnetwork = 2; - - // Default is false (with an external IP address). Required if - // no external public IP address is attached to the VM. If no external - // public IP address, additional configuration is required to allow the VM - // to access Google Services. See - // https://cloud.google.com/vpc/docs/configure-private-google-access and - // https://cloud.google.com/nat/docs/gce-example#create-nat for more - // information. - bool no_external_ip_address = 3; - } - - // NetworkPolicy describes VM instance network configurations. - message NetworkPolicy { - // Network configurations. - repeated NetworkInterface network_interfaces = 1; - } - - // PlacementPolicy describes a group placement policy for the VMs controlled - // by this AllocationPolicy. - message PlacementPolicy { - // UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you - // want VMs to be located close to each other for low network latency - // between the VMs. No placement policy will be generated when collocation - // is UNSPECIFIED. - string collocation = 1; - - // When specified, causes the job to fail if more than max_distance logical - // switches are required between VMs. Batch uses the most compact possible - // placement of VMs even when max_distance is not specified. An explicit - // max_distance makes that level of compactness a strict requirement. - // Not yet implemented - int64 max_distance = 2; - } - - // Compute Engine VM instance provisioning model. - enum ProvisioningModel { - // Unspecified. - PROVISIONING_MODEL_UNSPECIFIED = 0; - - // Standard VM. - STANDARD = 1; - - // SPOT VM. - SPOT = 2; - - // Preemptible VM (PVM). - // - // Above SPOT VM is the preferable model for preemptible VM instances: the - // old preemptible VM model (indicated by this field) is the older model, - // and has been migrated to use the SPOT model as the underlying technology. - // This old model will still be supported. - PREEMPTIBLE = 3; - } - - // Location where compute resources should be allocated for the Job. - LocationPolicy location = 1; - - // Describe instances that can be created by this AllocationPolicy. - // Only instances[0] is supported now. - repeated InstancePolicyOrTemplate instances = 8; - - // Defines the service account for Batch-created VMs. If omitted, the [default - // Compute Engine service - // account](https://cloud.google.com/compute/docs/access/service-accounts#default_service_account) - // is used. Must match the service account specified in any used instance - // template configured in the Batch job. - // - // Includes the following fields: - // * email: The service account's email address. If not set, the default - // Compute Engine service account is used. - // * scopes: Additional OAuth scopes to grant the service account, beyond the - // default cloud-platform scope. (list of strings) - ServiceAccount service_account = 9; - - // Custom labels to apply to the job and all the Compute Engine resources - // that both are created by this allocation policy and support labels. - // - // Use labels to group and describe the resources they are applied to. Batch - // automatically applies predefined labels and supports multiple `labels` - // fields for each job, which each let you apply custom labels to various - // resources. Label names that start with "goog-" or "google-" are - // reserved for predefined labels. For more information about labels with - // Batch, see - // [Organize resources using - // labels](https://cloud.google.com/batch/docs/organize-resources-using-labels). - map labels = 6; - - // The network policy. - // - // If you define an instance template in the `InstancePolicyOrTemplate` field, - // Batch will use the network settings in the instance template instead of - // this field. - NetworkPolicy network = 7; - - // The placement policy. - PlacementPolicy placement = 10; - - // Optional. Tags applied to the VM instances. - // - // The tags identify valid sources or targets for network firewalls. - // Each tag must be 1-63 characters long, and comply with - // [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). - repeated string tags = 11 [(google.api.field_behavior) = OPTIONAL]; -} - -// A TaskGroup defines one or more Tasks that all share the same TaskSpec. -message TaskGroup { - option (google.api.resource) = { - type: "batch.googleapis.com/TaskGroup" - pattern: "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" - }; - - // How Tasks in the TaskGroup should be scheduled relative to each other. - enum SchedulingPolicy { - // Unspecified. - SCHEDULING_POLICY_UNSPECIFIED = 0; - - // Run Tasks as soon as resources are available. - // - // Tasks might be executed in parallel depending on parallelism and - // task_count values. - AS_SOON_AS_POSSIBLE = 1; - - // Run Tasks sequentially with increased task index. - IN_ORDER = 2; - } - - // Output only. TaskGroup name. - // The system generates this field based on parent Job name. - // For example: - // "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01". - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. Tasks in the group share the same task spec. - TaskSpec task_spec = 3 [(google.api.field_behavior) = REQUIRED]; - - // Number of Tasks in the TaskGroup. - // Default is 1. - int64 task_count = 4; - - // Max number of tasks that can run in parallel. - // Default to min(task_count, parallel tasks per job limit). - // See: [Job Limits](https://cloud.google.com/batch/quotas#job_limits). - // Field parallelism must be 1 if the scheduling_policy is IN_ORDER. - int64 parallelism = 5; - - // Scheduling policy for Tasks in the TaskGroup. - // The default value is AS_SOON_AS_POSSIBLE. - SchedulingPolicy scheduling_policy = 6; - - // An array of environment variable mappings, which are passed to Tasks with - // matching indices. If task_environments is used then task_count should - // not be specified in the request (and will be ignored). Task count will be - // the length of task_environments. - // - // Tasks get a BATCH_TASK_INDEX and BATCH_TASK_COUNT environment variable, in - // addition to any environment variables set in task_environments, specifying - // the number of Tasks in the Task's parent TaskGroup, and the specific Task's - // index in the TaskGroup (0 through BATCH_TASK_COUNT - 1). - repeated Environment task_environments = 9; - - // Max number of tasks that can be run on a VM at the same time. - // If not specified, the system will decide a value based on available - // compute resources on a VM and task requirements. - int64 task_count_per_node = 10; - - // When true, Batch will populate a file with a list of all VMs assigned to - // the TaskGroup and set the BATCH_HOSTS_FILE environment variable to the path - // of that file. Defaults to false. The host file supports up to 1000 VMs. - bool require_hosts_file = 11; - - // When true, Batch will configure SSH to allow passwordless login between - // VMs running the Batch tasks in the same TaskGroup. - bool permissive_ssh = 12; - - // Optional. If not set or set to false, Batch uses the root user to execute - // runnables. If set to true, Batch runs the runnables using a non-root user. - // Currently, the non-root user Batch used is generated by OS Login. For more - // information, see [About OS - // Login](https://cloud.google.com/compute/docs/oslogin). - bool run_as_non_root = 14 [(google.api.field_behavior) = OPTIONAL]; -} - -// Carries information about a Google Cloud service account. -message ServiceAccount { - // Email address of the service account. - string email = 1; - - // List of scopes to be enabled for this service account. - repeated string scopes = 2; -} diff --git a/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/task.proto b/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/task.proto deleted file mode 100644 index f9edabb2b6a..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/task.proto +++ /dev/null @@ -1,475 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.batch.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/batch/v1/volume.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.Batch.V1"; -option go_package = "cloud.google.com/go/batch/apiv1/batchpb;batchpb"; -option java_multiple_files = true; -option java_outer_classname = "TaskProto"; -option java_package = "com.google.cloud.batch.v1"; -option objc_class_prefix = "GCB"; -option php_namespace = "Google\\Cloud\\Batch\\V1"; -option ruby_package = "Google::Cloud::Batch::V1"; - -// Compute resource requirements. -// -// ComputeResource defines the amount of resources required for each task. -// Make sure your tasks have enough resources to successfully run. -// If you also define the types of resources for a job to use with the -// [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) -// field, make sure both fields are compatible with each other. -message ComputeResource { - // The milliCPU count. - // - // `cpuMilli` defines the amount of CPU resources per task in milliCPU units. - // For example, `1000` corresponds to 1 vCPU per task. If undefined, the - // default value is `2000`. - // - // If you also define the VM's machine type using the `machineType` in - // [InstancePolicy](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicy) - // field or inside the `instanceTemplate` in the - // [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) - // field, make sure the CPU resources for both fields are compatible with each - // other and with how many tasks you want to allow to run on the same VM at - // the same time. - // - // For example, if you specify the `n2-standard-2` machine type, which has 2 - // vCPUs each, you are recommended to set `cpuMilli` no more than `2000`, or - // you are recommended to run two tasks on the same VM if you set `cpuMilli` - // to `1000` or less. - int64 cpu_milli = 1; - - // Memory in MiB. - // - // `memoryMib` defines the amount of memory per task in MiB units. - // If undefined, the default value is `2000`. - // If you also define the VM's machine type using the `machineType` in - // [InstancePolicy](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicy) - // field or inside the `instanceTemplate` in the - // [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) - // field, make sure the memory resources for both fields are compatible with - // each other and with how many tasks you want to allow to run on the same VM - // at the same time. - // - // For example, if you specify the `n2-standard-2` machine type, which has 8 - // GiB each, you are recommended to set `memoryMib` to no more than `8192`, - // or you are recommended to run two tasks on the same VM if you set - // `memoryMib` to `4096` or less. - int64 memory_mib = 2; - - // Extra boot disk size in MiB for each task. - int64 boot_disk_mib = 4; -} - -// Status event. -message StatusEvent { - // Type of the event. - string type = 3; - - // Description of the event. - string description = 1; - - // The time this event occurred. - google.protobuf.Timestamp event_time = 2; - - // Task Execution. - // This field is only defined for task-level status events where the task - // fails. - TaskExecution task_execution = 4; - - // Task State. - // This field is only defined for task-level status events. - TaskStatus.State task_state = 5; -} - -// This Task Execution field includes detail information for -// task execution procedures, based on StatusEvent types. -message TaskExecution { - // The exit code of a finished task. - // - // If the task succeeded, the exit code will be 0. If the task failed but not - // due to the following reasons, the exit code will be 50000. - // - // Otherwise, it can be from different sources: - // * Batch known failures: - // https://cloud.google.com/batch/docs/troubleshooting#reserved-exit-codes. - // * Batch runnable execution failures; you can rely on Batch logs to further - // diagnose: https://cloud.google.com/batch/docs/analyze-job-using-logs. If - // there are multiple runnables failures, Batch only exposes the first error. - int32 exit_code = 1; -} - -// Status of a task. -message TaskStatus { - // Task states. - enum State { - // Unknown state. - STATE_UNSPECIFIED = 0; - - // The Task is created and waiting for resources. - PENDING = 1; - - // The Task is assigned to at least one VM. - ASSIGNED = 2; - - // The Task is running. - RUNNING = 3; - - // The Task has failed. - FAILED = 4; - - // The Task has succeeded. - SUCCEEDED = 5; - - // The Task has not been executed when the Job finishes. - UNEXECUTED = 6; - } - - // Task state. - State state = 1; - - // Detailed info about why the state is reached. - repeated StatusEvent status_events = 2; -} - -// Runnable describes instructions for executing a specific script or container -// as part of a Task. -message Runnable { - // Container runnable. - message Container { - // Required. The URI to pull the container image from. - string image_uri = 1; - - // Required for some container images. Overrides the `CMD` specified in the - // container. If there is an `ENTRYPOINT` (either in the container image or - // with the `entrypoint` field below) then these commands are appended as - // arguments to the `ENTRYPOINT`. - repeated string commands = 2; - - // Required for some container images. Overrides the `ENTRYPOINT` specified - // in the container. - string entrypoint = 3; - - // Volumes to mount (bind mount) from the host machine files or directories - // into the container, formatted to match `--volume` option for the - // `docker run` command—for example, `/foo:/bar` or `/foo:/bar:ro`. - // - // If the `TaskSpec.Volumes` field is specified but this field is not, Batch - // will mount each volume from the host machine to the container with the - // same mount path by default. In this case, the default mount option for - // containers will be read-only (`ro`) for existing persistent disks and - // read-write (`rw`) for other volume types, regardless of the original - // mount options specified in `TaskSpec.Volumes`. If you need different - // mount settings, you can explicitly configure them in this field. - repeated string volumes = 7; - - // Required for some container images. Arbitrary additional options to - // include in the `docker run` command when running this container—for - // example, `--network host`. For the `--volume` option, use the `volumes` - // field for the container. - string options = 8; - - // If set to true, external network access to and from container will be - // blocked, containers that are with block_external_network as true can - // still communicate with each other, network cannot be specified in the - // `container.options` field. - bool block_external_network = 9; - - // Required if the container image is from a private Docker registry. The - // username to login to the Docker registry that contains the image. - // - // You can either specify the username directly by using plain text or - // specify an encrypted username by using a Secret Manager secret: - // `projects/*/secrets/*/versions/*`. However, using a secret is - // recommended for enhanced security. - // - // Caution: If you specify the username using plain text, you risk the - // username being exposed to any users who can view the job or its logs. - // To avoid this risk, specify a secret that contains the username instead. - // - // Learn more about [Secret - // Manager](https://cloud.google.com/secret-manager/docs/) and [using - // Secret Manager with - // Batch](https://cloud.google.com/batch/docs/create-run-job-secret-manager). - string username = 10; - - // Required if the container image is from a private Docker registry. The - // password to login to the Docker registry that contains the image. - // - // For security, it is strongly recommended to specify an - // encrypted password by using a Secret Manager secret: - // `projects/*/secrets/*/versions/*`. - // - // Warning: If you specify the password using plain text, you risk the - // password being exposed to any users who can view the job or its logs. - // To avoid this risk, specify a secret that contains the password instead. - // - // Learn more about [Secret - // Manager](https://cloud.google.com/secret-manager/docs/) and [using - // Secret Manager with - // Batch](https://cloud.google.com/batch/docs/create-run-job-secret-manager). - string password = 11; - - // Optional. If set to true, this container runnable uses Image streaming. - // - // Use Image streaming to allow the runnable to initialize without - // waiting for the entire container image to download, which can - // significantly reduce startup time for large container images. - // - // When `enableImageStreaming` is set to true, the container - // runtime is [containerd](https://containerd.io/) instead of Docker. - // Additionally, this container runnable only supports the following - // `container` subfields: `imageUri`, - // `commands[]`, `entrypoint`, and - // `volumes[]`; any other `container` subfields are ignored. - // - // For more information about the requirements and limitations for using - // Image streaming with Batch, see the [`image-streaming` - // sample on - // GitHub](https://github.com/GoogleCloudPlatform/batch-samples/tree/main/api-samples/image-streaming). - bool enable_image_streaming = 12 [(google.api.field_behavior) = OPTIONAL]; - } - - // Script runnable. - message Script { - // Required. The source code for this script runnable. - oneof command { - // The path to a script file that is accessible from the host VM(s). - // - // Unless the script file supports the default `#!/bin/sh` shell - // interpreter, you must specify an interpreter by including a - // [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix) as the - // first line of the file. For example, to execute the script using bash, - // include `#!/bin/bash` as the first line of the file. Alternatively, - // to execute the script using Python3, include `#!/usr/bin/env python3` - // as the first line of the file. - string path = 1; - - // The text for a script. - // - // Unless the script text supports the default `#!/bin/sh` shell - // interpreter, you must specify an interpreter by including a - // [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix) at the - // beginning of the text. For example, to execute the script using bash, - // include `#!/bin/bash\n` at the beginning of the text. Alternatively, - // to execute the script using Python3, include `#!/usr/bin/env python3\n` - // at the beginning of the text. - string text = 2; - } - } - - // A barrier runnable automatically blocks the execution of subsequent - // runnables until all the tasks in the task group reach the barrier. - message Barrier { - // Barriers are identified by their index in runnable list. - // Names are not required, but if present should be an identifier. - string name = 1; - } - - // Required. The script, container, or barrier for this runnable to execute. - oneof executable { - // Container runnable. - Container container = 1; - - // Script runnable. - Script script = 2; - - // Barrier runnable. - Barrier barrier = 6; - } - - // Optional. DisplayName is an optional field that can be provided by the - // caller. If provided, it will be used in logs and other outputs to identify - // the script, making it easier for users to understand the logs. If not - // provided the index of the runnable will be used for outputs. - string display_name = 10 [(google.api.field_behavior) = OPTIONAL]; - - // Normally, a runnable that returns a non-zero exit status fails and causes - // the task to fail. However, you can set this field to `true` to allow the - // task to continue executing its other runnables even if this runnable - // fails. - bool ignore_exit_status = 3; - - // Normally, a runnable that doesn't exit causes its task to fail. However, - // you can set this field to `true` to configure a background runnable. - // Background runnables are allowed continue running in the background while - // the task executes subsequent runnables. For example, background runnables - // are useful for providing services to other runnables or providing - // debugging-support tools like SSH servers. - // - // Specifically, background runnables are killed automatically (if they have - // not already exited) a short time after all foreground runnables have - // completed. Even though this is likely to result in a non-zero exit status - // for the background runnable, these automatic kills are not treated as task - // failures. - bool background = 4; - - // By default, after a Runnable fails, no further Runnable are executed. This - // flag indicates that this Runnable must be run even if the Task has already - // failed. This is useful for Runnables that copy output files off of the VM - // or for debugging. - // - // The always_run flag does not override the Task's overall max_run_duration. - // If the max_run_duration has expired then no further Runnables will execute, - // not even always_run Runnables. - bool always_run = 5; - - // Environment variables for this Runnable (overrides variables set for the - // whole Task or TaskGroup). - Environment environment = 7; - - // Timeout for this Runnable. - google.protobuf.Duration timeout = 8; - - // Labels for this Runnable. - map labels = 9; -} - -// Spec of a task -message TaskSpec { - // Required. The sequence of one or more runnables (executable scripts, - // executable containers, and/or barriers) for each task in this task group to - // run. Each task runs this list of runnables in order. For a task to succeed, - // all of its script and container runnables each must meet at least one of - // the following conditions: - // - // + The runnable exited with a zero status. - // + The runnable didn't finish, but you enabled its `background` subfield. - // + The runnable exited with a non-zero status, but you enabled its - // `ignore_exit_status` subfield. - repeated Runnable runnables = 8; - - // ComputeResource requirements. - ComputeResource compute_resource = 3; - - // Maximum duration the task should run before being automatically retried - // (if enabled) or automatically failed. Format the value of this field - // as a time limit in seconds followed by `s`—for example, `3600s` - // for 1 hour. The field accepts any value between 0 and the maximum listed - // for the `Duration` field type at - // https://protobuf.dev/reference/protobuf/google.protobuf/#duration; however, - // the actual maximum run time for a job will be limited to the maximum run - // time for a job listed at - // https://cloud.google.com/batch/quotas#max-job-duration. - google.protobuf.Duration max_run_duration = 4; - - // Maximum number of retries on failures. - // The default, 0, which means never retry. - // The valid value range is [0, 10]. - int32 max_retry_count = 5; - - // Lifecycle management schema when any task in a task group is failed. - // Currently we only support one lifecycle policy. - // When the lifecycle policy condition is met, - // the action in the policy will execute. - // If task execution result does not meet with the defined lifecycle - // policy, we consider it as the default policy. - // Default policy means if the exit code is 0, exit task. - // If task ends with non-zero exit code, retry the task with max_retry_count. - repeated LifecyclePolicy lifecycle_policies = 9; - - // Deprecated: please use environment(non-plural) instead. - map environments = 6 [deprecated = true]; - - // Volumes to mount before running Tasks using this TaskSpec. - repeated Volume volumes = 7; - - // Environment variables to set before running the Task. - Environment environment = 10; -} - -// LifecyclePolicy describes how to deal with task failures -// based on different conditions. -message LifecyclePolicy { - // Conditions for actions to deal with task failures. - message ActionCondition { - // Exit codes of a task execution. - // If there are more than 1 exit codes, - // when task executes with any of the exit code in the list, - // the condition is met and the action will be executed. - repeated int32 exit_codes = 1; - } - - // Action on task failures based on different conditions. - enum Action { - // Action unspecified. - ACTION_UNSPECIFIED = 0; - - // Action that tasks in the group will be scheduled to re-execute. - RETRY_TASK = 1; - - // Action that tasks in the group will be stopped immediately. - FAIL_TASK = 2; - } - - // Action to execute when ActionCondition is true. - // When RETRY_TASK is specified, we will retry failed tasks - // if we notice any exit code match and fail tasks if no match is found. - // Likewise, when FAIL_TASK is specified, we will fail tasks - // if we notice any exit code match and retry tasks if no match is found. - Action action = 1; - - // Conditions that decide why a task failure is dealt with a specific action. - ActionCondition action_condition = 2; -} - -// A Cloud Batch task. -message Task { - option (google.api.resource) = { - type: "batch.googleapis.com/Task" - pattern: "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}/tasks/{task}" - }; - - // Task name. - // The name is generated from the parent TaskGroup name and 'id' field. - // For example: - // "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01/tasks/task01". - string name = 1; - - // Task Status. - TaskStatus status = 2; -} - -// An Environment describes a collection of environment variables to set when -// executing Tasks. -message Environment { - message KMSEnvMap { - // The name of the KMS key that will be used to decrypt the cipher text. - string key_name = 1; - - // The value of the cipherText response from the `encrypt` method. - string cipher_text = 2; - } - - // A map of environment variable names to values. - map variables = 1; - - // A map of environment variable names to Secret Manager secret names. - // The VM will access the named secrets to set the value of each environment - // variable. - map secret_variables = 2; - - // An encrypted JSON dictionary where the key/value pairs correspond to - // environment variable names and their values. - KMSEnvMap encrypted_variables = 3; -} diff --git a/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/volume.proto b/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/volume.proto deleted file mode 100644 index 9bf8126f634..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/volume.proto +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.batch.v1; - -option csharp_namespace = "Google.Cloud.Batch.V1"; -option go_package = "cloud.google.com/go/batch/apiv1/batchpb;batchpb"; -option java_multiple_files = true; -option java_outer_classname = "VolumeProto"; -option java_package = "com.google.cloud.batch.v1"; -option objc_class_prefix = "GCB"; -option php_namespace = "Google\\Cloud\\Batch\\V1"; -option ruby_package = "Google::Cloud::Batch::V1"; - -// Volume describes a volume and parameters for it to be mounted to a VM. -message Volume { - // The source for the volume. - oneof source { - // A Network File System (NFS) volume. For example, a - // Filestore file share. - NFS nfs = 1; - - // A Google Cloud Storage (GCS) volume. - GCS gcs = 3; - - // Device name of an attached disk volume, which should align with a - // device_name specified by - // job.allocation_policy.instances[0].policy.disks[i].device_name or - // defined by the given instance template in - // job.allocation_policy.instances[0].instance_template. - string device_name = 6; - } - - // The mount path for the volume, e.g. /mnt/disks/share. - string mount_path = 4; - - // Mount options vary based on the type of storage volume: - // - // * For a Cloud Storage bucket, all the mount options provided - // by - // the [`gcsfuse` tool](https://cloud.google.com/storage/docs/gcsfuse-cli) - // are supported. - // * For an existing persistent disk, all mount options provided by the - // [`mount` command](https://man7.org/linux/man-pages/man8/mount.8.html) - // except writing are supported. This is due to restrictions of - // [multi-writer - // mode](https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms). - // * For any other disk or a Network File System (NFS), all the - // mount options provided by the `mount` command are supported. - repeated string mount_options = 5; -} - -// Represents an NFS volume. -message NFS { - // The IP address of the NFS. - string server = 1; - - // Remote source path exported from the NFS, e.g., "/share". - string remote_path = 2; -} - -// Represents a Google Cloud Storage volume. -message GCS { - // Remote path, either a bucket name or a subdirectory of a bucket, e.g.: - // bucket_name, bucket_name/subdirectory/ - string remote_path = 1; -} diff --git a/owl-bot-staging/google-cloud-batch/v1/protos/protos.d.ts b/owl-bot-staging/google-cloud-batch/v1/protos/protos.d.ts deleted file mode 100644 index 4d35440216c..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/protos/protos.d.ts +++ /dev/null @@ -1,13321 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import type {protobuf as $protobuf} from "google-gax"; -import Long = require("long"); -/** Namespace google. */ -export namespace google { - - /** Namespace cloud. */ - namespace cloud { - - /** Namespace batch. */ - namespace batch { - - /** Namespace v1. */ - namespace v1 { - - /** Represents a BatchService */ - class BatchService extends $protobuf.rpc.Service { - - /** - * Constructs a new BatchService 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 BatchService 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): BatchService; - - /** - * Calls CreateJob. - * @param request CreateJobRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Job - */ - public createJob(request: google.cloud.batch.v1.ICreateJobRequest, callback: google.cloud.batch.v1.BatchService.CreateJobCallback): void; - - /** - * Calls CreateJob. - * @param request CreateJobRequest message or plain object - * @returns Promise - */ - public createJob(request: google.cloud.batch.v1.ICreateJobRequest): Promise; - - /** - * Calls GetJob. - * @param request GetJobRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Job - */ - public getJob(request: google.cloud.batch.v1.IGetJobRequest, callback: google.cloud.batch.v1.BatchService.GetJobCallback): void; - - /** - * Calls GetJob. - * @param request GetJobRequest message or plain object - * @returns Promise - */ - public getJob(request: google.cloud.batch.v1.IGetJobRequest): Promise; - - /** - * Calls DeleteJob. - * @param request DeleteJobRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteJob(request: google.cloud.batch.v1.IDeleteJobRequest, callback: google.cloud.batch.v1.BatchService.DeleteJobCallback): void; - - /** - * Calls DeleteJob. - * @param request DeleteJobRequest message or plain object - * @returns Promise - */ - public deleteJob(request: google.cloud.batch.v1.IDeleteJobRequest): Promise; - - /** - * Calls ListJobs. - * @param request ListJobsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListJobsResponse - */ - public listJobs(request: google.cloud.batch.v1.IListJobsRequest, callback: google.cloud.batch.v1.BatchService.ListJobsCallback): void; - - /** - * Calls ListJobs. - * @param request ListJobsRequest message or plain object - * @returns Promise - */ - public listJobs(request: google.cloud.batch.v1.IListJobsRequest): Promise; - - /** - * Calls GetTask. - * @param request GetTaskRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Task - */ - public getTask(request: google.cloud.batch.v1.IGetTaskRequest, callback: google.cloud.batch.v1.BatchService.GetTaskCallback): void; - - /** - * Calls GetTask. - * @param request GetTaskRequest message or plain object - * @returns Promise - */ - public getTask(request: google.cloud.batch.v1.IGetTaskRequest): Promise; - - /** - * Calls ListTasks. - * @param request ListTasksRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListTasksResponse - */ - public listTasks(request: google.cloud.batch.v1.IListTasksRequest, callback: google.cloud.batch.v1.BatchService.ListTasksCallback): void; - - /** - * Calls ListTasks. - * @param request ListTasksRequest message or plain object - * @returns Promise - */ - public listTasks(request: google.cloud.batch.v1.IListTasksRequest): Promise; - } - - namespace BatchService { - - /** - * Callback as used by {@link google.cloud.batch.v1.BatchService|createJob}. - * @param error Error, if any - * @param [response] Job - */ - type CreateJobCallback = (error: (Error|null), response?: google.cloud.batch.v1.Job) => void; - - /** - * Callback as used by {@link google.cloud.batch.v1.BatchService|getJob}. - * @param error Error, if any - * @param [response] Job - */ - type GetJobCallback = (error: (Error|null), response?: google.cloud.batch.v1.Job) => void; - - /** - * Callback as used by {@link google.cloud.batch.v1.BatchService|deleteJob}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.batch.v1.BatchService|listJobs}. - * @param error Error, if any - * @param [response] ListJobsResponse - */ - type ListJobsCallback = (error: (Error|null), response?: google.cloud.batch.v1.ListJobsResponse) => void; - - /** - * Callback as used by {@link google.cloud.batch.v1.BatchService|getTask}. - * @param error Error, if any - * @param [response] Task - */ - type GetTaskCallback = (error: (Error|null), response?: google.cloud.batch.v1.Task) => void; - - /** - * Callback as used by {@link google.cloud.batch.v1.BatchService|listTasks}. - * @param error Error, if any - * @param [response] ListTasksResponse - */ - type ListTasksCallback = (error: (Error|null), response?: google.cloud.batch.v1.ListTasksResponse) => void; - } - - /** Properties of a CreateJobRequest. */ - interface ICreateJobRequest { - - /** CreateJobRequest parent */ - parent?: (string|null); - - /** CreateJobRequest jobId */ - jobId?: (string|null); - - /** CreateJobRequest job */ - job?: (google.cloud.batch.v1.IJob|null); - - /** CreateJobRequest requestId */ - requestId?: (string|null); - } - - /** Represents a CreateJobRequest. */ - class CreateJobRequest implements ICreateJobRequest { - - /** - * Constructs a new CreateJobRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.ICreateJobRequest); - - /** CreateJobRequest parent. */ - public parent: string; - - /** CreateJobRequest jobId. */ - public jobId: string; - - /** CreateJobRequest job. */ - public job?: (google.cloud.batch.v1.IJob|null); - - /** CreateJobRequest requestId. */ - public requestId: string; - - /** - * Creates a new CreateJobRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateJobRequest instance - */ - public static create(properties?: google.cloud.batch.v1.ICreateJobRequest): google.cloud.batch.v1.CreateJobRequest; - - /** - * Encodes the specified CreateJobRequest message. Does not implicitly {@link google.cloud.batch.v1.CreateJobRequest.verify|verify} messages. - * @param message CreateJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.ICreateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.CreateJobRequest.verify|verify} messages. - * @param message CreateJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.ICreateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateJobRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.CreateJobRequest; - - /** - * Decodes a CreateJobRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.CreateJobRequest; - - /** - * Verifies a CreateJobRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateJobRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateJobRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.CreateJobRequest; - - /** - * Creates a plain object from a CreateJobRequest message. Also converts values to other types if specified. - * @param message CreateJobRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.CreateJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateJobRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateJobRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetJobRequest. */ - interface IGetJobRequest { - - /** GetJobRequest name */ - name?: (string|null); - } - - /** Represents a GetJobRequest. */ - class GetJobRequest implements IGetJobRequest { - - /** - * Constructs a new GetJobRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IGetJobRequest); - - /** GetJobRequest name. */ - public name: string; - - /** - * Creates a new GetJobRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetJobRequest instance - */ - public static create(properties?: google.cloud.batch.v1.IGetJobRequest): google.cloud.batch.v1.GetJobRequest; - - /** - * Encodes the specified GetJobRequest message. Does not implicitly {@link google.cloud.batch.v1.GetJobRequest.verify|verify} messages. - * @param message GetJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IGetJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.GetJobRequest.verify|verify} messages. - * @param message GetJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IGetJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetJobRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.GetJobRequest; - - /** - * Decodes a GetJobRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.GetJobRequest; - - /** - * Verifies a GetJobRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetJobRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetJobRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.GetJobRequest; - - /** - * Creates a plain object from a GetJobRequest message. Also converts values to other types if specified. - * @param message GetJobRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.GetJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetJobRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetJobRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteJobRequest. */ - interface IDeleteJobRequest { - - /** DeleteJobRequest name */ - name?: (string|null); - - /** DeleteJobRequest reason */ - reason?: (string|null); - - /** DeleteJobRequest requestId */ - requestId?: (string|null); - } - - /** Represents a DeleteJobRequest. */ - class DeleteJobRequest implements IDeleteJobRequest { - - /** - * Constructs a new DeleteJobRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IDeleteJobRequest); - - /** DeleteJobRequest name. */ - public name: string; - - /** DeleteJobRequest reason. */ - public reason: string; - - /** DeleteJobRequest requestId. */ - public requestId: string; - - /** - * Creates a new DeleteJobRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteJobRequest instance - */ - public static create(properties?: google.cloud.batch.v1.IDeleteJobRequest): google.cloud.batch.v1.DeleteJobRequest; - - /** - * Encodes the specified DeleteJobRequest message. Does not implicitly {@link google.cloud.batch.v1.DeleteJobRequest.verify|verify} messages. - * @param message DeleteJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IDeleteJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.DeleteJobRequest.verify|verify} messages. - * @param message DeleteJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IDeleteJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteJobRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.DeleteJobRequest; - - /** - * Decodes a DeleteJobRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.DeleteJobRequest; - - /** - * Verifies a DeleteJobRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteJobRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteJobRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.DeleteJobRequest; - - /** - * Creates a plain object from a DeleteJobRequest message. Also converts values to other types if specified. - * @param message DeleteJobRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.DeleteJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteJobRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteJobRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListJobsRequest. */ - interface IListJobsRequest { - - /** ListJobsRequest parent */ - parent?: (string|null); - - /** ListJobsRequest filter */ - filter?: (string|null); - - /** ListJobsRequest orderBy */ - orderBy?: (string|null); - - /** ListJobsRequest pageSize */ - pageSize?: (number|null); - - /** ListJobsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListJobsRequest. */ - class ListJobsRequest implements IListJobsRequest { - - /** - * Constructs a new ListJobsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IListJobsRequest); - - /** ListJobsRequest parent. */ - public parent: string; - - /** ListJobsRequest filter. */ - public filter: string; - - /** ListJobsRequest orderBy. */ - public orderBy: string; - - /** ListJobsRequest pageSize. */ - public pageSize: number; - - /** ListJobsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListJobsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListJobsRequest instance - */ - public static create(properties?: google.cloud.batch.v1.IListJobsRequest): google.cloud.batch.v1.ListJobsRequest; - - /** - * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.cloud.batch.v1.ListJobsRequest.verify|verify} messages. - * @param message ListJobsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IListJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListJobsRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ListJobsRequest.verify|verify} messages. - * @param message ListJobsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IListJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListJobsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListJobsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.ListJobsRequest; - - /** - * Decodes a ListJobsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListJobsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.ListJobsRequest; - - /** - * Verifies a ListJobsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListJobsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListJobsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.ListJobsRequest; - - /** - * Creates a plain object from a ListJobsRequest message. Also converts values to other types if specified. - * @param message ListJobsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.ListJobsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListJobsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListJobsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListJobsResponse. */ - interface IListJobsResponse { - - /** ListJobsResponse jobs */ - jobs?: (google.cloud.batch.v1.IJob[]|null); - - /** ListJobsResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListJobsResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListJobsResponse. */ - class ListJobsResponse implements IListJobsResponse { - - /** - * Constructs a new ListJobsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IListJobsResponse); - - /** ListJobsResponse jobs. */ - public jobs: google.cloud.batch.v1.IJob[]; - - /** ListJobsResponse nextPageToken. */ - public nextPageToken: string; - - /** ListJobsResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListJobsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListJobsResponse instance - */ - public static create(properties?: google.cloud.batch.v1.IListJobsResponse): google.cloud.batch.v1.ListJobsResponse; - - /** - * Encodes the specified ListJobsResponse message. Does not implicitly {@link google.cloud.batch.v1.ListJobsResponse.verify|verify} messages. - * @param message ListJobsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IListJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListJobsResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ListJobsResponse.verify|verify} messages. - * @param message ListJobsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IListJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListJobsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListJobsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.ListJobsResponse; - - /** - * Decodes a ListJobsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListJobsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.ListJobsResponse; - - /** - * Verifies a ListJobsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListJobsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListJobsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.ListJobsResponse; - - /** - * Creates a plain object from a ListJobsResponse message. Also converts values to other types if specified. - * @param message ListJobsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.ListJobsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListJobsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListJobsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListTasksRequest. */ - interface IListTasksRequest { - - /** ListTasksRequest parent */ - parent?: (string|null); - - /** ListTasksRequest filter */ - filter?: (string|null); - - /** ListTasksRequest pageSize */ - pageSize?: (number|null); - - /** ListTasksRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListTasksRequest. */ - class ListTasksRequest implements IListTasksRequest { - - /** - * Constructs a new ListTasksRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IListTasksRequest); - - /** ListTasksRequest parent. */ - public parent: string; - - /** ListTasksRequest filter. */ - public filter: string; - - /** ListTasksRequest pageSize. */ - public pageSize: number; - - /** ListTasksRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListTasksRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListTasksRequest instance - */ - public static create(properties?: google.cloud.batch.v1.IListTasksRequest): google.cloud.batch.v1.ListTasksRequest; - - /** - * Encodes the specified ListTasksRequest message. Does not implicitly {@link google.cloud.batch.v1.ListTasksRequest.verify|verify} messages. - * @param message ListTasksRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IListTasksRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListTasksRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ListTasksRequest.verify|verify} messages. - * @param message ListTasksRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IListTasksRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListTasksRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListTasksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.ListTasksRequest; - - /** - * Decodes a ListTasksRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListTasksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.ListTasksRequest; - - /** - * Verifies a ListTasksRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListTasksRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListTasksRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.ListTasksRequest; - - /** - * Creates a plain object from a ListTasksRequest message. Also converts values to other types if specified. - * @param message ListTasksRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.ListTasksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListTasksRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListTasksRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListTasksResponse. */ - interface IListTasksResponse { - - /** ListTasksResponse tasks */ - tasks?: (google.cloud.batch.v1.ITask[]|null); - - /** ListTasksResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListTasksResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListTasksResponse. */ - class ListTasksResponse implements IListTasksResponse { - - /** - * Constructs a new ListTasksResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IListTasksResponse); - - /** ListTasksResponse tasks. */ - public tasks: google.cloud.batch.v1.ITask[]; - - /** ListTasksResponse nextPageToken. */ - public nextPageToken: string; - - /** ListTasksResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListTasksResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListTasksResponse instance - */ - public static create(properties?: google.cloud.batch.v1.IListTasksResponse): google.cloud.batch.v1.ListTasksResponse; - - /** - * Encodes the specified ListTasksResponse message. Does not implicitly {@link google.cloud.batch.v1.ListTasksResponse.verify|verify} messages. - * @param message ListTasksResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IListTasksResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListTasksResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ListTasksResponse.verify|verify} messages. - * @param message ListTasksResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IListTasksResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListTasksResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListTasksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.ListTasksResponse; - - /** - * Decodes a ListTasksResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListTasksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.ListTasksResponse; - - /** - * Verifies a ListTasksResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListTasksResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListTasksResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.ListTasksResponse; - - /** - * Creates a plain object from a ListTasksResponse message. Also converts values to other types if specified. - * @param message ListTasksResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.ListTasksResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListTasksResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListTasksResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetTaskRequest. */ - interface IGetTaskRequest { - - /** GetTaskRequest name */ - name?: (string|null); - } - - /** Represents a GetTaskRequest. */ - class GetTaskRequest implements IGetTaskRequest { - - /** - * Constructs a new GetTaskRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IGetTaskRequest); - - /** GetTaskRequest name. */ - public name: string; - - /** - * Creates a new GetTaskRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetTaskRequest instance - */ - public static create(properties?: google.cloud.batch.v1.IGetTaskRequest): google.cloud.batch.v1.GetTaskRequest; - - /** - * Encodes the specified GetTaskRequest message. Does not implicitly {@link google.cloud.batch.v1.GetTaskRequest.verify|verify} messages. - * @param message GetTaskRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IGetTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetTaskRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.GetTaskRequest.verify|verify} messages. - * @param message GetTaskRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IGetTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetTaskRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.GetTaskRequest; - - /** - * Decodes a GetTaskRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.GetTaskRequest; - - /** - * Verifies a GetTaskRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetTaskRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetTaskRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.GetTaskRequest; - - /** - * Creates a plain object from a GetTaskRequest message. Also converts values to other types if specified. - * @param message GetTaskRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.GetTaskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetTaskRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetTaskRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OperationMetadata. */ - interface IOperationMetadata { - - /** OperationMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata target */ - target?: (string|null); - - /** OperationMetadata verb */ - verb?: (string|null); - - /** OperationMetadata statusMessage */ - statusMessage?: (string|null); - - /** OperationMetadata requestedCancellation */ - requestedCancellation?: (boolean|null); - - /** OperationMetadata apiVersion */ - apiVersion?: (string|null); - } - - /** Represents an OperationMetadata. */ - class OperationMetadata implements IOperationMetadata { - - /** - * Constructs a new OperationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IOperationMetadata); - - /** OperationMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata target. */ - public target: string; - - /** OperationMetadata verb. */ - public verb: string; - - /** OperationMetadata statusMessage. */ - public statusMessage: string; - - /** OperationMetadata requestedCancellation. */ - public requestedCancellation: boolean; - - /** OperationMetadata apiVersion. */ - public apiVersion: string; - - /** - * Creates a new OperationMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns OperationMetadata instance - */ - public static create(properties?: google.cloud.batch.v1.IOperationMetadata): google.cloud.batch.v1.OperationMetadata; - - /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.batch.v1.OperationMetadata.verify|verify} messages. - * @param message OperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.batch.v1.OperationMetadata.verify|verify} messages. - * @param message OperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.OperationMetadata; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.OperationMetadata; - - /** - * Verifies an OperationMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OperationMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.OperationMetadata; - - /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. - * @param message OperationMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OperationMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OperationMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Job. */ - interface IJob { - - /** Job name */ - name?: (string|null); - - /** Job uid */ - uid?: (string|null); - - /** Job priority */ - priority?: (number|Long|string|null); - - /** Job taskGroups */ - taskGroups?: (google.cloud.batch.v1.ITaskGroup[]|null); - - /** Job allocationPolicy */ - allocationPolicy?: (google.cloud.batch.v1.IAllocationPolicy|null); - - /** Job labels */ - labels?: ({ [k: string]: string }|null); - - /** Job status */ - status?: (google.cloud.batch.v1.IJobStatus|null); - - /** Job createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Job updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Job logsPolicy */ - logsPolicy?: (google.cloud.batch.v1.ILogsPolicy|null); - - /** Job notifications */ - notifications?: (google.cloud.batch.v1.IJobNotification[]|null); - } - - /** Represents a Job. */ - class Job implements IJob { - - /** - * Constructs a new Job. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IJob); - - /** Job name. */ - public name: string; - - /** Job uid. */ - public uid: string; - - /** Job priority. */ - public priority: (number|Long|string); - - /** Job taskGroups. */ - public taskGroups: google.cloud.batch.v1.ITaskGroup[]; - - /** Job allocationPolicy. */ - public allocationPolicy?: (google.cloud.batch.v1.IAllocationPolicy|null); - - /** Job labels. */ - public labels: { [k: string]: string }; - - /** Job status. */ - public status?: (google.cloud.batch.v1.IJobStatus|null); - - /** Job createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Job updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Job logsPolicy. */ - public logsPolicy?: (google.cloud.batch.v1.ILogsPolicy|null); - - /** Job notifications. */ - public notifications: google.cloud.batch.v1.IJobNotification[]; - - /** - * Creates a new Job instance using the specified properties. - * @param [properties] Properties to set - * @returns Job instance - */ - public static create(properties?: google.cloud.batch.v1.IJob): google.cloud.batch.v1.Job; - - /** - * Encodes the specified Job message. Does not implicitly {@link google.cloud.batch.v1.Job.verify|verify} messages. - * @param message Job message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IJob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Job.verify|verify} messages. - * @param message Job message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IJob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Job message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Job - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.Job; - - /** - * Decodes a Job message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Job - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.Job; - - /** - * Verifies a Job message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Job message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Job - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.Job; - - /** - * Creates a plain object from a Job message. Also converts values to other types if specified. - * @param message Job - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.Job, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Job to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Job - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a LogsPolicy. */ - interface ILogsPolicy { - - /** LogsPolicy destination */ - destination?: (google.cloud.batch.v1.LogsPolicy.Destination|keyof typeof google.cloud.batch.v1.LogsPolicy.Destination|null); - - /** LogsPolicy logsPath */ - logsPath?: (string|null); - - /** LogsPolicy cloudLoggingOption */ - cloudLoggingOption?: (google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption|null); - } - - /** Represents a LogsPolicy. */ - class LogsPolicy implements ILogsPolicy { - - /** - * Constructs a new LogsPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.ILogsPolicy); - - /** LogsPolicy destination. */ - public destination: (google.cloud.batch.v1.LogsPolicy.Destination|keyof typeof google.cloud.batch.v1.LogsPolicy.Destination); - - /** LogsPolicy logsPath. */ - public logsPath: string; - - /** LogsPolicy cloudLoggingOption. */ - public cloudLoggingOption?: (google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption|null); - - /** - * Creates a new LogsPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns LogsPolicy instance - */ - public static create(properties?: google.cloud.batch.v1.ILogsPolicy): google.cloud.batch.v1.LogsPolicy; - - /** - * Encodes the specified LogsPolicy message. Does not implicitly {@link google.cloud.batch.v1.LogsPolicy.verify|verify} messages. - * @param message LogsPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.ILogsPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LogsPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.LogsPolicy.verify|verify} messages. - * @param message LogsPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.ILogsPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LogsPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LogsPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.LogsPolicy; - - /** - * Decodes a LogsPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LogsPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.LogsPolicy; - - /** - * Verifies a LogsPolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LogsPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LogsPolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.LogsPolicy; - - /** - * Creates a plain object from a LogsPolicy message. Also converts values to other types if specified. - * @param message LogsPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.LogsPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LogsPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LogsPolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace LogsPolicy { - - /** Properties of a CloudLoggingOption. */ - interface ICloudLoggingOption { - - /** CloudLoggingOption useGenericTaskMonitoredResource */ - useGenericTaskMonitoredResource?: (boolean|null); - } - - /** Represents a CloudLoggingOption. */ - class CloudLoggingOption implements ICloudLoggingOption { - - /** - * Constructs a new CloudLoggingOption. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption); - - /** CloudLoggingOption useGenericTaskMonitoredResource. */ - public useGenericTaskMonitoredResource: boolean; - - /** - * Creates a new CloudLoggingOption instance using the specified properties. - * @param [properties] Properties to set - * @returns CloudLoggingOption instance - */ - public static create(properties?: google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption): google.cloud.batch.v1.LogsPolicy.CloudLoggingOption; - - /** - * Encodes the specified CloudLoggingOption message. Does not implicitly {@link google.cloud.batch.v1.LogsPolicy.CloudLoggingOption.verify|verify} messages. - * @param message CloudLoggingOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CloudLoggingOption message, length delimited. Does not implicitly {@link google.cloud.batch.v1.LogsPolicy.CloudLoggingOption.verify|verify} messages. - * @param message CloudLoggingOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CloudLoggingOption message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CloudLoggingOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.LogsPolicy.CloudLoggingOption; - - /** - * Decodes a CloudLoggingOption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CloudLoggingOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.LogsPolicy.CloudLoggingOption; - - /** - * Verifies a CloudLoggingOption message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CloudLoggingOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CloudLoggingOption - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.LogsPolicy.CloudLoggingOption; - - /** - * Creates a plain object from a CloudLoggingOption message. Also converts values to other types if specified. - * @param message CloudLoggingOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.LogsPolicy.CloudLoggingOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CloudLoggingOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CloudLoggingOption - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Destination enum. */ - enum Destination { - DESTINATION_UNSPECIFIED = 0, - CLOUD_LOGGING = 1, - PATH = 2 - } - } - - /** Properties of a JobStatus. */ - interface IJobStatus { - - /** JobStatus state */ - state?: (google.cloud.batch.v1.JobStatus.State|keyof typeof google.cloud.batch.v1.JobStatus.State|null); - - /** JobStatus statusEvents */ - statusEvents?: (google.cloud.batch.v1.IStatusEvent[]|null); - - /** JobStatus taskGroups */ - taskGroups?: ({ [k: string]: google.cloud.batch.v1.JobStatus.ITaskGroupStatus }|null); - - /** JobStatus runDuration */ - runDuration?: (google.protobuf.IDuration|null); - } - - /** Represents a JobStatus. */ - class JobStatus implements IJobStatus { - - /** - * Constructs a new JobStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IJobStatus); - - /** JobStatus state. */ - public state: (google.cloud.batch.v1.JobStatus.State|keyof typeof google.cloud.batch.v1.JobStatus.State); - - /** JobStatus statusEvents. */ - public statusEvents: google.cloud.batch.v1.IStatusEvent[]; - - /** JobStatus taskGroups. */ - public taskGroups: { [k: string]: google.cloud.batch.v1.JobStatus.ITaskGroupStatus }; - - /** JobStatus runDuration. */ - public runDuration?: (google.protobuf.IDuration|null); - - /** - * Creates a new JobStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns JobStatus instance - */ - public static create(properties?: google.cloud.batch.v1.IJobStatus): google.cloud.batch.v1.JobStatus; - - /** - * Encodes the specified JobStatus message. Does not implicitly {@link google.cloud.batch.v1.JobStatus.verify|verify} messages. - * @param message JobStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IJobStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified JobStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobStatus.verify|verify} messages. - * @param message JobStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IJobStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a JobStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns JobStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.JobStatus; - - /** - * Decodes a JobStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns JobStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.JobStatus; - - /** - * Verifies a JobStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a JobStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns JobStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.JobStatus; - - /** - * Creates a plain object from a JobStatus message. Also converts values to other types if specified. - * @param message JobStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.JobStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this JobStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for JobStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace JobStatus { - - /** Properties of an InstanceStatus. */ - interface IInstanceStatus { - - /** InstanceStatus machineType */ - machineType?: (string|null); - - /** InstanceStatus provisioningModel */ - provisioningModel?: (google.cloud.batch.v1.AllocationPolicy.ProvisioningModel|keyof typeof google.cloud.batch.v1.AllocationPolicy.ProvisioningModel|null); - - /** InstanceStatus taskPack */ - taskPack?: (number|Long|string|null); - - /** InstanceStatus bootDisk */ - bootDisk?: (google.cloud.batch.v1.AllocationPolicy.IDisk|null); - } - - /** Represents an InstanceStatus. */ - class InstanceStatus implements IInstanceStatus { - - /** - * Constructs a new InstanceStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.JobStatus.IInstanceStatus); - - /** InstanceStatus machineType. */ - public machineType: string; - - /** InstanceStatus provisioningModel. */ - public provisioningModel: (google.cloud.batch.v1.AllocationPolicy.ProvisioningModel|keyof typeof google.cloud.batch.v1.AllocationPolicy.ProvisioningModel); - - /** InstanceStatus taskPack. */ - public taskPack: (number|Long|string); - - /** InstanceStatus bootDisk. */ - public bootDisk?: (google.cloud.batch.v1.AllocationPolicy.IDisk|null); - - /** - * Creates a new InstanceStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns InstanceStatus instance - */ - public static create(properties?: google.cloud.batch.v1.JobStatus.IInstanceStatus): google.cloud.batch.v1.JobStatus.InstanceStatus; - - /** - * Encodes the specified InstanceStatus message. Does not implicitly {@link google.cloud.batch.v1.JobStatus.InstanceStatus.verify|verify} messages. - * @param message InstanceStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.JobStatus.IInstanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InstanceStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobStatus.InstanceStatus.verify|verify} messages. - * @param message InstanceStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.JobStatus.IInstanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InstanceStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InstanceStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.JobStatus.InstanceStatus; - - /** - * Decodes an InstanceStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InstanceStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.JobStatus.InstanceStatus; - - /** - * Verifies an InstanceStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InstanceStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InstanceStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.JobStatus.InstanceStatus; - - /** - * Creates a plain object from an InstanceStatus message. Also converts values to other types if specified. - * @param message InstanceStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.JobStatus.InstanceStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InstanceStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InstanceStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TaskGroupStatus. */ - interface ITaskGroupStatus { - - /** TaskGroupStatus counts */ - counts?: ({ [k: string]: (number|Long|string) }|null); - - /** TaskGroupStatus instances */ - instances?: (google.cloud.batch.v1.JobStatus.IInstanceStatus[]|null); - } - - /** Represents a TaskGroupStatus. */ - class TaskGroupStatus implements ITaskGroupStatus { - - /** - * Constructs a new TaskGroupStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.JobStatus.ITaskGroupStatus); - - /** TaskGroupStatus counts. */ - public counts: { [k: string]: (number|Long|string) }; - - /** TaskGroupStatus instances. */ - public instances: google.cloud.batch.v1.JobStatus.IInstanceStatus[]; - - /** - * Creates a new TaskGroupStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns TaskGroupStatus instance - */ - public static create(properties?: google.cloud.batch.v1.JobStatus.ITaskGroupStatus): google.cloud.batch.v1.JobStatus.TaskGroupStatus; - - /** - * Encodes the specified TaskGroupStatus message. Does not implicitly {@link google.cloud.batch.v1.JobStatus.TaskGroupStatus.verify|verify} messages. - * @param message TaskGroupStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.JobStatus.ITaskGroupStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TaskGroupStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobStatus.TaskGroupStatus.verify|verify} messages. - * @param message TaskGroupStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.JobStatus.ITaskGroupStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TaskGroupStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TaskGroupStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.JobStatus.TaskGroupStatus; - - /** - * Decodes a TaskGroupStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TaskGroupStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.JobStatus.TaskGroupStatus; - - /** - * Verifies a TaskGroupStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TaskGroupStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TaskGroupStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.JobStatus.TaskGroupStatus; - - /** - * Creates a plain object from a TaskGroupStatus message. Also converts values to other types if specified. - * @param message TaskGroupStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.JobStatus.TaskGroupStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TaskGroupStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TaskGroupStatus - * @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, - QUEUED = 1, - SCHEDULED = 2, - RUNNING = 3, - SUCCEEDED = 4, - FAILED = 5, - DELETION_IN_PROGRESS = 6 - } - } - - /** Properties of a JobNotification. */ - interface IJobNotification { - - /** JobNotification pubsubTopic */ - pubsubTopic?: (string|null); - - /** JobNotification message */ - message?: (google.cloud.batch.v1.JobNotification.IMessage|null); - } - - /** Represents a JobNotification. */ - class JobNotification implements IJobNotification { - - /** - * Constructs a new JobNotification. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IJobNotification); - - /** JobNotification pubsubTopic. */ - public pubsubTopic: string; - - /** JobNotification message. */ - public message?: (google.cloud.batch.v1.JobNotification.IMessage|null); - - /** - * Creates a new JobNotification instance using the specified properties. - * @param [properties] Properties to set - * @returns JobNotification instance - */ - public static create(properties?: google.cloud.batch.v1.IJobNotification): google.cloud.batch.v1.JobNotification; - - /** - * Encodes the specified JobNotification message. Does not implicitly {@link google.cloud.batch.v1.JobNotification.verify|verify} messages. - * @param message JobNotification message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IJobNotification, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified JobNotification message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobNotification.verify|verify} messages. - * @param message JobNotification message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IJobNotification, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a JobNotification message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns JobNotification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.JobNotification; - - /** - * Decodes a JobNotification message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns JobNotification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.JobNotification; - - /** - * Verifies a JobNotification message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a JobNotification message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns JobNotification - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.JobNotification; - - /** - * Creates a plain object from a JobNotification message. Also converts values to other types if specified. - * @param message JobNotification - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.JobNotification, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this JobNotification to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for JobNotification - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace JobNotification { - - /** Properties of a Message. */ - interface IMessage { - - /** Message type */ - type?: (google.cloud.batch.v1.JobNotification.Type|keyof typeof google.cloud.batch.v1.JobNotification.Type|null); - - /** Message newJobState */ - newJobState?: (google.cloud.batch.v1.JobStatus.State|keyof typeof google.cloud.batch.v1.JobStatus.State|null); - - /** Message newTaskState */ - newTaskState?: (google.cloud.batch.v1.TaskStatus.State|keyof typeof google.cloud.batch.v1.TaskStatus.State|null); - } - - /** Represents a Message. */ - class Message implements IMessage { - - /** - * Constructs a new Message. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.JobNotification.IMessage); - - /** Message type. */ - public type: (google.cloud.batch.v1.JobNotification.Type|keyof typeof google.cloud.batch.v1.JobNotification.Type); - - /** Message newJobState. */ - public newJobState: (google.cloud.batch.v1.JobStatus.State|keyof typeof google.cloud.batch.v1.JobStatus.State); - - /** Message newTaskState. */ - public newTaskState: (google.cloud.batch.v1.TaskStatus.State|keyof typeof google.cloud.batch.v1.TaskStatus.State); - - /** - * Creates a new Message instance using the specified properties. - * @param [properties] Properties to set - * @returns Message instance - */ - public static create(properties?: google.cloud.batch.v1.JobNotification.IMessage): google.cloud.batch.v1.JobNotification.Message; - - /** - * Encodes the specified Message message. Does not implicitly {@link google.cloud.batch.v1.JobNotification.Message.verify|verify} messages. - * @param message Message message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.JobNotification.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobNotification.Message.verify|verify} messages. - * @param message Message message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.JobNotification.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Message message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.JobNotification.Message; - - /** - * Decodes a Message message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.JobNotification.Message; - - /** - * Verifies a Message message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Message message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Message - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.JobNotification.Message; - - /** - * Creates a plain object from a Message message. Also converts values to other types if specified. - * @param message Message - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.JobNotification.Message, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Message to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Message - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - JOB_STATE_CHANGED = 1, - TASK_STATE_CHANGED = 2 - } - } - - /** Properties of an AllocationPolicy. */ - interface IAllocationPolicy { - - /** AllocationPolicy location */ - location?: (google.cloud.batch.v1.AllocationPolicy.ILocationPolicy|null); - - /** AllocationPolicy instances */ - instances?: (google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate[]|null); - - /** AllocationPolicy serviceAccount */ - serviceAccount?: (google.cloud.batch.v1.IServiceAccount|null); - - /** AllocationPolicy labels */ - labels?: ({ [k: string]: string }|null); - - /** AllocationPolicy network */ - network?: (google.cloud.batch.v1.AllocationPolicy.INetworkPolicy|null); - - /** AllocationPolicy placement */ - placement?: (google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy|null); - - /** AllocationPolicy tags */ - tags?: (string[]|null); - } - - /** Represents an AllocationPolicy. */ - class AllocationPolicy implements IAllocationPolicy { - - /** - * Constructs a new AllocationPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IAllocationPolicy); - - /** AllocationPolicy location. */ - public location?: (google.cloud.batch.v1.AllocationPolicy.ILocationPolicy|null); - - /** AllocationPolicy instances. */ - public instances: google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate[]; - - /** AllocationPolicy serviceAccount. */ - public serviceAccount?: (google.cloud.batch.v1.IServiceAccount|null); - - /** AllocationPolicy labels. */ - public labels: { [k: string]: string }; - - /** AllocationPolicy network. */ - public network?: (google.cloud.batch.v1.AllocationPolicy.INetworkPolicy|null); - - /** AllocationPolicy placement. */ - public placement?: (google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy|null); - - /** AllocationPolicy tags. */ - public tags: string[]; - - /** - * Creates a new AllocationPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns AllocationPolicy instance - */ - public static create(properties?: google.cloud.batch.v1.IAllocationPolicy): google.cloud.batch.v1.AllocationPolicy; - - /** - * Encodes the specified AllocationPolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.verify|verify} messages. - * @param message AllocationPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IAllocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AllocationPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.verify|verify} messages. - * @param message AllocationPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IAllocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AllocationPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AllocationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy; - - /** - * Decodes an AllocationPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AllocationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy; - - /** - * Verifies an AllocationPolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AllocationPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AllocationPolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy; - - /** - * Creates a plain object from an AllocationPolicy message. Also converts values to other types if specified. - * @param message AllocationPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.AllocationPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AllocationPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AllocationPolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AllocationPolicy { - - /** Properties of a LocationPolicy. */ - interface ILocationPolicy { - - /** LocationPolicy allowedLocations */ - allowedLocations?: (string[]|null); - } - - /** Represents a LocationPolicy. */ - class LocationPolicy implements ILocationPolicy { - - /** - * Constructs a new LocationPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.AllocationPolicy.ILocationPolicy); - - /** LocationPolicy allowedLocations. */ - public allowedLocations: string[]; - - /** - * Creates a new LocationPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns LocationPolicy instance - */ - public static create(properties?: google.cloud.batch.v1.AllocationPolicy.ILocationPolicy): google.cloud.batch.v1.AllocationPolicy.LocationPolicy; - - /** - * Encodes the specified LocationPolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.LocationPolicy.verify|verify} messages. - * @param message LocationPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.AllocationPolicy.ILocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LocationPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.LocationPolicy.verify|verify} messages. - * @param message LocationPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.AllocationPolicy.ILocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LocationPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LocationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy.LocationPolicy; - - /** - * Decodes a LocationPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LocationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy.LocationPolicy; - - /** - * Verifies a LocationPolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LocationPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LocationPolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy.LocationPolicy; - - /** - * Creates a plain object from a LocationPolicy message. Also converts values to other types if specified. - * @param message LocationPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.AllocationPolicy.LocationPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LocationPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LocationPolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Disk. */ - interface IDisk { - - /** Disk image */ - image?: (string|null); - - /** Disk snapshot */ - snapshot?: (string|null); - - /** Disk type */ - type?: (string|null); - - /** Disk sizeGb */ - sizeGb?: (number|Long|string|null); - - /** Disk diskInterface */ - diskInterface?: (string|null); - } - - /** Represents a Disk. */ - class Disk implements IDisk { - - /** - * Constructs a new Disk. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.AllocationPolicy.IDisk); - - /** Disk image. */ - public image?: (string|null); - - /** Disk snapshot. */ - public snapshot?: (string|null); - - /** Disk type. */ - public type: string; - - /** Disk sizeGb. */ - public sizeGb: (number|Long|string); - - /** Disk diskInterface. */ - public diskInterface: string; - - /** Disk dataSource. */ - public dataSource?: ("image"|"snapshot"); - - /** - * Creates a new Disk instance using the specified properties. - * @param [properties] Properties to set - * @returns Disk instance - */ - public static create(properties?: google.cloud.batch.v1.AllocationPolicy.IDisk): google.cloud.batch.v1.AllocationPolicy.Disk; - - /** - * Encodes the specified Disk message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.Disk.verify|verify} messages. - * @param message Disk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.AllocationPolicy.IDisk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Disk message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.Disk.verify|verify} messages. - * @param message Disk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.AllocationPolicy.IDisk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Disk message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Disk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy.Disk; - - /** - * Decodes a Disk message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Disk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy.Disk; - - /** - * Verifies a Disk message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Disk message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Disk - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy.Disk; - - /** - * Creates a plain object from a Disk message. Also converts values to other types if specified. - * @param message Disk - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.AllocationPolicy.Disk, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Disk to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Disk - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AttachedDisk. */ - interface IAttachedDisk { - - /** AttachedDisk newDisk */ - newDisk?: (google.cloud.batch.v1.AllocationPolicy.IDisk|null); - - /** AttachedDisk existingDisk */ - existingDisk?: (string|null); - - /** AttachedDisk deviceName */ - deviceName?: (string|null); - } - - /** Represents an AttachedDisk. */ - class AttachedDisk implements IAttachedDisk { - - /** - * Constructs a new AttachedDisk. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.AllocationPolicy.IAttachedDisk); - - /** AttachedDisk newDisk. */ - public newDisk?: (google.cloud.batch.v1.AllocationPolicy.IDisk|null); - - /** AttachedDisk existingDisk. */ - public existingDisk?: (string|null); - - /** AttachedDisk deviceName. */ - public deviceName: string; - - /** AttachedDisk attached. */ - public attached?: ("newDisk"|"existingDisk"); - - /** - * Creates a new AttachedDisk instance using the specified properties. - * @param [properties] Properties to set - * @returns AttachedDisk instance - */ - public static create(properties?: google.cloud.batch.v1.AllocationPolicy.IAttachedDisk): google.cloud.batch.v1.AllocationPolicy.AttachedDisk; - - /** - * Encodes the specified AttachedDisk message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.AttachedDisk.verify|verify} messages. - * @param message AttachedDisk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.AllocationPolicy.IAttachedDisk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AttachedDisk message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.AttachedDisk.verify|verify} messages. - * @param message AttachedDisk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.AllocationPolicy.IAttachedDisk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AttachedDisk message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AttachedDisk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy.AttachedDisk; - - /** - * Decodes an AttachedDisk message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AttachedDisk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy.AttachedDisk; - - /** - * Verifies an AttachedDisk message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AttachedDisk message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AttachedDisk - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy.AttachedDisk; - - /** - * Creates a plain object from an AttachedDisk message. Also converts values to other types if specified. - * @param message AttachedDisk - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.AllocationPolicy.AttachedDisk, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AttachedDisk to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AttachedDisk - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Accelerator. */ - interface IAccelerator { - - /** Accelerator type */ - type?: (string|null); - - /** Accelerator count */ - count?: (number|Long|string|null); - - /** Accelerator installGpuDrivers */ - installGpuDrivers?: (boolean|null); - - /** Accelerator driverVersion */ - driverVersion?: (string|null); - } - - /** Represents an Accelerator. */ - class Accelerator implements IAccelerator { - - /** - * Constructs a new Accelerator. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.AllocationPolicy.IAccelerator); - - /** Accelerator type. */ - public type: string; - - /** Accelerator count. */ - public count: (number|Long|string); - - /** Accelerator installGpuDrivers. */ - public installGpuDrivers: boolean; - - /** Accelerator driverVersion. */ - public driverVersion: string; - - /** - * Creates a new Accelerator instance using the specified properties. - * @param [properties] Properties to set - * @returns Accelerator instance - */ - public static create(properties?: google.cloud.batch.v1.AllocationPolicy.IAccelerator): google.cloud.batch.v1.AllocationPolicy.Accelerator; - - /** - * Encodes the specified Accelerator message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.Accelerator.verify|verify} messages. - * @param message Accelerator message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.AllocationPolicy.IAccelerator, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Accelerator message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.Accelerator.verify|verify} messages. - * @param message Accelerator message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.AllocationPolicy.IAccelerator, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Accelerator message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Accelerator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy.Accelerator; - - /** - * Decodes an Accelerator message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Accelerator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy.Accelerator; - - /** - * Verifies an Accelerator message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Accelerator message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Accelerator - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy.Accelerator; - - /** - * Creates a plain object from an Accelerator message. Also converts values to other types if specified. - * @param message Accelerator - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.AllocationPolicy.Accelerator, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Accelerator to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Accelerator - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InstancePolicy. */ - interface IInstancePolicy { - - /** InstancePolicy machineType */ - machineType?: (string|null); - - /** InstancePolicy minCpuPlatform */ - minCpuPlatform?: (string|null); - - /** InstancePolicy provisioningModel */ - provisioningModel?: (google.cloud.batch.v1.AllocationPolicy.ProvisioningModel|keyof typeof google.cloud.batch.v1.AllocationPolicy.ProvisioningModel|null); - - /** InstancePolicy accelerators */ - accelerators?: (google.cloud.batch.v1.AllocationPolicy.IAccelerator[]|null); - - /** InstancePolicy bootDisk */ - bootDisk?: (google.cloud.batch.v1.AllocationPolicy.IDisk|null); - - /** InstancePolicy disks */ - disks?: (google.cloud.batch.v1.AllocationPolicy.IAttachedDisk[]|null); - - /** InstancePolicy reservation */ - reservation?: (string|null); - } - - /** Represents an InstancePolicy. */ - class InstancePolicy implements IInstancePolicy { - - /** - * Constructs a new InstancePolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.AllocationPolicy.IInstancePolicy); - - /** InstancePolicy machineType. */ - public machineType: string; - - /** InstancePolicy minCpuPlatform. */ - public minCpuPlatform: string; - - /** InstancePolicy provisioningModel. */ - public provisioningModel: (google.cloud.batch.v1.AllocationPolicy.ProvisioningModel|keyof typeof google.cloud.batch.v1.AllocationPolicy.ProvisioningModel); - - /** InstancePolicy accelerators. */ - public accelerators: google.cloud.batch.v1.AllocationPolicy.IAccelerator[]; - - /** InstancePolicy bootDisk. */ - public bootDisk?: (google.cloud.batch.v1.AllocationPolicy.IDisk|null); - - /** InstancePolicy disks. */ - public disks: google.cloud.batch.v1.AllocationPolicy.IAttachedDisk[]; - - /** InstancePolicy reservation. */ - public reservation: string; - - /** - * Creates a new InstancePolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns InstancePolicy instance - */ - public static create(properties?: google.cloud.batch.v1.AllocationPolicy.IInstancePolicy): google.cloud.batch.v1.AllocationPolicy.InstancePolicy; - - /** - * Encodes the specified InstancePolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.InstancePolicy.verify|verify} messages. - * @param message InstancePolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.AllocationPolicy.IInstancePolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InstancePolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.InstancePolicy.verify|verify} messages. - * @param message InstancePolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.AllocationPolicy.IInstancePolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InstancePolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InstancePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy.InstancePolicy; - - /** - * Decodes an InstancePolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InstancePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy.InstancePolicy; - - /** - * Verifies an InstancePolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InstancePolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InstancePolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy.InstancePolicy; - - /** - * Creates a plain object from an InstancePolicy message. Also converts values to other types if specified. - * @param message InstancePolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.AllocationPolicy.InstancePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InstancePolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InstancePolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InstancePolicyOrTemplate. */ - interface IInstancePolicyOrTemplate { - - /** InstancePolicyOrTemplate policy */ - policy?: (google.cloud.batch.v1.AllocationPolicy.IInstancePolicy|null); - - /** InstancePolicyOrTemplate instanceTemplate */ - instanceTemplate?: (string|null); - - /** InstancePolicyOrTemplate installGpuDrivers */ - installGpuDrivers?: (boolean|null); - - /** InstancePolicyOrTemplate installOpsAgent */ - installOpsAgent?: (boolean|null); - - /** InstancePolicyOrTemplate blockProjectSshKeys */ - blockProjectSshKeys?: (boolean|null); - } - - /** Represents an InstancePolicyOrTemplate. */ - class InstancePolicyOrTemplate implements IInstancePolicyOrTemplate { - - /** - * Constructs a new InstancePolicyOrTemplate. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate); - - /** InstancePolicyOrTemplate policy. */ - public policy?: (google.cloud.batch.v1.AllocationPolicy.IInstancePolicy|null); - - /** InstancePolicyOrTemplate instanceTemplate. */ - public instanceTemplate?: (string|null); - - /** InstancePolicyOrTemplate installGpuDrivers. */ - public installGpuDrivers: boolean; - - /** InstancePolicyOrTemplate installOpsAgent. */ - public installOpsAgent: boolean; - - /** InstancePolicyOrTemplate blockProjectSshKeys. */ - public blockProjectSshKeys: boolean; - - /** InstancePolicyOrTemplate policyTemplate. */ - public policyTemplate?: ("policy"|"instanceTemplate"); - - /** - * Creates a new InstancePolicyOrTemplate instance using the specified properties. - * @param [properties] Properties to set - * @returns InstancePolicyOrTemplate instance - */ - public static create(properties?: google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate): google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate; - - /** - * Encodes the specified InstancePolicyOrTemplate message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.verify|verify} messages. - * @param message InstancePolicyOrTemplate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InstancePolicyOrTemplate message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.verify|verify} messages. - * @param message InstancePolicyOrTemplate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InstancePolicyOrTemplate message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InstancePolicyOrTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate; - - /** - * Decodes an InstancePolicyOrTemplate message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InstancePolicyOrTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate; - - /** - * Verifies an InstancePolicyOrTemplate message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InstancePolicyOrTemplate message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InstancePolicyOrTemplate - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate; - - /** - * Creates a plain object from an InstancePolicyOrTemplate message. Also converts values to other types if specified. - * @param message InstancePolicyOrTemplate - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InstancePolicyOrTemplate to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InstancePolicyOrTemplate - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a NetworkInterface. */ - interface INetworkInterface { - - /** NetworkInterface network */ - network?: (string|null); - - /** NetworkInterface subnetwork */ - subnetwork?: (string|null); - - /** NetworkInterface noExternalIpAddress */ - noExternalIpAddress?: (boolean|null); - } - - /** Represents a NetworkInterface. */ - class NetworkInterface implements INetworkInterface { - - /** - * Constructs a new NetworkInterface. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.AllocationPolicy.INetworkInterface); - - /** NetworkInterface network. */ - public network: string; - - /** NetworkInterface subnetwork. */ - public subnetwork: string; - - /** NetworkInterface noExternalIpAddress. */ - public noExternalIpAddress: boolean; - - /** - * Creates a new NetworkInterface instance using the specified properties. - * @param [properties] Properties to set - * @returns NetworkInterface instance - */ - public static create(properties?: google.cloud.batch.v1.AllocationPolicy.INetworkInterface): google.cloud.batch.v1.AllocationPolicy.NetworkInterface; - - /** - * Encodes the specified NetworkInterface message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.NetworkInterface.verify|verify} messages. - * @param message NetworkInterface message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.AllocationPolicy.INetworkInterface, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NetworkInterface message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.NetworkInterface.verify|verify} messages. - * @param message NetworkInterface message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.AllocationPolicy.INetworkInterface, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NetworkInterface message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NetworkInterface - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy.NetworkInterface; - - /** - * Decodes a NetworkInterface message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NetworkInterface - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy.NetworkInterface; - - /** - * Verifies a NetworkInterface message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NetworkInterface message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NetworkInterface - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy.NetworkInterface; - - /** - * Creates a plain object from a NetworkInterface message. Also converts values to other types if specified. - * @param message NetworkInterface - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.AllocationPolicy.NetworkInterface, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NetworkInterface to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NetworkInterface - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a NetworkPolicy. */ - interface INetworkPolicy { - - /** NetworkPolicy networkInterfaces */ - networkInterfaces?: (google.cloud.batch.v1.AllocationPolicy.INetworkInterface[]|null); - } - - /** Represents a NetworkPolicy. */ - class NetworkPolicy implements INetworkPolicy { - - /** - * Constructs a new NetworkPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.AllocationPolicy.INetworkPolicy); - - /** NetworkPolicy networkInterfaces. */ - public networkInterfaces: google.cloud.batch.v1.AllocationPolicy.INetworkInterface[]; - - /** - * Creates a new NetworkPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns NetworkPolicy instance - */ - public static create(properties?: google.cloud.batch.v1.AllocationPolicy.INetworkPolicy): google.cloud.batch.v1.AllocationPolicy.NetworkPolicy; - - /** - * Encodes the specified NetworkPolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.verify|verify} messages. - * @param message NetworkPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.AllocationPolicy.INetworkPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NetworkPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.verify|verify} messages. - * @param message NetworkPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.AllocationPolicy.INetworkPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NetworkPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NetworkPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy.NetworkPolicy; - - /** - * Decodes a NetworkPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NetworkPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy.NetworkPolicy; - - /** - * Verifies a NetworkPolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NetworkPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NetworkPolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy.NetworkPolicy; - - /** - * Creates a plain object from a NetworkPolicy message. Also converts values to other types if specified. - * @param message NetworkPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.AllocationPolicy.NetworkPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NetworkPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NetworkPolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PlacementPolicy. */ - interface IPlacementPolicy { - - /** PlacementPolicy collocation */ - collocation?: (string|null); - - /** PlacementPolicy maxDistance */ - maxDistance?: (number|Long|string|null); - } - - /** Represents a PlacementPolicy. */ - class PlacementPolicy implements IPlacementPolicy { - - /** - * Constructs a new PlacementPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy); - - /** PlacementPolicy collocation. */ - public collocation: string; - - /** PlacementPolicy maxDistance. */ - public maxDistance: (number|Long|string); - - /** - * Creates a new PlacementPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns PlacementPolicy instance - */ - public static create(properties?: google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy): google.cloud.batch.v1.AllocationPolicy.PlacementPolicy; - - /** - * Encodes the specified PlacementPolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.verify|verify} messages. - * @param message PlacementPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PlacementPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.verify|verify} messages. - * @param message PlacementPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PlacementPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PlacementPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy.PlacementPolicy; - - /** - * Decodes a PlacementPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PlacementPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy.PlacementPolicy; - - /** - * Verifies a PlacementPolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PlacementPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PlacementPolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy.PlacementPolicy; - - /** - * Creates a plain object from a PlacementPolicy message. Also converts values to other types if specified. - * @param message PlacementPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.AllocationPolicy.PlacementPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PlacementPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PlacementPolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** ProvisioningModel enum. */ - enum ProvisioningModel { - PROVISIONING_MODEL_UNSPECIFIED = 0, - STANDARD = 1, - SPOT = 2, - PREEMPTIBLE = 3 - } - } - - /** Properties of a TaskGroup. */ - interface ITaskGroup { - - /** TaskGroup name */ - name?: (string|null); - - /** TaskGroup taskSpec */ - taskSpec?: (google.cloud.batch.v1.ITaskSpec|null); - - /** TaskGroup taskCount */ - taskCount?: (number|Long|string|null); - - /** TaskGroup parallelism */ - parallelism?: (number|Long|string|null); - - /** TaskGroup schedulingPolicy */ - schedulingPolicy?: (google.cloud.batch.v1.TaskGroup.SchedulingPolicy|keyof typeof google.cloud.batch.v1.TaskGroup.SchedulingPolicy|null); - - /** TaskGroup taskEnvironments */ - taskEnvironments?: (google.cloud.batch.v1.IEnvironment[]|null); - - /** TaskGroup taskCountPerNode */ - taskCountPerNode?: (number|Long|string|null); - - /** TaskGroup requireHostsFile */ - requireHostsFile?: (boolean|null); - - /** TaskGroup permissiveSsh */ - permissiveSsh?: (boolean|null); - - /** TaskGroup runAsNonRoot */ - runAsNonRoot?: (boolean|null); - } - - /** Represents a TaskGroup. */ - class TaskGroup implements ITaskGroup { - - /** - * Constructs a new TaskGroup. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.ITaskGroup); - - /** TaskGroup name. */ - public name: string; - - /** TaskGroup taskSpec. */ - public taskSpec?: (google.cloud.batch.v1.ITaskSpec|null); - - /** TaskGroup taskCount. */ - public taskCount: (number|Long|string); - - /** TaskGroup parallelism. */ - public parallelism: (number|Long|string); - - /** TaskGroup schedulingPolicy. */ - public schedulingPolicy: (google.cloud.batch.v1.TaskGroup.SchedulingPolicy|keyof typeof google.cloud.batch.v1.TaskGroup.SchedulingPolicy); - - /** TaskGroup taskEnvironments. */ - public taskEnvironments: google.cloud.batch.v1.IEnvironment[]; - - /** TaskGroup taskCountPerNode. */ - public taskCountPerNode: (number|Long|string); - - /** TaskGroup requireHostsFile. */ - public requireHostsFile: boolean; - - /** TaskGroup permissiveSsh. */ - public permissiveSsh: boolean; - - /** TaskGroup runAsNonRoot. */ - public runAsNonRoot: boolean; - - /** - * Creates a new TaskGroup instance using the specified properties. - * @param [properties] Properties to set - * @returns TaskGroup instance - */ - public static create(properties?: google.cloud.batch.v1.ITaskGroup): google.cloud.batch.v1.TaskGroup; - - /** - * Encodes the specified TaskGroup message. Does not implicitly {@link google.cloud.batch.v1.TaskGroup.verify|verify} messages. - * @param message TaskGroup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.ITaskGroup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TaskGroup message, length delimited. Does not implicitly {@link google.cloud.batch.v1.TaskGroup.verify|verify} messages. - * @param message TaskGroup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.ITaskGroup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TaskGroup message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TaskGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.TaskGroup; - - /** - * Decodes a TaskGroup message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TaskGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.TaskGroup; - - /** - * Verifies a TaskGroup message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TaskGroup message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TaskGroup - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.TaskGroup; - - /** - * Creates a plain object from a TaskGroup message. Also converts values to other types if specified. - * @param message TaskGroup - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.TaskGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TaskGroup to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TaskGroup - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace TaskGroup { - - /** SchedulingPolicy enum. */ - enum SchedulingPolicy { - SCHEDULING_POLICY_UNSPECIFIED = 0, - AS_SOON_AS_POSSIBLE = 1, - IN_ORDER = 2 - } - } - - /** Properties of a ServiceAccount. */ - interface IServiceAccount { - - /** ServiceAccount email */ - email?: (string|null); - - /** ServiceAccount scopes */ - scopes?: (string[]|null); - } - - /** Represents a ServiceAccount. */ - class ServiceAccount implements IServiceAccount { - - /** - * Constructs a new ServiceAccount. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IServiceAccount); - - /** ServiceAccount email. */ - public email: string; - - /** ServiceAccount scopes. */ - public scopes: string[]; - - /** - * Creates a new ServiceAccount instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceAccount instance - */ - public static create(properties?: google.cloud.batch.v1.IServiceAccount): google.cloud.batch.v1.ServiceAccount; - - /** - * Encodes the specified ServiceAccount message. Does not implicitly {@link google.cloud.batch.v1.ServiceAccount.verify|verify} messages. - * @param message ServiceAccount message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IServiceAccount, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceAccount message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ServiceAccount.verify|verify} messages. - * @param message ServiceAccount message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IServiceAccount, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceAccount message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.ServiceAccount; - - /** - * Decodes a ServiceAccount message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.ServiceAccount; - - /** - * Verifies a ServiceAccount message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceAccount message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceAccount - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.ServiceAccount; - - /** - * Creates a plain object from a ServiceAccount message. Also converts values to other types if specified. - * @param message ServiceAccount - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.ServiceAccount, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceAccount to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceAccount - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ComputeResource. */ - interface IComputeResource { - - /** ComputeResource cpuMilli */ - cpuMilli?: (number|Long|string|null); - - /** ComputeResource memoryMib */ - memoryMib?: (number|Long|string|null); - - /** ComputeResource bootDiskMib */ - bootDiskMib?: (number|Long|string|null); - } - - /** Represents a ComputeResource. */ - class ComputeResource implements IComputeResource { - - /** - * Constructs a new ComputeResource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IComputeResource); - - /** ComputeResource cpuMilli. */ - public cpuMilli: (number|Long|string); - - /** ComputeResource memoryMib. */ - public memoryMib: (number|Long|string); - - /** ComputeResource bootDiskMib. */ - public bootDiskMib: (number|Long|string); - - /** - * Creates a new ComputeResource instance using the specified properties. - * @param [properties] Properties to set - * @returns ComputeResource instance - */ - public static create(properties?: google.cloud.batch.v1.IComputeResource): google.cloud.batch.v1.ComputeResource; - - /** - * Encodes the specified ComputeResource message. Does not implicitly {@link google.cloud.batch.v1.ComputeResource.verify|verify} messages. - * @param message ComputeResource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IComputeResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ComputeResource message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ComputeResource.verify|verify} messages. - * @param message ComputeResource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IComputeResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ComputeResource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ComputeResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.ComputeResource; - - /** - * Decodes a ComputeResource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ComputeResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.ComputeResource; - - /** - * Verifies a ComputeResource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ComputeResource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ComputeResource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.ComputeResource; - - /** - * Creates a plain object from a ComputeResource message. Also converts values to other types if specified. - * @param message ComputeResource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.ComputeResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ComputeResource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ComputeResource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a StatusEvent. */ - interface IStatusEvent { - - /** StatusEvent type */ - type?: (string|null); - - /** StatusEvent description */ - description?: (string|null); - - /** StatusEvent eventTime */ - eventTime?: (google.protobuf.ITimestamp|null); - - /** StatusEvent taskExecution */ - taskExecution?: (google.cloud.batch.v1.ITaskExecution|null); - - /** StatusEvent taskState */ - taskState?: (google.cloud.batch.v1.TaskStatus.State|keyof typeof google.cloud.batch.v1.TaskStatus.State|null); - } - - /** Represents a StatusEvent. */ - class StatusEvent implements IStatusEvent { - - /** - * Constructs a new StatusEvent. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IStatusEvent); - - /** StatusEvent type. */ - public type: string; - - /** StatusEvent description. */ - public description: string; - - /** StatusEvent eventTime. */ - public eventTime?: (google.protobuf.ITimestamp|null); - - /** StatusEvent taskExecution. */ - public taskExecution?: (google.cloud.batch.v1.ITaskExecution|null); - - /** StatusEvent taskState. */ - public taskState: (google.cloud.batch.v1.TaskStatus.State|keyof typeof google.cloud.batch.v1.TaskStatus.State); - - /** - * Creates a new StatusEvent instance using the specified properties. - * @param [properties] Properties to set - * @returns StatusEvent instance - */ - public static create(properties?: google.cloud.batch.v1.IStatusEvent): google.cloud.batch.v1.StatusEvent; - - /** - * Encodes the specified StatusEvent message. Does not implicitly {@link google.cloud.batch.v1.StatusEvent.verify|verify} messages. - * @param message StatusEvent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IStatusEvent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StatusEvent message, length delimited. Does not implicitly {@link google.cloud.batch.v1.StatusEvent.verify|verify} messages. - * @param message StatusEvent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IStatusEvent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StatusEvent message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StatusEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.StatusEvent; - - /** - * Decodes a StatusEvent message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StatusEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.StatusEvent; - - /** - * Verifies a StatusEvent message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StatusEvent message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StatusEvent - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.StatusEvent; - - /** - * Creates a plain object from a StatusEvent message. Also converts values to other types if specified. - * @param message StatusEvent - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.StatusEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StatusEvent to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StatusEvent - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TaskExecution. */ - interface ITaskExecution { - - /** TaskExecution exitCode */ - exitCode?: (number|null); - } - - /** Represents a TaskExecution. */ - class TaskExecution implements ITaskExecution { - - /** - * Constructs a new TaskExecution. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.ITaskExecution); - - /** TaskExecution exitCode. */ - public exitCode: number; - - /** - * Creates a new TaskExecution instance using the specified properties. - * @param [properties] Properties to set - * @returns TaskExecution instance - */ - public static create(properties?: google.cloud.batch.v1.ITaskExecution): google.cloud.batch.v1.TaskExecution; - - /** - * Encodes the specified TaskExecution message. Does not implicitly {@link google.cloud.batch.v1.TaskExecution.verify|verify} messages. - * @param message TaskExecution message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.ITaskExecution, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TaskExecution message, length delimited. Does not implicitly {@link google.cloud.batch.v1.TaskExecution.verify|verify} messages. - * @param message TaskExecution message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.ITaskExecution, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TaskExecution message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TaskExecution - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.TaskExecution; - - /** - * Decodes a TaskExecution message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TaskExecution - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.TaskExecution; - - /** - * Verifies a TaskExecution message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TaskExecution message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TaskExecution - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.TaskExecution; - - /** - * Creates a plain object from a TaskExecution message. Also converts values to other types if specified. - * @param message TaskExecution - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.TaskExecution, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TaskExecution to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TaskExecution - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TaskStatus. */ - interface ITaskStatus { - - /** TaskStatus state */ - state?: (google.cloud.batch.v1.TaskStatus.State|keyof typeof google.cloud.batch.v1.TaskStatus.State|null); - - /** TaskStatus statusEvents */ - statusEvents?: (google.cloud.batch.v1.IStatusEvent[]|null); - } - - /** Represents a TaskStatus. */ - class TaskStatus implements ITaskStatus { - - /** - * Constructs a new TaskStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.ITaskStatus); - - /** TaskStatus state. */ - public state: (google.cloud.batch.v1.TaskStatus.State|keyof typeof google.cloud.batch.v1.TaskStatus.State); - - /** TaskStatus statusEvents. */ - public statusEvents: google.cloud.batch.v1.IStatusEvent[]; - - /** - * Creates a new TaskStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns TaskStatus instance - */ - public static create(properties?: google.cloud.batch.v1.ITaskStatus): google.cloud.batch.v1.TaskStatus; - - /** - * Encodes the specified TaskStatus message. Does not implicitly {@link google.cloud.batch.v1.TaskStatus.verify|verify} messages. - * @param message TaskStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.ITaskStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TaskStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1.TaskStatus.verify|verify} messages. - * @param message TaskStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.ITaskStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TaskStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TaskStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.TaskStatus; - - /** - * Decodes a TaskStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TaskStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.TaskStatus; - - /** - * Verifies a TaskStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TaskStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TaskStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.TaskStatus; - - /** - * Creates a plain object from a TaskStatus message. Also converts values to other types if specified. - * @param message TaskStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.TaskStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TaskStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TaskStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace TaskStatus { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - PENDING = 1, - ASSIGNED = 2, - RUNNING = 3, - FAILED = 4, - SUCCEEDED = 5, - UNEXECUTED = 6 - } - } - - /** Properties of a Runnable. */ - interface IRunnable { - - /** Runnable container */ - container?: (google.cloud.batch.v1.Runnable.IContainer|null); - - /** Runnable script */ - script?: (google.cloud.batch.v1.Runnable.IScript|null); - - /** Runnable barrier */ - barrier?: (google.cloud.batch.v1.Runnable.IBarrier|null); - - /** Runnable displayName */ - displayName?: (string|null); - - /** Runnable ignoreExitStatus */ - ignoreExitStatus?: (boolean|null); - - /** Runnable background */ - background?: (boolean|null); - - /** Runnable alwaysRun */ - alwaysRun?: (boolean|null); - - /** Runnable environment */ - environment?: (google.cloud.batch.v1.IEnvironment|null); - - /** Runnable timeout */ - timeout?: (google.protobuf.IDuration|null); - - /** Runnable labels */ - labels?: ({ [k: string]: string }|null); - } - - /** Represents a Runnable. */ - class Runnable implements IRunnable { - - /** - * Constructs a new Runnable. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IRunnable); - - /** Runnable container. */ - public container?: (google.cloud.batch.v1.Runnable.IContainer|null); - - /** Runnable script. */ - public script?: (google.cloud.batch.v1.Runnable.IScript|null); - - /** Runnable barrier. */ - public barrier?: (google.cloud.batch.v1.Runnable.IBarrier|null); - - /** Runnable displayName. */ - public displayName: string; - - /** Runnable ignoreExitStatus. */ - public ignoreExitStatus: boolean; - - /** Runnable background. */ - public background: boolean; - - /** Runnable alwaysRun. */ - public alwaysRun: boolean; - - /** Runnable environment. */ - public environment?: (google.cloud.batch.v1.IEnvironment|null); - - /** Runnable timeout. */ - public timeout?: (google.protobuf.IDuration|null); - - /** Runnable labels. */ - public labels: { [k: string]: string }; - - /** Runnable executable. */ - public executable?: ("container"|"script"|"barrier"); - - /** - * Creates a new Runnable instance using the specified properties. - * @param [properties] Properties to set - * @returns Runnable instance - */ - public static create(properties?: google.cloud.batch.v1.IRunnable): google.cloud.batch.v1.Runnable; - - /** - * Encodes the specified Runnable message. Does not implicitly {@link google.cloud.batch.v1.Runnable.verify|verify} messages. - * @param message Runnable message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IRunnable, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Runnable message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Runnable.verify|verify} messages. - * @param message Runnable message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IRunnable, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Runnable message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Runnable - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.Runnable; - - /** - * Decodes a Runnable message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Runnable - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.Runnable; - - /** - * Verifies a Runnable message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Runnable message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Runnable - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.Runnable; - - /** - * Creates a plain object from a Runnable message. Also converts values to other types if specified. - * @param message Runnable - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.Runnable, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Runnable to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Runnable - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Runnable { - - /** Properties of a Container. */ - interface IContainer { - - /** Container imageUri */ - imageUri?: (string|null); - - /** Container commands */ - commands?: (string[]|null); - - /** Container entrypoint */ - entrypoint?: (string|null); - - /** Container volumes */ - volumes?: (string[]|null); - - /** Container options */ - options?: (string|null); - - /** Container blockExternalNetwork */ - blockExternalNetwork?: (boolean|null); - - /** Container username */ - username?: (string|null); - - /** Container password */ - password?: (string|null); - - /** Container enableImageStreaming */ - enableImageStreaming?: (boolean|null); - } - - /** Represents a Container. */ - class Container implements IContainer { - - /** - * Constructs a new Container. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.Runnable.IContainer); - - /** Container imageUri. */ - public imageUri: string; - - /** Container commands. */ - public commands: string[]; - - /** Container entrypoint. */ - public entrypoint: string; - - /** Container volumes. */ - public volumes: string[]; - - /** Container options. */ - public options: string; - - /** Container blockExternalNetwork. */ - public blockExternalNetwork: boolean; - - /** Container username. */ - public username: string; - - /** Container password. */ - public password: string; - - /** Container enableImageStreaming. */ - public enableImageStreaming: boolean; - - /** - * Creates a new Container instance using the specified properties. - * @param [properties] Properties to set - * @returns Container instance - */ - public static create(properties?: google.cloud.batch.v1.Runnable.IContainer): google.cloud.batch.v1.Runnable.Container; - - /** - * Encodes the specified Container message. Does not implicitly {@link google.cloud.batch.v1.Runnable.Container.verify|verify} messages. - * @param message Container message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.Runnable.IContainer, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Container message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Runnable.Container.verify|verify} messages. - * @param message Container message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.Runnable.IContainer, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Container message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Container - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.Runnable.Container; - - /** - * Decodes a Container message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Container - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.Runnable.Container; - - /** - * Verifies a Container message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Container message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Container - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.Runnable.Container; - - /** - * Creates a plain object from a Container message. Also converts values to other types if specified. - * @param message Container - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.Runnable.Container, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Container to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Container - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Script. */ - interface IScript { - - /** Script path */ - path?: (string|null); - - /** Script text */ - text?: (string|null); - } - - /** Represents a Script. */ - class Script implements IScript { - - /** - * Constructs a new Script. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.Runnable.IScript); - - /** Script path. */ - public path?: (string|null); - - /** Script text. */ - public text?: (string|null); - - /** Script command. */ - public command?: ("path"|"text"); - - /** - * Creates a new Script instance using the specified properties. - * @param [properties] Properties to set - * @returns Script instance - */ - public static create(properties?: google.cloud.batch.v1.Runnable.IScript): google.cloud.batch.v1.Runnable.Script; - - /** - * Encodes the specified Script message. Does not implicitly {@link google.cloud.batch.v1.Runnable.Script.verify|verify} messages. - * @param message Script message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.Runnable.IScript, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Script message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Runnable.Script.verify|verify} messages. - * @param message Script message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.Runnable.IScript, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Script message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Script - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.Runnable.Script; - - /** - * Decodes a Script message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Script - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.Runnable.Script; - - /** - * Verifies a Script message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Script message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Script - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.Runnable.Script; - - /** - * Creates a plain object from a Script message. Also converts values to other types if specified. - * @param message Script - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.Runnable.Script, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Script to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Script - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Barrier. */ - interface IBarrier { - - /** Barrier name */ - name?: (string|null); - } - - /** Represents a Barrier. */ - class Barrier implements IBarrier { - - /** - * Constructs a new Barrier. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.Runnable.IBarrier); - - /** Barrier name. */ - public name: string; - - /** - * Creates a new Barrier instance using the specified properties. - * @param [properties] Properties to set - * @returns Barrier instance - */ - public static create(properties?: google.cloud.batch.v1.Runnable.IBarrier): google.cloud.batch.v1.Runnable.Barrier; - - /** - * Encodes the specified Barrier message. Does not implicitly {@link google.cloud.batch.v1.Runnable.Barrier.verify|verify} messages. - * @param message Barrier message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.Runnable.IBarrier, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Barrier message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Runnable.Barrier.verify|verify} messages. - * @param message Barrier message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.Runnable.IBarrier, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Barrier message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Barrier - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.Runnable.Barrier; - - /** - * Decodes a Barrier message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Barrier - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.Runnable.Barrier; - - /** - * Verifies a Barrier message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Barrier message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Barrier - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.Runnable.Barrier; - - /** - * Creates a plain object from a Barrier message. Also converts values to other types if specified. - * @param message Barrier - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.Runnable.Barrier, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Barrier to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Barrier - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a TaskSpec. */ - interface ITaskSpec { - - /** TaskSpec runnables */ - runnables?: (google.cloud.batch.v1.IRunnable[]|null); - - /** TaskSpec computeResource */ - computeResource?: (google.cloud.batch.v1.IComputeResource|null); - - /** TaskSpec maxRunDuration */ - maxRunDuration?: (google.protobuf.IDuration|null); - - /** TaskSpec maxRetryCount */ - maxRetryCount?: (number|null); - - /** TaskSpec lifecyclePolicies */ - lifecyclePolicies?: (google.cloud.batch.v1.ILifecyclePolicy[]|null); - - /** TaskSpec environments */ - environments?: ({ [k: string]: string }|null); - - /** TaskSpec volumes */ - volumes?: (google.cloud.batch.v1.IVolume[]|null); - - /** TaskSpec environment */ - environment?: (google.cloud.batch.v1.IEnvironment|null); - } - - /** Represents a TaskSpec. */ - class TaskSpec implements ITaskSpec { - - /** - * Constructs a new TaskSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.ITaskSpec); - - /** TaskSpec runnables. */ - public runnables: google.cloud.batch.v1.IRunnable[]; - - /** TaskSpec computeResource. */ - public computeResource?: (google.cloud.batch.v1.IComputeResource|null); - - /** TaskSpec maxRunDuration. */ - public maxRunDuration?: (google.protobuf.IDuration|null); - - /** TaskSpec maxRetryCount. */ - public maxRetryCount: number; - - /** TaskSpec lifecyclePolicies. */ - public lifecyclePolicies: google.cloud.batch.v1.ILifecyclePolicy[]; - - /** TaskSpec environments. */ - public environments: { [k: string]: string }; - - /** TaskSpec volumes. */ - public volumes: google.cloud.batch.v1.IVolume[]; - - /** TaskSpec environment. */ - public environment?: (google.cloud.batch.v1.IEnvironment|null); - - /** - * Creates a new TaskSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns TaskSpec instance - */ - public static create(properties?: google.cloud.batch.v1.ITaskSpec): google.cloud.batch.v1.TaskSpec; - - /** - * Encodes the specified TaskSpec message. Does not implicitly {@link google.cloud.batch.v1.TaskSpec.verify|verify} messages. - * @param message TaskSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.ITaskSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TaskSpec message, length delimited. Does not implicitly {@link google.cloud.batch.v1.TaskSpec.verify|verify} messages. - * @param message TaskSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.ITaskSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TaskSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TaskSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.TaskSpec; - - /** - * Decodes a TaskSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TaskSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.TaskSpec; - - /** - * Verifies a TaskSpec message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TaskSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TaskSpec - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.TaskSpec; - - /** - * Creates a plain object from a TaskSpec message. Also converts values to other types if specified. - * @param message TaskSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.TaskSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TaskSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TaskSpec - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a LifecyclePolicy. */ - interface ILifecyclePolicy { - - /** LifecyclePolicy action */ - action?: (google.cloud.batch.v1.LifecyclePolicy.Action|keyof typeof google.cloud.batch.v1.LifecyclePolicy.Action|null); - - /** LifecyclePolicy actionCondition */ - actionCondition?: (google.cloud.batch.v1.LifecyclePolicy.IActionCondition|null); - } - - /** Represents a LifecyclePolicy. */ - class LifecyclePolicy implements ILifecyclePolicy { - - /** - * Constructs a new LifecyclePolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.ILifecyclePolicy); - - /** LifecyclePolicy action. */ - public action: (google.cloud.batch.v1.LifecyclePolicy.Action|keyof typeof google.cloud.batch.v1.LifecyclePolicy.Action); - - /** LifecyclePolicy actionCondition. */ - public actionCondition?: (google.cloud.batch.v1.LifecyclePolicy.IActionCondition|null); - - /** - * Creates a new LifecyclePolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns LifecyclePolicy instance - */ - public static create(properties?: google.cloud.batch.v1.ILifecyclePolicy): google.cloud.batch.v1.LifecyclePolicy; - - /** - * Encodes the specified LifecyclePolicy message. Does not implicitly {@link google.cloud.batch.v1.LifecyclePolicy.verify|verify} messages. - * @param message LifecyclePolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.ILifecyclePolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LifecyclePolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.LifecyclePolicy.verify|verify} messages. - * @param message LifecyclePolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.ILifecyclePolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LifecyclePolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LifecyclePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.LifecyclePolicy; - - /** - * Decodes a LifecyclePolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LifecyclePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.LifecyclePolicy; - - /** - * Verifies a LifecyclePolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LifecyclePolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LifecyclePolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.LifecyclePolicy; - - /** - * Creates a plain object from a LifecyclePolicy message. Also converts values to other types if specified. - * @param message LifecyclePolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.LifecyclePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LifecyclePolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LifecyclePolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace LifecyclePolicy { - - /** Properties of an ActionCondition. */ - interface IActionCondition { - - /** ActionCondition exitCodes */ - exitCodes?: (number[]|null); - } - - /** Represents an ActionCondition. */ - class ActionCondition implements IActionCondition { - - /** - * Constructs a new ActionCondition. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.LifecyclePolicy.IActionCondition); - - /** ActionCondition exitCodes. */ - public exitCodes: number[]; - - /** - * Creates a new ActionCondition instance using the specified properties. - * @param [properties] Properties to set - * @returns ActionCondition instance - */ - public static create(properties?: google.cloud.batch.v1.LifecyclePolicy.IActionCondition): google.cloud.batch.v1.LifecyclePolicy.ActionCondition; - - /** - * Encodes the specified ActionCondition message. Does not implicitly {@link google.cloud.batch.v1.LifecyclePolicy.ActionCondition.verify|verify} messages. - * @param message ActionCondition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.LifecyclePolicy.IActionCondition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ActionCondition message, length delimited. Does not implicitly {@link google.cloud.batch.v1.LifecyclePolicy.ActionCondition.verify|verify} messages. - * @param message ActionCondition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.LifecyclePolicy.IActionCondition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ActionCondition message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ActionCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.LifecyclePolicy.ActionCondition; - - /** - * Decodes an ActionCondition message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ActionCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.LifecyclePolicy.ActionCondition; - - /** - * Verifies an ActionCondition message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ActionCondition message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ActionCondition - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.LifecyclePolicy.ActionCondition; - - /** - * Creates a plain object from an ActionCondition message. Also converts values to other types if specified. - * @param message ActionCondition - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.LifecyclePolicy.ActionCondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ActionCondition to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ActionCondition - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Action enum. */ - enum Action { - ACTION_UNSPECIFIED = 0, - RETRY_TASK = 1, - FAIL_TASK = 2 - } - } - - /** Properties of a Task. */ - interface ITask { - - /** Task name */ - name?: (string|null); - - /** Task status */ - status?: (google.cloud.batch.v1.ITaskStatus|null); - } - - /** Represents a Task. */ - class Task implements ITask { - - /** - * Constructs a new Task. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.ITask); - - /** Task name. */ - public name: string; - - /** Task status. */ - public status?: (google.cloud.batch.v1.ITaskStatus|null); - - /** - * Creates a new Task instance using the specified properties. - * @param [properties] Properties to set - * @returns Task instance - */ - public static create(properties?: google.cloud.batch.v1.ITask): google.cloud.batch.v1.Task; - - /** - * Encodes the specified Task message. Does not implicitly {@link google.cloud.batch.v1.Task.verify|verify} messages. - * @param message Task message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.ITask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Task message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Task.verify|verify} messages. - * @param message Task message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.ITask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Task message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Task - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.Task; - - /** - * Decodes a Task message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Task - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.Task; - - /** - * Verifies a Task message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Task message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Task - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.Task; - - /** - * Creates a plain object from a Task message. Also converts values to other types if specified. - * @param message Task - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.Task, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Task to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Task - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Environment. */ - interface IEnvironment { - - /** Environment variables */ - variables?: ({ [k: string]: string }|null); - - /** Environment secretVariables */ - secretVariables?: ({ [k: string]: string }|null); - - /** Environment encryptedVariables */ - encryptedVariables?: (google.cloud.batch.v1.Environment.IKMSEnvMap|null); - } - - /** Represents an Environment. */ - class Environment implements IEnvironment { - - /** - * Constructs a new Environment. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IEnvironment); - - /** Environment variables. */ - public variables: { [k: string]: string }; - - /** Environment secretVariables. */ - public secretVariables: { [k: string]: string }; - - /** Environment encryptedVariables. */ - public encryptedVariables?: (google.cloud.batch.v1.Environment.IKMSEnvMap|null); - - /** - * Creates a new Environment instance using the specified properties. - * @param [properties] Properties to set - * @returns Environment instance - */ - public static create(properties?: google.cloud.batch.v1.IEnvironment): google.cloud.batch.v1.Environment; - - /** - * Encodes the specified Environment message. Does not implicitly {@link google.cloud.batch.v1.Environment.verify|verify} messages. - * @param message Environment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Environment.verify|verify} messages. - * @param message Environment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Environment message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Environment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.Environment; - - /** - * Decodes an Environment message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Environment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.Environment; - - /** - * Verifies an Environment message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Environment message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Environment - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.Environment; - - /** - * Creates a plain object from an Environment message. Also converts values to other types if specified. - * @param message Environment - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.Environment, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Environment to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Environment - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Environment { - - /** Properties of a KMSEnvMap. */ - interface IKMSEnvMap { - - /** KMSEnvMap keyName */ - keyName?: (string|null); - - /** KMSEnvMap cipherText */ - cipherText?: (string|null); - } - - /** Represents a KMSEnvMap. */ - class KMSEnvMap implements IKMSEnvMap { - - /** - * Constructs a new KMSEnvMap. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.Environment.IKMSEnvMap); - - /** KMSEnvMap keyName. */ - public keyName: string; - - /** KMSEnvMap cipherText. */ - public cipherText: string; - - /** - * Creates a new KMSEnvMap instance using the specified properties. - * @param [properties] Properties to set - * @returns KMSEnvMap instance - */ - public static create(properties?: google.cloud.batch.v1.Environment.IKMSEnvMap): google.cloud.batch.v1.Environment.KMSEnvMap; - - /** - * Encodes the specified KMSEnvMap message. Does not implicitly {@link google.cloud.batch.v1.Environment.KMSEnvMap.verify|verify} messages. - * @param message KMSEnvMap message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.Environment.IKMSEnvMap, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified KMSEnvMap message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Environment.KMSEnvMap.verify|verify} messages. - * @param message KMSEnvMap message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.Environment.IKMSEnvMap, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a KMSEnvMap message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns KMSEnvMap - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.Environment.KMSEnvMap; - - /** - * Decodes a KMSEnvMap message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns KMSEnvMap - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.Environment.KMSEnvMap; - - /** - * Verifies a KMSEnvMap message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a KMSEnvMap message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns KMSEnvMap - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.Environment.KMSEnvMap; - - /** - * Creates a plain object from a KMSEnvMap message. Also converts values to other types if specified. - * @param message KMSEnvMap - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.Environment.KMSEnvMap, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this KMSEnvMap to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for KMSEnvMap - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a Volume. */ - interface IVolume { - - /** Volume nfs */ - nfs?: (google.cloud.batch.v1.INFS|null); - - /** Volume gcs */ - gcs?: (google.cloud.batch.v1.IGCS|null); - - /** Volume deviceName */ - deviceName?: (string|null); - - /** Volume mountPath */ - mountPath?: (string|null); - - /** Volume mountOptions */ - mountOptions?: (string[]|null); - } - - /** Represents a Volume. */ - class Volume implements IVolume { - - /** - * Constructs a new Volume. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IVolume); - - /** Volume nfs. */ - public nfs?: (google.cloud.batch.v1.INFS|null); - - /** Volume gcs. */ - public gcs?: (google.cloud.batch.v1.IGCS|null); - - /** Volume deviceName. */ - public deviceName?: (string|null); - - /** Volume mountPath. */ - public mountPath: string; - - /** Volume mountOptions. */ - public mountOptions: string[]; - - /** Volume source. */ - public source?: ("nfs"|"gcs"|"deviceName"); - - /** - * Creates a new Volume instance using the specified properties. - * @param [properties] Properties to set - * @returns Volume instance - */ - public static create(properties?: google.cloud.batch.v1.IVolume): google.cloud.batch.v1.Volume; - - /** - * Encodes the specified Volume message. Does not implicitly {@link google.cloud.batch.v1.Volume.verify|verify} messages. - * @param message Volume message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IVolume, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Volume message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Volume.verify|verify} messages. - * @param message Volume message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IVolume, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Volume message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Volume - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.Volume; - - /** - * Decodes a Volume message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Volume - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.Volume; - - /** - * Verifies a Volume message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Volume message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Volume - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.Volume; - - /** - * Creates a plain object from a Volume message. Also converts values to other types if specified. - * @param message Volume - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.Volume, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Volume to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Volume - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a NFS. */ - interface INFS { - - /** NFS server */ - server?: (string|null); - - /** NFS remotePath */ - remotePath?: (string|null); - } - - /** Represents a NFS. */ - class NFS implements INFS { - - /** - * Constructs a new NFS. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.INFS); - - /** NFS server. */ - public server: string; - - /** NFS remotePath. */ - public remotePath: string; - - /** - * Creates a new NFS instance using the specified properties. - * @param [properties] Properties to set - * @returns NFS instance - */ - public static create(properties?: google.cloud.batch.v1.INFS): google.cloud.batch.v1.NFS; - - /** - * Encodes the specified NFS message. Does not implicitly {@link google.cloud.batch.v1.NFS.verify|verify} messages. - * @param message NFS message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.INFS, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NFS message, length delimited. Does not implicitly {@link google.cloud.batch.v1.NFS.verify|verify} messages. - * @param message NFS message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.INFS, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NFS message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NFS - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.NFS; - - /** - * Decodes a NFS message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NFS - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.NFS; - - /** - * Verifies a NFS message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NFS message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NFS - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.NFS; - - /** - * Creates a plain object from a NFS message. Also converts values to other types if specified. - * @param message NFS - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.NFS, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NFS to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NFS - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GCS. */ - interface IGCS { - - /** GCS remotePath */ - remotePath?: (string|null); - } - - /** Represents a GCS. */ - class GCS implements IGCS { - - /** - * Constructs a new GCS. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IGCS); - - /** GCS remotePath. */ - public remotePath: string; - - /** - * Creates a new GCS instance using the specified properties. - * @param [properties] Properties to set - * @returns GCS instance - */ - public static create(properties?: google.cloud.batch.v1.IGCS): google.cloud.batch.v1.GCS; - - /** - * Encodes the specified GCS message. Does not implicitly {@link google.cloud.batch.v1.GCS.verify|verify} messages. - * @param message GCS message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IGCS, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GCS message, length delimited. Does not implicitly {@link google.cloud.batch.v1.GCS.verify|verify} messages. - * @param message GCS message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IGCS, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GCS message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GCS - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.GCS; - - /** - * Decodes a GCS message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GCS - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.GCS; - - /** - * Verifies a GCS message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GCS message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GCS - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.GCS; - - /** - * Creates a plain object from a GCS message. Also converts values to other types if specified. - * @param message GCS - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.GCS, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GCS to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GCS - * @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); - } - - /** Represents a CommonLanguageSettings. */ - class CommonLanguageSettings implements ICommonLanguageSettings { - - /** - * Constructs a new CommonLanguageSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICommonLanguageSettings); - - /** CommonLanguageSettings referenceDocsUri. */ - public referenceDocsUri: string; - - /** CommonLanguageSettings destinations. */ - public destinations: google.api.ClientLibraryDestination[]; - - /** - * Creates a new CommonLanguageSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns CommonLanguageSettings instance - */ - public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; - - /** - * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @param message CommonLanguageSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @param message CommonLanguageSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; - - /** - * Verifies a CommonLanguageSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CommonLanguageSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; - - /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. - * @param message CommonLanguageSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CommonLanguageSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CommonLanguageSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ClientLibrarySettings. */ - interface IClientLibrarySettings { - - /** ClientLibrarySettings version */ - version?: (string|null); - - /** ClientLibrarySettings launchStage */ - launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); - - /** ClientLibrarySettings restNumericEnums */ - restNumericEnums?: (boolean|null); - - /** ClientLibrarySettings javaSettings */ - javaSettings?: (google.api.IJavaSettings|null); - - /** ClientLibrarySettings cppSettings */ - cppSettings?: (google.api.ICppSettings|null); - - /** ClientLibrarySettings phpSettings */ - phpSettings?: (google.api.IPhpSettings|null); - - /** ClientLibrarySettings pythonSettings */ - pythonSettings?: (google.api.IPythonSettings|null); - - /** ClientLibrarySettings nodeSettings */ - nodeSettings?: (google.api.INodeSettings|null); - - /** ClientLibrarySettings dotnetSettings */ - dotnetSettings?: (google.api.IDotnetSettings|null); - - /** ClientLibrarySettings rubySettings */ - rubySettings?: (google.api.IRubySettings|null); - - /** ClientLibrarySettings goSettings */ - goSettings?: (google.api.IGoSettings|null); - } - - /** Represents a ClientLibrarySettings. */ - class ClientLibrarySettings implements IClientLibrarySettings { - - /** - * Constructs a new ClientLibrarySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IClientLibrarySettings); - - /** ClientLibrarySettings version. */ - public version: string; - - /** ClientLibrarySettings launchStage. */ - public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); - - /** ClientLibrarySettings restNumericEnums. */ - public restNumericEnums: boolean; - - /** ClientLibrarySettings javaSettings. */ - public javaSettings?: (google.api.IJavaSettings|null); - - /** ClientLibrarySettings cppSettings. */ - public cppSettings?: (google.api.ICppSettings|null); - - /** ClientLibrarySettings phpSettings. */ - public phpSettings?: (google.api.IPhpSettings|null); - - /** ClientLibrarySettings pythonSettings. */ - public pythonSettings?: (google.api.IPythonSettings|null); - - /** ClientLibrarySettings nodeSettings. */ - public nodeSettings?: (google.api.INodeSettings|null); - - /** ClientLibrarySettings dotnetSettings. */ - public dotnetSettings?: (google.api.IDotnetSettings|null); - - /** ClientLibrarySettings rubySettings. */ - public rubySettings?: (google.api.IRubySettings|null); - - /** ClientLibrarySettings goSettings. */ - public goSettings?: (google.api.IGoSettings|null); - - /** - * Creates a new ClientLibrarySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns ClientLibrarySettings instance - */ - public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; - - /** - * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @param message ClientLibrarySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @param message ClientLibrarySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; - - /** - * Verifies a ClientLibrarySettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClientLibrarySettings - */ - public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; - - /** - * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. - * @param message ClientLibrarySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClientLibrarySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ClientLibrarySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Publishing. */ - interface IPublishing { - - /** Publishing methodSettings */ - methodSettings?: (google.api.IMethodSettings[]|null); - - /** Publishing newIssueUri */ - newIssueUri?: (string|null); - - /** Publishing documentationUri */ - documentationUri?: (string|null); - - /** Publishing apiShortName */ - apiShortName?: (string|null); - - /** Publishing githubLabel */ - githubLabel?: (string|null); - - /** Publishing codeownerGithubTeams */ - codeownerGithubTeams?: (string[]|null); - - /** Publishing docTagPrefix */ - docTagPrefix?: (string|null); - - /** Publishing organization */ - organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); - - /** Publishing librarySettings */ - librarySettings?: (google.api.IClientLibrarySettings[]|null); - - /** Publishing protoReferenceDocumentationUri */ - protoReferenceDocumentationUri?: (string|null); - - /** Publishing restReferenceDocumentationUri */ - restReferenceDocumentationUri?: (string|null); - } - - /** Represents a Publishing. */ - class Publishing implements IPublishing { - - /** - * Constructs a new Publishing. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPublishing); - - /** Publishing methodSettings. */ - public methodSettings: google.api.IMethodSettings[]; - - /** Publishing newIssueUri. */ - public newIssueUri: string; - - /** Publishing documentationUri. */ - public documentationUri: string; - - /** Publishing apiShortName. */ - public apiShortName: string; - - /** Publishing githubLabel. */ - public githubLabel: string; - - /** Publishing codeownerGithubTeams. */ - public codeownerGithubTeams: string[]; - - /** Publishing docTagPrefix. */ - public docTagPrefix: string; - - /** Publishing organization. */ - public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); - - /** Publishing librarySettings. */ - public librarySettings: google.api.IClientLibrarySettings[]; - - /** Publishing protoReferenceDocumentationUri. */ - public protoReferenceDocumentationUri: string; - - /** Publishing restReferenceDocumentationUri. */ - public restReferenceDocumentationUri: string; - - /** - * Creates a new Publishing instance using the specified properties. - * @param [properties] Properties to set - * @returns Publishing instance - */ - public static create(properties?: google.api.IPublishing): google.api.Publishing; - - /** - * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @param message Publishing message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @param message Publishing message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Publishing message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; - - /** - * Decodes a Publishing message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; - - /** - * Verifies a Publishing message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Publishing message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Publishing - */ - public static fromObject(object: { [k: string]: any }): google.api.Publishing; - - /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @param message Publishing - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Publishing to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Publishing - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a JavaSettings. */ - interface IJavaSettings { - - /** JavaSettings libraryPackage */ - libraryPackage?: (string|null); - - /** JavaSettings serviceClassNames */ - serviceClassNames?: ({ [k: string]: string }|null); - - /** JavaSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a JavaSettings. */ - class JavaSettings implements IJavaSettings { - - /** - * Constructs a new JavaSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IJavaSettings); - - /** JavaSettings libraryPackage. */ - public libraryPackage: string; - - /** JavaSettings serviceClassNames. */ - public serviceClassNames: { [k: string]: string }; - - /** JavaSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new JavaSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns JavaSettings instance - */ - public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; - - /** - * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @param message JavaSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @param message JavaSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a JavaSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; - - /** - * Decodes a JavaSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; - - /** - * Verifies a JavaSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns JavaSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; - - /** - * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. - * @param message JavaSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this JavaSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for JavaSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CppSettings. */ - interface ICppSettings { - - /** CppSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a CppSettings. */ - class CppSettings implements ICppSettings { - - /** - * Constructs a new CppSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICppSettings); - - /** CppSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new CppSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns CppSettings instance - */ - public static create(properties?: google.api.ICppSettings): google.api.CppSettings; - - /** - * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @param message CppSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @param message CppSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CppSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; - - /** - * Decodes a CppSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; - - /** - * Verifies a CppSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CppSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.CppSettings; - - /** - * Creates a plain object from a CppSettings message. Also converts values to other types if specified. - * @param message CppSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CppSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CppSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PhpSettings. */ - interface IPhpSettings { - - /** PhpSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a PhpSettings. */ - class PhpSettings implements IPhpSettings { - - /** - * Constructs a new PhpSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPhpSettings); - - /** PhpSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new PhpSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns PhpSettings instance - */ - public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; - - /** - * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @param message PhpSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @param message PhpSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PhpSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; - - /** - * Decodes a PhpSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; - - /** - * Verifies a PhpSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PhpSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; - - /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @param message PhpSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PhpSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PhpSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PythonSettings. */ - interface IPythonSettings { - - /** PythonSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a PythonSettings. */ - class PythonSettings implements IPythonSettings { - - /** - * Constructs a new PythonSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPythonSettings); - - /** PythonSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new PythonSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns PythonSettings instance - */ - public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; - - /** - * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @param message PythonSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @param message PythonSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PythonSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; - - /** - * Decodes a PythonSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; - - /** - * Verifies a PythonSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PythonSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; - - /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. - * @param message PythonSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PythonSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PythonSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a NodeSettings. */ - interface INodeSettings { - - /** NodeSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a NodeSettings. */ - class NodeSettings implements INodeSettings { - - /** - * Constructs a new NodeSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.INodeSettings); - - /** NodeSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new NodeSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns NodeSettings instance - */ - public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; - - /** - * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @param message NodeSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @param message NodeSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NodeSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; - - /** - * Decodes a NodeSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; - - /** - * Verifies a NodeSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NodeSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; - - /** - * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. - * @param message NodeSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NodeSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NodeSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DotnetSettings. */ - interface IDotnetSettings { - - /** DotnetSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - - /** DotnetSettings renamedServices */ - renamedServices?: ({ [k: string]: string }|null); - - /** DotnetSettings renamedResources */ - renamedResources?: ({ [k: string]: string }|null); - - /** DotnetSettings ignoredResources */ - ignoredResources?: (string[]|null); - - /** DotnetSettings forcedNamespaceAliases */ - forcedNamespaceAliases?: (string[]|null); - - /** DotnetSettings handwrittenSignatures */ - handwrittenSignatures?: (string[]|null); - } - - /** Represents a DotnetSettings. */ - class DotnetSettings implements IDotnetSettings { - - /** - * Constructs a new DotnetSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IDotnetSettings); - - /** DotnetSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** DotnetSettings renamedServices. */ - public renamedServices: { [k: string]: string }; - - /** DotnetSettings renamedResources. */ - public renamedResources: { [k: string]: string }; - - /** DotnetSettings ignoredResources. */ - public ignoredResources: string[]; - - /** DotnetSettings forcedNamespaceAliases. */ - public forcedNamespaceAliases: string[]; - - /** DotnetSettings handwrittenSignatures. */ - public handwrittenSignatures: string[]; - - /** - * Creates a new DotnetSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns DotnetSettings instance - */ - public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; - - /** - * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @param message DotnetSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @param message DotnetSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; - - /** - * Verifies a DotnetSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DotnetSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; - - /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @param message DotnetSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DotnetSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DotnetSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RubySettings. */ - interface IRubySettings { - - /** RubySettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a RubySettings. */ - class RubySettings implements IRubySettings { - - /** - * Constructs a new RubySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IRubySettings); - - /** RubySettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new RubySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns RubySettings instance - */ - public static create(properties?: google.api.IRubySettings): google.api.RubySettings; - - /** - * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @param message RubySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @param message RubySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RubySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; - - /** - * Decodes a RubySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; - - /** - * Verifies a RubySettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RubySettings - */ - public static fromObject(object: { [k: string]: any }): google.api.RubySettings; - - /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @param message RubySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RubySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RubySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GoSettings. */ - interface IGoSettings { - - /** GoSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a GoSettings. */ - class GoSettings implements IGoSettings { - - /** - * Constructs a new GoSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IGoSettings); - - /** GoSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new GoSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns GoSettings instance - */ - public static create(properties?: google.api.IGoSettings): google.api.GoSettings; - - /** - * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @param message GoSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @param message GoSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GoSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; - - /** - * Decodes a GoSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; - - /** - * Verifies a GoSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GoSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.GoSettings; - - /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. - * @param message GoSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GoSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GoSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodSettings. */ - interface IMethodSettings { - - /** MethodSettings selector */ - selector?: (string|null); - - /** MethodSettings longRunning */ - longRunning?: (google.api.MethodSettings.ILongRunning|null); - - /** MethodSettings autoPopulatedFields */ - autoPopulatedFields?: (string[]|null); - } - - /** Represents a MethodSettings. */ - class MethodSettings implements IMethodSettings { - - /** - * Constructs a new MethodSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IMethodSettings); - - /** MethodSettings selector. */ - public selector: string; - - /** MethodSettings longRunning. */ - public longRunning?: (google.api.MethodSettings.ILongRunning|null); - - /** MethodSettings autoPopulatedFields. */ - public autoPopulatedFields: string[]; - - /** - * Creates a new MethodSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodSettings instance - */ - public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; - - /** - * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @param message MethodSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @param message MethodSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; - - /** - * Decodes a MethodSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; - - /** - * Verifies a MethodSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; - - /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @param message MethodSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MethodSettings { - - /** Properties of a LongRunning. */ - interface ILongRunning { - - /** LongRunning initialPollDelay */ - initialPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning pollDelayMultiplier */ - pollDelayMultiplier?: (number|null); - - /** LongRunning maxPollDelay */ - maxPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning totalPollTimeout */ - totalPollTimeout?: (google.protobuf.IDuration|null); - } - - /** Represents a LongRunning. */ - class LongRunning implements ILongRunning { - - /** - * Constructs a new LongRunning. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.MethodSettings.ILongRunning); - - /** LongRunning initialPollDelay. */ - public initialPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning pollDelayMultiplier. */ - public pollDelayMultiplier: number; - - /** LongRunning maxPollDelay. */ - public maxPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning totalPollTimeout. */ - public totalPollTimeout?: (google.protobuf.IDuration|null); - - /** - * Creates a new LongRunning instance using the specified properties. - * @param [properties] Properties to set - * @returns LongRunning instance - */ - public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; - - /** - * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @param message LongRunning message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @param message LongRunning message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LongRunning message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; - - /** - * Decodes a LongRunning message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; - - /** - * Verifies a LongRunning message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LongRunning - */ - public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; - - /** - * Creates a plain object from a LongRunning message. Also converts values to other types if specified. - * @param message LongRunning - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LongRunning to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LongRunning - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** ClientLibraryOrganization enum. */ - enum ClientLibraryOrganization { - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, - CLOUD = 1, - ADS = 2, - PHOTOS = 3, - STREET_VIEW = 4, - SHOPPING = 5, - GEO = 6, - GENERATIVE_AI = 7 - } - - /** ClientLibraryDestination enum. */ - enum ClientLibraryDestination { - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, - GITHUB = 10, - PACKAGE_MANAGER = 20 - } - - /** LaunchStage enum. */ - enum LaunchStage { - LAUNCH_STAGE_UNSPECIFIED = 0, - UNIMPLEMENTED = 6, - PRELAUNCH = 7, - EARLY_ACCESS = 1, - ALPHA = 2, - BETA = 3, - GA = 4, - DEPRECATED = 5 - } - - /** 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 FieldInfo. */ - interface IFieldInfo { - - /** FieldInfo format */ - format?: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format|null); - } - - /** Represents a FieldInfo. */ - class FieldInfo implements IFieldInfo { - - /** - * Constructs a new FieldInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IFieldInfo); - - /** FieldInfo format. */ - public format: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format); - - /** - * Creates a new FieldInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldInfo instance - */ - public static create(properties?: google.api.IFieldInfo): google.api.FieldInfo; - - /** - * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @param message FieldInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @param message FieldInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldInfo - * @throws {Error} If the payload is not 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.FieldInfo; - - /** - * Decodes a FieldInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldInfo - * @throws {Error} If the payload 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.FieldInfo; - - /** - * Verifies a FieldInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldInfo - */ - public static fromObject(object: { [k: string]: any }): google.api.FieldInfo; - - /** - * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. - * @param message FieldInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.FieldInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldInfo { - - /** Format enum. */ - enum Format { - FORMAT_UNSPECIFIED = 0, - UUID4 = 1, - IPV4 = 2, - IPV6 = 3, - IPV4_OR_IPV6 = 4 - } - } - - /** Properties of a ResourceDescriptor. */ - interface IResourceDescriptor { - - /** ResourceDescriptor type */ - type?: (string|null); - - /** ResourceDescriptor pattern */ - pattern?: (string[]|null); - - /** ResourceDescriptor nameField */ - nameField?: (string|null); - - /** ResourceDescriptor history */ - history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); - - /** ResourceDescriptor plural */ - plural?: (string|null); - - /** ResourceDescriptor singular */ - singular?: (string|null); - - /** ResourceDescriptor style */ - style?: (google.api.ResourceDescriptor.Style[]|null); - } - - /** Represents a ResourceDescriptor. */ - class ResourceDescriptor implements IResourceDescriptor { - - /** - * Constructs a new ResourceDescriptor. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceDescriptor); - - /** ResourceDescriptor type. */ - public type: string; - - /** ResourceDescriptor pattern. */ - public pattern: string[]; - - /** ResourceDescriptor nameField. */ - public nameField: string; - - /** ResourceDescriptor history. */ - public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); - - /** ResourceDescriptor plural. */ - public plural: string; - - /** ResourceDescriptor singular. */ - public singular: string; - - /** ResourceDescriptor style. */ - public style: google.api.ResourceDescriptor.Style[]; - - /** - * Creates a new ResourceDescriptor instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceDescriptor instance - */ - public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; - - /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; - - /** - * Verifies a ResourceDescriptor message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceDescriptor - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; - - /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @param message ResourceDescriptor - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceDescriptor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceDescriptor - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ResourceDescriptor { - - /** History enum. */ - enum History { - HISTORY_UNSPECIFIED = 0, - ORIGINALLY_SINGLE_PATTERN = 1, - FUTURE_MULTI_PATTERN = 2 - } - - /** Style enum. */ - enum Style { - STYLE_UNSPECIFIED = 0, - DECLARATIVE_FRIENDLY = 1 - } - } - - /** Properties of a ResourceReference. */ - interface IResourceReference { - - /** ResourceReference type */ - type?: (string|null); - - /** ResourceReference childType */ - childType?: (string|null); - } - - /** Represents a ResourceReference. */ - class ResourceReference implements IResourceReference { - - /** - * Constructs a new ResourceReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceReference); - - /** ResourceReference type. */ - public type: string; - - /** ResourceReference childType. */ - public childType: string; - - /** - * Creates a new ResourceReference instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceReference instance - */ - public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; - - /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceReference message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; - - /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; - - /** - * Verifies a ResourceReference message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceReference - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; - - /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @param message ResourceReference - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceReference - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace protobuf. */ - namespace protobuf { - - /** Properties of a FileDescriptorSet. */ - interface IFileDescriptorSet { - - /** FileDescriptorSet file */ - file?: (google.protobuf.IFileDescriptorProto[]|null); - } - - /** Represents a FileDescriptorSet. */ - class FileDescriptorSet implements IFileDescriptorSet { - - /** - * Constructs a new FileDescriptorSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorSet); - - /** FileDescriptorSet file. */ - public file: google.protobuf.IFileDescriptorProto[]; - - /** - * Creates a new FileDescriptorSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorSet instance - */ - public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; - - /** - * Verifies a FileDescriptorSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @param message FileDescriptorSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileDescriptorSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Edition enum. */ - enum Edition { - EDITION_UNKNOWN = 0, - EDITION_PROTO2 = 998, - EDITION_PROTO3 = 999, - EDITION_2023 = 1000, - EDITION_2024 = 1001, - EDITION_1_TEST_ONLY = 1, - EDITION_2_TEST_ONLY = 2, - EDITION_99997_TEST_ONLY = 99997, - EDITION_99998_TEST_ONLY = 99998, - EDITION_99999_TEST_ONLY = 99999, - EDITION_MAX = 2147483647 - } - - /** Properties of a FileDescriptorProto. */ - interface IFileDescriptorProto { - - /** FileDescriptorProto name */ - name?: (string|null); - - /** FileDescriptorProto package */ - "package"?: (string|null); - - /** FileDescriptorProto dependency */ - dependency?: (string[]|null); - - /** FileDescriptorProto publicDependency */ - publicDependency?: (number[]|null); - - /** FileDescriptorProto weakDependency */ - weakDependency?: (number[]|null); - - /** FileDescriptorProto messageType */ - messageType?: (google.protobuf.IDescriptorProto[]|null); - - /** FileDescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** FileDescriptorProto service */ - service?: (google.protobuf.IServiceDescriptorProto[]|null); - - /** FileDescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** FileDescriptorProto options */ - options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo */ - sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax */ - syntax?: (string|null); - - /** FileDescriptorProto edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FileDescriptorProto. */ - class FileDescriptorProto implements IFileDescriptorProto { - - /** - * Constructs a new FileDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorProto); - - /** FileDescriptorProto name. */ - public name: string; - - /** FileDescriptorProto package. */ - public package: string; - - /** FileDescriptorProto dependency. */ - public dependency: string[]; - - /** FileDescriptorProto publicDependency. */ - public publicDependency: number[]; - - /** FileDescriptorProto weakDependency. */ - public weakDependency: number[]; - - /** FileDescriptorProto messageType. */ - public messageType: google.protobuf.IDescriptorProto[]; - - /** FileDescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** FileDescriptorProto service. */ - public service: google.protobuf.IServiceDescriptorProto[]; - - /** FileDescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** FileDescriptorProto options. */ - public options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo. */ - public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax. */ - public syntax: string; - - /** FileDescriptorProto edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; - - /** - * Verifies a FileDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @param message FileDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DescriptorProto. */ - interface IDescriptorProto { - - /** DescriptorProto name */ - name?: (string|null); - - /** DescriptorProto field */ - field?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto nestedType */ - nestedType?: (google.protobuf.IDescriptorProto[]|null); - - /** DescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** DescriptorProto extensionRange */ - extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); - - /** DescriptorProto oneofDecl */ - oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); - - /** DescriptorProto options */ - options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange */ - reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); - - /** DescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents a DescriptorProto. */ - class DescriptorProto implements IDescriptorProto { - - /** - * Constructs a new DescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDescriptorProto); - - /** DescriptorProto name. */ - public name: string; - - /** DescriptorProto field. */ - public field: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto nestedType. */ - public nestedType: google.protobuf.IDescriptorProto[]; - - /** DescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** DescriptorProto extensionRange. */ - public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; - - /** DescriptorProto oneofDecl. */ - public oneofDecl: google.protobuf.IOneofDescriptorProto[]; - - /** DescriptorProto options. */ - public options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange. */ - public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; - - /** DescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns DescriptorProto instance - */ - public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; - - /** - * Verifies a DescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @param message DescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DescriptorProto { - - /** Properties of an ExtensionRange. */ - interface IExtensionRange { - - /** ExtensionRange start */ - start?: (number|null); - - /** ExtensionRange end */ - end?: (number|null); - - /** ExtensionRange options */ - options?: (google.protobuf.IExtensionRangeOptions|null); - } - - /** Represents an ExtensionRange. */ - class ExtensionRange implements IExtensionRange { - - /** - * Constructs a new ExtensionRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); - - /** ExtensionRange start. */ - public start: number; - - /** ExtensionRange end. */ - public end: number; - - /** ExtensionRange options. */ - public options?: (google.protobuf.IExtensionRangeOptions|null); - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Verifies an ExtensionRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @param message ExtensionRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtensionRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ReservedRange. */ - interface IReservedRange { - - /** ReservedRange start */ - start?: (number|null); - - /** ReservedRange end */ - end?: (number|null); - } - - /** Represents a ReservedRange. */ - class ReservedRange implements IReservedRange { - - /** - * Constructs a new ReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); - - /** ReservedRange start. */ - public start: number; - - /** ReservedRange end. */ - public end: number; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ReservedRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Verifies a ReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @param message ReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ExtensionRangeOptions. */ - interface IExtensionRangeOptions { - - /** ExtensionRangeOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ExtensionRangeOptions declaration */ - declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); - - /** ExtensionRangeOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification */ - verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); - } - - /** Represents an ExtensionRangeOptions. */ - class ExtensionRangeOptions implements IExtensionRangeOptions { - - /** - * Constructs a new ExtensionRangeOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IExtensionRangeOptions); - - /** ExtensionRangeOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** ExtensionRangeOptions declaration. */ - public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; - - /** ExtensionRangeOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification. */ - public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRangeOptions instance - */ - public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; - - /** - * Verifies an ExtensionRangeOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRangeOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @param message ExtensionRangeOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ExtensionRangeOptions { - - /** Properties of a Declaration. */ - interface IDeclaration { - - /** Declaration number */ - number?: (number|null); - - /** Declaration fullName */ - fullName?: (string|null); - - /** Declaration type */ - type?: (string|null); - - /** Declaration reserved */ - reserved?: (boolean|null); - - /** Declaration repeated */ - repeated?: (boolean|null); - } - - /** Represents a Declaration. */ - class Declaration implements IDeclaration { - - /** - * Constructs a new Declaration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); - - /** Declaration number. */ - public number: number; - - /** Declaration fullName. */ - public fullName: string; - - /** Declaration type. */ - public type: string; - - /** Declaration reserved. */ - public reserved: boolean; - - /** Declaration repeated. */ - public repeated: boolean; - - /** - * Creates a new Declaration instance using the specified properties. - * @param [properties] Properties to set - * @returns Declaration instance - */ - public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Verifies a Declaration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Declaration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Declaration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @param message Declaration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Declaration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Declaration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** VerificationState enum. */ - enum VerificationState { - DECLARATION = 0, - UNVERIFIED = 1 - } - } - - /** Properties of a FieldDescriptorProto. */ - interface IFieldDescriptorProto { - - /** FieldDescriptorProto name */ - name?: (string|null); - - /** FieldDescriptorProto number */ - number?: (number|null); - - /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); - - /** FieldDescriptorProto type */ - type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); - - /** FieldDescriptorProto typeName */ - typeName?: (string|null); - - /** FieldDescriptorProto extendee */ - extendee?: (string|null); - - /** FieldDescriptorProto defaultValue */ - defaultValue?: (string|null); - - /** FieldDescriptorProto oneofIndex */ - oneofIndex?: (number|null); - - /** FieldDescriptorProto jsonName */ - jsonName?: (string|null); - - /** FieldDescriptorProto options */ - options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional */ - proto3Optional?: (boolean|null); - } - - /** Represents a FieldDescriptorProto. */ - class FieldDescriptorProto implements IFieldDescriptorProto { - - /** - * Constructs a new FieldDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldDescriptorProto); - - /** FieldDescriptorProto name. */ - public name: string; - - /** FieldDescriptorProto number. */ - public number: number; - - /** FieldDescriptorProto label. */ - public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); - - /** FieldDescriptorProto type. */ - public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); - - /** FieldDescriptorProto typeName. */ - public typeName: string; - - /** FieldDescriptorProto extendee. */ - public extendee: string; - - /** FieldDescriptorProto defaultValue. */ - public defaultValue: string; - - /** FieldDescriptorProto oneofIndex. */ - public oneofIndex: number; - - /** FieldDescriptorProto jsonName. */ - public jsonName: string; - - /** FieldDescriptorProto options. */ - public options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional. */ - public proto3Optional: boolean; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; - - /** - * Verifies a FieldDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @param message FieldDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldDescriptorProto { - - /** Type enum. */ - enum Type { - TYPE_DOUBLE = 1, - TYPE_FLOAT = 2, - TYPE_INT64 = 3, - TYPE_UINT64 = 4, - TYPE_INT32 = 5, - TYPE_FIXED64 = 6, - TYPE_FIXED32 = 7, - TYPE_BOOL = 8, - TYPE_STRING = 9, - TYPE_GROUP = 10, - TYPE_MESSAGE = 11, - TYPE_BYTES = 12, - TYPE_UINT32 = 13, - TYPE_ENUM = 14, - TYPE_SFIXED32 = 15, - TYPE_SFIXED64 = 16, - TYPE_SINT32 = 17, - TYPE_SINT64 = 18 - } - - /** Label enum. */ - enum Label { - LABEL_OPTIONAL = 1, - LABEL_REPEATED = 3, - LABEL_REQUIRED = 2 - } - } - - /** Properties of an OneofDescriptorProto. */ - interface IOneofDescriptorProto { - - /** OneofDescriptorProto name */ - name?: (string|null); - - /** OneofDescriptorProto options */ - options?: (google.protobuf.IOneofOptions|null); - } - - /** Represents an OneofDescriptorProto. */ - class OneofDescriptorProto implements IOneofDescriptorProto { - - /** - * Constructs a new OneofDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofDescriptorProto); - - /** OneofDescriptorProto name. */ - public name: string; - - /** OneofDescriptorProto options. */ - public options?: (google.protobuf.IOneofOptions|null); - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofDescriptorProto instance - */ - public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; - - /** - * Verifies an OneofDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @param message OneofDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OneofDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumDescriptorProto. */ - interface IEnumDescriptorProto { - - /** EnumDescriptorProto name */ - name?: (string|null); - - /** EnumDescriptorProto value */ - value?: (google.protobuf.IEnumValueDescriptorProto[]|null); - - /** EnumDescriptorProto options */ - options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange */ - reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); - - /** EnumDescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents an EnumDescriptorProto. */ - class EnumDescriptorProto implements IEnumDescriptorProto { - - /** - * Constructs a new EnumDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumDescriptorProto); - - /** EnumDescriptorProto name. */ - public name: string; - - /** EnumDescriptorProto value. */ - public value: google.protobuf.IEnumValueDescriptorProto[]; - - /** EnumDescriptorProto options. */ - public options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange. */ - public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; - - /** EnumDescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; - - /** - * Verifies an EnumDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @param message EnumDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EnumDescriptorProto { - - /** Properties of an EnumReservedRange. */ - interface IEnumReservedRange { - - /** EnumReservedRange start */ - start?: (number|null); - - /** EnumReservedRange end */ - end?: (number|null); - } - - /** Represents an EnumReservedRange. */ - class EnumReservedRange implements IEnumReservedRange { - - /** - * Constructs a new EnumReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); - - /** EnumReservedRange start. */ - public start: number; - - /** EnumReservedRange end. */ - public end: number; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumReservedRange instance - */ - public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Verifies an EnumReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @param message EnumReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an EnumValueDescriptorProto. */ - interface IEnumValueDescriptorProto { - - /** EnumValueDescriptorProto name */ - name?: (string|null); - - /** EnumValueDescriptorProto number */ - number?: (number|null); - - /** EnumValueDescriptorProto options */ - options?: (google.protobuf.IEnumValueOptions|null); - } - - /** Represents an EnumValueDescriptorProto. */ - class EnumValueDescriptorProto implements IEnumValueDescriptorProto { - - /** - * Constructs a new EnumValueDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueDescriptorProto); - - /** EnumValueDescriptorProto name. */ - public name: string; - - /** EnumValueDescriptorProto number. */ - public number: number; - - /** EnumValueDescriptorProto options. */ - public options?: (google.protobuf.IEnumValueOptions|null); - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; - - /** - * Verifies an EnumValueDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @param message EnumValueDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceDescriptorProto. */ - interface IServiceDescriptorProto { - - /** ServiceDescriptorProto name */ - name?: (string|null); - - /** ServiceDescriptorProto method */ - method?: (google.protobuf.IMethodDescriptorProto[]|null); - - /** ServiceDescriptorProto options */ - options?: (google.protobuf.IServiceOptions|null); - } - - /** Represents a ServiceDescriptorProto. */ - class ServiceDescriptorProto implements IServiceDescriptorProto { - - /** - * Constructs a new ServiceDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceDescriptorProto); - - /** ServiceDescriptorProto name. */ - public name: string; - - /** ServiceDescriptorProto method. */ - public method: google.protobuf.IMethodDescriptorProto[]; - - /** ServiceDescriptorProto options. */ - public options?: (google.protobuf.IServiceOptions|null); - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceDescriptorProto instance - */ - public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; - - /** - * Verifies a ServiceDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @param message ServiceDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodDescriptorProto. */ - interface IMethodDescriptorProto { - - /** MethodDescriptorProto name */ - name?: (string|null); - - /** MethodDescriptorProto inputType */ - inputType?: (string|null); - - /** MethodDescriptorProto outputType */ - outputType?: (string|null); - - /** MethodDescriptorProto options */ - options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming */ - clientStreaming?: (boolean|null); - - /** MethodDescriptorProto serverStreaming */ - serverStreaming?: (boolean|null); - } - - /** Represents a MethodDescriptorProto. */ - class MethodDescriptorProto implements IMethodDescriptorProto { - - /** - * Constructs a new MethodDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodDescriptorProto); - - /** MethodDescriptorProto name. */ - public name: string; - - /** MethodDescriptorProto inputType. */ - public inputType: string; - - /** MethodDescriptorProto outputType. */ - public outputType: string; - - /** MethodDescriptorProto options. */ - public options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming. */ - public clientStreaming: boolean; - - /** MethodDescriptorProto serverStreaming. */ - public serverStreaming: boolean; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodDescriptorProto instance - */ - public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; - - /** - * Verifies a MethodDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @param message MethodDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FileOptions. */ - interface IFileOptions { - - /** FileOptions javaPackage */ - javaPackage?: (string|null); - - /** FileOptions javaOuterClassname */ - javaOuterClassname?: (string|null); - - /** FileOptions javaMultipleFiles */ - javaMultipleFiles?: (boolean|null); - - /** FileOptions javaGenerateEqualsAndHash */ - javaGenerateEqualsAndHash?: (boolean|null); - - /** FileOptions javaStringCheckUtf8 */ - javaStringCheckUtf8?: (boolean|null); - - /** FileOptions optimizeFor */ - optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); - - /** FileOptions goPackage */ - goPackage?: (string|null); - - /** FileOptions ccGenericServices */ - ccGenericServices?: (boolean|null); - - /** FileOptions javaGenericServices */ - javaGenericServices?: (boolean|null); - - /** FileOptions pyGenericServices */ - pyGenericServices?: (boolean|null); - - /** FileOptions deprecated */ - deprecated?: (boolean|null); - - /** FileOptions ccEnableArenas */ - ccEnableArenas?: (boolean|null); - - /** FileOptions objcClassPrefix */ - objcClassPrefix?: (string|null); - - /** FileOptions csharpNamespace */ - csharpNamespace?: (string|null); - - /** FileOptions swiftPrefix */ - swiftPrefix?: (string|null); - - /** FileOptions phpClassPrefix */ - phpClassPrefix?: (string|null); - - /** FileOptions phpNamespace */ - phpNamespace?: (string|null); - - /** FileOptions phpMetadataNamespace */ - phpMetadataNamespace?: (string|null); - - /** FileOptions rubyPackage */ - rubyPackage?: (string|null); - - /** FileOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** FileOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FileOptions .google.api.resourceDefinition */ - ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); - } - - /** Represents a FileOptions. */ - class FileOptions implements IFileOptions { - - /** - * Constructs a new FileOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileOptions); - - /** FileOptions javaPackage. */ - public javaPackage: string; - - /** FileOptions javaOuterClassname. */ - public javaOuterClassname: string; - - /** FileOptions javaMultipleFiles. */ - public javaMultipleFiles: boolean; - - /** FileOptions javaGenerateEqualsAndHash. */ - public javaGenerateEqualsAndHash: boolean; - - /** FileOptions javaStringCheckUtf8. */ - public javaStringCheckUtf8: boolean; - - /** FileOptions optimizeFor. */ - public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); - - /** FileOptions goPackage. */ - public goPackage: string; - - /** FileOptions ccGenericServices. */ - public ccGenericServices: boolean; - - /** FileOptions javaGenericServices. */ - public javaGenericServices: boolean; - - /** FileOptions pyGenericServices. */ - public pyGenericServices: boolean; - - /** FileOptions deprecated. */ - public deprecated: boolean; - - /** FileOptions ccEnableArenas. */ - public ccEnableArenas: boolean; - - /** FileOptions objcClassPrefix. */ - public objcClassPrefix: string; - - /** FileOptions csharpNamespace. */ - public csharpNamespace: string; - - /** FileOptions swiftPrefix. */ - public swiftPrefix: string; - - /** FileOptions phpClassPrefix. */ - public phpClassPrefix: string; - - /** FileOptions phpNamespace. */ - public phpNamespace: string; - - /** FileOptions phpMetadataNamespace. */ - public phpMetadataNamespace: string; - - /** FileOptions rubyPackage. */ - public rubyPackage: string; - - /** FileOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** FileOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FileOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FileOptions instance - */ - public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; - - /** - * Verifies a FileOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @param message FileOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FileOptions { - - /** OptimizeMode enum. */ - enum OptimizeMode { - SPEED = 1, - CODE_SIZE = 2, - LITE_RUNTIME = 3 - } - } - - /** Properties of a MessageOptions. */ - interface IMessageOptions { - - /** MessageOptions messageSetWireFormat */ - messageSetWireFormat?: (boolean|null); - - /** MessageOptions noStandardDescriptorAccessor */ - noStandardDescriptorAccessor?: (boolean|null); - - /** MessageOptions deprecated */ - deprecated?: (boolean|null); - - /** MessageOptions mapEntry */ - mapEntry?: (boolean|null); - - /** MessageOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** MessageOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** MessageOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MessageOptions .google.api.resource */ - ".google.api.resource"?: (google.api.IResourceDescriptor|null); - } - - /** Represents a MessageOptions. */ - class MessageOptions implements IMessageOptions { - - /** - * Constructs a new MessageOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMessageOptions); - - /** MessageOptions messageSetWireFormat. */ - public messageSetWireFormat: boolean; - - /** MessageOptions noStandardDescriptorAccessor. */ - public noStandardDescriptorAccessor: boolean; - - /** MessageOptions deprecated. */ - public deprecated: boolean; - - /** MessageOptions mapEntry. */ - public mapEntry: boolean; - - /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; - - /** MessageOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** MessageOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MessageOptions instance - */ - public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; - - /** - * Verifies a MessageOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MessageOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @param message MessageOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MessageOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MessageOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FieldOptions. */ - interface IFieldOptions { - - /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); - - /** FieldOptions packed */ - packed?: (boolean|null); - - /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); - - /** FieldOptions lazy */ - lazy?: (boolean|null); - - /** FieldOptions unverifiedLazy */ - unverifiedLazy?: (boolean|null); - - /** FieldOptions deprecated */ - deprecated?: (boolean|null); - - /** FieldOptions weak */ - weak?: (boolean|null); - - /** FieldOptions debugRedact */ - debugRedact?: (boolean|null); - - /** FieldOptions retention */ - retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); - - /** FieldOptions targets */ - targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); - - /** FieldOptions editionDefaults */ - editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); - - /** FieldOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** FieldOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FieldOptions .google.api.fieldBehavior */ - ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); - - /** FieldOptions .google.api.fieldInfo */ - ".google.api.fieldInfo"?: (google.api.IFieldInfo|null); - - /** FieldOptions .google.api.resourceReference */ - ".google.api.resourceReference"?: (google.api.IResourceReference|null); - } - - /** Represents a FieldOptions. */ - class FieldOptions implements IFieldOptions { - - /** - * Constructs a new FieldOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldOptions); - - /** FieldOptions ctype. */ - public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); - - /** FieldOptions packed. */ - public packed: boolean; - - /** FieldOptions jstype. */ - public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); - - /** FieldOptions lazy. */ - public lazy: boolean; - - /** FieldOptions unverifiedLazy. */ - public unverifiedLazy: boolean; - - /** FieldOptions deprecated. */ - public deprecated: boolean; - - /** FieldOptions weak. */ - public weak: boolean; - - /** FieldOptions debugRedact. */ - public debugRedact: boolean; - - /** FieldOptions retention. */ - public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); - - /** FieldOptions targets. */ - public targets: google.protobuf.FieldOptions.OptionTargetType[]; - - /** FieldOptions editionDefaults. */ - public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; - - /** FieldOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** FieldOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldOptions instance - */ - public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; - - /** - * Verifies a FieldOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @param message FieldOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldOptions { - - /** CType enum. */ - enum CType { - STRING = 0, - CORD = 1, - STRING_PIECE = 2 - } - - /** JSType enum. */ - enum JSType { - JS_NORMAL = 0, - JS_STRING = 1, - JS_NUMBER = 2 - } - - /** OptionRetention enum. */ - enum OptionRetention { - RETENTION_UNKNOWN = 0, - RETENTION_RUNTIME = 1, - RETENTION_SOURCE = 2 - } - - /** OptionTargetType enum. */ - enum OptionTargetType { - TARGET_TYPE_UNKNOWN = 0, - TARGET_TYPE_FILE = 1, - TARGET_TYPE_EXTENSION_RANGE = 2, - TARGET_TYPE_MESSAGE = 3, - TARGET_TYPE_FIELD = 4, - TARGET_TYPE_ONEOF = 5, - TARGET_TYPE_ENUM = 6, - TARGET_TYPE_ENUM_ENTRY = 7, - TARGET_TYPE_SERVICE = 8, - TARGET_TYPE_METHOD = 9 - } - - /** Properties of an EditionDefault. */ - interface IEditionDefault { - - /** EditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** EditionDefault value */ - value?: (string|null); - } - - /** Represents an EditionDefault. */ - class EditionDefault implements IEditionDefault { - - /** - * Constructs a new EditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); - - /** EditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** EditionDefault value. */ - public value: string; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns EditionDefault instance - */ - public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; - - /** - * Verifies an EditionDefault message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @param message EditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an OneofOptions. */ - interface IOneofOptions { - - /** OneofOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** OneofOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an OneofOptions. */ - class OneofOptions implements IOneofOptions { - - /** - * Constructs a new OneofOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofOptions); - - /** OneofOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** OneofOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofOptions instance - */ - public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; - - /** - * Verifies an OneofOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @param message OneofOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OneofOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumOptions. */ - interface IEnumOptions { - - /** EnumOptions allowAlias */ - allowAlias?: (boolean|null); - - /** EnumOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** EnumOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** EnumOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumOptions. */ - class EnumOptions implements IEnumOptions { - - /** - * Constructs a new EnumOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumOptions); - - /** EnumOptions allowAlias. */ - public allowAlias: boolean; - - /** EnumOptions deprecated. */ - public deprecated: boolean; - - /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; - - /** EnumOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** EnumOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumOptions instance - */ - public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; - - /** - * Verifies an EnumOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @param message EnumOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumValueOptions. */ - interface IEnumValueOptions { - - /** EnumValueOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumValueOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact */ - debugRedact?: (boolean|null); - - /** EnumValueOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumValueOptions. */ - class EnumValueOptions implements IEnumValueOptions { - - /** - * Constructs a new EnumValueOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueOptions); - - /** EnumValueOptions deprecated. */ - public deprecated: boolean; - - /** EnumValueOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact. */ - public debugRedact: boolean; - - /** EnumValueOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueOptions instance - */ - public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; - - /** - * Verifies an EnumValueOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @param message EnumValueOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceOptions. */ - interface IServiceOptions { - - /** ServiceOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** ServiceOptions deprecated */ - deprecated?: (boolean|null); - - /** ServiceOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ServiceOptions .google.api.defaultHost */ - ".google.api.defaultHost"?: (string|null); - - /** ServiceOptions .google.api.oauthScopes */ - ".google.api.oauthScopes"?: (string|null); - - /** ServiceOptions .google.api.apiVersion */ - ".google.api.apiVersion"?: (string|null); - } - - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { - - /** - * Constructs a new ServiceOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceOptions); - - /** ServiceOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** ServiceOptions deprecated. */ - public deprecated: boolean; - - /** ServiceOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceOptions instance - */ - public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; - - /** - * Verifies a ServiceOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @param message ServiceOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodOptions. */ - interface IMethodOptions { - - /** MethodOptions deprecated */ - deprecated?: (boolean|null); - - /** MethodOptions idempotencyLevel */ - idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); - - /** MethodOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** MethodOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MethodOptions .google.api.http */ - ".google.api.http"?: (google.api.IHttpRule|null); - - /** MethodOptions .google.api.methodSignature */ - ".google.api.methodSignature"?: (string[]|null); - - /** MethodOptions .google.longrunning.operationInfo */ - ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); - } - - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { - - /** - * Constructs a new MethodOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodOptions); - - /** MethodOptions deprecated. */ - public deprecated: boolean; - - /** MethodOptions idempotencyLevel. */ - public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); - - /** MethodOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** MethodOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MethodOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodOptions instance - */ - public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; - - /** - * Verifies a MethodOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @param message MethodOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MethodOptions { - - /** IdempotencyLevel enum. */ - enum IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0, - NO_SIDE_EFFECTS = 1, - IDEMPOTENT = 2 - } - } - - /** Properties of an UninterpretedOption. */ - interface IUninterpretedOption { - - /** UninterpretedOption name */ - name?: (google.protobuf.UninterpretedOption.INamePart[]|null); - - /** UninterpretedOption identifierValue */ - identifierValue?: (string|null); - - /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|Long|string|null); - - /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|Long|string|null); - - /** UninterpretedOption doubleValue */ - doubleValue?: (number|null); - - /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|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|string); - - /** UninterpretedOption aggregateValue. */ - public aggregateValue: string; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @param [properties] Properties to set - * @returns UninterpretedOption instance - */ - public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; - - /** - * Verifies an UninterpretedOption message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UninterpretedOption - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @param message UninterpretedOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UninterpretedOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UninterpretedOption - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace UninterpretedOption { - - /** Properties of a NamePart. */ - interface INamePart { - - /** NamePart namePart */ - namePart: string; - - /** NamePart isExtension */ - isExtension: boolean; - } - - /** Represents a NamePart. */ - class NamePart implements INamePart { - - /** - * Constructs a new NamePart. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.UninterpretedOption.INamePart); - - /** NamePart namePart. */ - public namePart: string; - - /** NamePart isExtension. */ - public isExtension: boolean; - - /** - * Creates a new NamePart instance using the specified properties. - * @param [properties] Properties to set - * @returns NamePart instance - */ - public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; - - /** - * Verifies a NamePart message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NamePart - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @param message NamePart - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NamePart to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NamePart - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a FeatureSet. */ - interface IFeatureSet { - - /** FeatureSet fieldPresence */ - fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); - - /** FeatureSet enumType */ - enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); - - /** FeatureSet repeatedFieldEncoding */ - repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); - - /** FeatureSet utf8Validation */ - utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); - - /** FeatureSet messageEncoding */ - messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); - - /** FeatureSet jsonFormat */ - jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); - } - - /** Represents a FeatureSet. */ - class FeatureSet implements IFeatureSet { - - /** - * Constructs a new FeatureSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSet); - - /** FeatureSet fieldPresence. */ - public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); - - /** FeatureSet enumType. */ - public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); - - /** FeatureSet repeatedFieldEncoding. */ - public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); - - /** FeatureSet utf8Validation. */ - public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); - - /** FeatureSet messageEncoding. */ - public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); - - /** FeatureSet jsonFormat. */ - public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); - - /** - * Creates a new FeatureSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSet instance - */ - public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; - - /** - * Verifies a FeatureSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @param message FeatureSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSet { - - /** FieldPresence enum. */ - enum FieldPresence { - FIELD_PRESENCE_UNKNOWN = 0, - EXPLICIT = 1, - IMPLICIT = 2, - LEGACY_REQUIRED = 3 - } - - /** EnumType enum. */ - enum EnumType { - ENUM_TYPE_UNKNOWN = 0, - OPEN = 1, - CLOSED = 2 - } - - /** RepeatedFieldEncoding enum. */ - enum RepeatedFieldEncoding { - REPEATED_FIELD_ENCODING_UNKNOWN = 0, - PACKED = 1, - EXPANDED = 2 - } - - /** Utf8Validation enum. */ - enum Utf8Validation { - UTF8_VALIDATION_UNKNOWN = 0, - VERIFY = 2, - NONE = 3 - } - - /** MessageEncoding enum. */ - enum MessageEncoding { - MESSAGE_ENCODING_UNKNOWN = 0, - LENGTH_PREFIXED = 1, - DELIMITED = 2 - } - - /** JsonFormat enum. */ - enum JsonFormat { - JSON_FORMAT_UNKNOWN = 0, - ALLOW = 1, - LEGACY_BEST_EFFORT = 2 - } - } - - /** Properties of a FeatureSetDefaults. */ - interface IFeatureSetDefaults { - - /** FeatureSetDefaults defaults */ - defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); - - /** FeatureSetDefaults minimumEdition */ - minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetDefaults maximumEdition */ - maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FeatureSetDefaults. */ - class FeatureSetDefaults implements IFeatureSetDefaults { - - /** - * Constructs a new FeatureSetDefaults. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSetDefaults); - - /** FeatureSetDefaults defaults. */ - public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; - - /** FeatureSetDefaults minimumEdition. */ - public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetDefaults maximumEdition. */ - public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetDefaults instance - */ - public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; - - /** - * Verifies a FeatureSetDefaults message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetDefaults - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @param message FeatureSetDefaults - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetDefaults - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSetDefaults { - - /** Properties of a FeatureSetEditionDefault. */ - interface IFeatureSetEditionDefault { - - /** FeatureSetEditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetEditionDefault features */ - features?: (google.protobuf.IFeatureSet|null); - } - - /** Represents a FeatureSetEditionDefault. */ - class FeatureSetEditionDefault implements IFeatureSetEditionDefault { - - /** - * Constructs a new FeatureSetEditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); - - /** FeatureSetEditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetEditionDefault features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetEditionDefault instance - */ - public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Verifies a FeatureSetEditionDefault message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetEditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @param message FeatureSetEditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a SourceCodeInfo. */ - interface ISourceCodeInfo { - - /** SourceCodeInfo location */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); - } - - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { - - /** - * Constructs a new SourceCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ISourceCodeInfo); - - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns SourceCodeInfo instance - */ - public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; - - /** - * Verifies a SourceCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SourceCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @param message SourceCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SourceCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SourceCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SourceCodeInfo { - - /** Properties of a Location. */ - interface ILocation { - - /** Location path */ - path?: (number[]|null); - - /** Location span */ - span?: (number[]|null); - - /** Location leadingComments */ - leadingComments?: (string|null); - - /** Location trailingComments */ - trailingComments?: (string|null); - - /** Location leadingDetachedComments */ - leadingDetachedComments?: (string[]|null); - } - - /** Represents a Location. */ - class Location implements ILocation { - - /** - * Constructs a new Location. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); - - /** Location path. */ - public path: number[]; - - /** Location span. */ - public span: number[]; - - /** Location leadingComments. */ - public leadingComments: string; - - /** Location trailingComments. */ - public trailingComments: string; - - /** Location leadingDetachedComments. */ - public leadingDetachedComments: string[]; - - /** - * Creates a new Location instance using the specified properties. - * @param [properties] Properties to set - * @returns Location instance - */ - public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Location message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; - - /** - * Verifies a Location message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Location - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @param message Location - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Location to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Location - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a GeneratedCodeInfo. */ - interface IGeneratedCodeInfo { - - /** GeneratedCodeInfo annotation */ - annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); - } - - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { - - /** - * Constructs a new GeneratedCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IGeneratedCodeInfo); - - /** GeneratedCodeInfo annotation. */ - public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns GeneratedCodeInfo instance - */ - public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; - - /** - * Verifies a GeneratedCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GeneratedCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @param message GeneratedCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace GeneratedCodeInfo { - - /** Properties of an Annotation. */ - interface IAnnotation { - - /** Annotation path */ - path?: (number[]|null); - - /** Annotation sourceFile */ - sourceFile?: (string|null); - - /** Annotation begin */ - begin?: (number|null); - - /** Annotation end */ - end?: (number|null); - - /** Annotation semantic */ - semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); - } - - /** Represents an Annotation. */ - class Annotation implements IAnnotation { - - /** - * Constructs a new Annotation. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); - - /** Annotation path. */ - public path: number[]; - - /** Annotation sourceFile. */ - public sourceFile: string; - - /** Annotation begin. */ - public begin: number; - - /** Annotation end. */ - public end: number; - - /** Annotation semantic. */ - public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); - - /** - * Creates a new Annotation instance using the specified properties. - * @param [properties] Properties to set - * @returns Annotation instance - */ - public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Verifies an Annotation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Annotation - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @param message Annotation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Annotation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Annotation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Annotation { - - /** Semantic enum. */ - enum Semantic { - NONE = 0, - SET = 1, - ALIAS = 2 - } - } - } - - /** Properties of a Duration. */ - interface IDuration { - - /** Duration seconds */ - seconds?: (number|Long|string|null); - - /** Duration nanos */ - nanos?: (number|null); - } - - /** Represents a Duration. */ - class Duration implements IDuration { - - /** - * Constructs a new Duration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDuration); - - /** Duration seconds. */ - public seconds: (number|Long|string); - - /** Duration nanos. */ - public nanos: number; - - /** - * Creates a new Duration instance using the specified properties. - * @param [properties] Properties to set - * @returns Duration instance - */ - public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; - - /** - * Verifies a Duration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Duration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @param message Duration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Duration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Duration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of 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 an Any. */ - interface IAny { - - /** Any type_url */ - type_url?: (string|null); - - /** Any value */ - value?: (Uint8Array|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|string); - - /** - * Creates a new Any instance using the specified properties. - * @param [properties] Properties to set - * @returns Any instance - */ - public static create(properties?: google.protobuf.IAny): google.protobuf.Any; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Any message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; - - /** - * Verifies an Any message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Any - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Any; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @param message Any - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Any to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Any - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Empty. */ - interface IEmpty { - } - - /** Represents an Empty. */ - class Empty implements IEmpty { - - /** - * Constructs a new Empty. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEmpty); - - /** - * Creates a new Empty instance using the specified properties. - * @param [properties] Properties to set - * @returns Empty instance - */ - public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; - - /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Empty message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; - - /** - * Decodes an Empty message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; - - /** - * Verifies an Empty message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Empty - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; - - /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @param message Empty - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Empty to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Empty - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace longrunning. */ - namespace longrunning { - - /** Represents an Operations */ - class Operations extends $protobuf.rpc.Service { - - /** - * Constructs a new Operations service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new Operations service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; - - /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListOperationsResponse - */ - public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; - - /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @returns Promise - */ - public listOperations(request: google.longrunning.IListOperationsRequest): Promise; - - /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; - - /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @returns Promise - */ - public getOperation(request: google.longrunning.IGetOperationRequest): Promise; - - /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; - - /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @returns Promise - */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; - - /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; - - /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @returns Promise - */ - public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; - - /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; - - /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @returns Promise - */ - public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; - } - - namespace Operations { - - /** - * Callback as used by {@link google.longrunning.Operations|listOperations}. - * @param error Error, if any - * @param [response] ListOperationsResponse - */ - type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|getOperation}. - * @param error Error, if any - * @param [response] Operation - */ - type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|deleteOperation}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|cancelOperation}. - * @param error Error, if any - * @param [response] Empty - */ - type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|waitOperation}. - * @param error Error, if any - * @param [response] Operation - */ - type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of an Operation. */ - interface IOperation { - - /** Operation name */ - name?: (string|null); - - /** Operation metadata */ - metadata?: (google.protobuf.IAny|null); - - /** Operation done */ - done?: (boolean|null); - - /** Operation error */ - error?: (google.rpc.IStatus|null); - - /** Operation response */ - response?: (google.protobuf.IAny|null); - } - - /** Represents an Operation. */ - class Operation implements IOperation { - - /** - * Constructs a new Operation. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IOperation); - - /** Operation name. */ - public name: string; - - /** Operation metadata. */ - public metadata?: (google.protobuf.IAny|null); - - /** Operation done. */ - public done: boolean; - - /** Operation error. */ - public error?: (google.rpc.IStatus|null); - - /** Operation response. */ - public response?: (google.protobuf.IAny|null); - - /** Operation result. */ - public result?: ("error"|"response"); - - /** - * Creates a new Operation instance using the specified properties. - * @param [properties] Properties to set - * @returns Operation instance - */ - public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; - - /** - * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @param message Operation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @param message Operation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Operation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; - - /** - * Decodes an Operation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; - - /** - * Verifies an Operation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Operation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Operation - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; - - /** - * Creates a plain object from an Operation message. Also converts values to other types if specified. - * @param message Operation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Operation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Operation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetOperationRequest. */ - interface IGetOperationRequest { - - /** GetOperationRequest name */ - name?: (string|null); - } - - /** Represents a GetOperationRequest. */ - class GetOperationRequest implements IGetOperationRequest { - - /** - * Constructs a new GetOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IGetOperationRequest); - - /** GetOperationRequest name. */ - public name: string; - - /** - * Creates a new GetOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetOperationRequest instance - */ - public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; - - /** - * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @param message GetOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @param message GetOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; - - /** - * Verifies a GetOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; - - /** - * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. - * @param message GetOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListOperationsRequest. */ - interface IListOperationsRequest { - - /** ListOperationsRequest name */ - name?: (string|null); - - /** ListOperationsRequest filter */ - filter?: (string|null); - - /** ListOperationsRequest pageSize */ - pageSize?: (number|null); - - /** ListOperationsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListOperationsRequest. */ - class ListOperationsRequest implements IListOperationsRequest { - - /** - * Constructs a new ListOperationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IListOperationsRequest); - - /** ListOperationsRequest name. */ - public name: string; - - /** ListOperationsRequest filter. */ - public filter: string; - - /** ListOperationsRequest pageSize. */ - public pageSize: number; - - /** ListOperationsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListOperationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListOperationsRequest instance - */ - public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; - - /** - * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @param message ListOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @param message ListOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; - - /** - * Verifies a ListOperationsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListOperationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; - - /** - * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. - * @param message ListOperationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListOperationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListOperationsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListOperationsResponse. */ - interface IListOperationsResponse { - - /** ListOperationsResponse operations */ - operations?: (google.longrunning.IOperation[]|null); - - /** ListOperationsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListOperationsResponse. */ - class ListOperationsResponse implements IListOperationsResponse { - - /** - * Constructs a new ListOperationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IListOperationsResponse); - - /** ListOperationsResponse operations. */ - public operations: google.longrunning.IOperation[]; - - /** ListOperationsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListOperationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListOperationsResponse instance - */ - public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; - - /** - * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @param message ListOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @param message ListOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; - - /** - * Verifies a ListOperationsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListOperationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; - - /** - * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. - * @param message ListOperationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListOperationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListOperationsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CancelOperationRequest. */ - interface ICancelOperationRequest { - - /** CancelOperationRequest name */ - name?: (string|null); - } - - /** Represents a CancelOperationRequest. */ - class CancelOperationRequest implements ICancelOperationRequest { - - /** - * Constructs a new CancelOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.ICancelOperationRequest); - - /** CancelOperationRequest name. */ - public name: string; - - /** - * Creates a new CancelOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CancelOperationRequest instance - */ - public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; - - /** - * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @param message CancelOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @param message CancelOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; - - /** - * Verifies a CancelOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CancelOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; - - /** - * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. - * @param message CancelOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CancelOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CancelOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteOperationRequest. */ - interface IDeleteOperationRequest { - - /** DeleteOperationRequest name */ - name?: (string|null); - } - - /** Represents a DeleteOperationRequest. */ - class DeleteOperationRequest implements IDeleteOperationRequest { - - /** - * Constructs a new DeleteOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IDeleteOperationRequest); - - /** DeleteOperationRequest name. */ - public name: string; - - /** - * Creates a new DeleteOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteOperationRequest instance - */ - public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; - - /** - * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @param message DeleteOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @param message DeleteOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; - - /** - * Verifies a DeleteOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; - - /** - * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. - * @param message DeleteOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a WaitOperationRequest. */ - interface IWaitOperationRequest { - - /** WaitOperationRequest name */ - name?: (string|null); - - /** WaitOperationRequest timeout */ - timeout?: (google.protobuf.IDuration|null); - } - - /** Represents a WaitOperationRequest. */ - class WaitOperationRequest implements IWaitOperationRequest { - - /** - * Constructs a new WaitOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IWaitOperationRequest); - - /** WaitOperationRequest name. */ - public name: string; - - /** WaitOperationRequest timeout. */ - public timeout?: (google.protobuf.IDuration|null); - - /** - * Creates a new WaitOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns WaitOperationRequest instance - */ - public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; - - /** - * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @param message WaitOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @param message WaitOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; - - /** - * Verifies a WaitOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WaitOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; - - /** - * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. - * @param message WaitOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WaitOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WaitOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OperationInfo. */ - interface IOperationInfo { - - /** OperationInfo responseType */ - responseType?: (string|null); - - /** OperationInfo metadataType */ - metadataType?: (string|null); - } - - /** Represents an OperationInfo. */ - class OperationInfo implements IOperationInfo { - - /** - * Constructs a new OperationInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IOperationInfo); - - /** OperationInfo responseType. */ - public responseType: string; - - /** OperationInfo metadataType. */ - public metadataType: string; - - /** - * Creates a new OperationInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns OperationInfo instance - */ - public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; - - /** - * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @param message OperationInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @param message OperationInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OperationInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; - - /** - * Decodes an OperationInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; - - /** - * Verifies an OperationInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OperationInfo - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; - - /** - * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. - * @param message OperationInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OperationInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OperationInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace rpc. */ - namespace rpc { - - /** Properties of a Status. */ - interface IStatus { - - /** Status code */ - code?: (number|null); - - /** Status message */ - message?: (string|null); - - /** Status details */ - details?: (google.protobuf.IAny[]|null); - } - - /** Represents a Status. */ - class Status implements IStatus { - - /** - * Constructs a new Status. - * @param [properties] Properties to set - */ - constructor(properties?: google.rpc.IStatus); - - /** Status code. */ - public code: number; - - /** Status message. */ - public message: string; - - /** Status details. */ - public details: google.protobuf.IAny[]; - - /** - * Creates a new Status instance using the specified properties. - * @param [properties] Properties to set - * @returns Status instance - */ - public static create(properties?: google.rpc.IStatus): google.rpc.Status; - - /** - * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @param message Status message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @param message Status message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Status message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; - - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; - - /** - * Verifies a Status message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Status - */ - public static fromObject(object: { [k: string]: any }): google.rpc.Status; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @param message Status - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Status to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Status - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } -} diff --git a/owl-bot-staging/google-cloud-batch/v1/protos/protos.js b/owl-bot-staging/google-cloud-batch/v1/protos/protos.js deleted file mode 100644 index 6d87f323961..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/protos/protos.js +++ /dev/null @@ -1,35612 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*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_batch_protos || ($protobuf.roots._google_cloud_batch_protos = {}); - - $root.google = (function() { - - /** - * Namespace google. - * @exports google - * @namespace - */ - var google = {}; - - google.cloud = (function() { - - /** - * Namespace cloud. - * @memberof google - * @namespace - */ - var cloud = {}; - - cloud.batch = (function() { - - /** - * Namespace batch. - * @memberof google.cloud - * @namespace - */ - var batch = {}; - - batch.v1 = (function() { - - /** - * Namespace v1. - * @memberof google.cloud.batch - * @namespace - */ - var v1 = {}; - - v1.BatchService = (function() { - - /** - * Constructs a new BatchService service. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a BatchService - * @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 BatchService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (BatchService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = BatchService; - - /** - * Creates new BatchService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.batch.v1.BatchService - * @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 {BatchService} RPC service. Useful where requests and/or responses are streamed. - */ - BatchService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.batch.v1.BatchService|createJob}. - * @memberof google.cloud.batch.v1.BatchService - * @typedef CreateJobCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.batch.v1.Job} [response] Job - */ - - /** - * Calls CreateJob. - * @function createJob - * @memberof google.cloud.batch.v1.BatchService - * @instance - * @param {google.cloud.batch.v1.ICreateJobRequest} request CreateJobRequest message or plain object - * @param {google.cloud.batch.v1.BatchService.CreateJobCallback} callback Node-style callback called with the error, if any, and Job - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.createJob = function createJob(request, callback) { - return this.rpcCall(createJob, $root.google.cloud.batch.v1.CreateJobRequest, $root.google.cloud.batch.v1.Job, request, callback); - }, "name", { value: "CreateJob" }); - - /** - * Calls CreateJob. - * @function createJob - * @memberof google.cloud.batch.v1.BatchService - * @instance - * @param {google.cloud.batch.v1.ICreateJobRequest} request CreateJobRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.batch.v1.BatchService|getJob}. - * @memberof google.cloud.batch.v1.BatchService - * @typedef GetJobCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.batch.v1.Job} [response] Job - */ - - /** - * Calls GetJob. - * @function getJob - * @memberof google.cloud.batch.v1.BatchService - * @instance - * @param {google.cloud.batch.v1.IGetJobRequest} request GetJobRequest message or plain object - * @param {google.cloud.batch.v1.BatchService.GetJobCallback} callback Node-style callback called with the error, if any, and Job - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.getJob = function getJob(request, callback) { - return this.rpcCall(getJob, $root.google.cloud.batch.v1.GetJobRequest, $root.google.cloud.batch.v1.Job, request, callback); - }, "name", { value: "GetJob" }); - - /** - * Calls GetJob. - * @function getJob - * @memberof google.cloud.batch.v1.BatchService - * @instance - * @param {google.cloud.batch.v1.IGetJobRequest} request GetJobRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.batch.v1.BatchService|deleteJob}. - * @memberof google.cloud.batch.v1.BatchService - * @typedef DeleteJobCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteJob. - * @function deleteJob - * @memberof google.cloud.batch.v1.BatchService - * @instance - * @param {google.cloud.batch.v1.IDeleteJobRequest} request DeleteJobRequest message or plain object - * @param {google.cloud.batch.v1.BatchService.DeleteJobCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.deleteJob = function deleteJob(request, callback) { - return this.rpcCall(deleteJob, $root.google.cloud.batch.v1.DeleteJobRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteJob" }); - - /** - * Calls DeleteJob. - * @function deleteJob - * @memberof google.cloud.batch.v1.BatchService - * @instance - * @param {google.cloud.batch.v1.IDeleteJobRequest} request DeleteJobRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.batch.v1.BatchService|listJobs}. - * @memberof google.cloud.batch.v1.BatchService - * @typedef ListJobsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.batch.v1.ListJobsResponse} [response] ListJobsResponse - */ - - /** - * Calls ListJobs. - * @function listJobs - * @memberof google.cloud.batch.v1.BatchService - * @instance - * @param {google.cloud.batch.v1.IListJobsRequest} request ListJobsRequest message or plain object - * @param {google.cloud.batch.v1.BatchService.ListJobsCallback} callback Node-style callback called with the error, if any, and ListJobsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.listJobs = function listJobs(request, callback) { - return this.rpcCall(listJobs, $root.google.cloud.batch.v1.ListJobsRequest, $root.google.cloud.batch.v1.ListJobsResponse, request, callback); - }, "name", { value: "ListJobs" }); - - /** - * Calls ListJobs. - * @function listJobs - * @memberof google.cloud.batch.v1.BatchService - * @instance - * @param {google.cloud.batch.v1.IListJobsRequest} request ListJobsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.batch.v1.BatchService|getTask}. - * @memberof google.cloud.batch.v1.BatchService - * @typedef GetTaskCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.batch.v1.Task} [response] Task - */ - - /** - * Calls GetTask. - * @function getTask - * @memberof google.cloud.batch.v1.BatchService - * @instance - * @param {google.cloud.batch.v1.IGetTaskRequest} request GetTaskRequest message or plain object - * @param {google.cloud.batch.v1.BatchService.GetTaskCallback} callback Node-style callback called with the error, if any, and Task - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.getTask = function getTask(request, callback) { - return this.rpcCall(getTask, $root.google.cloud.batch.v1.GetTaskRequest, $root.google.cloud.batch.v1.Task, request, callback); - }, "name", { value: "GetTask" }); - - /** - * Calls GetTask. - * @function getTask - * @memberof google.cloud.batch.v1.BatchService - * @instance - * @param {google.cloud.batch.v1.IGetTaskRequest} request GetTaskRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.batch.v1.BatchService|listTasks}. - * @memberof google.cloud.batch.v1.BatchService - * @typedef ListTasksCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.batch.v1.ListTasksResponse} [response] ListTasksResponse - */ - - /** - * Calls ListTasks. - * @function listTasks - * @memberof google.cloud.batch.v1.BatchService - * @instance - * @param {google.cloud.batch.v1.IListTasksRequest} request ListTasksRequest message or plain object - * @param {google.cloud.batch.v1.BatchService.ListTasksCallback} callback Node-style callback called with the error, if any, and ListTasksResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.listTasks = function listTasks(request, callback) { - return this.rpcCall(listTasks, $root.google.cloud.batch.v1.ListTasksRequest, $root.google.cloud.batch.v1.ListTasksResponse, request, callback); - }, "name", { value: "ListTasks" }); - - /** - * Calls ListTasks. - * @function listTasks - * @memberof google.cloud.batch.v1.BatchService - * @instance - * @param {google.cloud.batch.v1.IListTasksRequest} request ListTasksRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return BatchService; - })(); - - v1.CreateJobRequest = (function() { - - /** - * Properties of a CreateJobRequest. - * @memberof google.cloud.batch.v1 - * @interface ICreateJobRequest - * @property {string|null} [parent] CreateJobRequest parent - * @property {string|null} [jobId] CreateJobRequest jobId - * @property {google.cloud.batch.v1.IJob|null} [job] CreateJobRequest job - * @property {string|null} [requestId] CreateJobRequest requestId - */ - - /** - * Constructs a new CreateJobRequest. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a CreateJobRequest. - * @implements ICreateJobRequest - * @constructor - * @param {google.cloud.batch.v1.ICreateJobRequest=} [properties] Properties to set - */ - function CreateJobRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateJobRequest parent. - * @member {string} parent - * @memberof google.cloud.batch.v1.CreateJobRequest - * @instance - */ - CreateJobRequest.prototype.parent = ""; - - /** - * CreateJobRequest jobId. - * @member {string} jobId - * @memberof google.cloud.batch.v1.CreateJobRequest - * @instance - */ - CreateJobRequest.prototype.jobId = ""; - - /** - * CreateJobRequest job. - * @member {google.cloud.batch.v1.IJob|null|undefined} job - * @memberof google.cloud.batch.v1.CreateJobRequest - * @instance - */ - CreateJobRequest.prototype.job = null; - - /** - * CreateJobRequest requestId. - * @member {string} requestId - * @memberof google.cloud.batch.v1.CreateJobRequest - * @instance - */ - CreateJobRequest.prototype.requestId = ""; - - /** - * Creates a new CreateJobRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.CreateJobRequest - * @static - * @param {google.cloud.batch.v1.ICreateJobRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1.CreateJobRequest} CreateJobRequest instance - */ - CreateJobRequest.create = function create(properties) { - return new CreateJobRequest(properties); - }; - - /** - * Encodes the specified CreateJobRequest message. Does not implicitly {@link google.cloud.batch.v1.CreateJobRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.CreateJobRequest - * @static - * @param {google.cloud.batch.v1.ICreateJobRequest} message CreateJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateJobRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.jobId); - if (message.job != null && Object.hasOwnProperty.call(message, "job")) - $root.google.cloud.batch.v1.Job.encode(message.job, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified CreateJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.CreateJobRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.CreateJobRequest - * @static - * @param {google.cloud.batch.v1.ICreateJobRequest} message CreateJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateJobRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateJobRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.CreateJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.CreateJobRequest} CreateJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateJobRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.CreateJobRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.jobId = reader.string(); - break; - } - case 3: { - message.job = $root.google.cloud.batch.v1.Job.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateJobRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.CreateJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.CreateJobRequest} CreateJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateJobRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateJobRequest message. - * @function verify - * @memberof google.cloud.batch.v1.CreateJobRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateJobRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.jobId != null && message.hasOwnProperty("jobId")) - if (!$util.isString(message.jobId)) - return "jobId: string expected"; - if (message.job != null && message.hasOwnProperty("job")) { - var error = $root.google.cloud.batch.v1.Job.verify(message.job); - if (error) - return "job." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a CreateJobRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.CreateJobRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.CreateJobRequest} CreateJobRequest - */ - CreateJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.CreateJobRequest) - return object; - var message = new $root.google.cloud.batch.v1.CreateJobRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.jobId != null) - message.jobId = String(object.jobId); - if (object.job != null) { - if (typeof object.job !== "object") - throw TypeError(".google.cloud.batch.v1.CreateJobRequest.job: object expected"); - message.job = $root.google.cloud.batch.v1.Job.fromObject(object.job); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a CreateJobRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.CreateJobRequest - * @static - * @param {google.cloud.batch.v1.CreateJobRequest} message CreateJobRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateJobRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.jobId = ""; - object.job = null; - object.requestId = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.jobId != null && message.hasOwnProperty("jobId")) - object.jobId = message.jobId; - if (message.job != null && message.hasOwnProperty("job")) - object.job = $root.google.cloud.batch.v1.Job.toObject(message.job, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this CreateJobRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.CreateJobRequest - * @instance - * @returns {Object.} JSON object - */ - CreateJobRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateJobRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1.CreateJobRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.CreateJobRequest"; - }; - - return CreateJobRequest; - })(); - - v1.GetJobRequest = (function() { - - /** - * Properties of a GetJobRequest. - * @memberof google.cloud.batch.v1 - * @interface IGetJobRequest - * @property {string|null} [name] GetJobRequest name - */ - - /** - * Constructs a new GetJobRequest. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a GetJobRequest. - * @implements IGetJobRequest - * @constructor - * @param {google.cloud.batch.v1.IGetJobRequest=} [properties] Properties to set - */ - function GetJobRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetJobRequest name. - * @member {string} name - * @memberof google.cloud.batch.v1.GetJobRequest - * @instance - */ - GetJobRequest.prototype.name = ""; - - /** - * Creates a new GetJobRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.GetJobRequest - * @static - * @param {google.cloud.batch.v1.IGetJobRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1.GetJobRequest} GetJobRequest instance - */ - GetJobRequest.create = function create(properties) { - return new GetJobRequest(properties); - }; - - /** - * Encodes the specified GetJobRequest message. Does not implicitly {@link google.cloud.batch.v1.GetJobRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.GetJobRequest - * @static - * @param {google.cloud.batch.v1.IGetJobRequest} message GetJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetJobRequest.encode = function encode(message, writer) { - 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 GetJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.GetJobRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.GetJobRequest - * @static - * @param {google.cloud.batch.v1.IGetJobRequest} message GetJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetJobRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetJobRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.GetJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.GetJobRequest} GetJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetJobRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.GetJobRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetJobRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.GetJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.GetJobRequest} GetJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetJobRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetJobRequest message. - * @function verify - * @memberof google.cloud.batch.v1.GetJobRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetJobRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetJobRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.GetJobRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.GetJobRequest} GetJobRequest - */ - GetJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.GetJobRequest) - return object; - var message = new $root.google.cloud.batch.v1.GetJobRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetJobRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.GetJobRequest - * @static - * @param {google.cloud.batch.v1.GetJobRequest} message GetJobRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetJobRequest.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 GetJobRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.GetJobRequest - * @instance - * @returns {Object.} JSON object - */ - GetJobRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetJobRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1.GetJobRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.GetJobRequest"; - }; - - return GetJobRequest; - })(); - - v1.DeleteJobRequest = (function() { - - /** - * Properties of a DeleteJobRequest. - * @memberof google.cloud.batch.v1 - * @interface IDeleteJobRequest - * @property {string|null} [name] DeleteJobRequest name - * @property {string|null} [reason] DeleteJobRequest reason - * @property {string|null} [requestId] DeleteJobRequest requestId - */ - - /** - * Constructs a new DeleteJobRequest. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a DeleteJobRequest. - * @implements IDeleteJobRequest - * @constructor - * @param {google.cloud.batch.v1.IDeleteJobRequest=} [properties] Properties to set - */ - function DeleteJobRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteJobRequest name. - * @member {string} name - * @memberof google.cloud.batch.v1.DeleteJobRequest - * @instance - */ - DeleteJobRequest.prototype.name = ""; - - /** - * DeleteJobRequest reason. - * @member {string} reason - * @memberof google.cloud.batch.v1.DeleteJobRequest - * @instance - */ - DeleteJobRequest.prototype.reason = ""; - - /** - * DeleteJobRequest requestId. - * @member {string} requestId - * @memberof google.cloud.batch.v1.DeleteJobRequest - * @instance - */ - DeleteJobRequest.prototype.requestId = ""; - - /** - * Creates a new DeleteJobRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.DeleteJobRequest - * @static - * @param {google.cloud.batch.v1.IDeleteJobRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1.DeleteJobRequest} DeleteJobRequest instance - */ - DeleteJobRequest.create = function create(properties) { - return new DeleteJobRequest(properties); - }; - - /** - * Encodes the specified DeleteJobRequest message. Does not implicitly {@link google.cloud.batch.v1.DeleteJobRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.DeleteJobRequest - * @static - * @param {google.cloud.batch.v1.IDeleteJobRequest} message DeleteJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteJobRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.reason); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified DeleteJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.DeleteJobRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.DeleteJobRequest - * @static - * @param {google.cloud.batch.v1.IDeleteJobRequest} message DeleteJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteJobRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteJobRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.DeleteJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.DeleteJobRequest} DeleteJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteJobRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.DeleteJobRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.reason = reader.string(); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteJobRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.DeleteJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.DeleteJobRequest} DeleteJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteJobRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteJobRequest message. - * @function verify - * @memberof google.cloud.batch.v1.DeleteJobRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteJobRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.reason != null && message.hasOwnProperty("reason")) - if (!$util.isString(message.reason)) - return "reason: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a DeleteJobRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.DeleteJobRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.DeleteJobRequest} DeleteJobRequest - */ - DeleteJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.DeleteJobRequest) - return object; - var message = new $root.google.cloud.batch.v1.DeleteJobRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.reason != null) - message.reason = String(object.reason); - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a DeleteJobRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.DeleteJobRequest - * @static - * @param {google.cloud.batch.v1.DeleteJobRequest} message DeleteJobRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteJobRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.reason = ""; - object.requestId = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.reason != null && message.hasOwnProperty("reason")) - object.reason = message.reason; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this DeleteJobRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.DeleteJobRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteJobRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteJobRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1.DeleteJobRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.DeleteJobRequest"; - }; - - return DeleteJobRequest; - })(); - - v1.ListJobsRequest = (function() { - - /** - * Properties of a ListJobsRequest. - * @memberof google.cloud.batch.v1 - * @interface IListJobsRequest - * @property {string|null} [parent] ListJobsRequest parent - * @property {string|null} [filter] ListJobsRequest filter - * @property {string|null} [orderBy] ListJobsRequest orderBy - * @property {number|null} [pageSize] ListJobsRequest pageSize - * @property {string|null} [pageToken] ListJobsRequest pageToken - */ - - /** - * Constructs a new ListJobsRequest. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a ListJobsRequest. - * @implements IListJobsRequest - * @constructor - * @param {google.cloud.batch.v1.IListJobsRequest=} [properties] Properties to set - */ - function ListJobsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListJobsRequest parent. - * @member {string} parent - * @memberof google.cloud.batch.v1.ListJobsRequest - * @instance - */ - ListJobsRequest.prototype.parent = ""; - - /** - * ListJobsRequest filter. - * @member {string} filter - * @memberof google.cloud.batch.v1.ListJobsRequest - * @instance - */ - ListJobsRequest.prototype.filter = ""; - - /** - * ListJobsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.batch.v1.ListJobsRequest - * @instance - */ - ListJobsRequest.prototype.orderBy = ""; - - /** - * ListJobsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.batch.v1.ListJobsRequest - * @instance - */ - ListJobsRequest.prototype.pageSize = 0; - - /** - * ListJobsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.batch.v1.ListJobsRequest - * @instance - */ - ListJobsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListJobsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.ListJobsRequest - * @static - * @param {google.cloud.batch.v1.IListJobsRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1.ListJobsRequest} ListJobsRequest instance - */ - ListJobsRequest.create = function create(properties) { - return new ListJobsRequest(properties); - }; - - /** - * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.cloud.batch.v1.ListJobsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.ListJobsRequest - * @static - * @param {google.cloud.batch.v1.IListJobsRequest} message ListJobsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListJobsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; - - /** - * Encodes the specified ListJobsRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ListJobsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.ListJobsRequest - * @static - * @param {google.cloud.batch.v1.IListJobsRequest} message ListJobsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListJobsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.ListJobsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.ListJobsRequest} ListJobsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListJobsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.ListJobsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListJobsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.ListJobsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.ListJobsRequest} ListJobsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListJobsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListJobsRequest message. - * @function verify - * @memberof google.cloud.batch.v1.ListJobsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListJobsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListJobsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.ListJobsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.ListJobsRequest} ListJobsRequest - */ - ListJobsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.ListJobsRequest) - return object; - var message = new $root.google.cloud.batch.v1.ListJobsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListJobsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.ListJobsRequest - * @static - * @param {google.cloud.batch.v1.ListJobsRequest} message ListJobsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListJobsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; - - /** - * Converts this ListJobsRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.ListJobsRequest - * @instance - * @returns {Object.} JSON object - */ - ListJobsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListJobsRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1.ListJobsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListJobsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.ListJobsRequest"; - }; - - return ListJobsRequest; - })(); - - v1.ListJobsResponse = (function() { - - /** - * Properties of a ListJobsResponse. - * @memberof google.cloud.batch.v1 - * @interface IListJobsResponse - * @property {Array.|null} [jobs] ListJobsResponse jobs - * @property {string|null} [nextPageToken] ListJobsResponse nextPageToken - * @property {Array.|null} [unreachable] ListJobsResponse unreachable - */ - - /** - * Constructs a new ListJobsResponse. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a ListJobsResponse. - * @implements IListJobsResponse - * @constructor - * @param {google.cloud.batch.v1.IListJobsResponse=} [properties] Properties to set - */ - function ListJobsResponse(properties) { - this.jobs = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListJobsResponse jobs. - * @member {Array.} jobs - * @memberof google.cloud.batch.v1.ListJobsResponse - * @instance - */ - ListJobsResponse.prototype.jobs = $util.emptyArray; - - /** - * ListJobsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.batch.v1.ListJobsResponse - * @instance - */ - ListJobsResponse.prototype.nextPageToken = ""; - - /** - * ListJobsResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.batch.v1.ListJobsResponse - * @instance - */ - ListJobsResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListJobsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.ListJobsResponse - * @static - * @param {google.cloud.batch.v1.IListJobsResponse=} [properties] Properties to set - * @returns {google.cloud.batch.v1.ListJobsResponse} ListJobsResponse instance - */ - ListJobsResponse.create = function create(properties) { - return new ListJobsResponse(properties); - }; - - /** - * Encodes the specified ListJobsResponse message. Does not implicitly {@link google.cloud.batch.v1.ListJobsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.ListJobsResponse - * @static - * @param {google.cloud.batch.v1.IListJobsResponse} message ListJobsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListJobsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.jobs != null && message.jobs.length) - for (var i = 0; i < message.jobs.length; ++i) - $root.google.cloud.batch.v1.Job.encode(message.jobs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; - - /** - * Encodes the specified ListJobsResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ListJobsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.ListJobsResponse - * @static - * @param {google.cloud.batch.v1.IListJobsResponse} message ListJobsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListJobsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListJobsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.ListJobsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.ListJobsResponse} ListJobsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListJobsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.ListJobsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.jobs && message.jobs.length)) - message.jobs = []; - message.jobs.push($root.google.cloud.batch.v1.Job.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListJobsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.ListJobsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.ListJobsResponse} ListJobsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListJobsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListJobsResponse message. - * @function verify - * @memberof google.cloud.batch.v1.ListJobsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListJobsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.jobs != null && message.hasOwnProperty("jobs")) { - if (!Array.isArray(message.jobs)) - return "jobs: array expected"; - for (var i = 0; i < message.jobs.length; ++i) { - var error = $root.google.cloud.batch.v1.Job.verify(message.jobs[i]); - if (error) - return "jobs." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; - - /** - * Creates a ListJobsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.ListJobsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.ListJobsResponse} ListJobsResponse - */ - ListJobsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.ListJobsResponse) - return object; - var message = new $root.google.cloud.batch.v1.ListJobsResponse(); - if (object.jobs) { - if (!Array.isArray(object.jobs)) - throw TypeError(".google.cloud.batch.v1.ListJobsResponse.jobs: array expected"); - message.jobs = []; - for (var i = 0; i < object.jobs.length; ++i) { - if (typeof object.jobs[i] !== "object") - throw TypeError(".google.cloud.batch.v1.ListJobsResponse.jobs: object expected"); - message.jobs[i] = $root.google.cloud.batch.v1.Job.fromObject(object.jobs[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.batch.v1.ListJobsResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListJobsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.ListJobsResponse - * @static - * @param {google.cloud.batch.v1.ListJobsResponse} message ListJobsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListJobsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.jobs = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.jobs && message.jobs.length) { - object.jobs = []; - for (var j = 0; j < message.jobs.length; ++j) - object.jobs[j] = $root.google.cloud.batch.v1.Job.toObject(message.jobs[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; - - /** - * Converts this ListJobsResponse to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.ListJobsResponse - * @instance - * @returns {Object.} JSON object - */ - ListJobsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListJobsResponse - * @function getTypeUrl - * @memberof google.cloud.batch.v1.ListJobsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListJobsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.ListJobsResponse"; - }; - - return ListJobsResponse; - })(); - - v1.ListTasksRequest = (function() { - - /** - * Properties of a ListTasksRequest. - * @memberof google.cloud.batch.v1 - * @interface IListTasksRequest - * @property {string|null} [parent] ListTasksRequest parent - * @property {string|null} [filter] ListTasksRequest filter - * @property {number|null} [pageSize] ListTasksRequest pageSize - * @property {string|null} [pageToken] ListTasksRequest pageToken - */ - - /** - * Constructs a new ListTasksRequest. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a ListTasksRequest. - * @implements IListTasksRequest - * @constructor - * @param {google.cloud.batch.v1.IListTasksRequest=} [properties] Properties to set - */ - function ListTasksRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListTasksRequest parent. - * @member {string} parent - * @memberof google.cloud.batch.v1.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.parent = ""; - - /** - * ListTasksRequest filter. - * @member {string} filter - * @memberof google.cloud.batch.v1.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.filter = ""; - - /** - * ListTasksRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.batch.v1.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.pageSize = 0; - - /** - * ListTasksRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.batch.v1.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.pageToken = ""; - - /** - * Creates a new ListTasksRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.ListTasksRequest - * @static - * @param {google.cloud.batch.v1.IListTasksRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1.ListTasksRequest} ListTasksRequest instance - */ - ListTasksRequest.create = function create(properties) { - return new ListTasksRequest(properties); - }; - - /** - * Encodes the specified ListTasksRequest message. Does not implicitly {@link google.cloud.batch.v1.ListTasksRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.ListTasksRequest - * @static - * @param {google.cloud.batch.v1.IListTasksRequest} message ListTasksRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTasksRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListTasksRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ListTasksRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.ListTasksRequest - * @static - * @param {google.cloud.batch.v1.IListTasksRequest} message ListTasksRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTasksRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListTasksRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.ListTasksRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.ListTasksRequest} ListTasksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTasksRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.ListTasksRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.filter = reader.string(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListTasksRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.ListTasksRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.ListTasksRequest} ListTasksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTasksRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListTasksRequest message. - * @function verify - * @memberof google.cloud.batch.v1.ListTasksRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListTasksRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListTasksRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.ListTasksRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.ListTasksRequest} ListTasksRequest - */ - ListTasksRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.ListTasksRequest) - return object; - var message = new $root.google.cloud.batch.v1.ListTasksRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListTasksRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.ListTasksRequest - * @static - * @param {google.cloud.batch.v1.ListTasksRequest} message ListTasksRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListTasksRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListTasksRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.ListTasksRequest - * @instance - * @returns {Object.} JSON object - */ - ListTasksRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListTasksRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1.ListTasksRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListTasksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.ListTasksRequest"; - }; - - return ListTasksRequest; - })(); - - v1.ListTasksResponse = (function() { - - /** - * Properties of a ListTasksResponse. - * @memberof google.cloud.batch.v1 - * @interface IListTasksResponse - * @property {Array.|null} [tasks] ListTasksResponse tasks - * @property {string|null} [nextPageToken] ListTasksResponse nextPageToken - * @property {Array.|null} [unreachable] ListTasksResponse unreachable - */ - - /** - * Constructs a new ListTasksResponse. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a ListTasksResponse. - * @implements IListTasksResponse - * @constructor - * @param {google.cloud.batch.v1.IListTasksResponse=} [properties] Properties to set - */ - function ListTasksResponse(properties) { - this.tasks = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListTasksResponse tasks. - * @member {Array.} tasks - * @memberof google.cloud.batch.v1.ListTasksResponse - * @instance - */ - ListTasksResponse.prototype.tasks = $util.emptyArray; - - /** - * ListTasksResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.batch.v1.ListTasksResponse - * @instance - */ - ListTasksResponse.prototype.nextPageToken = ""; - - /** - * ListTasksResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.batch.v1.ListTasksResponse - * @instance - */ - ListTasksResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListTasksResponse instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.ListTasksResponse - * @static - * @param {google.cloud.batch.v1.IListTasksResponse=} [properties] Properties to set - * @returns {google.cloud.batch.v1.ListTasksResponse} ListTasksResponse instance - */ - ListTasksResponse.create = function create(properties) { - return new ListTasksResponse(properties); - }; - - /** - * Encodes the specified ListTasksResponse message. Does not implicitly {@link google.cloud.batch.v1.ListTasksResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.ListTasksResponse - * @static - * @param {google.cloud.batch.v1.IListTasksResponse} message ListTasksResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTasksResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tasks != null && message.tasks.length) - for (var i = 0; i < message.tasks.length; ++i) - $root.google.cloud.batch.v1.Task.encode(message.tasks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; - - /** - * Encodes the specified ListTasksResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ListTasksResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.ListTasksResponse - * @static - * @param {google.cloud.batch.v1.IListTasksResponse} message ListTasksResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTasksResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListTasksResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.ListTasksResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.ListTasksResponse} ListTasksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTasksResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.ListTasksResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.tasks && message.tasks.length)) - message.tasks = []; - message.tasks.push($root.google.cloud.batch.v1.Task.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListTasksResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.ListTasksResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.ListTasksResponse} ListTasksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTasksResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListTasksResponse message. - * @function verify - * @memberof google.cloud.batch.v1.ListTasksResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListTasksResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tasks != null && message.hasOwnProperty("tasks")) { - if (!Array.isArray(message.tasks)) - return "tasks: array expected"; - for (var i = 0; i < message.tasks.length; ++i) { - var error = $root.google.cloud.batch.v1.Task.verify(message.tasks[i]); - if (error) - return "tasks." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; - - /** - * Creates a ListTasksResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.ListTasksResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.ListTasksResponse} ListTasksResponse - */ - ListTasksResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.ListTasksResponse) - return object; - var message = new $root.google.cloud.batch.v1.ListTasksResponse(); - if (object.tasks) { - if (!Array.isArray(object.tasks)) - throw TypeError(".google.cloud.batch.v1.ListTasksResponse.tasks: array expected"); - message.tasks = []; - for (var i = 0; i < object.tasks.length; ++i) { - if (typeof object.tasks[i] !== "object") - throw TypeError(".google.cloud.batch.v1.ListTasksResponse.tasks: object expected"); - message.tasks[i] = $root.google.cloud.batch.v1.Task.fromObject(object.tasks[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.batch.v1.ListTasksResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListTasksResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.ListTasksResponse - * @static - * @param {google.cloud.batch.v1.ListTasksResponse} message ListTasksResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListTasksResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.tasks = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.tasks && message.tasks.length) { - object.tasks = []; - for (var j = 0; j < message.tasks.length; ++j) - object.tasks[j] = $root.google.cloud.batch.v1.Task.toObject(message.tasks[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; - - /** - * Converts this ListTasksResponse to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.ListTasksResponse - * @instance - * @returns {Object.} JSON object - */ - ListTasksResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListTasksResponse - * @function getTypeUrl - * @memberof google.cloud.batch.v1.ListTasksResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListTasksResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.ListTasksResponse"; - }; - - return ListTasksResponse; - })(); - - v1.GetTaskRequest = (function() { - - /** - * Properties of a GetTaskRequest. - * @memberof google.cloud.batch.v1 - * @interface IGetTaskRequest - * @property {string|null} [name] GetTaskRequest name - */ - - /** - * Constructs a new GetTaskRequest. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a GetTaskRequest. - * @implements IGetTaskRequest - * @constructor - * @param {google.cloud.batch.v1.IGetTaskRequest=} [properties] Properties to set - */ - function GetTaskRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTaskRequest name. - * @member {string} name - * @memberof google.cloud.batch.v1.GetTaskRequest - * @instance - */ - GetTaskRequest.prototype.name = ""; - - /** - * Creates a new GetTaskRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.GetTaskRequest - * @static - * @param {google.cloud.batch.v1.IGetTaskRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1.GetTaskRequest} GetTaskRequest instance - */ - GetTaskRequest.create = function create(properties) { - return new GetTaskRequest(properties); - }; - - /** - * Encodes the specified GetTaskRequest message. Does not implicitly {@link google.cloud.batch.v1.GetTaskRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.GetTaskRequest - * @static - * @param {google.cloud.batch.v1.IGetTaskRequest} message GetTaskRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTaskRequest.encode = function encode(message, writer) { - 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 GetTaskRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.GetTaskRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.GetTaskRequest - * @static - * @param {google.cloud.batch.v1.IGetTaskRequest} message GetTaskRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTaskRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTaskRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.GetTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.GetTaskRequest} GetTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTaskRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.GetTaskRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTaskRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.GetTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.GetTaskRequest} GetTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTaskRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTaskRequest message. - * @function verify - * @memberof google.cloud.batch.v1.GetTaskRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTaskRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetTaskRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.GetTaskRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.GetTaskRequest} GetTaskRequest - */ - GetTaskRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.GetTaskRequest) - return object; - var message = new $root.google.cloud.batch.v1.GetTaskRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetTaskRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.GetTaskRequest - * @static - * @param {google.cloud.batch.v1.GetTaskRequest} message GetTaskRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTaskRequest.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 GetTaskRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.GetTaskRequest - * @instance - * @returns {Object.} JSON object - */ - GetTaskRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetTaskRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1.GetTaskRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetTaskRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.GetTaskRequest"; - }; - - return GetTaskRequest; - })(); - - v1.OperationMetadata = (function() { - - /** - * Properties of an OperationMetadata. - * @memberof google.cloud.batch.v1 - * @interface IOperationMetadata - * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime - * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime - * @property {string|null} [target] OperationMetadata target - * @property {string|null} [verb] OperationMetadata verb - * @property {string|null} [statusMessage] OperationMetadata statusMessage - * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation - * @property {string|null} [apiVersion] OperationMetadata apiVersion - */ - - /** - * Constructs a new OperationMetadata. - * @memberof google.cloud.batch.v1 - * @classdesc Represents an OperationMetadata. - * @implements IOperationMetadata - * @constructor - * @param {google.cloud.batch.v1.IOperationMetadata=} [properties] Properties to set - */ - function OperationMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OperationMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.batch.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.createTime = null; - - /** - * OperationMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.batch.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.endTime = null; - - /** - * OperationMetadata target. - * @member {string} target - * @memberof google.cloud.batch.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.target = ""; - - /** - * OperationMetadata verb. - * @member {string} verb - * @memberof google.cloud.batch.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.verb = ""; - - /** - * OperationMetadata statusMessage. - * @member {string} statusMessage - * @memberof google.cloud.batch.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.statusMessage = ""; - - /** - * OperationMetadata requestedCancellation. - * @member {boolean} requestedCancellation - * @memberof google.cloud.batch.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.requestedCancellation = false; - - /** - * OperationMetadata apiVersion. - * @member {string} apiVersion - * @memberof google.cloud.batch.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.apiVersion = ""; - - /** - * Creates a new OperationMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.OperationMetadata - * @static - * @param {google.cloud.batch.v1.IOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.batch.v1.OperationMetadata} OperationMetadata instance - */ - OperationMetadata.create = function create(properties) { - return new OperationMetadata(properties); - }; - - /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.batch.v1.OperationMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.OperationMetadata - * @static - * @param {google.cloud.batch.v1.IOperationMetadata} message OperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, 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.target != null && Object.hasOwnProperty.call(message, "target")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); - if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); - if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); - if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); - if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); - return writer; - }; - - /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.batch.v1.OperationMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.OperationMetadata - * @static - * @param {google.cloud.batch.v1.IOperationMetadata} message OperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.OperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.OperationMetadata} OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationMetadata.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.OperationMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.target = reader.string(); - break; - } - case 4: { - message.verb = reader.string(); - break; - } - case 5: { - message.statusMessage = reader.string(); - break; - } - case 6: { - message.requestedCancellation = reader.bool(); - break; - } - case 7: { - message.apiVersion = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.OperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.OperationMetadata} OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OperationMetadata message. - * @function verify - * @memberof google.cloud.batch.v1.OperationMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OperationMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - if (message.target != null && message.hasOwnProperty("target")) - if (!$util.isString(message.target)) - return "target: string expected"; - if (message.verb != null && message.hasOwnProperty("verb")) - if (!$util.isString(message.verb)) - return "verb: string expected"; - if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) - if (!$util.isString(message.statusMessage)) - return "statusMessage: string expected"; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - if (typeof message.requestedCancellation !== "boolean") - return "requestedCancellation: boolean expected"; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - if (!$util.isString(message.apiVersion)) - return "apiVersion: string expected"; - return null; - }; - - /** - * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.OperationMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.OperationMetadata} OperationMetadata - */ - OperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.OperationMetadata) - return object; - var message = new $root.google.cloud.batch.v1.OperationMetadata(); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.batch.v1.OperationMetadata.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.batch.v1.OperationMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.target != null) - message.target = String(object.target); - if (object.verb != null) - message.verb = String(object.verb); - if (object.statusMessage != null) - message.statusMessage = String(object.statusMessage); - if (object.requestedCancellation != null) - message.requestedCancellation = Boolean(object.requestedCancellation); - if (object.apiVersion != null) - message.apiVersion = String(object.apiVersion); - return message; - }; - - /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.OperationMetadata - * @static - * @param {google.cloud.batch.v1.OperationMetadata} message OperationMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OperationMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.createTime = null; - object.endTime = null; - object.target = ""; - object.verb = ""; - object.statusMessage = ""; - object.requestedCancellation = false; - object.apiVersion = ""; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.target != null && message.hasOwnProperty("target")) - object.target = message.target; - if (message.verb != null && message.hasOwnProperty("verb")) - object.verb = message.verb; - if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) - object.statusMessage = message.statusMessage; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - object.requestedCancellation = message.requestedCancellation; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - object.apiVersion = message.apiVersion; - return object; - }; - - /** - * Converts this OperationMetadata to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.OperationMetadata - * @instance - * @returns {Object.} JSON object - */ - OperationMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OperationMetadata - * @function getTypeUrl - * @memberof google.cloud.batch.v1.OperationMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.OperationMetadata"; - }; - - return OperationMetadata; - })(); - - v1.Job = (function() { - - /** - * Properties of a Job. - * @memberof google.cloud.batch.v1 - * @interface IJob - * @property {string|null} [name] Job name - * @property {string|null} [uid] Job uid - * @property {number|Long|null} [priority] Job priority - * @property {Array.|null} [taskGroups] Job taskGroups - * @property {google.cloud.batch.v1.IAllocationPolicy|null} [allocationPolicy] Job allocationPolicy - * @property {Object.|null} [labels] Job labels - * @property {google.cloud.batch.v1.IJobStatus|null} [status] Job status - * @property {google.protobuf.ITimestamp|null} [createTime] Job createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Job updateTime - * @property {google.cloud.batch.v1.ILogsPolicy|null} [logsPolicy] Job logsPolicy - * @property {Array.|null} [notifications] Job notifications - */ - - /** - * Constructs a new Job. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a Job. - * @implements IJob - * @constructor - * @param {google.cloud.batch.v1.IJob=} [properties] Properties to set - */ - function Job(properties) { - this.taskGroups = []; - this.labels = {}; - this.notifications = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Job name. - * @member {string} name - * @memberof google.cloud.batch.v1.Job - * @instance - */ - Job.prototype.name = ""; - - /** - * Job uid. - * @member {string} uid - * @memberof google.cloud.batch.v1.Job - * @instance - */ - Job.prototype.uid = ""; - - /** - * Job priority. - * @member {number|Long} priority - * @memberof google.cloud.batch.v1.Job - * @instance - */ - Job.prototype.priority = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Job taskGroups. - * @member {Array.} taskGroups - * @memberof google.cloud.batch.v1.Job - * @instance - */ - Job.prototype.taskGroups = $util.emptyArray; - - /** - * Job allocationPolicy. - * @member {google.cloud.batch.v1.IAllocationPolicy|null|undefined} allocationPolicy - * @memberof google.cloud.batch.v1.Job - * @instance - */ - Job.prototype.allocationPolicy = null; - - /** - * Job labels. - * @member {Object.} labels - * @memberof google.cloud.batch.v1.Job - * @instance - */ - Job.prototype.labels = $util.emptyObject; - - /** - * Job status. - * @member {google.cloud.batch.v1.IJobStatus|null|undefined} status - * @memberof google.cloud.batch.v1.Job - * @instance - */ - Job.prototype.status = null; - - /** - * Job createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.batch.v1.Job - * @instance - */ - Job.prototype.createTime = null; - - /** - * Job updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.batch.v1.Job - * @instance - */ - Job.prototype.updateTime = null; - - /** - * Job logsPolicy. - * @member {google.cloud.batch.v1.ILogsPolicy|null|undefined} logsPolicy - * @memberof google.cloud.batch.v1.Job - * @instance - */ - Job.prototype.logsPolicy = null; - - /** - * Job notifications. - * @member {Array.} notifications - * @memberof google.cloud.batch.v1.Job - * @instance - */ - Job.prototype.notifications = $util.emptyArray; - - /** - * Creates a new Job instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.Job - * @static - * @param {google.cloud.batch.v1.IJob=} [properties] Properties to set - * @returns {google.cloud.batch.v1.Job} Job instance - */ - Job.create = function create(properties) { - return new Job(properties); - }; - - /** - * Encodes the specified Job message. Does not implicitly {@link google.cloud.batch.v1.Job.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.Job - * @static - * @param {google.cloud.batch.v1.IJob} message Job message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Job.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); - if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.priority); - if (message.taskGroups != null && message.taskGroups.length) - for (var i = 0; i < message.taskGroups.length; ++i) - $root.google.cloud.batch.v1.TaskGroup.encode(message.taskGroups[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.allocationPolicy != null && Object.hasOwnProperty.call(message, "allocationPolicy")) - $root.google.cloud.batch.v1.AllocationPolicy.encode(message.allocationPolicy, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.cloud.batch.v1.JobStatus.encode(message.status, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.logsPolicy != null && Object.hasOwnProperty.call(message, "logsPolicy")) - $root.google.cloud.batch.v1.LogsPolicy.encode(message.logsPolicy, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.notifications != null && message.notifications.length) - for (var i = 0; i < message.notifications.length; ++i) - $root.google.cloud.batch.v1.JobNotification.encode(message.notifications[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Job.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.Job - * @static - * @param {google.cloud.batch.v1.IJob} message Job message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Job.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Job message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.Job - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.Job} Job - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Job.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Job(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.uid = reader.string(); - break; - } - case 3: { - message.priority = reader.int64(); - break; - } - case 4: { - if (!(message.taskGroups && message.taskGroups.length)) - message.taskGroups = []; - message.taskGroups.push($root.google.cloud.batch.v1.TaskGroup.decode(reader, reader.uint32())); - break; - } - case 7: { - message.allocationPolicy = $root.google.cloud.batch.v1.AllocationPolicy.decode(reader, reader.uint32()); - break; - } - case 8: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 9: { - message.status = $root.google.cloud.batch.v1.JobStatus.decode(reader, reader.uint32()); - break; - } - case 11: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 12: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 13: { - message.logsPolicy = $root.google.cloud.batch.v1.LogsPolicy.decode(reader, reader.uint32()); - break; - } - case 14: { - if (!(message.notifications && message.notifications.length)) - message.notifications = []; - message.notifications.push($root.google.cloud.batch.v1.JobNotification.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Job message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.Job - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.Job} Job - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Job.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Job message. - * @function verify - * @memberof google.cloud.batch.v1.Job - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Job.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.uid != null && message.hasOwnProperty("uid")) - if (!$util.isString(message.uid)) - return "uid: string expected"; - if (message.priority != null && message.hasOwnProperty("priority")) - if (!$util.isInteger(message.priority) && !(message.priority && $util.isInteger(message.priority.low) && $util.isInteger(message.priority.high))) - return "priority: integer|Long expected"; - if (message.taskGroups != null && message.hasOwnProperty("taskGroups")) { - if (!Array.isArray(message.taskGroups)) - return "taskGroups: array expected"; - for (var i = 0; i < message.taskGroups.length; ++i) { - var error = $root.google.cloud.batch.v1.TaskGroup.verify(message.taskGroups[i]); - if (error) - return "taskGroups." + error; - } - } - if (message.allocationPolicy != null && message.hasOwnProperty("allocationPolicy")) { - var error = $root.google.cloud.batch.v1.AllocationPolicy.verify(message.allocationPolicy); - if (error) - return "allocationPolicy." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.status != null && message.hasOwnProperty("status")) { - var error = $root.google.cloud.batch.v1.JobStatus.verify(message.status); - if (error) - return "status." + error; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.logsPolicy != null && message.hasOwnProperty("logsPolicy")) { - var error = $root.google.cloud.batch.v1.LogsPolicy.verify(message.logsPolicy); - if (error) - return "logsPolicy." + error; - } - if (message.notifications != null && message.hasOwnProperty("notifications")) { - if (!Array.isArray(message.notifications)) - return "notifications: array expected"; - for (var i = 0; i < message.notifications.length; ++i) { - var error = $root.google.cloud.batch.v1.JobNotification.verify(message.notifications[i]); - if (error) - return "notifications." + error; - } - } - return null; - }; - - /** - * Creates a Job message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.Job - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.Job} Job - */ - Job.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.Job) - return object; - var message = new $root.google.cloud.batch.v1.Job(); - if (object.name != null) - message.name = String(object.name); - if (object.uid != null) - message.uid = String(object.uid); - if (object.priority != null) - if ($util.Long) - (message.priority = $util.Long.fromValue(object.priority)).unsigned = false; - else if (typeof object.priority === "string") - message.priority = parseInt(object.priority, 10); - else if (typeof object.priority === "number") - message.priority = object.priority; - else if (typeof object.priority === "object") - message.priority = new $util.LongBits(object.priority.low >>> 0, object.priority.high >>> 0).toNumber(); - if (object.taskGroups) { - if (!Array.isArray(object.taskGroups)) - throw TypeError(".google.cloud.batch.v1.Job.taskGroups: array expected"); - message.taskGroups = []; - for (var i = 0; i < object.taskGroups.length; ++i) { - if (typeof object.taskGroups[i] !== "object") - throw TypeError(".google.cloud.batch.v1.Job.taskGroups: object expected"); - message.taskGroups[i] = $root.google.cloud.batch.v1.TaskGroup.fromObject(object.taskGroups[i]); - } - } - if (object.allocationPolicy != null) { - if (typeof object.allocationPolicy !== "object") - throw TypeError(".google.cloud.batch.v1.Job.allocationPolicy: object expected"); - message.allocationPolicy = $root.google.cloud.batch.v1.AllocationPolicy.fromObject(object.allocationPolicy); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.batch.v1.Job.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - if (object.status != null) { - if (typeof object.status !== "object") - throw TypeError(".google.cloud.batch.v1.Job.status: object expected"); - message.status = $root.google.cloud.batch.v1.JobStatus.fromObject(object.status); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.batch.v1.Job.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.batch.v1.Job.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.logsPolicy != null) { - if (typeof object.logsPolicy !== "object") - throw TypeError(".google.cloud.batch.v1.Job.logsPolicy: object expected"); - message.logsPolicy = $root.google.cloud.batch.v1.LogsPolicy.fromObject(object.logsPolicy); - } - if (object.notifications) { - if (!Array.isArray(object.notifications)) - throw TypeError(".google.cloud.batch.v1.Job.notifications: array expected"); - message.notifications = []; - for (var i = 0; i < object.notifications.length; ++i) { - if (typeof object.notifications[i] !== "object") - throw TypeError(".google.cloud.batch.v1.Job.notifications: object expected"); - message.notifications[i] = $root.google.cloud.batch.v1.JobNotification.fromObject(object.notifications[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Job message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.Job - * @static - * @param {google.cloud.batch.v1.Job} message Job - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Job.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.taskGroups = []; - object.notifications = []; - } - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.uid = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.priority = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.priority = options.longs === String ? "0" : 0; - object.allocationPolicy = null; - object.status = null; - object.createTime = null; - object.updateTime = null; - object.logsPolicy = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - if (message.priority != null && message.hasOwnProperty("priority")) - if (typeof message.priority === "number") - object.priority = options.longs === String ? String(message.priority) : message.priority; - else - object.priority = options.longs === String ? $util.Long.prototype.toString.call(message.priority) : options.longs === Number ? new $util.LongBits(message.priority.low >>> 0, message.priority.high >>> 0).toNumber() : message.priority; - if (message.taskGroups && message.taskGroups.length) { - object.taskGroups = []; - for (var j = 0; j < message.taskGroups.length; ++j) - object.taskGroups[j] = $root.google.cloud.batch.v1.TaskGroup.toObject(message.taskGroups[j], options); - } - if (message.allocationPolicy != null && message.hasOwnProperty("allocationPolicy")) - object.allocationPolicy = $root.google.cloud.batch.v1.AllocationPolicy.toObject(message.allocationPolicy, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.cloud.batch.v1.JobStatus.toObject(message.status, options); - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.logsPolicy != null && message.hasOwnProperty("logsPolicy")) - object.logsPolicy = $root.google.cloud.batch.v1.LogsPolicy.toObject(message.logsPolicy, options); - if (message.notifications && message.notifications.length) { - object.notifications = []; - for (var j = 0; j < message.notifications.length; ++j) - object.notifications[j] = $root.google.cloud.batch.v1.JobNotification.toObject(message.notifications[j], options); - } - return object; - }; - - /** - * Converts this Job to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.Job - * @instance - * @returns {Object.} JSON object - */ - Job.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Job - * @function getTypeUrl - * @memberof google.cloud.batch.v1.Job - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Job.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.Job"; - }; - - return Job; - })(); - - v1.LogsPolicy = (function() { - - /** - * Properties of a LogsPolicy. - * @memberof google.cloud.batch.v1 - * @interface ILogsPolicy - * @property {google.cloud.batch.v1.LogsPolicy.Destination|null} [destination] LogsPolicy destination - * @property {string|null} [logsPath] LogsPolicy logsPath - * @property {google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption|null} [cloudLoggingOption] LogsPolicy cloudLoggingOption - */ - - /** - * Constructs a new LogsPolicy. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a LogsPolicy. - * @implements ILogsPolicy - * @constructor - * @param {google.cloud.batch.v1.ILogsPolicy=} [properties] Properties to set - */ - function LogsPolicy(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LogsPolicy destination. - * @member {google.cloud.batch.v1.LogsPolicy.Destination} destination - * @memberof google.cloud.batch.v1.LogsPolicy - * @instance - */ - LogsPolicy.prototype.destination = 0; - - /** - * LogsPolicy logsPath. - * @member {string} logsPath - * @memberof google.cloud.batch.v1.LogsPolicy - * @instance - */ - LogsPolicy.prototype.logsPath = ""; - - /** - * LogsPolicy cloudLoggingOption. - * @member {google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption|null|undefined} cloudLoggingOption - * @memberof google.cloud.batch.v1.LogsPolicy - * @instance - */ - LogsPolicy.prototype.cloudLoggingOption = null; - - /** - * Creates a new LogsPolicy instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.LogsPolicy - * @static - * @param {google.cloud.batch.v1.ILogsPolicy=} [properties] Properties to set - * @returns {google.cloud.batch.v1.LogsPolicy} LogsPolicy instance - */ - LogsPolicy.create = function create(properties) { - return new LogsPolicy(properties); - }; - - /** - * Encodes the specified LogsPolicy message. Does not implicitly {@link google.cloud.batch.v1.LogsPolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.LogsPolicy - * @static - * @param {google.cloud.batch.v1.ILogsPolicy} message LogsPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LogsPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.destination); - if (message.logsPath != null && Object.hasOwnProperty.call(message, "logsPath")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.logsPath); - if (message.cloudLoggingOption != null && Object.hasOwnProperty.call(message, "cloudLoggingOption")) - $root.google.cloud.batch.v1.LogsPolicy.CloudLoggingOption.encode(message.cloudLoggingOption, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LogsPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.LogsPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.LogsPolicy - * @static - * @param {google.cloud.batch.v1.ILogsPolicy} message LogsPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LogsPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LogsPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.LogsPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.LogsPolicy} LogsPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LogsPolicy.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.LogsPolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.destination = reader.int32(); - break; - } - case 2: { - message.logsPath = reader.string(); - break; - } - case 3: { - message.cloudLoggingOption = $root.google.cloud.batch.v1.LogsPolicy.CloudLoggingOption.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LogsPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.LogsPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.LogsPolicy} LogsPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LogsPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LogsPolicy message. - * @function verify - * @memberof google.cloud.batch.v1.LogsPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LogsPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.destination != null && message.hasOwnProperty("destination")) - switch (message.destination) { - default: - return "destination: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.logsPath != null && message.hasOwnProperty("logsPath")) - if (!$util.isString(message.logsPath)) - return "logsPath: string expected"; - if (message.cloudLoggingOption != null && message.hasOwnProperty("cloudLoggingOption")) { - var error = $root.google.cloud.batch.v1.LogsPolicy.CloudLoggingOption.verify(message.cloudLoggingOption); - if (error) - return "cloudLoggingOption." + error; - } - return null; - }; - - /** - * Creates a LogsPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.LogsPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.LogsPolicy} LogsPolicy - */ - LogsPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.LogsPolicy) - return object; - var message = new $root.google.cloud.batch.v1.LogsPolicy(); - switch (object.destination) { - default: - if (typeof object.destination === "number") { - message.destination = object.destination; - break; - } - break; - case "DESTINATION_UNSPECIFIED": - case 0: - message.destination = 0; - break; - case "CLOUD_LOGGING": - case 1: - message.destination = 1; - break; - case "PATH": - case 2: - message.destination = 2; - break; - } - if (object.logsPath != null) - message.logsPath = String(object.logsPath); - if (object.cloudLoggingOption != null) { - if (typeof object.cloudLoggingOption !== "object") - throw TypeError(".google.cloud.batch.v1.LogsPolicy.cloudLoggingOption: object expected"); - message.cloudLoggingOption = $root.google.cloud.batch.v1.LogsPolicy.CloudLoggingOption.fromObject(object.cloudLoggingOption); - } - return message; - }; - - /** - * Creates a plain object from a LogsPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.LogsPolicy - * @static - * @param {google.cloud.batch.v1.LogsPolicy} message LogsPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LogsPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.destination = options.enums === String ? "DESTINATION_UNSPECIFIED" : 0; - object.logsPath = ""; - object.cloudLoggingOption = null; - } - if (message.destination != null && message.hasOwnProperty("destination")) - object.destination = options.enums === String ? $root.google.cloud.batch.v1.LogsPolicy.Destination[message.destination] === undefined ? message.destination : $root.google.cloud.batch.v1.LogsPolicy.Destination[message.destination] : message.destination; - if (message.logsPath != null && message.hasOwnProperty("logsPath")) - object.logsPath = message.logsPath; - if (message.cloudLoggingOption != null && message.hasOwnProperty("cloudLoggingOption")) - object.cloudLoggingOption = $root.google.cloud.batch.v1.LogsPolicy.CloudLoggingOption.toObject(message.cloudLoggingOption, options); - return object; - }; - - /** - * Converts this LogsPolicy to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.LogsPolicy - * @instance - * @returns {Object.} JSON object - */ - LogsPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LogsPolicy - * @function getTypeUrl - * @memberof google.cloud.batch.v1.LogsPolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LogsPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.LogsPolicy"; - }; - - LogsPolicy.CloudLoggingOption = (function() { - - /** - * Properties of a CloudLoggingOption. - * @memberof google.cloud.batch.v1.LogsPolicy - * @interface ICloudLoggingOption - * @property {boolean|null} [useGenericTaskMonitoredResource] CloudLoggingOption useGenericTaskMonitoredResource - */ - - /** - * Constructs a new CloudLoggingOption. - * @memberof google.cloud.batch.v1.LogsPolicy - * @classdesc Represents a CloudLoggingOption. - * @implements ICloudLoggingOption - * @constructor - * @param {google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption=} [properties] Properties to set - */ - function CloudLoggingOption(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CloudLoggingOption useGenericTaskMonitoredResource. - * @member {boolean} useGenericTaskMonitoredResource - * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption - * @instance - */ - CloudLoggingOption.prototype.useGenericTaskMonitoredResource = false; - - /** - * Creates a new CloudLoggingOption instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption - * @static - * @param {google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption=} [properties] Properties to set - * @returns {google.cloud.batch.v1.LogsPolicy.CloudLoggingOption} CloudLoggingOption instance - */ - CloudLoggingOption.create = function create(properties) { - return new CloudLoggingOption(properties); - }; - - /** - * Encodes the specified CloudLoggingOption message. Does not implicitly {@link google.cloud.batch.v1.LogsPolicy.CloudLoggingOption.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption - * @static - * @param {google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption} message CloudLoggingOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudLoggingOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.useGenericTaskMonitoredResource != null && Object.hasOwnProperty.call(message, "useGenericTaskMonitoredResource")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.useGenericTaskMonitoredResource); - return writer; - }; - - /** - * Encodes the specified CloudLoggingOption message, length delimited. Does not implicitly {@link google.cloud.batch.v1.LogsPolicy.CloudLoggingOption.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption - * @static - * @param {google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption} message CloudLoggingOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudLoggingOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CloudLoggingOption message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.LogsPolicy.CloudLoggingOption} CloudLoggingOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudLoggingOption.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.LogsPolicy.CloudLoggingOption(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.useGenericTaskMonitoredResource = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CloudLoggingOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.LogsPolicy.CloudLoggingOption} CloudLoggingOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudLoggingOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CloudLoggingOption message. - * @function verify - * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CloudLoggingOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.useGenericTaskMonitoredResource != null && message.hasOwnProperty("useGenericTaskMonitoredResource")) - if (typeof message.useGenericTaskMonitoredResource !== "boolean") - return "useGenericTaskMonitoredResource: boolean expected"; - return null; - }; - - /** - * Creates a CloudLoggingOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.LogsPolicy.CloudLoggingOption} CloudLoggingOption - */ - CloudLoggingOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.LogsPolicy.CloudLoggingOption) - return object; - var message = new $root.google.cloud.batch.v1.LogsPolicy.CloudLoggingOption(); - if (object.useGenericTaskMonitoredResource != null) - message.useGenericTaskMonitoredResource = Boolean(object.useGenericTaskMonitoredResource); - return message; - }; - - /** - * Creates a plain object from a CloudLoggingOption message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption - * @static - * @param {google.cloud.batch.v1.LogsPolicy.CloudLoggingOption} message CloudLoggingOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CloudLoggingOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.useGenericTaskMonitoredResource = false; - if (message.useGenericTaskMonitoredResource != null && message.hasOwnProperty("useGenericTaskMonitoredResource")) - object.useGenericTaskMonitoredResource = message.useGenericTaskMonitoredResource; - return object; - }; - - /** - * Converts this CloudLoggingOption to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption - * @instance - * @returns {Object.} JSON object - */ - CloudLoggingOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CloudLoggingOption - * @function getTypeUrl - * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CloudLoggingOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.LogsPolicy.CloudLoggingOption"; - }; - - return CloudLoggingOption; - })(); - - /** - * Destination enum. - * @name google.cloud.batch.v1.LogsPolicy.Destination - * @enum {number} - * @property {number} DESTINATION_UNSPECIFIED=0 DESTINATION_UNSPECIFIED value - * @property {number} CLOUD_LOGGING=1 CLOUD_LOGGING value - * @property {number} PATH=2 PATH value - */ - LogsPolicy.Destination = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DESTINATION_UNSPECIFIED"] = 0; - values[valuesById[1] = "CLOUD_LOGGING"] = 1; - values[valuesById[2] = "PATH"] = 2; - return values; - })(); - - return LogsPolicy; - })(); - - v1.JobStatus = (function() { - - /** - * Properties of a JobStatus. - * @memberof google.cloud.batch.v1 - * @interface IJobStatus - * @property {google.cloud.batch.v1.JobStatus.State|null} [state] JobStatus state - * @property {Array.|null} [statusEvents] JobStatus statusEvents - * @property {Object.|null} [taskGroups] JobStatus taskGroups - * @property {google.protobuf.IDuration|null} [runDuration] JobStatus runDuration - */ - - /** - * Constructs a new JobStatus. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a JobStatus. - * @implements IJobStatus - * @constructor - * @param {google.cloud.batch.v1.IJobStatus=} [properties] Properties to set - */ - function JobStatus(properties) { - this.statusEvents = []; - this.taskGroups = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * JobStatus state. - * @member {google.cloud.batch.v1.JobStatus.State} state - * @memberof google.cloud.batch.v1.JobStatus - * @instance - */ - JobStatus.prototype.state = 0; - - /** - * JobStatus statusEvents. - * @member {Array.} statusEvents - * @memberof google.cloud.batch.v1.JobStatus - * @instance - */ - JobStatus.prototype.statusEvents = $util.emptyArray; - - /** - * JobStatus taskGroups. - * @member {Object.} taskGroups - * @memberof google.cloud.batch.v1.JobStatus - * @instance - */ - JobStatus.prototype.taskGroups = $util.emptyObject; - - /** - * JobStatus runDuration. - * @member {google.protobuf.IDuration|null|undefined} runDuration - * @memberof google.cloud.batch.v1.JobStatus - * @instance - */ - JobStatus.prototype.runDuration = null; - - /** - * Creates a new JobStatus instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.JobStatus - * @static - * @param {google.cloud.batch.v1.IJobStatus=} [properties] Properties to set - * @returns {google.cloud.batch.v1.JobStatus} JobStatus instance - */ - JobStatus.create = function create(properties) { - return new JobStatus(properties); - }; - - /** - * Encodes the specified JobStatus message. Does not implicitly {@link google.cloud.batch.v1.JobStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.JobStatus - * @static - * @param {google.cloud.batch.v1.IJobStatus} message JobStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JobStatus.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); - if (message.statusEvents != null && message.statusEvents.length) - for (var i = 0; i < message.statusEvents.length; ++i) - $root.google.cloud.batch.v1.StatusEvent.encode(message.statusEvents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.taskGroups != null && Object.hasOwnProperty.call(message, "taskGroups")) - for (var keys = Object.keys(message.taskGroups), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.batch.v1.JobStatus.TaskGroupStatus.encode(message.taskGroups[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.runDuration != null && Object.hasOwnProperty.call(message, "runDuration")) - $root.google.protobuf.Duration.encode(message.runDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified JobStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.JobStatus - * @static - * @param {google.cloud.batch.v1.IJobStatus} message JobStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JobStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a JobStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.JobStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.JobStatus} JobStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JobStatus.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.JobStatus(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.state = reader.int32(); - break; - } - case 2: { - if (!(message.statusEvents && message.statusEvents.length)) - message.statusEvents = []; - message.statusEvents.push($root.google.cloud.batch.v1.StatusEvent.decode(reader, reader.uint32())); - break; - } - case 4: { - if (message.taskGroups === $util.emptyObject) - message.taskGroups = {}; - 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.cloud.batch.v1.JobStatus.TaskGroupStatus.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.taskGroups[key] = value; - break; - } - case 5: { - message.runDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a JobStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.JobStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.JobStatus} JobStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JobStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a JobStatus message. - * @function verify - * @memberof google.cloud.batch.v1.JobStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - JobStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.statusEvents != null && message.hasOwnProperty("statusEvents")) { - if (!Array.isArray(message.statusEvents)) - return "statusEvents: array expected"; - for (var i = 0; i < message.statusEvents.length; ++i) { - var error = $root.google.cloud.batch.v1.StatusEvent.verify(message.statusEvents[i]); - if (error) - return "statusEvents." + error; - } - } - if (message.taskGroups != null && message.hasOwnProperty("taskGroups")) { - if (!$util.isObject(message.taskGroups)) - return "taskGroups: object expected"; - var key = Object.keys(message.taskGroups); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.batch.v1.JobStatus.TaskGroupStatus.verify(message.taskGroups[key[i]]); - if (error) - return "taskGroups." + error; - } - } - if (message.runDuration != null && message.hasOwnProperty("runDuration")) { - var error = $root.google.protobuf.Duration.verify(message.runDuration); - if (error) - return "runDuration." + error; - } - return null; - }; - - /** - * Creates a JobStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.JobStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.JobStatus} JobStatus - */ - JobStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.JobStatus) - return object; - var message = new $root.google.cloud.batch.v1.JobStatus(); - 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 "QUEUED": - case 1: - message.state = 1; - break; - case "SCHEDULED": - case 2: - message.state = 2; - break; - case "RUNNING": - case 3: - message.state = 3; - break; - case "SUCCEEDED": - case 4: - message.state = 4; - break; - case "FAILED": - case 5: - message.state = 5; - break; - case "DELETION_IN_PROGRESS": - case 6: - message.state = 6; - break; - } - if (object.statusEvents) { - if (!Array.isArray(object.statusEvents)) - throw TypeError(".google.cloud.batch.v1.JobStatus.statusEvents: array expected"); - message.statusEvents = []; - for (var i = 0; i < object.statusEvents.length; ++i) { - if (typeof object.statusEvents[i] !== "object") - throw TypeError(".google.cloud.batch.v1.JobStatus.statusEvents: object expected"); - message.statusEvents[i] = $root.google.cloud.batch.v1.StatusEvent.fromObject(object.statusEvents[i]); - } - } - if (object.taskGroups) { - if (typeof object.taskGroups !== "object") - throw TypeError(".google.cloud.batch.v1.JobStatus.taskGroups: object expected"); - message.taskGroups = {}; - for (var keys = Object.keys(object.taskGroups), i = 0; i < keys.length; ++i) { - if (typeof object.taskGroups[keys[i]] !== "object") - throw TypeError(".google.cloud.batch.v1.JobStatus.taskGroups: object expected"); - message.taskGroups[keys[i]] = $root.google.cloud.batch.v1.JobStatus.TaskGroupStatus.fromObject(object.taskGroups[keys[i]]); - } - } - if (object.runDuration != null) { - if (typeof object.runDuration !== "object") - throw TypeError(".google.cloud.batch.v1.JobStatus.runDuration: object expected"); - message.runDuration = $root.google.protobuf.Duration.fromObject(object.runDuration); - } - return message; - }; - - /** - * Creates a plain object from a JobStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.JobStatus - * @static - * @param {google.cloud.batch.v1.JobStatus} message JobStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - JobStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.statusEvents = []; - if (options.objects || options.defaults) - object.taskGroups = {}; - if (options.defaults) { - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.runDuration = null; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.batch.v1.JobStatus.State[message.state] === undefined ? message.state : $root.google.cloud.batch.v1.JobStatus.State[message.state] : message.state; - if (message.statusEvents && message.statusEvents.length) { - object.statusEvents = []; - for (var j = 0; j < message.statusEvents.length; ++j) - object.statusEvents[j] = $root.google.cloud.batch.v1.StatusEvent.toObject(message.statusEvents[j], options); - } - var keys2; - if (message.taskGroups && (keys2 = Object.keys(message.taskGroups)).length) { - object.taskGroups = {}; - for (var j = 0; j < keys2.length; ++j) - object.taskGroups[keys2[j]] = $root.google.cloud.batch.v1.JobStatus.TaskGroupStatus.toObject(message.taskGroups[keys2[j]], options); - } - if (message.runDuration != null && message.hasOwnProperty("runDuration")) - object.runDuration = $root.google.protobuf.Duration.toObject(message.runDuration, options); - return object; - }; - - /** - * Converts this JobStatus to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.JobStatus - * @instance - * @returns {Object.} JSON object - */ - JobStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for JobStatus - * @function getTypeUrl - * @memberof google.cloud.batch.v1.JobStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - JobStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.JobStatus"; - }; - - JobStatus.InstanceStatus = (function() { - - /** - * Properties of an InstanceStatus. - * @memberof google.cloud.batch.v1.JobStatus - * @interface IInstanceStatus - * @property {string|null} [machineType] InstanceStatus machineType - * @property {google.cloud.batch.v1.AllocationPolicy.ProvisioningModel|null} [provisioningModel] InstanceStatus provisioningModel - * @property {number|Long|null} [taskPack] InstanceStatus taskPack - * @property {google.cloud.batch.v1.AllocationPolicy.IDisk|null} [bootDisk] InstanceStatus bootDisk - */ - - /** - * Constructs a new InstanceStatus. - * @memberof google.cloud.batch.v1.JobStatus - * @classdesc Represents an InstanceStatus. - * @implements IInstanceStatus - * @constructor - * @param {google.cloud.batch.v1.JobStatus.IInstanceStatus=} [properties] Properties to set - */ - function InstanceStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InstanceStatus machineType. - * @member {string} machineType - * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus - * @instance - */ - InstanceStatus.prototype.machineType = ""; - - /** - * InstanceStatus provisioningModel. - * @member {google.cloud.batch.v1.AllocationPolicy.ProvisioningModel} provisioningModel - * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus - * @instance - */ - InstanceStatus.prototype.provisioningModel = 0; - - /** - * InstanceStatus taskPack. - * @member {number|Long} taskPack - * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus - * @instance - */ - InstanceStatus.prototype.taskPack = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * InstanceStatus bootDisk. - * @member {google.cloud.batch.v1.AllocationPolicy.IDisk|null|undefined} bootDisk - * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus - * @instance - */ - InstanceStatus.prototype.bootDisk = null; - - /** - * Creates a new InstanceStatus instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus - * @static - * @param {google.cloud.batch.v1.JobStatus.IInstanceStatus=} [properties] Properties to set - * @returns {google.cloud.batch.v1.JobStatus.InstanceStatus} InstanceStatus instance - */ - InstanceStatus.create = function create(properties) { - return new InstanceStatus(properties); - }; - - /** - * Encodes the specified InstanceStatus message. Does not implicitly {@link google.cloud.batch.v1.JobStatus.InstanceStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus - * @static - * @param {google.cloud.batch.v1.JobStatus.IInstanceStatus} message InstanceStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.machineType); - if (message.provisioningModel != null && Object.hasOwnProperty.call(message, "provisioningModel")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.provisioningModel); - if (message.taskPack != null && Object.hasOwnProperty.call(message, "taskPack")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.taskPack); - if (message.bootDisk != null && Object.hasOwnProperty.call(message, "bootDisk")) - $root.google.cloud.batch.v1.AllocationPolicy.Disk.encode(message.bootDisk, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified InstanceStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobStatus.InstanceStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus - * @static - * @param {google.cloud.batch.v1.JobStatus.IInstanceStatus} message InstanceStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InstanceStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.JobStatus.InstanceStatus} InstanceStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceStatus.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.JobStatus.InstanceStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.machineType = reader.string(); - break; - } - case 2: { - message.provisioningModel = reader.int32(); - break; - } - case 3: { - message.taskPack = reader.int64(); - break; - } - case 4: { - message.bootDisk = $root.google.cloud.batch.v1.AllocationPolicy.Disk.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InstanceStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.JobStatus.InstanceStatus} InstanceStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InstanceStatus message. - * @function verify - * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstanceStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.machineType != null && message.hasOwnProperty("machineType")) - if (!$util.isString(message.machineType)) - return "machineType: string expected"; - if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) - switch (message.provisioningModel) { - default: - return "provisioningModel: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.taskPack != null && message.hasOwnProperty("taskPack")) - if (!$util.isInteger(message.taskPack) && !(message.taskPack && $util.isInteger(message.taskPack.low) && $util.isInteger(message.taskPack.high))) - return "taskPack: integer|Long expected"; - if (message.bootDisk != null && message.hasOwnProperty("bootDisk")) { - var error = $root.google.cloud.batch.v1.AllocationPolicy.Disk.verify(message.bootDisk); - if (error) - return "bootDisk." + error; - } - return null; - }; - - /** - * Creates an InstanceStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.JobStatus.InstanceStatus} InstanceStatus - */ - InstanceStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.JobStatus.InstanceStatus) - return object; - var message = new $root.google.cloud.batch.v1.JobStatus.InstanceStatus(); - if (object.machineType != null) - message.machineType = String(object.machineType); - switch (object.provisioningModel) { - default: - if (typeof object.provisioningModel === "number") { - message.provisioningModel = object.provisioningModel; - break; - } - break; - case "PROVISIONING_MODEL_UNSPECIFIED": - case 0: - message.provisioningModel = 0; - break; - case "STANDARD": - case 1: - message.provisioningModel = 1; - break; - case "SPOT": - case 2: - message.provisioningModel = 2; - break; - case "PREEMPTIBLE": - case 3: - message.provisioningModel = 3; - break; - } - if (object.taskPack != null) - if ($util.Long) - (message.taskPack = $util.Long.fromValue(object.taskPack)).unsigned = false; - else if (typeof object.taskPack === "string") - message.taskPack = parseInt(object.taskPack, 10); - else if (typeof object.taskPack === "number") - message.taskPack = object.taskPack; - else if (typeof object.taskPack === "object") - message.taskPack = new $util.LongBits(object.taskPack.low >>> 0, object.taskPack.high >>> 0).toNumber(); - if (object.bootDisk != null) { - if (typeof object.bootDisk !== "object") - throw TypeError(".google.cloud.batch.v1.JobStatus.InstanceStatus.bootDisk: object expected"); - message.bootDisk = $root.google.cloud.batch.v1.AllocationPolicy.Disk.fromObject(object.bootDisk); - } - return message; - }; - - /** - * Creates a plain object from an InstanceStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus - * @static - * @param {google.cloud.batch.v1.JobStatus.InstanceStatus} message InstanceStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstanceStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.machineType = ""; - object.provisioningModel = options.enums === String ? "PROVISIONING_MODEL_UNSPECIFIED" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.taskPack = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.taskPack = options.longs === String ? "0" : 0; - object.bootDisk = null; - } - if (message.machineType != null && message.hasOwnProperty("machineType")) - object.machineType = message.machineType; - if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) - object.provisioningModel = options.enums === String ? $root.google.cloud.batch.v1.AllocationPolicy.ProvisioningModel[message.provisioningModel] === undefined ? message.provisioningModel : $root.google.cloud.batch.v1.AllocationPolicy.ProvisioningModel[message.provisioningModel] : message.provisioningModel; - if (message.taskPack != null && message.hasOwnProperty("taskPack")) - if (typeof message.taskPack === "number") - object.taskPack = options.longs === String ? String(message.taskPack) : message.taskPack; - else - object.taskPack = options.longs === String ? $util.Long.prototype.toString.call(message.taskPack) : options.longs === Number ? new $util.LongBits(message.taskPack.low >>> 0, message.taskPack.high >>> 0).toNumber() : message.taskPack; - if (message.bootDisk != null && message.hasOwnProperty("bootDisk")) - object.bootDisk = $root.google.cloud.batch.v1.AllocationPolicy.Disk.toObject(message.bootDisk, options); - return object; - }; - - /** - * Converts this InstanceStatus to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus - * @instance - * @returns {Object.} JSON object - */ - InstanceStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InstanceStatus - * @function getTypeUrl - * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstanceStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.JobStatus.InstanceStatus"; - }; - - return InstanceStatus; - })(); - - JobStatus.TaskGroupStatus = (function() { - - /** - * Properties of a TaskGroupStatus. - * @memberof google.cloud.batch.v1.JobStatus - * @interface ITaskGroupStatus - * @property {Object.|null} [counts] TaskGroupStatus counts - * @property {Array.|null} [instances] TaskGroupStatus instances - */ - - /** - * Constructs a new TaskGroupStatus. - * @memberof google.cloud.batch.v1.JobStatus - * @classdesc Represents a TaskGroupStatus. - * @implements ITaskGroupStatus - * @constructor - * @param {google.cloud.batch.v1.JobStatus.ITaskGroupStatus=} [properties] Properties to set - */ - function TaskGroupStatus(properties) { - this.counts = {}; - this.instances = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TaskGroupStatus counts. - * @member {Object.} counts - * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus - * @instance - */ - TaskGroupStatus.prototype.counts = $util.emptyObject; - - /** - * TaskGroupStatus instances. - * @member {Array.} instances - * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus - * @instance - */ - TaskGroupStatus.prototype.instances = $util.emptyArray; - - /** - * Creates a new TaskGroupStatus instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus - * @static - * @param {google.cloud.batch.v1.JobStatus.ITaskGroupStatus=} [properties] Properties to set - * @returns {google.cloud.batch.v1.JobStatus.TaskGroupStatus} TaskGroupStatus instance - */ - TaskGroupStatus.create = function create(properties) { - return new TaskGroupStatus(properties); - }; - - /** - * Encodes the specified TaskGroupStatus message. Does not implicitly {@link google.cloud.batch.v1.JobStatus.TaskGroupStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus - * @static - * @param {google.cloud.batch.v1.JobStatus.ITaskGroupStatus} message TaskGroupStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskGroupStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.counts != null && Object.hasOwnProperty.call(message, "counts")) - for (var keys = Object.keys(message.counts), i = 0; i < keys.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int64(message.counts[keys[i]]).ldelim(); - if (message.instances != null && message.instances.length) - for (var i = 0; i < message.instances.length; ++i) - $root.google.cloud.batch.v1.JobStatus.InstanceStatus.encode(message.instances[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TaskGroupStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobStatus.TaskGroupStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus - * @static - * @param {google.cloud.batch.v1.JobStatus.ITaskGroupStatus} message TaskGroupStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskGroupStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TaskGroupStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.JobStatus.TaskGroupStatus} TaskGroupStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskGroupStatus.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.JobStatus.TaskGroupStatus(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (message.counts === $util.emptyObject) - message.counts = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = 0; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.int64(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.counts[key] = value; - break; - } - case 2: { - if (!(message.instances && message.instances.length)) - message.instances = []; - message.instances.push($root.google.cloud.batch.v1.JobStatus.InstanceStatus.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TaskGroupStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.JobStatus.TaskGroupStatus} TaskGroupStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskGroupStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TaskGroupStatus message. - * @function verify - * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TaskGroupStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.counts != null && message.hasOwnProperty("counts")) { - if (!$util.isObject(message.counts)) - return "counts: object expected"; - var key = Object.keys(message.counts); - for (var i = 0; i < key.length; ++i) - if (!$util.isInteger(message.counts[key[i]]) && !(message.counts[key[i]] && $util.isInteger(message.counts[key[i]].low) && $util.isInteger(message.counts[key[i]].high))) - return "counts: integer|Long{k:string} expected"; - } - if (message.instances != null && message.hasOwnProperty("instances")) { - if (!Array.isArray(message.instances)) - return "instances: array expected"; - for (var i = 0; i < message.instances.length; ++i) { - var error = $root.google.cloud.batch.v1.JobStatus.InstanceStatus.verify(message.instances[i]); - if (error) - return "instances." + error; - } - } - return null; - }; - - /** - * Creates a TaskGroupStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.JobStatus.TaskGroupStatus} TaskGroupStatus - */ - TaskGroupStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.JobStatus.TaskGroupStatus) - return object; - var message = new $root.google.cloud.batch.v1.JobStatus.TaskGroupStatus(); - if (object.counts) { - if (typeof object.counts !== "object") - throw TypeError(".google.cloud.batch.v1.JobStatus.TaskGroupStatus.counts: object expected"); - message.counts = {}; - for (var keys = Object.keys(object.counts), i = 0; i < keys.length; ++i) - if ($util.Long) - (message.counts[keys[i]] = $util.Long.fromValue(object.counts[keys[i]])).unsigned = false; - else if (typeof object.counts[keys[i]] === "string") - message.counts[keys[i]] = parseInt(object.counts[keys[i]], 10); - else if (typeof object.counts[keys[i]] === "number") - message.counts[keys[i]] = object.counts[keys[i]]; - else if (typeof object.counts[keys[i]] === "object") - message.counts[keys[i]] = new $util.LongBits(object.counts[keys[i]].low >>> 0, object.counts[keys[i]].high >>> 0).toNumber(); - } - if (object.instances) { - if (!Array.isArray(object.instances)) - throw TypeError(".google.cloud.batch.v1.JobStatus.TaskGroupStatus.instances: array expected"); - message.instances = []; - for (var i = 0; i < object.instances.length; ++i) { - if (typeof object.instances[i] !== "object") - throw TypeError(".google.cloud.batch.v1.JobStatus.TaskGroupStatus.instances: object expected"); - message.instances[i] = $root.google.cloud.batch.v1.JobStatus.InstanceStatus.fromObject(object.instances[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a TaskGroupStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus - * @static - * @param {google.cloud.batch.v1.JobStatus.TaskGroupStatus} message TaskGroupStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TaskGroupStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.instances = []; - if (options.objects || options.defaults) - object.counts = {}; - var keys2; - if (message.counts && (keys2 = Object.keys(message.counts)).length) { - object.counts = {}; - for (var j = 0; j < keys2.length; ++j) - if (typeof message.counts[keys2[j]] === "number") - object.counts[keys2[j]] = options.longs === String ? String(message.counts[keys2[j]]) : message.counts[keys2[j]]; - else - object.counts[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.counts[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.counts[keys2[j]].low >>> 0, message.counts[keys2[j]].high >>> 0).toNumber() : message.counts[keys2[j]]; - } - if (message.instances && message.instances.length) { - object.instances = []; - for (var j = 0; j < message.instances.length; ++j) - object.instances[j] = $root.google.cloud.batch.v1.JobStatus.InstanceStatus.toObject(message.instances[j], options); - } - return object; - }; - - /** - * Converts this TaskGroupStatus to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus - * @instance - * @returns {Object.} JSON object - */ - TaskGroupStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TaskGroupStatus - * @function getTypeUrl - * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TaskGroupStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.JobStatus.TaskGroupStatus"; - }; - - return TaskGroupStatus; - })(); - - /** - * State enum. - * @name google.cloud.batch.v1.JobStatus.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} QUEUED=1 QUEUED value - * @property {number} SCHEDULED=2 SCHEDULED value - * @property {number} RUNNING=3 RUNNING value - * @property {number} SUCCEEDED=4 SUCCEEDED value - * @property {number} FAILED=5 FAILED value - * @property {number} DELETION_IN_PROGRESS=6 DELETION_IN_PROGRESS value - */ - JobStatus.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "QUEUED"] = 1; - values[valuesById[2] = "SCHEDULED"] = 2; - values[valuesById[3] = "RUNNING"] = 3; - values[valuesById[4] = "SUCCEEDED"] = 4; - values[valuesById[5] = "FAILED"] = 5; - values[valuesById[6] = "DELETION_IN_PROGRESS"] = 6; - return values; - })(); - - return JobStatus; - })(); - - v1.JobNotification = (function() { - - /** - * Properties of a JobNotification. - * @memberof google.cloud.batch.v1 - * @interface IJobNotification - * @property {string|null} [pubsubTopic] JobNotification pubsubTopic - * @property {google.cloud.batch.v1.JobNotification.IMessage|null} [message] JobNotification message - */ - - /** - * Constructs a new JobNotification. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a JobNotification. - * @implements IJobNotification - * @constructor - * @param {google.cloud.batch.v1.IJobNotification=} [properties] Properties to set - */ - function JobNotification(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * JobNotification pubsubTopic. - * @member {string} pubsubTopic - * @memberof google.cloud.batch.v1.JobNotification - * @instance - */ - JobNotification.prototype.pubsubTopic = ""; - - /** - * JobNotification message. - * @member {google.cloud.batch.v1.JobNotification.IMessage|null|undefined} message - * @memberof google.cloud.batch.v1.JobNotification - * @instance - */ - JobNotification.prototype.message = null; - - /** - * Creates a new JobNotification instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.JobNotification - * @static - * @param {google.cloud.batch.v1.IJobNotification=} [properties] Properties to set - * @returns {google.cloud.batch.v1.JobNotification} JobNotification instance - */ - JobNotification.create = function create(properties) { - return new JobNotification(properties); - }; - - /** - * Encodes the specified JobNotification message. Does not implicitly {@link google.cloud.batch.v1.JobNotification.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.JobNotification - * @static - * @param {google.cloud.batch.v1.IJobNotification} message JobNotification message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JobNotification.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pubsubTopic != null && Object.hasOwnProperty.call(message, "pubsubTopic")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.pubsubTopic); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - $root.google.cloud.batch.v1.JobNotification.Message.encode(message.message, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified JobNotification message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobNotification.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.JobNotification - * @static - * @param {google.cloud.batch.v1.IJobNotification} message JobNotification message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JobNotification.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a JobNotification message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.JobNotification - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.JobNotification} JobNotification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JobNotification.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.JobNotification(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.pubsubTopic = reader.string(); - break; - } - case 2: { - message.message = $root.google.cloud.batch.v1.JobNotification.Message.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a JobNotification message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.JobNotification - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.JobNotification} JobNotification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JobNotification.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a JobNotification message. - * @function verify - * @memberof google.cloud.batch.v1.JobNotification - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - JobNotification.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) - if (!$util.isString(message.pubsubTopic)) - return "pubsubTopic: string expected"; - if (message.message != null && message.hasOwnProperty("message")) { - var error = $root.google.cloud.batch.v1.JobNotification.Message.verify(message.message); - if (error) - return "message." + error; - } - return null; - }; - - /** - * Creates a JobNotification message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.JobNotification - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.JobNotification} JobNotification - */ - JobNotification.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.JobNotification) - return object; - var message = new $root.google.cloud.batch.v1.JobNotification(); - if (object.pubsubTopic != null) - message.pubsubTopic = String(object.pubsubTopic); - if (object.message != null) { - if (typeof object.message !== "object") - throw TypeError(".google.cloud.batch.v1.JobNotification.message: object expected"); - message.message = $root.google.cloud.batch.v1.JobNotification.Message.fromObject(object.message); - } - return message; - }; - - /** - * Creates a plain object from a JobNotification message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.JobNotification - * @static - * @param {google.cloud.batch.v1.JobNotification} message JobNotification - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - JobNotification.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.pubsubTopic = ""; - object.message = null; - } - if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) - object.pubsubTopic = message.pubsubTopic; - if (message.message != null && message.hasOwnProperty("message")) - object.message = $root.google.cloud.batch.v1.JobNotification.Message.toObject(message.message, options); - return object; - }; - - /** - * Converts this JobNotification to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.JobNotification - * @instance - * @returns {Object.} JSON object - */ - JobNotification.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for JobNotification - * @function getTypeUrl - * @memberof google.cloud.batch.v1.JobNotification - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - JobNotification.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.JobNotification"; - }; - - JobNotification.Message = (function() { - - /** - * Properties of a Message. - * @memberof google.cloud.batch.v1.JobNotification - * @interface IMessage - * @property {google.cloud.batch.v1.JobNotification.Type|null} [type] Message type - * @property {google.cloud.batch.v1.JobStatus.State|null} [newJobState] Message newJobState - * @property {google.cloud.batch.v1.TaskStatus.State|null} [newTaskState] Message newTaskState - */ - - /** - * Constructs a new Message. - * @memberof google.cloud.batch.v1.JobNotification - * @classdesc Represents a Message. - * @implements IMessage - * @constructor - * @param {google.cloud.batch.v1.JobNotification.IMessage=} [properties] Properties to set - */ - function Message(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Message type. - * @member {google.cloud.batch.v1.JobNotification.Type} type - * @memberof google.cloud.batch.v1.JobNotification.Message - * @instance - */ - Message.prototype.type = 0; - - /** - * Message newJobState. - * @member {google.cloud.batch.v1.JobStatus.State} newJobState - * @memberof google.cloud.batch.v1.JobNotification.Message - * @instance - */ - Message.prototype.newJobState = 0; - - /** - * Message newTaskState. - * @member {google.cloud.batch.v1.TaskStatus.State} newTaskState - * @memberof google.cloud.batch.v1.JobNotification.Message - * @instance - */ - Message.prototype.newTaskState = 0; - - /** - * Creates a new Message instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.JobNotification.Message - * @static - * @param {google.cloud.batch.v1.JobNotification.IMessage=} [properties] Properties to set - * @returns {google.cloud.batch.v1.JobNotification.Message} Message instance - */ - Message.create = function create(properties) { - return new Message(properties); - }; - - /** - * Encodes the specified Message message. Does not implicitly {@link google.cloud.batch.v1.JobNotification.Message.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.JobNotification.Message - * @static - * @param {google.cloud.batch.v1.JobNotification.IMessage} message Message message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Message.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); - if (message.newJobState != null && Object.hasOwnProperty.call(message, "newJobState")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.newJobState); - if (message.newTaskState != null && Object.hasOwnProperty.call(message, "newTaskState")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.newTaskState); - return writer; - }; - - /** - * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobNotification.Message.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.JobNotification.Message - * @static - * @param {google.cloud.batch.v1.JobNotification.IMessage} message Message message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Message.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Message message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.JobNotification.Message - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.JobNotification.Message} Message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Message.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.JobNotification.Message(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.type = reader.int32(); - break; - } - case 2: { - message.newJobState = reader.int32(); - break; - } - case 3: { - message.newTaskState = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Message message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.JobNotification.Message - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.JobNotification.Message} Message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Message.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Message message. - * @function verify - * @memberof google.cloud.batch.v1.JobNotification.Message - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Message.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.newJobState != null && message.hasOwnProperty("newJobState")) - switch (message.newJobState) { - default: - return "newJobState: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.newTaskState != null && message.hasOwnProperty("newTaskState")) - switch (message.newTaskState) { - default: - return "newTaskState: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - return null; - }; - - /** - * Creates a Message message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.JobNotification.Message - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.JobNotification.Message} Message - */ - Message.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.JobNotification.Message) - return object; - var message = new $root.google.cloud.batch.v1.JobNotification.Message(); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "JOB_STATE_CHANGED": - case 1: - message.type = 1; - break; - case "TASK_STATE_CHANGED": - case 2: - message.type = 2; - break; - } - switch (object.newJobState) { - default: - if (typeof object.newJobState === "number") { - message.newJobState = object.newJobState; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.newJobState = 0; - break; - case "QUEUED": - case 1: - message.newJobState = 1; - break; - case "SCHEDULED": - case 2: - message.newJobState = 2; - break; - case "RUNNING": - case 3: - message.newJobState = 3; - break; - case "SUCCEEDED": - case 4: - message.newJobState = 4; - break; - case "FAILED": - case 5: - message.newJobState = 5; - break; - case "DELETION_IN_PROGRESS": - case 6: - message.newJobState = 6; - break; - } - switch (object.newTaskState) { - default: - if (typeof object.newTaskState === "number") { - message.newTaskState = object.newTaskState; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.newTaskState = 0; - break; - case "PENDING": - case 1: - message.newTaskState = 1; - break; - case "ASSIGNED": - case 2: - message.newTaskState = 2; - break; - case "RUNNING": - case 3: - message.newTaskState = 3; - break; - case "FAILED": - case 4: - message.newTaskState = 4; - break; - case "SUCCEEDED": - case 5: - message.newTaskState = 5; - break; - case "UNEXECUTED": - case 6: - message.newTaskState = 6; - break; - } - return message; - }; - - /** - * Creates a plain object from a Message message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.JobNotification.Message - * @static - * @param {google.cloud.batch.v1.JobNotification.Message} message Message - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Message.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.newJobState = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.newTaskState = options.enums === String ? "STATE_UNSPECIFIED" : 0; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.batch.v1.JobNotification.Type[message.type] === undefined ? message.type : $root.google.cloud.batch.v1.JobNotification.Type[message.type] : message.type; - if (message.newJobState != null && message.hasOwnProperty("newJobState")) - object.newJobState = options.enums === String ? $root.google.cloud.batch.v1.JobStatus.State[message.newJobState] === undefined ? message.newJobState : $root.google.cloud.batch.v1.JobStatus.State[message.newJobState] : message.newJobState; - if (message.newTaskState != null && message.hasOwnProperty("newTaskState")) - object.newTaskState = options.enums === String ? $root.google.cloud.batch.v1.TaskStatus.State[message.newTaskState] === undefined ? message.newTaskState : $root.google.cloud.batch.v1.TaskStatus.State[message.newTaskState] : message.newTaskState; - return object; - }; - - /** - * Converts this Message to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.JobNotification.Message - * @instance - * @returns {Object.} JSON object - */ - Message.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Message - * @function getTypeUrl - * @memberof google.cloud.batch.v1.JobNotification.Message - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Message.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.JobNotification.Message"; - }; - - return Message; - })(); - - /** - * Type enum. - * @name google.cloud.batch.v1.JobNotification.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} JOB_STATE_CHANGED=1 JOB_STATE_CHANGED value - * @property {number} TASK_STATE_CHANGED=2 TASK_STATE_CHANGED value - */ - JobNotification.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "JOB_STATE_CHANGED"] = 1; - values[valuesById[2] = "TASK_STATE_CHANGED"] = 2; - return values; - })(); - - return JobNotification; - })(); - - v1.AllocationPolicy = (function() { - - /** - * Properties of an AllocationPolicy. - * @memberof google.cloud.batch.v1 - * @interface IAllocationPolicy - * @property {google.cloud.batch.v1.AllocationPolicy.ILocationPolicy|null} [location] AllocationPolicy location - * @property {Array.|null} [instances] AllocationPolicy instances - * @property {google.cloud.batch.v1.IServiceAccount|null} [serviceAccount] AllocationPolicy serviceAccount - * @property {Object.|null} [labels] AllocationPolicy labels - * @property {google.cloud.batch.v1.AllocationPolicy.INetworkPolicy|null} [network] AllocationPolicy network - * @property {google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy|null} [placement] AllocationPolicy placement - * @property {Array.|null} [tags] AllocationPolicy tags - */ - - /** - * Constructs a new AllocationPolicy. - * @memberof google.cloud.batch.v1 - * @classdesc Represents an AllocationPolicy. - * @implements IAllocationPolicy - * @constructor - * @param {google.cloud.batch.v1.IAllocationPolicy=} [properties] Properties to set - */ - function AllocationPolicy(properties) { - this.instances = []; - this.labels = {}; - this.tags = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AllocationPolicy location. - * @member {google.cloud.batch.v1.AllocationPolicy.ILocationPolicy|null|undefined} location - * @memberof google.cloud.batch.v1.AllocationPolicy - * @instance - */ - AllocationPolicy.prototype.location = null; - - /** - * AllocationPolicy instances. - * @member {Array.} instances - * @memberof google.cloud.batch.v1.AllocationPolicy - * @instance - */ - AllocationPolicy.prototype.instances = $util.emptyArray; - - /** - * AllocationPolicy serviceAccount. - * @member {google.cloud.batch.v1.IServiceAccount|null|undefined} serviceAccount - * @memberof google.cloud.batch.v1.AllocationPolicy - * @instance - */ - AllocationPolicy.prototype.serviceAccount = null; - - /** - * AllocationPolicy labels. - * @member {Object.} labels - * @memberof google.cloud.batch.v1.AllocationPolicy - * @instance - */ - AllocationPolicy.prototype.labels = $util.emptyObject; - - /** - * AllocationPolicy network. - * @member {google.cloud.batch.v1.AllocationPolicy.INetworkPolicy|null|undefined} network - * @memberof google.cloud.batch.v1.AllocationPolicy - * @instance - */ - AllocationPolicy.prototype.network = null; - - /** - * AllocationPolicy placement. - * @member {google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy|null|undefined} placement - * @memberof google.cloud.batch.v1.AllocationPolicy - * @instance - */ - AllocationPolicy.prototype.placement = null; - - /** - * AllocationPolicy tags. - * @member {Array.} tags - * @memberof google.cloud.batch.v1.AllocationPolicy - * @instance - */ - AllocationPolicy.prototype.tags = $util.emptyArray; - - /** - * Creates a new AllocationPolicy instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.AllocationPolicy - * @static - * @param {google.cloud.batch.v1.IAllocationPolicy=} [properties] Properties to set - * @returns {google.cloud.batch.v1.AllocationPolicy} AllocationPolicy instance - */ - AllocationPolicy.create = function create(properties) { - return new AllocationPolicy(properties); - }; - - /** - * Encodes the specified AllocationPolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.AllocationPolicy - * @static - * @param {google.cloud.batch.v1.IAllocationPolicy} message AllocationPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AllocationPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - $root.google.cloud.batch.v1.AllocationPolicy.LocationPolicy.encode(message.location, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.network != null && Object.hasOwnProperty.call(message, "network")) - $root.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.encode(message.network, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.instances != null && message.instances.length) - for (var i = 0; i < message.instances.length; ++i) - $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.encode(message.instances[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) - $root.google.cloud.batch.v1.ServiceAccount.encode(message.serviceAccount, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.placement != null && Object.hasOwnProperty.call(message, "placement")) - $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.encode(message.placement, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.tags != null && message.tags.length) - for (var i = 0; i < message.tags.length; ++i) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.tags[i]); - return writer; - }; - - /** - * Encodes the specified AllocationPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy - * @static - * @param {google.cloud.batch.v1.IAllocationPolicy} message AllocationPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AllocationPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AllocationPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.AllocationPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.AllocationPolicy} AllocationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AllocationPolicy.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.location = $root.google.cloud.batch.v1.AllocationPolicy.LocationPolicy.decode(reader, reader.uint32()); - break; - } - case 8: { - if (!(message.instances && message.instances.length)) - message.instances = []; - message.instances.push($root.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.decode(reader, reader.uint32())); - break; - } - case 9: { - message.serviceAccount = $root.google.cloud.batch.v1.ServiceAccount.decode(reader, reader.uint32()); - break; - } - case 6: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 7: { - message.network = $root.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.decode(reader, reader.uint32()); - break; - } - case 10: { - message.placement = $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.decode(reader, reader.uint32()); - break; - } - case 11: { - if (!(message.tags && message.tags.length)) - message.tags = []; - message.tags.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AllocationPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.AllocationPolicy} AllocationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AllocationPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AllocationPolicy message. - * @function verify - * @memberof google.cloud.batch.v1.AllocationPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AllocationPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) { - var error = $root.google.cloud.batch.v1.AllocationPolicy.LocationPolicy.verify(message.location); - if (error) - return "location." + error; - } - if (message.instances != null && message.hasOwnProperty("instances")) { - if (!Array.isArray(message.instances)) - return "instances: array expected"; - for (var i = 0; i < message.instances.length; ++i) { - var error = $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.verify(message.instances[i]); - if (error) - return "instances." + error; - } - } - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) { - var error = $root.google.cloud.batch.v1.ServiceAccount.verify(message.serviceAccount); - if (error) - return "serviceAccount." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.network != null && message.hasOwnProperty("network")) { - var error = $root.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.verify(message.network); - if (error) - return "network." + error; - } - if (message.placement != null && message.hasOwnProperty("placement")) { - var error = $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.verify(message.placement); - if (error) - return "placement." + error; - } - if (message.tags != null && message.hasOwnProperty("tags")) { - if (!Array.isArray(message.tags)) - return "tags: array expected"; - for (var i = 0; i < message.tags.length; ++i) - if (!$util.isString(message.tags[i])) - return "tags: string[] expected"; - } - return null; - }; - - /** - * Creates an AllocationPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.AllocationPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.AllocationPolicy} AllocationPolicy - */ - AllocationPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy) - return object; - var message = new $root.google.cloud.batch.v1.AllocationPolicy(); - if (object.location != null) { - if (typeof object.location !== "object") - throw TypeError(".google.cloud.batch.v1.AllocationPolicy.location: object expected"); - message.location = $root.google.cloud.batch.v1.AllocationPolicy.LocationPolicy.fromObject(object.location); - } - if (object.instances) { - if (!Array.isArray(object.instances)) - throw TypeError(".google.cloud.batch.v1.AllocationPolicy.instances: array expected"); - message.instances = []; - for (var i = 0; i < object.instances.length; ++i) { - if (typeof object.instances[i] !== "object") - throw TypeError(".google.cloud.batch.v1.AllocationPolicy.instances: object expected"); - message.instances[i] = $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.fromObject(object.instances[i]); - } - } - if (object.serviceAccount != null) { - if (typeof object.serviceAccount !== "object") - throw TypeError(".google.cloud.batch.v1.AllocationPolicy.serviceAccount: object expected"); - message.serviceAccount = $root.google.cloud.batch.v1.ServiceAccount.fromObject(object.serviceAccount); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.batch.v1.AllocationPolicy.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - if (object.network != null) { - if (typeof object.network !== "object") - throw TypeError(".google.cloud.batch.v1.AllocationPolicy.network: object expected"); - message.network = $root.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.fromObject(object.network); - } - if (object.placement != null) { - if (typeof object.placement !== "object") - throw TypeError(".google.cloud.batch.v1.AllocationPolicy.placement: object expected"); - message.placement = $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.fromObject(object.placement); - } - if (object.tags) { - if (!Array.isArray(object.tags)) - throw TypeError(".google.cloud.batch.v1.AllocationPolicy.tags: array expected"); - message.tags = []; - for (var i = 0; i < object.tags.length; ++i) - message.tags[i] = String(object.tags[i]); - } - return message; - }; - - /** - * Creates a plain object from an AllocationPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.AllocationPolicy - * @static - * @param {google.cloud.batch.v1.AllocationPolicy} message AllocationPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AllocationPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.instances = []; - object.tags = []; - } - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.location = null; - object.network = null; - object.serviceAccount = null; - object.placement = null; - } - if (message.location != null && message.hasOwnProperty("location")) - object.location = $root.google.cloud.batch.v1.AllocationPolicy.LocationPolicy.toObject(message.location, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.network != null && message.hasOwnProperty("network")) - object.network = $root.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.toObject(message.network, options); - if (message.instances && message.instances.length) { - object.instances = []; - for (var j = 0; j < message.instances.length; ++j) - object.instances[j] = $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.toObject(message.instances[j], options); - } - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - object.serviceAccount = $root.google.cloud.batch.v1.ServiceAccount.toObject(message.serviceAccount, options); - if (message.placement != null && message.hasOwnProperty("placement")) - object.placement = $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.toObject(message.placement, options); - if (message.tags && message.tags.length) { - object.tags = []; - for (var j = 0; j < message.tags.length; ++j) - object.tags[j] = message.tags[j]; - } - return object; - }; - - /** - * Converts this AllocationPolicy to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.AllocationPolicy - * @instance - * @returns {Object.} JSON object - */ - AllocationPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AllocationPolicy - * @function getTypeUrl - * @memberof google.cloud.batch.v1.AllocationPolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AllocationPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy"; - }; - - AllocationPolicy.LocationPolicy = (function() { - - /** - * Properties of a LocationPolicy. - * @memberof google.cloud.batch.v1.AllocationPolicy - * @interface ILocationPolicy - * @property {Array.|null} [allowedLocations] LocationPolicy allowedLocations - */ - - /** - * Constructs a new LocationPolicy. - * @memberof google.cloud.batch.v1.AllocationPolicy - * @classdesc Represents a LocationPolicy. - * @implements ILocationPolicy - * @constructor - * @param {google.cloud.batch.v1.AllocationPolicy.ILocationPolicy=} [properties] Properties to set - */ - function LocationPolicy(properties) { - this.allowedLocations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LocationPolicy allowedLocations. - * @member {Array.} allowedLocations - * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy - * @instance - */ - LocationPolicy.prototype.allowedLocations = $util.emptyArray; - - /** - * Creates a new LocationPolicy instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.ILocationPolicy=} [properties] Properties to set - * @returns {google.cloud.batch.v1.AllocationPolicy.LocationPolicy} LocationPolicy instance - */ - LocationPolicy.create = function create(properties) { - return new LocationPolicy(properties); - }; - - /** - * Encodes the specified LocationPolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.LocationPolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.ILocationPolicy} message LocationPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LocationPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowedLocations != null && message.allowedLocations.length) - for (var i = 0; i < message.allowedLocations.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedLocations[i]); - return writer; - }; - - /** - * Encodes the specified LocationPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.LocationPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.ILocationPolicy} message LocationPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LocationPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LocationPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.AllocationPolicy.LocationPolicy} LocationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LocationPolicy.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy.LocationPolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.allowedLocations && message.allowedLocations.length)) - message.allowedLocations = []; - message.allowedLocations.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LocationPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.AllocationPolicy.LocationPolicy} LocationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LocationPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LocationPolicy message. - * @function verify - * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LocationPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowedLocations != null && message.hasOwnProperty("allowedLocations")) { - if (!Array.isArray(message.allowedLocations)) - return "allowedLocations: array expected"; - for (var i = 0; i < message.allowedLocations.length; ++i) - if (!$util.isString(message.allowedLocations[i])) - return "allowedLocations: string[] expected"; - } - return null; - }; - - /** - * Creates a LocationPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.AllocationPolicy.LocationPolicy} LocationPolicy - */ - LocationPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy.LocationPolicy) - return object; - var message = new $root.google.cloud.batch.v1.AllocationPolicy.LocationPolicy(); - if (object.allowedLocations) { - if (!Array.isArray(object.allowedLocations)) - throw TypeError(".google.cloud.batch.v1.AllocationPolicy.LocationPolicy.allowedLocations: array expected"); - message.allowedLocations = []; - for (var i = 0; i < object.allowedLocations.length; ++i) - message.allowedLocations[i] = String(object.allowedLocations[i]); - } - return message; - }; - - /** - * Creates a plain object from a LocationPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.LocationPolicy} message LocationPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LocationPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.allowedLocations = []; - if (message.allowedLocations && message.allowedLocations.length) { - object.allowedLocations = []; - for (var j = 0; j < message.allowedLocations.length; ++j) - object.allowedLocations[j] = message.allowedLocations[j]; - } - return object; - }; - - /** - * Converts this LocationPolicy to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy - * @instance - * @returns {Object.} JSON object - */ - LocationPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LocationPolicy - * @function getTypeUrl - * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LocationPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy.LocationPolicy"; - }; - - return LocationPolicy; - })(); - - AllocationPolicy.Disk = (function() { - - /** - * Properties of a Disk. - * @memberof google.cloud.batch.v1.AllocationPolicy - * @interface IDisk - * @property {string|null} [image] Disk image - * @property {string|null} [snapshot] Disk snapshot - * @property {string|null} [type] Disk type - * @property {number|Long|null} [sizeGb] Disk sizeGb - * @property {string|null} [diskInterface] Disk diskInterface - */ - - /** - * Constructs a new Disk. - * @memberof google.cloud.batch.v1.AllocationPolicy - * @classdesc Represents a Disk. - * @implements IDisk - * @constructor - * @param {google.cloud.batch.v1.AllocationPolicy.IDisk=} [properties] Properties to set - */ - function Disk(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Disk image. - * @member {string|null|undefined} image - * @memberof google.cloud.batch.v1.AllocationPolicy.Disk - * @instance - */ - Disk.prototype.image = null; - - /** - * Disk snapshot. - * @member {string|null|undefined} snapshot - * @memberof google.cloud.batch.v1.AllocationPolicy.Disk - * @instance - */ - Disk.prototype.snapshot = null; - - /** - * Disk type. - * @member {string} type - * @memberof google.cloud.batch.v1.AllocationPolicy.Disk - * @instance - */ - Disk.prototype.type = ""; - - /** - * Disk sizeGb. - * @member {number|Long} sizeGb - * @memberof google.cloud.batch.v1.AllocationPolicy.Disk - * @instance - */ - Disk.prototype.sizeGb = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Disk diskInterface. - * @member {string} diskInterface - * @memberof google.cloud.batch.v1.AllocationPolicy.Disk - * @instance - */ - Disk.prototype.diskInterface = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Disk dataSource. - * @member {"image"|"snapshot"|undefined} dataSource - * @memberof google.cloud.batch.v1.AllocationPolicy.Disk - * @instance - */ - Object.defineProperty(Disk.prototype, "dataSource", { - get: $util.oneOfGetter($oneOfFields = ["image", "snapshot"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Disk instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.AllocationPolicy.Disk - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.IDisk=} [properties] Properties to set - * @returns {google.cloud.batch.v1.AllocationPolicy.Disk} Disk instance - */ - Disk.create = function create(properties) { - return new Disk(properties); - }; - - /** - * Encodes the specified Disk message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.Disk.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.AllocationPolicy.Disk - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.IDisk} message Disk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Disk.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.sizeGb != null && Object.hasOwnProperty.call(message, "sizeGb")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.sizeGb); - if (message.image != null && Object.hasOwnProperty.call(message, "image")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.image); - if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.snapshot); - if (message.diskInterface != null && Object.hasOwnProperty.call(message, "diskInterface")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.diskInterface); - return writer; - }; - - /** - * Encodes the specified Disk message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.Disk.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy.Disk - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.IDisk} message Disk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Disk.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Disk message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.AllocationPolicy.Disk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.AllocationPolicy.Disk} Disk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Disk.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy.Disk(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 4: { - message.image = reader.string(); - break; - } - case 5: { - message.snapshot = reader.string(); - break; - } - case 1: { - message.type = reader.string(); - break; - } - case 2: { - message.sizeGb = reader.int64(); - break; - } - case 6: { - message.diskInterface = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Disk message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy.Disk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.AllocationPolicy.Disk} Disk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Disk.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Disk message. - * @function verify - * @memberof google.cloud.batch.v1.AllocationPolicy.Disk - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Disk.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.image != null && message.hasOwnProperty("image")) { - properties.dataSource = 1; - if (!$util.isString(message.image)) - return "image: string expected"; - } - if (message.snapshot != null && message.hasOwnProperty("snapshot")) { - if (properties.dataSource === 1) - return "dataSource: multiple values"; - properties.dataSource = 1; - if (!$util.isString(message.snapshot)) - return "snapshot: string expected"; - } - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) - if (!$util.isInteger(message.sizeGb) && !(message.sizeGb && $util.isInteger(message.sizeGb.low) && $util.isInteger(message.sizeGb.high))) - return "sizeGb: integer|Long expected"; - if (message.diskInterface != null && message.hasOwnProperty("diskInterface")) - if (!$util.isString(message.diskInterface)) - return "diskInterface: string expected"; - return null; - }; - - /** - * Creates a Disk message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.AllocationPolicy.Disk - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.AllocationPolicy.Disk} Disk - */ - Disk.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy.Disk) - return object; - var message = new $root.google.cloud.batch.v1.AllocationPolicy.Disk(); - if (object.image != null) - message.image = String(object.image); - if (object.snapshot != null) - message.snapshot = String(object.snapshot); - if (object.type != null) - message.type = String(object.type); - if (object.sizeGb != null) - if ($util.Long) - (message.sizeGb = $util.Long.fromValue(object.sizeGb)).unsigned = false; - else if (typeof object.sizeGb === "string") - message.sizeGb = parseInt(object.sizeGb, 10); - else if (typeof object.sizeGb === "number") - message.sizeGb = object.sizeGb; - else if (typeof object.sizeGb === "object") - message.sizeGb = new $util.LongBits(object.sizeGb.low >>> 0, object.sizeGb.high >>> 0).toNumber(); - if (object.diskInterface != null) - message.diskInterface = String(object.diskInterface); - return message; - }; - - /** - * Creates a plain object from a Disk message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.AllocationPolicy.Disk - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.Disk} message Disk - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Disk.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.sizeGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sizeGb = options.longs === String ? "0" : 0; - object.diskInterface = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) - if (typeof message.sizeGb === "number") - object.sizeGb = options.longs === String ? String(message.sizeGb) : message.sizeGb; - else - object.sizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.sizeGb) : options.longs === Number ? new $util.LongBits(message.sizeGb.low >>> 0, message.sizeGb.high >>> 0).toNumber() : message.sizeGb; - if (message.image != null && message.hasOwnProperty("image")) { - object.image = message.image; - if (options.oneofs) - object.dataSource = "image"; - } - if (message.snapshot != null && message.hasOwnProperty("snapshot")) { - object.snapshot = message.snapshot; - if (options.oneofs) - object.dataSource = "snapshot"; - } - if (message.diskInterface != null && message.hasOwnProperty("diskInterface")) - object.diskInterface = message.diskInterface; - return object; - }; - - /** - * Converts this Disk to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.AllocationPolicy.Disk - * @instance - * @returns {Object.} JSON object - */ - Disk.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Disk - * @function getTypeUrl - * @memberof google.cloud.batch.v1.AllocationPolicy.Disk - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Disk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy.Disk"; - }; - - return Disk; - })(); - - AllocationPolicy.AttachedDisk = (function() { - - /** - * Properties of an AttachedDisk. - * @memberof google.cloud.batch.v1.AllocationPolicy - * @interface IAttachedDisk - * @property {google.cloud.batch.v1.AllocationPolicy.IDisk|null} [newDisk] AttachedDisk newDisk - * @property {string|null} [existingDisk] AttachedDisk existingDisk - * @property {string|null} [deviceName] AttachedDisk deviceName - */ - - /** - * Constructs a new AttachedDisk. - * @memberof google.cloud.batch.v1.AllocationPolicy - * @classdesc Represents an AttachedDisk. - * @implements IAttachedDisk - * @constructor - * @param {google.cloud.batch.v1.AllocationPolicy.IAttachedDisk=} [properties] Properties to set - */ - function AttachedDisk(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AttachedDisk newDisk. - * @member {google.cloud.batch.v1.AllocationPolicy.IDisk|null|undefined} newDisk - * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk - * @instance - */ - AttachedDisk.prototype.newDisk = null; - - /** - * AttachedDisk existingDisk. - * @member {string|null|undefined} existingDisk - * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk - * @instance - */ - AttachedDisk.prototype.existingDisk = null; - - /** - * AttachedDisk deviceName. - * @member {string} deviceName - * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk - * @instance - */ - AttachedDisk.prototype.deviceName = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * AttachedDisk attached. - * @member {"newDisk"|"existingDisk"|undefined} attached - * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk - * @instance - */ - Object.defineProperty(AttachedDisk.prototype, "attached", { - get: $util.oneOfGetter($oneOfFields = ["newDisk", "existingDisk"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new AttachedDisk instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.IAttachedDisk=} [properties] Properties to set - * @returns {google.cloud.batch.v1.AllocationPolicy.AttachedDisk} AttachedDisk instance - */ - AttachedDisk.create = function create(properties) { - return new AttachedDisk(properties); - }; - - /** - * Encodes the specified AttachedDisk message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.AttachedDisk.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.IAttachedDisk} message AttachedDisk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttachedDisk.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.newDisk != null && Object.hasOwnProperty.call(message, "newDisk")) - $root.google.cloud.batch.v1.AllocationPolicy.Disk.encode(message.newDisk, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.existingDisk != null && Object.hasOwnProperty.call(message, "existingDisk")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.existingDisk); - if (message.deviceName != null && Object.hasOwnProperty.call(message, "deviceName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.deviceName); - return writer; - }; - - /** - * Encodes the specified AttachedDisk message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.AttachedDisk.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.IAttachedDisk} message AttachedDisk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttachedDisk.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AttachedDisk message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.AllocationPolicy.AttachedDisk} AttachedDisk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttachedDisk.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy.AttachedDisk(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.newDisk = $root.google.cloud.batch.v1.AllocationPolicy.Disk.decode(reader, reader.uint32()); - break; - } - case 2: { - message.existingDisk = reader.string(); - break; - } - case 3: { - message.deviceName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AttachedDisk message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.AllocationPolicy.AttachedDisk} AttachedDisk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttachedDisk.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AttachedDisk message. - * @function verify - * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AttachedDisk.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.newDisk != null && message.hasOwnProperty("newDisk")) { - properties.attached = 1; - { - var error = $root.google.cloud.batch.v1.AllocationPolicy.Disk.verify(message.newDisk); - if (error) - return "newDisk." + error; - } - } - if (message.existingDisk != null && message.hasOwnProperty("existingDisk")) { - if (properties.attached === 1) - return "attached: multiple values"; - properties.attached = 1; - if (!$util.isString(message.existingDisk)) - return "existingDisk: string expected"; - } - if (message.deviceName != null && message.hasOwnProperty("deviceName")) - if (!$util.isString(message.deviceName)) - return "deviceName: string expected"; - return null; - }; - - /** - * Creates an AttachedDisk message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.AllocationPolicy.AttachedDisk} AttachedDisk - */ - AttachedDisk.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy.AttachedDisk) - return object; - var message = new $root.google.cloud.batch.v1.AllocationPolicy.AttachedDisk(); - if (object.newDisk != null) { - if (typeof object.newDisk !== "object") - throw TypeError(".google.cloud.batch.v1.AllocationPolicy.AttachedDisk.newDisk: object expected"); - message.newDisk = $root.google.cloud.batch.v1.AllocationPolicy.Disk.fromObject(object.newDisk); - } - if (object.existingDisk != null) - message.existingDisk = String(object.existingDisk); - if (object.deviceName != null) - message.deviceName = String(object.deviceName); - return message; - }; - - /** - * Creates a plain object from an AttachedDisk message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.AttachedDisk} message AttachedDisk - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AttachedDisk.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.deviceName = ""; - if (message.newDisk != null && message.hasOwnProperty("newDisk")) { - object.newDisk = $root.google.cloud.batch.v1.AllocationPolicy.Disk.toObject(message.newDisk, options); - if (options.oneofs) - object.attached = "newDisk"; - } - if (message.existingDisk != null && message.hasOwnProperty("existingDisk")) { - object.existingDisk = message.existingDisk; - if (options.oneofs) - object.attached = "existingDisk"; - } - if (message.deviceName != null && message.hasOwnProperty("deviceName")) - object.deviceName = message.deviceName; - return object; - }; - - /** - * Converts this AttachedDisk to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk - * @instance - * @returns {Object.} JSON object - */ - AttachedDisk.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AttachedDisk - * @function getTypeUrl - * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AttachedDisk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy.AttachedDisk"; - }; - - return AttachedDisk; - })(); - - AllocationPolicy.Accelerator = (function() { - - /** - * Properties of an Accelerator. - * @memberof google.cloud.batch.v1.AllocationPolicy - * @interface IAccelerator - * @property {string|null} [type] Accelerator type - * @property {number|Long|null} [count] Accelerator count - * @property {boolean|null} [installGpuDrivers] Accelerator installGpuDrivers - * @property {string|null} [driverVersion] Accelerator driverVersion - */ - - /** - * Constructs a new Accelerator. - * @memberof google.cloud.batch.v1.AllocationPolicy - * @classdesc Represents an Accelerator. - * @implements IAccelerator - * @constructor - * @param {google.cloud.batch.v1.AllocationPolicy.IAccelerator=} [properties] Properties to set - */ - function Accelerator(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Accelerator type. - * @member {string} type - * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator - * @instance - */ - Accelerator.prototype.type = ""; - - /** - * Accelerator count. - * @member {number|Long} count - * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator - * @instance - */ - Accelerator.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Accelerator installGpuDrivers. - * @member {boolean} installGpuDrivers - * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator - * @instance - */ - Accelerator.prototype.installGpuDrivers = false; - - /** - * Accelerator driverVersion. - * @member {string} driverVersion - * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator - * @instance - */ - Accelerator.prototype.driverVersion = ""; - - /** - * Creates a new Accelerator instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.IAccelerator=} [properties] Properties to set - * @returns {google.cloud.batch.v1.AllocationPolicy.Accelerator} Accelerator instance - */ - Accelerator.create = function create(properties) { - return new Accelerator(properties); - }; - - /** - * Encodes the specified Accelerator message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.Accelerator.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.IAccelerator} message Accelerator message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Accelerator.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); - if (message.installGpuDrivers != null && Object.hasOwnProperty.call(message, "installGpuDrivers")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.installGpuDrivers); - if (message.driverVersion != null && Object.hasOwnProperty.call(message, "driverVersion")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.driverVersion); - return writer; - }; - - /** - * Encodes the specified Accelerator message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.Accelerator.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.IAccelerator} message Accelerator message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Accelerator.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Accelerator message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.AllocationPolicy.Accelerator} Accelerator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Accelerator.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy.Accelerator(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - message.count = reader.int64(); - break; - } - case 3: { - message.installGpuDrivers = reader.bool(); - break; - } - case 4: { - message.driverVersion = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Accelerator message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.AllocationPolicy.Accelerator} Accelerator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Accelerator.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Accelerator message. - * @function verify - * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Accelerator.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) - return "count: integer|Long expected"; - if (message.installGpuDrivers != null && message.hasOwnProperty("installGpuDrivers")) - if (typeof message.installGpuDrivers !== "boolean") - return "installGpuDrivers: boolean expected"; - if (message.driverVersion != null && message.hasOwnProperty("driverVersion")) - if (!$util.isString(message.driverVersion)) - return "driverVersion: string expected"; - return null; - }; - - /** - * Creates an Accelerator message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.AllocationPolicy.Accelerator} Accelerator - */ - Accelerator.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy.Accelerator) - return object; - var message = new $root.google.cloud.batch.v1.AllocationPolicy.Accelerator(); - if (object.type != null) - message.type = String(object.type); - if (object.count != null) - if ($util.Long) - (message.count = $util.Long.fromValue(object.count)).unsigned = false; - else if (typeof object.count === "string") - message.count = parseInt(object.count, 10); - else if (typeof object.count === "number") - message.count = object.count; - else if (typeof object.count === "object") - message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); - if (object.installGpuDrivers != null) - message.installGpuDrivers = Boolean(object.installGpuDrivers); - if (object.driverVersion != null) - message.driverVersion = String(object.driverVersion); - return message; - }; - - /** - * Creates a plain object from an Accelerator message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.Accelerator} message Accelerator - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Accelerator.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.count = options.longs === String ? "0" : 0; - object.installGpuDrivers = false; - object.driverVersion = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.count != null && message.hasOwnProperty("count")) - if (typeof message.count === "number") - object.count = options.longs === String ? String(message.count) : message.count; - else - object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; - if (message.installGpuDrivers != null && message.hasOwnProperty("installGpuDrivers")) - object.installGpuDrivers = message.installGpuDrivers; - if (message.driverVersion != null && message.hasOwnProperty("driverVersion")) - object.driverVersion = message.driverVersion; - return object; - }; - - /** - * Converts this Accelerator to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator - * @instance - * @returns {Object.} JSON object - */ - Accelerator.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Accelerator - * @function getTypeUrl - * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Accelerator.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy.Accelerator"; - }; - - return Accelerator; - })(); - - AllocationPolicy.InstancePolicy = (function() { - - /** - * Properties of an InstancePolicy. - * @memberof google.cloud.batch.v1.AllocationPolicy - * @interface IInstancePolicy - * @property {string|null} [machineType] InstancePolicy machineType - * @property {string|null} [minCpuPlatform] InstancePolicy minCpuPlatform - * @property {google.cloud.batch.v1.AllocationPolicy.ProvisioningModel|null} [provisioningModel] InstancePolicy provisioningModel - * @property {Array.|null} [accelerators] InstancePolicy accelerators - * @property {google.cloud.batch.v1.AllocationPolicy.IDisk|null} [bootDisk] InstancePolicy bootDisk - * @property {Array.|null} [disks] InstancePolicy disks - * @property {string|null} [reservation] InstancePolicy reservation - */ - - /** - * Constructs a new InstancePolicy. - * @memberof google.cloud.batch.v1.AllocationPolicy - * @classdesc Represents an InstancePolicy. - * @implements IInstancePolicy - * @constructor - * @param {google.cloud.batch.v1.AllocationPolicy.IInstancePolicy=} [properties] Properties to set - */ - function InstancePolicy(properties) { - this.accelerators = []; - this.disks = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InstancePolicy machineType. - * @member {string} machineType - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy - * @instance - */ - InstancePolicy.prototype.machineType = ""; - - /** - * InstancePolicy minCpuPlatform. - * @member {string} minCpuPlatform - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy - * @instance - */ - InstancePolicy.prototype.minCpuPlatform = ""; - - /** - * InstancePolicy provisioningModel. - * @member {google.cloud.batch.v1.AllocationPolicy.ProvisioningModel} provisioningModel - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy - * @instance - */ - InstancePolicy.prototype.provisioningModel = 0; - - /** - * InstancePolicy accelerators. - * @member {Array.} accelerators - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy - * @instance - */ - InstancePolicy.prototype.accelerators = $util.emptyArray; - - /** - * InstancePolicy bootDisk. - * @member {google.cloud.batch.v1.AllocationPolicy.IDisk|null|undefined} bootDisk - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy - * @instance - */ - InstancePolicy.prototype.bootDisk = null; - - /** - * InstancePolicy disks. - * @member {Array.} disks - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy - * @instance - */ - InstancePolicy.prototype.disks = $util.emptyArray; - - /** - * InstancePolicy reservation. - * @member {string} reservation - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy - * @instance - */ - InstancePolicy.prototype.reservation = ""; - - /** - * Creates a new InstancePolicy instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.IInstancePolicy=} [properties] Properties to set - * @returns {google.cloud.batch.v1.AllocationPolicy.InstancePolicy} InstancePolicy instance - */ - InstancePolicy.create = function create(properties) { - return new InstancePolicy(properties); - }; - - /** - * Encodes the specified InstancePolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.InstancePolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.IInstancePolicy} message InstancePolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstancePolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.machineType); - if (message.minCpuPlatform != null && Object.hasOwnProperty.call(message, "minCpuPlatform")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.minCpuPlatform); - if (message.provisioningModel != null && Object.hasOwnProperty.call(message, "provisioningModel")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.provisioningModel); - if (message.accelerators != null && message.accelerators.length) - for (var i = 0; i < message.accelerators.length; ++i) - $root.google.cloud.batch.v1.AllocationPolicy.Accelerator.encode(message.accelerators[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.disks != null && message.disks.length) - for (var i = 0; i < message.disks.length; ++i) - $root.google.cloud.batch.v1.AllocationPolicy.AttachedDisk.encode(message.disks[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.reservation != null && Object.hasOwnProperty.call(message, "reservation")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.reservation); - if (message.bootDisk != null && Object.hasOwnProperty.call(message, "bootDisk")) - $root.google.cloud.batch.v1.AllocationPolicy.Disk.encode(message.bootDisk, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified InstancePolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.InstancePolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.IInstancePolicy} message InstancePolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstancePolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InstancePolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.AllocationPolicy.InstancePolicy} InstancePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstancePolicy.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - message.machineType = reader.string(); - break; - } - case 3: { - message.minCpuPlatform = reader.string(); - break; - } - case 4: { - message.provisioningModel = reader.int32(); - break; - } - case 5: { - if (!(message.accelerators && message.accelerators.length)) - message.accelerators = []; - message.accelerators.push($root.google.cloud.batch.v1.AllocationPolicy.Accelerator.decode(reader, reader.uint32())); - break; - } - case 8: { - message.bootDisk = $root.google.cloud.batch.v1.AllocationPolicy.Disk.decode(reader, reader.uint32()); - break; - } - case 6: { - if (!(message.disks && message.disks.length)) - message.disks = []; - message.disks.push($root.google.cloud.batch.v1.AllocationPolicy.AttachedDisk.decode(reader, reader.uint32())); - break; - } - case 7: { - message.reservation = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InstancePolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.AllocationPolicy.InstancePolicy} InstancePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstancePolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InstancePolicy message. - * @function verify - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstancePolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.machineType != null && message.hasOwnProperty("machineType")) - if (!$util.isString(message.machineType)) - return "machineType: string expected"; - if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) - if (!$util.isString(message.minCpuPlatform)) - return "minCpuPlatform: string expected"; - if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) - switch (message.provisioningModel) { - default: - return "provisioningModel: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.accelerators != null && message.hasOwnProperty("accelerators")) { - if (!Array.isArray(message.accelerators)) - return "accelerators: array expected"; - for (var i = 0; i < message.accelerators.length; ++i) { - var error = $root.google.cloud.batch.v1.AllocationPolicy.Accelerator.verify(message.accelerators[i]); - if (error) - return "accelerators." + error; - } - } - if (message.bootDisk != null && message.hasOwnProperty("bootDisk")) { - var error = $root.google.cloud.batch.v1.AllocationPolicy.Disk.verify(message.bootDisk); - if (error) - return "bootDisk." + error; - } - if (message.disks != null && message.hasOwnProperty("disks")) { - if (!Array.isArray(message.disks)) - return "disks: array expected"; - for (var i = 0; i < message.disks.length; ++i) { - var error = $root.google.cloud.batch.v1.AllocationPolicy.AttachedDisk.verify(message.disks[i]); - if (error) - return "disks." + error; - } - } - if (message.reservation != null && message.hasOwnProperty("reservation")) - if (!$util.isString(message.reservation)) - return "reservation: string expected"; - return null; - }; - - /** - * Creates an InstancePolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.AllocationPolicy.InstancePolicy} InstancePolicy - */ - InstancePolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicy) - return object; - var message = new $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicy(); - if (object.machineType != null) - message.machineType = String(object.machineType); - if (object.minCpuPlatform != null) - message.minCpuPlatform = String(object.minCpuPlatform); - switch (object.provisioningModel) { - default: - if (typeof object.provisioningModel === "number") { - message.provisioningModel = object.provisioningModel; - break; - } - break; - case "PROVISIONING_MODEL_UNSPECIFIED": - case 0: - message.provisioningModel = 0; - break; - case "STANDARD": - case 1: - message.provisioningModel = 1; - break; - case "SPOT": - case 2: - message.provisioningModel = 2; - break; - case "PREEMPTIBLE": - case 3: - message.provisioningModel = 3; - break; - } - if (object.accelerators) { - if (!Array.isArray(object.accelerators)) - throw TypeError(".google.cloud.batch.v1.AllocationPolicy.InstancePolicy.accelerators: array expected"); - message.accelerators = []; - for (var i = 0; i < object.accelerators.length; ++i) { - if (typeof object.accelerators[i] !== "object") - throw TypeError(".google.cloud.batch.v1.AllocationPolicy.InstancePolicy.accelerators: object expected"); - message.accelerators[i] = $root.google.cloud.batch.v1.AllocationPolicy.Accelerator.fromObject(object.accelerators[i]); - } - } - if (object.bootDisk != null) { - if (typeof object.bootDisk !== "object") - throw TypeError(".google.cloud.batch.v1.AllocationPolicy.InstancePolicy.bootDisk: object expected"); - message.bootDisk = $root.google.cloud.batch.v1.AllocationPolicy.Disk.fromObject(object.bootDisk); - } - if (object.disks) { - if (!Array.isArray(object.disks)) - throw TypeError(".google.cloud.batch.v1.AllocationPolicy.InstancePolicy.disks: array expected"); - message.disks = []; - for (var i = 0; i < object.disks.length; ++i) { - if (typeof object.disks[i] !== "object") - throw TypeError(".google.cloud.batch.v1.AllocationPolicy.InstancePolicy.disks: object expected"); - message.disks[i] = $root.google.cloud.batch.v1.AllocationPolicy.AttachedDisk.fromObject(object.disks[i]); - } - } - if (object.reservation != null) - message.reservation = String(object.reservation); - return message; - }; - - /** - * Creates a plain object from an InstancePolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.InstancePolicy} message InstancePolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstancePolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.accelerators = []; - object.disks = []; - } - if (options.defaults) { - object.machineType = ""; - object.minCpuPlatform = ""; - object.provisioningModel = options.enums === String ? "PROVISIONING_MODEL_UNSPECIFIED" : 0; - object.reservation = ""; - object.bootDisk = null; - } - if (message.machineType != null && message.hasOwnProperty("machineType")) - object.machineType = message.machineType; - if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) - object.minCpuPlatform = message.minCpuPlatform; - if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) - object.provisioningModel = options.enums === String ? $root.google.cloud.batch.v1.AllocationPolicy.ProvisioningModel[message.provisioningModel] === undefined ? message.provisioningModel : $root.google.cloud.batch.v1.AllocationPolicy.ProvisioningModel[message.provisioningModel] : message.provisioningModel; - if (message.accelerators && message.accelerators.length) { - object.accelerators = []; - for (var j = 0; j < message.accelerators.length; ++j) - object.accelerators[j] = $root.google.cloud.batch.v1.AllocationPolicy.Accelerator.toObject(message.accelerators[j], options); - } - if (message.disks && message.disks.length) { - object.disks = []; - for (var j = 0; j < message.disks.length; ++j) - object.disks[j] = $root.google.cloud.batch.v1.AllocationPolicy.AttachedDisk.toObject(message.disks[j], options); - } - if (message.reservation != null && message.hasOwnProperty("reservation")) - object.reservation = message.reservation; - if (message.bootDisk != null && message.hasOwnProperty("bootDisk")) - object.bootDisk = $root.google.cloud.batch.v1.AllocationPolicy.Disk.toObject(message.bootDisk, options); - return object; - }; - - /** - * Converts this InstancePolicy to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy - * @instance - * @returns {Object.} JSON object - */ - InstancePolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InstancePolicy - * @function getTypeUrl - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstancePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy.InstancePolicy"; - }; - - return InstancePolicy; - })(); - - AllocationPolicy.InstancePolicyOrTemplate = (function() { - - /** - * Properties of an InstancePolicyOrTemplate. - * @memberof google.cloud.batch.v1.AllocationPolicy - * @interface IInstancePolicyOrTemplate - * @property {google.cloud.batch.v1.AllocationPolicy.IInstancePolicy|null} [policy] InstancePolicyOrTemplate policy - * @property {string|null} [instanceTemplate] InstancePolicyOrTemplate instanceTemplate - * @property {boolean|null} [installGpuDrivers] InstancePolicyOrTemplate installGpuDrivers - * @property {boolean|null} [installOpsAgent] InstancePolicyOrTemplate installOpsAgent - * @property {boolean|null} [blockProjectSshKeys] InstancePolicyOrTemplate blockProjectSshKeys - */ - - /** - * Constructs a new InstancePolicyOrTemplate. - * @memberof google.cloud.batch.v1.AllocationPolicy - * @classdesc Represents an InstancePolicyOrTemplate. - * @implements IInstancePolicyOrTemplate - * @constructor - * @param {google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate=} [properties] Properties to set - */ - function InstancePolicyOrTemplate(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InstancePolicyOrTemplate policy. - * @member {google.cloud.batch.v1.AllocationPolicy.IInstancePolicy|null|undefined} policy - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate - * @instance - */ - InstancePolicyOrTemplate.prototype.policy = null; - - /** - * InstancePolicyOrTemplate instanceTemplate. - * @member {string|null|undefined} instanceTemplate - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate - * @instance - */ - InstancePolicyOrTemplate.prototype.instanceTemplate = null; - - /** - * InstancePolicyOrTemplate installGpuDrivers. - * @member {boolean} installGpuDrivers - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate - * @instance - */ - InstancePolicyOrTemplate.prototype.installGpuDrivers = false; - - /** - * InstancePolicyOrTemplate installOpsAgent. - * @member {boolean} installOpsAgent - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate - * @instance - */ - InstancePolicyOrTemplate.prototype.installOpsAgent = false; - - /** - * InstancePolicyOrTemplate blockProjectSshKeys. - * @member {boolean} blockProjectSshKeys - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate - * @instance - */ - InstancePolicyOrTemplate.prototype.blockProjectSshKeys = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * InstancePolicyOrTemplate policyTemplate. - * @member {"policy"|"instanceTemplate"|undefined} policyTemplate - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate - * @instance - */ - Object.defineProperty(InstancePolicyOrTemplate.prototype, "policyTemplate", { - get: $util.oneOfGetter($oneOfFields = ["policy", "instanceTemplate"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new InstancePolicyOrTemplate instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate=} [properties] Properties to set - * @returns {google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate} InstancePolicyOrTemplate instance - */ - InstancePolicyOrTemplate.create = function create(properties) { - return new InstancePolicyOrTemplate(properties); - }; - - /** - * Encodes the specified InstancePolicyOrTemplate message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate} message InstancePolicyOrTemplate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstancePolicyOrTemplate.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) - $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicy.encode(message.policy, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.instanceTemplate != null && Object.hasOwnProperty.call(message, "instanceTemplate")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceTemplate); - if (message.installGpuDrivers != null && Object.hasOwnProperty.call(message, "installGpuDrivers")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.installGpuDrivers); - if (message.installOpsAgent != null && Object.hasOwnProperty.call(message, "installOpsAgent")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.installOpsAgent); - if (message.blockProjectSshKeys != null && Object.hasOwnProperty.call(message, "blockProjectSshKeys")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.blockProjectSshKeys); - return writer; - }; - - /** - * Encodes the specified InstancePolicyOrTemplate message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate} message InstancePolicyOrTemplate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstancePolicyOrTemplate.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InstancePolicyOrTemplate message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate} InstancePolicyOrTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstancePolicyOrTemplate.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.policy = $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicy.decode(reader, reader.uint32()); - break; - } - case 2: { - message.instanceTemplate = reader.string(); - break; - } - case 3: { - message.installGpuDrivers = reader.bool(); - break; - } - case 4: { - message.installOpsAgent = reader.bool(); - break; - } - case 5: { - message.blockProjectSshKeys = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InstancePolicyOrTemplate message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate} InstancePolicyOrTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstancePolicyOrTemplate.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InstancePolicyOrTemplate message. - * @function verify - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstancePolicyOrTemplate.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.policy != null && message.hasOwnProperty("policy")) { - properties.policyTemplate = 1; - { - var error = $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicy.verify(message.policy); - if (error) - return "policy." + error; - } - } - if (message.instanceTemplate != null && message.hasOwnProperty("instanceTemplate")) { - if (properties.policyTemplate === 1) - return "policyTemplate: multiple values"; - properties.policyTemplate = 1; - if (!$util.isString(message.instanceTemplate)) - return "instanceTemplate: string expected"; - } - if (message.installGpuDrivers != null && message.hasOwnProperty("installGpuDrivers")) - if (typeof message.installGpuDrivers !== "boolean") - return "installGpuDrivers: boolean expected"; - if (message.installOpsAgent != null && message.hasOwnProperty("installOpsAgent")) - if (typeof message.installOpsAgent !== "boolean") - return "installOpsAgent: boolean expected"; - if (message.blockProjectSshKeys != null && message.hasOwnProperty("blockProjectSshKeys")) - if (typeof message.blockProjectSshKeys !== "boolean") - return "blockProjectSshKeys: boolean expected"; - return null; - }; - - /** - * Creates an InstancePolicyOrTemplate message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate} InstancePolicyOrTemplate - */ - InstancePolicyOrTemplate.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate) - return object; - var message = new $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate(); - if (object.policy != null) { - if (typeof object.policy !== "object") - throw TypeError(".google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.policy: object expected"); - message.policy = $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicy.fromObject(object.policy); - } - if (object.instanceTemplate != null) - message.instanceTemplate = String(object.instanceTemplate); - if (object.installGpuDrivers != null) - message.installGpuDrivers = Boolean(object.installGpuDrivers); - if (object.installOpsAgent != null) - message.installOpsAgent = Boolean(object.installOpsAgent); - if (object.blockProjectSshKeys != null) - message.blockProjectSshKeys = Boolean(object.blockProjectSshKeys); - return message; - }; - - /** - * Creates a plain object from an InstancePolicyOrTemplate message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate} message InstancePolicyOrTemplate - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstancePolicyOrTemplate.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.installGpuDrivers = false; - object.installOpsAgent = false; - object.blockProjectSshKeys = false; - } - if (message.policy != null && message.hasOwnProperty("policy")) { - object.policy = $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicy.toObject(message.policy, options); - if (options.oneofs) - object.policyTemplate = "policy"; - } - if (message.instanceTemplate != null && message.hasOwnProperty("instanceTemplate")) { - object.instanceTemplate = message.instanceTemplate; - if (options.oneofs) - object.policyTemplate = "instanceTemplate"; - } - if (message.installGpuDrivers != null && message.hasOwnProperty("installGpuDrivers")) - object.installGpuDrivers = message.installGpuDrivers; - if (message.installOpsAgent != null && message.hasOwnProperty("installOpsAgent")) - object.installOpsAgent = message.installOpsAgent; - if (message.blockProjectSshKeys != null && message.hasOwnProperty("blockProjectSshKeys")) - object.blockProjectSshKeys = message.blockProjectSshKeys; - return object; - }; - - /** - * Converts this InstancePolicyOrTemplate to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate - * @instance - * @returns {Object.} JSON object - */ - InstancePolicyOrTemplate.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InstancePolicyOrTemplate - * @function getTypeUrl - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstancePolicyOrTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate"; - }; - - return InstancePolicyOrTemplate; - })(); - - AllocationPolicy.NetworkInterface = (function() { - - /** - * Properties of a NetworkInterface. - * @memberof google.cloud.batch.v1.AllocationPolicy - * @interface INetworkInterface - * @property {string|null} [network] NetworkInterface network - * @property {string|null} [subnetwork] NetworkInterface subnetwork - * @property {boolean|null} [noExternalIpAddress] NetworkInterface noExternalIpAddress - */ - - /** - * Constructs a new NetworkInterface. - * @memberof google.cloud.batch.v1.AllocationPolicy - * @classdesc Represents a NetworkInterface. - * @implements INetworkInterface - * @constructor - * @param {google.cloud.batch.v1.AllocationPolicy.INetworkInterface=} [properties] Properties to set - */ - function NetworkInterface(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NetworkInterface network. - * @member {string} network - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface - * @instance - */ - NetworkInterface.prototype.network = ""; - - /** - * NetworkInterface subnetwork. - * @member {string} subnetwork - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface - * @instance - */ - NetworkInterface.prototype.subnetwork = ""; - - /** - * NetworkInterface noExternalIpAddress. - * @member {boolean} noExternalIpAddress - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface - * @instance - */ - NetworkInterface.prototype.noExternalIpAddress = false; - - /** - * Creates a new NetworkInterface instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.INetworkInterface=} [properties] Properties to set - * @returns {google.cloud.batch.v1.AllocationPolicy.NetworkInterface} NetworkInterface instance - */ - NetworkInterface.create = function create(properties) { - return new NetworkInterface(properties); - }; - - /** - * Encodes the specified NetworkInterface message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.NetworkInterface.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.INetworkInterface} message NetworkInterface message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NetworkInterface.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.network != null && Object.hasOwnProperty.call(message, "network")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.network); - if (message.subnetwork != null && Object.hasOwnProperty.call(message, "subnetwork")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.subnetwork); - if (message.noExternalIpAddress != null && Object.hasOwnProperty.call(message, "noExternalIpAddress")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.noExternalIpAddress); - return writer; - }; - - /** - * Encodes the specified NetworkInterface message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.NetworkInterface.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.INetworkInterface} message NetworkInterface message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NetworkInterface.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NetworkInterface message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.AllocationPolicy.NetworkInterface} NetworkInterface - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NetworkInterface.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy.NetworkInterface(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.network = reader.string(); - break; - } - case 2: { - message.subnetwork = reader.string(); - break; - } - case 3: { - message.noExternalIpAddress = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NetworkInterface message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.AllocationPolicy.NetworkInterface} NetworkInterface - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NetworkInterface.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NetworkInterface message. - * @function verify - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NetworkInterface.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.network != null && message.hasOwnProperty("network")) - if (!$util.isString(message.network)) - return "network: string expected"; - if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) - if (!$util.isString(message.subnetwork)) - return "subnetwork: string expected"; - if (message.noExternalIpAddress != null && message.hasOwnProperty("noExternalIpAddress")) - if (typeof message.noExternalIpAddress !== "boolean") - return "noExternalIpAddress: boolean expected"; - return null; - }; - - /** - * Creates a NetworkInterface message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.AllocationPolicy.NetworkInterface} NetworkInterface - */ - NetworkInterface.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy.NetworkInterface) - return object; - var message = new $root.google.cloud.batch.v1.AllocationPolicy.NetworkInterface(); - if (object.network != null) - message.network = String(object.network); - if (object.subnetwork != null) - message.subnetwork = String(object.subnetwork); - if (object.noExternalIpAddress != null) - message.noExternalIpAddress = Boolean(object.noExternalIpAddress); - return message; - }; - - /** - * Creates a plain object from a NetworkInterface message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.NetworkInterface} message NetworkInterface - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NetworkInterface.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.network = ""; - object.subnetwork = ""; - object.noExternalIpAddress = false; - } - if (message.network != null && message.hasOwnProperty("network")) - object.network = message.network; - if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) - object.subnetwork = message.subnetwork; - if (message.noExternalIpAddress != null && message.hasOwnProperty("noExternalIpAddress")) - object.noExternalIpAddress = message.noExternalIpAddress; - return object; - }; - - /** - * Converts this NetworkInterface to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface - * @instance - * @returns {Object.} JSON object - */ - NetworkInterface.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NetworkInterface - * @function getTypeUrl - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NetworkInterface.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy.NetworkInterface"; - }; - - return NetworkInterface; - })(); - - AllocationPolicy.NetworkPolicy = (function() { - - /** - * Properties of a NetworkPolicy. - * @memberof google.cloud.batch.v1.AllocationPolicy - * @interface INetworkPolicy - * @property {Array.|null} [networkInterfaces] NetworkPolicy networkInterfaces - */ - - /** - * Constructs a new NetworkPolicy. - * @memberof google.cloud.batch.v1.AllocationPolicy - * @classdesc Represents a NetworkPolicy. - * @implements INetworkPolicy - * @constructor - * @param {google.cloud.batch.v1.AllocationPolicy.INetworkPolicy=} [properties] Properties to set - */ - function NetworkPolicy(properties) { - this.networkInterfaces = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NetworkPolicy networkInterfaces. - * @member {Array.} networkInterfaces - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy - * @instance - */ - NetworkPolicy.prototype.networkInterfaces = $util.emptyArray; - - /** - * Creates a new NetworkPolicy instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.INetworkPolicy=} [properties] Properties to set - * @returns {google.cloud.batch.v1.AllocationPolicy.NetworkPolicy} NetworkPolicy instance - */ - NetworkPolicy.create = function create(properties) { - return new NetworkPolicy(properties); - }; - - /** - * Encodes the specified NetworkPolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.INetworkPolicy} message NetworkPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NetworkPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.networkInterfaces != null && message.networkInterfaces.length) - for (var i = 0; i < message.networkInterfaces.length; ++i) - $root.google.cloud.batch.v1.AllocationPolicy.NetworkInterface.encode(message.networkInterfaces[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified NetworkPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.INetworkPolicy} message NetworkPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NetworkPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NetworkPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.AllocationPolicy.NetworkPolicy} NetworkPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NetworkPolicy.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.networkInterfaces && message.networkInterfaces.length)) - message.networkInterfaces = []; - message.networkInterfaces.push($root.google.cloud.batch.v1.AllocationPolicy.NetworkInterface.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NetworkPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.AllocationPolicy.NetworkPolicy} NetworkPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NetworkPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NetworkPolicy message. - * @function verify - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NetworkPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.networkInterfaces != null && message.hasOwnProperty("networkInterfaces")) { - if (!Array.isArray(message.networkInterfaces)) - return "networkInterfaces: array expected"; - for (var i = 0; i < message.networkInterfaces.length; ++i) { - var error = $root.google.cloud.batch.v1.AllocationPolicy.NetworkInterface.verify(message.networkInterfaces[i]); - if (error) - return "networkInterfaces." + error; - } - } - return null; - }; - - /** - * Creates a NetworkPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.AllocationPolicy.NetworkPolicy} NetworkPolicy - */ - NetworkPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy) - return object; - var message = new $root.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy(); - if (object.networkInterfaces) { - if (!Array.isArray(object.networkInterfaces)) - throw TypeError(".google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.networkInterfaces: array expected"); - message.networkInterfaces = []; - for (var i = 0; i < object.networkInterfaces.length; ++i) { - if (typeof object.networkInterfaces[i] !== "object") - throw TypeError(".google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.networkInterfaces: object expected"); - message.networkInterfaces[i] = $root.google.cloud.batch.v1.AllocationPolicy.NetworkInterface.fromObject(object.networkInterfaces[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a NetworkPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.NetworkPolicy} message NetworkPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NetworkPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.networkInterfaces = []; - if (message.networkInterfaces && message.networkInterfaces.length) { - object.networkInterfaces = []; - for (var j = 0; j < message.networkInterfaces.length; ++j) - object.networkInterfaces[j] = $root.google.cloud.batch.v1.AllocationPolicy.NetworkInterface.toObject(message.networkInterfaces[j], options); - } - return object; - }; - - /** - * Converts this NetworkPolicy to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy - * @instance - * @returns {Object.} JSON object - */ - NetworkPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NetworkPolicy - * @function getTypeUrl - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NetworkPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy.NetworkPolicy"; - }; - - return NetworkPolicy; - })(); - - AllocationPolicy.PlacementPolicy = (function() { - - /** - * Properties of a PlacementPolicy. - * @memberof google.cloud.batch.v1.AllocationPolicy - * @interface IPlacementPolicy - * @property {string|null} [collocation] PlacementPolicy collocation - * @property {number|Long|null} [maxDistance] PlacementPolicy maxDistance - */ - - /** - * Constructs a new PlacementPolicy. - * @memberof google.cloud.batch.v1.AllocationPolicy - * @classdesc Represents a PlacementPolicy. - * @implements IPlacementPolicy - * @constructor - * @param {google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy=} [properties] Properties to set - */ - function PlacementPolicy(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PlacementPolicy collocation. - * @member {string} collocation - * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy - * @instance - */ - PlacementPolicy.prototype.collocation = ""; - - /** - * PlacementPolicy maxDistance. - * @member {number|Long} maxDistance - * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy - * @instance - */ - PlacementPolicy.prototype.maxDistance = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new PlacementPolicy instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy=} [properties] Properties to set - * @returns {google.cloud.batch.v1.AllocationPolicy.PlacementPolicy} PlacementPolicy instance - */ - PlacementPolicy.create = function create(properties) { - return new PlacementPolicy(properties); - }; - - /** - * Encodes the specified PlacementPolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy} message PlacementPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PlacementPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.collocation != null && Object.hasOwnProperty.call(message, "collocation")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.collocation); - if (message.maxDistance != null && Object.hasOwnProperty.call(message, "maxDistance")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.maxDistance); - return writer; - }; - - /** - * Encodes the specified PlacementPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy} message PlacementPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PlacementPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PlacementPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.AllocationPolicy.PlacementPolicy} PlacementPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PlacementPolicy.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.collocation = reader.string(); - break; - } - case 2: { - message.maxDistance = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PlacementPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.AllocationPolicy.PlacementPolicy} PlacementPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PlacementPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PlacementPolicy message. - * @function verify - * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PlacementPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.collocation != null && message.hasOwnProperty("collocation")) - if (!$util.isString(message.collocation)) - return "collocation: string expected"; - if (message.maxDistance != null && message.hasOwnProperty("maxDistance")) - if (!$util.isInteger(message.maxDistance) && !(message.maxDistance && $util.isInteger(message.maxDistance.low) && $util.isInteger(message.maxDistance.high))) - return "maxDistance: integer|Long expected"; - return null; - }; - - /** - * Creates a PlacementPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.AllocationPolicy.PlacementPolicy} PlacementPolicy - */ - PlacementPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy) - return object; - var message = new $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy(); - if (object.collocation != null) - message.collocation = String(object.collocation); - if (object.maxDistance != null) - if ($util.Long) - (message.maxDistance = $util.Long.fromValue(object.maxDistance)).unsigned = false; - else if (typeof object.maxDistance === "string") - message.maxDistance = parseInt(object.maxDistance, 10); - else if (typeof object.maxDistance === "number") - message.maxDistance = object.maxDistance; - else if (typeof object.maxDistance === "object") - message.maxDistance = new $util.LongBits(object.maxDistance.low >>> 0, object.maxDistance.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a PlacementPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.PlacementPolicy} message PlacementPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PlacementPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.collocation = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.maxDistance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.maxDistance = options.longs === String ? "0" : 0; - } - if (message.collocation != null && message.hasOwnProperty("collocation")) - object.collocation = message.collocation; - if (message.maxDistance != null && message.hasOwnProperty("maxDistance")) - if (typeof message.maxDistance === "number") - object.maxDistance = options.longs === String ? String(message.maxDistance) : message.maxDistance; - else - object.maxDistance = options.longs === String ? $util.Long.prototype.toString.call(message.maxDistance) : options.longs === Number ? new $util.LongBits(message.maxDistance.low >>> 0, message.maxDistance.high >>> 0).toNumber() : message.maxDistance; - return object; - }; - - /** - * Converts this PlacementPolicy to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy - * @instance - * @returns {Object.} JSON object - */ - PlacementPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PlacementPolicy - * @function getTypeUrl - * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PlacementPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy.PlacementPolicy"; - }; - - return PlacementPolicy; - })(); - - /** - * ProvisioningModel enum. - * @name google.cloud.batch.v1.AllocationPolicy.ProvisioningModel - * @enum {number} - * @property {number} PROVISIONING_MODEL_UNSPECIFIED=0 PROVISIONING_MODEL_UNSPECIFIED value - * @property {number} STANDARD=1 STANDARD value - * @property {number} SPOT=2 SPOT value - * @property {number} PREEMPTIBLE=3 PREEMPTIBLE value - */ - AllocationPolicy.ProvisioningModel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PROVISIONING_MODEL_UNSPECIFIED"] = 0; - values[valuesById[1] = "STANDARD"] = 1; - values[valuesById[2] = "SPOT"] = 2; - values[valuesById[3] = "PREEMPTIBLE"] = 3; - return values; - })(); - - return AllocationPolicy; - })(); - - v1.TaskGroup = (function() { - - /** - * Properties of a TaskGroup. - * @memberof google.cloud.batch.v1 - * @interface ITaskGroup - * @property {string|null} [name] TaskGroup name - * @property {google.cloud.batch.v1.ITaskSpec|null} [taskSpec] TaskGroup taskSpec - * @property {number|Long|null} [taskCount] TaskGroup taskCount - * @property {number|Long|null} [parallelism] TaskGroup parallelism - * @property {google.cloud.batch.v1.TaskGroup.SchedulingPolicy|null} [schedulingPolicy] TaskGroup schedulingPolicy - * @property {Array.|null} [taskEnvironments] TaskGroup taskEnvironments - * @property {number|Long|null} [taskCountPerNode] TaskGroup taskCountPerNode - * @property {boolean|null} [requireHostsFile] TaskGroup requireHostsFile - * @property {boolean|null} [permissiveSsh] TaskGroup permissiveSsh - * @property {boolean|null} [runAsNonRoot] TaskGroup runAsNonRoot - */ - - /** - * Constructs a new TaskGroup. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a TaskGroup. - * @implements ITaskGroup - * @constructor - * @param {google.cloud.batch.v1.ITaskGroup=} [properties] Properties to set - */ - function TaskGroup(properties) { - this.taskEnvironments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TaskGroup name. - * @member {string} name - * @memberof google.cloud.batch.v1.TaskGroup - * @instance - */ - TaskGroup.prototype.name = ""; - - /** - * TaskGroup taskSpec. - * @member {google.cloud.batch.v1.ITaskSpec|null|undefined} taskSpec - * @memberof google.cloud.batch.v1.TaskGroup - * @instance - */ - TaskGroup.prototype.taskSpec = null; - - /** - * TaskGroup taskCount. - * @member {number|Long} taskCount - * @memberof google.cloud.batch.v1.TaskGroup - * @instance - */ - TaskGroup.prototype.taskCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * TaskGroup parallelism. - * @member {number|Long} parallelism - * @memberof google.cloud.batch.v1.TaskGroup - * @instance - */ - TaskGroup.prototype.parallelism = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * TaskGroup schedulingPolicy. - * @member {google.cloud.batch.v1.TaskGroup.SchedulingPolicy} schedulingPolicy - * @memberof google.cloud.batch.v1.TaskGroup - * @instance - */ - TaskGroup.prototype.schedulingPolicy = 0; - - /** - * TaskGroup taskEnvironments. - * @member {Array.} taskEnvironments - * @memberof google.cloud.batch.v1.TaskGroup - * @instance - */ - TaskGroup.prototype.taskEnvironments = $util.emptyArray; - - /** - * TaskGroup taskCountPerNode. - * @member {number|Long} taskCountPerNode - * @memberof google.cloud.batch.v1.TaskGroup - * @instance - */ - TaskGroup.prototype.taskCountPerNode = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * TaskGroup requireHostsFile. - * @member {boolean} requireHostsFile - * @memberof google.cloud.batch.v1.TaskGroup - * @instance - */ - TaskGroup.prototype.requireHostsFile = false; - - /** - * TaskGroup permissiveSsh. - * @member {boolean} permissiveSsh - * @memberof google.cloud.batch.v1.TaskGroup - * @instance - */ - TaskGroup.prototype.permissiveSsh = false; - - /** - * TaskGroup runAsNonRoot. - * @member {boolean} runAsNonRoot - * @memberof google.cloud.batch.v1.TaskGroup - * @instance - */ - TaskGroup.prototype.runAsNonRoot = false; - - /** - * Creates a new TaskGroup instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.TaskGroup - * @static - * @param {google.cloud.batch.v1.ITaskGroup=} [properties] Properties to set - * @returns {google.cloud.batch.v1.TaskGroup} TaskGroup instance - */ - TaskGroup.create = function create(properties) { - return new TaskGroup(properties); - }; - - /** - * Encodes the specified TaskGroup message. Does not implicitly {@link google.cloud.batch.v1.TaskGroup.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.TaskGroup - * @static - * @param {google.cloud.batch.v1.ITaskGroup} message TaskGroup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskGroup.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.taskSpec != null && Object.hasOwnProperty.call(message, "taskSpec")) - $root.google.cloud.batch.v1.TaskSpec.encode(message.taskSpec, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.taskCount != null && Object.hasOwnProperty.call(message, "taskCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.taskCount); - if (message.parallelism != null && Object.hasOwnProperty.call(message, "parallelism")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.parallelism); - if (message.schedulingPolicy != null && Object.hasOwnProperty.call(message, "schedulingPolicy")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.schedulingPolicy); - if (message.taskEnvironments != null && message.taskEnvironments.length) - for (var i = 0; i < message.taskEnvironments.length; ++i) - $root.google.cloud.batch.v1.Environment.encode(message.taskEnvironments[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.taskCountPerNode != null && Object.hasOwnProperty.call(message, "taskCountPerNode")) - writer.uint32(/* id 10, wireType 0 =*/80).int64(message.taskCountPerNode); - if (message.requireHostsFile != null && Object.hasOwnProperty.call(message, "requireHostsFile")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.requireHostsFile); - if (message.permissiveSsh != null && Object.hasOwnProperty.call(message, "permissiveSsh")) - writer.uint32(/* id 12, wireType 0 =*/96).bool(message.permissiveSsh); - if (message.runAsNonRoot != null && Object.hasOwnProperty.call(message, "runAsNonRoot")) - writer.uint32(/* id 14, wireType 0 =*/112).bool(message.runAsNonRoot); - return writer; - }; - - /** - * Encodes the specified TaskGroup message, length delimited. Does not implicitly {@link google.cloud.batch.v1.TaskGroup.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.TaskGroup - * @static - * @param {google.cloud.batch.v1.ITaskGroup} message TaskGroup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskGroup.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TaskGroup message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.TaskGroup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.TaskGroup} TaskGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskGroup.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.TaskGroup(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.taskSpec = $root.google.cloud.batch.v1.TaskSpec.decode(reader, reader.uint32()); - break; - } - case 4: { - message.taskCount = reader.int64(); - break; - } - case 5: { - message.parallelism = reader.int64(); - break; - } - case 6: { - message.schedulingPolicy = reader.int32(); - break; - } - case 9: { - if (!(message.taskEnvironments && message.taskEnvironments.length)) - message.taskEnvironments = []; - message.taskEnvironments.push($root.google.cloud.batch.v1.Environment.decode(reader, reader.uint32())); - break; - } - case 10: { - message.taskCountPerNode = reader.int64(); - break; - } - case 11: { - message.requireHostsFile = reader.bool(); - break; - } - case 12: { - message.permissiveSsh = reader.bool(); - break; - } - case 14: { - message.runAsNonRoot = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TaskGroup message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.TaskGroup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.TaskGroup} TaskGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskGroup.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TaskGroup message. - * @function verify - * @memberof google.cloud.batch.v1.TaskGroup - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TaskGroup.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.taskSpec != null && message.hasOwnProperty("taskSpec")) { - var error = $root.google.cloud.batch.v1.TaskSpec.verify(message.taskSpec); - if (error) - return "taskSpec." + error; - } - if (message.taskCount != null && message.hasOwnProperty("taskCount")) - if (!$util.isInteger(message.taskCount) && !(message.taskCount && $util.isInteger(message.taskCount.low) && $util.isInteger(message.taskCount.high))) - return "taskCount: integer|Long expected"; - if (message.parallelism != null && message.hasOwnProperty("parallelism")) - if (!$util.isInteger(message.parallelism) && !(message.parallelism && $util.isInteger(message.parallelism.low) && $util.isInteger(message.parallelism.high))) - return "parallelism: integer|Long expected"; - if (message.schedulingPolicy != null && message.hasOwnProperty("schedulingPolicy")) - switch (message.schedulingPolicy) { - default: - return "schedulingPolicy: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.taskEnvironments != null && message.hasOwnProperty("taskEnvironments")) { - if (!Array.isArray(message.taskEnvironments)) - return "taskEnvironments: array expected"; - for (var i = 0; i < message.taskEnvironments.length; ++i) { - var error = $root.google.cloud.batch.v1.Environment.verify(message.taskEnvironments[i]); - if (error) - return "taskEnvironments." + error; - } - } - if (message.taskCountPerNode != null && message.hasOwnProperty("taskCountPerNode")) - if (!$util.isInteger(message.taskCountPerNode) && !(message.taskCountPerNode && $util.isInteger(message.taskCountPerNode.low) && $util.isInteger(message.taskCountPerNode.high))) - return "taskCountPerNode: integer|Long expected"; - if (message.requireHostsFile != null && message.hasOwnProperty("requireHostsFile")) - if (typeof message.requireHostsFile !== "boolean") - return "requireHostsFile: boolean expected"; - if (message.permissiveSsh != null && message.hasOwnProperty("permissiveSsh")) - if (typeof message.permissiveSsh !== "boolean") - return "permissiveSsh: boolean expected"; - if (message.runAsNonRoot != null && message.hasOwnProperty("runAsNonRoot")) - if (typeof message.runAsNonRoot !== "boolean") - return "runAsNonRoot: boolean expected"; - return null; - }; - - /** - * Creates a TaskGroup message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.TaskGroup - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.TaskGroup} TaskGroup - */ - TaskGroup.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.TaskGroup) - return object; - var message = new $root.google.cloud.batch.v1.TaskGroup(); - if (object.name != null) - message.name = String(object.name); - if (object.taskSpec != null) { - if (typeof object.taskSpec !== "object") - throw TypeError(".google.cloud.batch.v1.TaskGroup.taskSpec: object expected"); - message.taskSpec = $root.google.cloud.batch.v1.TaskSpec.fromObject(object.taskSpec); - } - if (object.taskCount != null) - if ($util.Long) - (message.taskCount = $util.Long.fromValue(object.taskCount)).unsigned = false; - else if (typeof object.taskCount === "string") - message.taskCount = parseInt(object.taskCount, 10); - else if (typeof object.taskCount === "number") - message.taskCount = object.taskCount; - else if (typeof object.taskCount === "object") - message.taskCount = new $util.LongBits(object.taskCount.low >>> 0, object.taskCount.high >>> 0).toNumber(); - if (object.parallelism != null) - if ($util.Long) - (message.parallelism = $util.Long.fromValue(object.parallelism)).unsigned = false; - else if (typeof object.parallelism === "string") - message.parallelism = parseInt(object.parallelism, 10); - else if (typeof object.parallelism === "number") - message.parallelism = object.parallelism; - else if (typeof object.parallelism === "object") - message.parallelism = new $util.LongBits(object.parallelism.low >>> 0, object.parallelism.high >>> 0).toNumber(); - switch (object.schedulingPolicy) { - default: - if (typeof object.schedulingPolicy === "number") { - message.schedulingPolicy = object.schedulingPolicy; - break; - } - break; - case "SCHEDULING_POLICY_UNSPECIFIED": - case 0: - message.schedulingPolicy = 0; - break; - case "AS_SOON_AS_POSSIBLE": - case 1: - message.schedulingPolicy = 1; - break; - case "IN_ORDER": - case 2: - message.schedulingPolicy = 2; - break; - } - if (object.taskEnvironments) { - if (!Array.isArray(object.taskEnvironments)) - throw TypeError(".google.cloud.batch.v1.TaskGroup.taskEnvironments: array expected"); - message.taskEnvironments = []; - for (var i = 0; i < object.taskEnvironments.length; ++i) { - if (typeof object.taskEnvironments[i] !== "object") - throw TypeError(".google.cloud.batch.v1.TaskGroup.taskEnvironments: object expected"); - message.taskEnvironments[i] = $root.google.cloud.batch.v1.Environment.fromObject(object.taskEnvironments[i]); - } - } - if (object.taskCountPerNode != null) - if ($util.Long) - (message.taskCountPerNode = $util.Long.fromValue(object.taskCountPerNode)).unsigned = false; - else if (typeof object.taskCountPerNode === "string") - message.taskCountPerNode = parseInt(object.taskCountPerNode, 10); - else if (typeof object.taskCountPerNode === "number") - message.taskCountPerNode = object.taskCountPerNode; - else if (typeof object.taskCountPerNode === "object") - message.taskCountPerNode = new $util.LongBits(object.taskCountPerNode.low >>> 0, object.taskCountPerNode.high >>> 0).toNumber(); - if (object.requireHostsFile != null) - message.requireHostsFile = Boolean(object.requireHostsFile); - if (object.permissiveSsh != null) - message.permissiveSsh = Boolean(object.permissiveSsh); - if (object.runAsNonRoot != null) - message.runAsNonRoot = Boolean(object.runAsNonRoot); - return message; - }; - - /** - * Creates a plain object from a TaskGroup message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.TaskGroup - * @static - * @param {google.cloud.batch.v1.TaskGroup} message TaskGroup - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TaskGroup.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.taskEnvironments = []; - if (options.defaults) { - object.name = ""; - object.taskSpec = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.taskCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.taskCount = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.parallelism = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.parallelism = options.longs === String ? "0" : 0; - object.schedulingPolicy = options.enums === String ? "SCHEDULING_POLICY_UNSPECIFIED" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.taskCountPerNode = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.taskCountPerNode = options.longs === String ? "0" : 0; - object.requireHostsFile = false; - object.permissiveSsh = false; - object.runAsNonRoot = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.taskSpec != null && message.hasOwnProperty("taskSpec")) - object.taskSpec = $root.google.cloud.batch.v1.TaskSpec.toObject(message.taskSpec, options); - if (message.taskCount != null && message.hasOwnProperty("taskCount")) - if (typeof message.taskCount === "number") - object.taskCount = options.longs === String ? String(message.taskCount) : message.taskCount; - else - object.taskCount = options.longs === String ? $util.Long.prototype.toString.call(message.taskCount) : options.longs === Number ? new $util.LongBits(message.taskCount.low >>> 0, message.taskCount.high >>> 0).toNumber() : message.taskCount; - if (message.parallelism != null && message.hasOwnProperty("parallelism")) - if (typeof message.parallelism === "number") - object.parallelism = options.longs === String ? String(message.parallelism) : message.parallelism; - else - object.parallelism = options.longs === String ? $util.Long.prototype.toString.call(message.parallelism) : options.longs === Number ? new $util.LongBits(message.parallelism.low >>> 0, message.parallelism.high >>> 0).toNumber() : message.parallelism; - if (message.schedulingPolicy != null && message.hasOwnProperty("schedulingPolicy")) - object.schedulingPolicy = options.enums === String ? $root.google.cloud.batch.v1.TaskGroup.SchedulingPolicy[message.schedulingPolicy] === undefined ? message.schedulingPolicy : $root.google.cloud.batch.v1.TaskGroup.SchedulingPolicy[message.schedulingPolicy] : message.schedulingPolicy; - if (message.taskEnvironments && message.taskEnvironments.length) { - object.taskEnvironments = []; - for (var j = 0; j < message.taskEnvironments.length; ++j) - object.taskEnvironments[j] = $root.google.cloud.batch.v1.Environment.toObject(message.taskEnvironments[j], options); - } - if (message.taskCountPerNode != null && message.hasOwnProperty("taskCountPerNode")) - if (typeof message.taskCountPerNode === "number") - object.taskCountPerNode = options.longs === String ? String(message.taskCountPerNode) : message.taskCountPerNode; - else - object.taskCountPerNode = options.longs === String ? $util.Long.prototype.toString.call(message.taskCountPerNode) : options.longs === Number ? new $util.LongBits(message.taskCountPerNode.low >>> 0, message.taskCountPerNode.high >>> 0).toNumber() : message.taskCountPerNode; - if (message.requireHostsFile != null && message.hasOwnProperty("requireHostsFile")) - object.requireHostsFile = message.requireHostsFile; - if (message.permissiveSsh != null && message.hasOwnProperty("permissiveSsh")) - object.permissiveSsh = message.permissiveSsh; - if (message.runAsNonRoot != null && message.hasOwnProperty("runAsNonRoot")) - object.runAsNonRoot = message.runAsNonRoot; - return object; - }; - - /** - * Converts this TaskGroup to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.TaskGroup - * @instance - * @returns {Object.} JSON object - */ - TaskGroup.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TaskGroup - * @function getTypeUrl - * @memberof google.cloud.batch.v1.TaskGroup - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TaskGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.TaskGroup"; - }; - - /** - * SchedulingPolicy enum. - * @name google.cloud.batch.v1.TaskGroup.SchedulingPolicy - * @enum {number} - * @property {number} SCHEDULING_POLICY_UNSPECIFIED=0 SCHEDULING_POLICY_UNSPECIFIED value - * @property {number} AS_SOON_AS_POSSIBLE=1 AS_SOON_AS_POSSIBLE value - * @property {number} IN_ORDER=2 IN_ORDER value - */ - TaskGroup.SchedulingPolicy = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SCHEDULING_POLICY_UNSPECIFIED"] = 0; - values[valuesById[1] = "AS_SOON_AS_POSSIBLE"] = 1; - values[valuesById[2] = "IN_ORDER"] = 2; - return values; - })(); - - return TaskGroup; - })(); - - v1.ServiceAccount = (function() { - - /** - * Properties of a ServiceAccount. - * @memberof google.cloud.batch.v1 - * @interface IServiceAccount - * @property {string|null} [email] ServiceAccount email - * @property {Array.|null} [scopes] ServiceAccount scopes - */ - - /** - * Constructs a new ServiceAccount. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a ServiceAccount. - * @implements IServiceAccount - * @constructor - * @param {google.cloud.batch.v1.IServiceAccount=} [properties] Properties to set - */ - function ServiceAccount(properties) { - this.scopes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceAccount email. - * @member {string} email - * @memberof google.cloud.batch.v1.ServiceAccount - * @instance - */ - ServiceAccount.prototype.email = ""; - - /** - * ServiceAccount scopes. - * @member {Array.} scopes - * @memberof google.cloud.batch.v1.ServiceAccount - * @instance - */ - ServiceAccount.prototype.scopes = $util.emptyArray; - - /** - * Creates a new ServiceAccount instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.ServiceAccount - * @static - * @param {google.cloud.batch.v1.IServiceAccount=} [properties] Properties to set - * @returns {google.cloud.batch.v1.ServiceAccount} ServiceAccount instance - */ - ServiceAccount.create = function create(properties) { - return new ServiceAccount(properties); - }; - - /** - * Encodes the specified ServiceAccount message. Does not implicitly {@link google.cloud.batch.v1.ServiceAccount.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.ServiceAccount - * @static - * @param {google.cloud.batch.v1.IServiceAccount} message ServiceAccount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceAccount.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.email != null && Object.hasOwnProperty.call(message, "email")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.email); - if (message.scopes != null && message.scopes.length) - for (var i = 0; i < message.scopes.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.scopes[i]); - return writer; - }; - - /** - * Encodes the specified ServiceAccount message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ServiceAccount.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.ServiceAccount - * @static - * @param {google.cloud.batch.v1.IServiceAccount} message ServiceAccount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceAccount.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceAccount message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.ServiceAccount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.ServiceAccount} ServiceAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceAccount.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.ServiceAccount(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.email = reader.string(); - break; - } - case 2: { - if (!(message.scopes && message.scopes.length)) - message.scopes = []; - message.scopes.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceAccount message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.ServiceAccount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.ServiceAccount} ServiceAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceAccount.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceAccount message. - * @function verify - * @memberof google.cloud.batch.v1.ServiceAccount - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceAccount.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.email != null && message.hasOwnProperty("email")) - if (!$util.isString(message.email)) - return "email: string expected"; - if (message.scopes != null && message.hasOwnProperty("scopes")) { - if (!Array.isArray(message.scopes)) - return "scopes: array expected"; - for (var i = 0; i < message.scopes.length; ++i) - if (!$util.isString(message.scopes[i])) - return "scopes: string[] expected"; - } - return null; - }; - - /** - * Creates a ServiceAccount message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.ServiceAccount - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.ServiceAccount} ServiceAccount - */ - ServiceAccount.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.ServiceAccount) - return object; - var message = new $root.google.cloud.batch.v1.ServiceAccount(); - if (object.email != null) - message.email = String(object.email); - if (object.scopes) { - if (!Array.isArray(object.scopes)) - throw TypeError(".google.cloud.batch.v1.ServiceAccount.scopes: array expected"); - message.scopes = []; - for (var i = 0; i < object.scopes.length; ++i) - message.scopes[i] = String(object.scopes[i]); - } - return message; - }; - - /** - * Creates a plain object from a ServiceAccount message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.ServiceAccount - * @static - * @param {google.cloud.batch.v1.ServiceAccount} message ServiceAccount - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceAccount.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.scopes = []; - if (options.defaults) - object.email = ""; - if (message.email != null && message.hasOwnProperty("email")) - object.email = message.email; - if (message.scopes && message.scopes.length) { - object.scopes = []; - for (var j = 0; j < message.scopes.length; ++j) - object.scopes[j] = message.scopes[j]; - } - return object; - }; - - /** - * Converts this ServiceAccount to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.ServiceAccount - * @instance - * @returns {Object.} JSON object - */ - ServiceAccount.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceAccount - * @function getTypeUrl - * @memberof google.cloud.batch.v1.ServiceAccount - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceAccount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.ServiceAccount"; - }; - - return ServiceAccount; - })(); - - v1.ComputeResource = (function() { - - /** - * Properties of a ComputeResource. - * @memberof google.cloud.batch.v1 - * @interface IComputeResource - * @property {number|Long|null} [cpuMilli] ComputeResource cpuMilli - * @property {number|Long|null} [memoryMib] ComputeResource memoryMib - * @property {number|Long|null} [bootDiskMib] ComputeResource bootDiskMib - */ - - /** - * Constructs a new ComputeResource. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a ComputeResource. - * @implements IComputeResource - * @constructor - * @param {google.cloud.batch.v1.IComputeResource=} [properties] Properties to set - */ - function ComputeResource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ComputeResource cpuMilli. - * @member {number|Long} cpuMilli - * @memberof google.cloud.batch.v1.ComputeResource - * @instance - */ - ComputeResource.prototype.cpuMilli = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ComputeResource memoryMib. - * @member {number|Long} memoryMib - * @memberof google.cloud.batch.v1.ComputeResource - * @instance - */ - ComputeResource.prototype.memoryMib = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ComputeResource bootDiskMib. - * @member {number|Long} bootDiskMib - * @memberof google.cloud.batch.v1.ComputeResource - * @instance - */ - ComputeResource.prototype.bootDiskMib = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new ComputeResource instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.ComputeResource - * @static - * @param {google.cloud.batch.v1.IComputeResource=} [properties] Properties to set - * @returns {google.cloud.batch.v1.ComputeResource} ComputeResource instance - */ - ComputeResource.create = function create(properties) { - return new ComputeResource(properties); - }; - - /** - * Encodes the specified ComputeResource message. Does not implicitly {@link google.cloud.batch.v1.ComputeResource.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.ComputeResource - * @static - * @param {google.cloud.batch.v1.IComputeResource} message ComputeResource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ComputeResource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cpuMilli != null && Object.hasOwnProperty.call(message, "cpuMilli")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.cpuMilli); - if (message.memoryMib != null && Object.hasOwnProperty.call(message, "memoryMib")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.memoryMib); - if (message.bootDiskMib != null && Object.hasOwnProperty.call(message, "bootDiskMib")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.bootDiskMib); - return writer; - }; - - /** - * Encodes the specified ComputeResource message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ComputeResource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.ComputeResource - * @static - * @param {google.cloud.batch.v1.IComputeResource} message ComputeResource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ComputeResource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ComputeResource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.ComputeResource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.ComputeResource} ComputeResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ComputeResource.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.ComputeResource(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.cpuMilli = reader.int64(); - break; - } - case 2: { - message.memoryMib = reader.int64(); - break; - } - case 4: { - message.bootDiskMib = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ComputeResource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.ComputeResource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.ComputeResource} ComputeResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ComputeResource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ComputeResource message. - * @function verify - * @memberof google.cloud.batch.v1.ComputeResource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ComputeResource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.cpuMilli != null && message.hasOwnProperty("cpuMilli")) - if (!$util.isInteger(message.cpuMilli) && !(message.cpuMilli && $util.isInteger(message.cpuMilli.low) && $util.isInteger(message.cpuMilli.high))) - return "cpuMilli: integer|Long expected"; - if (message.memoryMib != null && message.hasOwnProperty("memoryMib")) - if (!$util.isInteger(message.memoryMib) && !(message.memoryMib && $util.isInteger(message.memoryMib.low) && $util.isInteger(message.memoryMib.high))) - return "memoryMib: integer|Long expected"; - if (message.bootDiskMib != null && message.hasOwnProperty("bootDiskMib")) - if (!$util.isInteger(message.bootDiskMib) && !(message.bootDiskMib && $util.isInteger(message.bootDiskMib.low) && $util.isInteger(message.bootDiskMib.high))) - return "bootDiskMib: integer|Long expected"; - return null; - }; - - /** - * Creates a ComputeResource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.ComputeResource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.ComputeResource} ComputeResource - */ - ComputeResource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.ComputeResource) - return object; - var message = new $root.google.cloud.batch.v1.ComputeResource(); - if (object.cpuMilli != null) - if ($util.Long) - (message.cpuMilli = $util.Long.fromValue(object.cpuMilli)).unsigned = false; - else if (typeof object.cpuMilli === "string") - message.cpuMilli = parseInt(object.cpuMilli, 10); - else if (typeof object.cpuMilli === "number") - message.cpuMilli = object.cpuMilli; - else if (typeof object.cpuMilli === "object") - message.cpuMilli = new $util.LongBits(object.cpuMilli.low >>> 0, object.cpuMilli.high >>> 0).toNumber(); - if (object.memoryMib != null) - if ($util.Long) - (message.memoryMib = $util.Long.fromValue(object.memoryMib)).unsigned = false; - else if (typeof object.memoryMib === "string") - message.memoryMib = parseInt(object.memoryMib, 10); - else if (typeof object.memoryMib === "number") - message.memoryMib = object.memoryMib; - else if (typeof object.memoryMib === "object") - message.memoryMib = new $util.LongBits(object.memoryMib.low >>> 0, object.memoryMib.high >>> 0).toNumber(); - if (object.bootDiskMib != null) - if ($util.Long) - (message.bootDiskMib = $util.Long.fromValue(object.bootDiskMib)).unsigned = false; - else if (typeof object.bootDiskMib === "string") - message.bootDiskMib = parseInt(object.bootDiskMib, 10); - else if (typeof object.bootDiskMib === "number") - message.bootDiskMib = object.bootDiskMib; - else if (typeof object.bootDiskMib === "object") - message.bootDiskMib = new $util.LongBits(object.bootDiskMib.low >>> 0, object.bootDiskMib.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a ComputeResource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.ComputeResource - * @static - * @param {google.cloud.batch.v1.ComputeResource} message ComputeResource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ComputeResource.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.cpuMilli = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.cpuMilli = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.memoryMib = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.memoryMib = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.bootDiskMib = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.bootDiskMib = options.longs === String ? "0" : 0; - } - if (message.cpuMilli != null && message.hasOwnProperty("cpuMilli")) - if (typeof message.cpuMilli === "number") - object.cpuMilli = options.longs === String ? String(message.cpuMilli) : message.cpuMilli; - else - object.cpuMilli = options.longs === String ? $util.Long.prototype.toString.call(message.cpuMilli) : options.longs === Number ? new $util.LongBits(message.cpuMilli.low >>> 0, message.cpuMilli.high >>> 0).toNumber() : message.cpuMilli; - if (message.memoryMib != null && message.hasOwnProperty("memoryMib")) - if (typeof message.memoryMib === "number") - object.memoryMib = options.longs === String ? String(message.memoryMib) : message.memoryMib; - else - object.memoryMib = options.longs === String ? $util.Long.prototype.toString.call(message.memoryMib) : options.longs === Number ? new $util.LongBits(message.memoryMib.low >>> 0, message.memoryMib.high >>> 0).toNumber() : message.memoryMib; - if (message.bootDiskMib != null && message.hasOwnProperty("bootDiskMib")) - if (typeof message.bootDiskMib === "number") - object.bootDiskMib = options.longs === String ? String(message.bootDiskMib) : message.bootDiskMib; - else - object.bootDiskMib = options.longs === String ? $util.Long.prototype.toString.call(message.bootDiskMib) : options.longs === Number ? new $util.LongBits(message.bootDiskMib.low >>> 0, message.bootDiskMib.high >>> 0).toNumber() : message.bootDiskMib; - return object; - }; - - /** - * Converts this ComputeResource to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.ComputeResource - * @instance - * @returns {Object.} JSON object - */ - ComputeResource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ComputeResource - * @function getTypeUrl - * @memberof google.cloud.batch.v1.ComputeResource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ComputeResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.ComputeResource"; - }; - - return ComputeResource; - })(); - - v1.StatusEvent = (function() { - - /** - * Properties of a StatusEvent. - * @memberof google.cloud.batch.v1 - * @interface IStatusEvent - * @property {string|null} [type] StatusEvent type - * @property {string|null} [description] StatusEvent description - * @property {google.protobuf.ITimestamp|null} [eventTime] StatusEvent eventTime - * @property {google.cloud.batch.v1.ITaskExecution|null} [taskExecution] StatusEvent taskExecution - * @property {google.cloud.batch.v1.TaskStatus.State|null} [taskState] StatusEvent taskState - */ - - /** - * Constructs a new StatusEvent. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a StatusEvent. - * @implements IStatusEvent - * @constructor - * @param {google.cloud.batch.v1.IStatusEvent=} [properties] Properties to set - */ - function StatusEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StatusEvent type. - * @member {string} type - * @memberof google.cloud.batch.v1.StatusEvent - * @instance - */ - StatusEvent.prototype.type = ""; - - /** - * StatusEvent description. - * @member {string} description - * @memberof google.cloud.batch.v1.StatusEvent - * @instance - */ - StatusEvent.prototype.description = ""; - - /** - * StatusEvent eventTime. - * @member {google.protobuf.ITimestamp|null|undefined} eventTime - * @memberof google.cloud.batch.v1.StatusEvent - * @instance - */ - StatusEvent.prototype.eventTime = null; - - /** - * StatusEvent taskExecution. - * @member {google.cloud.batch.v1.ITaskExecution|null|undefined} taskExecution - * @memberof google.cloud.batch.v1.StatusEvent - * @instance - */ - StatusEvent.prototype.taskExecution = null; - - /** - * StatusEvent taskState. - * @member {google.cloud.batch.v1.TaskStatus.State} taskState - * @memberof google.cloud.batch.v1.StatusEvent - * @instance - */ - StatusEvent.prototype.taskState = 0; - - /** - * Creates a new StatusEvent instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.StatusEvent - * @static - * @param {google.cloud.batch.v1.IStatusEvent=} [properties] Properties to set - * @returns {google.cloud.batch.v1.StatusEvent} StatusEvent instance - */ - StatusEvent.create = function create(properties) { - return new StatusEvent(properties); - }; - - /** - * Encodes the specified StatusEvent message. Does not implicitly {@link google.cloud.batch.v1.StatusEvent.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.StatusEvent - * @static - * @param {google.cloud.batch.v1.IStatusEvent} message StatusEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StatusEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); - if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) - $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); - if (message.taskExecution != null && Object.hasOwnProperty.call(message, "taskExecution")) - $root.google.cloud.batch.v1.TaskExecution.encode(message.taskExecution, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.taskState != null && Object.hasOwnProperty.call(message, "taskState")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.taskState); - return writer; - }; - - /** - * Encodes the specified StatusEvent message, length delimited. Does not implicitly {@link google.cloud.batch.v1.StatusEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.StatusEvent - * @static - * @param {google.cloud.batch.v1.IStatusEvent} message StatusEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StatusEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StatusEvent message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.StatusEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.StatusEvent} StatusEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StatusEvent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.StatusEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 3: { - message.type = reader.string(); - break; - } - case 1: { - message.description = reader.string(); - break; - } - case 2: { - message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.taskExecution = $root.google.cloud.batch.v1.TaskExecution.decode(reader, reader.uint32()); - break; - } - case 5: { - message.taskState = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StatusEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.StatusEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.StatusEvent} StatusEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StatusEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StatusEvent message. - * @function verify - * @memberof google.cloud.batch.v1.StatusEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StatusEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.eventTime != null && message.hasOwnProperty("eventTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.eventTime); - if (error) - return "eventTime." + error; - } - if (message.taskExecution != null && message.hasOwnProperty("taskExecution")) { - var error = $root.google.cloud.batch.v1.TaskExecution.verify(message.taskExecution); - if (error) - return "taskExecution." + error; - } - if (message.taskState != null && message.hasOwnProperty("taskState")) - switch (message.taskState) { - default: - return "taskState: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - return null; - }; - - /** - * Creates a StatusEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.StatusEvent - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.StatusEvent} StatusEvent - */ - StatusEvent.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.StatusEvent) - return object; - var message = new $root.google.cloud.batch.v1.StatusEvent(); - if (object.type != null) - message.type = String(object.type); - if (object.description != null) - message.description = String(object.description); - if (object.eventTime != null) { - if (typeof object.eventTime !== "object") - throw TypeError(".google.cloud.batch.v1.StatusEvent.eventTime: object expected"); - message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); - } - if (object.taskExecution != null) { - if (typeof object.taskExecution !== "object") - throw TypeError(".google.cloud.batch.v1.StatusEvent.taskExecution: object expected"); - message.taskExecution = $root.google.cloud.batch.v1.TaskExecution.fromObject(object.taskExecution); - } - switch (object.taskState) { - default: - if (typeof object.taskState === "number") { - message.taskState = object.taskState; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.taskState = 0; - break; - case "PENDING": - case 1: - message.taskState = 1; - break; - case "ASSIGNED": - case 2: - message.taskState = 2; - break; - case "RUNNING": - case 3: - message.taskState = 3; - break; - case "FAILED": - case 4: - message.taskState = 4; - break; - case "SUCCEEDED": - case 5: - message.taskState = 5; - break; - case "UNEXECUTED": - case 6: - message.taskState = 6; - break; - } - return message; - }; - - /** - * Creates a plain object from a StatusEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.StatusEvent - * @static - * @param {google.cloud.batch.v1.StatusEvent} message StatusEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StatusEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.description = ""; - object.eventTime = null; - object.type = ""; - object.taskExecution = null; - object.taskState = options.enums === String ? "STATE_UNSPECIFIED" : 0; - } - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.eventTime != null && message.hasOwnProperty("eventTime")) - object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.taskExecution != null && message.hasOwnProperty("taskExecution")) - object.taskExecution = $root.google.cloud.batch.v1.TaskExecution.toObject(message.taskExecution, options); - if (message.taskState != null && message.hasOwnProperty("taskState")) - object.taskState = options.enums === String ? $root.google.cloud.batch.v1.TaskStatus.State[message.taskState] === undefined ? message.taskState : $root.google.cloud.batch.v1.TaskStatus.State[message.taskState] : message.taskState; - return object; - }; - - /** - * Converts this StatusEvent to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.StatusEvent - * @instance - * @returns {Object.} JSON object - */ - StatusEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StatusEvent - * @function getTypeUrl - * @memberof google.cloud.batch.v1.StatusEvent - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StatusEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.StatusEvent"; - }; - - return StatusEvent; - })(); - - v1.TaskExecution = (function() { - - /** - * Properties of a TaskExecution. - * @memberof google.cloud.batch.v1 - * @interface ITaskExecution - * @property {number|null} [exitCode] TaskExecution exitCode - */ - - /** - * Constructs a new TaskExecution. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a TaskExecution. - * @implements ITaskExecution - * @constructor - * @param {google.cloud.batch.v1.ITaskExecution=} [properties] Properties to set - */ - function TaskExecution(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TaskExecution exitCode. - * @member {number} exitCode - * @memberof google.cloud.batch.v1.TaskExecution - * @instance - */ - TaskExecution.prototype.exitCode = 0; - - /** - * Creates a new TaskExecution instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.TaskExecution - * @static - * @param {google.cloud.batch.v1.ITaskExecution=} [properties] Properties to set - * @returns {google.cloud.batch.v1.TaskExecution} TaskExecution instance - */ - TaskExecution.create = function create(properties) { - return new TaskExecution(properties); - }; - - /** - * Encodes the specified TaskExecution message. Does not implicitly {@link google.cloud.batch.v1.TaskExecution.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.TaskExecution - * @static - * @param {google.cloud.batch.v1.ITaskExecution} message TaskExecution message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskExecution.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.exitCode != null && Object.hasOwnProperty.call(message, "exitCode")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.exitCode); - return writer; - }; - - /** - * Encodes the specified TaskExecution message, length delimited. Does not implicitly {@link google.cloud.batch.v1.TaskExecution.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.TaskExecution - * @static - * @param {google.cloud.batch.v1.ITaskExecution} message TaskExecution message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskExecution.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TaskExecution message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.TaskExecution - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.TaskExecution} TaskExecution - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskExecution.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.TaskExecution(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.exitCode = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TaskExecution message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.TaskExecution - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.TaskExecution} TaskExecution - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskExecution.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TaskExecution message. - * @function verify - * @memberof google.cloud.batch.v1.TaskExecution - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TaskExecution.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.exitCode != null && message.hasOwnProperty("exitCode")) - if (!$util.isInteger(message.exitCode)) - return "exitCode: integer expected"; - return null; - }; - - /** - * Creates a TaskExecution message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.TaskExecution - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.TaskExecution} TaskExecution - */ - TaskExecution.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.TaskExecution) - return object; - var message = new $root.google.cloud.batch.v1.TaskExecution(); - if (object.exitCode != null) - message.exitCode = object.exitCode | 0; - return message; - }; - - /** - * Creates a plain object from a TaskExecution message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.TaskExecution - * @static - * @param {google.cloud.batch.v1.TaskExecution} message TaskExecution - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TaskExecution.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.exitCode = 0; - if (message.exitCode != null && message.hasOwnProperty("exitCode")) - object.exitCode = message.exitCode; - return object; - }; - - /** - * Converts this TaskExecution to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.TaskExecution - * @instance - * @returns {Object.} JSON object - */ - TaskExecution.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TaskExecution - * @function getTypeUrl - * @memberof google.cloud.batch.v1.TaskExecution - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TaskExecution.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.TaskExecution"; - }; - - return TaskExecution; - })(); - - v1.TaskStatus = (function() { - - /** - * Properties of a TaskStatus. - * @memberof google.cloud.batch.v1 - * @interface ITaskStatus - * @property {google.cloud.batch.v1.TaskStatus.State|null} [state] TaskStatus state - * @property {Array.|null} [statusEvents] TaskStatus statusEvents - */ - - /** - * Constructs a new TaskStatus. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a TaskStatus. - * @implements ITaskStatus - * @constructor - * @param {google.cloud.batch.v1.ITaskStatus=} [properties] Properties to set - */ - function TaskStatus(properties) { - this.statusEvents = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TaskStatus state. - * @member {google.cloud.batch.v1.TaskStatus.State} state - * @memberof google.cloud.batch.v1.TaskStatus - * @instance - */ - TaskStatus.prototype.state = 0; - - /** - * TaskStatus statusEvents. - * @member {Array.} statusEvents - * @memberof google.cloud.batch.v1.TaskStatus - * @instance - */ - TaskStatus.prototype.statusEvents = $util.emptyArray; - - /** - * Creates a new TaskStatus instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.TaskStatus - * @static - * @param {google.cloud.batch.v1.ITaskStatus=} [properties] Properties to set - * @returns {google.cloud.batch.v1.TaskStatus} TaskStatus instance - */ - TaskStatus.create = function create(properties) { - return new TaskStatus(properties); - }; - - /** - * Encodes the specified TaskStatus message. Does not implicitly {@link google.cloud.batch.v1.TaskStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.TaskStatus - * @static - * @param {google.cloud.batch.v1.ITaskStatus} message TaskStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskStatus.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); - if (message.statusEvents != null && message.statusEvents.length) - for (var i = 0; i < message.statusEvents.length; ++i) - $root.google.cloud.batch.v1.StatusEvent.encode(message.statusEvents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TaskStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1.TaskStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.TaskStatus - * @static - * @param {google.cloud.batch.v1.ITaskStatus} message TaskStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TaskStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.TaskStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.TaskStatus} TaskStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskStatus.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.TaskStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.state = reader.int32(); - break; - } - case 2: { - if (!(message.statusEvents && message.statusEvents.length)) - message.statusEvents = []; - message.statusEvents.push($root.google.cloud.batch.v1.StatusEvent.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TaskStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.TaskStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.TaskStatus} TaskStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TaskStatus message. - * @function verify - * @memberof google.cloud.batch.v1.TaskStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TaskStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.statusEvents != null && message.hasOwnProperty("statusEvents")) { - if (!Array.isArray(message.statusEvents)) - return "statusEvents: array expected"; - for (var i = 0; i < message.statusEvents.length; ++i) { - var error = $root.google.cloud.batch.v1.StatusEvent.verify(message.statusEvents[i]); - if (error) - return "statusEvents." + error; - } - } - return null; - }; - - /** - * Creates a TaskStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.TaskStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.TaskStatus} TaskStatus - */ - TaskStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.TaskStatus) - return object; - var message = new $root.google.cloud.batch.v1.TaskStatus(); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "PENDING": - case 1: - message.state = 1; - break; - case "ASSIGNED": - case 2: - message.state = 2; - break; - case "RUNNING": - case 3: - message.state = 3; - break; - case "FAILED": - case 4: - message.state = 4; - break; - case "SUCCEEDED": - case 5: - message.state = 5; - break; - case "UNEXECUTED": - case 6: - message.state = 6; - break; - } - if (object.statusEvents) { - if (!Array.isArray(object.statusEvents)) - throw TypeError(".google.cloud.batch.v1.TaskStatus.statusEvents: array expected"); - message.statusEvents = []; - for (var i = 0; i < object.statusEvents.length; ++i) { - if (typeof object.statusEvents[i] !== "object") - throw TypeError(".google.cloud.batch.v1.TaskStatus.statusEvents: object expected"); - message.statusEvents[i] = $root.google.cloud.batch.v1.StatusEvent.fromObject(object.statusEvents[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a TaskStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.TaskStatus - * @static - * @param {google.cloud.batch.v1.TaskStatus} message TaskStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TaskStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.statusEvents = []; - if (options.defaults) - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.batch.v1.TaskStatus.State[message.state] === undefined ? message.state : $root.google.cloud.batch.v1.TaskStatus.State[message.state] : message.state; - if (message.statusEvents && message.statusEvents.length) { - object.statusEvents = []; - for (var j = 0; j < message.statusEvents.length; ++j) - object.statusEvents[j] = $root.google.cloud.batch.v1.StatusEvent.toObject(message.statusEvents[j], options); - } - return object; - }; - - /** - * Converts this TaskStatus to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.TaskStatus - * @instance - * @returns {Object.} JSON object - */ - TaskStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TaskStatus - * @function getTypeUrl - * @memberof google.cloud.batch.v1.TaskStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TaskStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.TaskStatus"; - }; - - /** - * State enum. - * @name google.cloud.batch.v1.TaskStatus.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} PENDING=1 PENDING value - * @property {number} ASSIGNED=2 ASSIGNED value - * @property {number} RUNNING=3 RUNNING value - * @property {number} FAILED=4 FAILED value - * @property {number} SUCCEEDED=5 SUCCEEDED value - * @property {number} UNEXECUTED=6 UNEXECUTED value - */ - TaskStatus.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PENDING"] = 1; - values[valuesById[2] = "ASSIGNED"] = 2; - values[valuesById[3] = "RUNNING"] = 3; - values[valuesById[4] = "FAILED"] = 4; - values[valuesById[5] = "SUCCEEDED"] = 5; - values[valuesById[6] = "UNEXECUTED"] = 6; - return values; - })(); - - return TaskStatus; - })(); - - v1.Runnable = (function() { - - /** - * Properties of a Runnable. - * @memberof google.cloud.batch.v1 - * @interface IRunnable - * @property {google.cloud.batch.v1.Runnable.IContainer|null} [container] Runnable container - * @property {google.cloud.batch.v1.Runnable.IScript|null} [script] Runnable script - * @property {google.cloud.batch.v1.Runnable.IBarrier|null} [barrier] Runnable barrier - * @property {string|null} [displayName] Runnable displayName - * @property {boolean|null} [ignoreExitStatus] Runnable ignoreExitStatus - * @property {boolean|null} [background] Runnable background - * @property {boolean|null} [alwaysRun] Runnable alwaysRun - * @property {google.cloud.batch.v1.IEnvironment|null} [environment] Runnable environment - * @property {google.protobuf.IDuration|null} [timeout] Runnable timeout - * @property {Object.|null} [labels] Runnable labels - */ - - /** - * Constructs a new Runnable. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a Runnable. - * @implements IRunnable - * @constructor - * @param {google.cloud.batch.v1.IRunnable=} [properties] Properties to set - */ - function Runnable(properties) { - this.labels = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Runnable container. - * @member {google.cloud.batch.v1.Runnable.IContainer|null|undefined} container - * @memberof google.cloud.batch.v1.Runnable - * @instance - */ - Runnable.prototype.container = null; - - /** - * Runnable script. - * @member {google.cloud.batch.v1.Runnable.IScript|null|undefined} script - * @memberof google.cloud.batch.v1.Runnable - * @instance - */ - Runnable.prototype.script = null; - - /** - * Runnable barrier. - * @member {google.cloud.batch.v1.Runnable.IBarrier|null|undefined} barrier - * @memberof google.cloud.batch.v1.Runnable - * @instance - */ - Runnable.prototype.barrier = null; - - /** - * Runnable displayName. - * @member {string} displayName - * @memberof google.cloud.batch.v1.Runnable - * @instance - */ - Runnable.prototype.displayName = ""; - - /** - * Runnable ignoreExitStatus. - * @member {boolean} ignoreExitStatus - * @memberof google.cloud.batch.v1.Runnable - * @instance - */ - Runnable.prototype.ignoreExitStatus = false; - - /** - * Runnable background. - * @member {boolean} background - * @memberof google.cloud.batch.v1.Runnable - * @instance - */ - Runnable.prototype.background = false; - - /** - * Runnable alwaysRun. - * @member {boolean} alwaysRun - * @memberof google.cloud.batch.v1.Runnable - * @instance - */ - Runnable.prototype.alwaysRun = false; - - /** - * Runnable environment. - * @member {google.cloud.batch.v1.IEnvironment|null|undefined} environment - * @memberof google.cloud.batch.v1.Runnable - * @instance - */ - Runnable.prototype.environment = null; - - /** - * Runnable timeout. - * @member {google.protobuf.IDuration|null|undefined} timeout - * @memberof google.cloud.batch.v1.Runnable - * @instance - */ - Runnable.prototype.timeout = null; - - /** - * Runnable labels. - * @member {Object.} labels - * @memberof google.cloud.batch.v1.Runnable - * @instance - */ - Runnable.prototype.labels = $util.emptyObject; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Runnable executable. - * @member {"container"|"script"|"barrier"|undefined} executable - * @memberof google.cloud.batch.v1.Runnable - * @instance - */ - Object.defineProperty(Runnable.prototype, "executable", { - get: $util.oneOfGetter($oneOfFields = ["container", "script", "barrier"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Runnable instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.Runnable - * @static - * @param {google.cloud.batch.v1.IRunnable=} [properties] Properties to set - * @returns {google.cloud.batch.v1.Runnable} Runnable instance - */ - Runnable.create = function create(properties) { - return new Runnable(properties); - }; - - /** - * Encodes the specified Runnable message. Does not implicitly {@link google.cloud.batch.v1.Runnable.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.Runnable - * @static - * @param {google.cloud.batch.v1.IRunnable} message Runnable message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Runnable.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.container != null && Object.hasOwnProperty.call(message, "container")) - $root.google.cloud.batch.v1.Runnable.Container.encode(message.container, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.script != null && Object.hasOwnProperty.call(message, "script")) - $root.google.cloud.batch.v1.Runnable.Script.encode(message.script, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.ignoreExitStatus != null && Object.hasOwnProperty.call(message, "ignoreExitStatus")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.ignoreExitStatus); - if (message.background != null && Object.hasOwnProperty.call(message, "background")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.background); - if (message.alwaysRun != null && Object.hasOwnProperty.call(message, "alwaysRun")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.alwaysRun); - if (message.barrier != null && Object.hasOwnProperty.call(message, "barrier")) - $root.google.cloud.batch.v1.Runnable.Barrier.encode(message.barrier, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) - $root.google.cloud.batch.v1.Environment.encode(message.environment, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) - $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - 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 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.displayName); - return writer; - }; - - /** - * Encodes the specified Runnable message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Runnable.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.Runnable - * @static - * @param {google.cloud.batch.v1.IRunnable} message Runnable message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Runnable.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Runnable message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.Runnable - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.Runnable} Runnable - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Runnable.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Runnable(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.container = $root.google.cloud.batch.v1.Runnable.Container.decode(reader, reader.uint32()); - break; - } - case 2: { - message.script = $root.google.cloud.batch.v1.Runnable.Script.decode(reader, reader.uint32()); - break; - } - case 6: { - message.barrier = $root.google.cloud.batch.v1.Runnable.Barrier.decode(reader, reader.uint32()); - break; - } - case 10: { - message.displayName = reader.string(); - break; - } - case 3: { - message.ignoreExitStatus = reader.bool(); - break; - } - case 4: { - message.background = reader.bool(); - break; - } - case 5: { - message.alwaysRun = reader.bool(); - break; - } - case 7: { - message.environment = $root.google.cloud.batch.v1.Environment.decode(reader, reader.uint32()); - break; - } - case 8: { - message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 9: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Runnable message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.Runnable - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.Runnable} Runnable - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Runnable.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Runnable message. - * @function verify - * @memberof google.cloud.batch.v1.Runnable - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Runnable.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.container != null && message.hasOwnProperty("container")) { - properties.executable = 1; - { - var error = $root.google.cloud.batch.v1.Runnable.Container.verify(message.container); - if (error) - return "container." + error; - } - } - if (message.script != null && message.hasOwnProperty("script")) { - if (properties.executable === 1) - return "executable: multiple values"; - properties.executable = 1; - { - var error = $root.google.cloud.batch.v1.Runnable.Script.verify(message.script); - if (error) - return "script." + error; - } - } - if (message.barrier != null && message.hasOwnProperty("barrier")) { - if (properties.executable === 1) - return "executable: multiple values"; - properties.executable = 1; - { - var error = $root.google.cloud.batch.v1.Runnable.Barrier.verify(message.barrier); - if (error) - return "barrier." + error; - } - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.ignoreExitStatus != null && message.hasOwnProperty("ignoreExitStatus")) - if (typeof message.ignoreExitStatus !== "boolean") - return "ignoreExitStatus: boolean expected"; - if (message.background != null && message.hasOwnProperty("background")) - if (typeof message.background !== "boolean") - return "background: boolean expected"; - if (message.alwaysRun != null && message.hasOwnProperty("alwaysRun")) - if (typeof message.alwaysRun !== "boolean") - return "alwaysRun: boolean expected"; - if (message.environment != null && message.hasOwnProperty("environment")) { - var error = $root.google.cloud.batch.v1.Environment.verify(message.environment); - if (error) - return "environment." + error; - } - if (message.timeout != null && message.hasOwnProperty("timeout")) { - var error = $root.google.protobuf.Duration.verify(message.timeout); - if (error) - return "timeout." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - return null; - }; - - /** - * Creates a Runnable message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.Runnable - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.Runnable} Runnable - */ - Runnable.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.Runnable) - return object; - var message = new $root.google.cloud.batch.v1.Runnable(); - if (object.container != null) { - if (typeof object.container !== "object") - throw TypeError(".google.cloud.batch.v1.Runnable.container: object expected"); - message.container = $root.google.cloud.batch.v1.Runnable.Container.fromObject(object.container); - } - if (object.script != null) { - if (typeof object.script !== "object") - throw TypeError(".google.cloud.batch.v1.Runnable.script: object expected"); - message.script = $root.google.cloud.batch.v1.Runnable.Script.fromObject(object.script); - } - if (object.barrier != null) { - if (typeof object.barrier !== "object") - throw TypeError(".google.cloud.batch.v1.Runnable.barrier: object expected"); - message.barrier = $root.google.cloud.batch.v1.Runnable.Barrier.fromObject(object.barrier); - } - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.ignoreExitStatus != null) - message.ignoreExitStatus = Boolean(object.ignoreExitStatus); - if (object.background != null) - message.background = Boolean(object.background); - if (object.alwaysRun != null) - message.alwaysRun = Boolean(object.alwaysRun); - if (object.environment != null) { - if (typeof object.environment !== "object") - throw TypeError(".google.cloud.batch.v1.Runnable.environment: object expected"); - message.environment = $root.google.cloud.batch.v1.Environment.fromObject(object.environment); - } - if (object.timeout != null) { - if (typeof object.timeout !== "object") - throw TypeError(".google.cloud.batch.v1.Runnable.timeout: object expected"); - message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.batch.v1.Runnable.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - return message; - }; - - /** - * Creates a plain object from a Runnable message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.Runnable - * @static - * @param {google.cloud.batch.v1.Runnable} message Runnable - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Runnable.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.ignoreExitStatus = false; - object.background = false; - object.alwaysRun = false; - object.environment = null; - object.timeout = null; - object.displayName = ""; - } - if (message.container != null && message.hasOwnProperty("container")) { - object.container = $root.google.cloud.batch.v1.Runnable.Container.toObject(message.container, options); - if (options.oneofs) - object.executable = "container"; - } - if (message.script != null && message.hasOwnProperty("script")) { - object.script = $root.google.cloud.batch.v1.Runnable.Script.toObject(message.script, options); - if (options.oneofs) - object.executable = "script"; - } - if (message.ignoreExitStatus != null && message.hasOwnProperty("ignoreExitStatus")) - object.ignoreExitStatus = message.ignoreExitStatus; - if (message.background != null && message.hasOwnProperty("background")) - object.background = message.background; - if (message.alwaysRun != null && message.hasOwnProperty("alwaysRun")) - object.alwaysRun = message.alwaysRun; - if (message.barrier != null && message.hasOwnProperty("barrier")) { - object.barrier = $root.google.cloud.batch.v1.Runnable.Barrier.toObject(message.barrier, options); - if (options.oneofs) - object.executable = "barrier"; - } - if (message.environment != null && message.hasOwnProperty("environment")) - object.environment = $root.google.cloud.batch.v1.Environment.toObject(message.environment, options); - if (message.timeout != null && message.hasOwnProperty("timeout")) - object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - return object; - }; - - /** - * Converts this Runnable to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.Runnable - * @instance - * @returns {Object.} JSON object - */ - Runnable.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Runnable - * @function getTypeUrl - * @memberof google.cloud.batch.v1.Runnable - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Runnable.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.Runnable"; - }; - - Runnable.Container = (function() { - - /** - * Properties of a Container. - * @memberof google.cloud.batch.v1.Runnable - * @interface IContainer - * @property {string|null} [imageUri] Container imageUri - * @property {Array.|null} [commands] Container commands - * @property {string|null} [entrypoint] Container entrypoint - * @property {Array.|null} [volumes] Container volumes - * @property {string|null} [options] Container options - * @property {boolean|null} [blockExternalNetwork] Container blockExternalNetwork - * @property {string|null} [username] Container username - * @property {string|null} [password] Container password - * @property {boolean|null} [enableImageStreaming] Container enableImageStreaming - */ - - /** - * Constructs a new Container. - * @memberof google.cloud.batch.v1.Runnable - * @classdesc Represents a Container. - * @implements IContainer - * @constructor - * @param {google.cloud.batch.v1.Runnable.IContainer=} [properties] Properties to set - */ - function Container(properties) { - this.commands = []; - this.volumes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Container imageUri. - * @member {string} imageUri - * @memberof google.cloud.batch.v1.Runnable.Container - * @instance - */ - Container.prototype.imageUri = ""; - - /** - * Container commands. - * @member {Array.} commands - * @memberof google.cloud.batch.v1.Runnable.Container - * @instance - */ - Container.prototype.commands = $util.emptyArray; - - /** - * Container entrypoint. - * @member {string} entrypoint - * @memberof google.cloud.batch.v1.Runnable.Container - * @instance - */ - Container.prototype.entrypoint = ""; - - /** - * Container volumes. - * @member {Array.} volumes - * @memberof google.cloud.batch.v1.Runnable.Container - * @instance - */ - Container.prototype.volumes = $util.emptyArray; - - /** - * Container options. - * @member {string} options - * @memberof google.cloud.batch.v1.Runnable.Container - * @instance - */ - Container.prototype.options = ""; - - /** - * Container blockExternalNetwork. - * @member {boolean} blockExternalNetwork - * @memberof google.cloud.batch.v1.Runnable.Container - * @instance - */ - Container.prototype.blockExternalNetwork = false; - - /** - * Container username. - * @member {string} username - * @memberof google.cloud.batch.v1.Runnable.Container - * @instance - */ - Container.prototype.username = ""; - - /** - * Container password. - * @member {string} password - * @memberof google.cloud.batch.v1.Runnable.Container - * @instance - */ - Container.prototype.password = ""; - - /** - * Container enableImageStreaming. - * @member {boolean} enableImageStreaming - * @memberof google.cloud.batch.v1.Runnable.Container - * @instance - */ - Container.prototype.enableImageStreaming = false; - - /** - * Creates a new Container instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.Runnable.Container - * @static - * @param {google.cloud.batch.v1.Runnable.IContainer=} [properties] Properties to set - * @returns {google.cloud.batch.v1.Runnable.Container} Container instance - */ - Container.create = function create(properties) { - return new Container(properties); - }; - - /** - * Encodes the specified Container message. Does not implicitly {@link google.cloud.batch.v1.Runnable.Container.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.Runnable.Container - * @static - * @param {google.cloud.batch.v1.Runnable.IContainer} message Container message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Container.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.imageUri != null && Object.hasOwnProperty.call(message, "imageUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.imageUri); - if (message.commands != null && message.commands.length) - for (var i = 0; i < message.commands.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.commands[i]); - if (message.entrypoint != null && Object.hasOwnProperty.call(message, "entrypoint")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.entrypoint); - if (message.volumes != null && message.volumes.length) - for (var i = 0; i < message.volumes.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.volumes[i]); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.options); - if (message.blockExternalNetwork != null && Object.hasOwnProperty.call(message, "blockExternalNetwork")) - writer.uint32(/* id 9, wireType 0 =*/72).bool(message.blockExternalNetwork); - if (message.username != null && Object.hasOwnProperty.call(message, "username")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.username); - if (message.password != null && Object.hasOwnProperty.call(message, "password")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.password); - if (message.enableImageStreaming != null && Object.hasOwnProperty.call(message, "enableImageStreaming")) - writer.uint32(/* id 12, wireType 0 =*/96).bool(message.enableImageStreaming); - return writer; - }; - - /** - * Encodes the specified Container message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Runnable.Container.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.Runnable.Container - * @static - * @param {google.cloud.batch.v1.Runnable.IContainer} message Container message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Container.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Container message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.Runnable.Container - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.Runnable.Container} Container - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Container.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Runnable.Container(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.imageUri = reader.string(); - break; - } - case 2: { - if (!(message.commands && message.commands.length)) - message.commands = []; - message.commands.push(reader.string()); - break; - } - case 3: { - message.entrypoint = reader.string(); - break; - } - case 7: { - if (!(message.volumes && message.volumes.length)) - message.volumes = []; - message.volumes.push(reader.string()); - break; - } - case 8: { - message.options = reader.string(); - break; - } - case 9: { - message.blockExternalNetwork = reader.bool(); - break; - } - case 10: { - message.username = reader.string(); - break; - } - case 11: { - message.password = reader.string(); - break; - } - case 12: { - message.enableImageStreaming = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Container message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.Runnable.Container - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.Runnable.Container} Container - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Container.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Container message. - * @function verify - * @memberof google.cloud.batch.v1.Runnable.Container - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Container.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.imageUri != null && message.hasOwnProperty("imageUri")) - if (!$util.isString(message.imageUri)) - return "imageUri: string expected"; - if (message.commands != null && message.hasOwnProperty("commands")) { - if (!Array.isArray(message.commands)) - return "commands: array expected"; - for (var i = 0; i < message.commands.length; ++i) - if (!$util.isString(message.commands[i])) - return "commands: string[] expected"; - } - if (message.entrypoint != null && message.hasOwnProperty("entrypoint")) - if (!$util.isString(message.entrypoint)) - return "entrypoint: string expected"; - if (message.volumes != null && message.hasOwnProperty("volumes")) { - if (!Array.isArray(message.volumes)) - return "volumes: array expected"; - for (var i = 0; i < message.volumes.length; ++i) - if (!$util.isString(message.volumes[i])) - return "volumes: string[] expected"; - } - if (message.options != null && message.hasOwnProperty("options")) - if (!$util.isString(message.options)) - return "options: string expected"; - if (message.blockExternalNetwork != null && message.hasOwnProperty("blockExternalNetwork")) - if (typeof message.blockExternalNetwork !== "boolean") - return "blockExternalNetwork: boolean expected"; - if (message.username != null && message.hasOwnProperty("username")) - if (!$util.isString(message.username)) - return "username: string expected"; - if (message.password != null && message.hasOwnProperty("password")) - if (!$util.isString(message.password)) - return "password: string expected"; - if (message.enableImageStreaming != null && message.hasOwnProperty("enableImageStreaming")) - if (typeof message.enableImageStreaming !== "boolean") - return "enableImageStreaming: boolean expected"; - return null; - }; - - /** - * Creates a Container message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.Runnable.Container - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.Runnable.Container} Container - */ - Container.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.Runnable.Container) - return object; - var message = new $root.google.cloud.batch.v1.Runnable.Container(); - if (object.imageUri != null) - message.imageUri = String(object.imageUri); - if (object.commands) { - if (!Array.isArray(object.commands)) - throw TypeError(".google.cloud.batch.v1.Runnable.Container.commands: array expected"); - message.commands = []; - for (var i = 0; i < object.commands.length; ++i) - message.commands[i] = String(object.commands[i]); - } - if (object.entrypoint != null) - message.entrypoint = String(object.entrypoint); - if (object.volumes) { - if (!Array.isArray(object.volumes)) - throw TypeError(".google.cloud.batch.v1.Runnable.Container.volumes: array expected"); - message.volumes = []; - for (var i = 0; i < object.volumes.length; ++i) - message.volumes[i] = String(object.volumes[i]); - } - if (object.options != null) - message.options = String(object.options); - if (object.blockExternalNetwork != null) - message.blockExternalNetwork = Boolean(object.blockExternalNetwork); - if (object.username != null) - message.username = String(object.username); - if (object.password != null) - message.password = String(object.password); - if (object.enableImageStreaming != null) - message.enableImageStreaming = Boolean(object.enableImageStreaming); - return message; - }; - - /** - * Creates a plain object from a Container message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.Runnable.Container - * @static - * @param {google.cloud.batch.v1.Runnable.Container} message Container - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Container.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.commands = []; - object.volumes = []; - } - if (options.defaults) { - object.imageUri = ""; - object.entrypoint = ""; - object.options = ""; - object.blockExternalNetwork = false; - object.username = ""; - object.password = ""; - object.enableImageStreaming = false; - } - if (message.imageUri != null && message.hasOwnProperty("imageUri")) - object.imageUri = message.imageUri; - if (message.commands && message.commands.length) { - object.commands = []; - for (var j = 0; j < message.commands.length; ++j) - object.commands[j] = message.commands[j]; - } - if (message.entrypoint != null && message.hasOwnProperty("entrypoint")) - object.entrypoint = message.entrypoint; - if (message.volumes && message.volumes.length) { - object.volumes = []; - for (var j = 0; j < message.volumes.length; ++j) - object.volumes[j] = message.volumes[j]; - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = message.options; - if (message.blockExternalNetwork != null && message.hasOwnProperty("blockExternalNetwork")) - object.blockExternalNetwork = message.blockExternalNetwork; - if (message.username != null && message.hasOwnProperty("username")) - object.username = message.username; - if (message.password != null && message.hasOwnProperty("password")) - object.password = message.password; - if (message.enableImageStreaming != null && message.hasOwnProperty("enableImageStreaming")) - object.enableImageStreaming = message.enableImageStreaming; - return object; - }; - - /** - * Converts this Container to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.Runnable.Container - * @instance - * @returns {Object.} JSON object - */ - Container.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Container - * @function getTypeUrl - * @memberof google.cloud.batch.v1.Runnable.Container - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Container.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.Runnable.Container"; - }; - - return Container; - })(); - - Runnable.Script = (function() { - - /** - * Properties of a Script. - * @memberof google.cloud.batch.v1.Runnable - * @interface IScript - * @property {string|null} [path] Script path - * @property {string|null} [text] Script text - */ - - /** - * Constructs a new Script. - * @memberof google.cloud.batch.v1.Runnable - * @classdesc Represents a Script. - * @implements IScript - * @constructor - * @param {google.cloud.batch.v1.Runnable.IScript=} [properties] Properties to set - */ - function Script(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Script path. - * @member {string|null|undefined} path - * @memberof google.cloud.batch.v1.Runnable.Script - * @instance - */ - Script.prototype.path = null; - - /** - * Script text. - * @member {string|null|undefined} text - * @memberof google.cloud.batch.v1.Runnable.Script - * @instance - */ - Script.prototype.text = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Script command. - * @member {"path"|"text"|undefined} command - * @memberof google.cloud.batch.v1.Runnable.Script - * @instance - */ - Object.defineProperty(Script.prototype, "command", { - get: $util.oneOfGetter($oneOfFields = ["path", "text"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Script instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.Runnable.Script - * @static - * @param {google.cloud.batch.v1.Runnable.IScript=} [properties] Properties to set - * @returns {google.cloud.batch.v1.Runnable.Script} Script instance - */ - Script.create = function create(properties) { - return new Script(properties); - }; - - /** - * Encodes the specified Script message. Does not implicitly {@link google.cloud.batch.v1.Runnable.Script.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.Runnable.Script - * @static - * @param {google.cloud.batch.v1.Runnable.IScript} message Script message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Script.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.path); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.text); - return writer; - }; - - /** - * Encodes the specified Script message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Runnable.Script.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.Runnable.Script - * @static - * @param {google.cloud.batch.v1.Runnable.IScript} message Script message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Script.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Script message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.Runnable.Script - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.Runnable.Script} Script - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Script.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Runnable.Script(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.path = reader.string(); - break; - } - case 2: { - message.text = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Script message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.Runnable.Script - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.Runnable.Script} Script - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Script.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Script message. - * @function verify - * @memberof google.cloud.batch.v1.Runnable.Script - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Script.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.path != null && message.hasOwnProperty("path")) { - properties.command = 1; - if (!$util.isString(message.path)) - return "path: string expected"; - } - if (message.text != null && message.hasOwnProperty("text")) { - if (properties.command === 1) - return "command: multiple values"; - properties.command = 1; - if (!$util.isString(message.text)) - return "text: string expected"; - } - return null; - }; - - /** - * Creates a Script message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.Runnable.Script - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.Runnable.Script} Script - */ - Script.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.Runnable.Script) - return object; - var message = new $root.google.cloud.batch.v1.Runnable.Script(); - if (object.path != null) - message.path = String(object.path); - if (object.text != null) - message.text = String(object.text); - return message; - }; - - /** - * Creates a plain object from a Script message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.Runnable.Script - * @static - * @param {google.cloud.batch.v1.Runnable.Script} message Script - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Script.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.path != null && message.hasOwnProperty("path")) { - object.path = message.path; - if (options.oneofs) - object.command = "path"; - } - if (message.text != null && message.hasOwnProperty("text")) { - object.text = message.text; - if (options.oneofs) - object.command = "text"; - } - return object; - }; - - /** - * Converts this Script to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.Runnable.Script - * @instance - * @returns {Object.} JSON object - */ - Script.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Script - * @function getTypeUrl - * @memberof google.cloud.batch.v1.Runnable.Script - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Script.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.Runnable.Script"; - }; - - return Script; - })(); - - Runnable.Barrier = (function() { - - /** - * Properties of a Barrier. - * @memberof google.cloud.batch.v1.Runnable - * @interface IBarrier - * @property {string|null} [name] Barrier name - */ - - /** - * Constructs a new Barrier. - * @memberof google.cloud.batch.v1.Runnable - * @classdesc Represents a Barrier. - * @implements IBarrier - * @constructor - * @param {google.cloud.batch.v1.Runnable.IBarrier=} [properties] Properties to set - */ - function Barrier(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Barrier name. - * @member {string} name - * @memberof google.cloud.batch.v1.Runnable.Barrier - * @instance - */ - Barrier.prototype.name = ""; - - /** - * Creates a new Barrier instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.Runnable.Barrier - * @static - * @param {google.cloud.batch.v1.Runnable.IBarrier=} [properties] Properties to set - * @returns {google.cloud.batch.v1.Runnable.Barrier} Barrier instance - */ - Barrier.create = function create(properties) { - return new Barrier(properties); - }; - - /** - * Encodes the specified Barrier message. Does not implicitly {@link google.cloud.batch.v1.Runnable.Barrier.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.Runnable.Barrier - * @static - * @param {google.cloud.batch.v1.Runnable.IBarrier} message Barrier message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Barrier.encode = function encode(message, writer) { - 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 Barrier message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Runnable.Barrier.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.Runnable.Barrier - * @static - * @param {google.cloud.batch.v1.Runnable.IBarrier} message Barrier message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Barrier.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Barrier message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.Runnable.Barrier - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.Runnable.Barrier} Barrier - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Barrier.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Runnable.Barrier(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Barrier message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.Runnable.Barrier - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.Runnable.Barrier} Barrier - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Barrier.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Barrier message. - * @function verify - * @memberof google.cloud.batch.v1.Runnable.Barrier - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Barrier.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a Barrier message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.Runnable.Barrier - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.Runnable.Barrier} Barrier - */ - Barrier.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.Runnable.Barrier) - return object; - var message = new $root.google.cloud.batch.v1.Runnable.Barrier(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a Barrier message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.Runnable.Barrier - * @static - * @param {google.cloud.batch.v1.Runnable.Barrier} message Barrier - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Barrier.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 Barrier to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.Runnable.Barrier - * @instance - * @returns {Object.} JSON object - */ - Barrier.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Barrier - * @function getTypeUrl - * @memberof google.cloud.batch.v1.Runnable.Barrier - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Barrier.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.Runnable.Barrier"; - }; - - return Barrier; - })(); - - return Runnable; - })(); - - v1.TaskSpec = (function() { - - /** - * Properties of a TaskSpec. - * @memberof google.cloud.batch.v1 - * @interface ITaskSpec - * @property {Array.|null} [runnables] TaskSpec runnables - * @property {google.cloud.batch.v1.IComputeResource|null} [computeResource] TaskSpec computeResource - * @property {google.protobuf.IDuration|null} [maxRunDuration] TaskSpec maxRunDuration - * @property {number|null} [maxRetryCount] TaskSpec maxRetryCount - * @property {Array.|null} [lifecyclePolicies] TaskSpec lifecyclePolicies - * @property {Object.|null} [environments] TaskSpec environments - * @property {Array.|null} [volumes] TaskSpec volumes - * @property {google.cloud.batch.v1.IEnvironment|null} [environment] TaskSpec environment - */ - - /** - * Constructs a new TaskSpec. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a TaskSpec. - * @implements ITaskSpec - * @constructor - * @param {google.cloud.batch.v1.ITaskSpec=} [properties] Properties to set - */ - function TaskSpec(properties) { - this.runnables = []; - this.lifecyclePolicies = []; - this.environments = {}; - this.volumes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TaskSpec runnables. - * @member {Array.} runnables - * @memberof google.cloud.batch.v1.TaskSpec - * @instance - */ - TaskSpec.prototype.runnables = $util.emptyArray; - - /** - * TaskSpec computeResource. - * @member {google.cloud.batch.v1.IComputeResource|null|undefined} computeResource - * @memberof google.cloud.batch.v1.TaskSpec - * @instance - */ - TaskSpec.prototype.computeResource = null; - - /** - * TaskSpec maxRunDuration. - * @member {google.protobuf.IDuration|null|undefined} maxRunDuration - * @memberof google.cloud.batch.v1.TaskSpec - * @instance - */ - TaskSpec.prototype.maxRunDuration = null; - - /** - * TaskSpec maxRetryCount. - * @member {number} maxRetryCount - * @memberof google.cloud.batch.v1.TaskSpec - * @instance - */ - TaskSpec.prototype.maxRetryCount = 0; - - /** - * TaskSpec lifecyclePolicies. - * @member {Array.} lifecyclePolicies - * @memberof google.cloud.batch.v1.TaskSpec - * @instance - */ - TaskSpec.prototype.lifecyclePolicies = $util.emptyArray; - - /** - * TaskSpec environments. - * @member {Object.} environments - * @memberof google.cloud.batch.v1.TaskSpec - * @instance - */ - TaskSpec.prototype.environments = $util.emptyObject; - - /** - * TaskSpec volumes. - * @member {Array.} volumes - * @memberof google.cloud.batch.v1.TaskSpec - * @instance - */ - TaskSpec.prototype.volumes = $util.emptyArray; - - /** - * TaskSpec environment. - * @member {google.cloud.batch.v1.IEnvironment|null|undefined} environment - * @memberof google.cloud.batch.v1.TaskSpec - * @instance - */ - TaskSpec.prototype.environment = null; - - /** - * Creates a new TaskSpec instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.TaskSpec - * @static - * @param {google.cloud.batch.v1.ITaskSpec=} [properties] Properties to set - * @returns {google.cloud.batch.v1.TaskSpec} TaskSpec instance - */ - TaskSpec.create = function create(properties) { - return new TaskSpec(properties); - }; - - /** - * Encodes the specified TaskSpec message. Does not implicitly {@link google.cloud.batch.v1.TaskSpec.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.TaskSpec - * @static - * @param {google.cloud.batch.v1.ITaskSpec} message TaskSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.computeResource != null && Object.hasOwnProperty.call(message, "computeResource")) - $root.google.cloud.batch.v1.ComputeResource.encode(message.computeResource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.maxRunDuration != null && Object.hasOwnProperty.call(message, "maxRunDuration")) - $root.google.protobuf.Duration.encode(message.maxRunDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.maxRetryCount != null && Object.hasOwnProperty.call(message, "maxRetryCount")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxRetryCount); - if (message.environments != null && Object.hasOwnProperty.call(message, "environments")) - for (var keys = Object.keys(message.environments), i = 0; i < keys.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.environments[keys[i]]).ldelim(); - if (message.volumes != null && message.volumes.length) - for (var i = 0; i < message.volumes.length; ++i) - $root.google.cloud.batch.v1.Volume.encode(message.volumes[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.runnables != null && message.runnables.length) - for (var i = 0; i < message.runnables.length; ++i) - $root.google.cloud.batch.v1.Runnable.encode(message.runnables[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.lifecyclePolicies != null && message.lifecyclePolicies.length) - for (var i = 0; i < message.lifecyclePolicies.length; ++i) - $root.google.cloud.batch.v1.LifecyclePolicy.encode(message.lifecyclePolicies[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) - $root.google.cloud.batch.v1.Environment.encode(message.environment, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TaskSpec message, length delimited. Does not implicitly {@link google.cloud.batch.v1.TaskSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.TaskSpec - * @static - * @param {google.cloud.batch.v1.ITaskSpec} message TaskSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TaskSpec message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.TaskSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.TaskSpec} TaskSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskSpec.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.TaskSpec(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 8: { - if (!(message.runnables && message.runnables.length)) - message.runnables = []; - message.runnables.push($root.google.cloud.batch.v1.Runnable.decode(reader, reader.uint32())); - break; - } - case 3: { - message.computeResource = $root.google.cloud.batch.v1.ComputeResource.decode(reader, reader.uint32()); - break; - } - case 4: { - message.maxRunDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 5: { - message.maxRetryCount = reader.int32(); - break; - } - case 9: { - if (!(message.lifecyclePolicies && message.lifecyclePolicies.length)) - message.lifecyclePolicies = []; - message.lifecyclePolicies.push($root.google.cloud.batch.v1.LifecyclePolicy.decode(reader, reader.uint32())); - break; - } - case 6: { - if (message.environments === $util.emptyObject) - message.environments = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.environments[key] = value; - break; - } - case 7: { - if (!(message.volumes && message.volumes.length)) - message.volumes = []; - message.volumes.push($root.google.cloud.batch.v1.Volume.decode(reader, reader.uint32())); - break; - } - case 10: { - message.environment = $root.google.cloud.batch.v1.Environment.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TaskSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.TaskSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.TaskSpec} TaskSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TaskSpec message. - * @function verify - * @memberof google.cloud.batch.v1.TaskSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TaskSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.runnables != null && message.hasOwnProperty("runnables")) { - if (!Array.isArray(message.runnables)) - return "runnables: array expected"; - for (var i = 0; i < message.runnables.length; ++i) { - var error = $root.google.cloud.batch.v1.Runnable.verify(message.runnables[i]); - if (error) - return "runnables." + error; - } - } - if (message.computeResource != null && message.hasOwnProperty("computeResource")) { - var error = $root.google.cloud.batch.v1.ComputeResource.verify(message.computeResource); - if (error) - return "computeResource." + error; - } - if (message.maxRunDuration != null && message.hasOwnProperty("maxRunDuration")) { - var error = $root.google.protobuf.Duration.verify(message.maxRunDuration); - if (error) - return "maxRunDuration." + error; - } - if (message.maxRetryCount != null && message.hasOwnProperty("maxRetryCount")) - if (!$util.isInteger(message.maxRetryCount)) - return "maxRetryCount: integer expected"; - if (message.lifecyclePolicies != null && message.hasOwnProperty("lifecyclePolicies")) { - if (!Array.isArray(message.lifecyclePolicies)) - return "lifecyclePolicies: array expected"; - for (var i = 0; i < message.lifecyclePolicies.length; ++i) { - var error = $root.google.cloud.batch.v1.LifecyclePolicy.verify(message.lifecyclePolicies[i]); - if (error) - return "lifecyclePolicies." + error; - } - } - if (message.environments != null && message.hasOwnProperty("environments")) { - if (!$util.isObject(message.environments)) - return "environments: object expected"; - var key = Object.keys(message.environments); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.environments[key[i]])) - return "environments: string{k:string} expected"; - } - if (message.volumes != null && message.hasOwnProperty("volumes")) { - if (!Array.isArray(message.volumes)) - return "volumes: array expected"; - for (var i = 0; i < message.volumes.length; ++i) { - var error = $root.google.cloud.batch.v1.Volume.verify(message.volumes[i]); - if (error) - return "volumes." + error; - } - } - if (message.environment != null && message.hasOwnProperty("environment")) { - var error = $root.google.cloud.batch.v1.Environment.verify(message.environment); - if (error) - return "environment." + error; - } - return null; - }; - - /** - * Creates a TaskSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.TaskSpec - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.TaskSpec} TaskSpec - */ - TaskSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.TaskSpec) - return object; - var message = new $root.google.cloud.batch.v1.TaskSpec(); - if (object.runnables) { - if (!Array.isArray(object.runnables)) - throw TypeError(".google.cloud.batch.v1.TaskSpec.runnables: array expected"); - message.runnables = []; - for (var i = 0; i < object.runnables.length; ++i) { - if (typeof object.runnables[i] !== "object") - throw TypeError(".google.cloud.batch.v1.TaskSpec.runnables: object expected"); - message.runnables[i] = $root.google.cloud.batch.v1.Runnable.fromObject(object.runnables[i]); - } - } - if (object.computeResource != null) { - if (typeof object.computeResource !== "object") - throw TypeError(".google.cloud.batch.v1.TaskSpec.computeResource: object expected"); - message.computeResource = $root.google.cloud.batch.v1.ComputeResource.fromObject(object.computeResource); - } - if (object.maxRunDuration != null) { - if (typeof object.maxRunDuration !== "object") - throw TypeError(".google.cloud.batch.v1.TaskSpec.maxRunDuration: object expected"); - message.maxRunDuration = $root.google.protobuf.Duration.fromObject(object.maxRunDuration); - } - if (object.maxRetryCount != null) - message.maxRetryCount = object.maxRetryCount | 0; - if (object.lifecyclePolicies) { - if (!Array.isArray(object.lifecyclePolicies)) - throw TypeError(".google.cloud.batch.v1.TaskSpec.lifecyclePolicies: array expected"); - message.lifecyclePolicies = []; - for (var i = 0; i < object.lifecyclePolicies.length; ++i) { - if (typeof object.lifecyclePolicies[i] !== "object") - throw TypeError(".google.cloud.batch.v1.TaskSpec.lifecyclePolicies: object expected"); - message.lifecyclePolicies[i] = $root.google.cloud.batch.v1.LifecyclePolicy.fromObject(object.lifecyclePolicies[i]); - } - } - if (object.environments) { - if (typeof object.environments !== "object") - throw TypeError(".google.cloud.batch.v1.TaskSpec.environments: object expected"); - message.environments = {}; - for (var keys = Object.keys(object.environments), i = 0; i < keys.length; ++i) - message.environments[keys[i]] = String(object.environments[keys[i]]); - } - if (object.volumes) { - if (!Array.isArray(object.volumes)) - throw TypeError(".google.cloud.batch.v1.TaskSpec.volumes: array expected"); - message.volumes = []; - for (var i = 0; i < object.volumes.length; ++i) { - if (typeof object.volumes[i] !== "object") - throw TypeError(".google.cloud.batch.v1.TaskSpec.volumes: object expected"); - message.volumes[i] = $root.google.cloud.batch.v1.Volume.fromObject(object.volumes[i]); - } - } - if (object.environment != null) { - if (typeof object.environment !== "object") - throw TypeError(".google.cloud.batch.v1.TaskSpec.environment: object expected"); - message.environment = $root.google.cloud.batch.v1.Environment.fromObject(object.environment); - } - return message; - }; - - /** - * Creates a plain object from a TaskSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.TaskSpec - * @static - * @param {google.cloud.batch.v1.TaskSpec} message TaskSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TaskSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.volumes = []; - object.runnables = []; - object.lifecyclePolicies = []; - } - if (options.objects || options.defaults) - object.environments = {}; - if (options.defaults) { - object.computeResource = null; - object.maxRunDuration = null; - object.maxRetryCount = 0; - object.environment = null; - } - if (message.computeResource != null && message.hasOwnProperty("computeResource")) - object.computeResource = $root.google.cloud.batch.v1.ComputeResource.toObject(message.computeResource, options); - if (message.maxRunDuration != null && message.hasOwnProperty("maxRunDuration")) - object.maxRunDuration = $root.google.protobuf.Duration.toObject(message.maxRunDuration, options); - if (message.maxRetryCount != null && message.hasOwnProperty("maxRetryCount")) - object.maxRetryCount = message.maxRetryCount; - var keys2; - if (message.environments && (keys2 = Object.keys(message.environments)).length) { - object.environments = {}; - for (var j = 0; j < keys2.length; ++j) - object.environments[keys2[j]] = message.environments[keys2[j]]; - } - if (message.volumes && message.volumes.length) { - object.volumes = []; - for (var j = 0; j < message.volumes.length; ++j) - object.volumes[j] = $root.google.cloud.batch.v1.Volume.toObject(message.volumes[j], options); - } - if (message.runnables && message.runnables.length) { - object.runnables = []; - for (var j = 0; j < message.runnables.length; ++j) - object.runnables[j] = $root.google.cloud.batch.v1.Runnable.toObject(message.runnables[j], options); - } - if (message.lifecyclePolicies && message.lifecyclePolicies.length) { - object.lifecyclePolicies = []; - for (var j = 0; j < message.lifecyclePolicies.length; ++j) - object.lifecyclePolicies[j] = $root.google.cloud.batch.v1.LifecyclePolicy.toObject(message.lifecyclePolicies[j], options); - } - if (message.environment != null && message.hasOwnProperty("environment")) - object.environment = $root.google.cloud.batch.v1.Environment.toObject(message.environment, options); - return object; - }; - - /** - * Converts this TaskSpec to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.TaskSpec - * @instance - * @returns {Object.} JSON object - */ - TaskSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TaskSpec - * @function getTypeUrl - * @memberof google.cloud.batch.v1.TaskSpec - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TaskSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.TaskSpec"; - }; - - return TaskSpec; - })(); - - v1.LifecyclePolicy = (function() { - - /** - * Properties of a LifecyclePolicy. - * @memberof google.cloud.batch.v1 - * @interface ILifecyclePolicy - * @property {google.cloud.batch.v1.LifecyclePolicy.Action|null} [action] LifecyclePolicy action - * @property {google.cloud.batch.v1.LifecyclePolicy.IActionCondition|null} [actionCondition] LifecyclePolicy actionCondition - */ - - /** - * Constructs a new LifecyclePolicy. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a LifecyclePolicy. - * @implements ILifecyclePolicy - * @constructor - * @param {google.cloud.batch.v1.ILifecyclePolicy=} [properties] Properties to set - */ - function LifecyclePolicy(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LifecyclePolicy action. - * @member {google.cloud.batch.v1.LifecyclePolicy.Action} action - * @memberof google.cloud.batch.v1.LifecyclePolicy - * @instance - */ - LifecyclePolicy.prototype.action = 0; - - /** - * LifecyclePolicy actionCondition. - * @member {google.cloud.batch.v1.LifecyclePolicy.IActionCondition|null|undefined} actionCondition - * @memberof google.cloud.batch.v1.LifecyclePolicy - * @instance - */ - LifecyclePolicy.prototype.actionCondition = null; - - /** - * Creates a new LifecyclePolicy instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.LifecyclePolicy - * @static - * @param {google.cloud.batch.v1.ILifecyclePolicy=} [properties] Properties to set - * @returns {google.cloud.batch.v1.LifecyclePolicy} LifecyclePolicy instance - */ - LifecyclePolicy.create = function create(properties) { - return new LifecyclePolicy(properties); - }; - - /** - * Encodes the specified LifecyclePolicy message. Does not implicitly {@link google.cloud.batch.v1.LifecyclePolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.LifecyclePolicy - * @static - * @param {google.cloud.batch.v1.ILifecyclePolicy} message LifecyclePolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LifecyclePolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); - if (message.actionCondition != null && Object.hasOwnProperty.call(message, "actionCondition")) - $root.google.cloud.batch.v1.LifecyclePolicy.ActionCondition.encode(message.actionCondition, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LifecyclePolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.LifecyclePolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.LifecyclePolicy - * @static - * @param {google.cloud.batch.v1.ILifecyclePolicy} message LifecyclePolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LifecyclePolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LifecyclePolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.LifecyclePolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.LifecyclePolicy} LifecyclePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LifecyclePolicy.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.LifecyclePolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.action = reader.int32(); - break; - } - case 2: { - message.actionCondition = $root.google.cloud.batch.v1.LifecyclePolicy.ActionCondition.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LifecyclePolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.LifecyclePolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.LifecyclePolicy} LifecyclePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LifecyclePolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LifecyclePolicy message. - * @function verify - * @memberof google.cloud.batch.v1.LifecyclePolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LifecyclePolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.action != null && message.hasOwnProperty("action")) - switch (message.action) { - default: - return "action: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.actionCondition != null && message.hasOwnProperty("actionCondition")) { - var error = $root.google.cloud.batch.v1.LifecyclePolicy.ActionCondition.verify(message.actionCondition); - if (error) - return "actionCondition." + error; - } - return null; - }; - - /** - * Creates a LifecyclePolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.LifecyclePolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.LifecyclePolicy} LifecyclePolicy - */ - LifecyclePolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.LifecyclePolicy) - return object; - var message = new $root.google.cloud.batch.v1.LifecyclePolicy(); - switch (object.action) { - default: - if (typeof object.action === "number") { - message.action = object.action; - break; - } - break; - case "ACTION_UNSPECIFIED": - case 0: - message.action = 0; - break; - case "RETRY_TASK": - case 1: - message.action = 1; - break; - case "FAIL_TASK": - case 2: - message.action = 2; - break; - } - if (object.actionCondition != null) { - if (typeof object.actionCondition !== "object") - throw TypeError(".google.cloud.batch.v1.LifecyclePolicy.actionCondition: object expected"); - message.actionCondition = $root.google.cloud.batch.v1.LifecyclePolicy.ActionCondition.fromObject(object.actionCondition); - } - return message; - }; - - /** - * Creates a plain object from a LifecyclePolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.LifecyclePolicy - * @static - * @param {google.cloud.batch.v1.LifecyclePolicy} message LifecyclePolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LifecyclePolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; - object.actionCondition = null; - } - if (message.action != null && message.hasOwnProperty("action")) - object.action = options.enums === String ? $root.google.cloud.batch.v1.LifecyclePolicy.Action[message.action] === undefined ? message.action : $root.google.cloud.batch.v1.LifecyclePolicy.Action[message.action] : message.action; - if (message.actionCondition != null && message.hasOwnProperty("actionCondition")) - object.actionCondition = $root.google.cloud.batch.v1.LifecyclePolicy.ActionCondition.toObject(message.actionCondition, options); - return object; - }; - - /** - * Converts this LifecyclePolicy to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.LifecyclePolicy - * @instance - * @returns {Object.} JSON object - */ - LifecyclePolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LifecyclePolicy - * @function getTypeUrl - * @memberof google.cloud.batch.v1.LifecyclePolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LifecyclePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.LifecyclePolicy"; - }; - - LifecyclePolicy.ActionCondition = (function() { - - /** - * Properties of an ActionCondition. - * @memberof google.cloud.batch.v1.LifecyclePolicy - * @interface IActionCondition - * @property {Array.|null} [exitCodes] ActionCondition exitCodes - */ - - /** - * Constructs a new ActionCondition. - * @memberof google.cloud.batch.v1.LifecyclePolicy - * @classdesc Represents an ActionCondition. - * @implements IActionCondition - * @constructor - * @param {google.cloud.batch.v1.LifecyclePolicy.IActionCondition=} [properties] Properties to set - */ - function ActionCondition(properties) { - this.exitCodes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ActionCondition exitCodes. - * @member {Array.} exitCodes - * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition - * @instance - */ - ActionCondition.prototype.exitCodes = $util.emptyArray; - - /** - * Creates a new ActionCondition instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition - * @static - * @param {google.cloud.batch.v1.LifecyclePolicy.IActionCondition=} [properties] Properties to set - * @returns {google.cloud.batch.v1.LifecyclePolicy.ActionCondition} ActionCondition instance - */ - ActionCondition.create = function create(properties) { - return new ActionCondition(properties); - }; - - /** - * Encodes the specified ActionCondition message. Does not implicitly {@link google.cloud.batch.v1.LifecyclePolicy.ActionCondition.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition - * @static - * @param {google.cloud.batch.v1.LifecyclePolicy.IActionCondition} message ActionCondition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ActionCondition.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.exitCodes != null && message.exitCodes.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.exitCodes.length; ++i) - writer.int32(message.exitCodes[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified ActionCondition message, length delimited. Does not implicitly {@link google.cloud.batch.v1.LifecyclePolicy.ActionCondition.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition - * @static - * @param {google.cloud.batch.v1.LifecyclePolicy.IActionCondition} message ActionCondition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ActionCondition.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ActionCondition message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.LifecyclePolicy.ActionCondition} ActionCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ActionCondition.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.LifecyclePolicy.ActionCondition(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.exitCodes && message.exitCodes.length)) - message.exitCodes = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.exitCodes.push(reader.int32()); - } else - message.exitCodes.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ActionCondition message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.LifecyclePolicy.ActionCondition} ActionCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ActionCondition.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ActionCondition message. - * @function verify - * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ActionCondition.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.exitCodes != null && message.hasOwnProperty("exitCodes")) { - if (!Array.isArray(message.exitCodes)) - return "exitCodes: array expected"; - for (var i = 0; i < message.exitCodes.length; ++i) - if (!$util.isInteger(message.exitCodes[i])) - return "exitCodes: integer[] expected"; - } - return null; - }; - - /** - * Creates an ActionCondition message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.LifecyclePolicy.ActionCondition} ActionCondition - */ - ActionCondition.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.LifecyclePolicy.ActionCondition) - return object; - var message = new $root.google.cloud.batch.v1.LifecyclePolicy.ActionCondition(); - if (object.exitCodes) { - if (!Array.isArray(object.exitCodes)) - throw TypeError(".google.cloud.batch.v1.LifecyclePolicy.ActionCondition.exitCodes: array expected"); - message.exitCodes = []; - for (var i = 0; i < object.exitCodes.length; ++i) - message.exitCodes[i] = object.exitCodes[i] | 0; - } - return message; - }; - - /** - * Creates a plain object from an ActionCondition message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition - * @static - * @param {google.cloud.batch.v1.LifecyclePolicy.ActionCondition} message ActionCondition - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ActionCondition.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.exitCodes = []; - if (message.exitCodes && message.exitCodes.length) { - object.exitCodes = []; - for (var j = 0; j < message.exitCodes.length; ++j) - object.exitCodes[j] = message.exitCodes[j]; - } - return object; - }; - - /** - * Converts this ActionCondition to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition - * @instance - * @returns {Object.} JSON object - */ - ActionCondition.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ActionCondition - * @function getTypeUrl - * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ActionCondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.LifecyclePolicy.ActionCondition"; - }; - - return ActionCondition; - })(); - - /** - * Action enum. - * @name google.cloud.batch.v1.LifecyclePolicy.Action - * @enum {number} - * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value - * @property {number} RETRY_TASK=1 RETRY_TASK value - * @property {number} FAIL_TASK=2 FAIL_TASK value - */ - LifecyclePolicy.Action = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "RETRY_TASK"] = 1; - values[valuesById[2] = "FAIL_TASK"] = 2; - return values; - })(); - - return LifecyclePolicy; - })(); - - v1.Task = (function() { - - /** - * Properties of a Task. - * @memberof google.cloud.batch.v1 - * @interface ITask - * @property {string|null} [name] Task name - * @property {google.cloud.batch.v1.ITaskStatus|null} [status] Task status - */ - - /** - * Constructs a new Task. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a Task. - * @implements ITask - * @constructor - * @param {google.cloud.batch.v1.ITask=} [properties] Properties to set - */ - function Task(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Task name. - * @member {string} name - * @memberof google.cloud.batch.v1.Task - * @instance - */ - Task.prototype.name = ""; - - /** - * Task status. - * @member {google.cloud.batch.v1.ITaskStatus|null|undefined} status - * @memberof google.cloud.batch.v1.Task - * @instance - */ - Task.prototype.status = null; - - /** - * Creates a new Task instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.Task - * @static - * @param {google.cloud.batch.v1.ITask=} [properties] Properties to set - * @returns {google.cloud.batch.v1.Task} Task instance - */ - Task.create = function create(properties) { - return new Task(properties); - }; - - /** - * Encodes the specified Task message. Does not implicitly {@link google.cloud.batch.v1.Task.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.Task - * @static - * @param {google.cloud.batch.v1.ITask} message Task message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Task.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.cloud.batch.v1.TaskStatus.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Task message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Task.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.Task - * @static - * @param {google.cloud.batch.v1.ITask} message Task message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Task.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Task message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.Task - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.Task} Task - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Task.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Task(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.status = $root.google.cloud.batch.v1.TaskStatus.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Task message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.Task - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.Task} Task - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Task.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Task message. - * @function verify - * @memberof google.cloud.batch.v1.Task - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Task.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.status != null && message.hasOwnProperty("status")) { - var error = $root.google.cloud.batch.v1.TaskStatus.verify(message.status); - if (error) - return "status." + error; - } - return null; - }; - - /** - * Creates a Task message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.Task - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.Task} Task - */ - Task.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.Task) - return object; - var message = new $root.google.cloud.batch.v1.Task(); - if (object.name != null) - message.name = String(object.name); - if (object.status != null) { - if (typeof object.status !== "object") - throw TypeError(".google.cloud.batch.v1.Task.status: object expected"); - message.status = $root.google.cloud.batch.v1.TaskStatus.fromObject(object.status); - } - return message; - }; - - /** - * Creates a plain object from a Task message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.Task - * @static - * @param {google.cloud.batch.v1.Task} message Task - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Task.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.status = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.cloud.batch.v1.TaskStatus.toObject(message.status, options); - return object; - }; - - /** - * Converts this Task to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.Task - * @instance - * @returns {Object.} JSON object - */ - Task.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Task - * @function getTypeUrl - * @memberof google.cloud.batch.v1.Task - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Task.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.Task"; - }; - - return Task; - })(); - - v1.Environment = (function() { - - /** - * Properties of an Environment. - * @memberof google.cloud.batch.v1 - * @interface IEnvironment - * @property {Object.|null} [variables] Environment variables - * @property {Object.|null} [secretVariables] Environment secretVariables - * @property {google.cloud.batch.v1.Environment.IKMSEnvMap|null} [encryptedVariables] Environment encryptedVariables - */ - - /** - * Constructs a new Environment. - * @memberof google.cloud.batch.v1 - * @classdesc Represents an Environment. - * @implements IEnvironment - * @constructor - * @param {google.cloud.batch.v1.IEnvironment=} [properties] Properties to set - */ - function Environment(properties) { - this.variables = {}; - this.secretVariables = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Environment variables. - * @member {Object.} variables - * @memberof google.cloud.batch.v1.Environment - * @instance - */ - Environment.prototype.variables = $util.emptyObject; - - /** - * Environment secretVariables. - * @member {Object.} secretVariables - * @memberof google.cloud.batch.v1.Environment - * @instance - */ - Environment.prototype.secretVariables = $util.emptyObject; - - /** - * Environment encryptedVariables. - * @member {google.cloud.batch.v1.Environment.IKMSEnvMap|null|undefined} encryptedVariables - * @memberof google.cloud.batch.v1.Environment - * @instance - */ - Environment.prototype.encryptedVariables = null; - - /** - * Creates a new Environment instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.Environment - * @static - * @param {google.cloud.batch.v1.IEnvironment=} [properties] Properties to set - * @returns {google.cloud.batch.v1.Environment} Environment instance - */ - Environment.create = function create(properties) { - return new Environment(properties); - }; - - /** - * Encodes the specified Environment message. Does not implicitly {@link google.cloud.batch.v1.Environment.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.Environment - * @static - * @param {google.cloud.batch.v1.IEnvironment} message Environment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Environment.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.variables != null && Object.hasOwnProperty.call(message, "variables")) - for (var keys = Object.keys(message.variables), i = 0; i < keys.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.variables[keys[i]]).ldelim(); - if (message.secretVariables != null && Object.hasOwnProperty.call(message, "secretVariables")) - for (var keys = Object.keys(message.secretVariables), 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.secretVariables[keys[i]]).ldelim(); - if (message.encryptedVariables != null && Object.hasOwnProperty.call(message, "encryptedVariables")) - $root.google.cloud.batch.v1.Environment.KMSEnvMap.encode(message.encryptedVariables, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Environment.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.Environment - * @static - * @param {google.cloud.batch.v1.IEnvironment} message Environment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Environment.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Environment message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.Environment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.Environment} Environment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Environment.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Environment(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (message.variables === $util.emptyObject) - message.variables = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.variables[key] = value; - break; - } - case 2: { - if (message.secretVariables === $util.emptyObject) - message.secretVariables = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.secretVariables[key] = value; - break; - } - case 3: { - message.encryptedVariables = $root.google.cloud.batch.v1.Environment.KMSEnvMap.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Environment message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.Environment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.Environment} Environment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Environment.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Environment message. - * @function verify - * @memberof google.cloud.batch.v1.Environment - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Environment.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.variables != null && message.hasOwnProperty("variables")) { - if (!$util.isObject(message.variables)) - return "variables: object expected"; - var key = Object.keys(message.variables); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.variables[key[i]])) - return "variables: string{k:string} expected"; - } - if (message.secretVariables != null && message.hasOwnProperty("secretVariables")) { - if (!$util.isObject(message.secretVariables)) - return "secretVariables: object expected"; - var key = Object.keys(message.secretVariables); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.secretVariables[key[i]])) - return "secretVariables: string{k:string} expected"; - } - if (message.encryptedVariables != null && message.hasOwnProperty("encryptedVariables")) { - var error = $root.google.cloud.batch.v1.Environment.KMSEnvMap.verify(message.encryptedVariables); - if (error) - return "encryptedVariables." + error; - } - return null; - }; - - /** - * Creates an Environment message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.Environment - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.Environment} Environment - */ - Environment.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.Environment) - return object; - var message = new $root.google.cloud.batch.v1.Environment(); - if (object.variables) { - if (typeof object.variables !== "object") - throw TypeError(".google.cloud.batch.v1.Environment.variables: object expected"); - message.variables = {}; - for (var keys = Object.keys(object.variables), i = 0; i < keys.length; ++i) - message.variables[keys[i]] = String(object.variables[keys[i]]); - } - if (object.secretVariables) { - if (typeof object.secretVariables !== "object") - throw TypeError(".google.cloud.batch.v1.Environment.secretVariables: object expected"); - message.secretVariables = {}; - for (var keys = Object.keys(object.secretVariables), i = 0; i < keys.length; ++i) - message.secretVariables[keys[i]] = String(object.secretVariables[keys[i]]); - } - if (object.encryptedVariables != null) { - if (typeof object.encryptedVariables !== "object") - throw TypeError(".google.cloud.batch.v1.Environment.encryptedVariables: object expected"); - message.encryptedVariables = $root.google.cloud.batch.v1.Environment.KMSEnvMap.fromObject(object.encryptedVariables); - } - return message; - }; - - /** - * Creates a plain object from an Environment message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.Environment - * @static - * @param {google.cloud.batch.v1.Environment} message Environment - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Environment.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) { - object.variables = {}; - object.secretVariables = {}; - } - if (options.defaults) - object.encryptedVariables = null; - var keys2; - if (message.variables && (keys2 = Object.keys(message.variables)).length) { - object.variables = {}; - for (var j = 0; j < keys2.length; ++j) - object.variables[keys2[j]] = message.variables[keys2[j]]; - } - if (message.secretVariables && (keys2 = Object.keys(message.secretVariables)).length) { - object.secretVariables = {}; - for (var j = 0; j < keys2.length; ++j) - object.secretVariables[keys2[j]] = message.secretVariables[keys2[j]]; - } - if (message.encryptedVariables != null && message.hasOwnProperty("encryptedVariables")) - object.encryptedVariables = $root.google.cloud.batch.v1.Environment.KMSEnvMap.toObject(message.encryptedVariables, options); - return object; - }; - - /** - * Converts this Environment to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.Environment - * @instance - * @returns {Object.} JSON object - */ - Environment.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Environment - * @function getTypeUrl - * @memberof google.cloud.batch.v1.Environment - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Environment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.Environment"; - }; - - Environment.KMSEnvMap = (function() { - - /** - * Properties of a KMSEnvMap. - * @memberof google.cloud.batch.v1.Environment - * @interface IKMSEnvMap - * @property {string|null} [keyName] KMSEnvMap keyName - * @property {string|null} [cipherText] KMSEnvMap cipherText - */ - - /** - * Constructs a new KMSEnvMap. - * @memberof google.cloud.batch.v1.Environment - * @classdesc Represents a KMSEnvMap. - * @implements IKMSEnvMap - * @constructor - * @param {google.cloud.batch.v1.Environment.IKMSEnvMap=} [properties] Properties to set - */ - function KMSEnvMap(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * KMSEnvMap keyName. - * @member {string} keyName - * @memberof google.cloud.batch.v1.Environment.KMSEnvMap - * @instance - */ - KMSEnvMap.prototype.keyName = ""; - - /** - * KMSEnvMap cipherText. - * @member {string} cipherText - * @memberof google.cloud.batch.v1.Environment.KMSEnvMap - * @instance - */ - KMSEnvMap.prototype.cipherText = ""; - - /** - * Creates a new KMSEnvMap instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.Environment.KMSEnvMap - * @static - * @param {google.cloud.batch.v1.Environment.IKMSEnvMap=} [properties] Properties to set - * @returns {google.cloud.batch.v1.Environment.KMSEnvMap} KMSEnvMap instance - */ - KMSEnvMap.create = function create(properties) { - return new KMSEnvMap(properties); - }; - - /** - * Encodes the specified KMSEnvMap message. Does not implicitly {@link google.cloud.batch.v1.Environment.KMSEnvMap.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.Environment.KMSEnvMap - * @static - * @param {google.cloud.batch.v1.Environment.IKMSEnvMap} message KMSEnvMap message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KMSEnvMap.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.keyName != null && Object.hasOwnProperty.call(message, "keyName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.keyName); - if (message.cipherText != null && Object.hasOwnProperty.call(message, "cipherText")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.cipherText); - return writer; - }; - - /** - * Encodes the specified KMSEnvMap message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Environment.KMSEnvMap.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.Environment.KMSEnvMap - * @static - * @param {google.cloud.batch.v1.Environment.IKMSEnvMap} message KMSEnvMap message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KMSEnvMap.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a KMSEnvMap message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.Environment.KMSEnvMap - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.Environment.KMSEnvMap} KMSEnvMap - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KMSEnvMap.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Environment.KMSEnvMap(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.keyName = reader.string(); - break; - } - case 2: { - message.cipherText = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a KMSEnvMap message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.Environment.KMSEnvMap - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.Environment.KMSEnvMap} KMSEnvMap - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KMSEnvMap.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a KMSEnvMap message. - * @function verify - * @memberof google.cloud.batch.v1.Environment.KMSEnvMap - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KMSEnvMap.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.keyName != null && message.hasOwnProperty("keyName")) - if (!$util.isString(message.keyName)) - return "keyName: string expected"; - if (message.cipherText != null && message.hasOwnProperty("cipherText")) - if (!$util.isString(message.cipherText)) - return "cipherText: string expected"; - return null; - }; - - /** - * Creates a KMSEnvMap message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.Environment.KMSEnvMap - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.Environment.KMSEnvMap} KMSEnvMap - */ - KMSEnvMap.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.Environment.KMSEnvMap) - return object; - var message = new $root.google.cloud.batch.v1.Environment.KMSEnvMap(); - if (object.keyName != null) - message.keyName = String(object.keyName); - if (object.cipherText != null) - message.cipherText = String(object.cipherText); - return message; - }; - - /** - * Creates a plain object from a KMSEnvMap message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.Environment.KMSEnvMap - * @static - * @param {google.cloud.batch.v1.Environment.KMSEnvMap} message KMSEnvMap - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KMSEnvMap.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.keyName = ""; - object.cipherText = ""; - } - if (message.keyName != null && message.hasOwnProperty("keyName")) - object.keyName = message.keyName; - if (message.cipherText != null && message.hasOwnProperty("cipherText")) - object.cipherText = message.cipherText; - return object; - }; - - /** - * Converts this KMSEnvMap to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.Environment.KMSEnvMap - * @instance - * @returns {Object.} JSON object - */ - KMSEnvMap.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for KMSEnvMap - * @function getTypeUrl - * @memberof google.cloud.batch.v1.Environment.KMSEnvMap - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - KMSEnvMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.Environment.KMSEnvMap"; - }; - - return KMSEnvMap; - })(); - - return Environment; - })(); - - v1.Volume = (function() { - - /** - * Properties of a Volume. - * @memberof google.cloud.batch.v1 - * @interface IVolume - * @property {google.cloud.batch.v1.INFS|null} [nfs] Volume nfs - * @property {google.cloud.batch.v1.IGCS|null} [gcs] Volume gcs - * @property {string|null} [deviceName] Volume deviceName - * @property {string|null} [mountPath] Volume mountPath - * @property {Array.|null} [mountOptions] Volume mountOptions - */ - - /** - * Constructs a new Volume. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a Volume. - * @implements IVolume - * @constructor - * @param {google.cloud.batch.v1.IVolume=} [properties] Properties to set - */ - function Volume(properties) { - this.mountOptions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Volume nfs. - * @member {google.cloud.batch.v1.INFS|null|undefined} nfs - * @memberof google.cloud.batch.v1.Volume - * @instance - */ - Volume.prototype.nfs = null; - - /** - * Volume gcs. - * @member {google.cloud.batch.v1.IGCS|null|undefined} gcs - * @memberof google.cloud.batch.v1.Volume - * @instance - */ - Volume.prototype.gcs = null; - - /** - * Volume deviceName. - * @member {string|null|undefined} deviceName - * @memberof google.cloud.batch.v1.Volume - * @instance - */ - Volume.prototype.deviceName = null; - - /** - * Volume mountPath. - * @member {string} mountPath - * @memberof google.cloud.batch.v1.Volume - * @instance - */ - Volume.prototype.mountPath = ""; - - /** - * Volume mountOptions. - * @member {Array.} mountOptions - * @memberof google.cloud.batch.v1.Volume - * @instance - */ - Volume.prototype.mountOptions = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Volume source. - * @member {"nfs"|"gcs"|"deviceName"|undefined} source - * @memberof google.cloud.batch.v1.Volume - * @instance - */ - Object.defineProperty(Volume.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["nfs", "gcs", "deviceName"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Volume instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.Volume - * @static - * @param {google.cloud.batch.v1.IVolume=} [properties] Properties to set - * @returns {google.cloud.batch.v1.Volume} Volume instance - */ - Volume.create = function create(properties) { - return new Volume(properties); - }; - - /** - * Encodes the specified Volume message. Does not implicitly {@link google.cloud.batch.v1.Volume.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.Volume - * @static - * @param {google.cloud.batch.v1.IVolume} message Volume message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Volume.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nfs != null && Object.hasOwnProperty.call(message, "nfs")) - $root.google.cloud.batch.v1.NFS.encode(message.nfs, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.gcs != null && Object.hasOwnProperty.call(message, "gcs")) - $root.google.cloud.batch.v1.GCS.encode(message.gcs, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.mountPath != null && Object.hasOwnProperty.call(message, "mountPath")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.mountPath); - if (message.mountOptions != null && message.mountOptions.length) - for (var i = 0; i < message.mountOptions.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.mountOptions[i]); - if (message.deviceName != null && Object.hasOwnProperty.call(message, "deviceName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.deviceName); - return writer; - }; - - /** - * Encodes the specified Volume message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Volume.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.Volume - * @static - * @param {google.cloud.batch.v1.IVolume} message Volume message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Volume.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Volume message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.Volume - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.Volume} Volume - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Volume.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Volume(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.nfs = $root.google.cloud.batch.v1.NFS.decode(reader, reader.uint32()); - break; - } - case 3: { - message.gcs = $root.google.cloud.batch.v1.GCS.decode(reader, reader.uint32()); - break; - } - case 6: { - message.deviceName = reader.string(); - break; - } - case 4: { - message.mountPath = reader.string(); - break; - } - case 5: { - if (!(message.mountOptions && message.mountOptions.length)) - message.mountOptions = []; - message.mountOptions.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Volume message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.Volume - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.Volume} Volume - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Volume.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Volume message. - * @function verify - * @memberof google.cloud.batch.v1.Volume - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Volume.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.nfs != null && message.hasOwnProperty("nfs")) { - properties.source = 1; - { - var error = $root.google.cloud.batch.v1.NFS.verify(message.nfs); - if (error) - return "nfs." + error; - } - } - if (message.gcs != null && message.hasOwnProperty("gcs")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.batch.v1.GCS.verify(message.gcs); - if (error) - return "gcs." + error; - } - } - if (message.deviceName != null && message.hasOwnProperty("deviceName")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - if (!$util.isString(message.deviceName)) - return "deviceName: string expected"; - } - if (message.mountPath != null && message.hasOwnProperty("mountPath")) - if (!$util.isString(message.mountPath)) - return "mountPath: string expected"; - if (message.mountOptions != null && message.hasOwnProperty("mountOptions")) { - if (!Array.isArray(message.mountOptions)) - return "mountOptions: array expected"; - for (var i = 0; i < message.mountOptions.length; ++i) - if (!$util.isString(message.mountOptions[i])) - return "mountOptions: string[] expected"; - } - return null; - }; - - /** - * Creates a Volume message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.Volume - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.Volume} Volume - */ - Volume.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.Volume) - return object; - var message = new $root.google.cloud.batch.v1.Volume(); - if (object.nfs != null) { - if (typeof object.nfs !== "object") - throw TypeError(".google.cloud.batch.v1.Volume.nfs: object expected"); - message.nfs = $root.google.cloud.batch.v1.NFS.fromObject(object.nfs); - } - if (object.gcs != null) { - if (typeof object.gcs !== "object") - throw TypeError(".google.cloud.batch.v1.Volume.gcs: object expected"); - message.gcs = $root.google.cloud.batch.v1.GCS.fromObject(object.gcs); - } - if (object.deviceName != null) - message.deviceName = String(object.deviceName); - if (object.mountPath != null) - message.mountPath = String(object.mountPath); - if (object.mountOptions) { - if (!Array.isArray(object.mountOptions)) - throw TypeError(".google.cloud.batch.v1.Volume.mountOptions: array expected"); - message.mountOptions = []; - for (var i = 0; i < object.mountOptions.length; ++i) - message.mountOptions[i] = String(object.mountOptions[i]); - } - return message; - }; - - /** - * Creates a plain object from a Volume message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.Volume - * @static - * @param {google.cloud.batch.v1.Volume} message Volume - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Volume.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.mountOptions = []; - if (options.defaults) - object.mountPath = ""; - if (message.nfs != null && message.hasOwnProperty("nfs")) { - object.nfs = $root.google.cloud.batch.v1.NFS.toObject(message.nfs, options); - if (options.oneofs) - object.source = "nfs"; - } - if (message.gcs != null && message.hasOwnProperty("gcs")) { - object.gcs = $root.google.cloud.batch.v1.GCS.toObject(message.gcs, options); - if (options.oneofs) - object.source = "gcs"; - } - if (message.mountPath != null && message.hasOwnProperty("mountPath")) - object.mountPath = message.mountPath; - if (message.mountOptions && message.mountOptions.length) { - object.mountOptions = []; - for (var j = 0; j < message.mountOptions.length; ++j) - object.mountOptions[j] = message.mountOptions[j]; - } - if (message.deviceName != null && message.hasOwnProperty("deviceName")) { - object.deviceName = message.deviceName; - if (options.oneofs) - object.source = "deviceName"; - } - return object; - }; - - /** - * Converts this Volume to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.Volume - * @instance - * @returns {Object.} JSON object - */ - Volume.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Volume - * @function getTypeUrl - * @memberof google.cloud.batch.v1.Volume - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Volume.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.Volume"; - }; - - return Volume; - })(); - - v1.NFS = (function() { - - /** - * Properties of a NFS. - * @memberof google.cloud.batch.v1 - * @interface INFS - * @property {string|null} [server] NFS server - * @property {string|null} [remotePath] NFS remotePath - */ - - /** - * Constructs a new NFS. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a NFS. - * @implements INFS - * @constructor - * @param {google.cloud.batch.v1.INFS=} [properties] Properties to set - */ - function NFS(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NFS server. - * @member {string} server - * @memberof google.cloud.batch.v1.NFS - * @instance - */ - NFS.prototype.server = ""; - - /** - * NFS remotePath. - * @member {string} remotePath - * @memberof google.cloud.batch.v1.NFS - * @instance - */ - NFS.prototype.remotePath = ""; - - /** - * Creates a new NFS instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.NFS - * @static - * @param {google.cloud.batch.v1.INFS=} [properties] Properties to set - * @returns {google.cloud.batch.v1.NFS} NFS instance - */ - NFS.create = function create(properties) { - return new NFS(properties); - }; - - /** - * Encodes the specified NFS message. Does not implicitly {@link google.cloud.batch.v1.NFS.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.NFS - * @static - * @param {google.cloud.batch.v1.INFS} message NFS message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NFS.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.server != null && Object.hasOwnProperty.call(message, "server")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.server); - if (message.remotePath != null && Object.hasOwnProperty.call(message, "remotePath")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.remotePath); - return writer; - }; - - /** - * Encodes the specified NFS message, length delimited. Does not implicitly {@link google.cloud.batch.v1.NFS.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.NFS - * @static - * @param {google.cloud.batch.v1.INFS} message NFS message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NFS.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NFS message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.NFS - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.NFS} NFS - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NFS.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.NFS(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.server = reader.string(); - break; - } - case 2: { - message.remotePath = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NFS message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.NFS - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.NFS} NFS - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NFS.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NFS message. - * @function verify - * @memberof google.cloud.batch.v1.NFS - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NFS.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.server != null && message.hasOwnProperty("server")) - if (!$util.isString(message.server)) - return "server: string expected"; - if (message.remotePath != null && message.hasOwnProperty("remotePath")) - if (!$util.isString(message.remotePath)) - return "remotePath: string expected"; - return null; - }; - - /** - * Creates a NFS message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.NFS - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.NFS} NFS - */ - NFS.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.NFS) - return object; - var message = new $root.google.cloud.batch.v1.NFS(); - if (object.server != null) - message.server = String(object.server); - if (object.remotePath != null) - message.remotePath = String(object.remotePath); - return message; - }; - - /** - * Creates a plain object from a NFS message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.NFS - * @static - * @param {google.cloud.batch.v1.NFS} message NFS - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NFS.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.server = ""; - object.remotePath = ""; - } - if (message.server != null && message.hasOwnProperty("server")) - object.server = message.server; - if (message.remotePath != null && message.hasOwnProperty("remotePath")) - object.remotePath = message.remotePath; - return object; - }; - - /** - * Converts this NFS to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.NFS - * @instance - * @returns {Object.} JSON object - */ - NFS.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NFS - * @function getTypeUrl - * @memberof google.cloud.batch.v1.NFS - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NFS.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.NFS"; - }; - - return NFS; - })(); - - v1.GCS = (function() { - - /** - * Properties of a GCS. - * @memberof google.cloud.batch.v1 - * @interface IGCS - * @property {string|null} [remotePath] GCS remotePath - */ - - /** - * Constructs a new GCS. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a GCS. - * @implements IGCS - * @constructor - * @param {google.cloud.batch.v1.IGCS=} [properties] Properties to set - */ - function GCS(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GCS remotePath. - * @member {string} remotePath - * @memberof google.cloud.batch.v1.GCS - * @instance - */ - GCS.prototype.remotePath = ""; - - /** - * Creates a new GCS instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.GCS - * @static - * @param {google.cloud.batch.v1.IGCS=} [properties] Properties to set - * @returns {google.cloud.batch.v1.GCS} GCS instance - */ - GCS.create = function create(properties) { - return new GCS(properties); - }; - - /** - * Encodes the specified GCS message. Does not implicitly {@link google.cloud.batch.v1.GCS.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.GCS - * @static - * @param {google.cloud.batch.v1.IGCS} message GCS message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GCS.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.remotePath != null && Object.hasOwnProperty.call(message, "remotePath")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.remotePath); - return writer; - }; - - /** - * Encodes the specified GCS message, length delimited. Does not implicitly {@link google.cloud.batch.v1.GCS.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.GCS - * @static - * @param {google.cloud.batch.v1.IGCS} message GCS message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GCS.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GCS message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.GCS - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.GCS} GCS - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GCS.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.GCS(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.remotePath = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GCS message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.GCS - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.GCS} GCS - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GCS.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GCS message. - * @function verify - * @memberof google.cloud.batch.v1.GCS - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GCS.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.remotePath != null && message.hasOwnProperty("remotePath")) - if (!$util.isString(message.remotePath)) - return "remotePath: string expected"; - return null; - }; - - /** - * Creates a GCS message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.GCS - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.GCS} GCS - */ - GCS.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.GCS) - return object; - var message = new $root.google.cloud.batch.v1.GCS(); - if (object.remotePath != null) - message.remotePath = String(object.remotePath); - return message; - }; - - /** - * Creates a plain object from a GCS message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.GCS - * @static - * @param {google.cloud.batch.v1.GCS} message GCS - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GCS.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.remotePath = ""; - if (message.remotePath != null && message.hasOwnProperty("remotePath")) - object.remotePath = message.remotePath; - return object; - }; - - /** - * Converts this GCS to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.GCS - * @instance - * @returns {Object.} JSON object - */ - GCS.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GCS - * @function getTypeUrl - * @memberof google.cloud.batch.v1.GCS - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GCS.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.GCS"; - }; - - return GCS; - })(); - - return v1; - })(); - - return batch; - })(); - - return cloud; - })(); - - google.api = (function() { - - /** - * Namespace api. - * @memberof google - * @namespace - */ - var api = {}; - - api.Http = (function() { - - /** - * Properties of a Http. - * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion - */ - - /** - * Constructs a new Http. - * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp - * @constructor - * @param {google.api.IHttp=} [properties] Properties to set - */ - function Http(properties) { - this.rules = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http - * @instance - */ - Http.prototype.rules = $util.emptyArray; - - /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http - * @instance - */ - Http.prototype.fullyDecodeReservedExpansion = false; - - /** - * Creates a new Http instance using the specified properties. - * @function create - * @memberof google.api.Http - * @static - * @param {google.api.IHttp=} [properties] Properties to set - * @returns {google.api.Http} Http instance - */ - Http.create = function create(properties) { - return new Http(properties); - }; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encode - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rules != null && message.rules.length) - for (var i = 0; i < message.rules.length; ++i) - $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); - return writer; - }; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Http message from the specified reader or buffer. - * @function decode - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - } - case 2: { - message.fullyDecodeReservedExpansion = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Http message. - * @function verify - * @memberof google.api.Http - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Http.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.rules != null && message.hasOwnProperty("rules")) { - if (!Array.isArray(message.rules)) - return "rules: array expected"; - for (var i = 0; i < message.rules.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.rules[i]); - if (error) - return "rules." + error; - } - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - if (typeof message.fullyDecodeReservedExpansion !== "boolean") - return "fullyDecodeReservedExpansion: boolean expected"; - return null; - }; - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Http - * @static - * @param {Object.} object Plain object - * @returns {google.api.Http} Http - */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) - return object; - var message = new $root.google.api.Http(); - if (object.rules) { - if (!Array.isArray(object.rules)) - throw TypeError(".google.api.Http.rules: array expected"); - message.rules = []; - for (var i = 0; i < object.rules.length; ++i) { - if (typeof object.rules[i] !== "object") - throw TypeError(".google.api.Http.rules: object expected"); - message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); - } - } - if (object.fullyDecodeReservedExpansion != null) - message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); - return message; - }; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Http - * @static - * @param {google.api.Http} message Http - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Http.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.rules = []; - if (options.defaults) - object.fullyDecodeReservedExpansion = false; - if (message.rules && message.rules.length) { - object.rules = []; - for (var j = 0; j < message.rules.length; ++j) - object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; - return object; - }; - - /** - * Converts this Http to JSON. - * @function toJSON - * @memberof google.api.Http - * @instance - * @returns {Object.} JSON object - */ - Http.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Http - * @function getTypeUrl - * @memberof google.api.Http - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Http"; - }; - - return Http; - })(); - - api.HttpRule = (function() { - - /** - * Properties of a HttpRule. - * @memberof google.api - * @interface IHttpRule - * @property {string|null} [selector] HttpRule selector - * @property {string|null} [get] HttpRule get - * @property {string|null} [put] HttpRule put - * @property {string|null} [post] HttpRule post - * @property {string|null} ["delete"] HttpRule delete - * @property {string|null} [patch] HttpRule patch - * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom - * @property {string|null} [body] HttpRule body - * @property {string|null} [responseBody] HttpRule responseBody - * @property {Array.|null} [additionalBindings] HttpRule additionalBindings - */ - - /** - * Constructs a new HttpRule. - * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule - * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set - */ - function HttpRule(properties) { - this.additionalBindings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; - - /** - * HttpRule get. - * @member {string|null|undefined} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = null; - - /** - * HttpRule put. - * @member {string|null|undefined} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = null; - - /** - * HttpRule post. - * @member {string|null|undefined} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = null; - - /** - * HttpRule delete. - * @member {string|null|undefined} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = null; - - /** - * HttpRule patch. - * @member {string|null|undefined} patch - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.patch = null; - - /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.custom = null; - - /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.body = ""; - - /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.responseBody = ""; - - /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule - * @instance - */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new HttpRule instance using the specified properties. - * @function create - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance - */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); - }; - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encode - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && Object.hasOwnProperty.call(message, "get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && Object.hasOwnProperty.call(message, "put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && Object.hasOwnProperty.call(message, "post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) - $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.additionalBindings != null && message.additionalBindings.length) - for (var i = 0; i < message.additionalBindings.length; ++i) - $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); - return writer; - }; - - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @function decode - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.selector = reader.string(); - break; - } - case 2: { - message.get = reader.string(); - break; - } - case 3: { - message.put = reader.string(); - break; - } - case 4: { - message.post = reader.string(); - break; - } - case 5: { - message["delete"] = reader.string(); - break; - } - case 6: { - message.patch = reader.string(); - break; - } - case 8: { - message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); - break; - } - case 7: { - message.body = reader.string(); - break; - } - case 12: { - message.responseBody = reader.string(); - break; - } - case 11: { - if (!(message.additionalBindings && message.additionalBindings.length)) - message.additionalBindings = []; - message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HttpRule message. - * @function verify - * @memberof google.api.HttpRule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HttpRule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.get != null && message.hasOwnProperty("get")) { - properties.pattern = 1; - if (!$util.isString(message.get)) - return "get: string expected"; - } - if (message.put != null && message.hasOwnProperty("put")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.put)) - return "put: string expected"; - } - if (message.post != null && message.hasOwnProperty("post")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.post)) - return "post: string expected"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message["delete"])) - return "delete: string expected"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.patch)) - return "patch: string expected"; - } - if (message.custom != null && message.hasOwnProperty("custom")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - { - var error = $root.google.api.CustomHttpPattern.verify(message.custom); - if (error) - return "custom." + error; - } - } - if (message.body != null && message.hasOwnProperty("body")) - if (!$util.isString(message.body)) - return "body: string expected"; - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - if (!$util.isString(message.responseBody)) - return "responseBody: string expected"; - if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { - if (!Array.isArray(message.additionalBindings)) - return "additionalBindings: array expected"; - for (var i = 0; i < message.additionalBindings.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); - if (error) - return "additionalBindings." + error; - } - } - return null; - }; - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.HttpRule - * @static - * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule - */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) - return object; - var message = new $root.google.api.HttpRule(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.get != null) - message.get = String(object.get); - if (object.put != null) - message.put = String(object.put); - if (object.post != null) - message.post = String(object.post); - if (object["delete"] != null) - message["delete"] = String(object["delete"]); - if (object.patch != null) - message.patch = String(object.patch); - if (object.custom != null) { - if (typeof object.custom !== "object") - throw TypeError(".google.api.HttpRule.custom: object expected"); - message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); - } - if (object.body != null) - message.body = String(object.body); - if (object.responseBody != null) - message.responseBody = String(object.responseBody); - if (object.additionalBindings) { - if (!Array.isArray(object.additionalBindings)) - throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); - message.additionalBindings = []; - for (var i = 0; i < object.additionalBindings.length; ++i) { - if (typeof object.additionalBindings[i] !== "object") - throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); - message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.HttpRule - * @static - * @param {google.api.HttpRule} message HttpRule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HttpRule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.additionalBindings = []; - if (options.defaults) { - object.selector = ""; - object.body = ""; - object.responseBody = ""; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.get != null && message.hasOwnProperty("get")) { - object.get = message.get; - if (options.oneofs) - object.pattern = "get"; - } - if (message.put != null && message.hasOwnProperty("put")) { - object.put = message.put; - if (options.oneofs) - object.pattern = "put"; - } - if (message.post != null && message.hasOwnProperty("post")) { - object.post = message.post; - if (options.oneofs) - object.pattern = "post"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - object["delete"] = message["delete"]; - if (options.oneofs) - object.pattern = "delete"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - object.patch = message.patch; - if (options.oneofs) - object.pattern = "patch"; - } - if (message.body != null && message.hasOwnProperty("body")) - object.body = message.body; - if (message.custom != null && message.hasOwnProperty("custom")) { - object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); - if (options.oneofs) - object.pattern = "custom"; - } - if (message.additionalBindings && message.additionalBindings.length) { - object.additionalBindings = []; - for (var j = 0; j < message.additionalBindings.length; ++j) - object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); - } - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; - return object; - }; - - /** - * Converts this HttpRule to JSON. - * @function toJSON - * @memberof google.api.HttpRule - * @instance - * @returns {Object.} JSON object - */ - HttpRule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HttpRule - * @function getTypeUrl - * @memberof google.api.HttpRule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.HttpRule"; - }; - - return HttpRule; - })(); - - api.CustomHttpPattern = (function() { - - /** - * Properties of a CustomHttpPattern. - * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path - */ - - /** - * Constructs a new CustomHttpPattern. - * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern - * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - */ - function CustomHttpPattern(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.kind = ""; - - /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.path = ""; - - /** - * Creates a new CustomHttpPattern instance using the specified properties. - * @function create - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance - */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); - }; - - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encode - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); - return writer; - }; - - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @function decode - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.kind = reader.string(); - break; - } - case 2: { - message.path = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CustomHttpPattern message. - * @function verify - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CustomHttpPattern.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - if (!$util.isString(message.kind)) - return "kind: string expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; - return null; - }; - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) - return object; - var message = new $root.google.api.CustomHttpPattern(); - if (object.kind != null) - message.kind = String(object.kind); - if (object.path != null) - message.path = String(object.path); - return message; - }; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomHttpPattern.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.kind = ""; - object.path = ""; - } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - return object; - }; - - /** - * Converts this CustomHttpPattern to JSON. - * @function toJSON - * @memberof google.api.CustomHttpPattern - * @instance - * @returns {Object.} JSON object - */ - CustomHttpPattern.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CustomHttpPattern - * @function getTypeUrl - * @memberof google.api.CustomHttpPattern - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CustomHttpPattern"; - }; - - return CustomHttpPattern; - })(); - - api.CommonLanguageSettings = (function() { - - /** - * Properties of a CommonLanguageSettings. - * @memberof google.api - * @interface ICommonLanguageSettings - * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri - * @property {Array.|null} [destinations] CommonLanguageSettings destinations - */ - - /** - * Constructs a new CommonLanguageSettings. - * @memberof google.api - * @classdesc Represents a CommonLanguageSettings. - * @implements ICommonLanguageSettings - * @constructor - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set - */ - function CommonLanguageSettings(properties) { - this.destinations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CommonLanguageSettings referenceDocsUri. - * @member {string} referenceDocsUri - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.referenceDocsUri = ""; - - /** - * CommonLanguageSettings destinations. - * @member {Array.} destinations - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.destinations = $util.emptyArray; - - /** - * Creates a new CommonLanguageSettings instance using the specified properties. - * @function create - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance - */ - CommonLanguageSettings.create = function create(properties) { - return new CommonLanguageSettings(properties); - }; - - /** - * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @function encode - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonLanguageSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); - if (message.destinations != null && message.destinations.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.destinations.length; ++i) - writer.int32(message.destinations[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.CommonLanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonLanguageSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.referenceDocsUri = reader.string(); - break; - } - case 2: { - if (!(message.destinations && message.destinations.length)) - message.destinations = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.destinations.push(reader.int32()); - } else - message.destinations.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CommonLanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CommonLanguageSettings message. - * @function verify - * @memberof google.api.CommonLanguageSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CommonLanguageSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) - if (!$util.isString(message.referenceDocsUri)) - return "referenceDocsUri: string expected"; - if (message.destinations != null && message.hasOwnProperty("destinations")) { - if (!Array.isArray(message.destinations)) - return "destinations: array expected"; - for (var i = 0; i < message.destinations.length; ++i) - switch (message.destinations[i]) { - default: - return "destinations: enum value[] expected"; - case 0: - case 10: - case 20: - break; - } - } - return null; - }; - - /** - * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CommonLanguageSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - */ - CommonLanguageSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CommonLanguageSettings) - return object; - var message = new $root.google.api.CommonLanguageSettings(); - if (object.referenceDocsUri != null) - message.referenceDocsUri = String(object.referenceDocsUri); - if (object.destinations) { - if (!Array.isArray(object.destinations)) - throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); - message.destinations = []; - for (var i = 0; i < object.destinations.length; ++i) - switch (object.destinations[i]) { - default: - if (typeof object.destinations[i] === "number") { - message.destinations[i] = object.destinations[i]; - break; - } - case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": - case 0: - message.destinations[i] = 0; - break; - case "GITHUB": - case 10: - message.destinations[i] = 10; - break; - case "PACKAGE_MANAGER": - case 20: - message.destinations[i] = 20; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CommonLanguageSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.destinations = []; - if (options.defaults) - object.referenceDocsUri = ""; - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) - object.referenceDocsUri = message.referenceDocsUri; - if (message.destinations && message.destinations.length) { - object.destinations = []; - for (var j = 0; j < message.destinations.length; ++j) - object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; - } - return object; - }; - - /** - * Converts this CommonLanguageSettings to JSON. - * @function toJSON - * @memberof google.api.CommonLanguageSettings - * @instance - * @returns {Object.} JSON object - */ - CommonLanguageSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CommonLanguageSettings - * @function getTypeUrl - * @memberof google.api.CommonLanguageSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CommonLanguageSettings"; - }; - - return CommonLanguageSettings; - })(); - - api.ClientLibrarySettings = (function() { - - /** - * Properties of a ClientLibrarySettings. - * @memberof google.api - * @interface IClientLibrarySettings - * @property {string|null} [version] ClientLibrarySettings version - * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage - * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums - * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings - * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings - * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings - * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings - * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings - * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings - * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings - * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings - */ - - /** - * Constructs a new ClientLibrarySettings. - * @memberof google.api - * @classdesc Represents a ClientLibrarySettings. - * @implements IClientLibrarySettings - * @constructor - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - */ - function ClientLibrarySettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientLibrarySettings version. - * @member {string} version - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.version = ""; - - /** - * ClientLibrarySettings launchStage. - * @member {google.api.LaunchStage} launchStage - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.launchStage = 0; - - /** - * ClientLibrarySettings restNumericEnums. - * @member {boolean} restNumericEnums - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.restNumericEnums = false; - - /** - * ClientLibrarySettings javaSettings. - * @member {google.api.IJavaSettings|null|undefined} javaSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.javaSettings = null; - - /** - * ClientLibrarySettings cppSettings. - * @member {google.api.ICppSettings|null|undefined} cppSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.cppSettings = null; - - /** - * ClientLibrarySettings phpSettings. - * @member {google.api.IPhpSettings|null|undefined} phpSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.phpSettings = null; - - /** - * ClientLibrarySettings pythonSettings. - * @member {google.api.IPythonSettings|null|undefined} pythonSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.pythonSettings = null; - - /** - * ClientLibrarySettings nodeSettings. - * @member {google.api.INodeSettings|null|undefined} nodeSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.nodeSettings = null; - - /** - * ClientLibrarySettings dotnetSettings. - * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.dotnetSettings = null; - - /** - * ClientLibrarySettings rubySettings. - * @member {google.api.IRubySettings|null|undefined} rubySettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.rubySettings = null; - - /** - * ClientLibrarySettings goSettings. - * @member {google.api.IGoSettings|null|undefined} goSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.goSettings = null; - - /** - * Creates a new ClientLibrarySettings instance using the specified properties. - * @function create - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance - */ - ClientLibrarySettings.create = function create(properties) { - return new ClientLibrarySettings(properties); - }; - - /** - * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @function encode - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientLibrarySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); - if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); - if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) - $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) - $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) - $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) - $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) - $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); - if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) - $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) - $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) - $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.ClientLibrarySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientLibrarySettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.version = reader.string(); - break; - } - case 2: { - message.launchStage = reader.int32(); - break; - } - case 3: { - message.restNumericEnums = reader.bool(); - break; - } - case 21: { - message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); - break; - } - case 22: { - message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); - break; - } - case 23: { - message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); - break; - } - case 24: { - message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); - break; - } - case 25: { - message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); - break; - } - case 26: { - message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); - break; - } - case 27: { - message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); - break; - } - case 28: { - message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ClientLibrarySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientLibrarySettings message. - * @function verify - * @memberof google.api.ClientLibrarySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientLibrarySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - switch (message.launchStage) { - default: - return "launchStage: enum value expected"; - case 0: - case 6: - case 7: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) - if (typeof message.restNumericEnums !== "boolean") - return "restNumericEnums: boolean expected"; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { - var error = $root.google.api.JavaSettings.verify(message.javaSettings); - if (error) - return "javaSettings." + error; - } - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { - var error = $root.google.api.CppSettings.verify(message.cppSettings); - if (error) - return "cppSettings." + error; - } - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { - var error = $root.google.api.PhpSettings.verify(message.phpSettings); - if (error) - return "phpSettings." + error; - } - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { - var error = $root.google.api.PythonSettings.verify(message.pythonSettings); - if (error) - return "pythonSettings." + error; - } - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { - var error = $root.google.api.NodeSettings.verify(message.nodeSettings); - if (error) - return "nodeSettings." + error; - } - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { - var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); - if (error) - return "dotnetSettings." + error; - } - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { - var error = $root.google.api.RubySettings.verify(message.rubySettings); - if (error) - return "rubySettings." + error; - } - if (message.goSettings != null && message.hasOwnProperty("goSettings")) { - var error = $root.google.api.GoSettings.verify(message.goSettings); - if (error) - return "goSettings." + error; - } - return null; - }; - - /** - * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ClientLibrarySettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - */ - ClientLibrarySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ClientLibrarySettings) - return object; - var message = new $root.google.api.ClientLibrarySettings(); - if (object.version != null) - message.version = String(object.version); - switch (object.launchStage) { - default: - if (typeof object.launchStage === "number") { - message.launchStage = object.launchStage; - break; - } - break; - case "LAUNCH_STAGE_UNSPECIFIED": - case 0: - message.launchStage = 0; - break; - case "UNIMPLEMENTED": - case 6: - message.launchStage = 6; - break; - case "PRELAUNCH": - case 7: - message.launchStage = 7; - break; - case "EARLY_ACCESS": - case 1: - message.launchStage = 1; - break; - case "ALPHA": - case 2: - message.launchStage = 2; - break; - case "BETA": - case 3: - message.launchStage = 3; - break; - case "GA": - case 4: - message.launchStage = 4; - break; - case "DEPRECATED": - case 5: - message.launchStage = 5; - break; - } - if (object.restNumericEnums != null) - message.restNumericEnums = Boolean(object.restNumericEnums); - if (object.javaSettings != null) { - if (typeof object.javaSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); - message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); - } - if (object.cppSettings != null) { - if (typeof object.cppSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); - message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); - } - if (object.phpSettings != null) { - if (typeof object.phpSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); - message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); - } - if (object.pythonSettings != null) { - if (typeof object.pythonSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); - message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); - } - if (object.nodeSettings != null) { - if (typeof object.nodeSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); - message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); - } - if (object.dotnetSettings != null) { - if (typeof object.dotnetSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); - message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); - } - if (object.rubySettings != null) { - if (typeof object.rubySettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); - message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); - } - if (object.goSettings != null) { - if (typeof object.goSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); - message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); - } - return message; - }; - - /** - * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientLibrarySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.version = ""; - object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - object.restNumericEnums = false; - object.javaSettings = null; - object.cppSettings = null; - object.phpSettings = null; - object.pythonSettings = null; - object.nodeSettings = null; - object.dotnetSettings = null; - object.rubySettings = null; - object.goSettings = null; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) - object.restNumericEnums = message.restNumericEnums; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) - object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) - object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) - object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) - object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) - object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) - object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) - object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); - if (message.goSettings != null && message.hasOwnProperty("goSettings")) - object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); - return object; - }; - - /** - * Converts this ClientLibrarySettings to JSON. - * @function toJSON - * @memberof google.api.ClientLibrarySettings - * @instance - * @returns {Object.} JSON object - */ - ClientLibrarySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClientLibrarySettings - * @function getTypeUrl - * @memberof google.api.ClientLibrarySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ClientLibrarySettings"; - }; - - return ClientLibrarySettings; - })(); - - api.Publishing = (function() { - - /** - * Properties of a Publishing. - * @memberof google.api - * @interface IPublishing - * @property {Array.|null} [methodSettings] Publishing methodSettings - * @property {string|null} [newIssueUri] Publishing newIssueUri - * @property {string|null} [documentationUri] Publishing documentationUri - * @property {string|null} [apiShortName] Publishing apiShortName - * @property {string|null} [githubLabel] Publishing githubLabel - * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams - * @property {string|null} [docTagPrefix] Publishing docTagPrefix - * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization - * @property {Array.|null} [librarySettings] Publishing librarySettings - * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri - * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri - */ - - /** - * Constructs a new Publishing. - * @memberof google.api - * @classdesc Represents a Publishing. - * @implements IPublishing - * @constructor - * @param {google.api.IPublishing=} [properties] Properties to set - */ - function Publishing(properties) { - this.methodSettings = []; - this.codeownerGithubTeams = []; - this.librarySettings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Publishing methodSettings. - * @member {Array.} methodSettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.methodSettings = $util.emptyArray; - - /** - * Publishing newIssueUri. - * @member {string} newIssueUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.newIssueUri = ""; - - /** - * Publishing documentationUri. - * @member {string} documentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.documentationUri = ""; - - /** - * Publishing apiShortName. - * @member {string} apiShortName - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.apiShortName = ""; - - /** - * Publishing githubLabel. - * @member {string} githubLabel - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.githubLabel = ""; - - /** - * Publishing codeownerGithubTeams. - * @member {Array.} codeownerGithubTeams - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.codeownerGithubTeams = $util.emptyArray; - - /** - * Publishing docTagPrefix. - * @member {string} docTagPrefix - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.docTagPrefix = ""; - - /** - * Publishing organization. - * @member {google.api.ClientLibraryOrganization} organization - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.organization = 0; - - /** - * Publishing librarySettings. - * @member {Array.} librarySettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.librarySettings = $util.emptyArray; - - /** - * Publishing protoReferenceDocumentationUri. - * @member {string} protoReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.protoReferenceDocumentationUri = ""; - - /** - * Publishing restReferenceDocumentationUri. - * @member {string} restReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.restReferenceDocumentationUri = ""; - - /** - * Creates a new Publishing instance using the specified properties. - * @function create - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing=} [properties] Properties to set - * @returns {google.api.Publishing} Publishing instance - */ - Publishing.create = function create(properties) { - return new Publishing(properties); - }; - - /** - * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @function encode - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing} message Publishing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Publishing.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.methodSettings != null && message.methodSettings.length) - for (var i = 0; i < message.methodSettings.length; ++i) - $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) - writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); - if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) - writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); - if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) - writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); - if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) - writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); - if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) - for (var i = 0; i < message.codeownerGithubTeams.length; ++i) - writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); - if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) - writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); - if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) - writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); - if (message.librarySettings != null && message.librarySettings.length) - for (var i = 0; i < message.librarySettings.length; ++i) - $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); - if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) - writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); - if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) - writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); - return writer; - }; - - /** - * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing} message Publishing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Publishing.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Publishing message from the specified reader or buffer. - * @function decode - * @memberof google.api.Publishing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Publishing} Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Publishing.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - if (!(message.methodSettings && message.methodSettings.length)) - message.methodSettings = []; - message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); - break; - } - case 101: { - message.newIssueUri = reader.string(); - break; - } - case 102: { - message.documentationUri = reader.string(); - break; - } - case 103: { - message.apiShortName = reader.string(); - break; - } - case 104: { - message.githubLabel = reader.string(); - break; - } - case 105: { - if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) - message.codeownerGithubTeams = []; - message.codeownerGithubTeams.push(reader.string()); - break; - } - case 106: { - message.docTagPrefix = reader.string(); - break; - } - case 107: { - message.organization = reader.int32(); - break; - } - case 109: { - if (!(message.librarySettings && message.librarySettings.length)) - message.librarySettings = []; - message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); - break; - } - case 110: { - message.protoReferenceDocumentationUri = reader.string(); - break; - } - case 111: { - message.restReferenceDocumentationUri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Publishing message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Publishing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Publishing} Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Publishing.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Publishing message. - * @function verify - * @memberof google.api.Publishing - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Publishing.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { - if (!Array.isArray(message.methodSettings)) - return "methodSettings: array expected"; - for (var i = 0; i < message.methodSettings.length; ++i) { - var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); - if (error) - return "methodSettings." + error; - } - } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) - if (!$util.isString(message.newIssueUri)) - return "newIssueUri: string expected"; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - if (!$util.isString(message.documentationUri)) - return "documentationUri: string expected"; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) - if (!$util.isString(message.apiShortName)) - return "apiShortName: string expected"; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) - if (!$util.isString(message.githubLabel)) - return "githubLabel: string expected"; - if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { - if (!Array.isArray(message.codeownerGithubTeams)) - return "codeownerGithubTeams: array expected"; - for (var i = 0; i < message.codeownerGithubTeams.length; ++i) - if (!$util.isString(message.codeownerGithubTeams[i])) - return "codeownerGithubTeams: string[] expected"; - } - if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) - if (!$util.isString(message.docTagPrefix)) - return "docTagPrefix: string expected"; - if (message.organization != null && message.hasOwnProperty("organization")) - switch (message.organization) { - default: - return "organization: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { - if (!Array.isArray(message.librarySettings)) - return "librarySettings: array expected"; - for (var i = 0; i < message.librarySettings.length; ++i) { - var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); - if (error) - return "librarySettings." + error; - } - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - if (!$util.isString(message.protoReferenceDocumentationUri)) - return "protoReferenceDocumentationUri: string expected"; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - if (!$util.isString(message.restReferenceDocumentationUri)) - return "restReferenceDocumentationUri: string expected"; - return null; - }; - - /** - * Creates a Publishing message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Publishing - * @static - * @param {Object.} object Plain object - * @returns {google.api.Publishing} Publishing - */ - Publishing.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Publishing) - return object; - var message = new $root.google.api.Publishing(); - if (object.methodSettings) { - if (!Array.isArray(object.methodSettings)) - throw TypeError(".google.api.Publishing.methodSettings: array expected"); - message.methodSettings = []; - for (var i = 0; i < object.methodSettings.length; ++i) { - if (typeof object.methodSettings[i] !== "object") - throw TypeError(".google.api.Publishing.methodSettings: object expected"); - message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); - } - } - if (object.newIssueUri != null) - message.newIssueUri = String(object.newIssueUri); - if (object.documentationUri != null) - message.documentationUri = String(object.documentationUri); - if (object.apiShortName != null) - message.apiShortName = String(object.apiShortName); - if (object.githubLabel != null) - message.githubLabel = String(object.githubLabel); - if (object.codeownerGithubTeams) { - if (!Array.isArray(object.codeownerGithubTeams)) - throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); - message.codeownerGithubTeams = []; - for (var i = 0; i < object.codeownerGithubTeams.length; ++i) - message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); - } - if (object.docTagPrefix != null) - message.docTagPrefix = String(object.docTagPrefix); - switch (object.organization) { - default: - if (typeof object.organization === "number") { - message.organization = object.organization; - break; - } - break; - case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": - case 0: - message.organization = 0; - break; - case "CLOUD": - case 1: - message.organization = 1; - break; - case "ADS": - case 2: - message.organization = 2; - break; - case "PHOTOS": - case 3: - message.organization = 3; - break; - case "STREET_VIEW": - case 4: - message.organization = 4; - break; - case "SHOPPING": - case 5: - message.organization = 5; - break; - case "GEO": - case 6: - message.organization = 6; - break; - case "GENERATIVE_AI": - case 7: - message.organization = 7; - break; - } - if (object.librarySettings) { - if (!Array.isArray(object.librarySettings)) - throw TypeError(".google.api.Publishing.librarySettings: array expected"); - message.librarySettings = []; - for (var i = 0; i < object.librarySettings.length; ++i) { - if (typeof object.librarySettings[i] !== "object") - throw TypeError(".google.api.Publishing.librarySettings: object expected"); - message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); - } - } - if (object.protoReferenceDocumentationUri != null) - message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); - if (object.restReferenceDocumentationUri != null) - message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); - return message; - }; - - /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Publishing - * @static - * @param {google.api.Publishing} message Publishing - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Publishing.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.methodSettings = []; - object.codeownerGithubTeams = []; - object.librarySettings = []; - } - if (options.defaults) { - object.newIssueUri = ""; - object.documentationUri = ""; - object.apiShortName = ""; - object.githubLabel = ""; - object.docTagPrefix = ""; - object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; - object.protoReferenceDocumentationUri = ""; - object.restReferenceDocumentationUri = ""; - } - if (message.methodSettings && message.methodSettings.length) { - object.methodSettings = []; - for (var j = 0; j < message.methodSettings.length; ++j) - object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); - } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) - object.newIssueUri = message.newIssueUri; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - object.documentationUri = message.documentationUri; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) - object.apiShortName = message.apiShortName; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) - object.githubLabel = message.githubLabel; - if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { - object.codeownerGithubTeams = []; - for (var j = 0; j < message.codeownerGithubTeams.length; ++j) - object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; - } - if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) - object.docTagPrefix = message.docTagPrefix; - if (message.organization != null && message.hasOwnProperty("organization")) - object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; - if (message.librarySettings && message.librarySettings.length) { - object.librarySettings = []; - for (var j = 0; j < message.librarySettings.length; ++j) - object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; - return object; - }; - - /** - * Converts this Publishing to JSON. - * @function toJSON - * @memberof google.api.Publishing - * @instance - * @returns {Object.} JSON object - */ - Publishing.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Publishing - * @function getTypeUrl - * @memberof google.api.Publishing - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Publishing"; - }; - - return Publishing; - })(); - - api.JavaSettings = (function() { - - /** - * Properties of a JavaSettings. - * @memberof google.api - * @interface IJavaSettings - * @property {string|null} [libraryPackage] JavaSettings libraryPackage - * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames - * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common - */ - - /** - * Constructs a new JavaSettings. - * @memberof google.api - * @classdesc Represents a JavaSettings. - * @implements IJavaSettings - * @constructor - * @param {google.api.IJavaSettings=} [properties] Properties to set - */ - function JavaSettings(properties) { - this.serviceClassNames = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * JavaSettings libraryPackage. - * @member {string} libraryPackage - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.libraryPackage = ""; - - /** - * JavaSettings serviceClassNames. - * @member {Object.} serviceClassNames - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.serviceClassNames = $util.emptyObject; - - /** - * JavaSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.common = null; - - /** - * Creates a new JavaSettings instance using the specified properties. - * @function create - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings=} [properties] Properties to set - * @returns {google.api.JavaSettings} JavaSettings instance - */ - JavaSettings.create = function create(properties) { - return new JavaSettings(properties); - }; - - /** - * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @function encode - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JavaSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); - if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) - for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a JavaSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.JavaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.JavaSettings} JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JavaSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.libraryPackage = reader.string(); - break; - } - case 2: { - if (message.serviceClassNames === $util.emptyObject) - message.serviceClassNames = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.serviceClassNames[key] = value; - break; - } - case 3: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a JavaSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.JavaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.JavaSettings} JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JavaSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a JavaSettings message. - * @function verify - * @memberof google.api.JavaSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - JavaSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) - if (!$util.isString(message.libraryPackage)) - return "libraryPackage: string expected"; - if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { - if (!$util.isObject(message.serviceClassNames)) - return "serviceClassNames: object expected"; - var key = Object.keys(message.serviceClassNames); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.serviceClassNames[key[i]])) - return "serviceClassNames: string{k:string} expected"; - } - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.JavaSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.JavaSettings} JavaSettings - */ - JavaSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.JavaSettings) - return object; - var message = new $root.google.api.JavaSettings(); - if (object.libraryPackage != null) - message.libraryPackage = String(object.libraryPackage); - if (object.serviceClassNames) { - if (typeof object.serviceClassNames !== "object") - throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); - message.serviceClassNames = {}; - for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) - message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); - } - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.JavaSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.JavaSettings - * @static - * @param {google.api.JavaSettings} message JavaSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - JavaSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.serviceClassNames = {}; - if (options.defaults) { - object.libraryPackage = ""; - object.common = null; - } - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) - object.libraryPackage = message.libraryPackage; - var keys2; - if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { - object.serviceClassNames = {}; - for (var j = 0; j < keys2.length; ++j) - object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; - } - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this JavaSettings to JSON. - * @function toJSON - * @memberof google.api.JavaSettings - * @instance - * @returns {Object.} JSON object - */ - JavaSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for JavaSettings - * @function getTypeUrl - * @memberof google.api.JavaSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.JavaSettings"; - }; - - return JavaSettings; - })(); - - api.CppSettings = (function() { - - /** - * Properties of a CppSettings. - * @memberof google.api - * @interface ICppSettings - * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common - */ - - /** - * Constructs a new CppSettings. - * @memberof google.api - * @classdesc Represents a CppSettings. - * @implements ICppSettings - * @constructor - * @param {google.api.ICppSettings=} [properties] Properties to set - */ - function CppSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CppSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.CppSettings - * @instance - */ - CppSettings.prototype.common = null; - - /** - * Creates a new CppSettings instance using the specified properties. - * @function create - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings=} [properties] Properties to set - * @returns {google.api.CppSettings} CppSettings instance - */ - CppSettings.create = function create(properties) { - return new CppSettings(properties); - }; - - /** - * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @function encode - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings} message CppSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CppSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings} message CppSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CppSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CppSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.CppSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CppSettings} CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CppSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CppSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CppSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CppSettings} CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CppSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CppSettings message. - * @function verify - * @memberof google.api.CppSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CppSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CppSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CppSettings} CppSettings - */ - CppSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CppSettings) - return object; - var message = new $root.google.api.CppSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.CppSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a CppSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CppSettings - * @static - * @param {google.api.CppSettings} message CppSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CppSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this CppSettings to JSON. - * @function toJSON - * @memberof google.api.CppSettings - * @instance - * @returns {Object.} JSON object - */ - CppSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CppSettings - * @function getTypeUrl - * @memberof google.api.CppSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CppSettings"; - }; - - return CppSettings; - })(); - - api.PhpSettings = (function() { - - /** - * Properties of a PhpSettings. - * @memberof google.api - * @interface IPhpSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common - */ - - /** - * Constructs a new PhpSettings. - * @memberof google.api - * @classdesc Represents a PhpSettings. - * @implements IPhpSettings - * @constructor - * @param {google.api.IPhpSettings=} [properties] Properties to set - */ - function PhpSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PhpSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PhpSettings - * @instance - */ - PhpSettings.prototype.common = null; - - /** - * Creates a new PhpSettings instance using the specified properties. - * @function create - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings=} [properties] Properties to set - * @returns {google.api.PhpSettings} PhpSettings instance - */ - PhpSettings.create = function create(properties) { - return new PhpSettings(properties); - }; - - /** - * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @function encode - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhpSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PhpSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.PhpSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PhpSettings} PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhpSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PhpSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PhpSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PhpSettings} PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhpSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PhpSettings message. - * @function verify - * @memberof google.api.PhpSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PhpSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PhpSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PhpSettings} PhpSettings - */ - PhpSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PhpSettings) - return object; - var message = new $root.google.api.PhpSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PhpSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PhpSettings - * @static - * @param {google.api.PhpSettings} message PhpSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PhpSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this PhpSettings to JSON. - * @function toJSON - * @memberof google.api.PhpSettings - * @instance - * @returns {Object.} JSON object - */ - PhpSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PhpSettings - * @function getTypeUrl - * @memberof google.api.PhpSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PhpSettings"; - }; - - return PhpSettings; - })(); - - api.PythonSettings = (function() { - - /** - * Properties of a PythonSettings. - * @memberof google.api - * @interface IPythonSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common - */ - - /** - * Constructs a new PythonSettings. - * @memberof google.api - * @classdesc Represents a PythonSettings. - * @implements IPythonSettings - * @constructor - * @param {google.api.IPythonSettings=} [properties] Properties to set - */ - function PythonSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PythonSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PythonSettings - * @instance - */ - PythonSettings.prototype.common = null; - - /** - * Creates a new PythonSettings instance using the specified properties. - * @function create - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings=} [properties] Properties to set - * @returns {google.api.PythonSettings} PythonSettings instance - */ - PythonSettings.create = function create(properties) { - return new PythonSettings(properties); - }; - - /** - * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @function encode - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PythonSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.PythonSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PythonSettings} PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PythonSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PythonSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PythonSettings} PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PythonSettings message. - * @function verify - * @memberof google.api.PythonSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PythonSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PythonSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PythonSettings} PythonSettings - */ - PythonSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PythonSettings) - return object; - var message = new $root.google.api.PythonSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PythonSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PythonSettings - * @static - * @param {google.api.PythonSettings} message PythonSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PythonSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this PythonSettings to JSON. - * @function toJSON - * @memberof google.api.PythonSettings - * @instance - * @returns {Object.} JSON object - */ - PythonSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PythonSettings - * @function getTypeUrl - * @memberof google.api.PythonSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PythonSettings"; - }; - - return PythonSettings; - })(); - - api.NodeSettings = (function() { - - /** - * Properties of a NodeSettings. - * @memberof google.api - * @interface INodeSettings - * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common - */ - - /** - * Constructs a new NodeSettings. - * @memberof google.api - * @classdesc Represents a NodeSettings. - * @implements INodeSettings - * @constructor - * @param {google.api.INodeSettings=} [properties] Properties to set - */ - function NodeSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NodeSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.NodeSettings - * @instance - */ - NodeSettings.prototype.common = null; - - /** - * Creates a new NodeSettings instance using the specified properties. - * @function create - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings=} [properties] Properties to set - * @returns {google.api.NodeSettings} NodeSettings instance - */ - NodeSettings.create = function create(properties) { - return new NodeSettings(properties); - }; - - /** - * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @function encode - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NodeSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.NodeSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.NodeSettings} NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NodeSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.NodeSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.NodeSettings} NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NodeSettings message. - * @function verify - * @memberof google.api.NodeSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NodeSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.NodeSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.NodeSettings} NodeSettings - */ - NodeSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.NodeSettings) - return object; - var message = new $root.google.api.NodeSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.NodeSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.NodeSettings - * @static - * @param {google.api.NodeSettings} message NodeSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NodeSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this NodeSettings to JSON. - * @function toJSON - * @memberof google.api.NodeSettings - * @instance - * @returns {Object.} JSON object - */ - NodeSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NodeSettings - * @function getTypeUrl - * @memberof google.api.NodeSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.NodeSettings"; - }; - - return NodeSettings; - })(); - - api.DotnetSettings = (function() { - - /** - * Properties of a DotnetSettings. - * @memberof google.api - * @interface IDotnetSettings - * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common - * @property {Object.|null} [renamedServices] DotnetSettings renamedServices - * @property {Object.|null} [renamedResources] DotnetSettings renamedResources - * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources - * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases - * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures - */ - - /** - * Constructs a new DotnetSettings. - * @memberof google.api - * @classdesc Represents a DotnetSettings. - * @implements IDotnetSettings - * @constructor - * @param {google.api.IDotnetSettings=} [properties] Properties to set - */ - function DotnetSettings(properties) { - this.renamedServices = {}; - this.renamedResources = {}; - this.ignoredResources = []; - this.forcedNamespaceAliases = []; - this.handwrittenSignatures = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DotnetSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.common = null; - - /** - * DotnetSettings renamedServices. - * @member {Object.} renamedServices - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedServices = $util.emptyObject; - - /** - * DotnetSettings renamedResources. - * @member {Object.} renamedResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedResources = $util.emptyObject; - - /** - * DotnetSettings ignoredResources. - * @member {Array.} ignoredResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.ignoredResources = $util.emptyArray; - - /** - * DotnetSettings forcedNamespaceAliases. - * @member {Array.} forcedNamespaceAliases - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; - - /** - * DotnetSettings handwrittenSignatures. - * @member {Array.} handwrittenSignatures - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; - - /** - * Creates a new DotnetSettings instance using the specified properties. - * @function create - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings=} [properties] Properties to set - * @returns {google.api.DotnetSettings} DotnetSettings instance - */ - DotnetSettings.create = function create(properties) { - return new DotnetSettings(properties); - }; - - /** - * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @function encode - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DotnetSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) - for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); - if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) - for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); - if (message.ignoredResources != null && message.ignoredResources.length) - for (var i = 0; i < message.ignoredResources.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); - if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); - if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); - return writer; - }; - - /** - * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.DotnetSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.DotnetSettings} DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DotnetSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - case 2: { - if (message.renamedServices === $util.emptyObject) - message.renamedServices = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.renamedServices[key] = value; - break; - } - case 3: { - if (message.renamedResources === $util.emptyObject) - message.renamedResources = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.renamedResources[key] = value; - break; - } - case 4: { - if (!(message.ignoredResources && message.ignoredResources.length)) - message.ignoredResources = []; - message.ignoredResources.push(reader.string()); - break; - } - case 5: { - if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) - message.forcedNamespaceAliases = []; - message.forcedNamespaceAliases.push(reader.string()); - break; - } - case 6: { - if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) - message.handwrittenSignatures = []; - message.handwrittenSignatures.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.DotnetSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.DotnetSettings} DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DotnetSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DotnetSettings message. - * @function verify - * @memberof google.api.DotnetSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DotnetSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { - if (!$util.isObject(message.renamedServices)) - return "renamedServices: object expected"; - var key = Object.keys(message.renamedServices); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedServices[key[i]])) - return "renamedServices: string{k:string} expected"; - } - if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { - if (!$util.isObject(message.renamedResources)) - return "renamedResources: object expected"; - var key = Object.keys(message.renamedResources); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedResources[key[i]])) - return "renamedResources: string{k:string} expected"; - } - if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { - if (!Array.isArray(message.ignoredResources)) - return "ignoredResources: array expected"; - for (var i = 0; i < message.ignoredResources.length; ++i) - if (!$util.isString(message.ignoredResources[i])) - return "ignoredResources: string[] expected"; - } - if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { - if (!Array.isArray(message.forcedNamespaceAliases)) - return "forcedNamespaceAliases: array expected"; - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - if (!$util.isString(message.forcedNamespaceAliases[i])) - return "forcedNamespaceAliases: string[] expected"; - } - if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { - if (!Array.isArray(message.handwrittenSignatures)) - return "handwrittenSignatures: array expected"; - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - if (!$util.isString(message.handwrittenSignatures[i])) - return "handwrittenSignatures: string[] expected"; - } - return null; - }; - - /** - * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.DotnetSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.DotnetSettings} DotnetSettings - */ - DotnetSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.DotnetSettings) - return object; - var message = new $root.google.api.DotnetSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.DotnetSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - if (object.renamedServices) { - if (typeof object.renamedServices !== "object") - throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); - message.renamedServices = {}; - for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) - message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); - } - if (object.renamedResources) { - if (typeof object.renamedResources !== "object") - throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); - message.renamedResources = {}; - for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) - message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); - } - if (object.ignoredResources) { - if (!Array.isArray(object.ignoredResources)) - throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); - message.ignoredResources = []; - for (var i = 0; i < object.ignoredResources.length; ++i) - message.ignoredResources[i] = String(object.ignoredResources[i]); - } - if (object.forcedNamespaceAliases) { - if (!Array.isArray(object.forcedNamespaceAliases)) - throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); - message.forcedNamespaceAliases = []; - for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) - message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); - } - if (object.handwrittenSignatures) { - if (!Array.isArray(object.handwrittenSignatures)) - throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); - message.handwrittenSignatures = []; - for (var i = 0; i < object.handwrittenSignatures.length; ++i) - message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); - } - return message; - }; - - /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.DotnetSettings} message DotnetSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DotnetSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.ignoredResources = []; - object.forcedNamespaceAliases = []; - object.handwrittenSignatures = []; - } - if (options.objects || options.defaults) { - object.renamedServices = {}; - object.renamedResources = {}; - } - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - var keys2; - if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { - object.renamedServices = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; - } - if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { - object.renamedResources = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; - } - if (message.ignoredResources && message.ignoredResources.length) { - object.ignoredResources = []; - for (var j = 0; j < message.ignoredResources.length; ++j) - object.ignoredResources[j] = message.ignoredResources[j]; - } - if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { - object.forcedNamespaceAliases = []; - for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) - object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; - } - if (message.handwrittenSignatures && message.handwrittenSignatures.length) { - object.handwrittenSignatures = []; - for (var j = 0; j < message.handwrittenSignatures.length; ++j) - object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; - } - return object; - }; - - /** - * Converts this DotnetSettings to JSON. - * @function toJSON - * @memberof google.api.DotnetSettings - * @instance - * @returns {Object.} JSON object - */ - DotnetSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DotnetSettings - * @function getTypeUrl - * @memberof google.api.DotnetSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.DotnetSettings"; - }; - - return DotnetSettings; - })(); - - api.RubySettings = (function() { - - /** - * Properties of a RubySettings. - * @memberof google.api - * @interface IRubySettings - * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common - */ - - /** - * Constructs a new RubySettings. - * @memberof google.api - * @classdesc Represents a RubySettings. - * @implements IRubySettings - * @constructor - * @param {google.api.IRubySettings=} [properties] Properties to set - */ - function RubySettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RubySettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.RubySettings - * @instance - */ - RubySettings.prototype.common = null; - - /** - * Creates a new RubySettings instance using the specified properties. - * @function create - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings=} [properties] Properties to set - * @returns {google.api.RubySettings} RubySettings instance - */ - RubySettings.create = function create(properties) { - return new RubySettings(properties); - }; - - /** - * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @function encode - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings} message RubySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RubySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings} message RubySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RubySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RubySettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.RubySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.RubySettings} RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RubySettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RubySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.RubySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.RubySettings} RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RubySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RubySettings message. - * @function verify - * @memberof google.api.RubySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RubySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.RubySettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.RubySettings} RubySettings - */ - RubySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.RubySettings) - return object; - var message = new $root.google.api.RubySettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.RubySettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.RubySettings - * @static - * @param {google.api.RubySettings} message RubySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RubySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this RubySettings to JSON. - * @function toJSON - * @memberof google.api.RubySettings - * @instance - * @returns {Object.} JSON object - */ - RubySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RubySettings - * @function getTypeUrl - * @memberof google.api.RubySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.RubySettings"; - }; - - return RubySettings; - })(); - - api.GoSettings = (function() { - - /** - * Properties of a GoSettings. - * @memberof google.api - * @interface IGoSettings - * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common - */ - - /** - * Constructs a new GoSettings. - * @memberof google.api - * @classdesc Represents a GoSettings. - * @implements IGoSettings - * @constructor - * @param {google.api.IGoSettings=} [properties] Properties to set - */ - function GoSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GoSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.GoSettings - * @instance - */ - GoSettings.prototype.common = null; - - /** - * Creates a new GoSettings instance using the specified properties. - * @function create - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings=} [properties] Properties to set - * @returns {google.api.GoSettings} GoSettings instance - */ - GoSettings.create = function create(properties) { - return new GoSettings(properties); - }; - - /** - * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @function encode - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings} message GoSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings} message GoSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GoSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.GoSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.GoSettings} GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GoSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.GoSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.GoSettings} GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GoSettings message. - * @function verify - * @memberof google.api.GoSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GoSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.GoSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.GoSettings} GoSettings - */ - GoSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.GoSettings) - return object; - var message = new $root.google.api.GoSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.GoSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.GoSettings - * @static - * @param {google.api.GoSettings} message GoSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GoSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this GoSettings to JSON. - * @function toJSON - * @memberof google.api.GoSettings - * @instance - * @returns {Object.} JSON object - */ - GoSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GoSettings - * @function getTypeUrl - * @memberof google.api.GoSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.GoSettings"; - }; - - return GoSettings; - })(); - - api.MethodSettings = (function() { - - /** - * Properties of a MethodSettings. - * @memberof google.api - * @interface IMethodSettings - * @property {string|null} [selector] MethodSettings selector - * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning - * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields - */ - - /** - * Constructs a new MethodSettings. - * @memberof google.api - * @classdesc Represents a MethodSettings. - * @implements IMethodSettings - * @constructor - * @param {google.api.IMethodSettings=} [properties] Properties to set - */ - function MethodSettings(properties) { - this.autoPopulatedFields = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodSettings selector. - * @member {string} selector - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.selector = ""; - - /** - * MethodSettings longRunning. - * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.longRunning = null; - - /** - * MethodSettings autoPopulatedFields. - * @member {Array.} autoPopulatedFields - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; - - /** - * Creates a new MethodSettings instance using the specified properties. - * @function create - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings=} [properties] Properties to set - * @returns {google.api.MethodSettings} MethodSettings instance - */ - MethodSettings.create = function create(properties) { - return new MethodSettings(properties); - }; - - /** - * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @function encode - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) - $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); - return writer; - }; - - /** - * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.MethodSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MethodSettings} MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.selector = reader.string(); - break; - } - case 2: { - message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) - message.autoPopulatedFields = []; - message.autoPopulatedFields.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MethodSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MethodSettings} MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodSettings message. - * @function verify - * @memberof google.api.MethodSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) { - var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); - if (error) - return "longRunning." + error; - } - if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { - if (!Array.isArray(message.autoPopulatedFields)) - return "autoPopulatedFields: array expected"; - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - if (!$util.isString(message.autoPopulatedFields[i])) - return "autoPopulatedFields: string[] expected"; - } - return null; - }; - - /** - * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings} MethodSettings - */ - MethodSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MethodSettings) - return object; - var message = new $root.google.api.MethodSettings(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.longRunning != null) { - if (typeof object.longRunning !== "object") - throw TypeError(".google.api.MethodSettings.longRunning: object expected"); - message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); - } - if (object.autoPopulatedFields) { - if (!Array.isArray(object.autoPopulatedFields)) - throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); - message.autoPopulatedFields = []; - for (var i = 0; i < object.autoPopulatedFields.length; ++i) - message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); - } - return message; - }; - - /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings - * @static - * @param {google.api.MethodSettings} message MethodSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.autoPopulatedFields = []; - if (options.defaults) { - object.selector = ""; - object.longRunning = null; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) - object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); - if (message.autoPopulatedFields && message.autoPopulatedFields.length) { - object.autoPopulatedFields = []; - for (var j = 0; j < message.autoPopulatedFields.length; ++j) - object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; - } - return object; - }; - - /** - * Converts this MethodSettings to JSON. - * @function toJSON - * @memberof google.api.MethodSettings - * @instance - * @returns {Object.} JSON object - */ - MethodSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodSettings - * @function getTypeUrl - * @memberof google.api.MethodSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.MethodSettings"; - }; - - MethodSettings.LongRunning = (function() { - - /** - * Properties of a LongRunning. - * @memberof google.api.MethodSettings - * @interface ILongRunning - * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay - * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier - * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay - * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout - */ - - /** - * Constructs a new LongRunning. - * @memberof google.api.MethodSettings - * @classdesc Represents a LongRunning. - * @implements ILongRunning - * @constructor - * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set - */ - function LongRunning(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LongRunning initialPollDelay. - * @member {google.protobuf.IDuration|null|undefined} initialPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.initialPollDelay = null; - - /** - * LongRunning pollDelayMultiplier. - * @member {number} pollDelayMultiplier - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.pollDelayMultiplier = 0; - - /** - * LongRunning maxPollDelay. - * @member {google.protobuf.IDuration|null|undefined} maxPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.maxPollDelay = null; - - /** - * LongRunning totalPollTimeout. - * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.totalPollTimeout = null; - - /** - * Creates a new LongRunning instance using the specified properties. - * @function create - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set - * @returns {google.api.MethodSettings.LongRunning} LongRunning instance - */ - LongRunning.create = function create(properties) { - return new LongRunning(properties); - }; - - /** - * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @function encode - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LongRunning.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) - $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); - if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) - $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) - $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LongRunning.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LongRunning message from the specified reader or buffer. - * @function decode - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MethodSettings.LongRunning} LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LongRunning.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 2: { - message.pollDelayMultiplier = reader.float(); - break; - } - case 3: { - message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LongRunning message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MethodSettings.LongRunning} LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LongRunning.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LongRunning message. - * @function verify - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LongRunning.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { - var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); - if (error) - return "initialPollDelay." + error; - } - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) - if (typeof message.pollDelayMultiplier !== "number") - return "pollDelayMultiplier: number expected"; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { - var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); - if (error) - return "maxPollDelay." + error; - } - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { - var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); - if (error) - return "totalPollTimeout." + error; - } - return null; - }; - - /** - * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings.LongRunning} LongRunning - */ - LongRunning.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MethodSettings.LongRunning) - return object; - var message = new $root.google.api.MethodSettings.LongRunning(); - if (object.initialPollDelay != null) { - if (typeof object.initialPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); - message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); - } - if (object.pollDelayMultiplier != null) - message.pollDelayMultiplier = Number(object.pollDelayMultiplier); - if (object.maxPollDelay != null) { - if (typeof object.maxPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); - message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); - } - if (object.totalPollTimeout != null) { - if (typeof object.totalPollTimeout !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); - message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); - } - return message; - }; - - /** - * Creates a plain object from a LongRunning message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.LongRunning} message LongRunning - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LongRunning.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.initialPollDelay = null; - object.pollDelayMultiplier = 0; - object.maxPollDelay = null; - object.totalPollTimeout = null; - } - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) - object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) - object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) - object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) - object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); - return object; - }; - - /** - * Converts this LongRunning to JSON. - * @function toJSON - * @memberof google.api.MethodSettings.LongRunning - * @instance - * @returns {Object.} JSON object - */ - LongRunning.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LongRunning - * @function getTypeUrl - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; - }; - - return LongRunning; - })(); - - return MethodSettings; - })(); - - /** - * ClientLibraryOrganization enum. - * @name google.api.ClientLibraryOrganization - * @enum {number} - * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value - * @property {number} CLOUD=1 CLOUD value - * @property {number} ADS=2 ADS value - * @property {number} PHOTOS=3 PHOTOS value - * @property {number} STREET_VIEW=4 STREET_VIEW value - * @property {number} SHOPPING=5 SHOPPING value - * @property {number} GEO=6 GEO value - * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value - */ - api.ClientLibraryOrganization = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; - values[valuesById[1] = "CLOUD"] = 1; - values[valuesById[2] = "ADS"] = 2; - values[valuesById[3] = "PHOTOS"] = 3; - values[valuesById[4] = "STREET_VIEW"] = 4; - values[valuesById[5] = "SHOPPING"] = 5; - values[valuesById[6] = "GEO"] = 6; - values[valuesById[7] = "GENERATIVE_AI"] = 7; - return values; - })(); - - /** - * ClientLibraryDestination enum. - * @name google.api.ClientLibraryDestination - * @enum {number} - * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value - * @property {number} GITHUB=10 GITHUB value - * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value - */ - api.ClientLibraryDestination = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; - values[valuesById[10] = "GITHUB"] = 10; - values[valuesById[20] = "PACKAGE_MANAGER"] = 20; - return values; - })(); - - /** - * LaunchStage enum. - * @name google.api.LaunchStage - * @enum {number} - * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value - * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value - * @property {number} PRELAUNCH=7 PRELAUNCH value - * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value - * @property {number} ALPHA=2 ALPHA value - * @property {number} BETA=3 BETA value - * @property {number} GA=4 GA value - * @property {number} DEPRECATED=5 DEPRECATED value - */ - api.LaunchStage = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; - values[valuesById[6] = "UNIMPLEMENTED"] = 6; - values[valuesById[7] = "PRELAUNCH"] = 7; - values[valuesById[1] = "EARLY_ACCESS"] = 1; - values[valuesById[2] = "ALPHA"] = 2; - values[valuesById[3] = "BETA"] = 3; - values[valuesById[4] = "GA"] = 4; - values[valuesById[5] = "DEPRECATED"] = 5; - return values; - })(); - - /** - * 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.FieldInfo = (function() { - - /** - * Properties of a FieldInfo. - * @memberof google.api - * @interface IFieldInfo - * @property {google.api.FieldInfo.Format|null} [format] FieldInfo format - */ - - /** - * Constructs a new FieldInfo. - * @memberof google.api - * @classdesc Represents a FieldInfo. - * @implements IFieldInfo - * @constructor - * @param {google.api.IFieldInfo=} [properties] Properties to set - */ - function FieldInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldInfo format. - * @member {google.api.FieldInfo.Format} format - * @memberof google.api.FieldInfo - * @instance - */ - FieldInfo.prototype.format = 0; - - /** - * Creates a new FieldInfo instance using the specified properties. - * @function create - * @memberof google.api.FieldInfo - * @static - * @param {google.api.IFieldInfo=} [properties] Properties to set - * @returns {google.api.FieldInfo} FieldInfo instance - */ - FieldInfo.create = function create(properties) { - return new FieldInfo(properties); - }; - - /** - * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @function encode - * @memberof google.api.FieldInfo - * @static - * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.format != null && Object.hasOwnProperty.call(message, "format")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.format); - return writer; - }; - - /** - * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.FieldInfo - * @static - * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldInfo message from the specified reader or buffer. - * @function decode - * @memberof google.api.FieldInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.FieldInfo} FieldInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.FieldInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.format = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.FieldInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.FieldInfo} FieldInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldInfo message. - * @function verify - * @memberof google.api.FieldInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.format != null && message.hasOwnProperty("format")) - switch (message.format) { - default: - return "format: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - return null; - }; - - /** - * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.FieldInfo - * @static - * @param {Object.} object Plain object - * @returns {google.api.FieldInfo} FieldInfo - */ - FieldInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.FieldInfo) - return object; - var message = new $root.google.api.FieldInfo(); - switch (object.format) { - default: - if (typeof object.format === "number") { - message.format = object.format; - break; - } - break; - case "FORMAT_UNSPECIFIED": - case 0: - message.format = 0; - break; - case "UUID4": - case 1: - message.format = 1; - break; - case "IPV4": - case 2: - message.format = 2; - break; - case "IPV6": - case 3: - message.format = 3; - break; - case "IPV4_OR_IPV6": - case 4: - message.format = 4; - break; - } - return message; - }; - - /** - * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.FieldInfo - * @static - * @param {google.api.FieldInfo} message FieldInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.format = options.enums === String ? "FORMAT_UNSPECIFIED" : 0; - if (message.format != null && message.hasOwnProperty("format")) - object.format = options.enums === String ? $root.google.api.FieldInfo.Format[message.format] === undefined ? message.format : $root.google.api.FieldInfo.Format[message.format] : message.format; - return object; - }; - - /** - * Converts this FieldInfo to JSON. - * @function toJSON - * @memberof google.api.FieldInfo - * @instance - * @returns {Object.} JSON object - */ - FieldInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldInfo - * @function getTypeUrl - * @memberof google.api.FieldInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.FieldInfo"; - }; - - /** - * Format enum. - * @name google.api.FieldInfo.Format - * @enum {number} - * @property {number} FORMAT_UNSPECIFIED=0 FORMAT_UNSPECIFIED value - * @property {number} UUID4=1 UUID4 value - * @property {number} IPV4=2 IPV4 value - * @property {number} IPV6=3 IPV6 value - * @property {number} IPV4_OR_IPV6=4 IPV4_OR_IPV6 value - */ - FieldInfo.Format = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FORMAT_UNSPECIFIED"] = 0; - values[valuesById[1] = "UUID4"] = 1; - values[valuesById[2] = "IPV4"] = 2; - values[valuesById[3] = "IPV6"] = 3; - values[valuesById[4] = "IPV4_OR_IPV6"] = 4; - return values; - })(); - - return FieldInfo; - })(); - - api.ResourceDescriptor = (function() { - - /** - * Properties of a ResourceDescriptor. - * @memberof google.api - * @interface IResourceDescriptor - * @property {string|null} [type] ResourceDescriptor type - * @property {Array.|null} [pattern] ResourceDescriptor pattern - * @property {string|null} [nameField] ResourceDescriptor nameField - * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history - * @property {string|null} [plural] ResourceDescriptor plural - * @property {string|null} [singular] ResourceDescriptor singular - * @property {Array.|null} [style] ResourceDescriptor style - */ - - /** - * Constructs a new ResourceDescriptor. - * @memberof google.api - * @classdesc Represents a ResourceDescriptor. - * @implements IResourceDescriptor - * @constructor - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - */ - function ResourceDescriptor(properties) { - this.pattern = []; - this.style = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceDescriptor type. - * @member {string} type - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.type = ""; - - /** - * ResourceDescriptor pattern. - * @member {Array.} pattern - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.pattern = $util.emptyArray; - - /** - * ResourceDescriptor nameField. - * @member {string} nameField - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.nameField = ""; - - /** - * ResourceDescriptor history. - * @member {google.api.ResourceDescriptor.History} history - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.history = 0; - - /** - * ResourceDescriptor plural. - * @member {string} plural - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.plural = ""; - - /** - * ResourceDescriptor singular. - * @member {string} singular - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.singular = ""; - - /** - * ResourceDescriptor style. - * @member {Array.} style - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.style = $util.emptyArray; - - /** - * Creates a new ResourceDescriptor instance using the specified properties. - * @function create - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance - */ - ResourceDescriptor.create = function create(properties) { - return new ResourceDescriptor(properties); - }; - - /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @function encode - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceDescriptor.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.pattern != null && message.pattern.length) - for (var i = 0; i < message.pattern.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); - if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && Object.hasOwnProperty.call(message, "history")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); - if (message.style != null && message.style.length) { - writer.uint32(/* id 10, wireType 2 =*/82).fork(); - for (var i = 0; i < message.style.length; ++i) - writer.int32(message.style[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. - * @function decode - * @memberof google.api.ResourceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceDescriptor.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - if (!(message.pattern && message.pattern.length)) - message.pattern = []; - message.pattern.push(reader.string()); - break; - } - case 3: { - message.nameField = reader.string(); - break; - } - case 4: { - message.history = reader.int32(); - break; - } - case 5: { - message.plural = reader.string(); - break; - } - case 6: { - message.singular = reader.string(); - break; - } - case 10: { - if (!(message.style && message.style.length)) - message.style = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.style.push(reader.int32()); - } else - message.style.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ResourceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceDescriptor message. - * @function verify - * @memberof google.api.ResourceDescriptor - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceDescriptor.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.pattern != null && message.hasOwnProperty("pattern")) { - if (!Array.isArray(message.pattern)) - return "pattern: array expected"; - for (var i = 0; i < message.pattern.length; ++i) - if (!$util.isString(message.pattern[i])) - return "pattern: string[] expected"; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - if (!$util.isString(message.nameField)) - return "nameField: string expected"; - if (message.history != null && message.hasOwnProperty("history")) - switch (message.history) { - default: - return "history: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.plural != null && message.hasOwnProperty("plural")) - if (!$util.isString(message.plural)) - return "plural: string expected"; - if (message.singular != null && message.hasOwnProperty("singular")) - if (!$util.isString(message.singular)) - return "singular: string expected"; - if (message.style != null && message.hasOwnProperty("style")) { - if (!Array.isArray(message.style)) - return "style: array expected"; - for (var i = 0; i < message.style.length; ++i) - switch (message.style[i]) { - default: - return "style: enum value[] expected"; - case 0: - case 1: - break; - } - } - return null; - }; - - /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ResourceDescriptor - * @static - * @param {Object.} object Plain object - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - */ - ResourceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceDescriptor) - return object; - var message = new $root.google.api.ResourceDescriptor(); - if (object.type != null) - message.type = String(object.type); - if (object.pattern) { - if (!Array.isArray(object.pattern)) - throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); - message.pattern = []; - for (var i = 0; i < object.pattern.length; ++i) - message.pattern[i] = String(object.pattern[i]); - } - if (object.nameField != null) - message.nameField = String(object.nameField); - switch (object.history) { - default: - if (typeof object.history === "number") { - message.history = object.history; - break; - } - break; - case "HISTORY_UNSPECIFIED": - case 0: - message.history = 0; - break; - case "ORIGINALLY_SINGLE_PATTERN": - case 1: - message.history = 1; - break; - case "FUTURE_MULTI_PATTERN": - case 2: - message.history = 2; - break; - } - if (object.plural != null) - message.plural = String(object.plural); - if (object.singular != null) - message.singular = String(object.singular); - if (object.style) { - if (!Array.isArray(object.style)) - throw TypeError(".google.api.ResourceDescriptor.style: array expected"); - message.style = []; - for (var i = 0; i < object.style.length; ++i) - switch (object.style[i]) { - default: - if (typeof object.style[i] === "number") { - message.style[i] = object.style[i]; - break; - } - case "STYLE_UNSPECIFIED": - case 0: - message.style[i] = 0; - break; - case "DECLARATIVE_FRIENDLY": - case 1: - message.style[i] = 1; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.ResourceDescriptor} message ResourceDescriptor - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceDescriptor.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.pattern = []; - object.style = []; - } - if (options.defaults) { - object.type = ""; - object.nameField = ""; - object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; - object.plural = ""; - object.singular = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.pattern && message.pattern.length) { - object.pattern = []; - for (var j = 0; j < message.pattern.length; ++j) - object.pattern[j] = message.pattern[j]; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - object.nameField = message.nameField; - if (message.history != null && message.hasOwnProperty("history")) - object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; - if (message.plural != null && message.hasOwnProperty("plural")) - object.plural = message.plural; - if (message.singular != null && message.hasOwnProperty("singular")) - object.singular = message.singular; - if (message.style && message.style.length) { - object.style = []; - for (var j = 0; j < message.style.length; ++j) - object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; - } - return object; - }; - - /** - * Converts this ResourceDescriptor to JSON. - * @function toJSON - * @memberof google.api.ResourceDescriptor - * @instance - * @returns {Object.} JSON object - */ - ResourceDescriptor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceDescriptor - * @function getTypeUrl - * @memberof google.api.ResourceDescriptor - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ResourceDescriptor"; - }; - - /** - * History enum. - * @name google.api.ResourceDescriptor.History - * @enum {number} - * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value - * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value - * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value - */ - ResourceDescriptor.History = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; - values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; - values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; - return values; - })(); - - /** - * Style enum. - * @name google.api.ResourceDescriptor.Style - * @enum {number} - * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value - * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value - */ - ResourceDescriptor.Style = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; - return values; - })(); - - return ResourceDescriptor; - })(); - - api.ResourceReference = (function() { - - /** - * Properties of a ResourceReference. - * @memberof google.api - * @interface IResourceReference - * @property {string|null} [type] ResourceReference type - * @property {string|null} [childType] ResourceReference childType - */ - - /** - * Constructs a new ResourceReference. - * @memberof google.api - * @classdesc Represents a ResourceReference. - * @implements IResourceReference - * @constructor - * @param {google.api.IResourceReference=} [properties] Properties to set - */ - function ResourceReference(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceReference type. - * @member {string} type - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.type = ""; - - /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.childType = ""; - - /** - * Creates a new ResourceReference instance using the specified properties. - * @function create - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference=} [properties] Properties to set - * @returns {google.api.ResourceReference} ResourceReference instance - */ - ResourceReference.create = function create(properties) { - return new ResourceReference(properties); - }; - - /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @function encode - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceReference.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); - return writer; - }; - - /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceReference message from the specified reader or buffer. - * @function decode - * @memberof google.api.ResourceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceReference} ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceReference.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - message.childType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ResourceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceReference} ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceReference.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceReference message. - * @function verify - * @memberof google.api.ResourceReference - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceReference.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.childType != null && message.hasOwnProperty("childType")) - if (!$util.isString(message.childType)) - return "childType: string expected"; - return null; - }; - - /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ResourceReference - * @static - * @param {Object.} object Plain object - * @returns {google.api.ResourceReference} ResourceReference - */ - ResourceReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceReference) - return object; - var message = new $root.google.api.ResourceReference(); - if (object.type != null) - message.type = String(object.type); - if (object.childType != null) - message.childType = String(object.childType); - return message; - }; - - /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ResourceReference - * @static - * @param {google.api.ResourceReference} message ResourceReference - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceReference.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = ""; - object.childType = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.childType != null && message.hasOwnProperty("childType")) - object.childType = message.childType; - return object; - }; - - /** - * Converts this ResourceReference to JSON. - * @function toJSON - * @memberof google.api.ResourceReference - * @instance - * @returns {Object.} JSON object - */ - ResourceReference.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceReference - * @function getTypeUrl - * @memberof google.api.ResourceReference - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ResourceReference"; - }; - - return ResourceReference; - })(); - - return api; - })(); - - google.protobuf = (function() { - - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - var protobuf = {}; - - protobuf.FileDescriptorSet = (function() { - - /** - * Properties of a FileDescriptorSet. - * @memberof google.protobuf - * @interface IFileDescriptorSet - * @property {Array.|null} [file] FileDescriptorSet file - */ - - /** - * Constructs a new FileDescriptorSet. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorSet. - * @implements IFileDescriptorSet - * @constructor - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - */ - function FileDescriptorSet(properties) { - this.file = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorSet file. - * @member {Array.} file - * @memberof google.protobuf.FileDescriptorSet - * @instance - */ - FileDescriptorSet.prototype.file = $util.emptyArray; - - /** - * Creates a new FileDescriptorSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance - */ - FileDescriptorSet.create = function create(properties) { - return new FileDescriptorSet(properties); - }; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.file != null && message.file.length) - for (var i = 0; i < message.file.length; ++i) - $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.file && message.file.length)) - message.file = []; - message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorSet message. - * @function verify - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.file != null && message.hasOwnProperty("file")) { - if (!Array.isArray(message.file)) - return "file: array expected"; - for (var i = 0; i < message.file.length; ++i) { - var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); - if (error) - return "file." + error; - } - } - return null; - }; - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - */ - FileDescriptorSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorSet) - return object; - var message = new $root.google.protobuf.FileDescriptorSet(); - if (object.file) { - if (!Array.isArray(object.file)) - throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); - message.file = []; - for (var i = 0; i < object.file.length; ++i) { - if (typeof object.file[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); - message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.file = []; - if (message.file && message.file.length) { - object.file = []; - for (var j = 0; j < message.file.length; ++j) - object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); - } - return object; - }; - - /** - * Converts this FileDescriptorSet to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorSet - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorSet - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; - }; - - return FileDescriptorSet; - })(); - - /** - * Edition enum. - * @name google.protobuf.Edition - * @enum {number} - * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value - * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value - * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value - * @property {number} EDITION_2023=1000 EDITION_2023 value - * @property {number} EDITION_2024=1001 EDITION_2024 value - * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value - * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value - * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value - * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value - * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value - * @property {number} EDITION_MAX=2147483647 EDITION_MAX value - */ - protobuf.Edition = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EDITION_UNKNOWN"] = 0; - values[valuesById[998] = "EDITION_PROTO2"] = 998; - values[valuesById[999] = "EDITION_PROTO3"] = 999; - values[valuesById[1000] = "EDITION_2023"] = 1000; - values[valuesById[1001] = "EDITION_2024"] = 1001; - values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; - values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; - values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; - values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; - values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; - values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; - return values; - })(); - - protobuf.FileDescriptorProto = (function() { - - /** - * Properties of a FileDescriptorProto. - * @memberof google.protobuf - * @interface IFileDescriptorProto - * @property {string|null} [name] FileDescriptorProto name - * @property {string|null} ["package"] FileDescriptorProto package - * @property {Array.|null} [dependency] FileDescriptorProto dependency - * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency - * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency - * @property {Array.|null} [messageType] FileDescriptorProto messageType - * @property {Array.|null} [enumType] FileDescriptorProto enumType - * @property {Array.|null} [service] FileDescriptorProto service - * @property {Array.|null} [extension] FileDescriptorProto extension - * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options - * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo - * @property {string|null} [syntax] FileDescriptorProto syntax - * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition - */ - - /** - * Constructs a new FileDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorProto. - * @implements IFileDescriptorProto - * @constructor - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - */ - function FileDescriptorProto(properties) { - this.dependency = []; - this.publicDependency = []; - this.weakDependency = []; - this.messageType = []; - this.enumType = []; - this.service = []; - this.extension = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.name = ""; - - /** - * FileDescriptorProto package. - * @member {string} package - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype["package"] = ""; - - /** - * FileDescriptorProto dependency. - * @member {Array.} dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.dependency = $util.emptyArray; - - /** - * FileDescriptorProto publicDependency. - * @member {Array.} publicDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.publicDependency = $util.emptyArray; - - /** - * FileDescriptorProto weakDependency. - * @member {Array.} weakDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.weakDependency = $util.emptyArray; - - /** - * FileDescriptorProto messageType. - * @member {Array.} messageType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.messageType = $util.emptyArray; - - /** - * FileDescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * FileDescriptorProto service. - * @member {Array.} service - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.service = $util.emptyArray; - - /** - * FileDescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.extension = $util.emptyArray; - - /** - * FileDescriptorProto options. - * @member {google.protobuf.IFileOptions|null|undefined} options - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.options = null; - - /** - * FileDescriptorProto sourceCodeInfo. - * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.sourceCodeInfo = null; - - /** - * FileDescriptorProto syntax. - * @member {string} syntax - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.syntax = ""; - - /** - * FileDescriptorProto edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.edition = 0; - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance - */ - FileDescriptorProto.create = function create(properties) { - return new FileDescriptorProto(properties); - }; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); - if (message.dependency != null && message.dependency.length) - for (var i = 0; i < message.dependency.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); - if (message.messageType != null && message.messageType.length) - for (var i = 0; i < message.messageType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.service != null && message.service.length) - for (var i = 0; i < message.service.length; ++i) - $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) - $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.publicDependency != null && message.publicDependency.length) - for (var i = 0; i < message.publicDependency.length; ++i) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); - if (message.weakDependency != null && message.weakDependency.length) - for (var i = 0; i < message.weakDependency.length; ++i) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); - if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message["package"] = reader.string(); - break; - } - case 3: { - if (!(message.dependency && message.dependency.length)) - message.dependency = []; - message.dependency.push(reader.string()); - break; - } - case 10: { - if (!(message.publicDependency && message.publicDependency.length)) - message.publicDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.publicDependency.push(reader.int32()); - } else - message.publicDependency.push(reader.int32()); - break; - } - case 11: { - if (!(message.weakDependency && message.weakDependency.length)) - message.weakDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.weakDependency.push(reader.int32()); - } else - message.weakDependency.push(reader.int32()); - break; - } - case 4: { - if (!(message.messageType && message.messageType.length)) - message.messageType = []; - message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.service && message.service.length)) - message.service = []; - message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 7: { - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 8: { - message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); - break; - } - case 12: { - message.syntax = reader.string(); - break; - } - case 14: { - message.edition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorProto message. - * @function verify - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message["package"] != null && message.hasOwnProperty("package")) - if (!$util.isString(message["package"])) - return "package: string expected"; - if (message.dependency != null && message.hasOwnProperty("dependency")) { - if (!Array.isArray(message.dependency)) - return "dependency: array expected"; - for (var i = 0; i < message.dependency.length; ++i) - if (!$util.isString(message.dependency[i])) - return "dependency: string[] expected"; - } - if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { - if (!Array.isArray(message.publicDependency)) - return "publicDependency: array expected"; - for (var i = 0; i < message.publicDependency.length; ++i) - if (!$util.isInteger(message.publicDependency[i])) - return "publicDependency: integer[] expected"; - } - if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { - if (!Array.isArray(message.weakDependency)) - return "weakDependency: array expected"; - for (var i = 0; i < message.weakDependency.length; ++i) - if (!$util.isInteger(message.weakDependency[i])) - return "weakDependency: integer[] expected"; - } - if (message.messageType != null && message.hasOwnProperty("messageType")) { - if (!Array.isArray(message.messageType)) - return "messageType: array expected"; - for (var i = 0; i < message.messageType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); - if (error) - return "messageType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.service != null && message.hasOwnProperty("service")) { - if (!Array.isArray(message.service)) - return "service: array expected"; - for (var i = 0; i < message.service.length; ++i) { - var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); - if (error) - return "service." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FileOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { - var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); - if (error) - return "sourceCodeInfo." + error; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - if (!$util.isString(message.syntax)) - return "syntax: string expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - */ - FileDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorProto) - return object; - var message = new $root.google.protobuf.FileDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object["package"] != null) - message["package"] = String(object["package"]); - if (object.dependency) { - if (!Array.isArray(object.dependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); - message.dependency = []; - for (var i = 0; i < object.dependency.length; ++i) - message.dependency[i] = String(object.dependency[i]); - } - if (object.publicDependency) { - if (!Array.isArray(object.publicDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); - message.publicDependency = []; - for (var i = 0; i < object.publicDependency.length; ++i) - message.publicDependency[i] = object.publicDependency[i] | 0; - } - if (object.weakDependency) { - if (!Array.isArray(object.weakDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); - message.weakDependency = []; - for (var i = 0; i < object.weakDependency.length; ++i) - message.weakDependency[i] = object.weakDependency[i] | 0; - } - if (object.messageType) { - if (!Array.isArray(object.messageType)) - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); - message.messageType = []; - for (var i = 0; i < object.messageType.length; ++i) { - if (typeof object.messageType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); - message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.service) { - if (!Array.isArray(object.service)) - throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); - message.service = []; - for (var i = 0; i < object.service.length; ++i) { - if (typeof object.service[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); - message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FileOptions.fromObject(object.options); - } - if (object.sourceCodeInfo != null) { - if (typeof object.sourceCodeInfo !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); - } - if (object.syntax != null) - message.syntax = String(object.syntax); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.dependency = []; - object.messageType = []; - object.enumType = []; - object.service = []; - object.extension = []; - object.publicDependency = []; - object.weakDependency = []; - } - if (options.defaults) { - object.name = ""; - object["package"] = ""; - object.options = null; - object.sourceCodeInfo = null; - object.syntax = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message["package"] != null && message.hasOwnProperty("package")) - object["package"] = message["package"]; - if (message.dependency && message.dependency.length) { - object.dependency = []; - for (var j = 0; j < message.dependency.length; ++j) - object.dependency[j] = message.dependency[j]; - } - if (message.messageType && message.messageType.length) { - object.messageType = []; - for (var j = 0; j < message.messageType.length; ++j) - object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.service && message.service.length) { - object.service = []; - for (var j = 0; j < message.service.length; ++j) - object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) - object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); - if (message.publicDependency && message.publicDependency.length) { - object.publicDependency = []; - for (var j = 0; j < message.publicDependency.length; ++j) - object.publicDependency[j] = message.publicDependency[j]; - } - if (message.weakDependency && message.weakDependency.length) { - object.weakDependency = []; - for (var j = 0; j < message.weakDependency.length; ++j) - object.weakDependency[j] = message.weakDependency[j]; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - object.syntax = message.syntax; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this FileDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; - }; - - return FileDescriptorProto; - })(); - - protobuf.DescriptorProto = (function() { - - /** - * Properties of a DescriptorProto. - * @memberof google.protobuf - * @interface IDescriptorProto - * @property {string|null} [name] DescriptorProto name - * @property {Array.|null} [field] DescriptorProto field - * @property {Array.|null} [extension] DescriptorProto extension - * @property {Array.|null} [nestedType] DescriptorProto nestedType - * @property {Array.|null} [enumType] DescriptorProto enumType - * @property {Array.|null} [extensionRange] DescriptorProto extensionRange - * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl - * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options - * @property {Array.|null} [reservedRange] DescriptorProto reservedRange - * @property {Array.|null} [reservedName] DescriptorProto reservedName - */ - - /** - * Constructs a new DescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a DescriptorProto. - * @implements IDescriptorProto - * @constructor - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - */ - function DescriptorProto(properties) { - this.field = []; - this.extension = []; - this.nestedType = []; - this.enumType = []; - this.extensionRange = []; - this.oneofDecl = []; - this.reservedRange = []; - this.reservedName = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DescriptorProto name. - * @member {string} name - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.name = ""; - - /** - * DescriptorProto field. - * @member {Array.} field - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.field = $util.emptyArray; - - /** - * DescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extension = $util.emptyArray; - - /** - * DescriptorProto nestedType. - * @member {Array.} nestedType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.nestedType = $util.emptyArray; - - /** - * DescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * DescriptorProto extensionRange. - * @member {Array.} extensionRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extensionRange = $util.emptyArray; - - /** - * DescriptorProto oneofDecl. - * @member {Array.} oneofDecl - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.oneofDecl = $util.emptyArray; - - /** - * DescriptorProto options. - * @member {google.protobuf.IMessageOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.options = null; - - /** - * DescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * DescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto} DescriptorProto instance - */ - DescriptorProto.create = function create(properties) { - return new DescriptorProto(properties); - }; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.field != null && message.field.length) - for (var i = 0; i < message.field.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nestedType != null && message.nestedType.length) - for (var i = 0; i < message.nestedType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.extensionRange != null && message.extensionRange.length) - for (var i = 0; i < message.extensionRange.length; ++i) - $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.oneofDecl != null && message.oneofDecl.length) - for (var i = 0; i < message.oneofDecl.length; ++i) - $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); - return writer; - }; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.field && message.field.length)) - message.field = []; - message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.nestedType && message.nestedType.length)) - message.nestedType = []; - message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - } - case 4: { - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.extensionRange && message.extensionRange.length)) - message.extensionRange = []; - message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); - break; - } - case 8: { - if (!(message.oneofDecl && message.oneofDecl.length)) - message.oneofDecl = []; - message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 7: { - message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); - break; - } - case 10: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DescriptorProto message. - * @function verify - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.field != null && message.hasOwnProperty("field")) { - if (!Array.isArray(message.field)) - return "field: array expected"; - for (var i = 0; i < message.field.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); - if (error) - return "field." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.nestedType != null && message.hasOwnProperty("nestedType")) { - if (!Array.isArray(message.nestedType)) - return "nestedType: array expected"; - for (var i = 0; i < message.nestedType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); - if (error) - return "nestedType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { - if (!Array.isArray(message.extensionRange)) - return "extensionRange: array expected"; - for (var i = 0; i < message.extensionRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); - if (error) - return "extensionRange." + error; - } - } - if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { - if (!Array.isArray(message.oneofDecl)) - return "oneofDecl: array expected"; - for (var i = 0; i < message.oneofDecl.length; ++i) { - var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); - if (error) - return "oneofDecl." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MessageOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto} DescriptorProto - */ - DescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto) - return object; - var message = new $root.google.protobuf.DescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.field) { - if (!Array.isArray(object.field)) - throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); - message.field = []; - for (var i = 0; i < object.field.length; ++i) { - if (typeof object.field[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); - message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.nestedType) { - if (!Array.isArray(object.nestedType)) - throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); - message.nestedType = []; - for (var i = 0; i < object.nestedType.length; ++i) { - if (typeof object.nestedType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); - message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.extensionRange) { - if (!Array.isArray(object.extensionRange)) - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); - message.extensionRange = []; - for (var i = 0; i < object.extensionRange.length; ++i) { - if (typeof object.extensionRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); - message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); - } - } - if (object.oneofDecl) { - if (!Array.isArray(object.oneofDecl)) - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); - message.oneofDecl = []; - for (var i = 0; i < object.oneofDecl.length; ++i) { - if (typeof object.oneofDecl[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); - message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.DescriptorProto} message DescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.field = []; - object.nestedType = []; - object.enumType = []; - object.extensionRange = []; - object.extension = []; - object.oneofDecl = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.field && message.field.length) { - object.field = []; - for (var j = 0; j < message.field.length; ++j) - object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); - } - if (message.nestedType && message.nestedType.length) { - object.nestedType = []; - for (var j = 0; j < message.nestedType.length; ++j) - object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.extensionRange && message.extensionRange.length) { - object.extensionRange = []; - for (var j = 0; j < message.extensionRange.length; ++j) - object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); - if (message.oneofDecl && message.oneofDecl.length) { - object.oneofDecl = []; - for (var j = 0; j < message.oneofDecl.length; ++j) - object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); - } - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this DescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto - * @instance - * @returns {Object.} JSON object - */ - DescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto"; - }; - - DescriptorProto.ExtensionRange = (function() { - - /** - * Properties of an ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @interface IExtensionRange - * @property {number|null} [start] ExtensionRange start - * @property {number|null} [end] ExtensionRange end - * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options - */ - - /** - * Constructs a new ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents an ExtensionRange. - * @implements IExtensionRange - * @constructor - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - */ - function ExtensionRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.start = 0; - - /** - * ExtensionRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.end = 0; - - /** - * ExtensionRange options. - * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.options = null; - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance - */ - ExtensionRange.create = function create(properties) { - return new ExtensionRange(properties); - }; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - case 3: { - message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - */ - ExtensionRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); - message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - object.options = null; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ExtensionRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - * @returns {Object.} JSON object - */ - ExtensionRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; - }; - - return ExtensionRange; - })(); - - DescriptorProto.ReservedRange = (function() { - - /** - * Properties of a ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @interface IReservedRange - * @property {number|null} [start] ReservedRange start - * @property {number|null} [end] ReservedRange end - */ - - /** - * Constructs a new ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents a ReservedRange. - * @implements IReservedRange - * @constructor - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - */ - function ReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReservedRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.start = 0; - - /** - * ReservedRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.end = 0; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance - */ - ReservedRange.create = function create(properties) { - return new ReservedRange(properties); - }; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReservedRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - */ - ReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this ReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - * @returns {Object.} JSON object - */ - ReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReservedRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; - }; - - return ReservedRange; - })(); - - return DescriptorProto; - })(); - - protobuf.ExtensionRangeOptions = (function() { - - /** - * Properties of an ExtensionRangeOptions. - * @memberof google.protobuf - * @interface IExtensionRangeOptions - * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption - * @property {Array.|null} [declaration] ExtensionRangeOptions declaration - * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features - * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification - */ - - /** - * Constructs a new ExtensionRangeOptions. - * @memberof google.protobuf - * @classdesc Represents an ExtensionRangeOptions. - * @implements IExtensionRangeOptions - * @constructor - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - */ - function ExtensionRangeOptions(properties) { - this.uninterpretedOption = []; - this.declaration = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRangeOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ExtensionRangeOptions declaration. - * @member {Array.} declaration - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.declaration = $util.emptyArray; - - /** - * ExtensionRangeOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.features = null; - - /** - * ExtensionRangeOptions verification. - * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.verification = 1; - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance - */ - ExtensionRangeOptions.create = function create(properties) { - return new ExtensionRangeOptions(properties); - }; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.declaration != null && message.declaration.length) - for (var i = 0; i < message.declaration.length; ++i) - $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.declaration && message.declaration.length)) - message.declaration = []; - message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); - break; - } - case 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.verification = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRangeOptions message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRangeOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message.declaration != null && message.hasOwnProperty("declaration")) { - if (!Array.isArray(message.declaration)) - return "declaration: array expected"; - for (var i = 0; i < message.declaration.length; ++i) { - var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); - if (error) - return "declaration." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.verification != null && message.hasOwnProperty("verification")) - switch (message.verification) { - default: - return "verification: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - */ - ExtensionRangeOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions(); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object.declaration) { - if (!Array.isArray(object.declaration)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); - message.declaration = []; - for (var i = 0; i < object.declaration.length; ++i) { - if (typeof object.declaration[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); - message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - switch (object.verification) { - case "DECLARATION": - case 0: - message.verification = 0; - break; - default: - if (typeof object.verification === "number") { - message.verification = object.verification; - break; - } - break; - case "UNVERIFIED": - case 1: - message.verification = 1; - break; - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRangeOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.declaration = []; - object.uninterpretedOption = []; - } - if (options.defaults) { - object.verification = options.enums === String ? "UNVERIFIED" : 1; - object.features = null; - } - if (message.declaration && message.declaration.length) { - object.declaration = []; - for (var j = 0; j < message.declaration.length; ++j) - object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); - } - if (message.verification != null && message.hasOwnProperty("verification")) - object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - * @returns {Object.} JSON object - */ - ExtensionRangeOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; - }; - - ExtensionRangeOptions.Declaration = (function() { - - /** - * Properties of a Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @interface IDeclaration - * @property {number|null} [number] Declaration number - * @property {string|null} [fullName] Declaration fullName - * @property {string|null} [type] Declaration type - * @property {boolean|null} [reserved] Declaration reserved - * @property {boolean|null} [repeated] Declaration repeated - */ - - /** - * Constructs a new Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @classdesc Represents a Declaration. - * @implements IDeclaration - * @constructor - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - */ - function Declaration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Declaration number. - * @member {number} number - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.number = 0; - - /** - * Declaration fullName. - * @member {string} fullName - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.fullName = ""; - - /** - * Declaration type. - * @member {string} type - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.type = ""; - - /** - * Declaration reserved. - * @member {boolean} reserved - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.reserved = false; - - /** - * Declaration repeated. - * @member {boolean} repeated - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.repeated = false; - - /** - * Creates a new Declaration instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance - */ - Declaration.create = function create(properties) { - return new Declaration(properties); - }; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); - if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); - if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); - if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); - return writer; - }; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.number = reader.int32(); - break; - } - case 2: { - message.fullName = reader.string(); - break; - } - case 3: { - message.type = reader.string(); - break; - } - case 5: { - message.reserved = reader.bool(); - break; - } - case 6: { - message.repeated = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Declaration message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Declaration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.fullName != null && message.hasOwnProperty("fullName")) - if (!$util.isString(message.fullName)) - return "fullName: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.reserved != null && message.hasOwnProperty("reserved")) - if (typeof message.reserved !== "boolean") - return "reserved: boolean expected"; - if (message.repeated != null && message.hasOwnProperty("repeated")) - if (typeof message.repeated !== "boolean") - return "repeated: boolean expected"; - return null; - }; - - /** - * Creates a Declaration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - */ - Declaration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - if (object.number != null) - message.number = object.number | 0; - if (object.fullName != null) - message.fullName = String(object.fullName); - if (object.type != null) - message.type = String(object.type); - if (object.reserved != null) - message.reserved = Boolean(object.reserved); - if (object.repeated != null) - message.repeated = Boolean(object.repeated); - return message; - }; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Declaration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.number = 0; - object.fullName = ""; - object.type = ""; - object.reserved = false; - object.repeated = false; - } - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.fullName != null && message.hasOwnProperty("fullName")) - object.fullName = message.fullName; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.reserved != null && message.hasOwnProperty("reserved")) - object.reserved = message.reserved; - if (message.repeated != null && message.hasOwnProperty("repeated")) - object.repeated = message.repeated; - return object; - }; - - /** - * Converts this Declaration to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - * @returns {Object.} JSON object - */ - Declaration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Declaration - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; - }; - - return Declaration; - })(); - - /** - * VerificationState enum. - * @name google.protobuf.ExtensionRangeOptions.VerificationState - * @enum {number} - * @property {number} DECLARATION=0 DECLARATION value - * @property {number} UNVERIFIED=1 UNVERIFIED value - */ - ExtensionRangeOptions.VerificationState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DECLARATION"] = 0; - values[valuesById[1] = "UNVERIFIED"] = 1; - return values; - })(); - - return ExtensionRangeOptions; - })(); - - protobuf.FieldDescriptorProto = (function() { - - /** - * Properties of a FieldDescriptorProto. - * @memberof google.protobuf - * @interface IFieldDescriptorProto - * @property {string|null} [name] FieldDescriptorProto name - * @property {number|null} [number] FieldDescriptorProto number - * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label - * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type - * @property {string|null} [typeName] FieldDescriptorProto typeName - * @property {string|null} [extendee] FieldDescriptorProto extendee - * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue - * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex - * @property {string|null} [jsonName] FieldDescriptorProto jsonName - * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options - * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional - */ - - /** - * Constructs a new FieldDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FieldDescriptorProto. - * @implements IFieldDescriptorProto - * @constructor - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - */ - function FieldDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.name = ""; - - /** - * FieldDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.number = 0; - - /** - * FieldDescriptorProto label. - * @member {google.protobuf.FieldDescriptorProto.Label} label - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.label = 1; - - /** - * FieldDescriptorProto type. - * @member {google.protobuf.FieldDescriptorProto.Type} type - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.type = 1; - - /** - * FieldDescriptorProto typeName. - * @member {string} typeName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.typeName = ""; - - /** - * FieldDescriptorProto extendee. - * @member {string} extendee - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.extendee = ""; - - /** - * FieldDescriptorProto defaultValue. - * @member {string} defaultValue - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.defaultValue = ""; - - /** - * FieldDescriptorProto oneofIndex. - * @member {number} oneofIndex - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.oneofIndex = 0; - - /** - * FieldDescriptorProto jsonName. - * @member {string} jsonName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.jsonName = ""; - - /** - * FieldDescriptorProto options. - * @member {google.protobuf.IFieldOptions|null|undefined} options - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.options = null; - - /** - * FieldDescriptorProto proto3Optional. - * @member {boolean} proto3Optional - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.proto3Optional = false; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance - */ - FieldDescriptorProto.create = function create(properties) { - return new FieldDescriptorProto(properties); - }; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && Object.hasOwnProperty.call(message, "label")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); - if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); - if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); - if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); - return writer; - }; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.number = reader.int32(); - break; - } - case 4: { - message.label = reader.int32(); - break; - } - case 5: { - message.type = reader.int32(); - break; - } - case 6: { - message.typeName = reader.string(); - break; - } - case 2: { - message.extendee = reader.string(); - break; - } - case 7: { - message.defaultValue = reader.string(); - break; - } - case 9: { - message.oneofIndex = reader.int32(); - break; - } - case 10: { - message.jsonName = reader.string(); - break; - } - case 8: { - message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); - break; - } - case 17: { - message.proto3Optional = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldDescriptorProto message. - * @function verify - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.label != null && message.hasOwnProperty("label")) - switch (message.label) { - default: - return "label: enum value expected"; - case 1: - case 3: - case 2: - break; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - break; - } - if (message.typeName != null && message.hasOwnProperty("typeName")) - if (!$util.isString(message.typeName)) - return "typeName: string expected"; - if (message.extendee != null && message.hasOwnProperty("extendee")) - if (!$util.isString(message.extendee)) - return "extendee: string expected"; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - if (!$util.isString(message.defaultValue)) - return "defaultValue: string expected"; - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - if (!$util.isInteger(message.oneofIndex)) - return "oneofIndex: integer expected"; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - if (!$util.isString(message.jsonName)) - return "jsonName: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FieldOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - if (typeof message.proto3Optional !== "boolean") - return "proto3Optional: boolean expected"; - return null; - }; - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - */ - FieldDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldDescriptorProto) - return object; - var message = new $root.google.protobuf.FieldDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - switch (object.label) { - default: - if (typeof object.label === "number") { - message.label = object.label; - break; - } - break; - case "LABEL_OPTIONAL": - case 1: - message.label = 1; - break; - case "LABEL_REPEATED": - case 3: - message.label = 3; - break; - case "LABEL_REQUIRED": - case 2: - message.label = 2; - break; - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_DOUBLE": - case 1: - message.type = 1; - break; - case "TYPE_FLOAT": - case 2: - message.type = 2; - break; - case "TYPE_INT64": - case 3: - message.type = 3; - break; - case "TYPE_UINT64": - case 4: - message.type = 4; - break; - case "TYPE_INT32": - case 5: - message.type = 5; - break; - case "TYPE_FIXED64": - case 6: - message.type = 6; - break; - case "TYPE_FIXED32": - case 7: - message.type = 7; - break; - case "TYPE_BOOL": - case 8: - message.type = 8; - break; - case "TYPE_STRING": - case 9: - message.type = 9; - break; - case "TYPE_GROUP": - case 10: - message.type = 10; - break; - case "TYPE_MESSAGE": - case 11: - message.type = 11; - break; - case "TYPE_BYTES": - case 12: - message.type = 12; - break; - case "TYPE_UINT32": - case 13: - message.type = 13; - break; - case "TYPE_ENUM": - case 14: - message.type = 14; - break; - case "TYPE_SFIXED32": - case 15: - message.type = 15; - break; - case "TYPE_SFIXED64": - case 16: - message.type = 16; - break; - case "TYPE_SINT32": - case 17: - message.type = 17; - break; - case "TYPE_SINT64": - case 18: - message.type = 18; - break; - } - if (object.typeName != null) - message.typeName = String(object.typeName); - if (object.extendee != null) - message.extendee = String(object.extendee); - if (object.defaultValue != null) - message.defaultValue = String(object.defaultValue); - if (object.oneofIndex != null) - message.oneofIndex = object.oneofIndex | 0; - if (object.jsonName != null) - message.jsonName = String(object.jsonName); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); - } - if (object.proto3Optional != null) - message.proto3Optional = Boolean(object.proto3Optional); - return message; - }; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.extendee = ""; - object.number = 0; - object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; - object.type = options.enums === String ? "TYPE_DOUBLE" : 1; - object.typeName = ""; - object.defaultValue = ""; - object.options = null; - object.oneofIndex = 0; - object.jsonName = ""; - object.proto3Optional = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.extendee != null && message.hasOwnProperty("extendee")) - object.extendee = message.extendee; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.label != null && message.hasOwnProperty("label")) - object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; - if (message.typeName != null && message.hasOwnProperty("typeName")) - object.typeName = message.typeName; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - object.defaultValue = message.defaultValue; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - object.oneofIndex = message.oneofIndex; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - object.jsonName = message.jsonName; - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - object.proto3Optional = message.proto3Optional; - return object; - }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FieldDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FieldDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; - }; - - /** - * Type enum. - * @name google.protobuf.FieldDescriptorProto.Type - * @enum {number} - * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value - * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value - * @property {number} TYPE_INT64=3 TYPE_INT64 value - * @property {number} TYPE_UINT64=4 TYPE_UINT64 value - * @property {number} TYPE_INT32=5 TYPE_INT32 value - * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value - * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value - * @property {number} TYPE_BOOL=8 TYPE_BOOL value - * @property {number} TYPE_STRING=9 TYPE_STRING value - * @property {number} TYPE_GROUP=10 TYPE_GROUP value - * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value - * @property {number} TYPE_BYTES=12 TYPE_BYTES value - * @property {number} TYPE_UINT32=13 TYPE_UINT32 value - * @property {number} TYPE_ENUM=14 TYPE_ENUM value - * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value - * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value - * @property {number} TYPE_SINT32=17 TYPE_SINT32 value - * @property {number} TYPE_SINT64=18 TYPE_SINT64 value - */ - FieldDescriptorProto.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "TYPE_DOUBLE"] = 1; - values[valuesById[2] = "TYPE_FLOAT"] = 2; - values[valuesById[3] = "TYPE_INT64"] = 3; - values[valuesById[4] = "TYPE_UINT64"] = 4; - values[valuesById[5] = "TYPE_INT32"] = 5; - values[valuesById[6] = "TYPE_FIXED64"] = 6; - values[valuesById[7] = "TYPE_FIXED32"] = 7; - values[valuesById[8] = "TYPE_BOOL"] = 8; - values[valuesById[9] = "TYPE_STRING"] = 9; - values[valuesById[10] = "TYPE_GROUP"] = 10; - values[valuesById[11] = "TYPE_MESSAGE"] = 11; - values[valuesById[12] = "TYPE_BYTES"] = 12; - values[valuesById[13] = "TYPE_UINT32"] = 13; - values[valuesById[14] = "TYPE_ENUM"] = 14; - values[valuesById[15] = "TYPE_SFIXED32"] = 15; - values[valuesById[16] = "TYPE_SFIXED64"] = 16; - values[valuesById[17] = "TYPE_SINT32"] = 17; - values[valuesById[18] = "TYPE_SINT64"] = 18; - return values; - })(); - - /** - * Label enum. - * @name google.protobuf.FieldDescriptorProto.Label - * @enum {number} - * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value - * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value - * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value - */ - FieldDescriptorProto.Label = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "LABEL_OPTIONAL"] = 1; - values[valuesById[3] = "LABEL_REPEATED"] = 3; - values[valuesById[2] = "LABEL_REQUIRED"] = 2; - return values; - })(); - - return FieldDescriptorProto; - })(); - - protobuf.OneofDescriptorProto = (function() { - - /** - * Properties of an OneofDescriptorProto. - * @memberof google.protobuf - * @interface IOneofDescriptorProto - * @property {string|null} [name] OneofDescriptorProto name - * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options - */ - - /** - * Constructs a new OneofDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an OneofDescriptorProto. - * @implements IOneofDescriptorProto - * @constructor - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - */ - function OneofDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.name = ""; - - /** - * OneofDescriptorProto options. - * @member {google.protobuf.IOneofOptions|null|undefined} options - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.options = null; - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance - */ - OneofDescriptorProto.create = function create(properties) { - return new OneofDescriptorProto(properties); - }; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofDescriptorProto message. - * @function verify - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.OneofOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - */ - OneofDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofDescriptorProto) - return object; - var message = new $root.google.protobuf.OneofDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.OneofDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - OneofDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; - }; - - return OneofDescriptorProto; - })(); - - protobuf.EnumDescriptorProto = (function() { - - /** - * Properties of an EnumDescriptorProto. - * @memberof google.protobuf - * @interface IEnumDescriptorProto - * @property {string|null} [name] EnumDescriptorProto name - * @property {Array.|null} [value] EnumDescriptorProto value - * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options - * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange - * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName - */ - - /** - * Constructs a new EnumDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumDescriptorProto. - * @implements IEnumDescriptorProto - * @constructor - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - */ - function EnumDescriptorProto(properties) { - this.value = []; - this.reservedRange = []; - this.reservedName = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.name = ""; - - /** - * EnumDescriptorProto value. - * @member {Array.} value - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.value = $util.emptyArray; - - /** - * EnumDescriptorProto options. - * @member {google.protobuf.IEnumOptions|null|undefined} options - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.options = null; - - /** - * EnumDescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * EnumDescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance - */ - EnumDescriptorProto.create = function create(properties) { - return new EnumDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.value != null && message.value.length) - for (var i = 0; i < message.value.length; ++i) - $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); - return writer; - }; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.value && message.value.length)) - message.value = []; - message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); - break; - } - case 4: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.value != null && message.hasOwnProperty("value")) { - if (!Array.isArray(message.value)) - return "value: array expected"; - for (var i = 0; i < message.value.length; ++i) { - var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); - if (error) - return "value." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - */ - EnumDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.value) { - if (!Array.isArray(object.value)) - throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); - message.value = []; - for (var i = 0; i < object.value.length; ++i) { - if (typeof object.value[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); - message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.value = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.value && message.value.length) { - object.value = []; - for (var j = 0; j < message.value.length; ++j) - object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; - }; - - EnumDescriptorProto.EnumReservedRange = (function() { - - /** - * Properties of an EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @interface IEnumReservedRange - * @property {number|null} [start] EnumReservedRange start - * @property {number|null} [end] EnumReservedRange end - */ - - /** - * Constructs a new EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @classdesc Represents an EnumReservedRange. - * @implements IEnumReservedRange - * @constructor - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - */ - function EnumReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumReservedRange start. - * @member {number} start - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.start = 0; - - /** - * EnumReservedRange end. - * @member {number} end - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.end = 0; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance - */ - EnumReservedRange.create = function create(properties) { - return new EnumReservedRange(properties); - }; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumReservedRange message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - */ - EnumReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this EnumReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - * @returns {Object.} JSON object - */ - EnumReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumReservedRange - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; - }; - - return EnumReservedRange; - })(); - - return EnumDescriptorProto; - })(); - - protobuf.EnumValueDescriptorProto = (function() { - - /** - * Properties of an EnumValueDescriptorProto. - * @memberof google.protobuf - * @interface IEnumValueDescriptorProto - * @property {string|null} [name] EnumValueDescriptorProto name - * @property {number|null} [number] EnumValueDescriptorProto number - * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options - */ - - /** - * Constructs a new EnumValueDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumValueDescriptorProto. - * @implements IEnumValueDescriptorProto - * @constructor - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - */ - function EnumValueDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.name = ""; - - /** - * EnumValueDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.number = 0; - - /** - * EnumValueDescriptorProto options. - * @member {google.protobuf.IEnumValueOptions|null|undefined} options - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.options = null; - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance - */ - EnumValueDescriptorProto.create = function create(properties) { - return new EnumValueDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.number = reader.int32(); - break; - } - case 3: { - message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumValueOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - */ - EnumValueDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumValueDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.number = 0; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumValueDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; - }; - - return EnumValueDescriptorProto; - })(); - - protobuf.ServiceDescriptorProto = (function() { - - /** - * Properties of a ServiceDescriptorProto. - * @memberof google.protobuf - * @interface IServiceDescriptorProto - * @property {string|null} [name] ServiceDescriptorProto name - * @property {Array.|null} [method] ServiceDescriptorProto method - * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options - */ - - /** - * Constructs a new ServiceDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a ServiceDescriptorProto. - * @implements IServiceDescriptorProto - * @constructor - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - */ - function ServiceDescriptorProto(properties) { - this.method = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.name = ""; - - /** - * ServiceDescriptorProto method. - * @member {Array.} method - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.method = $util.emptyArray; - - /** - * ServiceDescriptorProto options. - * @member {google.protobuf.IServiceOptions|null|undefined} options - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.options = null; - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance - */ - ServiceDescriptorProto.create = function create(properties) { - return new ServiceDescriptorProto(properties); - }; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.method != null && message.method.length) - for (var i = 0; i < message.method.length; ++i) - $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.method && message.method.length)) - message.method = []; - message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceDescriptorProto message. - * @function verify - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.method != null && message.hasOwnProperty("method")) { - if (!Array.isArray(message.method)) - return "method: array expected"; - for (var i = 0; i < message.method.length; ++i) { - var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); - if (error) - return "method." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ServiceOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - */ - ServiceDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceDescriptorProto) - return object; - var message = new $root.google.protobuf.ServiceDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.method) { - if (!Array.isArray(object.method)) - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); - message.method = []; - for (var i = 0; i < object.method.length; ++i) { - if (typeof object.method[i] !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); - message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.method = []; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.method && message.method.length) { - object.method = []; - for (var j = 0; j < message.method.length; ++j) - object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - ServiceDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; - }; - - return ServiceDescriptorProto; - })(); - - protobuf.MethodDescriptorProto = (function() { - - /** - * Properties of a MethodDescriptorProto. - * @memberof google.protobuf - * @interface IMethodDescriptorProto - * @property {string|null} [name] MethodDescriptorProto name - * @property {string|null} [inputType] MethodDescriptorProto inputType - * @property {string|null} [outputType] MethodDescriptorProto outputType - * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options - * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming - * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming - */ - - /** - * Constructs a new MethodDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a MethodDescriptorProto. - * @implements IMethodDescriptorProto - * @constructor - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - */ - function MethodDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.name = ""; - - /** - * MethodDescriptorProto inputType. - * @member {string} inputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.inputType = ""; - - /** - * MethodDescriptorProto outputType. - * @member {string} outputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.outputType = ""; - - /** - * MethodDescriptorProto options. - * @member {google.protobuf.IMethodOptions|null|undefined} options - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.options = null; - - /** - * MethodDescriptorProto clientStreaming. - * @member {boolean} clientStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.clientStreaming = false; - - /** - * MethodDescriptorProto serverStreaming. - * @member {boolean} serverStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.serverStreaming = false; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance - */ - MethodDescriptorProto.create = function create(properties) { - return new MethodDescriptorProto(properties); - }; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); - if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); - if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); - return writer; - }; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.inputType = reader.string(); - break; - } - case 3: { - message.outputType = reader.string(); - break; - } - case 4: { - message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); - break; - } - case 5: { - message.clientStreaming = reader.bool(); - break; - } - case 6: { - message.serverStreaming = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodDescriptorProto message. - * @function verify - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.inputType != null && message.hasOwnProperty("inputType")) - if (!$util.isString(message.inputType)) - return "inputType: string expected"; - if (message.outputType != null && message.hasOwnProperty("outputType")) - if (!$util.isString(message.outputType)) - return "outputType: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MethodOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - if (typeof message.clientStreaming !== "boolean") - return "clientStreaming: boolean expected"; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - if (typeof message.serverStreaming !== "boolean") - return "serverStreaming: boolean expected"; - return null; - }; - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - */ - MethodDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodDescriptorProto) - return object; - var message = new $root.google.protobuf.MethodDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.inputType != null) - message.inputType = String(object.inputType); - if (object.outputType != null) - message.outputType = String(object.outputType); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); - } - if (object.clientStreaming != null) - message.clientStreaming = Boolean(object.clientStreaming); - if (object.serverStreaming != null) - message.serverStreaming = Boolean(object.serverStreaming); - return message; - }; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.inputType = ""; - object.outputType = ""; - object.options = null; - object.clientStreaming = false; - object.serverStreaming = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.inputType != null && message.hasOwnProperty("inputType")) - object.inputType = message.inputType; - if (message.outputType != null && message.hasOwnProperty("outputType")) - object.outputType = message.outputType; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - object.clientStreaming = message.clientStreaming; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - object.serverStreaming = message.serverStreaming; - return object; - }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.MethodDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - MethodDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; - }; - - return MethodDescriptorProto; - })(); - - protobuf.FileOptions = (function() { - - /** - * Properties of a FileOptions. - * @memberof google.protobuf - * @interface IFileOptions - * @property {string|null} [javaPackage] FileOptions javaPackage - * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname - * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles - * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash - * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 - * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor - * @property {string|null} [goPackage] FileOptions goPackage - * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices - * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices - * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices - * @property {boolean|null} [deprecated] FileOptions deprecated - * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas - * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix - * @property {string|null} [csharpNamespace] FileOptions csharpNamespace - * @property {string|null} [swiftPrefix] FileOptions swiftPrefix - * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix - * @property {string|null} [phpNamespace] FileOptions phpNamespace - * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace - * @property {string|null} [rubyPackage] FileOptions rubyPackage - * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features - * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption - * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition - */ - - /** - * Constructs a new FileOptions. - * @memberof google.protobuf - * @classdesc Represents a FileOptions. - * @implements IFileOptions - * @constructor - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - */ - function FileOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.resourceDefinition"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileOptions javaPackage. - * @member {string} javaPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaPackage = ""; - - /** - * FileOptions javaOuterClassname. - * @member {string} javaOuterClassname - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaOuterClassname = ""; - - /** - * FileOptions javaMultipleFiles. - * @member {boolean} javaMultipleFiles - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaMultipleFiles = false; - - /** - * FileOptions javaGenerateEqualsAndHash. - * @member {boolean} javaGenerateEqualsAndHash - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenerateEqualsAndHash = false; - - /** - * FileOptions javaStringCheckUtf8. - * @member {boolean} javaStringCheckUtf8 - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaStringCheckUtf8 = false; - - /** - * FileOptions optimizeFor. - * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.optimizeFor = 1; - - /** - * FileOptions goPackage. - * @member {string} goPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.goPackage = ""; - - /** - * FileOptions ccGenericServices. - * @member {boolean} ccGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccGenericServices = false; - - /** - * FileOptions javaGenericServices. - * @member {boolean} javaGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenericServices = false; - - /** - * FileOptions pyGenericServices. - * @member {boolean} pyGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.pyGenericServices = false; - - /** - * FileOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.deprecated = false; - - /** - * FileOptions ccEnableArenas. - * @member {boolean} ccEnableArenas - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccEnableArenas = true; - - /** - * FileOptions objcClassPrefix. - * @member {string} objcClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.objcClassPrefix = ""; - - /** - * FileOptions csharpNamespace. - * @member {string} csharpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.csharpNamespace = ""; - - /** - * FileOptions swiftPrefix. - * @member {string} swiftPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.swiftPrefix = ""; - - /** - * FileOptions phpClassPrefix. - * @member {string} phpClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpClassPrefix = ""; - - /** - * FileOptions phpNamespace. - * @member {string} phpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpNamespace = ""; - - /** - * FileOptions phpMetadataNamespace. - * @member {string} phpMetadataNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpMetadataNamespace = ""; - - /** - * FileOptions rubyPackage. - * @member {string} rubyPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.rubyPackage = ""; - - /** - * FileOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.features = null; - - /** - * FileOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FileOptions .google.api.resourceDefinition. - * @member {Array.} .google.api.resourceDefinition - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; - - /** - * Creates a new FileOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - * @returns {google.protobuf.FileOptions} FileOptions instance - */ - FileOptions.create = function create(properties) { - return new FileOptions(properties); - }; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); - if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); - if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); - if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); - if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); - if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); - if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); - if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) - writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); - if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) - writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) - writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); - if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) - writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); - if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) - writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); - if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) - writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); - if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) - writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); - if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) - writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); - if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) - writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); - if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) - writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); - if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) - writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.javaPackage = reader.string(); - break; - } - case 8: { - message.javaOuterClassname = reader.string(); - break; - } - case 10: { - message.javaMultipleFiles = reader.bool(); - break; - } - case 20: { - message.javaGenerateEqualsAndHash = reader.bool(); - break; - } - case 27: { - message.javaStringCheckUtf8 = reader.bool(); - break; - } - case 9: { - message.optimizeFor = reader.int32(); - break; - } - case 11: { - message.goPackage = reader.string(); - break; - } - case 16: { - message.ccGenericServices = reader.bool(); - break; - } - case 17: { - message.javaGenericServices = reader.bool(); - break; - } - case 18: { - message.pyGenericServices = reader.bool(); - break; - } - case 23: { - message.deprecated = reader.bool(); - break; - } - case 31: { - message.ccEnableArenas = reader.bool(); - break; - } - case 36: { - message.objcClassPrefix = reader.string(); - break; - } - case 37: { - message.csharpNamespace = reader.string(); - break; - } - case 39: { - message.swiftPrefix = reader.string(); - break; - } - case 40: { - message.phpClassPrefix = reader.string(); - break; - } - case 41: { - message.phpNamespace = reader.string(); - break; - } - case 44: { - message.phpMetadataNamespace = reader.string(); - break; - } - case 45: { - message.rubyPackage = reader.string(); - break; - } - case 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1053: { - if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) - message[".google.api.resourceDefinition"] = []; - message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileOptions message. - * @function verify - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - if (!$util.isString(message.javaPackage)) - return "javaPackage: string expected"; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - if (!$util.isString(message.javaOuterClassname)) - return "javaOuterClassname: string expected"; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - if (typeof message.javaMultipleFiles !== "boolean") - return "javaMultipleFiles: boolean expected"; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - if (typeof message.javaGenerateEqualsAndHash !== "boolean") - return "javaGenerateEqualsAndHash: boolean expected"; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - if (typeof message.javaStringCheckUtf8 !== "boolean") - return "javaStringCheckUtf8: boolean expected"; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - switch (message.optimizeFor) { - default: - return "optimizeFor: enum value expected"; - case 1: - case 2: - case 3: - break; - } - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - if (!$util.isString(message.goPackage)) - return "goPackage: string expected"; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - if (typeof message.ccGenericServices !== "boolean") - return "ccGenericServices: boolean expected"; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - if (typeof message.javaGenericServices !== "boolean") - return "javaGenericServices: boolean expected"; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - if (typeof message.pyGenericServices !== "boolean") - return "pyGenericServices: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - if (typeof message.ccEnableArenas !== "boolean") - return "ccEnableArenas: boolean expected"; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - if (!$util.isString(message.objcClassPrefix)) - return "objcClassPrefix: string expected"; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - if (!$util.isString(message.csharpNamespace)) - return "csharpNamespace: string expected"; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - if (!$util.isString(message.swiftPrefix)) - return "swiftPrefix: string expected"; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - if (!$util.isString(message.phpClassPrefix)) - return "phpClassPrefix: string expected"; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - if (!$util.isString(message.phpNamespace)) - return "phpNamespace: string expected"; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - if (!$util.isString(message.phpMetadataNamespace)) - return "phpMetadataNamespace: string expected"; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - if (!$util.isString(message.rubyPackage)) - return "rubyPackage: string expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { - if (!Array.isArray(message[".google.api.resourceDefinition"])) - return ".google.api.resourceDefinition: array expected"; - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); - if (error) - return ".google.api.resourceDefinition." + error; - } - } - return null; - }; - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileOptions} FileOptions - */ - FileOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileOptions) - return object; - var message = new $root.google.protobuf.FileOptions(); - if (object.javaPackage != null) - message.javaPackage = String(object.javaPackage); - if (object.javaOuterClassname != null) - message.javaOuterClassname = String(object.javaOuterClassname); - if (object.javaMultipleFiles != null) - message.javaMultipleFiles = Boolean(object.javaMultipleFiles); - if (object.javaGenerateEqualsAndHash != null) - message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); - if (object.javaStringCheckUtf8 != null) - message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); - switch (object.optimizeFor) { - default: - if (typeof object.optimizeFor === "number") { - message.optimizeFor = object.optimizeFor; - break; - } - break; - case "SPEED": - case 1: - message.optimizeFor = 1; - break; - case "CODE_SIZE": - case 2: - message.optimizeFor = 2; - break; - case "LITE_RUNTIME": - case 3: - message.optimizeFor = 3; - break; - } - if (object.goPackage != null) - message.goPackage = String(object.goPackage); - if (object.ccGenericServices != null) - message.ccGenericServices = Boolean(object.ccGenericServices); - if (object.javaGenericServices != null) - message.javaGenericServices = Boolean(object.javaGenericServices); - if (object.pyGenericServices != null) - message.pyGenericServices = Boolean(object.pyGenericServices); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.ccEnableArenas != null) - message.ccEnableArenas = Boolean(object.ccEnableArenas); - if (object.objcClassPrefix != null) - message.objcClassPrefix = String(object.objcClassPrefix); - if (object.csharpNamespace != null) - message.csharpNamespace = String(object.csharpNamespace); - if (object.swiftPrefix != null) - message.swiftPrefix = String(object.swiftPrefix); - if (object.phpClassPrefix != null) - message.phpClassPrefix = String(object.phpClassPrefix); - if (object.phpNamespace != null) - message.phpNamespace = String(object.phpNamespace); - if (object.phpMetadataNamespace != null) - message.phpMetadataNamespace = String(object.phpMetadataNamespace); - if (object.rubyPackage != null) - message.rubyPackage = String(object.rubyPackage); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FileOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.resourceDefinition"]) { - if (!Array.isArray(object[".google.api.resourceDefinition"])) - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); - message[".google.api.resourceDefinition"] = []; - for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { - if (typeof object[".google.api.resourceDefinition"][i] !== "object") - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); - message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.FileOptions} message FileOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.resourceDefinition"] = []; - } - if (options.defaults) { - object.javaPackage = ""; - object.javaOuterClassname = ""; - object.optimizeFor = options.enums === String ? "SPEED" : 1; - object.javaMultipleFiles = false; - object.goPackage = ""; - object.ccGenericServices = false; - object.javaGenericServices = false; - object.pyGenericServices = false; - object.javaGenerateEqualsAndHash = false; - object.deprecated = false; - object.javaStringCheckUtf8 = false; - object.ccEnableArenas = true; - object.objcClassPrefix = ""; - object.csharpNamespace = ""; - object.swiftPrefix = ""; - object.phpClassPrefix = ""; - object.phpNamespace = ""; - object.phpMetadataNamespace = ""; - object.rubyPackage = ""; - object.features = null; - } - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - object.javaPackage = message.javaPackage; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - object.javaOuterClassname = message.javaOuterClassname; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - object.javaMultipleFiles = message.javaMultipleFiles; - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - object.goPackage = message.goPackage; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - object.ccGenericServices = message.ccGenericServices; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - object.javaGenericServices = message.javaGenericServices; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - object.pyGenericServices = message.pyGenericServices; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - object.javaStringCheckUtf8 = message.javaStringCheckUtf8; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - object.ccEnableArenas = message.ccEnableArenas; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - object.objcClassPrefix = message.objcClassPrefix; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - object.csharpNamespace = message.csharpNamespace; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - object.swiftPrefix = message.swiftPrefix; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - object.phpClassPrefix = message.phpClassPrefix; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - object.phpNamespace = message.phpNamespace; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - object.phpMetadataNamespace = message.phpMetadataNamespace; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - object.rubyPackage = message.rubyPackage; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { - object[".google.api.resourceDefinition"] = []; - for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) - object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); - } - return object; - }; - - /** - * Converts this FileOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FileOptions - * @instance - * @returns {Object.} JSON object - */ - FileOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileOptions - * @function getTypeUrl - * @memberof google.protobuf.FileOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileOptions"; - }; - - /** - * OptimizeMode enum. - * @name google.protobuf.FileOptions.OptimizeMode - * @enum {number} - * @property {number} SPEED=1 SPEED value - * @property {number} CODE_SIZE=2 CODE_SIZE value - * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value - */ - FileOptions.OptimizeMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "SPEED"] = 1; - values[valuesById[2] = "CODE_SIZE"] = 2; - values[valuesById[3] = "LITE_RUNTIME"] = 3; - return values; - })(); - - return FileOptions; - })(); - - protobuf.MessageOptions = (function() { - - /** - * Properties of a MessageOptions. - * @memberof google.protobuf - * @interface IMessageOptions - * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat - * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor - * @property {boolean|null} [deprecated] MessageOptions deprecated - * @property {boolean|null} [mapEntry] MessageOptions mapEntry - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features - * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption - * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource - */ - - /** - * Constructs a new MessageOptions. - * @memberof google.protobuf - * @classdesc Represents a MessageOptions. - * @implements IMessageOptions - * @constructor - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - */ - function MessageOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MessageOptions messageSetWireFormat. - * @member {boolean} messageSetWireFormat - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.messageSetWireFormat = false; - - /** - * MessageOptions noStandardDescriptorAccessor. - * @member {boolean} noStandardDescriptorAccessor - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.noStandardDescriptorAccessor = false; - - /** - * MessageOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecated = false; - - /** - * MessageOptions mapEntry. - * @member {boolean} mapEntry - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.mapEntry = false; - - /** - * MessageOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * MessageOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.features = null; - - /** - * MessageOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * MessageOptions .google.api.resource. - * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".google.api.resource"] = null; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - * @returns {google.protobuf.MessageOptions} MessageOptions instance - */ - MessageOptions.create = function create(properties) { - return new MessageOptions(properties); - }; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); - if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.messageSetWireFormat = reader.bool(); - break; - } - case 2: { - message.noStandardDescriptorAccessor = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 7: { - message.mapEntry = reader.bool(); - break; - } - case 11: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 12: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1053: { - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MessageOptions message. - * @function verify - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MessageOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - if (typeof message.messageSetWireFormat !== "boolean") - return "messageSetWireFormat: boolean expected"; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - if (typeof message.noStandardDescriptorAccessor !== "boolean") - return "noStandardDescriptorAccessor: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - if (typeof message.mapEntry !== "boolean") - return "mapEntry: boolean expected"; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); - if (error) - return ".google.api.resource." + error; - } - return null; - }; - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MessageOptions} MessageOptions - */ - MessageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MessageOptions) - return object; - var message = new $root.google.protobuf.MessageOptions(); - if (object.messageSetWireFormat != null) - message.messageSetWireFormat = Boolean(object.messageSetWireFormat); - if (object.noStandardDescriptorAccessor != null) - message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.mapEntry != null) - message.mapEntry = Boolean(object.mapEntry); - if (object.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MessageOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.resource"] != null) { - if (typeof object[".google.api.resource"] !== "object") - throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); - } - return message; - }; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.MessageOptions} message MessageOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MessageOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.messageSetWireFormat = false; - object.noStandardDescriptorAccessor = false; - object.deprecated = false; - object.mapEntry = false; - object.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - object[".google.api.resource"] = null; - } - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - object.messageSetWireFormat = message.messageSetWireFormat; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - object.mapEntry = message.mapEntry; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) - object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); - return object; - }; - - /** - * Converts this MessageOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MessageOptions - * @instance - * @returns {Object.} JSON object - */ - MessageOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MessageOptions - * @function getTypeUrl - * @memberof google.protobuf.MessageOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MessageOptions"; - }; - - return MessageOptions; - })(); - - protobuf.FieldOptions = (function() { - - /** - * Properties of a FieldOptions. - * @memberof google.protobuf - * @interface IFieldOptions - * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype - * @property {boolean|null} [packed] FieldOptions packed - * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype - * @property {boolean|null} [lazy] FieldOptions lazy - * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy - * @property {boolean|null} [deprecated] FieldOptions deprecated - * @property {boolean|null} [weak] FieldOptions weak - * @property {boolean|null} [debugRedact] FieldOptions debugRedact - * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention - * @property {Array.|null} [targets] FieldOptions targets - * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults - * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features - * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption - * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior - * @property {google.api.IFieldInfo|null} [".google.api.fieldInfo"] FieldOptions .google.api.fieldInfo - * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference - */ - - /** - * Constructs a new FieldOptions. - * @memberof google.protobuf - * @classdesc Represents a FieldOptions. - * @implements IFieldOptions - * @constructor - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - */ - function FieldOptions(properties) { - this.targets = []; - this.editionDefaults = []; - this.uninterpretedOption = []; - this[".google.api.fieldBehavior"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldOptions ctype. - * @member {google.protobuf.FieldOptions.CType} ctype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.ctype = 0; - - /** - * FieldOptions packed. - * @member {boolean} packed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.packed = false; - - /** - * FieldOptions jstype. - * @member {google.protobuf.FieldOptions.JSType} jstype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.jstype = 0; - - /** - * FieldOptions lazy. - * @member {boolean} lazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.lazy = false; - - /** - * FieldOptions unverifiedLazy. - * @member {boolean} unverifiedLazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.unverifiedLazy = false; - - /** - * FieldOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.deprecated = false; - - /** - * FieldOptions weak. - * @member {boolean} weak - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.weak = false; - - /** - * FieldOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.debugRedact = false; - - /** - * FieldOptions retention. - * @member {google.protobuf.FieldOptions.OptionRetention} retention - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.retention = 0; - - /** - * FieldOptions targets. - * @member {Array.} targets - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.targets = $util.emptyArray; - - /** - * FieldOptions editionDefaults. - * @member {Array.} editionDefaults - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.editionDefaults = $util.emptyArray; - - /** - * FieldOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.features = null; - - /** - * FieldOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FieldOptions .google.api.fieldBehavior. - * @member {Array.} .google.api.fieldBehavior - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; - - /** - * FieldOptions .google.api.fieldInfo. - * @member {google.api.IFieldInfo|null|undefined} .google.api.fieldInfo - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.fieldInfo"] = null; - - /** - * FieldOptions .google.api.resourceReference. - * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.resourceReference"] = null; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions} FieldOptions instance - */ - FieldOptions.create = function create(properties) { - return new FieldOptions(properties); - }; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); - if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) - writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); - if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) - writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); - if (message.targets != null && message.targets.length) - for (var i = 0; i < message.targets.length; ++i) - writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); - if (message.editionDefaults != null && message.editionDefaults.length) - for (var i = 0; i < message.editionDefaults.length; ++i) - $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); - if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) - $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); - if (message[".google.api.fieldInfo"] != null && Object.hasOwnProperty.call(message, ".google.api.fieldInfo")) - $root.google.api.FieldInfo.encode(message[".google.api.fieldInfo"], writer.uint32(/* id 291403980, wireType 2 =*/2331231842).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.ctype = reader.int32(); - break; - } - case 2: { - message.packed = reader.bool(); - break; - } - case 6: { - message.jstype = reader.int32(); - break; - } - case 5: { - message.lazy = reader.bool(); - break; - } - case 15: { - message.unverifiedLazy = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 10: { - message.weak = reader.bool(); - break; - } - case 16: { - message.debugRedact = reader.bool(); - break; - } - case 17: { - message.retention = reader.int32(); - break; - } - case 19: { - if (!(message.targets && message.targets.length)) - message.targets = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.targets.push(reader.int32()); - } else - message.targets.push(reader.int32()); - break; - } - case 20: { - if (!(message.editionDefaults && message.editionDefaults.length)) - message.editionDefaults = []; - message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); - break; - } - case 21: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1052: { - if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) - message[".google.api.fieldBehavior"] = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message[".google.api.fieldBehavior"].push(reader.int32()); - } else - message[".google.api.fieldBehavior"].push(reader.int32()); - break; - } - case 291403980: { - message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.decode(reader, reader.uint32()); - break; - } - case 1055: { - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldOptions message. - * @function verify - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ctype != null && message.hasOwnProperty("ctype")) - switch (message.ctype) { - default: - return "ctype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.packed != null && message.hasOwnProperty("packed")) - if (typeof message.packed !== "boolean") - return "packed: boolean expected"; - if (message.jstype != null && message.hasOwnProperty("jstype")) - switch (message.jstype) { - default: - return "jstype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.lazy != null && message.hasOwnProperty("lazy")) - if (typeof message.lazy !== "boolean") - return "lazy: boolean expected"; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - if (typeof message.unverifiedLazy !== "boolean") - return "unverifiedLazy: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.weak != null && message.hasOwnProperty("weak")) - if (typeof message.weak !== "boolean") - return "weak: boolean expected"; - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: boolean expected"; - if (message.retention != null && message.hasOwnProperty("retention")) - switch (message.retention) { - default: - return "retention: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.targets != null && message.hasOwnProperty("targets")) { - if (!Array.isArray(message.targets)) - return "targets: array expected"; - for (var i = 0; i < message.targets.length; ++i) - switch (message.targets[i]) { - default: - return "targets: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } - } - if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { - if (!Array.isArray(message.editionDefaults)) - return "editionDefaults: array expected"; - for (var i = 0; i < message.editionDefaults.length; ++i) { - var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); - if (error) - return "editionDefaults." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { - if (!Array.isArray(message[".google.api.fieldBehavior"])) - return ".google.api.fieldBehavior: array expected"; - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - switch (message[".google.api.fieldBehavior"][i]) { - default: - return ".google.api.fieldBehavior: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - } - if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) { - var error = $root.google.api.FieldInfo.verify(message[".google.api.fieldInfo"]); - if (error) - return ".google.api.fieldInfo." + error; - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { - var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); - if (error) - return ".google.api.resourceReference." + error; - } - return null; - }; - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions} FieldOptions - */ - FieldOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions) - return object; - var message = new $root.google.protobuf.FieldOptions(); - switch (object.ctype) { - default: - if (typeof object.ctype === "number") { - message.ctype = object.ctype; - break; - } - break; - case "STRING": - case 0: - message.ctype = 0; - break; - case "CORD": - case 1: - message.ctype = 1; - break; - case "STRING_PIECE": - case 2: - message.ctype = 2; - break; - } - if (object.packed != null) - message.packed = Boolean(object.packed); - switch (object.jstype) { - default: - if (typeof object.jstype === "number") { - message.jstype = object.jstype; - break; - } - break; - case "JS_NORMAL": - case 0: - message.jstype = 0; - break; - case "JS_STRING": - case 1: - message.jstype = 1; - break; - case "JS_NUMBER": - case 2: - message.jstype = 2; - break; - } - if (object.lazy != null) - message.lazy = Boolean(object.lazy); - if (object.unverifiedLazy != null) - message.unverifiedLazy = Boolean(object.unverifiedLazy); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.weak != null) - message.weak = Boolean(object.weak); - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - switch (object.retention) { - default: - if (typeof object.retention === "number") { - message.retention = object.retention; - break; - } - break; - case "RETENTION_UNKNOWN": - case 0: - message.retention = 0; - break; - case "RETENTION_RUNTIME": - case 1: - message.retention = 1; - break; - case "RETENTION_SOURCE": - case 2: - message.retention = 2; - break; - } - if (object.targets) { - if (!Array.isArray(object.targets)) - throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); - message.targets = []; - for (var i = 0; i < object.targets.length; ++i) - switch (object.targets[i]) { - default: - if (typeof object.targets[i] === "number") { - message.targets[i] = object.targets[i]; - break; - } - case "TARGET_TYPE_UNKNOWN": - case 0: - message.targets[i] = 0; - break; - case "TARGET_TYPE_FILE": - case 1: - message.targets[i] = 1; - break; - case "TARGET_TYPE_EXTENSION_RANGE": - case 2: - message.targets[i] = 2; - break; - case "TARGET_TYPE_MESSAGE": - case 3: - message.targets[i] = 3; - break; - case "TARGET_TYPE_FIELD": - case 4: - message.targets[i] = 4; - break; - case "TARGET_TYPE_ONEOF": - case 5: - message.targets[i] = 5; - break; - case "TARGET_TYPE_ENUM": - case 6: - message.targets[i] = 6; - break; - case "TARGET_TYPE_ENUM_ENTRY": - case 7: - message.targets[i] = 7; - break; - case "TARGET_TYPE_SERVICE": - case 8: - message.targets[i] = 8; - break; - case "TARGET_TYPE_METHOD": - case 9: - message.targets[i] = 9; - break; - } - } - if (object.editionDefaults) { - if (!Array.isArray(object.editionDefaults)) - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); - message.editionDefaults = []; - for (var i = 0; i < object.editionDefaults.length; ++i) { - if (typeof object.editionDefaults[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); - message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FieldOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.fieldBehavior"]) { - if (!Array.isArray(object[".google.api.fieldBehavior"])) - throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); - message[".google.api.fieldBehavior"] = []; - for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) - switch (object[".google.api.fieldBehavior"][i]) { - default: - if (typeof object[".google.api.fieldBehavior"][i] === "number") { - message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; - break; - } - case "FIELD_BEHAVIOR_UNSPECIFIED": - case 0: - message[".google.api.fieldBehavior"][i] = 0; - break; - case "OPTIONAL": - case 1: - message[".google.api.fieldBehavior"][i] = 1; - break; - case "REQUIRED": - case 2: - message[".google.api.fieldBehavior"][i] = 2; - break; - case "OUTPUT_ONLY": - case 3: - message[".google.api.fieldBehavior"][i] = 3; - break; - case "INPUT_ONLY": - case 4: - message[".google.api.fieldBehavior"][i] = 4; - break; - case "IMMUTABLE": - case 5: - message[".google.api.fieldBehavior"][i] = 5; - break; - case "UNORDERED_LIST": - case 6: - message[".google.api.fieldBehavior"][i] = 6; - break; - case "NON_EMPTY_DEFAULT": - case 7: - message[".google.api.fieldBehavior"][i] = 7; - break; - case "IDENTIFIER": - case 8: - message[".google.api.fieldBehavior"][i] = 8; - break; - } - } - if (object[".google.api.fieldInfo"] != null) { - if (typeof object[".google.api.fieldInfo"] !== "object") - throw TypeError(".google.protobuf.FieldOptions..google.api.fieldInfo: object expected"); - message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.fromObject(object[".google.api.fieldInfo"]); - } - if (object[".google.api.resourceReference"] != null) { - if (typeof object[".google.api.resourceReference"] !== "object") - throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); - } - return message; - }; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.FieldOptions} message FieldOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.targets = []; - object.editionDefaults = []; - object.uninterpretedOption = []; - object[".google.api.fieldBehavior"] = []; - } - if (options.defaults) { - object.ctype = options.enums === String ? "STRING" : 0; - object.packed = false; - object.deprecated = false; - object.lazy = false; - object.jstype = options.enums === String ? "JS_NORMAL" : 0; - object.weak = false; - object.unverifiedLazy = false; - object.debugRedact = false; - object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; - object.features = null; - object[".google.api.resourceReference"] = null; - object[".google.api.fieldInfo"] = null; - } - if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; - if (message.packed != null && message.hasOwnProperty("packed")) - object.packed = message.packed; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.lazy != null && message.hasOwnProperty("lazy")) - object.lazy = message.lazy; - if (message.jstype != null && message.hasOwnProperty("jstype")) - object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; - if (message.weak != null && message.hasOwnProperty("weak")) - object.weak = message.weak; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - object.unverifiedLazy = message.unverifiedLazy; - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - if (message.retention != null && message.hasOwnProperty("retention")) - object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; - if (message.targets && message.targets.length) { - object.targets = []; - for (var j = 0; j < message.targets.length; ++j) - object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; - } - if (message.editionDefaults && message.editionDefaults.length) { - object.editionDefaults = []; - for (var j = 0; j < message.editionDefaults.length; ++j) - object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); - } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { - object[".google.api.fieldBehavior"] = []; - for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) - object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) - object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); - if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) - object[".google.api.fieldInfo"] = $root.google.api.FieldInfo.toObject(message[".google.api.fieldInfo"], options); - return object; - }; - - /** - * Converts this FieldOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions - * @instance - * @returns {Object.} JSON object - */ - FieldOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldOptions - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions"; - }; - - /** - * CType enum. - * @name google.protobuf.FieldOptions.CType - * @enum {number} - * @property {number} STRING=0 STRING value - * @property {number} CORD=1 CORD value - * @property {number} STRING_PIECE=2 STRING_PIECE value - */ - FieldOptions.CType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STRING"] = 0; - values[valuesById[1] = "CORD"] = 1; - values[valuesById[2] = "STRING_PIECE"] = 2; - return values; - })(); - - /** - * JSType enum. - * @name google.protobuf.FieldOptions.JSType - * @enum {number} - * @property {number} JS_NORMAL=0 JS_NORMAL value - * @property {number} JS_STRING=1 JS_STRING value - * @property {number} JS_NUMBER=2 JS_NUMBER value - */ - FieldOptions.JSType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JS_NORMAL"] = 0; - values[valuesById[1] = "JS_STRING"] = 1; - values[valuesById[2] = "JS_NUMBER"] = 2; - return values; - })(); - - /** - * OptionRetention enum. - * @name google.protobuf.FieldOptions.OptionRetention - * @enum {number} - * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value - * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value - * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value - */ - FieldOptions.OptionRetention = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; - values[valuesById[1] = "RETENTION_RUNTIME"] = 1; - values[valuesById[2] = "RETENTION_SOURCE"] = 2; - return values; - })(); - - /** - * OptionTargetType enum. - * @name google.protobuf.FieldOptions.OptionTargetType - * @enum {number} - * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value - * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value - * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value - * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value - * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value - * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value - * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value - * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value - * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value - * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value - */ - FieldOptions.OptionTargetType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; - values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; - values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; - values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; - values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; - values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; - values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; - values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; - values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; - return values; - })(); - - FieldOptions.EditionDefault = (function() { - - /** - * Properties of an EditionDefault. - * @memberof google.protobuf.FieldOptions - * @interface IEditionDefault - * @property {google.protobuf.Edition|null} [edition] EditionDefault edition - * @property {string|null} [value] EditionDefault value - */ - - /** - * Constructs a new EditionDefault. - * @memberof google.protobuf.FieldOptions - * @classdesc Represents an EditionDefault. - * @implements IEditionDefault - * @constructor - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - */ - function EditionDefault(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.edition = 0; - - /** - * EditionDefault value. - * @member {string} value - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.value = ""; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance - */ - EditionDefault.create = function create(properties) { - return new EditionDefault(properties); - }; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.value = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EditionDefault message. - * @function verify - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - */ - EditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) - return object; - var message = new $root.google.protobuf.FieldOptions.EditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.value = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this EditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - * @returns {Object.} JSON object - */ - EditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; - }; - - return EditionDefault; - })(); - - return FieldOptions; - })(); - - protobuf.OneofOptions = (function() { - - /** - * Properties of an OneofOptions. - * @memberof google.protobuf - * @interface IOneofOptions - * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features - * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption - */ - - /** - * Constructs a new OneofOptions. - * @memberof google.protobuf - * @classdesc Represents an OneofOptions. - * @implements IOneofOptions - * @constructor - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - */ - function OneofOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.features = null; - - /** - * OneofOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - * @returns {google.protobuf.OneofOptions} OneofOptions instance - */ - OneofOptions.create = function create(properties) { - return new OneofOptions(properties); - }; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofOptions message. - * @function verify - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofOptions} OneofOptions - */ - OneofOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofOptions) - return object; - var message = new $root.google.protobuf.OneofOptions(); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.OneofOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.OneofOptions} message OneofOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) - object.features = null; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this OneofOptions to JSON. - * @function toJSON - * @memberof google.protobuf.OneofOptions - * @instance - * @returns {Object.} JSON object - */ - OneofOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofOptions - * @function getTypeUrl - * @memberof google.protobuf.OneofOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofOptions"; - }; - - return OneofOptions; - })(); - - protobuf.EnumOptions = (function() { - - /** - * Properties of an EnumOptions. - * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allowAlias] EnumOptions allowAlias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features - * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption - */ - - /** - * Constructs a new EnumOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumOptions. - * @implements IEnumOptions - * @constructor - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - */ - function EnumOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumOptions allowAlias. - * @member {boolean} allowAlias - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.allowAlias = false; - - /** - * EnumOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecated = false; - - /** - * EnumOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * EnumOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.features = null; - - /** - * EnumOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumOptions} EnumOptions instance - */ - EnumOptions.create = function create(properties) { - return new EnumOptions(properties); - }; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - message.allowAlias = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 6: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 7: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumOptions message. - * @function verify - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - if (typeof message.allowAlias !== "boolean") - return "allowAlias: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumOptions} EnumOptions - */ - EnumOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumOptions) - return object; - var message = new $root.google.protobuf.EnumOptions(); - if (object.allowAlias != null) - message.allowAlias = Boolean(object.allowAlias); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.EnumOptions} message EnumOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.allowAlias = false; - object.deprecated = false; - object.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - } - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - object.allowAlias = message.allowAlias; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumOptions - * @instance - * @returns {Object.} JSON object - */ - EnumOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumOptions"; - }; - - return EnumOptions; - })(); - - protobuf.EnumValueOptions = (function() { - - /** - * Properties of an EnumValueOptions. - * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features - * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact - * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption - */ - - /** - * Constructs a new EnumValueOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumValueOptions. - * @implements IEnumValueOptions - * @constructor - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - */ - function EnumValueOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.deprecated = false; - - /** - * EnumValueOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.features = null; - - /** - * EnumValueOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.debugRedact = false; - - /** - * EnumValueOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance - */ - EnumValueOptions.create = function create(properties) { - return new EnumValueOptions(properties); - }; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.deprecated = reader.bool(); - break; - } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.debugRedact = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueOptions message. - * @function verify - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - */ - EnumValueOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueOptions) - return object; - var message = new $root.google.protobuf.EnumValueOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.EnumValueOptions} message EnumValueOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object.features = null; - object.debugRedact = false; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumValueOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueOptions - * @instance - * @returns {Object.} JSON object - */ - EnumValueOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; - }; - - return EnumValueOptions; - })(); - - protobuf.ServiceOptions = (function() { - - /** - * Properties of a ServiceOptions. - * @memberof google.protobuf - * @interface IServiceOptions - * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features - * @property {boolean|null} [deprecated] ServiceOptions deprecated - * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption - * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost - * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes - * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion - */ - - /** - * Constructs a new ServiceOptions. - * @memberof google.protobuf - * @classdesc Represents a ServiceOptions. - * @implements IServiceOptions - * @constructor - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - */ - function ServiceOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.features = null; - - /** - * ServiceOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.deprecated = false; - - /** - * ServiceOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ServiceOptions .google.api.defaultHost. - * @member {string} .google.api.defaultHost - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.defaultHost"] = ""; - - /** - * ServiceOptions .google.api.oauthScopes. - * @member {string} .google.api.oauthScopes - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.oauthScopes"] = ""; - - /** - * ServiceOptions .google.api.apiVersion. - * @member {string} .google.api.apiVersion - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.apiVersion"] = ""; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - * @returns {google.protobuf.ServiceOptions} ServiceOptions instance - */ - ServiceOptions.create = function create(properties) { - return new ServiceOptions(properties); - }; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) - writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); - if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) - writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); - if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) - writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); - return writer; - }; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 34: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 33: { - message.deprecated = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1049: { - message[".google.api.defaultHost"] = reader.string(); - break; - } - case 1050: { - message[".google.api.oauthScopes"] = reader.string(); - break; - } - case 525000001: { - message[".google.api.apiVersion"] = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceOptions message. - * @function verify - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - if (!$util.isString(message[".google.api.defaultHost"])) - return ".google.api.defaultHost: string expected"; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - if (!$util.isString(message[".google.api.oauthScopes"])) - return ".google.api.oauthScopes: string expected"; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - if (!$util.isString(message[".google.api.apiVersion"])) - return ".google.api.apiVersion: string expected"; - return null; - }; - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceOptions} ServiceOptions - */ - ServiceOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceOptions) - return object; - var message = new $root.google.protobuf.ServiceOptions(); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.defaultHost"] != null) - message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); - if (object[".google.api.oauthScopes"] != null) - message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); - if (object[".google.api.apiVersion"] != null) - message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); - return message; - }; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.ServiceOptions} message ServiceOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object.features = null; - object[".google.api.defaultHost"] = ""; - object[".google.api.oauthScopes"] = ""; - object[".google.api.apiVersion"] = ""; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; - return object; - }; - - /** - * Converts this ServiceOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceOptions - * @instance - * @returns {Object.} JSON object - */ - ServiceOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceOptions - * @function getTypeUrl - * @memberof google.protobuf.ServiceOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceOptions"; - }; - - return ServiceOptions; - })(); - - protobuf.MethodOptions = (function() { - - /** - * Properties of a MethodOptions. - * @memberof google.protobuf - * @interface IMethodOptions - * @property {boolean|null} [deprecated] MethodOptions deprecated - * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel - * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features - * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption - * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http - * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature - * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo - */ - - /** - * Constructs a new MethodOptions. - * @memberof google.protobuf - * @classdesc Represents a MethodOptions. - * @implements IMethodOptions - * @constructor - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - */ - function MethodOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.methodSignature"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.deprecated = false; - - /** - * MethodOptions idempotencyLevel. - * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.idempotencyLevel = 0; - - /** - * MethodOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.features = null; - - /** - * MethodOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * MethodOptions .google.api.http. - * @member {google.api.IHttpRule|null|undefined} .google.api.http - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.http"] = null; - - /** - * MethodOptions .google.api.methodSignature. - * @member {Array.} .google.api.methodSignature - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; - - /** - * MethodOptions .google.longrunning.operationInfo. - * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.longrunning.operationInfo"] = null; - - /** - * Creates a new MethodOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - * @returns {google.protobuf.MethodOptions} MethodOptions instance - */ - MethodOptions.create = function create(properties) { - return new MethodOptions(properties); - }; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) - writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) - $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); - if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); - if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) - $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 33: { - message.deprecated = reader.bool(); - break; - } - case 34: { - message.idempotencyLevel = reader.int32(); - break; - } - case 35: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 72295728: { - message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); - break; - } - case 1051: { - if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) - message[".google.api.methodSignature"] = []; - message[".google.api.methodSignature"].push(reader.string()); - break; - } - case 1049: { - message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodOptions message. - * @function verify - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - switch (message.idempotencyLevel) { - default: - return "idempotencyLevel: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { - var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); - if (error) - return ".google.api.http." + error; - } - if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { - if (!Array.isArray(message[".google.api.methodSignature"])) - return ".google.api.methodSignature: array expected"; - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - if (!$util.isString(message[".google.api.methodSignature"][i])) - return ".google.api.methodSignature: string[] expected"; - } - if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { - var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); - if (error) - return ".google.longrunning.operationInfo." + error; - } - return null; - }; - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodOptions} MethodOptions - */ - MethodOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodOptions) - return object; - var message = new $root.google.protobuf.MethodOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - switch (object.idempotencyLevel) { - default: - if (typeof object.idempotencyLevel === "number") { - message.idempotencyLevel = object.idempotencyLevel; - break; - } - break; - case "IDEMPOTENCY_UNKNOWN": - case 0: - message.idempotencyLevel = 0; - break; - case "NO_SIDE_EFFECTS": - case 1: - message.idempotencyLevel = 1; - break; - case "IDEMPOTENT": - case 2: - message.idempotencyLevel = 2; - break; - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MethodOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.http"] != null) { - if (typeof object[".google.api.http"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); - message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); - } - if (object[".google.api.methodSignature"]) { - if (!Array.isArray(object[".google.api.methodSignature"])) - throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); - message[".google.api.methodSignature"] = []; - for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) - message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); - } - if (object[".google.longrunning.operationInfo"] != null) { - if (typeof object[".google.longrunning.operationInfo"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); - message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); - } - return message; - }; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.MethodOptions} message MethodOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.methodSignature"] = []; - } - if (options.defaults) { - object.deprecated = false; - object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; - object.features = null; - object[".google.longrunning.operationInfo"] = null; - object[".google.api.http"] = null; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) - object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); - if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { - object[".google.api.methodSignature"] = []; - for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) - object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) - object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); - return object; - }; - - /** - * Converts this MethodOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MethodOptions - * @instance - * @returns {Object.} JSON object - */ - MethodOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodOptions - * @function getTypeUrl - * @memberof google.protobuf.MethodOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodOptions"; - }; - - /** - * IdempotencyLevel enum. - * @name google.protobuf.MethodOptions.IdempotencyLevel - * @enum {number} - * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value - * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value - * @property {number} IDEMPOTENT=2 IDEMPOTENT value - */ - MethodOptions.IdempotencyLevel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; - values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; - values[valuesById[2] = "IDEMPOTENT"] = 2; - return values; - })(); - - return MethodOptions; - })(); - - protobuf.UninterpretedOption = (function() { - - /** - * Properties of an UninterpretedOption. - * @memberof google.protobuf - * @interface IUninterpretedOption - * @property {Array.|null} [name] UninterpretedOption name - * @property {string|null} [identifierValue] UninterpretedOption identifierValue - * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue - * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue - * @property {number|null} [doubleValue] UninterpretedOption doubleValue - * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue - * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue - */ - - /** - * Constructs a new UninterpretedOption. - * @memberof google.protobuf - * @classdesc Represents an UninterpretedOption. - * @implements IUninterpretedOption - * @constructor - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - */ - function UninterpretedOption(properties) { - this.name = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UninterpretedOption name. - * @member {Array.} name - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.name = $util.emptyArray; - - /** - * UninterpretedOption identifierValue. - * @member {string} identifierValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.identifierValue = ""; - - /** - * UninterpretedOption positiveIntValue. - * @member {number|Long} positiveIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * UninterpretedOption negativeIntValue. - * @member {number|Long} negativeIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * UninterpretedOption doubleValue. - * @member {number} doubleValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.doubleValue = 0; - - /** - * UninterpretedOption stringValue. - * @member {Uint8Array} stringValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.stringValue = $util.newBuffer([]); - - /** - * UninterpretedOption aggregateValue. - * @member {string} aggregateValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.aggregateValue = ""; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance - */ - UninterpretedOption.create = function create(properties) { - return new UninterpretedOption(properties); - }; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.name.length) - for (var i = 0; i < message.name.length; ++i) - $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); - if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); - if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); - if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) - writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); - if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); - return writer; - }; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - if (!(message.name && message.name.length)) - message.name = []; - message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); - break; - } - case 3: { - message.identifierValue = reader.string(); - break; - } - case 4: { - message.positiveIntValue = reader.uint64(); - break; - } - case 5: { - message.negativeIntValue = reader.int64(); - break; - } - case 6: { - message.doubleValue = reader.double(); - break; - } - case 7: { - message.stringValue = reader.bytes(); - break; - } - case 8: { - message.aggregateValue = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UninterpretedOption message. - * @function verify - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UninterpretedOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) { - if (!Array.isArray(message.name)) - return "name: array expected"; - for (var i = 0; i < message.name.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); - if (error) - return "name." + error; - } - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - if (!$util.isString(message.identifierValue)) - return "identifierValue: string expected"; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) - return "positiveIntValue: integer|Long expected"; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) - return "negativeIntValue: integer|Long expected"; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - if (typeof message.doubleValue !== "number") - return "doubleValue: number expected"; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) - return "stringValue: buffer expected"; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - if (!$util.isString(message.aggregateValue)) - return "aggregateValue: string expected"; - return null; - }; - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - */ - UninterpretedOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption) - return object; - var message = new $root.google.protobuf.UninterpretedOption(); - if (object.name) { - if (!Array.isArray(object.name)) - throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); - message.name = []; - for (var i = 0; i < object.name.length; ++i) { - if (typeof object.name[i] !== "object") - throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); - message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); - } - } - if (object.identifierValue != null) - message.identifierValue = String(object.identifierValue); - if (object.positiveIntValue != null) - if ($util.Long) - (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; - else if (typeof object.positiveIntValue === "string") - message.positiveIntValue = parseInt(object.positiveIntValue, 10); - else if (typeof object.positiveIntValue === "number") - message.positiveIntValue = object.positiveIntValue; - else if (typeof object.positiveIntValue === "object") - message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); - if (object.negativeIntValue != null) - if ($util.Long) - (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; - else if (typeof object.negativeIntValue === "string") - message.negativeIntValue = parseInt(object.negativeIntValue, 10); - else if (typeof object.negativeIntValue === "number") - message.negativeIntValue = object.negativeIntValue; - else if (typeof object.negativeIntValue === "object") - message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); - if (object.doubleValue != null) - message.doubleValue = Number(object.doubleValue); - if (object.stringValue != null) - if (typeof object.stringValue === "string") - $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); - else if (object.stringValue.length >= 0) - message.stringValue = object.stringValue; - if (object.aggregateValue != null) - message.aggregateValue = String(object.aggregateValue); - return message; - }; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.UninterpretedOption} message UninterpretedOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UninterpretedOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.name = []; - if (options.defaults) { - object.identifierValue = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.positiveIntValue = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.negativeIntValue = options.longs === String ? "0" : 0; - object.doubleValue = 0; - if (options.bytes === String) - object.stringValue = ""; - else { - object.stringValue = []; - if (options.bytes !== Array) - object.stringValue = $util.newBuffer(object.stringValue); - } - object.aggregateValue = ""; - } - if (message.name && message.name.length) { - object.name = []; - for (var j = 0; j < message.name.length; ++j) - object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - object.identifierValue = message.identifierValue; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (typeof message.positiveIntValue === "number") - object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; - else - object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (typeof message.negativeIntValue === "number") - object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; - else - object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - object.aggregateValue = message.aggregateValue; - return object; - }; - - /** - * Converts this UninterpretedOption to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption - * @instance - * @returns {Object.} JSON object - */ - UninterpretedOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UninterpretedOption - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; - }; - - UninterpretedOption.NamePart = (function() { - - /** - * Properties of a NamePart. - * @memberof google.protobuf.UninterpretedOption - * @interface INamePart - * @property {string} namePart NamePart namePart - * @property {boolean} isExtension NamePart isExtension - */ - - /** - * Constructs a new NamePart. - * @memberof google.protobuf.UninterpretedOption - * @classdesc Represents a NamePart. - * @implements INamePart - * @constructor - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - */ - function NamePart(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NamePart namePart. - * @member {string} namePart - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.namePart = ""; - - /** - * NamePart isExtension. - * @member {boolean} isExtension - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.isExtension = false; - - /** - * Creates a new NamePart instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance - */ - NamePart.create = function create(properties) { - return new NamePart(properties); - }; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); - return writer; - }; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.namePart = reader.string(); - break; - } - case 2: { - message.isExtension = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - if (!message.hasOwnProperty("namePart")) - throw $util.ProtocolError("missing required 'namePart'", { instance: message }); - if (!message.hasOwnProperty("isExtension")) - throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); - return message; - }; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NamePart message. - * @function verify - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NamePart.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (!$util.isString(message.namePart)) - return "namePart: string expected"; - if (typeof message.isExtension !== "boolean") - return "isExtension: boolean expected"; - return null; - }; - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - */ - NamePart.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) - return object; - var message = new $root.google.protobuf.UninterpretedOption.NamePart(); - if (object.namePart != null) - message.namePart = String(object.namePart); - if (object.isExtension != null) - message.isExtension = Boolean(object.isExtension); - return message; - }; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NamePart.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.namePart = ""; - object.isExtension = false; - } - if (message.namePart != null && message.hasOwnProperty("namePart")) - object.namePart = message.namePart; - if (message.isExtension != null && message.hasOwnProperty("isExtension")) - object.isExtension = message.isExtension; - return object; - }; - - /** - * Converts this NamePart to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - * @returns {Object.} JSON object - */ - NamePart.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NamePart - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; - }; - - return NamePart; - })(); - - return UninterpretedOption; - })(); - - protobuf.FeatureSet = (function() { - - /** - * Properties of a FeatureSet. - * @memberof google.protobuf - * @interface IFeatureSet - * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence - * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType - * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding - * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation - * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding - * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat - */ - - /** - * Constructs a new FeatureSet. - * @memberof google.protobuf - * @classdesc Represents a FeatureSet. - * @implements IFeatureSet - * @constructor - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - */ - function FeatureSet(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSet fieldPresence. - * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.fieldPresence = 0; - - /** - * FeatureSet enumType. - * @member {google.protobuf.FeatureSet.EnumType} enumType - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.enumType = 0; - - /** - * FeatureSet repeatedFieldEncoding. - * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.repeatedFieldEncoding = 0; - - /** - * FeatureSet utf8Validation. - * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.utf8Validation = 0; - - /** - * FeatureSet messageEncoding. - * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.messageEncoding = 0; - - /** - * FeatureSet jsonFormat. - * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.jsonFormat = 0; - - /** - * Creates a new FeatureSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - * @returns {google.protobuf.FeatureSet} FeatureSet instance - */ - FeatureSet.create = function create(properties) { - return new FeatureSet(properties); - }; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); - if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); - if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); - if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); - if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); - if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); - return writer; - }; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.fieldPresence = reader.int32(); - break; - } - case 2: { - message.enumType = reader.int32(); - break; - } - case 3: { - message.repeatedFieldEncoding = reader.int32(); - break; - } - case 4: { - message.utf8Validation = reader.int32(); - break; - } - case 5: { - message.messageEncoding = reader.int32(); - break; - } - case 6: { - message.jsonFormat = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSet message. - * @function verify - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - switch (message.fieldPresence) { - default: - return "fieldPresence: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.enumType != null && message.hasOwnProperty("enumType")) - switch (message.enumType) { - default: - return "enumType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - switch (message.repeatedFieldEncoding) { - default: - return "repeatedFieldEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - switch (message.utf8Validation) { - default: - return "utf8Validation: enum value expected"; - case 0: - case 2: - case 3: - break; - } - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - switch (message.messageEncoding) { - default: - return "messageEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - switch (message.jsonFormat) { - default: - return "jsonFormat: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSet} FeatureSet - */ - FeatureSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSet) - return object; - var message = new $root.google.protobuf.FeatureSet(); - switch (object.fieldPresence) { - default: - if (typeof object.fieldPresence === "number") { - message.fieldPresence = object.fieldPresence; - break; - } - break; - case "FIELD_PRESENCE_UNKNOWN": - case 0: - message.fieldPresence = 0; - break; - case "EXPLICIT": - case 1: - message.fieldPresence = 1; - break; - case "IMPLICIT": - case 2: - message.fieldPresence = 2; - break; - case "LEGACY_REQUIRED": - case 3: - message.fieldPresence = 3; - break; - } - switch (object.enumType) { - default: - if (typeof object.enumType === "number") { - message.enumType = object.enumType; - break; - } - break; - case "ENUM_TYPE_UNKNOWN": - case 0: - message.enumType = 0; - break; - case "OPEN": - case 1: - message.enumType = 1; - break; - case "CLOSED": - case 2: - message.enumType = 2; - break; - } - switch (object.repeatedFieldEncoding) { - default: - if (typeof object.repeatedFieldEncoding === "number") { - message.repeatedFieldEncoding = object.repeatedFieldEncoding; - break; - } - break; - case "REPEATED_FIELD_ENCODING_UNKNOWN": - case 0: - message.repeatedFieldEncoding = 0; - break; - case "PACKED": - case 1: - message.repeatedFieldEncoding = 1; - break; - case "EXPANDED": - case 2: - message.repeatedFieldEncoding = 2; - break; - } - switch (object.utf8Validation) { - default: - if (typeof object.utf8Validation === "number") { - message.utf8Validation = object.utf8Validation; - break; - } - break; - case "UTF8_VALIDATION_UNKNOWN": - case 0: - message.utf8Validation = 0; - break; - case "VERIFY": - case 2: - message.utf8Validation = 2; - break; - case "NONE": - case 3: - message.utf8Validation = 3; - break; - } - switch (object.messageEncoding) { - default: - if (typeof object.messageEncoding === "number") { - message.messageEncoding = object.messageEncoding; - break; - } - break; - case "MESSAGE_ENCODING_UNKNOWN": - case 0: - message.messageEncoding = 0; - break; - case "LENGTH_PREFIXED": - case 1: - message.messageEncoding = 1; - break; - case "DELIMITED": - case 2: - message.messageEncoding = 2; - break; - } - switch (object.jsonFormat) { - default: - if (typeof object.jsonFormat === "number") { - message.jsonFormat = object.jsonFormat; - break; - } - break; - case "JSON_FORMAT_UNKNOWN": - case 0: - message.jsonFormat = 0; - break; - case "ALLOW": - case 1: - message.jsonFormat = 1; - break; - case "LEGACY_BEST_EFFORT": - case 2: - message.jsonFormat = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.FeatureSet} message FeatureSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; - object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; - object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; - object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; - object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; - object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; - } - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; - if (message.enumType != null && message.hasOwnProperty("enumType")) - object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; - return object; - }; - - /** - * Converts this FeatureSet to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSet - * @instance - * @returns {Object.} JSON object - */ - FeatureSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSet - * @function getTypeUrl - * @memberof google.protobuf.FeatureSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSet"; - }; - - /** - * FieldPresence enum. - * @name google.protobuf.FeatureSet.FieldPresence - * @enum {number} - * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value - * @property {number} EXPLICIT=1 EXPLICIT value - * @property {number} IMPLICIT=2 IMPLICIT value - * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value - */ - FeatureSet.FieldPresence = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; - values[valuesById[1] = "EXPLICIT"] = 1; - values[valuesById[2] = "IMPLICIT"] = 2; - values[valuesById[3] = "LEGACY_REQUIRED"] = 3; - return values; - })(); - - /** - * EnumType enum. - * @name google.protobuf.FeatureSet.EnumType - * @enum {number} - * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value - * @property {number} OPEN=1 OPEN value - * @property {number} CLOSED=2 CLOSED value - */ - FeatureSet.EnumType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "OPEN"] = 1; - values[valuesById[2] = "CLOSED"] = 2; - return values; - })(); - - /** - * RepeatedFieldEncoding enum. - * @name google.protobuf.FeatureSet.RepeatedFieldEncoding - * @enum {number} - * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value - * @property {number} PACKED=1 PACKED value - * @property {number} EXPANDED=2 EXPANDED value - */ - FeatureSet.RepeatedFieldEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "PACKED"] = 1; - values[valuesById[2] = "EXPANDED"] = 2; - return values; - })(); - - /** - * Utf8Validation enum. - * @name google.protobuf.FeatureSet.Utf8Validation - * @enum {number} - * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value - * @property {number} VERIFY=2 VERIFY value - * @property {number} NONE=3 NONE value - */ - FeatureSet.Utf8Validation = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; - values[valuesById[2] = "VERIFY"] = 2; - values[valuesById[3] = "NONE"] = 3; - return values; - })(); - - /** - * MessageEncoding enum. - * @name google.protobuf.FeatureSet.MessageEncoding - * @enum {number} - * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value - * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value - * @property {number} DELIMITED=2 DELIMITED value - */ - FeatureSet.MessageEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "LENGTH_PREFIXED"] = 1; - values[valuesById[2] = "DELIMITED"] = 2; - return values; - })(); - - /** - * JsonFormat enum. - * @name google.protobuf.FeatureSet.JsonFormat - * @enum {number} - * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value - * @property {number} ALLOW=1 ALLOW value - * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value - */ - FeatureSet.JsonFormat = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; - values[valuesById[1] = "ALLOW"] = 1; - values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; - return values; - })(); - - return FeatureSet; - })(); - - protobuf.FeatureSetDefaults = (function() { - - /** - * Properties of a FeatureSetDefaults. - * @memberof google.protobuf - * @interface IFeatureSetDefaults - * @property {Array.|null} [defaults] FeatureSetDefaults defaults - * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition - * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition - */ - - /** - * Constructs a new FeatureSetDefaults. - * @memberof google.protobuf - * @classdesc Represents a FeatureSetDefaults. - * @implements IFeatureSetDefaults - * @constructor - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - */ - function FeatureSetDefaults(properties) { - this.defaults = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSetDefaults defaults. - * @member {Array.} defaults - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.defaults = $util.emptyArray; - - /** - * FeatureSetDefaults minimumEdition. - * @member {google.protobuf.Edition} minimumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.minimumEdition = 0; - - /** - * FeatureSetDefaults maximumEdition. - * @member {google.protobuf.Edition} maximumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.maximumEdition = 0; - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance - */ - FeatureSetDefaults.create = function create(properties) { - return new FeatureSetDefaults(properties); - }; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.defaults != null && message.defaults.length) - for (var i = 0; i < message.defaults.length; ++i) - $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); - if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); - return writer; - }; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.defaults && message.defaults.length)) - message.defaults = []; - message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); - break; - } - case 4: { - message.minimumEdition = reader.int32(); - break; - } - case 5: { - message.maximumEdition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetDefaults message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetDefaults.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.defaults != null && message.hasOwnProperty("defaults")) { - if (!Array.isArray(message.defaults)) - return "defaults: array expected"; - for (var i = 0; i < message.defaults.length; ++i) { - var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); - if (error) - return "defaults." + error; - } - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - switch (message.minimumEdition) { - default: - return "minimumEdition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - switch (message.maximumEdition) { - default: - return "maximumEdition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - */ - FeatureSetDefaults.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults(); - if (object.defaults) { - if (!Array.isArray(object.defaults)) - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); - message.defaults = []; - for (var i = 0; i < object.defaults.length; ++i) { - if (typeof object.defaults[i] !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); - message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); - } - } - switch (object.minimumEdition) { - default: - if (typeof object.minimumEdition === "number") { - message.minimumEdition = object.minimumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.minimumEdition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.minimumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.minimumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.minimumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.minimumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.minimumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.minimumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.minimumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.minimumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.minimumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.minimumEdition = 2147483647; - break; - } - switch (object.maximumEdition) { - default: - if (typeof object.maximumEdition === "number") { - message.maximumEdition = object.maximumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.maximumEdition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.maximumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.maximumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.maximumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.maximumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.maximumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.maximumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.maximumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.maximumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.maximumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.maximumEdition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetDefaults.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.defaults = []; - if (options.defaults) { - object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.defaults && message.defaults.length) { - object.defaults = []; - for (var j = 0; j < message.defaults.length; ++j) - object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; - return object; - }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults - * @instance - * @returns {Object.} JSON object - */ - FeatureSetDefaults.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetDefaults - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; - }; - - FeatureSetDefaults.FeatureSetEditionDefault = (function() { - - /** - * Properties of a FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @interface IFeatureSetEditionDefault - * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition - * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features - */ - - /** - * Constructs a new FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @classdesc Represents a FeatureSetEditionDefault. - * @implements IFeatureSetEditionDefault - * @constructor - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - */ - function FeatureSetEditionDefault(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSetEditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.edition = 0; - - /** - * FeatureSetEditionDefault features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.features = null; - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance - */ - FeatureSetEditionDefault.create = function create(properties) { - return new FeatureSetEditionDefault(properties); - }; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetEditionDefault message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetEditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - return null; - }; - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - */ - FeatureSetEditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetEditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.features = null; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - * @returns {Object.} JSON object - */ - FeatureSetEditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; - }; - - return FeatureSetEditionDefault; - })(); - - return FeatureSetDefaults; - })(); - - protobuf.SourceCodeInfo = (function() { - - /** - * Properties of a SourceCodeInfo. - * @memberof google.protobuf - * @interface ISourceCodeInfo - * @property {Array.|null} [location] SourceCodeInfo location - */ - - /** - * Constructs a new SourceCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a SourceCodeInfo. - * @implements ISourceCodeInfo - * @constructor - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - */ - function SourceCodeInfo(properties) { - this.location = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SourceCodeInfo location. - * @member {Array.} location - * @memberof google.protobuf.SourceCodeInfo - * @instance - */ - SourceCodeInfo.prototype.location = $util.emptyArray; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance - */ - SourceCodeInfo.create = function create(properties) { - return new SourceCodeInfo(properties); - }; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.location != null && message.location.length) - for (var i = 0; i < message.location.length; ++i) - $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.location && message.location.length)) - message.location = []; - message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SourceCodeInfo message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SourceCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) { - if (!Array.isArray(message.location)) - return "location: array expected"; - for (var i = 0; i < message.location.length; ++i) { - var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); - if (error) - return "location." + error; - } - } - return null; - }; - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - */ - SourceCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo) - return object; - var message = new $root.google.protobuf.SourceCodeInfo(); - if (object.location) { - if (!Array.isArray(object.location)) - throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); - message.location = []; - for (var i = 0; i < object.location.length; ++i) { - if (typeof object.location[i] !== "object") - throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); - message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SourceCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.location = []; - if (message.location && message.location.length) { - object.location = []; - for (var j = 0; j < message.location.length; ++j) - object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); - } - return object; - }; - - /** - * Converts this SourceCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo - * @instance - * @returns {Object.} JSON object - */ - SourceCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SourceCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; - }; - - SourceCodeInfo.Location = (function() { - - /** - * Properties of a Location. - * @memberof google.protobuf.SourceCodeInfo - * @interface ILocation - * @property {Array.|null} [path] Location path - * @property {Array.|null} [span] Location span - * @property {string|null} [leadingComments] Location leadingComments - * @property {string|null} [trailingComments] Location trailingComments - * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments - */ - - /** - * Constructs a new Location. - * @memberof google.protobuf.SourceCodeInfo - * @classdesc Represents a Location. - * @implements ILocation - * @constructor - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - */ - function Location(properties) { - this.path = []; - this.span = []; - this.leadingDetachedComments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Location path. - * @member {Array.} path - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.path = $util.emptyArray; - - /** - * Location span. - * @member {Array.} span - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.span = $util.emptyArray; - - /** - * Location leadingComments. - * @member {string} leadingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingComments = ""; - - /** - * Location trailingComments. - * @member {string} trailingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.trailingComments = ""; - - /** - * Location leadingDetachedComments. - * @member {Array.} leadingDetachedComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingDetachedComments = $util.emptyArray; - - /** - * Creates a new Location instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo.Location} Location instance - */ - Location.create = function create(properties) { - return new Location(properties); - }; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.span != null && message.span.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.span.length; ++i) - writer.int32(message.span[i]); - writer.ldelim(); - } - if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); - if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); - return writer; - }; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Location message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - if (!(message.span && message.span.length)) - message.span = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.span.push(reader.int32()); - } else - message.span.push(reader.int32()); - break; - } - case 3: { - message.leadingComments = reader.string(); - break; - } - case 4: { - message.trailingComments = reader.string(); - break; - } - case 6: { - if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) - message.leadingDetachedComments = []; - message.leadingDetachedComments.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Location message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Location.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.span != null && message.hasOwnProperty("span")) { - if (!Array.isArray(message.span)) - return "span: array expected"; - for (var i = 0; i < message.span.length; ++i) - if (!$util.isInteger(message.span[i])) - return "span: integer[] expected"; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - if (!$util.isString(message.leadingComments)) - return "leadingComments: string expected"; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - if (!$util.isString(message.trailingComments)) - return "trailingComments: string expected"; - if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { - if (!Array.isArray(message.leadingDetachedComments)) - return "leadingDetachedComments: array expected"; - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - if (!$util.isString(message.leadingDetachedComments[i])) - return "leadingDetachedComments: string[] expected"; - } - return null; - }; - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo.Location} Location - */ - Location.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) - return object; - var message = new $root.google.protobuf.SourceCodeInfo.Location(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.span) { - if (!Array.isArray(object.span)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); - message.span = []; - for (var i = 0; i < object.span.length; ++i) - message.span[i] = object.span[i] | 0; - } - if (object.leadingComments != null) - message.leadingComments = String(object.leadingComments); - if (object.trailingComments != null) - message.trailingComments = String(object.trailingComments); - if (object.leadingDetachedComments) { - if (!Array.isArray(object.leadingDetachedComments)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); - message.leadingDetachedComments = []; - for (var i = 0; i < object.leadingDetachedComments.length; ++i) - message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); - } - return message; - }; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.Location} message Location - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Location.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.path = []; - object.span = []; - object.leadingDetachedComments = []; - } - if (options.defaults) { - object.leadingComments = ""; - object.trailingComments = ""; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.span && message.span.length) { - object.span = []; - for (var j = 0; j < message.span.length; ++j) - object.span[j] = message.span[j]; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - object.leadingComments = message.leadingComments; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - object.trailingComments = message.trailingComments; - if (message.leadingDetachedComments && message.leadingDetachedComments.length) { - object.leadingDetachedComments = []; - for (var j = 0; j < message.leadingDetachedComments.length; ++j) - object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; - } - return object; - }; - - /** - * Converts this Location to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - * @returns {Object.} JSON object - */ - Location.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Location - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; - }; - - return Location; - })(); - - return SourceCodeInfo; - })(); - - protobuf.GeneratedCodeInfo = (function() { - - /** - * Properties of a GeneratedCodeInfo. - * @memberof google.protobuf - * @interface IGeneratedCodeInfo - * @property {Array.|null} [annotation] GeneratedCodeInfo annotation - */ - - /** - * Constructs a new GeneratedCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a GeneratedCodeInfo. - * @implements IGeneratedCodeInfo - * @constructor - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - */ - function GeneratedCodeInfo(properties) { - this.annotation = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GeneratedCodeInfo annotation. - * @member {Array.} annotation - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - */ - GeneratedCodeInfo.prototype.annotation = $util.emptyArray; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance - */ - GeneratedCodeInfo.create = function create(properties) { - return new GeneratedCodeInfo(properties); - }; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.annotation != null && message.annotation.length) - for (var i = 0; i < message.annotation.length; ++i) - $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.annotation && message.annotation.length)) - message.annotation = []; - message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GeneratedCodeInfo message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GeneratedCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.annotation != null && message.hasOwnProperty("annotation")) { - if (!Array.isArray(message.annotation)) - return "annotation: array expected"; - for (var i = 0; i < message.annotation.length; ++i) { - var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); - if (error) - return "annotation." + error; - } - } - return null; - }; - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - */ - GeneratedCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo(); - if (object.annotation) { - if (!Array.isArray(object.annotation)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); - message.annotation = []; - for (var i = 0; i < object.annotation.length; ++i) { - if (typeof object.annotation[i] !== "object") - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); - message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GeneratedCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.annotation = []; - if (message.annotation && message.annotation.length) { - object.annotation = []; - for (var j = 0; j < message.annotation.length; ++j) - object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); - } - return object; - }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - * @returns {Object.} JSON object - */ - GeneratedCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; - }; - - GeneratedCodeInfo.Annotation = (function() { - - /** - * Properties of an Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @interface IAnnotation - * @property {Array.|null} [path] Annotation path - * @property {string|null} [sourceFile] Annotation sourceFile - * @property {number|null} [begin] Annotation begin - * @property {number|null} [end] Annotation end - * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic - */ - - /** - * Constructs a new Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @classdesc Represents an Annotation. - * @implements IAnnotation - * @constructor - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - */ - function Annotation(properties) { - this.path = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Annotation path. - * @member {Array.} path - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.path = $util.emptyArray; - - /** - * Annotation sourceFile. - * @member {string} sourceFile - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.sourceFile = ""; - - /** - * Annotation begin. - * @member {number} begin - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.begin = 0; - - /** - * Annotation end. - * @member {number} end - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.end = 0; - - /** - * Annotation semantic. - * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.semantic = 0; - - /** - * Creates a new Annotation instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance - */ - Annotation.create = function create(properties) { - return new Annotation(properties); - }; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); - if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); - return writer; - }; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - message.sourceFile = reader.string(); - break; - } - case 3: { - message.begin = reader.int32(); - break; - } - case 4: { - message.end = reader.int32(); - break; - } - case 5: { - message.semantic = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Annotation message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Annotation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - if (!$util.isString(message.sourceFile)) - return "sourceFile: string expected"; - if (message.begin != null && message.hasOwnProperty("begin")) - if (!$util.isInteger(message.begin)) - return "begin: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.semantic != null && message.hasOwnProperty("semantic")) - switch (message.semantic) { - default: - return "semantic: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - */ - Annotation.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.sourceFile != null) - message.sourceFile = String(object.sourceFile); - if (object.begin != null) - message.begin = object.begin | 0; - if (object.end != null) - message.end = object.end | 0; - switch (object.semantic) { - default: - if (typeof object.semantic === "number") { - message.semantic = object.semantic; - break; - } - break; - case "NONE": - case 0: - message.semantic = 0; - break; - case "SET": - case 1: - message.semantic = 1; - break; - case "ALIAS": - case 2: - message.semantic = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Annotation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.path = []; - if (options.defaults) { - object.sourceFile = ""; - object.begin = 0; - object.end = 0; - object.semantic = options.enums === String ? "NONE" : 0; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - object.sourceFile = message.sourceFile; - if (message.begin != null && message.hasOwnProperty("begin")) - object.begin = message.begin; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.semantic != null && message.hasOwnProperty("semantic")) - object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; - return object; - }; - - /** - * Converts this Annotation to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - * @returns {Object.} JSON object - */ - Annotation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Annotation - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; - }; - - /** - * Semantic enum. - * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic - * @enum {number} - * @property {number} NONE=0 NONE value - * @property {number} SET=1 SET value - * @property {number} ALIAS=2 ALIAS value - */ - Annotation.Semantic = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NONE"] = 0; - values[valuesById[1] = "SET"] = 1; - values[valuesById[2] = "ALIAS"] = 2; - return values; - })(); - - return Annotation; - })(); - - return GeneratedCodeInfo; - })(); - - protobuf.Duration = (function() { - - /** - * Properties of a Duration. - * @memberof google.protobuf - * @interface IDuration - * @property {number|Long|null} [seconds] Duration seconds - * @property {number|null} [nanos] Duration nanos - */ - - /** - * Constructs a new Duration. - * @memberof google.protobuf - * @classdesc Represents a Duration. - * @implements IDuration - * @constructor - * @param {google.protobuf.IDuration=} [properties] Properties to set - */ - function Duration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Duration seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Duration nanos. - * @member {number} nanos - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.nanos = 0; - - /** - * Creates a new Duration instance using the specified properties. - * @function create - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration=} [properties] Properties to set - * @returns {google.protobuf.Duration} Duration instance - */ - Duration.create = function create(properties) { - return new Duration(properties); - }; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Duration message. - * @function verify - * @memberof google.protobuf.Duration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Duration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Duration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Duration} Duration - */ - Duration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Duration) - return object; - var message = new $root.google.protobuf.Duration(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.Duration} message Duration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Duration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Duration to JSON. - * @function toJSON - * @memberof google.protobuf.Duration - * @instance - * @returns {Object.} JSON object - */ - Duration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Duration - * @function getTypeUrl - * @memberof google.protobuf.Duration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Duration"; - }; - - return Duration; - })(); - - protobuf.Timestamp = (function() { - - /** - * Properties of a Timestamp. - * @memberof google.protobuf - * @interface ITimestamp - * @property {number|Long|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos - */ - - /** - * Constructs a new Timestamp. - * @memberof google.protobuf - * @classdesc Represents a Timestamp. - * @implements ITimestamp - * @constructor - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - */ - function Timestamp(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Timestamp seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Timestamp nanos. - * @member {number} nanos - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.nanos = 0; - - /** - * Creates a new Timestamp instance using the specified properties. - * @function create - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - * @returns {google.protobuf.Timestamp} Timestamp instance - */ - Timestamp.create = function create(properties) { - return new Timestamp(properties); - }; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Timestamp message. - * @function verify - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Timestamp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Timestamp} Timestamp - */ - Timestamp.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Timestamp) - return object; - var message = new $root.google.protobuf.Timestamp(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.Timestamp} message Timestamp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Timestamp.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Timestamp to JSON. - * @function toJSON - * @memberof google.protobuf.Timestamp - * @instance - * @returns {Object.} JSON object - */ - Timestamp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Timestamp - * @function getTypeUrl - * @memberof google.protobuf.Timestamp - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Timestamp"; - }; - - return Timestamp; - })(); - - protobuf.Any = (function() { - - /** - * Properties of an Any. - * @memberof google.protobuf - * @interface IAny - * @property {string|null} [type_url] Any type_url - * @property {Uint8Array|null} [value] Any value - */ - - /** - * Constructs a new Any. - * @memberof google.protobuf - * @classdesc Represents an Any. - * @implements IAny - * @constructor - * @param {google.protobuf.IAny=} [properties] Properties to set - */ - function Any(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Any type_url. - * @member {string} type_url - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.type_url = ""; - - /** - * Any value. - * @member {Uint8Array} value - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.value = $util.newBuffer([]); - - /** - * Creates a new Any instance using the specified properties. - * @function create - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny=} [properties] Properties to set - * @returns {google.protobuf.Any} Any instance - */ - Any.create = function create(properties) { - return new Any(properties); - }; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Any message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.type_url = reader.string(); - break; - } - case 2: { - message.value = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Any message. - * @function verify - * @memberof google.protobuf.Any - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Any.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type_url != null && message.hasOwnProperty("type_url")) - if (!$util.isString(message.type_url)) - return "type_url: string expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Any - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Any} Any - */ - Any.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Any) - return object; - var message = new $root.google.protobuf.Any(); - if (object.type_url != null) - message.type_url = String(object.type_url); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length >= 0) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.Any} message Any - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Any.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type_url = ""; - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - } - if (message.type_url != null && message.hasOwnProperty("type_url")) - object.type_url = message.type_url; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this Any to JSON. - * @function toJSON - * @memberof google.protobuf.Any - * @instance - * @returns {Object.} JSON object - */ - Any.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Any - * @function getTypeUrl - * @memberof google.protobuf.Any - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Any"; - }; - - return Any; - })(); - - protobuf.Empty = (function() { - - /** - * Properties of an Empty. - * @memberof google.protobuf - * @interface IEmpty - */ - - /** - * Constructs a new Empty. - * @memberof google.protobuf - * @classdesc Represents an Empty. - * @implements IEmpty - * @constructor - * @param {google.protobuf.IEmpty=} [properties] Properties to set - */ - function Empty(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Creates a new Empty instance using the specified properties. - * @function create - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty=} [properties] Properties to set - * @returns {google.protobuf.Empty} Empty instance - */ - Empty.create = function create(properties) { - return new Empty(properties); - }; - - /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Empty.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Empty.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Empty message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Empty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Empty} Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Empty.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Empty message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Empty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Empty} Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Empty.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Empty message. - * @function verify - * @memberof google.protobuf.Empty - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Empty.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Empty - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Empty} Empty - */ - Empty.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Empty) - return object; - return new $root.google.protobuf.Empty(); - }; - - /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.Empty} message Empty - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Empty.toObject = function toObject() { - return {}; - }; - - /** - * Converts this Empty to JSON. - * @function toJSON - * @memberof google.protobuf.Empty - * @instance - * @returns {Object.} JSON object - */ - Empty.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Empty - * @function getTypeUrl - * @memberof google.protobuf.Empty - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Empty"; - }; - - return Empty; - })(); - - return protobuf; - })(); - - google.longrunning = (function() { - - /** - * Namespace longrunning. - * @memberof google - * @namespace - */ - var longrunning = {}; - - longrunning.Operations = (function() { - - /** - * Constructs a new Operations service. - * @memberof google.longrunning - * @classdesc Represents an Operations - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Operations(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; - - /** - * Creates new Operations service using the specified rpc implementation. - * @function create - * @memberof google.longrunning.Operations - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. - */ - Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.longrunning.Operations|listOperations}. - * @memberof google.longrunning.Operations - * @typedef ListOperationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse - */ - - /** - * Calls ListOperations. - * @function listOperations - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object - * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { - return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); - }, "name", { value: "ListOperations" }); - - /** - * Calls ListOperations. - * @function listOperations - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|getOperation}. - * @memberof google.longrunning.Operations - * @typedef GetOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls GetOperation. - * @function getOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object - * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { - return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "GetOperation" }); - - /** - * Calls GetOperation. - * @function getOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|deleteOperation}. - * @memberof google.longrunning.Operations - * @typedef DeleteOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteOperation. - * @function deleteOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object - * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { - return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteOperation" }); - - /** - * Calls DeleteOperation. - * @function deleteOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|cancelOperation}. - * @memberof google.longrunning.Operations - * @typedef CancelOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls CancelOperation. - * @function cancelOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object - * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { - return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "CancelOperation" }); - - /** - * Calls CancelOperation. - * @function cancelOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|waitOperation}. - * @memberof google.longrunning.Operations - * @typedef WaitOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls WaitOperation. - * @function waitOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object - * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { - return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "WaitOperation" }); - - /** - * Calls WaitOperation. - * @function waitOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Operations; - })(); - - longrunning.Operation = (function() { - - /** - * Properties of an Operation. - * @memberof google.longrunning - * @interface IOperation - * @property {string|null} [name] Operation name - * @property {google.protobuf.IAny|null} [metadata] Operation metadata - * @property {boolean|null} [done] Operation done - * @property {google.rpc.IStatus|null} [error] Operation error - * @property {google.protobuf.IAny|null} [response] Operation response - */ - - /** - * Constructs a new Operation. - * @memberof google.longrunning - * @classdesc Represents an Operation. - * @implements IOperation - * @constructor - * @param {google.longrunning.IOperation=} [properties] Properties to set - */ - function Operation(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Operation name. - * @member {string} name - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.name = ""; - - /** - * Operation metadata. - * @member {google.protobuf.IAny|null|undefined} metadata - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.metadata = null; - - /** - * Operation done. - * @member {boolean} done - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.done = false; - - /** - * Operation error. - * @member {google.rpc.IStatus|null|undefined} error - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.error = null; - - /** - * Operation response. - * @member {google.protobuf.IAny|null|undefined} response - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.response = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Operation result. - * @member {"error"|"response"|undefined} result - * @memberof google.longrunning.Operation - * @instance - */ - Object.defineProperty(Operation.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["error", "response"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Operation instance using the specified properties. - * @function create - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation=} [properties] Properties to set - * @returns {google.longrunning.Operation} Operation instance - */ - Operation.create = function create(properties) { - return new Operation(properties); - }; - - /** - * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @function encode - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation} message Operation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Operation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.done != null && Object.hasOwnProperty.call(message, "done")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.response != null && Object.hasOwnProperty.call(message, "response")) - $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation} message Operation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Operation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Operation message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.Operation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.Operation} Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Operation.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - } - case 3: { - message.done = reader.bool(); - break; - } - case 4: { - message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 5: { - message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Operation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.Operation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.Operation} Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Operation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Operation message. - * @function verify - * @memberof google.longrunning.Operation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Operation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.protobuf.Any.verify(message.metadata); - if (error) - return "metadata." + error; - } - if (message.done != null && message.hasOwnProperty("done")) - if (typeof message.done !== "boolean") - return "done: boolean expected"; - if (message.error != null && message.hasOwnProperty("error")) { - properties.result = 1; - { - var error = $root.google.rpc.Status.verify(message.error); - if (error) - return "error." + error; - } - } - if (message.response != null && message.hasOwnProperty("response")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.google.protobuf.Any.verify(message.response); - if (error) - return "response." + error; - } - } - return null; - }; - - /** - * Creates an Operation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.Operation - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.Operation} Operation - */ - Operation.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.Operation) - return object; - var message = new $root.google.longrunning.Operation(); - if (object.name != null) - message.name = String(object.name); - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.longrunning.Operation.metadata: object expected"); - message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); - } - if (object.done != null) - message.done = Boolean(object.done); - if (object.error != null) { - if (typeof object.error !== "object") - throw TypeError(".google.longrunning.Operation.error: object expected"); - message.error = $root.google.rpc.Status.fromObject(object.error); - } - if (object.response != null) { - if (typeof object.response !== "object") - throw TypeError(".google.longrunning.Operation.response: object expected"); - message.response = $root.google.protobuf.Any.fromObject(object.response); - } - return message; - }; - - /** - * Creates a plain object from an Operation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.Operation} message Operation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Operation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.metadata = null; - object.done = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); - if (message.done != null && message.hasOwnProperty("done")) - object.done = message.done; - if (message.error != null && message.hasOwnProperty("error")) { - object.error = $root.google.rpc.Status.toObject(message.error, options); - if (options.oneofs) - object.result = "error"; - } - if (message.response != null && message.hasOwnProperty("response")) { - object.response = $root.google.protobuf.Any.toObject(message.response, options); - if (options.oneofs) - object.result = "response"; - } - return object; - }; - - /** - * Converts this Operation to JSON. - * @function toJSON - * @memberof google.longrunning.Operation - * @instance - * @returns {Object.} JSON object - */ - Operation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Operation - * @function getTypeUrl - * @memberof google.longrunning.Operation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.Operation"; - }; - - return Operation; - })(); - - longrunning.GetOperationRequest = (function() { - - /** - * Properties of a GetOperationRequest. - * @memberof google.longrunning - * @interface IGetOperationRequest - * @property {string|null} [name] GetOperationRequest name - */ - - /** - * Constructs a new GetOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a GetOperationRequest. - * @implements IGetOperationRequest - * @constructor - * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set - */ - function GetOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetOperationRequest name. - * @member {string} name - * @memberof google.longrunning.GetOperationRequest - * @instance - */ - GetOperationRequest.prototype.name = ""; - - /** - * Creates a new GetOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance - */ - GetOperationRequest.create = function create(properties) { - return new GetOperationRequest(properties); - }; - - /** - * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetOperationRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetOperationRequest message. - * @function verify - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - */ - GetOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.GetOperationRequest) - return object; - var message = new $root.google.longrunning.GetOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.GetOperationRequest} message GetOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this GetOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.GetOperationRequest - * @instance - * @returns {Object.} JSON object - */ - GetOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; - }; - - return GetOperationRequest; - })(); - - longrunning.ListOperationsRequest = (function() { - - /** - * Properties of a ListOperationsRequest. - * @memberof google.longrunning - * @interface IListOperationsRequest - * @property {string|null} [name] ListOperationsRequest name - * @property {string|null} [filter] ListOperationsRequest filter - * @property {number|null} [pageSize] ListOperationsRequest pageSize - * @property {string|null} [pageToken] ListOperationsRequest pageToken - */ - - /** - * Constructs a new ListOperationsRequest. - * @memberof google.longrunning - * @classdesc Represents a ListOperationsRequest. - * @implements IListOperationsRequest - * @constructor - * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set - */ - function ListOperationsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListOperationsRequest name. - * @member {string} name - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.name = ""; - - /** - * ListOperationsRequest filter. - * @member {string} filter - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.filter = ""; - - /** - * ListOperationsRequest pageSize. - * @member {number} pageSize - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.pageSize = 0; - - /** - * ListOperationsRequest pageToken. - * @member {string} pageToken - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListOperationsRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance - */ - ListOperationsRequest.create = function create(properties) { - return new ListOperationsRequest(properties); - }; - - /** - * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); - return writer; - }; - - /** - * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 4: { - message.name = reader.string(); - break; - } - case 1: { - message.filter = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListOperationsRequest message. - * @function verify - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListOperationsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - */ - ListOperationsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.ListOperationsRequest) - return object; - var message = new $root.google.longrunning.ListOperationsRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListOperationsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - object.name = ""; - } - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this ListOperationsRequest to JSON. - * @function toJSON - * @memberof google.longrunning.ListOperationsRequest - * @instance - * @returns {Object.} JSON object - */ - ListOperationsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListOperationsRequest - * @function getTypeUrl - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; - }; - - return ListOperationsRequest; - })(); - - longrunning.ListOperationsResponse = (function() { - - /** - * Properties of a ListOperationsResponse. - * @memberof google.longrunning - * @interface IListOperationsResponse - * @property {Array.|null} [operations] ListOperationsResponse operations - * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken - */ - - /** - * Constructs a new ListOperationsResponse. - * @memberof google.longrunning - * @classdesc Represents a ListOperationsResponse. - * @implements IListOperationsResponse - * @constructor - * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set - */ - function ListOperationsResponse(properties) { - this.operations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListOperationsResponse operations. - * @member {Array.} operations - * @memberof google.longrunning.ListOperationsResponse - * @instance - */ - ListOperationsResponse.prototype.operations = $util.emptyArray; - - /** - * ListOperationsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.longrunning.ListOperationsResponse - * @instance - */ - ListOperationsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListOperationsResponse instance using the specified properties. - * @function create - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance - */ - ListOperationsResponse.create = function create(properties) { - return new ListOperationsResponse(properties); - }; - - /** - * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @function encode - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.operations != null && message.operations.length) - for (var i = 0; i < message.operations.length; ++i) - $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.operations && message.operations.length)) - message.operations = []; - message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListOperationsResponse message. - * @function verify - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListOperationsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.operations != null && message.hasOwnProperty("operations")) { - if (!Array.isArray(message.operations)) - return "operations: array expected"; - for (var i = 0; i < message.operations.length; ++i) { - var error = $root.google.longrunning.Operation.verify(message.operations[i]); - if (error) - return "operations." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - */ - ListOperationsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.ListOperationsResponse) - return object; - var message = new $root.google.longrunning.ListOperationsResponse(); - if (object.operations) { - if (!Array.isArray(object.operations)) - throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); - message.operations = []; - for (var i = 0; i < object.operations.length; ++i) { - if (typeof object.operations[i] !== "object") - throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); - message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListOperationsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.operations = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.operations && message.operations.length) { - object.operations = []; - for (var j = 0; j < message.operations.length; ++j) - object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListOperationsResponse to JSON. - * @function toJSON - * @memberof google.longrunning.ListOperationsResponse - * @instance - * @returns {Object.} JSON object - */ - ListOperationsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListOperationsResponse - * @function getTypeUrl - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; - }; - - return ListOperationsResponse; - })(); - - longrunning.CancelOperationRequest = (function() { - - /** - * Properties of a CancelOperationRequest. - * @memberof google.longrunning - * @interface ICancelOperationRequest - * @property {string|null} [name] CancelOperationRequest name - */ - - /** - * Constructs a new CancelOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a CancelOperationRequest. - * @implements ICancelOperationRequest - * @constructor - * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set - */ - function CancelOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CancelOperationRequest name. - * @member {string} name - * @memberof google.longrunning.CancelOperationRequest - * @instance - */ - CancelOperationRequest.prototype.name = ""; - - /** - * Creates a new CancelOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance - */ - CancelOperationRequest.create = function create(properties) { - return new CancelOperationRequest(properties); - }; - - /** - * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelOperationRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CancelOperationRequest message. - * @function verify - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CancelOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - */ - CancelOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.CancelOperationRequest) - return object; - var message = new $root.google.longrunning.CancelOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CancelOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this CancelOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.CancelOperationRequest - * @instance - * @returns {Object.} JSON object - */ - CancelOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CancelOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; - }; - - return CancelOperationRequest; - })(); - - longrunning.DeleteOperationRequest = (function() { - - /** - * Properties of a DeleteOperationRequest. - * @memberof google.longrunning - * @interface IDeleteOperationRequest - * @property {string|null} [name] DeleteOperationRequest name - */ - - /** - * Constructs a new DeleteOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a DeleteOperationRequest. - * @implements IDeleteOperationRequest - * @constructor - * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set - */ - function DeleteOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteOperationRequest name. - * @member {string} name - * @memberof google.longrunning.DeleteOperationRequest - * @instance - */ - DeleteOperationRequest.prototype.name = ""; - - /** - * Creates a new DeleteOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance - */ - DeleteOperationRequest.create = function create(properties) { - return new DeleteOperationRequest(properties); - }; - - /** - * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteOperationRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteOperationRequest message. - * @function verify - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - */ - DeleteOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.DeleteOperationRequest) - return object; - var message = new $root.google.longrunning.DeleteOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this DeleteOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.DeleteOperationRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; - }; - - return DeleteOperationRequest; - })(); - - longrunning.WaitOperationRequest = (function() { - - /** - * Properties of a WaitOperationRequest. - * @memberof google.longrunning - * @interface IWaitOperationRequest - * @property {string|null} [name] WaitOperationRequest name - * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout - */ - - /** - * Constructs a new WaitOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a WaitOperationRequest. - * @implements IWaitOperationRequest - * @constructor - * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set - */ - function WaitOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WaitOperationRequest name. - * @member {string} name - * @memberof google.longrunning.WaitOperationRequest - * @instance - */ - WaitOperationRequest.prototype.name = ""; - - /** - * WaitOperationRequest timeout. - * @member {google.protobuf.IDuration|null|undefined} timeout - * @memberof google.longrunning.WaitOperationRequest - * @instance - */ - WaitOperationRequest.prototype.timeout = null; - - /** - * Creates a new WaitOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance - */ - WaitOperationRequest.create = function create(properties) { - return new WaitOperationRequest(properties); - }; - - /** - * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) - $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitOperationRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WaitOperationRequest message. - * @function verify - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WaitOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.timeout != null && message.hasOwnProperty("timeout")) { - var error = $root.google.protobuf.Duration.verify(message.timeout); - if (error) - return "timeout." + error; - } - return null; - }; - - /** - * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - */ - WaitOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.WaitOperationRequest) - return object; - var message = new $root.google.longrunning.WaitOperationRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.timeout != null) { - if (typeof object.timeout !== "object") - throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); - message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); - } - return message; - }; - - /** - * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WaitOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.timeout = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.timeout != null && message.hasOwnProperty("timeout")) - object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); - return object; - }; - - /** - * Converts this WaitOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.WaitOperationRequest - * @instance - * @returns {Object.} JSON object - */ - WaitOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WaitOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; - }; - - return WaitOperationRequest; - })(); - - longrunning.OperationInfo = (function() { - - /** - * Properties of an OperationInfo. - * @memberof google.longrunning - * @interface IOperationInfo - * @property {string|null} [responseType] OperationInfo responseType - * @property {string|null} [metadataType] OperationInfo metadataType - */ - - /** - * Constructs a new OperationInfo. - * @memberof google.longrunning - * @classdesc Represents an OperationInfo. - * @implements IOperationInfo - * @constructor - * @param {google.longrunning.IOperationInfo=} [properties] Properties to set - */ - function OperationInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OperationInfo responseType. - * @member {string} responseType - * @memberof google.longrunning.OperationInfo - * @instance - */ - OperationInfo.prototype.responseType = ""; - - /** - * OperationInfo metadataType. - * @member {string} metadataType - * @memberof google.longrunning.OperationInfo - * @instance - */ - OperationInfo.prototype.metadataType = ""; - - /** - * Creates a new OperationInfo instance using the specified properties. - * @function create - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo=} [properties] Properties to set - * @returns {google.longrunning.OperationInfo} OperationInfo instance - */ - OperationInfo.create = function create(properties) { - return new OperationInfo(properties); - }; - - /** - * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @function encode - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); - if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); - return writer; - }; - - /** - * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OperationInfo message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.OperationInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.OperationInfo} OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.responseType = reader.string(); - break; - } - case 2: { - message.metadataType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OperationInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.OperationInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.OperationInfo} OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OperationInfo message. - * @function verify - * @memberof google.longrunning.OperationInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OperationInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.responseType != null && message.hasOwnProperty("responseType")) - if (!$util.isString(message.responseType)) - return "responseType: string expected"; - if (message.metadataType != null && message.hasOwnProperty("metadataType")) - if (!$util.isString(message.metadataType)) - return "metadataType: string expected"; - return null; - }; - - /** - * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.OperationInfo - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.OperationInfo} OperationInfo - */ - OperationInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.OperationInfo) - return object; - var message = new $root.google.longrunning.OperationInfo(); - if (object.responseType != null) - message.responseType = String(object.responseType); - if (object.metadataType != null) - message.metadataType = String(object.metadataType); - return message; - }; - - /** - * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.OperationInfo} message OperationInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OperationInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.responseType = ""; - object.metadataType = ""; - } - if (message.responseType != null && message.hasOwnProperty("responseType")) - object.responseType = message.responseType; - if (message.metadataType != null && message.hasOwnProperty("metadataType")) - object.metadataType = message.metadataType; - return object; - }; - - /** - * Converts this OperationInfo to JSON. - * @function toJSON - * @memberof google.longrunning.OperationInfo - * @instance - * @returns {Object.} JSON object - */ - OperationInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OperationInfo - * @function getTypeUrl - * @memberof google.longrunning.OperationInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.OperationInfo"; - }; - - return OperationInfo; - })(); - - return longrunning; - })(); - - google.rpc = (function() { - - /** - * Namespace rpc. - * @memberof google - * @namespace - */ - var rpc = {}; - - rpc.Status = (function() { - - /** - * Properties of a Status. - * @memberof google.rpc - * @interface IStatus - * @property {number|null} [code] Status code - * @property {string|null} [message] Status message - * @property {Array.|null} [details] Status details - */ - - /** - * Constructs a new Status. - * @memberof google.rpc - * @classdesc Represents a Status. - * @implements IStatus - * @constructor - * @param {google.rpc.IStatus=} [properties] Properties to set - */ - function Status(properties) { - this.details = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Status code. - * @member {number} code - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.code = 0; - - /** - * Status message. - * @member {string} message - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.message = ""; - - /** - * Status details. - * @member {Array.} details - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.details = $util.emptyArray; - - /** - * Creates a new Status instance using the specified properties. - * @function create - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus=} [properties] Properties to set - * @returns {google.rpc.Status} Status instance - */ - Status.create = function create(properties) { - return new Status(properties); - }; - - /** - * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encode - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.code != null && Object.hasOwnProperty.call(message, "code")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); - if (message.details != null && message.details.length) - for (var i = 0; i < message.details.length; ++i) - $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encodeDelimited - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Status message from the specified reader or buffer. - * @function decode - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.code = reader.int32(); - break; - } - case 2: { - message.message = reader.string(); - break; - } - case 3: { - if (!(message.details && message.details.length)) - message.details = []; - message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Status message. - * @function verify - * @memberof google.rpc.Status - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Status.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.code != null && message.hasOwnProperty("code")) - if (!$util.isInteger(message.code)) - return "code: integer expected"; - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - if (message.details != null && message.hasOwnProperty("details")) { - if (!Array.isArray(message.details)) - return "details: array expected"; - for (var i = 0; i < message.details.length; ++i) { - var error = $root.google.protobuf.Any.verify(message.details[i]); - if (error) - return "details." + error; - } - } - return null; - }; - - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.rpc.Status - * @static - * @param {Object.} object Plain object - * @returns {google.rpc.Status} Status - */ - Status.fromObject = function fromObject(object) { - if (object instanceof $root.google.rpc.Status) - return object; - var message = new $root.google.rpc.Status(); - if (object.code != null) - message.code = object.code | 0; - if (object.message != null) - message.message = String(object.message); - if (object.details) { - if (!Array.isArray(object.details)) - throw TypeError(".google.rpc.Status.details: array expected"); - message.details = []; - for (var i = 0; i < object.details.length; ++i) { - if (typeof object.details[i] !== "object") - throw TypeError(".google.rpc.Status.details: object expected"); - message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @function toObject - * @memberof google.rpc.Status - * @static - * @param {google.rpc.Status} message Status - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Status.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.details = []; - if (options.defaults) { - object.code = 0; - object.message = ""; - } - if (message.code != null && message.hasOwnProperty("code")) - object.code = message.code; - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - if (message.details && message.details.length) { - object.details = []; - for (var j = 0; j < message.details.length; ++j) - object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); - } - return object; - }; - - /** - * Converts this Status to JSON. - * @function toJSON - * @memberof google.rpc.Status - * @instance - * @returns {Object.} JSON object - */ - Status.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Status - * @function getTypeUrl - * @memberof google.rpc.Status - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.rpc.Status"; - }; - - return Status; - })(); - - return rpc; - })(); - - return google; - })(); - - return $root; -}); diff --git a/owl-bot-staging/google-cloud-batch/v1/protos/protos.json b/owl-bot-staging/google-cloud-batch/v1/protos/protos.json deleted file mode 100644 index f6488c2185f..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/protos/protos.json +++ /dev/null @@ -1,3401 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "cloud": { - "nested": { - "batch": { - "nested": { - "v1": { - "options": { - "csharp_namespace": "Google.Cloud.Batch.V1", - "go_package": "cloud.google.com/go/batch/apiv1/batchpb;batchpb", - "java_multiple_files": true, - "java_outer_classname": "VolumeProto", - "java_package": "com.google.cloud.batch.v1", - "objc_class_prefix": "GCB", - "php_namespace": "Google\\Cloud\\Batch\\V1", - "ruby_package": "Google::Cloud::Batch::V1" - }, - "nested": { - "BatchService": { - "options": { - "(google.api.default_host)": "batch.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "CreateJob": { - "requestType": "CreateJobRequest", - "responseType": "Job", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/jobs", - "(google.api.http).body": "job", - "(google.api.method_signature)": "parent,job,job_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/jobs", - "body": "job" - } - }, - { - "(google.api.method_signature)": "parent,job,job_id" - } - ] - }, - "GetJob": { - "requestType": "GetJobRequest", - "responseType": "Job", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/jobs/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/jobs/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "DeleteJob": { - "requestType": "DeleteJobRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/jobs/*}", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "google.cloud.batch.v1.OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/jobs/*}" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "google.cloud.batch.v1.OperationMetadata" - } - } - ] - }, - "ListJobs": { - "requestType": "ListJobsRequest", - "responseType": "ListJobsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/jobs", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/jobs" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetTask": { - "requestType": "GetTaskRequest", - "responseType": "Task", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/jobs/*/taskGroups/*/tasks/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/jobs/*/taskGroups/*/tasks/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListTasks": { - "requestType": "ListTasksRequest", - "responseType": "ListTasksResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*/jobs/*/taskGroups/*}/tasks", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*/jobs/*/taskGroups/*}/tasks" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - } - } - }, - "CreateJobRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "batch.googleapis.com/Job" - } - }, - "jobId": { - "type": "string", - "id": 2 - }, - "job": { - "type": "Job", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GetJobRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "batch.googleapis.com/Job" - } - } - } - }, - "DeleteJobRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "reason": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListJobsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1 - }, - "filter": { - "type": "string", - "id": 4 - }, - "orderBy": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListJobsResponse": { - "fields": { - "jobs": { - "rule": "repeated", - "type": "Job", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "ListTasksRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "batch.googleapis.com/TaskGroup" - } - }, - "filter": { - "type": "string", - "id": 2 - }, - "pageSize": { - "type": "int32", - "id": 3 - }, - "pageToken": { - "type": "string", - "id": 4 - } - } - }, - "ListTasksResponse": { - "fields": { - "tasks": { - "rule": "repeated", - "type": "Task", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "GetTaskRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "batch.googleapis.com/Task" - } - } - } - }, - "OperationMetadata": { - "fields": { - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "target": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "verb": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "statusMessage": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "requestedCancellation": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "apiVersion": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "Job": { - "options": { - "(google.api.resource).type": "batch.googleapis.com/Job", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/jobs/{job}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "uid": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "priority": { - "type": "int64", - "id": 3 - }, - "taskGroups": { - "rule": "repeated", - "type": "TaskGroup", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "allocationPolicy": { - "type": "AllocationPolicy", - "id": 7 - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 8 - }, - "status": { - "type": "JobStatus", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "logsPolicy": { - "type": "LogsPolicy", - "id": 13 - }, - "notifications": { - "rule": "repeated", - "type": "JobNotification", - "id": 14 - } - } - }, - "LogsPolicy": { - "fields": { - "destination": { - "type": "Destination", - "id": 1 - }, - "logsPath": { - "type": "string", - "id": 2 - }, - "cloudLoggingOption": { - "type": "CloudLoggingOption", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "CloudLoggingOption": { - "fields": { - "useGenericTaskMonitoredResource": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Destination": { - "values": { - "DESTINATION_UNSPECIFIED": 0, - "CLOUD_LOGGING": 1, - "PATH": 2 - } - } - } - }, - "JobStatus": { - "fields": { - "state": { - "type": "State", - "id": 1 - }, - "statusEvents": { - "rule": "repeated", - "type": "StatusEvent", - "id": 2 - }, - "taskGroups": { - "keyType": "string", - "type": "TaskGroupStatus", - "id": 4 - }, - "runDuration": { - "type": "google.protobuf.Duration", - "id": 5 - } - }, - "nested": { - "InstanceStatus": { - "fields": { - "machineType": { - "type": "string", - "id": 1 - }, - "provisioningModel": { - "type": "AllocationPolicy.ProvisioningModel", - "id": 2 - }, - "taskPack": { - "type": "int64", - "id": 3 - }, - "bootDisk": { - "type": "AllocationPolicy.Disk", - "id": 4 - } - } - }, - "TaskGroupStatus": { - "fields": { - "counts": { - "keyType": "string", - "type": "int64", - "id": 1 - }, - "instances": { - "rule": "repeated", - "type": "InstanceStatus", - "id": 2 - } - } - }, - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "QUEUED": 1, - "SCHEDULED": 2, - "RUNNING": 3, - "SUCCEEDED": 4, - "FAILED": 5, - "DELETION_IN_PROGRESS": 6 - } - } - } - }, - "JobNotification": { - "fields": { - "pubsubTopic": { - "type": "string", - "id": 1 - }, - "message": { - "type": "Message", - "id": 2 - } - }, - "nested": { - "Message": { - "fields": { - "type": { - "type": "Type", - "id": 1 - }, - "newJobState": { - "type": "JobStatus.State", - "id": 2 - }, - "newTaskState": { - "type": "TaskStatus.State", - "id": 3 - } - } - }, - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "JOB_STATE_CHANGED": 1, - "TASK_STATE_CHANGED": 2 - } - } - } - }, - "AllocationPolicy": { - "fields": { - "location": { - "type": "LocationPolicy", - "id": 1 - }, - "instances": { - "rule": "repeated", - "type": "InstancePolicyOrTemplate", - "id": 8 - }, - "serviceAccount": { - "type": "ServiceAccount", - "id": 9 - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 6 - }, - "network": { - "type": "NetworkPolicy", - "id": 7 - }, - "placement": { - "type": "PlacementPolicy", - "id": 10 - }, - "tags": { - "rule": "repeated", - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "LocationPolicy": { - "fields": { - "allowedLocations": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "Disk": { - "oneofs": { - "dataSource": { - "oneof": [ - "image", - "snapshot" - ] - } - }, - "fields": { - "image": { - "type": "string", - "id": 4 - }, - "snapshot": { - "type": "string", - "id": 5 - }, - "type": { - "type": "string", - "id": 1 - }, - "sizeGb": { - "type": "int64", - "id": 2 - }, - "diskInterface": { - "type": "string", - "id": 6 - } - } - }, - "AttachedDisk": { - "oneofs": { - "attached": { - "oneof": [ - "newDisk", - "existingDisk" - ] - } - }, - "fields": { - "newDisk": { - "type": "Disk", - "id": 1 - }, - "existingDisk": { - "type": "string", - "id": 2 - }, - "deviceName": { - "type": "string", - "id": 3 - } - } - }, - "Accelerator": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "count": { - "type": "int64", - "id": 2 - }, - "installGpuDrivers": { - "type": "bool", - "id": 3, - "options": { - "deprecated": true - } - }, - "driverVersion": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "InstancePolicy": { - "fields": { - "machineType": { - "type": "string", - "id": 2 - }, - "minCpuPlatform": { - "type": "string", - "id": 3 - }, - "provisioningModel": { - "type": "ProvisioningModel", - "id": 4 - }, - "accelerators": { - "rule": "repeated", - "type": "Accelerator", - "id": 5 - }, - "bootDisk": { - "type": "Disk", - "id": 8 - }, - "disks": { - "rule": "repeated", - "type": "AttachedDisk", - "id": 6 - }, - "reservation": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "InstancePolicyOrTemplate": { - "oneofs": { - "policyTemplate": { - "oneof": [ - "policy", - "instanceTemplate" - ] - } - }, - "fields": { - "policy": { - "type": "InstancePolicy", - "id": 1 - }, - "instanceTemplate": { - "type": "string", - "id": 2 - }, - "installGpuDrivers": { - "type": "bool", - "id": 3 - }, - "installOpsAgent": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "blockProjectSshKeys": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "NetworkInterface": { - "fields": { - "network": { - "type": "string", - "id": 1 - }, - "subnetwork": { - "type": "string", - "id": 2 - }, - "noExternalIpAddress": { - "type": "bool", - "id": 3 - } - } - }, - "NetworkPolicy": { - "fields": { - "networkInterfaces": { - "rule": "repeated", - "type": "NetworkInterface", - "id": 1 - } - } - }, - "PlacementPolicy": { - "fields": { - "collocation": { - "type": "string", - "id": 1 - }, - "maxDistance": { - "type": "int64", - "id": 2 - } - } - }, - "ProvisioningModel": { - "values": { - "PROVISIONING_MODEL_UNSPECIFIED": 0, - "STANDARD": 1, - "SPOT": 2, - "PREEMPTIBLE": 3 - } - } - } - }, - "TaskGroup": { - "options": { - "(google.api.resource).type": "batch.googleapis.com/TaskGroup", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "taskSpec": { - "type": "TaskSpec", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "taskCount": { - "type": "int64", - "id": 4 - }, - "parallelism": { - "type": "int64", - "id": 5 - }, - "schedulingPolicy": { - "type": "SchedulingPolicy", - "id": 6 - }, - "taskEnvironments": { - "rule": "repeated", - "type": "Environment", - "id": 9 - }, - "taskCountPerNode": { - "type": "int64", - "id": 10 - }, - "requireHostsFile": { - "type": "bool", - "id": 11 - }, - "permissiveSsh": { - "type": "bool", - "id": 12 - }, - "runAsNonRoot": { - "type": "bool", - "id": 14, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "SchedulingPolicy": { - "values": { - "SCHEDULING_POLICY_UNSPECIFIED": 0, - "AS_SOON_AS_POSSIBLE": 1, - "IN_ORDER": 2 - } - } - } - }, - "ServiceAccount": { - "fields": { - "email": { - "type": "string", - "id": 1 - }, - "scopes": { - "rule": "repeated", - "type": "string", - "id": 2 - } - } - }, - "ComputeResource": { - "fields": { - "cpuMilli": { - "type": "int64", - "id": 1 - }, - "memoryMib": { - "type": "int64", - "id": 2 - }, - "bootDiskMib": { - "type": "int64", - "id": 4 - } - } - }, - "StatusEvent": { - "fields": { - "type": { - "type": "string", - "id": 3 - }, - "description": { - "type": "string", - "id": 1 - }, - "eventTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "taskExecution": { - "type": "TaskExecution", - "id": 4 - }, - "taskState": { - "type": "TaskStatus.State", - "id": 5 - } - } - }, - "TaskExecution": { - "fields": { - "exitCode": { - "type": "int32", - "id": 1 - } - } - }, - "TaskStatus": { - "fields": { - "state": { - "type": "State", - "id": 1 - }, - "statusEvents": { - "rule": "repeated", - "type": "StatusEvent", - "id": 2 - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "PENDING": 1, - "ASSIGNED": 2, - "RUNNING": 3, - "FAILED": 4, - "SUCCEEDED": 5, - "UNEXECUTED": 6 - } - } - } - }, - "Runnable": { - "oneofs": { - "executable": { - "oneof": [ - "container", - "script", - "barrier" - ] - } - }, - "fields": { - "container": { - "type": "Container", - "id": 1 - }, - "script": { - "type": "Script", - "id": 2 - }, - "barrier": { - "type": "Barrier", - "id": 6 - }, - "displayName": { - "type": "string", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "ignoreExitStatus": { - "type": "bool", - "id": 3 - }, - "background": { - "type": "bool", - "id": 4 - }, - "alwaysRun": { - "type": "bool", - "id": 5 - }, - "environment": { - "type": "Environment", - "id": 7 - }, - "timeout": { - "type": "google.protobuf.Duration", - "id": 8 - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 9 - } - }, - "nested": { - "Container": { - "fields": { - "imageUri": { - "type": "string", - "id": 1 - }, - "commands": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "entrypoint": { - "type": "string", - "id": 3 - }, - "volumes": { - "rule": "repeated", - "type": "string", - "id": 7 - }, - "options": { - "type": "string", - "id": 8 - }, - "blockExternalNetwork": { - "type": "bool", - "id": 9 - }, - "username": { - "type": "string", - "id": 10 - }, - "password": { - "type": "string", - "id": 11 - }, - "enableImageStreaming": { - "type": "bool", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Script": { - "oneofs": { - "command": { - "oneof": [ - "path", - "text" - ] - } - }, - "fields": { - "path": { - "type": "string", - "id": 1 - }, - "text": { - "type": "string", - "id": 2 - } - } - }, - "Barrier": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - } - } - }, - "TaskSpec": { - "fields": { - "runnables": { - "rule": "repeated", - "type": "Runnable", - "id": 8 - }, - "computeResource": { - "type": "ComputeResource", - "id": 3 - }, - "maxRunDuration": { - "type": "google.protobuf.Duration", - "id": 4 - }, - "maxRetryCount": { - "type": "int32", - "id": 5 - }, - "lifecyclePolicies": { - "rule": "repeated", - "type": "LifecyclePolicy", - "id": 9 - }, - "environments": { - "keyType": "string", - "type": "string", - "id": 6, - "options": { - "deprecated": true - } - }, - "volumes": { - "rule": "repeated", - "type": "Volume", - "id": 7 - }, - "environment": { - "type": "Environment", - "id": 10 - } - } - }, - "LifecyclePolicy": { - "fields": { - "action": { - "type": "Action", - "id": 1 - }, - "actionCondition": { - "type": "ActionCondition", - "id": 2 - } - }, - "nested": { - "ActionCondition": { - "fields": { - "exitCodes": { - "rule": "repeated", - "type": "int32", - "id": 1 - } - } - }, - "Action": { - "values": { - "ACTION_UNSPECIFIED": 0, - "RETRY_TASK": 1, - "FAIL_TASK": 2 - } - } - } - }, - "Task": { - "options": { - "(google.api.resource).type": "batch.googleapis.com/Task", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}/tasks/{task}" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "status": { - "type": "TaskStatus", - "id": 2 - } - } - }, - "Environment": { - "fields": { - "variables": { - "keyType": "string", - "type": "string", - "id": 1 - }, - "secretVariables": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "encryptedVariables": { - "type": "KMSEnvMap", - "id": 3 - } - }, - "nested": { - "KMSEnvMap": { - "fields": { - "keyName": { - "type": "string", - "id": 1 - }, - "cipherText": { - "type": "string", - "id": 2 - } - } - } - } - }, - "Volume": { - "oneofs": { - "source": { - "oneof": [ - "nfs", - "gcs", - "deviceName" - ] - } - }, - "fields": { - "nfs": { - "type": "NFS", - "id": 1 - }, - "gcs": { - "type": "GCS", - "id": 3 - }, - "deviceName": { - "type": "string", - "id": 6 - }, - "mountPath": { - "type": "string", - "id": 4 - }, - "mountOptions": { - "rule": "repeated", - "type": "string", - "id": 5 - } - } - }, - "NFS": { - "fields": { - "server": { - "type": "string", - "id": 1 - }, - "remotePath": { - "type": "string", - "id": 2 - } - } - }, - "GCS": { - "fields": { - "remotePath": { - "type": "string", - "id": 1 - } - } - } - } - } - } - } - } - }, - "api": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", - "java_multiple_files": true, - "java_outer_classname": "ResourceProto", - "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true - }, - "nested": { - "http": { - "type": "HttpRule", - "id": 72295728, - "extend": "google.protobuf.MethodOptions" - }, - "Http": { - "fields": { - "rules": { - "rule": "repeated", - "type": "HttpRule", - "id": 1 - }, - "fullyDecodeReservedExpansion": { - "type": "bool", - "id": 2 - } - } - }, - "HttpRule": { - "oneofs": { - "pattern": { - "oneof": [ - "get", - "put", - "post", - "delete", - "patch", - "custom" - ] - } - }, - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "get": { - "type": "string", - "id": 2 - }, - "put": { - "type": "string", - "id": 3 - }, - "post": { - "type": "string", - "id": 4 - }, - "delete": { - "type": "string", - "id": 5 - }, - "patch": { - "type": "string", - "id": 6 - }, - "custom": { - "type": "CustomHttpPattern", - "id": 8 - }, - "body": { - "type": "string", - "id": 7 - }, - "responseBody": { - "type": "string", - "id": 12 - }, - "additionalBindings": { - "rule": "repeated", - "type": "HttpRule", - "id": 11 - } - } - }, - "CustomHttpPattern": { - "fields": { - "kind": { - "type": "string", - "id": 1 - }, - "path": { - "type": "string", - "id": 2 - } - } - }, - "methodSignature": { - "rule": "repeated", - "type": "string", - "id": 1051, - "extend": "google.protobuf.MethodOptions" - }, - "defaultHost": { - "type": "string", - "id": 1049, - "extend": "google.protobuf.ServiceOptions" - }, - "oauthScopes": { - "type": "string", - "id": 1050, - "extend": "google.protobuf.ServiceOptions" - }, - "apiVersion": { - "type": "string", - "id": 525000001, - "extend": "google.protobuf.ServiceOptions" - }, - "CommonLanguageSettings": { - "fields": { - "referenceDocsUri": { - "type": "string", - "id": 1, - "options": { - "deprecated": true - } - }, - "destinations": { - "rule": "repeated", - "type": "ClientLibraryDestination", - "id": 2 - } - } - }, - "ClientLibrarySettings": { - "fields": { - "version": { - "type": "string", - "id": 1 - }, - "launchStage": { - "type": "LaunchStage", - "id": 2 - }, - "restNumericEnums": { - "type": "bool", - "id": 3 - }, - "javaSettings": { - "type": "JavaSettings", - "id": 21 - }, - "cppSettings": { - "type": "CppSettings", - "id": 22 - }, - "phpSettings": { - "type": "PhpSettings", - "id": 23 - }, - "pythonSettings": { - "type": "PythonSettings", - "id": 24 - }, - "nodeSettings": { - "type": "NodeSettings", - "id": 25 - }, - "dotnetSettings": { - "type": "DotnetSettings", - "id": 26 - }, - "rubySettings": { - "type": "RubySettings", - "id": 27 - }, - "goSettings": { - "type": "GoSettings", - "id": 28 - } - } - }, - "Publishing": { - "fields": { - "methodSettings": { - "rule": "repeated", - "type": "MethodSettings", - "id": 2 - }, - "newIssueUri": { - "type": "string", - "id": 101 - }, - "documentationUri": { - "type": "string", - "id": 102 - }, - "apiShortName": { - "type": "string", - "id": 103 - }, - "githubLabel": { - "type": "string", - "id": 104 - }, - "codeownerGithubTeams": { - "rule": "repeated", - "type": "string", - "id": 105 - }, - "docTagPrefix": { - "type": "string", - "id": 106 - }, - "organization": { - "type": "ClientLibraryOrganization", - "id": 107 - }, - "librarySettings": { - "rule": "repeated", - "type": "ClientLibrarySettings", - "id": 109 - }, - "protoReferenceDocumentationUri": { - "type": "string", - "id": 110 - }, - "restReferenceDocumentationUri": { - "type": "string", - "id": 111 - } - } - }, - "JavaSettings": { - "fields": { - "libraryPackage": { - "type": "string", - "id": 1 - }, - "serviceClassNames": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "common": { - "type": "CommonLanguageSettings", - "id": 3 - } - } - }, - "CppSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "PhpSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "PythonSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "NodeSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "DotnetSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - }, - "renamedServices": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "renamedResources": { - "keyType": "string", - "type": "string", - "id": 3 - }, - "ignoredResources": { - "rule": "repeated", - "type": "string", - "id": 4 - }, - "forcedNamespaceAliases": { - "rule": "repeated", - "type": "string", - "id": 5 - }, - "handwrittenSignatures": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - }, - "RubySettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "GoSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "MethodSettings": { - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "longRunning": { - "type": "LongRunning", - "id": 2 - }, - "autoPopulatedFields": { - "rule": "repeated", - "type": "string", - "id": 3 - } - }, - "nested": { - "LongRunning": { - "fields": { - "initialPollDelay": { - "type": "google.protobuf.Duration", - "id": 1 - }, - "pollDelayMultiplier": { - "type": "float", - "id": 2 - }, - "maxPollDelay": { - "type": "google.protobuf.Duration", - "id": 3 - }, - "totalPollTimeout": { - "type": "google.protobuf.Duration", - "id": 4 - } - } - } - } - }, - "ClientLibraryOrganization": { - "values": { - "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, - "CLOUD": 1, - "ADS": 2, - "PHOTOS": 3, - "STREET_VIEW": 4, - "SHOPPING": 5, - "GEO": 6, - "GENERATIVE_AI": 7 - } - }, - "ClientLibraryDestination": { - "values": { - "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, - "GITHUB": 10, - "PACKAGE_MANAGER": 20 - } - }, - "LaunchStage": { - "values": { - "LAUNCH_STAGE_UNSPECIFIED": 0, - "UNIMPLEMENTED": 6, - "PRELAUNCH": 7, - "EARLY_ACCESS": 1, - "ALPHA": 2, - "BETA": 3, - "GA": 4, - "DEPRECATED": 5 - } - }, - "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 - } - }, - "fieldInfo": { - "type": "google.api.FieldInfo", - "id": 291403980, - "extend": "google.protobuf.FieldOptions" - }, - "FieldInfo": { - "fields": { - "format": { - "type": "Format", - "id": 1 - } - }, - "nested": { - "Format": { - "values": { - "FORMAT_UNSPECIFIED": 0, - "UUID4": 1, - "IPV4": 2, - "IPV6": 3, - "IPV4_OR_IPV6": 4 - } - } - } - }, - "resourceReference": { - "type": "google.api.ResourceReference", - "id": 1055, - "extend": "google.protobuf.FieldOptions" - }, - "resourceDefinition": { - "rule": "repeated", - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.FileOptions" - }, - "resource": { - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.MessageOptions" - }, - "ResourceDescriptor": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "pattern": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "nameField": { - "type": "string", - "id": 3 - }, - "history": { - "type": "History", - "id": 4 - }, - "plural": { - "type": "string", - "id": 5 - }, - "singular": { - "type": "string", - "id": 6 - }, - "style": { - "rule": "repeated", - "type": "Style", - "id": 10 - } - }, - "nested": { - "History": { - "values": { - "HISTORY_UNSPECIFIED": 0, - "ORIGINALLY_SINGLE_PATTERN": 1, - "FUTURE_MULTI_PATTERN": 2 - } - }, - "Style": { - "values": { - "STYLE_UNSPECIFIED": 0, - "DECLARATIVE_FRIENDLY": 1 - } - } - } - }, - "ResourceReference": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "childType": { - "type": "string", - "id": 2 - } - } - } - } - }, - "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": { - "fields": { - "file": { - "rule": "repeated", - "type": "FileDescriptorProto", - "id": 1 - } - } - }, - "Edition": { - "values": { - "EDITION_UNKNOWN": 0, - "EDITION_PROTO2": 998, - "EDITION_PROTO3": 999, - "EDITION_2023": 1000, - "EDITION_2024": 1001, - "EDITION_1_TEST_ONLY": 1, - "EDITION_2_TEST_ONLY": 2, - "EDITION_99997_TEST_ONLY": 99997, - "EDITION_99998_TEST_ONLY": 99998, - "EDITION_99999_TEST_ONLY": 99999, - "EDITION_MAX": 2147483647 - } - }, - "FileDescriptorProto": { - "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, - "options": { - "packed": false - } - }, - "weakDependency": { - "rule": "repeated", - "type": "int32", - "id": 11, - "options": { - "packed": false - } - }, - "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": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "field": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 2 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 6 - }, - "nestedType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 3 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 4 - }, - "extensionRange": { - "rule": "repeated", - "type": "ExtensionRange", - "id": 5 - }, - "oneofDecl": { - "rule": "repeated", - "type": "OneofDescriptorProto", - "id": 8 - }, - "options": { - "type": "MessageOptions", - "id": 7 - }, - "reservedRange": { - "rule": "repeated", - "type": "ReservedRange", - "id": 9 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 10 - } - }, - "nested": { - "ExtensionRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "ExtensionRangeOptions", - "id": 3 - } - } - }, - "ReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "ExtensionRangeOptions": { - "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": { - "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": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "options": { - "type": "OneofOptions", - "id": 2 - } - } - }, - "EnumDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "value": { - "rule": "repeated", - "type": "EnumValueDescriptorProto", - "id": 2 - }, - "options": { - "type": "EnumOptions", - "id": 3 - }, - "reservedRange": { - "rule": "repeated", - "type": "EnumReservedRange", - "id": 4 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 5 - } - }, - "nested": { - "EnumReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "EnumValueDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "EnumValueOptions", - "id": 3 - } - } - }, - "ServiceDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "method": { - "rule": "repeated", - "type": "MethodDescriptorProto", - "id": 2 - }, - "options": { - "type": "ServiceOptions", - "id": 3 - } - } - }, - "MethodDescriptorProto": { - "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": { - "fields": { - "javaPackage": { - "type": "string", - "id": 1 - }, - "javaOuterClassname": { - "type": "string", - "id": 8 - }, - "javaMultipleFiles": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "javaGenerateEqualsAndHash": { - "type": "bool", - "id": 20, - "options": { - "deprecated": true - } - }, - "javaStringCheckUtf8": { - "type": "bool", - "id": 27, - "options": { - "default": false - } - }, - "optimizeFor": { - "type": "OptimizeMode", - "id": 9, - "options": { - "default": "SPEED" - } - }, - "goPackage": { - "type": "string", - "id": 11 - }, - "ccGenericServices": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "javaGenericServices": { - "type": "bool", - "id": 17, - "options": { - "default": false - } - }, - "pyGenericServices": { - "type": "bool", - "id": 18, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 23, - "options": { - "default": false - } - }, - "ccEnableArenas": { - "type": "bool", - "id": 31, - "options": { - "default": true - } - }, - "objcClassPrefix": { - "type": "string", - "id": 36 - }, - "csharpNamespace": { - "type": "string", - "id": 37 - }, - "swiftPrefix": { - "type": "string", - "id": 39 - }, - "phpClassPrefix": { - "type": "string", - "id": 40 - }, - "phpNamespace": { - "type": "string", - "id": 41 - }, - "phpMetadataNamespace": { - "type": "string", - "id": 44 - }, - "rubyPackage": { - "type": "string", - "id": 45 - }, - "features": { - "type": "FeatureSet", - "id": 50 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 42, - 42 - ], - [ - 38, - 38 - ] - ], - "nested": { - "OptimizeMode": { - "values": { - "SPEED": 1, - "CODE_SIZE": 2, - "LITE_RUNTIME": 3 - } - } - } - }, - "MessageOptions": { - "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": { - "fields": { - "ctype": { - "type": "CType", - "id": 1, - "options": { - "default": "STRING" - } - }, - "packed": { - "type": "bool", - "id": 2 - }, - "jstype": { - "type": "JSType", - "id": 6, - "options": { - "default": "JS_NORMAL" - } - }, - "lazy": { - "type": "bool", - "id": 5, - "options": { - "default": false - } - }, - "unverifiedLazy": { - "type": "bool", - "id": 15, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "weak": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "debugRedact": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "retention": { - "type": "OptionRetention", - "id": 17 - }, - "targets": { - "rule": "repeated", - "type": "OptionTargetType", - "id": 19, - "options": { - "packed": false - } - }, - "editionDefaults": { - "rule": "repeated", - "type": "EditionDefault", - "id": 20 - }, - "features": { - "type": "FeatureSet", - "id": 21 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 18, - 18 - ] - ], - "nested": { - "CType": { - "values": { - "STRING": 0, - "CORD": 1, - "STRING_PIECE": 2 - } - }, - "JSType": { - "values": { - "JS_NORMAL": 0, - "JS_STRING": 1, - "JS_NUMBER": 2 - } - }, - "OptionRetention": { - "values": { - "RETENTION_UNKNOWN": 0, - "RETENTION_RUNTIME": 1, - "RETENTION_SOURCE": 2 - } - }, - "OptionTargetType": { - "values": { - "TARGET_TYPE_UNKNOWN": 0, - "TARGET_TYPE_FILE": 1, - "TARGET_TYPE_EXTENSION_RANGE": 2, - "TARGET_TYPE_MESSAGE": 3, - "TARGET_TYPE_FIELD": 4, - "TARGET_TYPE_ONEOF": 5, - "TARGET_TYPE_ENUM": 6, - "TARGET_TYPE_ENUM_ENTRY": 7, - "TARGET_TYPE_SERVICE": 8, - "TARGET_TYPE_METHOD": 9 - } - }, - "EditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "value": { - "type": "string", - "id": 2 - } - } - } - } - }, - "OneofOptions": { - "fields": { - "features": { - "type": "FeatureSet", - "id": 1 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "EnumOptions": { - "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": { - "fields": { - "deprecated": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "features": { - "type": "FeatureSet", - "id": 2 - }, - "debugRedact": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "ServiceOptions": { - "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": { - "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": { - "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": { - "fields": { - "fieldPresence": { - "type": "FieldPresence", - "id": 1, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_2023", - "edition_defaults.value": "EXPLICIT" - } - }, - "enumType": { - "type": "EnumType", - "id": 2, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "OPEN" - } - }, - "repeatedFieldEncoding": { - "type": "RepeatedFieldEncoding", - "id": 3, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "PACKED" - } - }, - "utf8Validation": { - "type": "Utf8Validation", - "id": 4, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "VERIFY" - } - }, - "messageEncoding": { - "type": "MessageEncoding", - "id": 5, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO2", - "edition_defaults.value": "LENGTH_PREFIXED" - } - }, - "jsonFormat": { - "type": "JsonFormat", - "id": 6, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "ALLOW" - } - } - }, - "extensions": [ - [ - 1000, - 1000 - ], - [ - 1001, - 1001 - ], - [ - 1002, - 1002 - ], - [ - 9990, - 9990 - ], - [ - 9995, - 9999 - ], - [ - 10000, - 10000 - ] - ], - "reserved": [ - [ - 999, - 999 - ] - ], - "nested": { - "FieldPresence": { - "values": { - "FIELD_PRESENCE_UNKNOWN": 0, - "EXPLICIT": 1, - "IMPLICIT": 2, - "LEGACY_REQUIRED": 3 - } - }, - "EnumType": { - "values": { - "ENUM_TYPE_UNKNOWN": 0, - "OPEN": 1, - "CLOSED": 2 - } - }, - "RepeatedFieldEncoding": { - "values": { - "REPEATED_FIELD_ENCODING_UNKNOWN": 0, - "PACKED": 1, - "EXPANDED": 2 - } - }, - "Utf8Validation": { - "values": { - "UTF8_VALIDATION_UNKNOWN": 0, - "VERIFY": 2, - "NONE": 3 - } - }, - "MessageEncoding": { - "values": { - "MESSAGE_ENCODING_UNKNOWN": 0, - "LENGTH_PREFIXED": 1, - "DELIMITED": 2 - } - }, - "JsonFormat": { - "values": { - "JSON_FORMAT_UNKNOWN": 0, - "ALLOW": 1, - "LEGACY_BEST_EFFORT": 2 - } - } - } - }, - "FeatureSetDefaults": { - "fields": { - "defaults": { - "rule": "repeated", - "type": "FeatureSetEditionDefault", - "id": 1 - }, - "minimumEdition": { - "type": "Edition", - "id": 4 - }, - "maximumEdition": { - "type": "Edition", - "id": 5 - } - }, - "nested": { - "FeatureSetEditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "features": { - "type": "FeatureSet", - "id": 2 - } - } - } - } - }, - "SourceCodeInfo": { - "fields": { - "location": { - "rule": "repeated", - "type": "Location", - "id": 1 - } - }, - "nested": { - "Location": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1 - }, - "span": { - "rule": "repeated", - "type": "int32", - "id": 2 - }, - "leadingComments": { - "type": "string", - "id": 3 - }, - "trailingComments": { - "type": "string", - "id": 4 - }, - "leadingDetachedComments": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - } - } - }, - "GeneratedCodeInfo": { - "fields": { - "annotation": { - "rule": "repeated", - "type": "Annotation", - "id": 1 - } - }, - "nested": { - "Annotation": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1 - }, - "sourceFile": { - "type": "string", - "id": 2 - }, - "begin": { - "type": "int32", - "id": 3 - }, - "end": { - "type": "int32", - "id": 4 - }, - "semantic": { - "type": "Semantic", - "id": 5 - } - }, - "nested": { - "Semantic": { - "values": { - "NONE": 0, - "SET": 1, - "ALIAS": 2 - } - } - } - } - } - }, - "Duration": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "Timestamp": { - "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": {} - } - } - }, - "longrunning": { - "options": { - "cc_enable_arenas": true, - "csharp_namespace": "Google.LongRunning", - "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", - "java_multiple_files": true, - "java_outer_classname": "OperationsProto", - "java_package": "com.google.longrunning", - "php_namespace": "Google\\LongRunning" - }, - "nested": { - "operationInfo": { - "type": "google.longrunning.OperationInfo", - "id": 1049, - "extend": "google.protobuf.MethodOptions" - }, - "Operations": { - "options": { - "(google.api.default_host)": "longrunning.googleapis.com" - }, - "methods": { - "ListOperations": { - "requestType": "ListOperationsRequest", - "responseType": "ListOperationsResponse", - "options": { - "(google.api.http).get": "/v1/{name=operations}", - "(google.api.method_signature)": "name,filter" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=operations}" - } - }, - { - "(google.api.method_signature)": "name,filter" - } - ] - }, - "GetOperation": { - "requestType": "GetOperationRequest", - "responseType": "Operation", - "options": { - "(google.api.http).get": "/v1/{name=operations/**}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=operations/**}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "DeleteOperation": { - "requestType": "DeleteOperationRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=operations/**}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=operations/**}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CancelOperation": { - "requestType": "CancelOperationRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).post": "/v1/{name=operations/**}:cancel", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=operations/**}:cancel", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "WaitOperation": { - "requestType": "WaitOperationRequest", - "responseType": "Operation" - } - } - }, - "Operation": { - "oneofs": { - "result": { - "oneof": [ - "error", - "response" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "metadata": { - "type": "google.protobuf.Any", - "id": 2 - }, - "done": { - "type": "bool", - "id": 3 - }, - "error": { - "type": "google.rpc.Status", - "id": 4 - }, - "response": { - "type": "google.protobuf.Any", - "id": 5 - } - } - }, - "GetOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "ListOperationsRequest": { - "fields": { - "name": { - "type": "string", - "id": 4 - }, - "filter": { - "type": "string", - "id": 1 - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListOperationsResponse": { - "fields": { - "operations": { - "rule": "repeated", - "type": "Operation", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "CancelOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "DeleteOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "WaitOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "timeout": { - "type": "google.protobuf.Duration", - "id": 2 - } - } - }, - "OperationInfo": { - "fields": { - "responseType": { - "type": "string", - "id": 1 - }, - "metadataType": { - "type": "string", - "id": 2 - } - } - } - } - }, - "rpc": { - "options": { - "cc_enable_arenas": true, - "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", - "java_multiple_files": true, - "java_outer_classname": "StatusProto", - "java_package": "com.google.rpc", - "objc_class_prefix": "RPC" - }, - "nested": { - "Status": { - "fields": { - "code": { - "type": "int32", - "id": 1 - }, - "message": { - "type": "string", - "id": 2 - }, - "details": { - "rule": "repeated", - "type": "google.protobuf.Any", - "id": 3 - } - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.create_job.js b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.create_job.js deleted file mode 100644 index ceffce87c28..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.create_job.js +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, job) { - // [START batch_v1_generated_BatchService_CreateJob_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent resource name where the Job will be created. - * Pattern: "projects/{project}/locations/{location}" - */ - // const parent = 'abc123' - /** - * ID used to uniquely identify the Job within its parent scope. - * This field should contain at most 63 characters and must start with - * lowercase characters. - * Only lowercase characters, numbers and '-' are accepted. - * The '-' character cannot be the first or the last one. - * A system generated ID will be used if the field is not set. - * The job.name field in the request will be ignored and the created resource - * name of the Job will be "{parent}/jobs/{job_id}". - */ - // const jobId = 'abc123' - /** - * Required. The Job to create. - */ - // const job = {} - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callCreateJob() { - // Construct request - const request = { - parent, - job, - }; - - // Run request - const response = await batchClient.createJob(request); - console.log(response); - } - - callCreateJob(); - // [END batch_v1_generated_BatchService_CreateJob_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.delete_job.js b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.delete_job.js deleted file mode 100644 index 056a8d9bce4..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.delete_job.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START batch_v1_generated_BatchService_DeleteJob_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Job name. - */ - // const name = 'abc123' - /** - * Optional. Reason for this deletion. - */ - // const reason = 'abc123' - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callDeleteJob() { - // Construct request - const request = { - }; - - // Run request - const [operation] = await batchClient.deleteJob(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteJob(); - // [END batch_v1_generated_BatchService_DeleteJob_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.get_job.js b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.get_job.js deleted file mode 100644 index 0e68cdffae5..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.get_job.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START batch_v1_generated_BatchService_GetJob_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Job name. - */ - // const name = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callGetJob() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await batchClient.getJob(request); - console.log(response); - } - - callGetJob(); - // [END batch_v1_generated_BatchService_GetJob_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.get_task.js b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.get_task.js deleted file mode 100644 index 3b6d00367e7..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.get_task.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START batch_v1_generated_BatchService_GetTask_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Task name. - */ - // const name = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callGetTask() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await batchClient.getTask(request); - console.log(response); - } - - callGetTask(); - // [END batch_v1_generated_BatchService_GetTask_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.list_jobs.js b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.list_jobs.js deleted file mode 100644 index cfd8edc4cf8..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.list_jobs.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START batch_v1_generated_BatchService_ListJobs_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Parent path. - */ - // const parent = 'abc123' - /** - * List filter. - */ - // const filter = 'abc123' - /** - * Optional. Sort results. Supported are "name", "name desc", "create_time", - * and "create_time desc". - */ - // const orderBy = 'abc123' - /** - * Page size. - */ - // const pageSize = 1234 - /** - * Page token. - */ - // const pageToken = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callListJobs() { - // Construct request - const request = { - }; - - // Run request - const iterable = batchClient.listJobsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListJobs(); - // [END batch_v1_generated_BatchService_ListJobs_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.list_tasks.js b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.list_tasks.js deleted file mode 100644 index d0546798f89..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.list_tasks.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START batch_v1_generated_BatchService_ListTasks_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of a TaskGroup from which Tasks are being requested. - * Pattern: - * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" - */ - // const parent = 'abc123' - /** - * Task filter, null filter matches all Tasks. - * Filter string should be of the format State=TaskStatus.State e.g. - * State=RUNNING - */ - // const filter = 'abc123' - /** - * Page size. - */ - // const pageSize = 1234 - /** - * Page token. - */ - // const pageToken = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callListTasks() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = batchClient.listTasksAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListTasks(); - // [END batch_v1_generated_BatchService_ListTasks_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/snippet_metadata_google.cloud.batch.v1.json b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/snippet_metadata_google.cloud.batch.v1.json deleted file mode 100644 index fd2ad4716e2..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/snippet_metadata_google.cloud.batch.v1.json +++ /dev/null @@ -1,303 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-batch", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.batch.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "regionTag": "batch_v1_generated_BatchService_CreateJob_async", - "title": "BatchService createJob Sample", - "origin": "API_DEFINITION", - "description": " Create a Job.", - "canonical": true, - "file": "batch_service.create_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 84, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateJob", - "fullName": "google.cloud.batch.v1.BatchService.CreateJob", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "job_id", - "type": "TYPE_STRING" - }, - { - "name": "job", - "type": ".google.cloud.batch.v1.Job" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.batch.v1.Job", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1.BatchServiceClient" - }, - "method": { - "shortName": "CreateJob", - "fullName": "google.cloud.batch.v1.BatchService.CreateJob", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1.BatchService" - } - } - } - }, - { - "regionTag": "batch_v1_generated_BatchService_GetJob_async", - "title": "BatchService getJob Sample", - "origin": "API_DEFINITION", - "description": " Get a Job specified by its resource name.", - "canonical": true, - "file": "batch_service.get_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetJob", - "fullName": "google.cloud.batch.v1.BatchService.GetJob", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.batch.v1.Job", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1.BatchServiceClient" - }, - "method": { - "shortName": "GetJob", - "fullName": "google.cloud.batch.v1.BatchService.GetJob", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1.BatchService" - } - } - } - }, - { - "regionTag": "batch_v1_generated_BatchService_DeleteJob_async", - "title": "BatchService deleteJob Sample", - "origin": "API_DEFINITION", - "description": " Delete a Job.", - "canonical": true, - "file": "batch_service.delete_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteJob", - "fullName": "google.cloud.batch.v1.BatchService.DeleteJob", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "reason", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1.BatchServiceClient" - }, - "method": { - "shortName": "DeleteJob", - "fullName": "google.cloud.batch.v1.BatchService.DeleteJob", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1.BatchService" - } - } - } - }, - { - "regionTag": "batch_v1_generated_BatchService_ListJobs_async", - "title": "BatchService listJobs Sample", - "origin": "API_DEFINITION", - "description": " List all Jobs for a project within a region.", - "canonical": true, - "file": "batch_service.list_jobs.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListJobs", - "fullName": "google.cloud.batch.v1.BatchService.ListJobs", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.batch.v1.ListJobsResponse", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1.BatchServiceClient" - }, - "method": { - "shortName": "ListJobs", - "fullName": "google.cloud.batch.v1.BatchService.ListJobs", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1.BatchService" - } - } - } - }, - { - "regionTag": "batch_v1_generated_BatchService_GetTask_async", - "title": "BatchService getTask Sample", - "origin": "API_DEFINITION", - "description": " Return a single Task.", - "canonical": true, - "file": "batch_service.get_task.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetTask", - "fullName": "google.cloud.batch.v1.BatchService.GetTask", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.batch.v1.Task", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1.BatchServiceClient" - }, - "method": { - "shortName": "GetTask", - "fullName": "google.cloud.batch.v1.BatchService.GetTask", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1.BatchService" - } - } - } - }, - { - "regionTag": "batch_v1_generated_BatchService_ListTasks_async", - "title": "BatchService listTasks Sample", - "origin": "API_DEFINITION", - "description": " List Tasks associated with a job.", - "canonical": true, - "file": "batch_service.list_tasks.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListTasks", - "fullName": "google.cloud.batch.v1.BatchService.ListTasks", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.batch.v1.ListTasksResponse", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1.BatchServiceClient" - }, - "method": { - "shortName": "ListTasks", - "fullName": "google.cloud.batch.v1.BatchService.ListTasks", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1.BatchService" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-cloud-batch/v1/src/index.ts b/owl-bot-staging/google-cloud-batch/v1/src/index.ts deleted file mode 100644 index 5a38d7beb99..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/src/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as v1 from './v1'; -const BatchServiceClient = v1.BatchServiceClient; -type BatchServiceClient = v1.BatchServiceClient; -export {v1, BatchServiceClient}; -export default {v1, BatchServiceClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_client.ts b/owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_client.ts deleted file mode 100644 index d858efc2bf3..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_client.ts +++ /dev/null @@ -1,1620 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); - -/** - * Client JSON configuration object, loaded from - * `src/v1/batch_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './batch_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Google Batch Service. - * The service manages user submitted batch jobs and allocates Google Compute - * Engine VM instances to run the jobs. - * @class - * @memberof v1 - */ -export class BatchServiceClient { - 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; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - locationsClient: LocationsClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - batchServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of BatchServiceClient. - * - * @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://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @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 BatchServiceClient({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 BatchServiceClient; - 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 = 'batch.' + 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; - } - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process === 'object' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - jobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - taskPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}/tasks/{task}' - ), - taskGroupPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}' - ), - }; - - // 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 = { - listJobs: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'jobs'), - listTasks: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'tasks') - }; - - const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback) { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v1/{name=projects/*/locations/*}',},{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1/{name=projects/*}/locations',},{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',body: '*',},{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/locations/*}/operations',}]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const deleteJobResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteJobMetadata = protoFilesRoot.lookup( - '.google.cloud.batch.v1.OperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - deleteJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteJobResponse.decode.bind(deleteJobResponse), - deleteJobMetadata.decode.bind(deleteJobMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.batch.v1.BatchService', 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.batchServiceStub) { - return this.batchServiceStub; - } - - // Put together the "service stub" for - // google.cloud.batch.v1.BatchService. - this.batchServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.batch.v1.BatchService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.batch.v1.BatchService, - 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 batchServiceStubMethods = - ['createJob', 'getJob', 'deleteJob', 'listJobs', 'getTask', 'listTasks']; - for (const methodName of batchServiceStubMethods) { - const callPromise = this.batchServiceStub.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.batchServiceStub; - } - - /** - * 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 'batch.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 'batch.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' - ]; - } - - 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 -- - // ------------------- -/** - * Create a Job. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name where the Job will be created. - * Pattern: "projects/{project}/locations/{location}" - * @param {string} request.jobId - * ID used to uniquely identify the Job within its parent scope. - * This field should contain at most 63 characters and must start with - * lowercase characters. - * Only lowercase characters, numbers and '-' are accepted. - * The '-' character cannot be the first or the last one. - * A system generated ID will be used if the field is not set. - * - * The job.name field in the request will be ignored and the created resource - * name of the Job will be "{parent}/jobs/{job_id}". - * @param {google.cloud.batch.v1.Job} request.job - * Required. The Job to create. - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1.Job|Job}. - * 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/batch_service.create_job.js - * region_tag:batch_v1_generated_BatchService_CreateJob_async - */ - createJob( - request?: protos.google.cloud.batch.v1.ICreateJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.batch.v1.IJob, - protos.google.cloud.batch.v1.ICreateJobRequest|undefined, {}|undefined - ]>; - createJob( - request: protos.google.cloud.batch.v1.ICreateJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.batch.v1.IJob, - protos.google.cloud.batch.v1.ICreateJobRequest|null|undefined, - {}|null|undefined>): void; - createJob( - request: protos.google.cloud.batch.v1.ICreateJobRequest, - callback: Callback< - protos.google.cloud.batch.v1.IJob, - protos.google.cloud.batch.v1.ICreateJobRequest|null|undefined, - {}|null|undefined>): void; - createJob( - request?: protos.google.cloud.batch.v1.ICreateJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.batch.v1.IJob, - protos.google.cloud.batch.v1.ICreateJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.batch.v1.IJob, - protos.google.cloud.batch.v1.ICreateJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.batch.v1.IJob, - protos.google.cloud.batch.v1.ICreateJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.createJob(request, options, callback); - } -/** - * Get a Job specified by its resource name. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Job name. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1.Job|Job}. - * 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/batch_service.get_job.js - * region_tag:batch_v1_generated_BatchService_GetJob_async - */ - getJob( - request?: protos.google.cloud.batch.v1.IGetJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.batch.v1.IJob, - protos.google.cloud.batch.v1.IGetJobRequest|undefined, {}|undefined - ]>; - getJob( - request: protos.google.cloud.batch.v1.IGetJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.batch.v1.IJob, - protos.google.cloud.batch.v1.IGetJobRequest|null|undefined, - {}|null|undefined>): void; - getJob( - request: protos.google.cloud.batch.v1.IGetJobRequest, - callback: Callback< - protos.google.cloud.batch.v1.IJob, - protos.google.cloud.batch.v1.IGetJobRequest|null|undefined, - {}|null|undefined>): void; - getJob( - request?: protos.google.cloud.batch.v1.IGetJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.batch.v1.IJob, - protos.google.cloud.batch.v1.IGetJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.batch.v1.IJob, - protos.google.cloud.batch.v1.IGetJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.batch.v1.IJob, - protos.google.cloud.batch.v1.IGetJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getJob(request, options, callback); - } -/** - * Return a single Task. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Task name. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1.Task|Task}. - * 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/batch_service.get_task.js - * region_tag:batch_v1_generated_BatchService_GetTask_async - */ - getTask( - request?: protos.google.cloud.batch.v1.IGetTaskRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.batch.v1.ITask, - protos.google.cloud.batch.v1.IGetTaskRequest|undefined, {}|undefined - ]>; - getTask( - request: protos.google.cloud.batch.v1.IGetTaskRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.batch.v1.ITask, - protos.google.cloud.batch.v1.IGetTaskRequest|null|undefined, - {}|null|undefined>): void; - getTask( - request: protos.google.cloud.batch.v1.IGetTaskRequest, - callback: Callback< - protos.google.cloud.batch.v1.ITask, - protos.google.cloud.batch.v1.IGetTaskRequest|null|undefined, - {}|null|undefined>): void; - getTask( - request?: protos.google.cloud.batch.v1.IGetTaskRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.batch.v1.ITask, - protos.google.cloud.batch.v1.IGetTaskRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.batch.v1.ITask, - protos.google.cloud.batch.v1.IGetTaskRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.batch.v1.ITask, - protos.google.cloud.batch.v1.IGetTaskRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getTask(request, options, callback); - } - -/** - * Delete a Job. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Job name. - * @param {string} [request.reason] - * Optional. Reason for this deletion. - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/batch_service.delete_job.js - * region_tag:batch_v1_generated_BatchService_DeleteJob_async - */ - deleteJob( - request?: protos.google.cloud.batch.v1.IDeleteJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteJob( - request: protos.google.cloud.batch.v1.IDeleteJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteJob( - request: protos.google.cloud.batch.v1.IDeleteJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteJob( - request?: protos.google.cloud.batch.v1.IDeleteJobRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteJob(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteJob()`. - * @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/batch_service.delete_job.js - * region_tag:batch_v1_generated_BatchService_DeleteJob_async - */ - async checkDeleteJobProgress(name: string): Promise>{ - 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.deleteJob, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * List all Jobs for a project within a region. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Parent path. - * @param {string} request.filter - * List filter. - * @param {string} [request.orderBy] - * Optional. Sort results. Supported are "name", "name desc", "create_time", - * and "create_time desc". - * @param {number} request.pageSize - * Page size. - * @param {string} request.pageToken - * Page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.batch.v1.Job|Job}. - * 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 `listJobsAsync()` - * 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. - */ - listJobs( - request?: protos.google.cloud.batch.v1.IListJobsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.batch.v1.IJob[], - protos.google.cloud.batch.v1.IListJobsRequest|null, - protos.google.cloud.batch.v1.IListJobsResponse - ]>; - listJobs( - request: protos.google.cloud.batch.v1.IListJobsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.batch.v1.IListJobsRequest, - protos.google.cloud.batch.v1.IListJobsResponse|null|undefined, - protos.google.cloud.batch.v1.IJob>): void; - listJobs( - request: protos.google.cloud.batch.v1.IListJobsRequest, - callback: PaginationCallback< - protos.google.cloud.batch.v1.IListJobsRequest, - protos.google.cloud.batch.v1.IListJobsResponse|null|undefined, - protos.google.cloud.batch.v1.IJob>): void; - listJobs( - request?: protos.google.cloud.batch.v1.IListJobsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.batch.v1.IListJobsRequest, - protos.google.cloud.batch.v1.IListJobsResponse|null|undefined, - protos.google.cloud.batch.v1.IJob>, - callback?: PaginationCallback< - protos.google.cloud.batch.v1.IListJobsRequest, - protos.google.cloud.batch.v1.IListJobsResponse|null|undefined, - protos.google.cloud.batch.v1.IJob>): - Promise<[ - protos.google.cloud.batch.v1.IJob[], - protos.google.cloud.batch.v1.IListJobsRequest|null, - protos.google.cloud.batch.v1.IListJobsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listJobs(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Parent path. - * @param {string} request.filter - * List filter. - * @param {string} [request.orderBy] - * Optional. Sort results. Supported are "name", "name desc", "create_time", - * and "create_time desc". - * @param {number} request.pageSize - * Page size. - * @param {string} request.pageToken - * Page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.batch.v1.Job|Job} 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 `listJobsAsync()` - * 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. - */ - listJobsStream( - request?: protos.google.cloud.batch.v1.IListJobsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listJobs.createStream( - this.innerApiCalls.listJobs as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listJobs`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Parent path. - * @param {string} request.filter - * List filter. - * @param {string} [request.orderBy] - * Optional. Sort results. Supported are "name", "name desc", "create_time", - * and "create_time desc". - * @param {number} request.pageSize - * Page size. - * @param {string} request.pageToken - * Page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.batch.v1.Job|Job}. 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/batch_service.list_jobs.js - * region_tag:batch_v1_generated_BatchService_ListJobs_async - */ - listJobsAsync( - request?: protos.google.cloud.batch.v1.IListJobsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listJobs.asyncIterate( - this.innerApiCalls['listJobs'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * List Tasks associated with a job. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of a TaskGroup from which Tasks are being requested. - * Pattern: - * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" - * @param {string} request.filter - * Task filter, null filter matches all Tasks. - * Filter string should be of the format State=TaskStatus.State e.g. - * State=RUNNING - * @param {number} request.pageSize - * Page size. - * @param {string} request.pageToken - * Page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.batch.v1.Task|Task}. - * 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 `listTasksAsync()` - * 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. - */ - listTasks( - request?: protos.google.cloud.batch.v1.IListTasksRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.batch.v1.ITask[], - protos.google.cloud.batch.v1.IListTasksRequest|null, - protos.google.cloud.batch.v1.IListTasksResponse - ]>; - listTasks( - request: protos.google.cloud.batch.v1.IListTasksRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.batch.v1.IListTasksRequest, - protos.google.cloud.batch.v1.IListTasksResponse|null|undefined, - protos.google.cloud.batch.v1.ITask>): void; - listTasks( - request: protos.google.cloud.batch.v1.IListTasksRequest, - callback: PaginationCallback< - protos.google.cloud.batch.v1.IListTasksRequest, - protos.google.cloud.batch.v1.IListTasksResponse|null|undefined, - protos.google.cloud.batch.v1.ITask>): void; - listTasks( - request?: protos.google.cloud.batch.v1.IListTasksRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.batch.v1.IListTasksRequest, - protos.google.cloud.batch.v1.IListTasksResponse|null|undefined, - protos.google.cloud.batch.v1.ITask>, - callback?: PaginationCallback< - protos.google.cloud.batch.v1.IListTasksRequest, - protos.google.cloud.batch.v1.IListTasksResponse|null|undefined, - protos.google.cloud.batch.v1.ITask>): - Promise<[ - protos.google.cloud.batch.v1.ITask[], - protos.google.cloud.batch.v1.IListTasksRequest|null, - protos.google.cloud.batch.v1.IListTasksResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listTasks(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of a TaskGroup from which Tasks are being requested. - * Pattern: - * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" - * @param {string} request.filter - * Task filter, null filter matches all Tasks. - * Filter string should be of the format State=TaskStatus.State e.g. - * State=RUNNING - * @param {number} request.pageSize - * Page size. - * @param {string} request.pageToken - * Page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.batch.v1.Task|Task} 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 `listTasksAsync()` - * 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. - */ - listTasksStream( - request?: protos.google.cloud.batch.v1.IListTasksRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listTasks']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTasks.createStream( - this.innerApiCalls.listTasks as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listTasks`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of a TaskGroup from which Tasks are being requested. - * Pattern: - * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" - * @param {string} request.filter - * Task filter, null filter matches all Tasks. - * Filter string should be of the format State=TaskStatus.State e.g. - * State=RUNNING - * @param {number} request.pageSize - * Page size. - * @param {string} request.pageToken - * Page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.batch.v1.Task|Task}. 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/batch_service.list_tasks.js - * region_tag:batch_v1_generated_BatchService_ListTasks_async - */ - listTasksAsync( - request?: protos.google.cloud.batch.v1.IListTasksRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listTasks']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTasks.asyncIterate( - this.innerApiCalls['listTasks'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the location. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 google.cloud.location.Location | Location}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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.name - * The resource that owns the locations collection, if applicable. - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link google.cloud.location.Location | Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * 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, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@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 { - 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, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@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, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified job resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @returns {string} Resource name string. - */ - jobPath(project:string,location:string,job:string) { - return this.pathTemplates.jobPathTemplate.render({ - project: project, - location: location, - job: job, - }); - } - - /** - * Parse the project from Job resource. - * - * @param {string} jobName - * A fully-qualified path representing Job resource. - * @returns {string} A string representing the project. - */ - matchProjectFromJobName(jobName: string) { - return this.pathTemplates.jobPathTemplate.match(jobName).project; - } - - /** - * Parse the location from Job resource. - * - * @param {string} jobName - * A fully-qualified path representing Job resource. - * @returns {string} A string representing the location. - */ - matchLocationFromJobName(jobName: string) { - return this.pathTemplates.jobPathTemplate.match(jobName).location; - } - - /** - * Parse the job from Job resource. - * - * @param {string} jobName - * A fully-qualified path representing Job resource. - * @returns {string} A string representing the job. - */ - matchJobFromJobName(jobName: string) { - return this.pathTemplates.jobPathTemplate.match(jobName).job; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified project resource name string. - * - * @param {string} project - * @returns {string} Resource name string. - */ - projectPath(project:string) { - return this.pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the project from Project resource. - * - * @param {string} projectName - * A fully-qualified path representing Project resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectName(projectName: string) { - return this.pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * Return a fully-qualified task resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @param {string} task_group - * @param {string} task - * @returns {string} Resource name string. - */ - taskPath(project:string,location:string,job:string,taskGroup:string,task:string) { - return this.pathTemplates.taskPathTemplate.render({ - project: project, - location: location, - job: job, - task_group: taskGroup, - task: task, - }); - } - - /** - * Parse the project from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).project; - } - - /** - * Parse the location from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).location; - } - - /** - * Parse the job from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the job. - */ - matchJobFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).job; - } - - /** - * Parse the task_group from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the task_group. - */ - matchTaskGroupFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).task_group; - } - - /** - * Parse the task from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the task. - */ - matchTaskFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).task; - } - - /** - * Return a fully-qualified taskGroup resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @param {string} task_group - * @returns {string} Resource name string. - */ - taskGroupPath(project:string,location:string,job:string,taskGroup:string) { - return this.pathTemplates.taskGroupPathTemplate.render({ - project: project, - location: location, - job: job, - task_group: taskGroup, - }); - } - - /** - * Parse the project from TaskGroup resource. - * - * @param {string} taskGroupName - * A fully-qualified path representing TaskGroup resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTaskGroupName(taskGroupName: string) { - return this.pathTemplates.taskGroupPathTemplate.match(taskGroupName).project; - } - - /** - * Parse the location from TaskGroup resource. - * - * @param {string} taskGroupName - * A fully-qualified path representing TaskGroup resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTaskGroupName(taskGroupName: string) { - return this.pathTemplates.taskGroupPathTemplate.match(taskGroupName).location; - } - - /** - * Parse the job from TaskGroup resource. - * - * @param {string} taskGroupName - * A fully-qualified path representing TaskGroup resource. - * @returns {string} A string representing the job. - */ - matchJobFromTaskGroupName(taskGroupName: string) { - return this.pathTemplates.taskGroupPathTemplate.match(taskGroupName).job; - } - - /** - * Parse the task_group from TaskGroup resource. - * - * @param {string} taskGroupName - * A fully-qualified path representing TaskGroup resource. - * @returns {string} A string representing the task_group. - */ - matchTaskGroupFromTaskGroupName(taskGroupName: string) { - return this.pathTemplates.taskGroupPathTemplate.match(taskGroupName).task_group; - } - - /** - * 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.batchServiceStub && !this._terminated) { - return this.batchServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.locationsClient.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_client_config.json b/owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_client_config.json deleted file mode 100644 index be602f6e2eb..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_client_config.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "interfaces": { - "google.cloud.batch.v1.BatchService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "unavailable": [ - "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 - }, - "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateJob": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetJob": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "DeleteJob": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListJobs": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "GetTask": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "ListTasks": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_proto_list.json b/owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_proto_list.json deleted file mode 100644 index d9013a506a2..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_proto_list.json +++ /dev/null @@ -1,6 +0,0 @@ -[ - "../../protos/google/cloud/batch/v1/batch.proto", - "../../protos/google/cloud/batch/v1/job.proto", - "../../protos/google/cloud/batch/v1/task.proto", - "../../protos/google/cloud/batch/v1/volume.proto" -] diff --git a/owl-bot-staging/google-cloud-batch/v1/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-batch/v1/src/v1/gapic_metadata.json deleted file mode 100644 index 914e910ca19..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/src/v1/gapic_metadata.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.batch.v1", - "libraryPackage": "@google-cloud/batch", - "services": { - "BatchService": { - "clients": { - "grpc": { - "libraryClient": "BatchServiceClient", - "rpcs": { - "CreateJob": { - "methods": [ - "createJob" - ] - }, - "GetJob": { - "methods": [ - "getJob" - ] - }, - "GetTask": { - "methods": [ - "getTask" - ] - }, - "DeleteJob": { - "methods": [ - "deleteJob" - ] - }, - "ListJobs": { - "methods": [ - "listJobs", - "listJobsStream", - "listJobsAsync" - ] - }, - "ListTasks": { - "methods": [ - "listTasks", - "listTasksStream", - "listTasksAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "BatchServiceClient", - "rpcs": { - "CreateJob": { - "methods": [ - "createJob" - ] - }, - "GetJob": { - "methods": [ - "getJob" - ] - }, - "GetTask": { - "methods": [ - "getTask" - ] - }, - "DeleteJob": { - "methods": [ - "deleteJob" - ] - }, - "ListJobs": { - "methods": [ - "listJobs", - "listJobsStream", - "listJobsAsync" - ] - }, - "ListTasks": { - "methods": [ - "listTasks", - "listTasksStream", - "listTasksAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-batch/v1/src/v1/index.ts b/owl-bot-staging/google-cloud-batch/v1/src/v1/index.ts deleted file mode 100644 index fb53b495001..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/src/v1/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {BatchServiceClient} from './batch_service_client'; diff --git a/owl-bot-staging/google-cloud-batch/v1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-batch/v1/system-test/fixtures/sample/src/index.js deleted file mode 100644 index b9ac0eb683e..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -/* eslint-disable node/no-missing-require, no-unused-vars */ -const batch = require('@google-cloud/batch'); - -function main() { - const batchServiceClient = new batch.BatchServiceClient(); -} - -main(); diff --git a/owl-bot-staging/google-cloud-batch/v1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-batch/v1/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index c43e51952e7..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 {BatchServiceClient} from '@google-cloud/batch'; - -// check that the client class type name can be used -function doStuffWithBatchServiceClient(client: BatchServiceClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const batchServiceClient = new BatchServiceClient(); - doStuffWithBatchServiceClient(batchServiceClient); -} - -main(); diff --git a/owl-bot-staging/google-cloud-batch/v1/system-test/install.ts b/owl-bot-staging/google-cloud-batch/v1/system-test/install.ts deleted file mode 100644 index fd5bfdc71d5..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {packNTest} from 'pack-n-play'; -import {readFileSync} from 'fs'; -import {describe, it} from 'mocha'; - -describe('📦 pack-n-play test', () => { - - it('TypeScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'TypeScript user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() - } - }; - await packNTest(options); - }); - - it('JavaScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'JavaScript user can use the library', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() - } - }; - await packNTest(options); - }); - -}); diff --git a/owl-bot-staging/google-cloud-batch/v1/test/gapic_batch_service_v1.ts b/owl-bot-staging/google-cloud-batch/v1/test/gapic_batch_service_v1.ts deleted file mode 100644 index 6ad80d6c51e..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/test/gapic_batch_service_v1.ts +++ /dev/null @@ -1,1899 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 batchserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos, LocationProtos} 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.BatchServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new batchserviceModule.v1.BatchServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'batch.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new batchserviceModule.v1.BatchServiceClient(); - 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 = batchserviceModule.v1.BatchServiceClient.servicePath; - assert.strictEqual(servicePath, 'batch.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = batchserviceModule.v1.BatchServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'batch.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new batchserviceModule.v1.BatchServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'batch.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new batchserviceModule.v1.BatchServiceClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'batch.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 batchserviceModule.v1.BatchServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'batch.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 batchserviceModule.v1.BatchServiceClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'batch.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 batchserviceModule.v1.BatchServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = batchserviceModule.v1.BatchServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new batchserviceModule.v1.BatchServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.batchServiceStub, undefined); - await client.initialize(); - assert(client.batchServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.batchServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.batchServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new batchserviceModule.v1.BatchServiceClient({ - 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 batchserviceModule.v1.BatchServiceClient({ - 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('createJob', () => { - it('invokes createJob without error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.CreateJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.CreateJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1.Job() - ); - client.innerApiCalls.createJob = stubSimpleCall(expectedResponse); - const [response] = await client.createJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createJob without error using callback', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.CreateJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.CreateJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1.Job() - ); - client.innerApiCalls.createJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createJob( - request, - (err?: Error|null, result?: protos.google.cloud.batch.v1.IJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createJob with error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.CreateJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.CreateJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createJob(request), expectedError); - const actualRequest = (client.innerApiCalls.createJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createJob with closed client', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.CreateJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.CreateJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createJob(request), expectedError); - }); - }); - - describe('getJob', () => { - it('invokes getJob without error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.GetJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.GetJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1.Job() - ); - client.innerApiCalls.getJob = stubSimpleCall(expectedResponse); - const [response] = await client.getJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getJob without error using callback', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.GetJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.GetJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1.Job() - ); - client.innerApiCalls.getJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getJob( - request, - (err?: Error|null, result?: protos.google.cloud.batch.v1.IJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getJob with error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.GetJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.GetJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getJob(request), expectedError); - const actualRequest = (client.innerApiCalls.getJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getJob with closed client', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.GetJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.GetJobRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getJob(request), expectedError); - }); - }); - - describe('getTask', () => { - it('invokes getTask without error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.GetTaskRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.GetTaskRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1.Task() - ); - client.innerApiCalls.getTask = stubSimpleCall(expectedResponse); - const [response] = await client.getTask(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getTask as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTask as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getTask without error using callback', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.GetTaskRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.GetTaskRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1.Task() - ); - client.innerApiCalls.getTask = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getTask( - request, - (err?: Error|null, result?: protos.google.cloud.batch.v1.ITask|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getTask as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTask as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getTask with error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.GetTaskRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.GetTaskRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getTask = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTask(request), expectedError); - const actualRequest = (client.innerApiCalls.getTask as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTask as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getTask with closed client', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.GetTaskRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.GetTaskRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getTask(request), expectedError); - }); - }); - - describe('deleteJob', () => { - it('invokes deleteJob without error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.DeleteJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.DeleteJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteJob(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteJob without error using callback', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.DeleteJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.DeleteJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteJob( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteJob with call error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.DeleteJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.DeleteJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteJob(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteJob with LRO error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.DeleteJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.DeleteJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteJob(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteJobProgress without error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - 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.checkDeleteJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteJobProgress with error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listJobs', () => { - it('invokes listJobs without error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.ListJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.ListJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1.Job()), - generateSampleMessage(new protos.google.cloud.batch.v1.Job()), - generateSampleMessage(new protos.google.cloud.batch.v1.Job()), - ]; - client.innerApiCalls.listJobs = stubSimpleCall(expectedResponse); - const [response] = await client.listJobs(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listJobs without error using callback', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.ListJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.ListJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1.Job()), - generateSampleMessage(new protos.google.cloud.batch.v1.Job()), - generateSampleMessage(new protos.google.cloud.batch.v1.Job()), - ]; - client.innerApiCalls.listJobs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listJobs( - request, - (err?: Error|null, result?: protos.google.cloud.batch.v1.IJob[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listJobs with error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.ListJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.ListJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listJobs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listJobs(request), expectedError); - const actualRequest = (client.innerApiCalls.listJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listJobsStream without error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.ListJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.ListJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1.Job()), - generateSampleMessage(new protos.google.cloud.batch.v1.Job()), - generateSampleMessage(new protos.google.cloud.batch.v1.Job()), - ]; - client.descriptors.page.listJobs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.batch.v1.Job[] = []; - stream.on('data', (response: protos.google.cloud.batch.v1.Job) => { - 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.listJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listJobs, request)); - assert( - (client.descriptors.page.listJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listJobsStream with error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.ListJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.ListJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listJobs.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.batch.v1.Job[] = []; - stream.on('data', (response: protos.google.cloud.batch.v1.Job) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listJobs, request)); - assert( - (client.descriptors.page.listJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listJobs without error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.ListJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.ListJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1.Job()), - generateSampleMessage(new protos.google.cloud.batch.v1.Job()), - generateSampleMessage(new protos.google.cloud.batch.v1.Job()), - ]; - client.descriptors.page.listJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.batch.v1.IJob[] = []; - const iterable = client.listJobsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listJobs with error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.ListJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.ListJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listJobsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.batch.v1.IJob[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listTasks', () => { - it('invokes listTasks without error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.ListTasksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1.Task()), - generateSampleMessage(new protos.google.cloud.batch.v1.Task()), - generateSampleMessage(new protos.google.cloud.batch.v1.Task()), - ]; - client.innerApiCalls.listTasks = stubSimpleCall(expectedResponse); - const [response] = await client.listTasks(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listTasks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTasks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listTasks without error using callback', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.ListTasksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1.Task()), - generateSampleMessage(new protos.google.cloud.batch.v1.Task()), - generateSampleMessage(new protos.google.cloud.batch.v1.Task()), - ]; - client.innerApiCalls.listTasks = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listTasks( - request, - (err?: Error|null, result?: protos.google.cloud.batch.v1.ITask[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listTasks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTasks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listTasks with error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.ListTasksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listTasks = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTasks(request), expectedError); - const actualRequest = (client.innerApiCalls.listTasks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTasks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listTasksStream without error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.ListTasksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1.Task()), - generateSampleMessage(new protos.google.cloud.batch.v1.Task()), - generateSampleMessage(new protos.google.cloud.batch.v1.Task()), - ]; - client.descriptors.page.listTasks.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listTasksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.batch.v1.Task[] = []; - stream.on('data', (response: protos.google.cloud.batch.v1.Task) => { - 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.listTasks.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTasks, request)); - assert( - (client.descriptors.page.listTasks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listTasksStream with error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.ListTasksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listTasks.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listTasksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.batch.v1.Task[] = []; - stream.on('data', (response: protos.google.cloud.batch.v1.Task) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listTasks.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTasks, request)); - assert( - (client.descriptors.page.listTasks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listTasks without error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.ListTasksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1.Task()), - generateSampleMessage(new protos.google.cloud.batch.v1.Task()), - generateSampleMessage(new protos.google.cloud.batch.v1.Task()), - ]; - client.descriptors.page.listTasks.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.batch.v1.ITask[] = []; - const iterable = client.listTasksAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listTasks.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listTasks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listTasks with error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.ListTasksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listTasks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listTasksAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.batch.v1.ITask[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listTasks.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listTasks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation without error using callback', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.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 batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - 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 batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - 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 batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - 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 batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - describe('Path templates', () => { - - describe('job', () => { - const fakePath = "/rendered/path/job"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - }; - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.jobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.jobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('jobPath', () => { - const result = client.jobPath("projectValue", "locationValue", "jobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.jobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromJobName', () => { - const result = client.matchProjectFromJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.jobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromJobName', () => { - const result = client.matchLocationFromJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.jobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchJobFromJobName', () => { - const result = client.matchJobFromJobName(fakePath); - assert.strictEqual(result, "jobValue"); - assert((client.pathTemplates.jobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('task', () => { - const fakePath = "/rendered/path/task"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - task_group: "taskGroupValue", - task: "taskValue", - }; - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.taskPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.taskPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('taskPath', () => { - const result = client.taskPath("projectValue", "locationValue", "jobValue", "taskGroupValue", "taskValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.taskPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTaskName', () => { - const result = client.matchProjectFromTaskName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.taskPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTaskName', () => { - const result = client.matchLocationFromTaskName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.taskPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchJobFromTaskName', () => { - const result = client.matchJobFromTaskName(fakePath); - assert.strictEqual(result, "jobValue"); - assert((client.pathTemplates.taskPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTaskGroupFromTaskName', () => { - const result = client.matchTaskGroupFromTaskName(fakePath); - assert.strictEqual(result, "taskGroupValue"); - assert((client.pathTemplates.taskPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTaskFromTaskName', () => { - const result = client.matchTaskFromTaskName(fakePath); - assert.strictEqual(result, "taskValue"); - assert((client.pathTemplates.taskPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('taskGroup', () => { - const fakePath = "/rendered/path/taskGroup"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - task_group: "taskGroupValue", - }; - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.taskGroupPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.taskGroupPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('taskGroupPath', () => { - const result = client.taskGroupPath("projectValue", "locationValue", "jobValue", "taskGroupValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.taskGroupPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTaskGroupName', () => { - const result = client.matchProjectFromTaskGroupName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.taskGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTaskGroupName', () => { - const result = client.matchLocationFromTaskGroupName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.taskGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchJobFromTaskGroupName', () => { - const result = client.matchJobFromTaskGroupName(fakePath); - assert.strictEqual(result, "jobValue"); - assert((client.pathTemplates.taskGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTaskGroupFromTaskGroupName', () => { - const result = client.matchTaskGroupFromTaskGroupName(fakePath); - assert.strictEqual(result, "taskGroupValue"); - assert((client.pathTemplates.taskGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-batch/v1/tsconfig.json b/owl-bot-staging/google-cloud-batch/v1/tsconfig.json deleted file mode 100644 index c78f1c884ef..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2018", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts" - ] -} diff --git a/owl-bot-staging/google-cloud-batch/v1/webpack.config.js b/owl-bot-staging/google-cloud-batch/v1/webpack.config.js deleted file mode 100644 index 04a4c53960a..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const path = require('path'); - -module.exports = { - entry: './src/index.ts', - output: { - library: 'BatchService', - filename: './batch-service.js', - }, - node: { - child_process: 'empty', - fs: 'empty', - crypto: 'empty', - }, - resolve: { - alias: { - '../../../package.json': path.resolve(__dirname, 'package.json'), - }, - extensions: ['.js', '.json', '.ts'], - }, - module: { - rules: [ - { - test: /\.tsx?$/, - use: 'ts-loader', - exclude: /node_modules/ - }, - { - test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]grpc/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]retry-request/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]gtoken/, - use: 'null-loader' - }, - ], - }, - mode: 'production', -}; diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/.eslintignore b/owl-bot-staging/google-cloud-batch/v1alpha/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/.eslintrc.json b/owl-bot-staging/google-cloud-batch/v1alpha/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/.gitignore b/owl-bot-staging/google-cloud-batch/v1alpha/.gitignore deleted file mode 100644 index d4f03a0df2e..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.log -**/node_modules -/.coverage -/coverage -/.nyc_output -/docs/ -/out/ -/build/ -system-test/secrets.js -system-test/*key.json -*.lock -.DS_Store -package-lock.json -__pycache__ diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/.jsdoc.js b/owl-bot-staging/google-cloud-batch/v1alpha/.jsdoc.js deleted file mode 100644 index f3c1e45a4fc..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -'use strict'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2024 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/batch', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/.mocharc.js b/owl-bot-staging/google-cloud-batch/v1alpha/.mocharc.js deleted file mode 100644 index 13b67c34edc..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/.prettierrc.js b/owl-bot-staging/google-cloud-batch/v1alpha/.prettierrc.js deleted file mode 100644 index 9a8fd690982..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/README.md b/owl-bot-staging/google-cloud-batch/v1alpha/README.md deleted file mode 100644 index 15b2fa3f3e4..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/README.md +++ /dev/null @@ -1 +0,0 @@ -Batch: Nodejs Client diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/package.json b/owl-bot-staging/google-cloud-batch/v1alpha/package.json deleted file mode 100644 index d27d57773ff..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "@google-cloud/batch", - "version": "0.1.0", - "description": "Batch client for Node.js", - "repository": "googleapis/nodejs-batch", - "license": "Apache-2.0", - "author": "Google LLC", - "main": "build/src/index.js", - "files": [ - "build/src", - "build/protos" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "google batch", - "batch", - "batch service" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^4.3.4" - }, - "devDependencies": { - "@types/mocha": "^10.0.6", - "@types/node": "^20.12.12", - "@types/sinon": "^10.0.20", - "c8": "^9.1.0", - "gapic-tools": "^0.4.2", - "gts": "5.3.0", - "jsdoc": "^4.0.3", - "jsdoc-fresh": "^3.0.0", - "jsdoc-region-tag": "^3.0.0", - "mocha": "^10.4.0", - "pack-n-play": "^2.0.3", - "sinon": "^15.2.0", - "typescript": "5.1.6" - }, - "engines": { - "node": ">=v14" - } -} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/batch.proto b/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/batch.proto deleted file mode 100644 index 7591e92c08e..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/batch.proto +++ /dev/null @@ -1,587 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.batch.v1alpha; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/field_info.proto"; -import "google/api/resource.proto"; -import "google/cloud/batch/v1alpha/job.proto"; -import "google/cloud/batch/v1alpha/resource_allowance.proto"; -import "google/cloud/batch/v1alpha/task.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.Batch.V1Alpha"; -option go_package = "cloud.google.com/go/batch/apiv1alpha/batchpb;batchpb"; -option java_multiple_files = true; -option java_outer_classname = "BatchProto"; -option java_package = "com.google.cloud.batch.v1alpha"; -option objc_class_prefix = "GCB"; -option php_namespace = "Google\\Cloud\\Batch\\V1alpha"; -option ruby_package = "Google::Cloud::Batch::V1alpha"; - -// Google Batch Service. -// The service manages user submitted batch jobs and allocates Google Compute -// Engine VM instances to run the jobs. -service BatchService { - option (google.api.default_host) = "batch.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Create a Job. - rpc CreateJob(CreateJobRequest) returns (Job) { - option (google.api.http) = { - post: "/v1alpha/{parent=projects/*/locations/*}/jobs" - body: "job" - }; - option (google.api.method_signature) = "parent,job,job_id"; - } - - // Get a Job specified by its resource name. - rpc GetJob(GetJobRequest) returns (Job) { - option (google.api.http) = { - get: "/v1alpha/{name=projects/*/locations/*/jobs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Delete a Job. - rpc DeleteJob(DeleteJobRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1alpha/{name=projects/*/locations/*/jobs/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "google.cloud.batch.v1alpha.OperationMetadata" - }; - } - - // Cancel a Job. - rpc CancelJob(CancelJobRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1alpha/{name=projects/*/locations/*/jobs/*}:cancel" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.cloud.batch.v1alpha.CancelJobResponse" - metadata_type: "google.cloud.batch.v1alpha.OperationMetadata" - }; - } - - // Update a Job. - rpc UpdateJob(UpdateJobRequest) returns (Job) { - option (google.api.http) = { - patch: "/v1alpha/{job.name=projects/*/locations/*/jobs/*}" - body: "job" - }; - option (google.api.method_signature) = "job,update_mask"; - } - - // List all Jobs for a project within a region. - rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) { - option (google.api.http) = { - get: "/v1alpha/{parent=projects/*/locations/*}/jobs" - }; - option (google.api.method_signature) = "parent"; - } - - // Return a single Task. - rpc GetTask(GetTaskRequest) returns (Task) { - option (google.api.http) = { - get: "/v1alpha/{name=projects/*/locations/*/jobs/*/taskGroups/*/tasks/*}" - }; - option (google.api.method_signature) = "name"; - } - - // List Tasks associated with a job. - rpc ListTasks(ListTasksRequest) returns (ListTasksResponse) { - option (google.api.http) = { - get: "/v1alpha/{parent=projects/*/locations/*/jobs/*/taskGroups/*}/tasks" - }; - option (google.api.method_signature) = "parent"; - } - - // Create a Resource Allowance. - rpc CreateResourceAllowance(CreateResourceAllowanceRequest) - returns (ResourceAllowance) { - option (google.api.http) = { - post: "/v1alpha/{parent=projects/*/locations/*}/resourceAllowances" - body: "resource_allowance" - }; - option (google.api.method_signature) = - "parent,resource_allowance,resource_allowance_id"; - } - - // Get a ResourceAllowance specified by its resource name. - rpc GetResourceAllowance(GetResourceAllowanceRequest) - returns (ResourceAllowance) { - option (google.api.http) = { - get: "/v1alpha/{name=projects/*/locations/*/resourceAllowances/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Delete a ResourceAllowance. - rpc DeleteResourceAllowance(DeleteResourceAllowanceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1alpha/{name=projects/*/locations/*/resourceAllowances/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "google.cloud.batch.v1alpha.OperationMetadata" - }; - } - - // List all ResourceAllowances for a project within a region. - rpc ListResourceAllowances(ListResourceAllowancesRequest) - returns (ListResourceAllowancesResponse) { - option (google.api.http) = { - get: "/v1alpha/{parent=projects/*/locations/*}/resourceAllowances" - }; - option (google.api.method_signature) = "parent"; - } - - // Update a Resource Allowance. - rpc UpdateResourceAllowance(UpdateResourceAllowanceRequest) - returns (ResourceAllowance) { - option (google.api.http) = { - patch: "/v1alpha/{resource_allowance.name=projects/*/locations/*/resourceAllowances/*}" - body: "resource_allowance" - }; - option (google.api.method_signature) = "resource_allowance,update_mask"; - } -} - -// CreateJob Request. -message CreateJobRequest { - // Required. The parent resource name where the Job will be created. - // Pattern: "projects/{project}/locations/{location}" - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { child_type: "batch.googleapis.com/Job" } - ]; - - // ID used to uniquely identify the Job within its parent scope. - // This field should contain at most 63 characters and must start with - // lowercase characters. - // Only lowercase characters, numbers and '-' are accepted. - // The '-' character cannot be the first or the last one. - // A system generated ID will be used if the field is not set. - // - // The job.name field in the request will be ignored and the created resource - // name of the Job will be "{parent}/jobs/{job_id}". - string job_id = 2; - - // Required. The Job to create. - Job job = 3 [(google.api.field_behavior) = REQUIRED]; - - // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// GetJob Request. -message GetJobRequest { - // Required. Job name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "batch.googleapis.com/Job" } - ]; -} - -// DeleteJob Request. -message DeleteJobRequest { - // Job name. - string name = 1; - - // Optional. Reason for this deletion. - string reason = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// CancelJob Request. -message CancelJobRequest { - // Required. Job name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "batch.googleapis.com/Job" } - ]; - - // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 4 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; -} - -// Response to the CancelJob request. -message CancelJobResponse {} - -// UpdateJob Request. -message UpdateJobRequest { - // Required. The Job to update. - // Only fields specified in `updateMask` are updated. - Job job = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Mask of fields to update. - // - // The `jobs.patch` method can only be used while a job is in the `QUEUED`, - // `SCHEDULED`, or `RUNNING` state and currently only supports increasing the - // value of the first `taskCount` field in the job's `taskGroups` field. - // Therefore, you must set the value of `updateMask` to `taskGroups`. Any - // other job fields in the update request will be ignored. - // - // For example, to update a job's `taskCount` to `2`, set `updateMask` to - // `taskGroups` and use the following request body: - // ``` - // { - // "taskGroups":[{ - // "taskCount": 2 - // }] - // } - // ``` - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 3 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; -} - -// ListJob Request. -message ListJobsRequest { - // Parent path. - string parent = 1; - - // List filter. - string filter = 4; - - // Optional. Sort results. Supported are "name", "name desc", "create_time", - // and "create_time desc". - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Page size. - int32 page_size = 2; - - // Page token. - string page_token = 3; -} - -// ListJob Response. -message ListJobsResponse { - // Jobs. - repeated Job jobs = 1; - - // Next page token. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// ListTasks Request. -message ListTasksRequest { - // Required. Name of a TaskGroup from which Tasks are being requested. - // Pattern: - // "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "batch.googleapis.com/TaskGroup" } - ]; - - // Task filter, null filter matches all Tasks. - // Filter string should be of the format State=TaskStatus.State e.g. - // State=RUNNING - string filter = 2; - - // Not implemented. - string order_by = 5; - - // Page size. - int32 page_size = 3; - - // Page token. - string page_token = 4; -} - -// ListTasks Response. -message ListTasksResponse { - // Tasks. - repeated Task tasks = 1; - - // Next page token. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// Request for a single Task by name. -message GetTaskRequest { - // Required. Task name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "batch.googleapis.com/Task" } - ]; -} - -// CreateResourceAllowance Request. -message CreateResourceAllowanceRequest { - // Required. The parent resource name where the ResourceAllowance will be - // created. Pattern: "projects/{project}/locations/{location}" - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "batch.googleapis.com/ResourceAllowance" - } - ]; - - // ID used to uniquely identify the ResourceAllowance within its parent scope. - // This field should contain at most 63 characters and must start with - // lowercase characters. - // Only lowercase characters, numbers and '-' are accepted. - // The '-' character cannot be the first or the last one. - // A system generated ID will be used if the field is not set. - // - // The resource_allowance.name field in the request will be ignored and the - // created resource name of the ResourceAllowance will be - // "{parent}/resourceAllowances/{resource_allowance_id}". - string resource_allowance_id = 2; - - // Required. The ResourceAllowance to create. - ResourceAllowance resource_allowance = 3 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 4 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; -} - -// GetResourceAllowance Request. -message GetResourceAllowanceRequest { - // Required. ResourceAllowance name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "batch.googleapis.com/ResourceAllowance" - } - ]; -} - -// DeleteResourceAllowance Request. -message DeleteResourceAllowanceRequest { - // Required. ResourceAllowance name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "batch.googleapis.com/ResourceAllowance" - } - ]; - - // Optional. Reason for this deletion. - string reason = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 4 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; -} - -// ListResourceAllowances Request. -message ListResourceAllowancesRequest { - // Required. Parent path. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "batch.googleapis.com/ResourceAllowance" - } - ]; - - // Optional. Page size. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Page token. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// ListResourceAllowances Response. -message ListResourceAllowancesResponse { - // ResourceAllowances. - repeated ResourceAllowance resource_allowances = 1; - - // Next page token. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// UpdateResourceAllowance Request. -message UpdateResourceAllowanceRequest { - // Required. The ResourceAllowance to update. - // Update description. - // Only fields specified in `update_mask` are updated. - ResourceAllowance resource_allowance = 1 - [(google.api.field_behavior) = REQUIRED]; - - // Required. Mask of fields to update. - // - // Field mask is used to specify the fields to be overwritten in the - // ResourceAllowance resource by the update. - // The fields specified in the update_mask are relative to the resource, not - // the full request. A field will be overwritten if it is in the mask. If the - // user does not provide a mask then all fields will be overwritten. - // - // UpdateResourceAllowance request now only supports update on `limit` field. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 3 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; -} - -// Represents the metadata of the long-running operation. -message OperationMetadata { - // Output only. The time the operation was created. - google.protobuf.Timestamp create_time = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time the operation finished running. - google.protobuf.Timestamp end_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Server-defined resource path for the target of the operation. - string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Name of the verb executed by the operation. - string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Human-readable status of the operation, if any. - string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Identifies whether the user has requested cancellation - // of the operation. Operations that have successfully been cancelled - // have - // [google.longrunning.Operation.error][google.longrunning.Operation.error] - // value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - // corresponding to `Code.CANCELLED`. - bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. API version used to start the operation. - string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/job.proto b/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/job.proto deleted file mode 100644 index 8ab62c01f9a..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/job.proto +++ /dev/null @@ -1,802 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.batch.v1alpha; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/batch/v1alpha/task.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.Batch.V1Alpha"; -option go_package = "cloud.google.com/go/batch/apiv1alpha/batchpb;batchpb"; -option java_multiple_files = true; -option java_outer_classname = "JobProto"; -option java_package = "com.google.cloud.batch.v1alpha"; -option objc_class_prefix = "GCB"; -option php_namespace = "Google\\Cloud\\Batch\\V1alpha"; -option ruby_package = "Google::Cloud::Batch::V1alpha"; - -// The Cloud Batch Job description. -message Job { - option (google.api.resource) = { - type: "batch.googleapis.com/Job" - pattern: "projects/{project}/locations/{location}/jobs/{job}" - }; - - // The order that TaskGroups are scheduled relative to each other. - // - // Not yet implemented. - enum SchedulingPolicy { - // Unspecified. - SCHEDULING_POLICY_UNSPECIFIED = 0; - - // Run all TaskGroups as soon as possible. - AS_SOON_AS_POSSIBLE = 1; - } - - // Output only. Job name. - // For example: "projects/123456/locations/us-central1/jobs/job01". - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A system generated unique ID for the Job. - string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Priority of the Job. - // The valid value range is [0, 100). Default value is 0. - // Higher value indicates higher priority. - // A job with higher priority value is more likely to run earlier if all other - // requirements are satisfied. - int64 priority = 3; - - // Required. TaskGroups in the Job. Only one TaskGroup is supported now. - repeated TaskGroup task_groups = 4 [(google.api.field_behavior) = REQUIRED]; - - // Scheduling policy for TaskGroups in the job. - SchedulingPolicy scheduling_policy = 5; - - // At least one of the dependencies must be satisfied before the Job is - // scheduled to run. - // Only one JobDependency is supported now. - // Not yet implemented. - repeated JobDependency dependencies = 6; - - // Compute resource allocation for all TaskGroups in the Job. - AllocationPolicy allocation_policy = 7; - - // Custom labels to apply to the job and any Cloud Logging - // [LogEntry](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry) - // that it generates. - // - // Use labels to group and describe the resources they are applied to. Batch - // automatically applies predefined labels and supports multiple `labels` - // fields for each job, which each let you apply custom labels to various - // resources. Label names that start with "goog-" or "google-" are - // reserved for predefined labels. For more information about labels with - // Batch, see - // [Organize resources using - // labels](https://cloud.google.com/batch/docs/organize-resources-using-labels). - map labels = 8; - - // Output only. Job status. It is read only for users. - JobStatus status = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Deprecated: please use notifications instead. - JobNotification notification = 10 [deprecated = true]; - - // Output only. When the Job was created. - google.protobuf.Timestamp create_time = 11 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The last time the Job was updated. - google.protobuf.Timestamp update_time = 12 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Log preservation policy for the Job. - LogsPolicy logs_policy = 13; - - // Notification configurations. - repeated JobNotification notifications = 14; -} - -// LogsPolicy describes if and how a job's logs are preserved. Logs include -// information that is automatically written by the Batch service agent and any -// information that you configured the job's runnables to write to the `stdout` -// or `stderr` streams. -message LogsPolicy { - // `CloudLoggingOption` contains additional settings for Cloud Logging logs - // generated by Batch job. - message CloudLoggingOption { - // Optional. Set this field to `true` to change the [monitored resource - // type](https://cloud.google.com/monitoring/api/resources) for - // Cloud Logging logs generated by this Batch job from - // the - // [`batch.googleapis.com/Job`](https://cloud.google.com/monitoring/api/resources#tag_batch.googleapis.com/Job) - // type to the formerly used - // [`generic_task`](https://cloud.google.com/monitoring/api/resources#tag_generic_task) - // type. - bool use_generic_task_monitored_resource = 1 - [(google.api.field_behavior) = OPTIONAL]; - } - - // The destination (if any) for logs. - enum Destination { - // (Default) Logs are not preserved. - DESTINATION_UNSPECIFIED = 0; - - // Logs are streamed to Cloud Logging. Optionally, you can configure - // additional settings in the `cloudLoggingOption` field. - CLOUD_LOGGING = 1; - - // Logs are saved to the file path specified in the `logsPath` field. - PATH = 2; - } - - // If and where logs should be saved. - Destination destination = 1; - - // When `destination` is set to `PATH`, you must set this field to the path - // where you want logs to be saved. This path can point to a local directory - // on the VM or (if congifured) a directory under the mount path of any - // Cloud Storage bucket, network file system (NFS), or writable persistent - // disk that is mounted to the job. For example, if the job has a bucket with - // `mountPath` set to `/mnt/disks/my-bucket`, you can write logs to the - // root directory of the `remotePath` of that bucket by setting this field to - // `/mnt/disks/my-bucket/`. - string logs_path = 2; - - // Optional. When `destination` is set to `CLOUD_LOGGING`, you can optionally - // set this field to configure additional settings for Cloud Logging. - CloudLoggingOption cloud_logging_option = 3 - [(google.api.field_behavior) = OPTIONAL]; -} - -// JobDependency describes the state of other Jobs that the start of this Job -// depends on. -// All dependent Jobs must have been submitted in the same region. -message JobDependency { - // Dependency type. - enum Type { - // Unspecified. - TYPE_UNSPECIFIED = 0; - - // The dependent Job has succeeded. - SUCCEEDED = 1; - - // The dependent Job has failed. - FAILED = 2; - - // SUCCEEDED or FAILED. - FINISHED = 3; - } - - // Each item maps a Job name to a Type. - // All items must be satisfied for the JobDependency to be satisfied (the AND - // operation). - // Once a condition for one item becomes true, it won't go back to false - // even the dependent Job state changes again. - map items = 1; -} - -// Job status. -message JobStatus { - // VM instance status. - message InstanceStatus { - // The Compute Engine machine type. - string machine_type = 1; - - // The VM instance provisioning model. - AllocationPolicy.ProvisioningModel provisioning_model = 2; - - // The max number of tasks can be assigned to this instance type. - int64 task_pack = 3; - - // The VM boot disk. - AllocationPolicy.Disk boot_disk = 4; - } - - // Aggregated task status for a TaskGroup. - message TaskGroupStatus { - // Count of task in each state in the TaskGroup. - // The map key is task state name. - map counts = 1; - - // Status of instances allocated for the TaskGroup. - repeated InstanceStatus instances = 2; - } - - // Valid Job states. - enum State { - // Job state unspecified. - STATE_UNSPECIFIED = 0; - - // Job is admitted (validated and persisted) and waiting for resources. - QUEUED = 1; - - // Job is scheduled to run as soon as resource allocation is ready. - // The resource allocation may happen at a later time but with a high - // chance to succeed. - SCHEDULED = 2; - - // Resource allocation has been successful. At least one Task in the Job is - // RUNNING. - RUNNING = 3; - - // All Tasks in the Job have finished successfully. - SUCCEEDED = 4; - - // At least one Task in the Job has failed. - FAILED = 5; - - // The Job will be deleted, but has not been deleted yet. Typically this is - // because resources used by the Job are still being cleaned up. - DELETION_IN_PROGRESS = 6; - - // The Job cancellation is in progress, this is because the resources used - // by the Job are still being cleaned up. - CANCELLATION_IN_PROGRESS = 7; - - // The Job has been cancelled, the task executions were stopped and the - // resources were cleaned up. - CANCELLED = 8; - } - - // Job state - State state = 1; - - // Job status events - repeated StatusEvent status_events = 2; - - // Aggregated task status for each TaskGroup in the Job. - // The map key is TaskGroup ID. - map task_groups = 4; - - // The duration of time that the Job spent in status RUNNING. - google.protobuf.Duration run_duration = 5; - - // The resource usage of the job. - ResourceUsage resource_usage = 6; -} - -// ResourceUsage describes the resource usage of the job. -message ResourceUsage { - // The CPU core hours that the job consumes. - double core_hours = 1; -} - -// Notification configurations. -message JobNotification { - // Message details. - // Describe the conditions under which messages will be sent. - // If no attribute is defined, no message will be sent by default. - // One message should specify either the job or the task level attributes, - // but not both. For example, - // job level: JOB_STATE_CHANGED and/or a specified new_job_state; - // task level: TASK_STATE_CHANGED and/or a specified new_task_state. - message Message { - // The message type. - Type type = 1; - - // The new job state. - JobStatus.State new_job_state = 2; - - // The new task state. - TaskStatus.State new_task_state = 3; - } - - // The message type. - enum Type { - // Unspecified. - TYPE_UNSPECIFIED = 0; - - // Notify users that the job state has changed. - JOB_STATE_CHANGED = 1; - - // Notify users that the task state has changed. - TASK_STATE_CHANGED = 2; - } - - // The Pub/Sub topic where notifications for the job, like state - // changes, will be published. If undefined, no Pub/Sub notifications - // are sent for this job. - // - // Specify the topic using the following format: - // `projects/{project}/topics/{topic}`. - // Notably, if you want to specify a Pub/Sub topic that is in a - // different project than the job, your administrator must grant your - // project's Batch service agent permission to publish to that topic. - // - // For more information about configuring Pub/Sub notifications for - // a job, see - // https://cloud.google.com/batch/docs/enable-notifications. - string pubsub_topic = 1; - - // The attribute requirements of messages to be sent to this Pub/Sub topic. - // Without this field, no message will be sent. - Message message = 2; -} - -// A Job's resource allocation policy describes when, where, and how compute -// resources should be allocated for the Job. -message AllocationPolicy { - message LocationPolicy { - // A list of allowed location names represented by internal URLs. - // - // Each location can be a region or a zone. - // Only one region or multiple zones in one region is supported now. - // For example, - // ["regions/us-central1"] allow VMs in any zones in region us-central1. - // ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs - // in zones us-central1-a and us-central1-c. - // - // Mixing locations from different regions would cause errors. - // For example, - // ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b", - // "zones/us-west1-a"] contains locations from two distinct regions: - // us-central1 and us-west1. This combination will trigger an error. - repeated string allowed_locations = 1; - - // A list of denied location names. - // - // Not yet implemented. - repeated string denied_locations = 2; - } - - // A new persistent disk or a local ssd. - // A VM can only have one local SSD setting but multiple local SSD partitions. - // See https://cloud.google.com/compute/docs/disks#pdspecs and - // https://cloud.google.com/compute/docs/disks#localssds. - message Disk { - // A data source from which a PD will be created. - oneof data_source { - // URL for a VM image to use as the data source for this disk. - // For example, the following are all valid URLs: - // - // * Specify the image by its family name: - // projects/{project}/global/images/family/{image_family} - // * Specify the image version: - // projects/{project}/global/images/{image_version} - // - // You can also use Batch customized image in short names. - // The following image values are supported for a boot disk: - // - // * `batch-debian`: use Batch Debian images. - // * `batch-cos`: use Batch Container-Optimized images. - // * `batch-hpc-rocky`: use Batch HPC Rocky Linux images. - string image = 4; - - // Name of a snapshot used as the data source. - // Snapshot is not supported as boot disk now. - string snapshot = 5; - } - - // Disk type as shown in `gcloud compute disk-types list`. - // For example, local SSD uses type "local-ssd". - // Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd" - // or "pd-standard". If not specified, "pd-standard" will be used as the - // default type for non-boot disks, "pd-balanced" will be used as the - // default type for boot disks. - string type = 1; - - // Disk size in GB. - // - // **Non-Boot Disk**: - // If the `type` specifies a persistent disk, this field - // is ignored if `data_source` is set as `image` or `snapshot`. - // If the `type` specifies a local SSD, this field should be a multiple of - // 375 GB, otherwise, the final size will be the next greater multiple of - // 375 GB. - // - // **Boot Disk**: - // Batch will calculate the boot disk size based on source - // image and task requirements if you do not speicify the size. - // If both this field and the `boot_disk_mib` field in task spec's - // `compute_resource` are defined, Batch will only honor this field. - // Also, this field should be no smaller than the source disk's - // size when the `data_source` is set as `snapshot` or `image`. - // For example, if you set an image as the `data_source` field and the - // image's default disk size 30 GB, you can only use this field to make the - // disk larger or equal to 30 GB. - int64 size_gb = 2; - - // Local SSDs are available through both "SCSI" and "NVMe" interfaces. - // If not indicated, "NVMe" will be the default one for local ssds. - // This field is ignored for persistent disks as the interface is chosen - // automatically. See - // https://cloud.google.com/compute/docs/disks/persistent-disks#choose_an_interface. - string disk_interface = 6; - } - - // A new or an existing persistent disk (PD) or a local ssd attached to a VM - // instance. - message AttachedDisk { - oneof attached { - Disk new_disk = 1; - - // Name of an existing PD. - string existing_disk = 2; - } - - // Device name that the guest operating system will see. - // It is used by Runnable.volumes field to mount disks. So please specify - // the device_name if you want Batch to help mount the disk, and it should - // match the device_name field in volumes. - string device_name = 3; - } - - // Accelerator describes Compute Engine accelerators to be attached to the VM. - message Accelerator { - // The accelerator type. For example, "nvidia-tesla-t4". - // See `gcloud compute accelerator-types list`. - string type = 1; - - // The number of accelerators of this type. - int64 count = 2; - - // Deprecated: please use instances[0].install_gpu_drivers instead. - bool install_gpu_drivers = 3 [deprecated = true]; - - // Optional. The NVIDIA GPU driver version that should be installed for this - // type. - // - // You can define the specific driver version such as "470.103.01", - // following the driver version requirements in - // https://cloud.google.com/compute/docs/gpus/install-drivers-gpu#minimum-driver. - // Batch will install the specific accelerator driver if qualified. - string driver_version = 4 [(google.api.field_behavior) = OPTIONAL]; - } - - // InstancePolicy describes an instance type and resources attached to each VM - // created by this InstancePolicy. - message InstancePolicy { - // Deprecated: please use machine_type instead. - repeated string allowed_machine_types = 1 [deprecated = true]; - - // The Compute Engine machine type. - string machine_type = 2; - - // The minimum CPU platform. - // See - // https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. - string min_cpu_platform = 3; - - // The provisioning model. - ProvisioningModel provisioning_model = 4; - - // The accelerators attached to each VM instance. - repeated Accelerator accelerators = 5; - - // Boot disk to be created and attached to each VM by this InstancePolicy. - // Boot disk will be deleted when the VM is deleted. - // Batch API now only supports booting from image. - Disk boot_disk = 8; - - // Non-boot disks to be attached for each VM created by this InstancePolicy. - // New disks will be deleted when the VM is deleted. - // A non-boot disk is a disk that can be of a device with a - // file system or a raw storage drive that is not ready for data - // storage and accessing. - repeated AttachedDisk disks = 6; - - // Optional. If not specified (default), VMs will consume any applicable - // reservation. If "NO_RESERVATION" is specified, VMs will not consume any - // reservation. Otherwise, if specified, VMs will consume only the specified - // reservation. - string reservation = 7 [(google.api.field_behavior) = OPTIONAL]; - } - - // InstancePolicyOrTemplate lets you define the type of resources to use for - // this job either with an InstancePolicy or an instance template. - // If undefined, Batch picks the type of VM to use and doesn't include - // optional VM resources such as GPUs and extra disks. - message InstancePolicyOrTemplate { - oneof policy_template { - // InstancePolicy. - InstancePolicy policy = 1; - - // Name of an instance template used to create VMs. - // Named the field as 'instance_template' instead of 'template' to avoid - // C++ keyword conflict. - // - // Batch only supports global instance templates from the same project as - // the job. - // You can specify the global instance template as a full or partial URL. - string instance_template = 2; - } - - // Set this field true if you want Batch to help fetch drivers from a third - // party location and install them for GPUs specified in - // `policy.accelerators` or `instance_template` on your behalf. Default is - // false. - // - // For Container-Optimized Image cases, Batch will install the - // accelerator driver following milestones of - // https://cloud.google.com/container-optimized-os/docs/release-notes. For - // non Container-Optimized Image cases, following - // https://github.com/GoogleCloudPlatform/compute-gpu-installation/blob/main/linux/install_gpu_driver.py. - bool install_gpu_drivers = 3; - - // Optional. Set this field true if you want Batch to install Ops Agent on - // your behalf. Default is false. - bool install_ops_agent = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Set this field to `true` if you want Batch to block - // project-level SSH keys from accessing this job's VMs. Alternatively, you - // can configure the job to specify a VM instance template that blocks - // project-level SSH keys. In either case, Batch blocks project-level SSH - // keys while creating the VMs for this job. - // - // Batch allows project-level SSH keys for a job's VMs only if all - // the following are true: - // - // + This field is undefined or set to `false`. - // + The job's VM instance template (if any) doesn't block project-level - // SSH keys. - // - // Notably, you can override this behavior by manually updating a VM to - // block or allow project-level SSH keys. For more information about - // blocking project-level SSH keys, see the Compute Engine documentation: - // https://cloud.google.com/compute/docs/connect/restrict-ssh-keys#block-keys - bool block_project_ssh_keys = 5 [(google.api.field_behavior) = OPTIONAL]; - } - - // A network interface. - message NetworkInterface { - // The URL of an existing network resource. - // You can specify the network as a full or partial URL. - // - // For example, the following are all valid URLs: - // - // * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network} - // * projects/{project}/global/networks/{network} - // * global/networks/{network} - string network = 1; - - // The URL of an existing subnetwork resource in the network. - // You can specify the subnetwork as a full or partial URL. - // - // For example, the following are all valid URLs: - // - // * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork} - // * projects/{project}/regions/{region}/subnetworks/{subnetwork} - // * regions/{region}/subnetworks/{subnetwork} - string subnetwork = 2; - - // Default is false (with an external IP address). Required if - // no external public IP address is attached to the VM. If no external - // public IP address, additional configuration is required to allow the VM - // to access Google Services. See - // https://cloud.google.com/vpc/docs/configure-private-google-access and - // https://cloud.google.com/nat/docs/gce-example#create-nat for more - // information. - bool no_external_ip_address = 3; - } - - // NetworkPolicy describes VM instance network configurations. - message NetworkPolicy { - // Network configurations. - repeated NetworkInterface network_interfaces = 1; - } - - // PlacementPolicy describes a group placement policy for the VMs controlled - // by this AllocationPolicy. - message PlacementPolicy { - // UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you - // want VMs to be located close to each other for low network latency - // between the VMs. No placement policy will be generated when collocation - // is UNSPECIFIED. - string collocation = 1; - - // When specified, causes the job to fail if more than max_distance logical - // switches are required between VMs. Batch uses the most compact possible - // placement of VMs even when max_distance is not specified. An explicit - // max_distance makes that level of compactness a strict requirement. - // Not yet implemented - int64 max_distance = 2; - } - - // Compute Engine VM instance provisioning model. - enum ProvisioningModel { - // Unspecified. - PROVISIONING_MODEL_UNSPECIFIED = 0; - - // Standard VM. - STANDARD = 1; - - // SPOT VM. - SPOT = 2; - - // Preemptible VM (PVM). - // - // Above SPOT VM is the preferable model for preemptible VM instances: the - // old preemptible VM model (indicated by this field) is the older model, - // and has been migrated to use the SPOT model as the underlying technology. - // This old model will still be supported. - PREEMPTIBLE = 3; - } - - // Location where compute resources should be allocated for the Job. - LocationPolicy location = 1; - - // Deprecated: please use instances[0].policy instead. - InstancePolicy instance = 2 [deprecated = true]; - - // Describe instances that can be created by this AllocationPolicy. - // Only instances[0] is supported now. - repeated InstancePolicyOrTemplate instances = 8; - - // Deprecated: please use instances[0].template instead. - repeated string instance_templates = 3 [deprecated = true]; - - // Deprecated: please use instances[0].policy.provisioning_model instead. - repeated ProvisioningModel provisioning_models = 4 [deprecated = true]; - - // Deprecated: please use service_account instead. - string service_account_email = 5 [deprecated = true]; - - // Defines the service account for Batch-created VMs. If omitted, the [default - // Compute Engine service - // account](https://cloud.google.com/compute/docs/access/service-accounts#default_service_account) - // is used. Must match the service account specified in any used instance - // template configured in the Batch job. - // - // Includes the following fields: - // * email: The service account's email address. If not set, the default - // Compute Engine service account is used. - // * scopes: Additional OAuth scopes to grant the service account, beyond the - // default cloud-platform scope. (list of strings) - ServiceAccount service_account = 9; - - // Custom labels to apply to the job and all the Compute Engine resources - // that both are created by this allocation policy and support labels. - // - // Use labels to group and describe the resources they are applied to. Batch - // automatically applies predefined labels and supports multiple `labels` - // fields for each job, which each let you apply custom labels to various - // resources. Label names that start with "goog-" or "google-" are - // reserved for predefined labels. For more information about labels with - // Batch, see - // [Organize resources using - // labels](https://cloud.google.com/batch/docs/organize-resources-using-labels). - map labels = 6; - - // The network policy. - // - // If you define an instance template in the `InstancePolicyOrTemplate` field, - // Batch will use the network settings in the instance template instead of - // this field. - NetworkPolicy network = 7; - - // The placement policy. - PlacementPolicy placement = 10; - - // Optional. Tags applied to the VM instances. - // - // The tags identify valid sources or targets for network firewalls. - // Each tag must be 1-63 characters long, and comply with - // [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). - repeated string tags = 11 [(google.api.field_behavior) = OPTIONAL]; -} - -// A TaskGroup defines one or more Tasks that all share the same TaskSpec. -message TaskGroup { - option (google.api.resource) = { - type: "batch.googleapis.com/TaskGroup" - pattern: "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" - }; - - // How Tasks in the TaskGroup should be scheduled relative to each other. - enum SchedulingPolicy { - // Unspecified. - SCHEDULING_POLICY_UNSPECIFIED = 0; - - // Run Tasks as soon as resources are available. - // - // Tasks might be executed in parallel depending on parallelism and - // task_count values. - AS_SOON_AS_POSSIBLE = 1; - - // Run Tasks sequentially with increased task index. - IN_ORDER = 2; - } - - // Output only. TaskGroup name. - // The system generates this field based on parent Job name. - // For example: - // "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01". - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. Tasks in the group share the same task spec. - TaskSpec task_spec = 3 [(google.api.field_behavior) = REQUIRED]; - - // Number of Tasks in the TaskGroup. - // Default is 1. - int64 task_count = 4; - - // Max number of tasks that can run in parallel. - // Default to min(task_count, parallel tasks per job limit). - // See: [Job Limits](https://cloud.google.com/batch/quotas#job_limits). - // Field parallelism must be 1 if the scheduling_policy is IN_ORDER. - int64 parallelism = 5; - - // Scheduling policy for Tasks in the TaskGroup. - // The default value is AS_SOON_AS_POSSIBLE. - SchedulingPolicy scheduling_policy = 6; - - // Compute resource allocation for the TaskGroup. - // If specified, it overrides resources in Job. - AllocationPolicy allocation_policy = 7; - - // Labels for the TaskGroup. - // Labels could be user provided or system generated. - // You can assign up to 64 labels. [Google Compute Engine label - // restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions) - // apply. - // Label names that start with "goog-" or "google-" are reserved. - map labels = 8; - - // An array of environment variable mappings, which are passed to Tasks with - // matching indices. If task_environments is used then task_count should - // not be specified in the request (and will be ignored). Task count will be - // the length of task_environments. - // - // Tasks get a BATCH_TASK_INDEX and BATCH_TASK_COUNT environment variable, in - // addition to any environment variables set in task_environments, specifying - // the number of Tasks in the Task's parent TaskGroup, and the specific Task's - // index in the TaskGroup (0 through BATCH_TASK_COUNT - 1). - repeated Environment task_environments = 9; - - // Max number of tasks that can be run on a VM at the same time. - // If not specified, the system will decide a value based on available - // compute resources on a VM and task requirements. - int64 task_count_per_node = 10; - - // When true, Batch will populate a file with a list of all VMs assigned to - // the TaskGroup and set the BATCH_HOSTS_FILE environment variable to the path - // of that file. Defaults to false. The host file supports up to 1000 VMs. - bool require_hosts_file = 11; - - // When true, Batch will configure SSH to allow passwordless login between - // VMs running the Batch tasks in the same TaskGroup. - bool permissive_ssh = 12; - - // Optional. If not set or set to false, Batch uses the root user to execute - // runnables. If set to true, Batch runs the runnables using a non-root user. - // Currently, the non-root user Batch used is generated by OS Login. For more - // information, see [About OS - // Login](https://cloud.google.com/compute/docs/oslogin). - bool run_as_non_root = 14 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. ServiceAccount used by tasks within the task group for the access - // to other Cloud resources. This allows tasks to operate with permissions - // distinct from the service account for the VM set at `AllocationPolicy`. Use - // this field when tasks require different access rights than those of the VM. - // - // Specify the service account's `email` field. Ensure `scopes` - // include any necessary permissions for tasks, in addition to the default - // 'cloud-platform' scope. - ServiceAccount service_account = 15 [(google.api.field_behavior) = OPTIONAL]; -} - -// Carries information about a Google Cloud service account. -message ServiceAccount { - // Email address of the service account. - string email = 1; - - // List of scopes to be enabled for this service account. - repeated string scopes = 2; -} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/notification.proto b/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/notification.proto deleted file mode 100644 index 6eedfc615c5..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/notification.proto +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.batch.v1alpha; - -import "google/api/field_behavior.proto"; - -option csharp_namespace = "Google.Cloud.Batch.V1Alpha"; -option go_package = "cloud.google.com/go/batch/apiv1alpha/batchpb;batchpb"; -option java_multiple_files = true; -option java_outer_classname = "NotificationProto"; -option java_package = "com.google.cloud.batch.v1alpha"; -option objc_class_prefix = "GCB"; -option php_namespace = "Google\\Cloud\\Batch\\V1alpha"; -option ruby_package = "Google::Cloud::Batch::V1alpha"; - -// Notification on resource state change. -message Notification { - // Required. The Pub/Sub topic where notifications like the resource allowance - // state changes will be published. The topic must exist in the same project - // as the job and billings will be charged to this project. If not specified, - // no Pub/Sub messages will be sent. Topic format: - // `projects/{project}/topics/{topic}`. - string pubsub_topic = 1 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/resource_allowance.proto b/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/resource_allowance.proto deleted file mode 100644 index 988271f5802..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/resource_allowance.proto +++ /dev/null @@ -1,208 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.batch.v1alpha; - -import "google/api/field_behavior.proto"; -import "google/api/field_info.proto"; -import "google/api/resource.proto"; -import "google/cloud/batch/v1alpha/notification.proto"; -import "google/protobuf/timestamp.proto"; -import "google/type/interval.proto"; - -option csharp_namespace = "Google.Cloud.Batch.V1Alpha"; -option go_package = "cloud.google.com/go/batch/apiv1alpha/batchpb;batchpb"; -option java_multiple_files = true; -option java_outer_classname = "ResourceAllowanceProto"; -option java_package = "com.google.cloud.batch.v1alpha"; -option objc_class_prefix = "GCB"; -option php_namespace = "Google\\Cloud\\Batch\\V1alpha"; -option ruby_package = "Google::Cloud::Batch::V1alpha"; - -// A `CalendarPeriod` represents the abstract concept of a time period that -// has a canonical start. All calendar times begin at 12 AM US and Canadian -// Pacific Time (UTC-8). -enum CalendarPeriod { - // Unspecified. - CALENDAR_PERIOD_UNSPECIFIED = 0; - - // The month starts on the first date of the month and resets at the beginning - // of each month. - MONTH = 1; - - // The quarter starts on dates January 1, April 1, July 1, and October 1 of - // each year and resets at the beginning of the next quarter. - QUARTER = 2; - - // The year starts on January 1 and resets at the beginning of the next year. - YEAR = 3; - - // The week period starts and resets every Monday. - WEEK = 4; - - // The day starts at 12:00am. - DAY = 5; -} - -// ResourceAllowance valid state. -enum ResourceAllowanceState { - // Unspecified. - RESOURCE_ALLOWANCE_STATE_UNSPECIFIED = 0; - - // ResourceAllowance is active and in use. - RESOURCE_ALLOWANCE_ACTIVE = 1; - - // ResourceAllowance limit is reached. - RESOURCE_ALLOWANCE_DEPLETED = 2; -} - -// The Resource Allowance description for Cloud Batch. -// Only one Resource Allowance is supported now under a specific location and -// project. -message ResourceAllowance { - option (google.api.resource) = { - type: "batch.googleapis.com/ResourceAllowance" - pattern: "projects/{project}/locations/{location}/resourceAllowances/{resource_allowance}" - plural: "resourceAllowances" - singular: "resourceAllowance" - }; - - // ResourceAllowance detail. - oneof resource_allowance { - // The detail of usage resource allowance. - UsageResourceAllowance usage_resource_allowance = 4; - } - - // Identifier. ResourceAllowance name. - // For example: - // "projects/123456/locations/us-central1/resourceAllowances/resource-allowance-1". - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Output only. A system generated unique ID (in UUID4 format) for the - // ResourceAllowance. - string uid = 2 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OUTPUT_ONLY - ]; - - // Output only. Time when the ResourceAllowance was created. - google.protobuf.Timestamp create_time = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Labels are attributes that can be set and used by both the - // user and by Batch. Labels must meet the following constraints: - // - // * Keys and values can contain only lowercase letters, numeric characters, - // underscores, and dashes. - // * All characters must use UTF-8 encoding, and international characters are - // allowed. - // * Keys must start with a lowercase letter or international character. - // * Each resource is limited to a maximum of 64 labels. - // - // Both keys and values are additionally constrained to be <= 128 bytes. - map labels = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Notification configurations. - repeated Notification notifications = 6 - [(google.api.field_behavior) = OPTIONAL]; -} - -// UsageResourceAllowance describes the detail of usage resource allowance. -message UsageResourceAllowance { - // Required. Spec of a usage ResourceAllowance. - UsageResourceAllowanceSpec spec = 1 [(google.api.field_behavior) = REQUIRED]; - - // Output only. Status of a usage ResourceAllowance. - UsageResourceAllowanceStatus status = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Spec of a usage ResourceAllowance. -message UsageResourceAllowanceSpec { - // UsageResourceAllowance limitation. - message Limit { - oneof duration { - // Optional. A CalendarPeriod represents the abstract concept of a time - // period that has a canonical start. - CalendarPeriod calendar_period = 1 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Required. Limit value of a UsageResourceAllowance within its one - // duration. - // - // Limit cannot be a negative value. Default is 0. - // For example, you can set `limit` as 10000.0 with duration of the current - // month by setting `calendar_period` field as monthly. That means in your - // current month, 10000.0 is the core hour limitation that your resources - // are allowed to consume. - optional double limit = 2 [(google.api.field_behavior) = REQUIRED]; - } - - // Required. Spec type is unique for each usage ResourceAllowance. - // Batch now only supports type as "cpu-core-hours" for CPU usage consumption - // tracking. - string type = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Threshold of a UsageResourceAllowance limiting how many resources - // can be consumed for each type. - Limit limit = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Status of a usage ResourceAllowance. -message UsageResourceAllowanceStatus { - // UsageResourceAllowanceStatus detail about usage consumption. - message LimitStatus { - // Output only. The consumption interval. - google.type.Interval consumption_interval = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Limit value of a UsageResourceAllowance within its one - // duration. - optional double limit = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Accumulated consumption during `consumption_interval`. - optional double consumed = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - message PeriodConsumption { - // Output only. The consumption interval. - google.type.Interval consumption_interval = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Accumulated consumption during `consumption_interval`. - optional double consumed = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // ConsumptionReport is the report of ResourceAllowance consumptions in a time - // period. - message ConsumptionReport { - // Output only. ResourceAllowance consumptions in the latest calendar - // period. Key is the calendar period in string format. Batch currently - // supports HOUR, DAY, MONTH and YEAR. - map latest_period_consumptions = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Output only. ResourceAllowance state. - ResourceAllowanceState state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. ResourceAllowance consumption status for usage resources. - LimitStatus limit_status = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The report of ResourceAllowance consumptions in a time period. - ConsumptionReport report = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/task.proto b/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/task.proto deleted file mode 100644 index 08a20f499dd..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/task.proto +++ /dev/null @@ -1,494 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.batch.v1alpha; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/batch/v1alpha/volume.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.Batch.V1Alpha"; -option go_package = "cloud.google.com/go/batch/apiv1alpha/batchpb;batchpb"; -option java_multiple_files = true; -option java_outer_classname = "TaskProto"; -option java_package = "com.google.cloud.batch.v1alpha"; -option objc_class_prefix = "GCB"; -option php_namespace = "Google\\Cloud\\Batch\\V1alpha"; -option ruby_package = "Google::Cloud::Batch::V1alpha"; - -// Compute resource requirements. -// -// ComputeResource defines the amount of resources required for each task. -// Make sure your tasks have enough resources to successfully run. -// If you also define the types of resources for a job to use with the -// [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) -// field, make sure both fields are compatible with each other. -message ComputeResource { - // The milliCPU count. - // - // `cpuMilli` defines the amount of CPU resources per task in milliCPU units. - // For example, `1000` corresponds to 1 vCPU per task. If undefined, the - // default value is `2000`. - // - // If you also define the VM's machine type using the `machineType` in - // [InstancePolicy](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicy) - // field or inside the `instanceTemplate` in the - // [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) - // field, make sure the CPU resources for both fields are compatible with each - // other and with how many tasks you want to allow to run on the same VM at - // the same time. - // - // For example, if you specify the `n2-standard-2` machine type, which has 2 - // vCPUs each, you are recommended to set `cpuMilli` no more than `2000`, or - // you are recommended to run two tasks on the same VM if you set `cpuMilli` - // to `1000` or less. - int64 cpu_milli = 1; - - // Memory in MiB. - // - // `memoryMib` defines the amount of memory per task in MiB units. - // If undefined, the default value is `2000`. - // If you also define the VM's machine type using the `machineType` in - // [InstancePolicy](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicy) - // field or inside the `instanceTemplate` in the - // [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) - // field, make sure the memory resources for both fields are compatible with - // each other and with how many tasks you want to allow to run on the same VM - // at the same time. - // - // For example, if you specify the `n2-standard-2` machine type, which has 8 - // GiB each, you are recommended to set `memoryMib` to no more than `8192`, - // or you are recommended to run two tasks on the same VM if you set - // `memoryMib` to `4096` or less. - int64 memory_mib = 2; - - // The GPU count. - // - // Not yet implemented. - int64 gpu_count = 3; - - // Extra boot disk size in MiB for each task. - int64 boot_disk_mib = 4; -} - -// Status event. -message StatusEvent { - // Type of the event. - string type = 3; - - // Description of the event. - string description = 1; - - // The time this event occurred. - google.protobuf.Timestamp event_time = 2; - - // Task Execution. - // This field is only defined for task-level status events where the task - // fails. - TaskExecution task_execution = 4; - - // Task State. - // This field is only defined for task-level status events. - TaskStatus.State task_state = 5; -} - -// This Task Execution field includes detail information for -// task execution procedures, based on StatusEvent types. -message TaskExecution { - // The exit code of a finished task. - // - // If the task succeeded, the exit code will be 0. If the task failed but not - // due to the following reasons, the exit code will be 50000. - // - // Otherwise, it can be from different sources: - // * Batch known failures: - // https://cloud.google.com/batch/docs/troubleshooting#reserved-exit-codes. - // * Batch runnable execution failures; you can rely on Batch logs to further - // diagnose: https://cloud.google.com/batch/docs/analyze-job-using-logs. If - // there are multiple runnables failures, Batch only exposes the first error. - int32 exit_code = 1; - - // Optional. The tail end of any content written to standard error by the task - // execution. This field will be populated only when the execution failed. - string stderr_snippet = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Status of a task. -message TaskStatus { - // Task states. - enum State { - // Unknown state. - STATE_UNSPECIFIED = 0; - - // The Task is created and waiting for resources. - PENDING = 1; - - // The Task is assigned to at least one VM. - ASSIGNED = 2; - - // The Task is running. - RUNNING = 3; - - // The Task has failed. - FAILED = 4; - - // The Task has succeeded. - SUCCEEDED = 5; - - // The Task has not been executed when the Job finishes. - UNEXECUTED = 6; - } - - // Task state. - State state = 1; - - // Detailed info about why the state is reached. - repeated StatusEvent status_events = 2; - - // The resource usage of the task. - TaskResourceUsage resource_usage = 3; -} - -// TaskResourceUsage describes the resource usage of the task. -message TaskResourceUsage { - // The CPU core hours the task consumes based on task requirement and run - // time. - double core_hours = 1; -} - -// Runnable describes instructions for executing a specific script or container -// as part of a Task. -message Runnable { - // Container runnable. - message Container { - // Required. The URI to pull the container image from. - string image_uri = 1; - - // Required for some container images. Overrides the `CMD` specified in the - // container. If there is an `ENTRYPOINT` (either in the container image or - // with the `entrypoint` field below) then these commands are appended as - // arguments to the `ENTRYPOINT`. - repeated string commands = 2; - - // Required for some container images. Overrides the `ENTRYPOINT` specified - // in the container. - string entrypoint = 3; - - // Volumes to mount (bind mount) from the host machine files or directories - // into the container, formatted to match `--volume` option for the - // `docker run` command—for example, `/foo:/bar` or `/foo:/bar:ro`. - // - // If the `TaskSpec.Volumes` field is specified but this field is not, Batch - // will mount each volume from the host machine to the container with the - // same mount path by default. In this case, the default mount option for - // containers will be read-only (`ro`) for existing persistent disks and - // read-write (`rw`) for other volume types, regardless of the original - // mount options specified in `TaskSpec.Volumes`. If you need different - // mount settings, you can explicitly configure them in this field. - repeated string volumes = 7; - - // Required for some container images. Arbitrary additional options to - // include in the `docker run` command when running this container—for - // example, `--network host`. For the `--volume` option, use the `volumes` - // field for the container. - string options = 8; - - // If set to true, external network access to and from container will be - // blocked, containers that are with block_external_network as true can - // still communicate with each other, network cannot be specified in the - // `container.options` field. - bool block_external_network = 9; - - // Required if the container image is from a private Docker registry. The - // username to login to the Docker registry that contains the image. - // - // You can either specify the username directly by using plain text or - // specify an encrypted username by using a Secret Manager secret: - // `projects/*/secrets/*/versions/*`. However, using a secret is - // recommended for enhanced security. - // - // Caution: If you specify the username using plain text, you risk the - // username being exposed to any users who can view the job or its logs. - // To avoid this risk, specify a secret that contains the username instead. - // - // Learn more about [Secret - // Manager](https://cloud.google.com/secret-manager/docs/) and [using - // Secret Manager with - // Batch](https://cloud.google.com/batch/docs/create-run-job-secret-manager). - string username = 10; - - // Required if the container image is from a private Docker registry. The - // password to login to the Docker registry that contains the image. - // - // For security, it is strongly recommended to specify an - // encrypted password by using a Secret Manager secret: - // `projects/*/secrets/*/versions/*`. - // - // Warning: If you specify the password using plain text, you risk the - // password being exposed to any users who can view the job or its logs. - // To avoid this risk, specify a secret that contains the password instead. - // - // Learn more about [Secret - // Manager](https://cloud.google.com/secret-manager/docs/) and [using - // Secret Manager with - // Batch](https://cloud.google.com/batch/docs/create-run-job-secret-manager). - string password = 11; - - // Optional. If set to true, this container runnable uses Image streaming. - // - // Use Image streaming to allow the runnable to initialize without - // waiting for the entire container image to download, which can - // significantly reduce startup time for large container images. - // - // When `enableImageStreaming` is set to true, the container - // runtime is [containerd](https://containerd.io/) instead of Docker. - // Additionally, this container runnable only supports the following - // `container` subfields: `imageUri`, - // `commands[]`, `entrypoint`, and - // `volumes[]`; any other `container` subfields are ignored. - // - // For more information about the requirements and limitations for using - // Image streaming with Batch, see the [`image-streaming` - // sample on - // GitHub](https://github.com/GoogleCloudPlatform/batch-samples/tree/main/api-samples/image-streaming). - bool enable_image_streaming = 12 [(google.api.field_behavior) = OPTIONAL]; - } - - // Script runnable. - message Script { - // Required. The source code for this script runnable. - oneof command { - // The path to a script file that is accessible from the host VM(s). - // - // Unless the script file supports the default `#!/bin/sh` shell - // interpreter, you must specify an interpreter by including a - // [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix) as the - // first line of the file. For example, to execute the script using bash, - // include `#!/bin/bash` as the first line of the file. Alternatively, - // to execute the script using Python3, include `#!/usr/bin/env python3` - // as the first line of the file. - string path = 1; - - // The text for a script. - // - // Unless the script text supports the default `#!/bin/sh` shell - // interpreter, you must specify an interpreter by including a - // [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix) at the - // beginning of the text. For example, to execute the script using bash, - // include `#!/bin/bash\n` at the beginning of the text. Alternatively, - // to execute the script using Python3, include `#!/usr/bin/env python3\n` - // at the beginning of the text. - string text = 2; - } - } - - // A barrier runnable automatically blocks the execution of subsequent - // runnables until all the tasks in the task group reach the barrier. - message Barrier { - // Barriers are identified by their index in runnable list. - // Names are not required, but if present should be an identifier. - string name = 1; - } - - // Required. The script, container, or barrier for this runnable to execute. - oneof executable { - // Container runnable. - Container container = 1; - - // Script runnable. - Script script = 2; - - // Barrier runnable. - Barrier barrier = 6; - } - - // Optional. DisplayName is an optional field that can be provided by the - // caller. If provided, it will be used in logs and other outputs to identify - // the script, making it easier for users to understand the logs. If not - // provided the index of the runnable will be used for outputs. - string display_name = 10 [(google.api.field_behavior) = OPTIONAL]; - - // Normally, a runnable that returns a non-zero exit status fails and causes - // the task to fail. However, you can set this field to `true` to allow the - // task to continue executing its other runnables even if this runnable - // fails. - bool ignore_exit_status = 3; - - // Normally, a runnable that doesn't exit causes its task to fail. However, - // you can set this field to `true` to configure a background runnable. - // Background runnables are allowed continue running in the background while - // the task executes subsequent runnables. For example, background runnables - // are useful for providing services to other runnables or providing - // debugging-support tools like SSH servers. - // - // Specifically, background runnables are killed automatically (if they have - // not already exited) a short time after all foreground runnables have - // completed. Even though this is likely to result in a non-zero exit status - // for the background runnable, these automatic kills are not treated as task - // failures. - bool background = 4; - - // By default, after a Runnable fails, no further Runnable are executed. This - // flag indicates that this Runnable must be run even if the Task has already - // failed. This is useful for Runnables that copy output files off of the VM - // or for debugging. - // - // The always_run flag does not override the Task's overall max_run_duration. - // If the max_run_duration has expired then no further Runnables will execute, - // not even always_run Runnables. - bool always_run = 5; - - // Environment variables for this Runnable (overrides variables set for the - // whole Task or TaskGroup). - Environment environment = 7; - - // Timeout for this Runnable. - google.protobuf.Duration timeout = 8; - - // Labels for this Runnable. - map labels = 9; -} - -// Spec of a task -message TaskSpec { - // Required. The sequence of one or more runnables (executable scripts, - // executable containers, and/or barriers) for each task in this task group to - // run. Each task runs this list of runnables in order. For a task to succeed, - // all of its script and container runnables each must meet at least one of - // the following conditions: - // - // + The runnable exited with a zero status. - // + The runnable didn't finish, but you enabled its `background` subfield. - // + The runnable exited with a non-zero status, but you enabled its - // `ignore_exit_status` subfield. - repeated Runnable runnables = 8; - - // ComputeResource requirements. - ComputeResource compute_resource = 3; - - // Maximum duration the task should run before being automatically retried - // (if enabled) or automatically failed. Format the value of this field - // as a time limit in seconds followed by `s`—for example, `3600s` - // for 1 hour. The field accepts any value between 0 and the maximum listed - // for the `Duration` field type at - // https://protobuf.dev/reference/protobuf/google.protobuf/#duration; however, - // the actual maximum run time for a job will be limited to the maximum run - // time for a job listed at - // https://cloud.google.com/batch/quotas#max-job-duration. - google.protobuf.Duration max_run_duration = 4; - - // Maximum number of retries on failures. - // The default, 0, which means never retry. - // The valid value range is [0, 10]. - int32 max_retry_count = 5; - - // Lifecycle management schema when any task in a task group is failed. - // Currently we only support one lifecycle policy. - // When the lifecycle policy condition is met, - // the action in the policy will execute. - // If task execution result does not meet with the defined lifecycle - // policy, we consider it as the default policy. - // Default policy means if the exit code is 0, exit task. - // If task ends with non-zero exit code, retry the task with max_retry_count. - repeated LifecyclePolicy lifecycle_policies = 9; - - // Deprecated: please use environment(non-plural) instead. - map environments = 6 [deprecated = true]; - - // Volumes to mount before running Tasks using this TaskSpec. - repeated Volume volumes = 7; - - // Environment variables to set before running the Task. - Environment environment = 10; -} - -// LifecyclePolicy describes how to deal with task failures -// based on different conditions. -message LifecyclePolicy { - // Conditions for actions to deal with task failures. - message ActionCondition { - // Exit codes of a task execution. - // If there are more than 1 exit codes, - // when task executes with any of the exit code in the list, - // the condition is met and the action will be executed. - repeated int32 exit_codes = 1; - } - - // Action on task failures based on different conditions. - enum Action { - // Action unspecified. - ACTION_UNSPECIFIED = 0; - - // Action that tasks in the group will be scheduled to re-execute. - RETRY_TASK = 1; - - // Action that tasks in the group will be stopped immediately. - FAIL_TASK = 2; - } - - // Action to execute when ActionCondition is true. - // When RETRY_TASK is specified, we will retry failed tasks - // if we notice any exit code match and fail tasks if no match is found. - // Likewise, when FAIL_TASK is specified, we will fail tasks - // if we notice any exit code match and retry tasks if no match is found. - Action action = 1; - - // Conditions that decide why a task failure is dealt with a specific action. - ActionCondition action_condition = 2; -} - -// A Cloud Batch task. -message Task { - option (google.api.resource) = { - type: "batch.googleapis.com/Task" - pattern: "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}/tasks/{task}" - }; - - // Task name. - // The name is generated from the parent TaskGroup name and 'id' field. - // For example: - // "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01/tasks/task01". - string name = 1; - - // Task Status. - TaskStatus status = 2; -} - -// An Environment describes a collection of environment variables to set when -// executing Tasks. -message Environment { - message KMSEnvMap { - // The name of the KMS key that will be used to decrypt the cipher text. - string key_name = 1; - - // The value of the cipherText response from the `encrypt` method. - string cipher_text = 2; - } - - // A map of environment variable names to values. - map variables = 1; - - // A map of environment variable names to Secret Manager secret names. - // The VM will access the named secrets to set the value of each environment - // variable. - map secret_variables = 2; - - // An encrypted JSON dictionary where the key/value pairs correspond to - // environment variable names and their values. - KMSEnvMap encrypted_variables = 3; -} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/volume.proto b/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/volume.proto deleted file mode 100644 index 9256ef6faa4..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/volume.proto +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.batch.v1alpha; - -option csharp_namespace = "Google.Cloud.Batch.V1Alpha"; -option go_package = "cloud.google.com/go/batch/apiv1alpha/batchpb;batchpb"; -option java_multiple_files = true; -option java_outer_classname = "VolumeProto"; -option java_package = "com.google.cloud.batch.v1alpha"; -option objc_class_prefix = "GCB"; -option php_namespace = "Google\\Cloud\\Batch\\V1alpha"; -option ruby_package = "Google::Cloud::Batch::V1alpha"; - -// Volume describes a volume and parameters for it to be mounted to a VM. -message Volume { - // The source for the volume. - oneof source { - // A Network File System (NFS) volume. For example, a - // Filestore file share. - NFS nfs = 1; - - // Deprecated: please use device_name instead. - PD pd = 2 [deprecated = true]; - - // A Google Cloud Storage (GCS) volume. - GCS gcs = 3; - - // Device name of an attached disk volume, which should align with a - // device_name specified by - // job.allocation_policy.instances[0].policy.disks[i].device_name or - // defined by the given instance template in - // job.allocation_policy.instances[0].instance_template. - string device_name = 6; - } - - // The mount path for the volume, e.g. /mnt/disks/share. - string mount_path = 4; - - // Mount options vary based on the type of storage volume: - // - // * For a Cloud Storage bucket, all the mount options provided - // by - // the [`gcsfuse` tool](https://cloud.google.com/storage/docs/gcsfuse-cli) - // are supported. - // * For an existing persistent disk, all mount options provided by the - // [`mount` command](https://man7.org/linux/man-pages/man8/mount.8.html) - // except writing are supported. This is due to restrictions of - // [multi-writer - // mode](https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms). - // * For any other disk or a Network File System (NFS), all the - // mount options provided by the `mount` command are supported. - repeated string mount_options = 5; -} - -// Represents an NFS volume. -message NFS { - // The IP address of the NFS. - string server = 1; - - // Remote source path exported from the NFS, e.g., "/share". - string remote_path = 2; -} - -// Deprecated: please use device_name instead. -message PD { - // PD disk name, e.g. pd-1. - string disk = 1; - - // PD device name, e.g. persistent-disk-1. - string device = 2; - - // Whether this is an existing PD. Default is false. If false, i.e., new - // PD, we will format it into ext4 and mount to the given path. If true, i.e., - // existing PD, it should be in ext4 format and we will mount it to the given - // path. - bool existing = 3 [deprecated = true]; -} - -// Represents a Google Cloud Storage volume. -message GCS { - // Remote path, either a bucket name or a subdirectory of a bucket, e.g.: - // bucket_name, bucket_name/subdirectory/ - string remote_path = 1; -} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.d.ts b/owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.d.ts deleted file mode 100644 index b3108d65ff9..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.d.ts +++ /dev/null @@ -1,16145 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import type {protobuf as $protobuf} from "google-gax"; -import Long = require("long"); -/** Namespace google. */ -export namespace google { - - /** Namespace cloud. */ - namespace cloud { - - /** Namespace batch. */ - namespace batch { - - /** Namespace v1alpha. */ - namespace v1alpha { - - /** Represents a BatchService */ - class BatchService extends $protobuf.rpc.Service { - - /** - * Constructs a new BatchService 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 BatchService 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): BatchService; - - /** - * Calls CreateJob. - * @param request CreateJobRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Job - */ - public createJob(request: google.cloud.batch.v1alpha.ICreateJobRequest, callback: google.cloud.batch.v1alpha.BatchService.CreateJobCallback): void; - - /** - * Calls CreateJob. - * @param request CreateJobRequest message or plain object - * @returns Promise - */ - public createJob(request: google.cloud.batch.v1alpha.ICreateJobRequest): Promise; - - /** - * Calls GetJob. - * @param request GetJobRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Job - */ - public getJob(request: google.cloud.batch.v1alpha.IGetJobRequest, callback: google.cloud.batch.v1alpha.BatchService.GetJobCallback): void; - - /** - * Calls GetJob. - * @param request GetJobRequest message or plain object - * @returns Promise - */ - public getJob(request: google.cloud.batch.v1alpha.IGetJobRequest): Promise; - - /** - * Calls DeleteJob. - * @param request DeleteJobRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteJob(request: google.cloud.batch.v1alpha.IDeleteJobRequest, callback: google.cloud.batch.v1alpha.BatchService.DeleteJobCallback): void; - - /** - * Calls DeleteJob. - * @param request DeleteJobRequest message or plain object - * @returns Promise - */ - public deleteJob(request: google.cloud.batch.v1alpha.IDeleteJobRequest): Promise; - - /** - * Calls CancelJob. - * @param request CancelJobRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public cancelJob(request: google.cloud.batch.v1alpha.ICancelJobRequest, callback: google.cloud.batch.v1alpha.BatchService.CancelJobCallback): void; - - /** - * Calls CancelJob. - * @param request CancelJobRequest message or plain object - * @returns Promise - */ - public cancelJob(request: google.cloud.batch.v1alpha.ICancelJobRequest): Promise; - - /** - * Calls UpdateJob. - * @param request UpdateJobRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Job - */ - public updateJob(request: google.cloud.batch.v1alpha.IUpdateJobRequest, callback: google.cloud.batch.v1alpha.BatchService.UpdateJobCallback): void; - - /** - * Calls UpdateJob. - * @param request UpdateJobRequest message or plain object - * @returns Promise - */ - public updateJob(request: google.cloud.batch.v1alpha.IUpdateJobRequest): Promise; - - /** - * Calls ListJobs. - * @param request ListJobsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListJobsResponse - */ - public listJobs(request: google.cloud.batch.v1alpha.IListJobsRequest, callback: google.cloud.batch.v1alpha.BatchService.ListJobsCallback): void; - - /** - * Calls ListJobs. - * @param request ListJobsRequest message or plain object - * @returns Promise - */ - public listJobs(request: google.cloud.batch.v1alpha.IListJobsRequest): Promise; - - /** - * Calls GetTask. - * @param request GetTaskRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Task - */ - public getTask(request: google.cloud.batch.v1alpha.IGetTaskRequest, callback: google.cloud.batch.v1alpha.BatchService.GetTaskCallback): void; - - /** - * Calls GetTask. - * @param request GetTaskRequest message or plain object - * @returns Promise - */ - public getTask(request: google.cloud.batch.v1alpha.IGetTaskRequest): Promise; - - /** - * Calls ListTasks. - * @param request ListTasksRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListTasksResponse - */ - public listTasks(request: google.cloud.batch.v1alpha.IListTasksRequest, callback: google.cloud.batch.v1alpha.BatchService.ListTasksCallback): void; - - /** - * Calls ListTasks. - * @param request ListTasksRequest message or plain object - * @returns Promise - */ - public listTasks(request: google.cloud.batch.v1alpha.IListTasksRequest): Promise; - - /** - * Calls CreateResourceAllowance. - * @param request CreateResourceAllowanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ResourceAllowance - */ - public createResourceAllowance(request: google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest, callback: google.cloud.batch.v1alpha.BatchService.CreateResourceAllowanceCallback): void; - - /** - * Calls CreateResourceAllowance. - * @param request CreateResourceAllowanceRequest message or plain object - * @returns Promise - */ - public createResourceAllowance(request: google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest): Promise; - - /** - * Calls GetResourceAllowance. - * @param request GetResourceAllowanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ResourceAllowance - */ - public getResourceAllowance(request: google.cloud.batch.v1alpha.IGetResourceAllowanceRequest, callback: google.cloud.batch.v1alpha.BatchService.GetResourceAllowanceCallback): void; - - /** - * Calls GetResourceAllowance. - * @param request GetResourceAllowanceRequest message or plain object - * @returns Promise - */ - public getResourceAllowance(request: google.cloud.batch.v1alpha.IGetResourceAllowanceRequest): Promise; - - /** - * Calls DeleteResourceAllowance. - * @param request DeleteResourceAllowanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteResourceAllowance(request: google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest, callback: google.cloud.batch.v1alpha.BatchService.DeleteResourceAllowanceCallback): void; - - /** - * Calls DeleteResourceAllowance. - * @param request DeleteResourceAllowanceRequest message or plain object - * @returns Promise - */ - public deleteResourceAllowance(request: google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest): Promise; - - /** - * Calls ListResourceAllowances. - * @param request ListResourceAllowancesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListResourceAllowancesResponse - */ - public listResourceAllowances(request: google.cloud.batch.v1alpha.IListResourceAllowancesRequest, callback: google.cloud.batch.v1alpha.BatchService.ListResourceAllowancesCallback): void; - - /** - * Calls ListResourceAllowances. - * @param request ListResourceAllowancesRequest message or plain object - * @returns Promise - */ - public listResourceAllowances(request: google.cloud.batch.v1alpha.IListResourceAllowancesRequest): Promise; - - /** - * Calls UpdateResourceAllowance. - * @param request UpdateResourceAllowanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ResourceAllowance - */ - public updateResourceAllowance(request: google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest, callback: google.cloud.batch.v1alpha.BatchService.UpdateResourceAllowanceCallback): void; - - /** - * Calls UpdateResourceAllowance. - * @param request UpdateResourceAllowanceRequest message or plain object - * @returns Promise - */ - public updateResourceAllowance(request: google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest): Promise; - } - - namespace BatchService { - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|createJob}. - * @param error Error, if any - * @param [response] Job - */ - type CreateJobCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.Job) => void; - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|getJob}. - * @param error Error, if any - * @param [response] Job - */ - type GetJobCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.Job) => void; - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|deleteJob}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|cancelJob}. - * @param error Error, if any - * @param [response] Operation - */ - type CancelJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|updateJob}. - * @param error Error, if any - * @param [response] Job - */ - type UpdateJobCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.Job) => void; - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|listJobs}. - * @param error Error, if any - * @param [response] ListJobsResponse - */ - type ListJobsCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.ListJobsResponse) => void; - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|getTask}. - * @param error Error, if any - * @param [response] Task - */ - type GetTaskCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.Task) => void; - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|listTasks}. - * @param error Error, if any - * @param [response] ListTasksResponse - */ - type ListTasksCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.ListTasksResponse) => void; - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|createResourceAllowance}. - * @param error Error, if any - * @param [response] ResourceAllowance - */ - type CreateResourceAllowanceCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.ResourceAllowance) => void; - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|getResourceAllowance}. - * @param error Error, if any - * @param [response] ResourceAllowance - */ - type GetResourceAllowanceCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.ResourceAllowance) => void; - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|deleteResourceAllowance}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteResourceAllowanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|listResourceAllowances}. - * @param error Error, if any - * @param [response] ListResourceAllowancesResponse - */ - type ListResourceAllowancesCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.ListResourceAllowancesResponse) => void; - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|updateResourceAllowance}. - * @param error Error, if any - * @param [response] ResourceAllowance - */ - type UpdateResourceAllowanceCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.ResourceAllowance) => void; - } - - /** Properties of a CreateJobRequest. */ - interface ICreateJobRequest { - - /** CreateJobRequest parent */ - parent?: (string|null); - - /** CreateJobRequest jobId */ - jobId?: (string|null); - - /** CreateJobRequest job */ - job?: (google.cloud.batch.v1alpha.IJob|null); - - /** CreateJobRequest requestId */ - requestId?: (string|null); - } - - /** Represents a CreateJobRequest. */ - class CreateJobRequest implements ICreateJobRequest { - - /** - * Constructs a new CreateJobRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.ICreateJobRequest); - - /** CreateJobRequest parent. */ - public parent: string; - - /** CreateJobRequest jobId. */ - public jobId: string; - - /** CreateJobRequest job. */ - public job?: (google.cloud.batch.v1alpha.IJob|null); - - /** CreateJobRequest requestId. */ - public requestId: string; - - /** - * Creates a new CreateJobRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateJobRequest instance - */ - public static create(properties?: google.cloud.batch.v1alpha.ICreateJobRequest): google.cloud.batch.v1alpha.CreateJobRequest; - - /** - * Encodes the specified CreateJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.CreateJobRequest.verify|verify} messages. - * @param message CreateJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.ICreateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.CreateJobRequest.verify|verify} messages. - * @param message CreateJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.ICreateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateJobRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.CreateJobRequest; - - /** - * Decodes a CreateJobRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.CreateJobRequest; - - /** - * Verifies a CreateJobRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateJobRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateJobRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.CreateJobRequest; - - /** - * Creates a plain object from a CreateJobRequest message. Also converts values to other types if specified. - * @param message CreateJobRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.CreateJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateJobRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateJobRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetJobRequest. */ - interface IGetJobRequest { - - /** GetJobRequest name */ - name?: (string|null); - } - - /** Represents a GetJobRequest. */ - class GetJobRequest implements IGetJobRequest { - - /** - * Constructs a new GetJobRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IGetJobRequest); - - /** GetJobRequest name. */ - public name: string; - - /** - * Creates a new GetJobRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetJobRequest instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IGetJobRequest): google.cloud.batch.v1alpha.GetJobRequest; - - /** - * Encodes the specified GetJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.GetJobRequest.verify|verify} messages. - * @param message GetJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IGetJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.GetJobRequest.verify|verify} messages. - * @param message GetJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IGetJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetJobRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.GetJobRequest; - - /** - * Decodes a GetJobRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.GetJobRequest; - - /** - * Verifies a GetJobRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetJobRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetJobRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.GetJobRequest; - - /** - * Creates a plain object from a GetJobRequest message. Also converts values to other types if specified. - * @param message GetJobRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.GetJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetJobRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetJobRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteJobRequest. */ - interface IDeleteJobRequest { - - /** DeleteJobRequest name */ - name?: (string|null); - - /** DeleteJobRequest reason */ - reason?: (string|null); - - /** DeleteJobRequest requestId */ - requestId?: (string|null); - } - - /** Represents a DeleteJobRequest. */ - class DeleteJobRequest implements IDeleteJobRequest { - - /** - * Constructs a new DeleteJobRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IDeleteJobRequest); - - /** DeleteJobRequest name. */ - public name: string; - - /** DeleteJobRequest reason. */ - public reason: string; - - /** DeleteJobRequest requestId. */ - public requestId: string; - - /** - * Creates a new DeleteJobRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteJobRequest instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IDeleteJobRequest): google.cloud.batch.v1alpha.DeleteJobRequest; - - /** - * Encodes the specified DeleteJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.DeleteJobRequest.verify|verify} messages. - * @param message DeleteJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IDeleteJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.DeleteJobRequest.verify|verify} messages. - * @param message DeleteJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IDeleteJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteJobRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.DeleteJobRequest; - - /** - * Decodes a DeleteJobRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.DeleteJobRequest; - - /** - * Verifies a DeleteJobRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteJobRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteJobRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.DeleteJobRequest; - - /** - * Creates a plain object from a DeleteJobRequest message. Also converts values to other types if specified. - * @param message DeleteJobRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.DeleteJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteJobRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteJobRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CancelJobRequest. */ - interface ICancelJobRequest { - - /** CancelJobRequest name */ - name?: (string|null); - - /** CancelJobRequest requestId */ - requestId?: (string|null); - } - - /** Represents a CancelJobRequest. */ - class CancelJobRequest implements ICancelJobRequest { - - /** - * Constructs a new CancelJobRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.ICancelJobRequest); - - /** CancelJobRequest name. */ - public name: string; - - /** CancelJobRequest requestId. */ - public requestId: string; - - /** - * Creates a new CancelJobRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CancelJobRequest instance - */ - public static create(properties?: google.cloud.batch.v1alpha.ICancelJobRequest): google.cloud.batch.v1alpha.CancelJobRequest; - - /** - * Encodes the specified CancelJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.CancelJobRequest.verify|verify} messages. - * @param message CancelJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.ICancelJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CancelJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.CancelJobRequest.verify|verify} messages. - * @param message CancelJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.ICancelJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CancelJobRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CancelJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.CancelJobRequest; - - /** - * Decodes a CancelJobRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CancelJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.CancelJobRequest; - - /** - * Verifies a CancelJobRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CancelJobRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CancelJobRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.CancelJobRequest; - - /** - * Creates a plain object from a CancelJobRequest message. Also converts values to other types if specified. - * @param message CancelJobRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.CancelJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CancelJobRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CancelJobRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CancelJobResponse. */ - interface ICancelJobResponse { - } - - /** Represents a CancelJobResponse. */ - class CancelJobResponse implements ICancelJobResponse { - - /** - * Constructs a new CancelJobResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.ICancelJobResponse); - - /** - * Creates a new CancelJobResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns CancelJobResponse instance - */ - public static create(properties?: google.cloud.batch.v1alpha.ICancelJobResponse): google.cloud.batch.v1alpha.CancelJobResponse; - - /** - * Encodes the specified CancelJobResponse message. Does not implicitly {@link google.cloud.batch.v1alpha.CancelJobResponse.verify|verify} messages. - * @param message CancelJobResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.ICancelJobResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CancelJobResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.CancelJobResponse.verify|verify} messages. - * @param message CancelJobResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.ICancelJobResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CancelJobResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CancelJobResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.CancelJobResponse; - - /** - * Decodes a CancelJobResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CancelJobResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.CancelJobResponse; - - /** - * Verifies a CancelJobResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CancelJobResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CancelJobResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.CancelJobResponse; - - /** - * Creates a plain object from a CancelJobResponse message. Also converts values to other types if specified. - * @param message CancelJobResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.CancelJobResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CancelJobResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CancelJobResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateJobRequest. */ - interface IUpdateJobRequest { - - /** UpdateJobRequest job */ - job?: (google.cloud.batch.v1alpha.IJob|null); - - /** UpdateJobRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateJobRequest requestId */ - requestId?: (string|null); - } - - /** Represents an UpdateJobRequest. */ - class UpdateJobRequest implements IUpdateJobRequest { - - /** - * Constructs a new UpdateJobRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IUpdateJobRequest); - - /** UpdateJobRequest job. */ - public job?: (google.cloud.batch.v1alpha.IJob|null); - - /** UpdateJobRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateJobRequest requestId. */ - public requestId: string; - - /** - * Creates a new UpdateJobRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateJobRequest instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IUpdateJobRequest): google.cloud.batch.v1alpha.UpdateJobRequest; - - /** - * Encodes the specified UpdateJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.UpdateJobRequest.verify|verify} messages. - * @param message UpdateJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IUpdateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UpdateJobRequest.verify|verify} messages. - * @param message UpdateJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IUpdateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateJobRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.UpdateJobRequest; - - /** - * Decodes an UpdateJobRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.UpdateJobRequest; - - /** - * Verifies an UpdateJobRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateJobRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateJobRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.UpdateJobRequest; - - /** - * Creates a plain object from an UpdateJobRequest message. Also converts values to other types if specified. - * @param message UpdateJobRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.UpdateJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateJobRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateJobRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListJobsRequest. */ - interface IListJobsRequest { - - /** ListJobsRequest parent */ - parent?: (string|null); - - /** ListJobsRequest filter */ - filter?: (string|null); - - /** ListJobsRequest orderBy */ - orderBy?: (string|null); - - /** ListJobsRequest pageSize */ - pageSize?: (number|null); - - /** ListJobsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListJobsRequest. */ - class ListJobsRequest implements IListJobsRequest { - - /** - * Constructs a new ListJobsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IListJobsRequest); - - /** ListJobsRequest parent. */ - public parent: string; - - /** ListJobsRequest filter. */ - public filter: string; - - /** ListJobsRequest orderBy. */ - public orderBy: string; - - /** ListJobsRequest pageSize. */ - public pageSize: number; - - /** ListJobsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListJobsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListJobsRequest instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IListJobsRequest): google.cloud.batch.v1alpha.ListJobsRequest; - - /** - * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.ListJobsRequest.verify|verify} messages. - * @param message ListJobsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IListJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListJobsRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListJobsRequest.verify|verify} messages. - * @param message ListJobsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IListJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListJobsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListJobsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ListJobsRequest; - - /** - * Decodes a ListJobsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListJobsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ListJobsRequest; - - /** - * Verifies a ListJobsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListJobsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListJobsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ListJobsRequest; - - /** - * Creates a plain object from a ListJobsRequest message. Also converts values to other types if specified. - * @param message ListJobsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.ListJobsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListJobsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListJobsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListJobsResponse. */ - interface IListJobsResponse { - - /** ListJobsResponse jobs */ - jobs?: (google.cloud.batch.v1alpha.IJob[]|null); - - /** ListJobsResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListJobsResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListJobsResponse. */ - class ListJobsResponse implements IListJobsResponse { - - /** - * Constructs a new ListJobsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IListJobsResponse); - - /** ListJobsResponse jobs. */ - public jobs: google.cloud.batch.v1alpha.IJob[]; - - /** ListJobsResponse nextPageToken. */ - public nextPageToken: string; - - /** ListJobsResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListJobsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListJobsResponse instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IListJobsResponse): google.cloud.batch.v1alpha.ListJobsResponse; - - /** - * Encodes the specified ListJobsResponse message. Does not implicitly {@link google.cloud.batch.v1alpha.ListJobsResponse.verify|verify} messages. - * @param message ListJobsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IListJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListJobsResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListJobsResponse.verify|verify} messages. - * @param message ListJobsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IListJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListJobsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListJobsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ListJobsResponse; - - /** - * Decodes a ListJobsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListJobsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ListJobsResponse; - - /** - * Verifies a ListJobsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListJobsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListJobsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ListJobsResponse; - - /** - * Creates a plain object from a ListJobsResponse message. Also converts values to other types if specified. - * @param message ListJobsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.ListJobsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListJobsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListJobsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListTasksRequest. */ - interface IListTasksRequest { - - /** ListTasksRequest parent */ - parent?: (string|null); - - /** ListTasksRequest filter */ - filter?: (string|null); - - /** ListTasksRequest orderBy */ - orderBy?: (string|null); - - /** ListTasksRequest pageSize */ - pageSize?: (number|null); - - /** ListTasksRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListTasksRequest. */ - class ListTasksRequest implements IListTasksRequest { - - /** - * Constructs a new ListTasksRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IListTasksRequest); - - /** ListTasksRequest parent. */ - public parent: string; - - /** ListTasksRequest filter. */ - public filter: string; - - /** ListTasksRequest orderBy. */ - public orderBy: string; - - /** ListTasksRequest pageSize. */ - public pageSize: number; - - /** ListTasksRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListTasksRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListTasksRequest instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IListTasksRequest): google.cloud.batch.v1alpha.ListTasksRequest; - - /** - * Encodes the specified ListTasksRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.ListTasksRequest.verify|verify} messages. - * @param message ListTasksRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IListTasksRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListTasksRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListTasksRequest.verify|verify} messages. - * @param message ListTasksRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IListTasksRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListTasksRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListTasksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ListTasksRequest; - - /** - * Decodes a ListTasksRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListTasksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ListTasksRequest; - - /** - * Verifies a ListTasksRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListTasksRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListTasksRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ListTasksRequest; - - /** - * Creates a plain object from a ListTasksRequest message. Also converts values to other types if specified. - * @param message ListTasksRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.ListTasksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListTasksRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListTasksRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListTasksResponse. */ - interface IListTasksResponse { - - /** ListTasksResponse tasks */ - tasks?: (google.cloud.batch.v1alpha.ITask[]|null); - - /** ListTasksResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListTasksResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListTasksResponse. */ - class ListTasksResponse implements IListTasksResponse { - - /** - * Constructs a new ListTasksResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IListTasksResponse); - - /** ListTasksResponse tasks. */ - public tasks: google.cloud.batch.v1alpha.ITask[]; - - /** ListTasksResponse nextPageToken. */ - public nextPageToken: string; - - /** ListTasksResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListTasksResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListTasksResponse instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IListTasksResponse): google.cloud.batch.v1alpha.ListTasksResponse; - - /** - * Encodes the specified ListTasksResponse message. Does not implicitly {@link google.cloud.batch.v1alpha.ListTasksResponse.verify|verify} messages. - * @param message ListTasksResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IListTasksResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListTasksResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListTasksResponse.verify|verify} messages. - * @param message ListTasksResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IListTasksResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListTasksResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListTasksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ListTasksResponse; - - /** - * Decodes a ListTasksResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListTasksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ListTasksResponse; - - /** - * Verifies a ListTasksResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListTasksResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListTasksResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ListTasksResponse; - - /** - * Creates a plain object from a ListTasksResponse message. Also converts values to other types if specified. - * @param message ListTasksResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.ListTasksResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListTasksResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListTasksResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetTaskRequest. */ - interface IGetTaskRequest { - - /** GetTaskRequest name */ - name?: (string|null); - } - - /** Represents a GetTaskRequest. */ - class GetTaskRequest implements IGetTaskRequest { - - /** - * Constructs a new GetTaskRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IGetTaskRequest); - - /** GetTaskRequest name. */ - public name: string; - - /** - * Creates a new GetTaskRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetTaskRequest instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IGetTaskRequest): google.cloud.batch.v1alpha.GetTaskRequest; - - /** - * Encodes the specified GetTaskRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.GetTaskRequest.verify|verify} messages. - * @param message GetTaskRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IGetTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetTaskRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.GetTaskRequest.verify|verify} messages. - * @param message GetTaskRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IGetTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetTaskRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.GetTaskRequest; - - /** - * Decodes a GetTaskRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.GetTaskRequest; - - /** - * Verifies a GetTaskRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetTaskRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetTaskRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.GetTaskRequest; - - /** - * Creates a plain object from a GetTaskRequest message. Also converts values to other types if specified. - * @param message GetTaskRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.GetTaskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetTaskRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetTaskRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateResourceAllowanceRequest. */ - interface ICreateResourceAllowanceRequest { - - /** CreateResourceAllowanceRequest parent */ - parent?: (string|null); - - /** CreateResourceAllowanceRequest resourceAllowanceId */ - resourceAllowanceId?: (string|null); - - /** CreateResourceAllowanceRequest resourceAllowance */ - resourceAllowance?: (google.cloud.batch.v1alpha.IResourceAllowance|null); - - /** CreateResourceAllowanceRequest requestId */ - requestId?: (string|null); - } - - /** Represents a CreateResourceAllowanceRequest. */ - class CreateResourceAllowanceRequest implements ICreateResourceAllowanceRequest { - - /** - * Constructs a new CreateResourceAllowanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest); - - /** CreateResourceAllowanceRequest parent. */ - public parent: string; - - /** CreateResourceAllowanceRequest resourceAllowanceId. */ - public resourceAllowanceId: string; - - /** CreateResourceAllowanceRequest resourceAllowance. */ - public resourceAllowance?: (google.cloud.batch.v1alpha.IResourceAllowance|null); - - /** CreateResourceAllowanceRequest requestId. */ - public requestId: string; - - /** - * Creates a new CreateResourceAllowanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateResourceAllowanceRequest instance - */ - public static create(properties?: google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest): google.cloud.batch.v1alpha.CreateResourceAllowanceRequest; - - /** - * Encodes the specified CreateResourceAllowanceRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.CreateResourceAllowanceRequest.verify|verify} messages. - * @param message CreateResourceAllowanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateResourceAllowanceRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.CreateResourceAllowanceRequest.verify|verify} messages. - * @param message CreateResourceAllowanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateResourceAllowanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateResourceAllowanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.CreateResourceAllowanceRequest; - - /** - * Decodes a CreateResourceAllowanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateResourceAllowanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.CreateResourceAllowanceRequest; - - /** - * Verifies a CreateResourceAllowanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateResourceAllowanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateResourceAllowanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.CreateResourceAllowanceRequest; - - /** - * Creates a plain object from a CreateResourceAllowanceRequest message. Also converts values to other types if specified. - * @param message CreateResourceAllowanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.CreateResourceAllowanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateResourceAllowanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateResourceAllowanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetResourceAllowanceRequest. */ - interface IGetResourceAllowanceRequest { - - /** GetResourceAllowanceRequest name */ - name?: (string|null); - } - - /** Represents a GetResourceAllowanceRequest. */ - class GetResourceAllowanceRequest implements IGetResourceAllowanceRequest { - - /** - * Constructs a new GetResourceAllowanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IGetResourceAllowanceRequest); - - /** GetResourceAllowanceRequest name. */ - public name: string; - - /** - * Creates a new GetResourceAllowanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetResourceAllowanceRequest instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IGetResourceAllowanceRequest): google.cloud.batch.v1alpha.GetResourceAllowanceRequest; - - /** - * Encodes the specified GetResourceAllowanceRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.GetResourceAllowanceRequest.verify|verify} messages. - * @param message GetResourceAllowanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IGetResourceAllowanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetResourceAllowanceRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.GetResourceAllowanceRequest.verify|verify} messages. - * @param message GetResourceAllowanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IGetResourceAllowanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetResourceAllowanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetResourceAllowanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.GetResourceAllowanceRequest; - - /** - * Decodes a GetResourceAllowanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetResourceAllowanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.GetResourceAllowanceRequest; - - /** - * Verifies a GetResourceAllowanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetResourceAllowanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetResourceAllowanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.GetResourceAllowanceRequest; - - /** - * Creates a plain object from a GetResourceAllowanceRequest message. Also converts values to other types if specified. - * @param message GetResourceAllowanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.GetResourceAllowanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetResourceAllowanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetResourceAllowanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteResourceAllowanceRequest. */ - interface IDeleteResourceAllowanceRequest { - - /** DeleteResourceAllowanceRequest name */ - name?: (string|null); - - /** DeleteResourceAllowanceRequest reason */ - reason?: (string|null); - - /** DeleteResourceAllowanceRequest requestId */ - requestId?: (string|null); - } - - /** Represents a DeleteResourceAllowanceRequest. */ - class DeleteResourceAllowanceRequest implements IDeleteResourceAllowanceRequest { - - /** - * Constructs a new DeleteResourceAllowanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest); - - /** DeleteResourceAllowanceRequest name. */ - public name: string; - - /** DeleteResourceAllowanceRequest reason. */ - public reason: string; - - /** DeleteResourceAllowanceRequest requestId. */ - public requestId: string; - - /** - * Creates a new DeleteResourceAllowanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteResourceAllowanceRequest instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest): google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest; - - /** - * Encodes the specified DeleteResourceAllowanceRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest.verify|verify} messages. - * @param message DeleteResourceAllowanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteResourceAllowanceRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest.verify|verify} messages. - * @param message DeleteResourceAllowanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteResourceAllowanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteResourceAllowanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest; - - /** - * Decodes a DeleteResourceAllowanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteResourceAllowanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest; - - /** - * Verifies a DeleteResourceAllowanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteResourceAllowanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteResourceAllowanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest; - - /** - * Creates a plain object from a DeleteResourceAllowanceRequest message. Also converts values to other types if specified. - * @param message DeleteResourceAllowanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteResourceAllowanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteResourceAllowanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListResourceAllowancesRequest. */ - interface IListResourceAllowancesRequest { - - /** ListResourceAllowancesRequest parent */ - parent?: (string|null); - - /** ListResourceAllowancesRequest pageSize */ - pageSize?: (number|null); - - /** ListResourceAllowancesRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListResourceAllowancesRequest. */ - class ListResourceAllowancesRequest implements IListResourceAllowancesRequest { - - /** - * Constructs a new ListResourceAllowancesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IListResourceAllowancesRequest); - - /** ListResourceAllowancesRequest parent. */ - public parent: string; - - /** ListResourceAllowancesRequest pageSize. */ - public pageSize: number; - - /** ListResourceAllowancesRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListResourceAllowancesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListResourceAllowancesRequest instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IListResourceAllowancesRequest): google.cloud.batch.v1alpha.ListResourceAllowancesRequest; - - /** - * Encodes the specified ListResourceAllowancesRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.ListResourceAllowancesRequest.verify|verify} messages. - * @param message ListResourceAllowancesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IListResourceAllowancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListResourceAllowancesRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListResourceAllowancesRequest.verify|verify} messages. - * @param message ListResourceAllowancesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IListResourceAllowancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListResourceAllowancesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListResourceAllowancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ListResourceAllowancesRequest; - - /** - * Decodes a ListResourceAllowancesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListResourceAllowancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ListResourceAllowancesRequest; - - /** - * Verifies a ListResourceAllowancesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListResourceAllowancesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListResourceAllowancesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ListResourceAllowancesRequest; - - /** - * Creates a plain object from a ListResourceAllowancesRequest message. Also converts values to other types if specified. - * @param message ListResourceAllowancesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.ListResourceAllowancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListResourceAllowancesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListResourceAllowancesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListResourceAllowancesResponse. */ - interface IListResourceAllowancesResponse { - - /** ListResourceAllowancesResponse resourceAllowances */ - resourceAllowances?: (google.cloud.batch.v1alpha.IResourceAllowance[]|null); - - /** ListResourceAllowancesResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListResourceAllowancesResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListResourceAllowancesResponse. */ - class ListResourceAllowancesResponse implements IListResourceAllowancesResponse { - - /** - * Constructs a new ListResourceAllowancesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IListResourceAllowancesResponse); - - /** ListResourceAllowancesResponse resourceAllowances. */ - public resourceAllowances: google.cloud.batch.v1alpha.IResourceAllowance[]; - - /** ListResourceAllowancesResponse nextPageToken. */ - public nextPageToken: string; - - /** ListResourceAllowancesResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListResourceAllowancesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListResourceAllowancesResponse instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IListResourceAllowancesResponse): google.cloud.batch.v1alpha.ListResourceAllowancesResponse; - - /** - * Encodes the specified ListResourceAllowancesResponse message. Does not implicitly {@link google.cloud.batch.v1alpha.ListResourceAllowancesResponse.verify|verify} messages. - * @param message ListResourceAllowancesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IListResourceAllowancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListResourceAllowancesResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListResourceAllowancesResponse.verify|verify} messages. - * @param message ListResourceAllowancesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IListResourceAllowancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListResourceAllowancesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListResourceAllowancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ListResourceAllowancesResponse; - - /** - * Decodes a ListResourceAllowancesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListResourceAllowancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ListResourceAllowancesResponse; - - /** - * Verifies a ListResourceAllowancesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListResourceAllowancesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListResourceAllowancesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ListResourceAllowancesResponse; - - /** - * Creates a plain object from a ListResourceAllowancesResponse message. Also converts values to other types if specified. - * @param message ListResourceAllowancesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.ListResourceAllowancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListResourceAllowancesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListResourceAllowancesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateResourceAllowanceRequest. */ - interface IUpdateResourceAllowanceRequest { - - /** UpdateResourceAllowanceRequest resourceAllowance */ - resourceAllowance?: (google.cloud.batch.v1alpha.IResourceAllowance|null); - - /** UpdateResourceAllowanceRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateResourceAllowanceRequest requestId */ - requestId?: (string|null); - } - - /** Represents an UpdateResourceAllowanceRequest. */ - class UpdateResourceAllowanceRequest implements IUpdateResourceAllowanceRequest { - - /** - * Constructs a new UpdateResourceAllowanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest); - - /** UpdateResourceAllowanceRequest resourceAllowance. */ - public resourceAllowance?: (google.cloud.batch.v1alpha.IResourceAllowance|null); - - /** UpdateResourceAllowanceRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateResourceAllowanceRequest requestId. */ - public requestId: string; - - /** - * Creates a new UpdateResourceAllowanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateResourceAllowanceRequest instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest): google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest; - - /** - * Encodes the specified UpdateResourceAllowanceRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest.verify|verify} messages. - * @param message UpdateResourceAllowanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateResourceAllowanceRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest.verify|verify} messages. - * @param message UpdateResourceAllowanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateResourceAllowanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateResourceAllowanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest; - - /** - * Decodes an UpdateResourceAllowanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateResourceAllowanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest; - - /** - * Verifies an UpdateResourceAllowanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateResourceAllowanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateResourceAllowanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest; - - /** - * Creates a plain object from an UpdateResourceAllowanceRequest message. Also converts values to other types if specified. - * @param message UpdateResourceAllowanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateResourceAllowanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateResourceAllowanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OperationMetadata. */ - interface IOperationMetadata { - - /** OperationMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata target */ - target?: (string|null); - - /** OperationMetadata verb */ - verb?: (string|null); - - /** OperationMetadata statusMessage */ - statusMessage?: (string|null); - - /** OperationMetadata requestedCancellation */ - requestedCancellation?: (boolean|null); - - /** OperationMetadata apiVersion */ - apiVersion?: (string|null); - } - - /** Represents an OperationMetadata. */ - class OperationMetadata implements IOperationMetadata { - - /** - * Constructs a new OperationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IOperationMetadata); - - /** OperationMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata target. */ - public target: string; - - /** OperationMetadata verb. */ - public verb: string; - - /** OperationMetadata statusMessage. */ - public statusMessage: string; - - /** OperationMetadata requestedCancellation. */ - public requestedCancellation: boolean; - - /** OperationMetadata apiVersion. */ - public apiVersion: string; - - /** - * Creates a new OperationMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns OperationMetadata instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IOperationMetadata): google.cloud.batch.v1alpha.OperationMetadata; - - /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.batch.v1alpha.OperationMetadata.verify|verify} messages. - * @param message OperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.OperationMetadata.verify|verify} messages. - * @param message OperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.OperationMetadata; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.OperationMetadata; - - /** - * Verifies an OperationMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OperationMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.OperationMetadata; - - /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. - * @param message OperationMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OperationMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OperationMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Job. */ - interface IJob { - - /** Job name */ - name?: (string|null); - - /** Job uid */ - uid?: (string|null); - - /** Job priority */ - priority?: (number|Long|string|null); - - /** Job taskGroups */ - taskGroups?: (google.cloud.batch.v1alpha.ITaskGroup[]|null); - - /** Job schedulingPolicy */ - schedulingPolicy?: (google.cloud.batch.v1alpha.Job.SchedulingPolicy|keyof typeof google.cloud.batch.v1alpha.Job.SchedulingPolicy|null); - - /** Job dependencies */ - dependencies?: (google.cloud.batch.v1alpha.IJobDependency[]|null); - - /** Job allocationPolicy */ - allocationPolicy?: (google.cloud.batch.v1alpha.IAllocationPolicy|null); - - /** Job labels */ - labels?: ({ [k: string]: string }|null); - - /** Job status */ - status?: (google.cloud.batch.v1alpha.IJobStatus|null); - - /** Job notification */ - notification?: (google.cloud.batch.v1alpha.IJobNotification|null); - - /** Job createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Job updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Job logsPolicy */ - logsPolicy?: (google.cloud.batch.v1alpha.ILogsPolicy|null); - - /** Job notifications */ - notifications?: (google.cloud.batch.v1alpha.IJobNotification[]|null); - } - - /** Represents a Job. */ - class Job implements IJob { - - /** - * Constructs a new Job. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IJob); - - /** Job name. */ - public name: string; - - /** Job uid. */ - public uid: string; - - /** Job priority. */ - public priority: (number|Long|string); - - /** Job taskGroups. */ - public taskGroups: google.cloud.batch.v1alpha.ITaskGroup[]; - - /** Job schedulingPolicy. */ - public schedulingPolicy: (google.cloud.batch.v1alpha.Job.SchedulingPolicy|keyof typeof google.cloud.batch.v1alpha.Job.SchedulingPolicy); - - /** Job dependencies. */ - public dependencies: google.cloud.batch.v1alpha.IJobDependency[]; - - /** Job allocationPolicy. */ - public allocationPolicy?: (google.cloud.batch.v1alpha.IAllocationPolicy|null); - - /** Job labels. */ - public labels: { [k: string]: string }; - - /** Job status. */ - public status?: (google.cloud.batch.v1alpha.IJobStatus|null); - - /** Job notification. */ - public notification?: (google.cloud.batch.v1alpha.IJobNotification|null); - - /** Job createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Job updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Job logsPolicy. */ - public logsPolicy?: (google.cloud.batch.v1alpha.ILogsPolicy|null); - - /** Job notifications. */ - public notifications: google.cloud.batch.v1alpha.IJobNotification[]; - - /** - * Creates a new Job instance using the specified properties. - * @param [properties] Properties to set - * @returns Job instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IJob): google.cloud.batch.v1alpha.Job; - - /** - * Encodes the specified Job message. Does not implicitly {@link google.cloud.batch.v1alpha.Job.verify|verify} messages. - * @param message Job message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IJob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Job.verify|verify} messages. - * @param message Job message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IJob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Job message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Job - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Job; - - /** - * Decodes a Job message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Job - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Job; - - /** - * Verifies a Job message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Job message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Job - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Job; - - /** - * Creates a plain object from a Job message. Also converts values to other types if specified. - * @param message Job - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.Job, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Job to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Job - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Job { - - /** SchedulingPolicy enum. */ - enum SchedulingPolicy { - SCHEDULING_POLICY_UNSPECIFIED = 0, - AS_SOON_AS_POSSIBLE = 1 - } - } - - /** Properties of a LogsPolicy. */ - interface ILogsPolicy { - - /** LogsPolicy destination */ - destination?: (google.cloud.batch.v1alpha.LogsPolicy.Destination|keyof typeof google.cloud.batch.v1alpha.LogsPolicy.Destination|null); - - /** LogsPolicy logsPath */ - logsPath?: (string|null); - - /** LogsPolicy cloudLoggingOption */ - cloudLoggingOption?: (google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption|null); - } - - /** Represents a LogsPolicy. */ - class LogsPolicy implements ILogsPolicy { - - /** - * Constructs a new LogsPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.ILogsPolicy); - - /** LogsPolicy destination. */ - public destination: (google.cloud.batch.v1alpha.LogsPolicy.Destination|keyof typeof google.cloud.batch.v1alpha.LogsPolicy.Destination); - - /** LogsPolicy logsPath. */ - public logsPath: string; - - /** LogsPolicy cloudLoggingOption. */ - public cloudLoggingOption?: (google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption|null); - - /** - * Creates a new LogsPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns LogsPolicy instance - */ - public static create(properties?: google.cloud.batch.v1alpha.ILogsPolicy): google.cloud.batch.v1alpha.LogsPolicy; - - /** - * Encodes the specified LogsPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.LogsPolicy.verify|verify} messages. - * @param message LogsPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.ILogsPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LogsPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.LogsPolicy.verify|verify} messages. - * @param message LogsPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.ILogsPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LogsPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LogsPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.LogsPolicy; - - /** - * Decodes a LogsPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LogsPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.LogsPolicy; - - /** - * Verifies a LogsPolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LogsPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LogsPolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.LogsPolicy; - - /** - * Creates a plain object from a LogsPolicy message. Also converts values to other types if specified. - * @param message LogsPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.LogsPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LogsPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LogsPolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace LogsPolicy { - - /** Properties of a CloudLoggingOption. */ - interface ICloudLoggingOption { - - /** CloudLoggingOption useGenericTaskMonitoredResource */ - useGenericTaskMonitoredResource?: (boolean|null); - } - - /** Represents a CloudLoggingOption. */ - class CloudLoggingOption implements ICloudLoggingOption { - - /** - * Constructs a new CloudLoggingOption. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption); - - /** CloudLoggingOption useGenericTaskMonitoredResource. */ - public useGenericTaskMonitoredResource: boolean; - - /** - * Creates a new CloudLoggingOption instance using the specified properties. - * @param [properties] Properties to set - * @returns CloudLoggingOption instance - */ - public static create(properties?: google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption): google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption; - - /** - * Encodes the specified CloudLoggingOption message. Does not implicitly {@link google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption.verify|verify} messages. - * @param message CloudLoggingOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CloudLoggingOption message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption.verify|verify} messages. - * @param message CloudLoggingOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CloudLoggingOption message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CloudLoggingOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption; - - /** - * Decodes a CloudLoggingOption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CloudLoggingOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption; - - /** - * Verifies a CloudLoggingOption message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CloudLoggingOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CloudLoggingOption - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption; - - /** - * Creates a plain object from a CloudLoggingOption message. Also converts values to other types if specified. - * @param message CloudLoggingOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CloudLoggingOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CloudLoggingOption - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Destination enum. */ - enum Destination { - DESTINATION_UNSPECIFIED = 0, - CLOUD_LOGGING = 1, - PATH = 2 - } - } - - /** Properties of a JobDependency. */ - interface IJobDependency { - - /** JobDependency items */ - items?: ({ [k: string]: google.cloud.batch.v1alpha.JobDependency.Type }|null); - } - - /** Represents a JobDependency. */ - class JobDependency implements IJobDependency { - - /** - * Constructs a new JobDependency. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IJobDependency); - - /** JobDependency items. */ - public items: { [k: string]: google.cloud.batch.v1alpha.JobDependency.Type }; - - /** - * Creates a new JobDependency instance using the specified properties. - * @param [properties] Properties to set - * @returns JobDependency instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IJobDependency): google.cloud.batch.v1alpha.JobDependency; - - /** - * Encodes the specified JobDependency message. Does not implicitly {@link google.cloud.batch.v1alpha.JobDependency.verify|verify} messages. - * @param message JobDependency message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IJobDependency, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified JobDependency message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobDependency.verify|verify} messages. - * @param message JobDependency message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IJobDependency, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a JobDependency message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns JobDependency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.JobDependency; - - /** - * Decodes a JobDependency message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns JobDependency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.JobDependency; - - /** - * Verifies a JobDependency message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a JobDependency message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns JobDependency - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.JobDependency; - - /** - * Creates a plain object from a JobDependency message. Also converts values to other types if specified. - * @param message JobDependency - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.JobDependency, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this JobDependency to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for JobDependency - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace JobDependency { - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - SUCCEEDED = 1, - FAILED = 2, - FINISHED = 3 - } - } - - /** Properties of a JobStatus. */ - interface IJobStatus { - - /** JobStatus state */ - state?: (google.cloud.batch.v1alpha.JobStatus.State|keyof typeof google.cloud.batch.v1alpha.JobStatus.State|null); - - /** JobStatus statusEvents */ - statusEvents?: (google.cloud.batch.v1alpha.IStatusEvent[]|null); - - /** JobStatus taskGroups */ - taskGroups?: ({ [k: string]: google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus }|null); - - /** JobStatus runDuration */ - runDuration?: (google.protobuf.IDuration|null); - - /** JobStatus resourceUsage */ - resourceUsage?: (google.cloud.batch.v1alpha.IResourceUsage|null); - } - - /** Represents a JobStatus. */ - class JobStatus implements IJobStatus { - - /** - * Constructs a new JobStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IJobStatus); - - /** JobStatus state. */ - public state: (google.cloud.batch.v1alpha.JobStatus.State|keyof typeof google.cloud.batch.v1alpha.JobStatus.State); - - /** JobStatus statusEvents. */ - public statusEvents: google.cloud.batch.v1alpha.IStatusEvent[]; - - /** JobStatus taskGroups. */ - public taskGroups: { [k: string]: google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus }; - - /** JobStatus runDuration. */ - public runDuration?: (google.protobuf.IDuration|null); - - /** JobStatus resourceUsage. */ - public resourceUsage?: (google.cloud.batch.v1alpha.IResourceUsage|null); - - /** - * Creates a new JobStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns JobStatus instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IJobStatus): google.cloud.batch.v1alpha.JobStatus; - - /** - * Encodes the specified JobStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.verify|verify} messages. - * @param message JobStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IJobStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified JobStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.verify|verify} messages. - * @param message JobStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IJobStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a JobStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns JobStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.JobStatus; - - /** - * Decodes a JobStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns JobStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.JobStatus; - - /** - * Verifies a JobStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a JobStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns JobStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.JobStatus; - - /** - * Creates a plain object from a JobStatus message. Also converts values to other types if specified. - * @param message JobStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.JobStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this JobStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for JobStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace JobStatus { - - /** Properties of an InstanceStatus. */ - interface IInstanceStatus { - - /** InstanceStatus machineType */ - machineType?: (string|null); - - /** InstanceStatus provisioningModel */ - provisioningModel?: (google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel|keyof typeof google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel|null); - - /** InstanceStatus taskPack */ - taskPack?: (number|Long|string|null); - - /** InstanceStatus bootDisk */ - bootDisk?: (google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null); - } - - /** Represents an InstanceStatus. */ - class InstanceStatus implements IInstanceStatus { - - /** - * Constructs a new InstanceStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.JobStatus.IInstanceStatus); - - /** InstanceStatus machineType. */ - public machineType: string; - - /** InstanceStatus provisioningModel. */ - public provisioningModel: (google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel|keyof typeof google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel); - - /** InstanceStatus taskPack. */ - public taskPack: (number|Long|string); - - /** InstanceStatus bootDisk. */ - public bootDisk?: (google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null); - - /** - * Creates a new InstanceStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns InstanceStatus instance - */ - public static create(properties?: google.cloud.batch.v1alpha.JobStatus.IInstanceStatus): google.cloud.batch.v1alpha.JobStatus.InstanceStatus; - - /** - * Encodes the specified InstanceStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.InstanceStatus.verify|verify} messages. - * @param message InstanceStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.JobStatus.IInstanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InstanceStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.InstanceStatus.verify|verify} messages. - * @param message InstanceStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.JobStatus.IInstanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InstanceStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InstanceStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.JobStatus.InstanceStatus; - - /** - * Decodes an InstanceStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InstanceStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.JobStatus.InstanceStatus; - - /** - * Verifies an InstanceStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InstanceStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InstanceStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.JobStatus.InstanceStatus; - - /** - * Creates a plain object from an InstanceStatus message. Also converts values to other types if specified. - * @param message InstanceStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.JobStatus.InstanceStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InstanceStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InstanceStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TaskGroupStatus. */ - interface ITaskGroupStatus { - - /** TaskGroupStatus counts */ - counts?: ({ [k: string]: (number|Long|string) }|null); - - /** TaskGroupStatus instances */ - instances?: (google.cloud.batch.v1alpha.JobStatus.IInstanceStatus[]|null); - } - - /** Represents a TaskGroupStatus. */ - class TaskGroupStatus implements ITaskGroupStatus { - - /** - * Constructs a new TaskGroupStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus); - - /** TaskGroupStatus counts. */ - public counts: { [k: string]: (number|Long|string) }; - - /** TaskGroupStatus instances. */ - public instances: google.cloud.batch.v1alpha.JobStatus.IInstanceStatus[]; - - /** - * Creates a new TaskGroupStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns TaskGroupStatus instance - */ - public static create(properties?: google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus): google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus; - - /** - * Encodes the specified TaskGroupStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.verify|verify} messages. - * @param message TaskGroupStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TaskGroupStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.verify|verify} messages. - * @param message TaskGroupStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TaskGroupStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TaskGroupStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus; - - /** - * Decodes a TaskGroupStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TaskGroupStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus; - - /** - * Verifies a TaskGroupStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TaskGroupStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TaskGroupStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus; - - /** - * Creates a plain object from a TaskGroupStatus message. Also converts values to other types if specified. - * @param message TaskGroupStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TaskGroupStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TaskGroupStatus - * @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, - QUEUED = 1, - SCHEDULED = 2, - RUNNING = 3, - SUCCEEDED = 4, - FAILED = 5, - DELETION_IN_PROGRESS = 6, - CANCELLATION_IN_PROGRESS = 7, - CANCELLED = 8 - } - } - - /** Properties of a ResourceUsage. */ - interface IResourceUsage { - - /** ResourceUsage coreHours */ - coreHours?: (number|null); - } - - /** Represents a ResourceUsage. */ - class ResourceUsage implements IResourceUsage { - - /** - * Constructs a new ResourceUsage. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IResourceUsage); - - /** ResourceUsage coreHours. */ - public coreHours: number; - - /** - * Creates a new ResourceUsage instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceUsage instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IResourceUsage): google.cloud.batch.v1alpha.ResourceUsage; - - /** - * Encodes the specified ResourceUsage message. Does not implicitly {@link google.cloud.batch.v1alpha.ResourceUsage.verify|verify} messages. - * @param message ResourceUsage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IResourceUsage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceUsage message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ResourceUsage.verify|verify} messages. - * @param message ResourceUsage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IResourceUsage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceUsage message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceUsage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ResourceUsage; - - /** - * Decodes a ResourceUsage message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceUsage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ResourceUsage; - - /** - * Verifies a ResourceUsage message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceUsage message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceUsage - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ResourceUsage; - - /** - * Creates a plain object from a ResourceUsage message. Also converts values to other types if specified. - * @param message ResourceUsage - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.ResourceUsage, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceUsage to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceUsage - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a JobNotification. */ - interface IJobNotification { - - /** JobNotification pubsubTopic */ - pubsubTopic?: (string|null); - - /** JobNotification message */ - message?: (google.cloud.batch.v1alpha.JobNotification.IMessage|null); - } - - /** Represents a JobNotification. */ - class JobNotification implements IJobNotification { - - /** - * Constructs a new JobNotification. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IJobNotification); - - /** JobNotification pubsubTopic. */ - public pubsubTopic: string; - - /** JobNotification message. */ - public message?: (google.cloud.batch.v1alpha.JobNotification.IMessage|null); - - /** - * Creates a new JobNotification instance using the specified properties. - * @param [properties] Properties to set - * @returns JobNotification instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IJobNotification): google.cloud.batch.v1alpha.JobNotification; - - /** - * Encodes the specified JobNotification message. Does not implicitly {@link google.cloud.batch.v1alpha.JobNotification.verify|verify} messages. - * @param message JobNotification message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IJobNotification, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified JobNotification message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobNotification.verify|verify} messages. - * @param message JobNotification message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IJobNotification, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a JobNotification message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns JobNotification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.JobNotification; - - /** - * Decodes a JobNotification message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns JobNotification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.JobNotification; - - /** - * Verifies a JobNotification message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a JobNotification message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns JobNotification - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.JobNotification; - - /** - * Creates a plain object from a JobNotification message. Also converts values to other types if specified. - * @param message JobNotification - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.JobNotification, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this JobNotification to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for JobNotification - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace JobNotification { - - /** Properties of a Message. */ - interface IMessage { - - /** Message type */ - type?: (google.cloud.batch.v1alpha.JobNotification.Type|keyof typeof google.cloud.batch.v1alpha.JobNotification.Type|null); - - /** Message newJobState */ - newJobState?: (google.cloud.batch.v1alpha.JobStatus.State|keyof typeof google.cloud.batch.v1alpha.JobStatus.State|null); - - /** Message newTaskState */ - newTaskState?: (google.cloud.batch.v1alpha.TaskStatus.State|keyof typeof google.cloud.batch.v1alpha.TaskStatus.State|null); - } - - /** Represents a Message. */ - class Message implements IMessage { - - /** - * Constructs a new Message. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.JobNotification.IMessage); - - /** Message type. */ - public type: (google.cloud.batch.v1alpha.JobNotification.Type|keyof typeof google.cloud.batch.v1alpha.JobNotification.Type); - - /** Message newJobState. */ - public newJobState: (google.cloud.batch.v1alpha.JobStatus.State|keyof typeof google.cloud.batch.v1alpha.JobStatus.State); - - /** Message newTaskState. */ - public newTaskState: (google.cloud.batch.v1alpha.TaskStatus.State|keyof typeof google.cloud.batch.v1alpha.TaskStatus.State); - - /** - * Creates a new Message instance using the specified properties. - * @param [properties] Properties to set - * @returns Message instance - */ - public static create(properties?: google.cloud.batch.v1alpha.JobNotification.IMessage): google.cloud.batch.v1alpha.JobNotification.Message; - - /** - * Encodes the specified Message message. Does not implicitly {@link google.cloud.batch.v1alpha.JobNotification.Message.verify|verify} messages. - * @param message Message message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.JobNotification.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobNotification.Message.verify|verify} messages. - * @param message Message message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.JobNotification.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Message message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.JobNotification.Message; - - /** - * Decodes a Message message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.JobNotification.Message; - - /** - * Verifies a Message message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Message message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Message - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.JobNotification.Message; - - /** - * Creates a plain object from a Message message. Also converts values to other types if specified. - * @param message Message - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.JobNotification.Message, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Message to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Message - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - JOB_STATE_CHANGED = 1, - TASK_STATE_CHANGED = 2 - } - } - - /** Properties of an AllocationPolicy. */ - interface IAllocationPolicy { - - /** AllocationPolicy location */ - location?: (google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy|null); - - /** AllocationPolicy instance */ - instance?: (google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy|null); - - /** AllocationPolicy instances */ - instances?: (google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate[]|null); - - /** AllocationPolicy instanceTemplates */ - instanceTemplates?: (string[]|null); - - /** AllocationPolicy provisioningModels */ - provisioningModels?: (google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel[]|null); - - /** AllocationPolicy serviceAccountEmail */ - serviceAccountEmail?: (string|null); - - /** AllocationPolicy serviceAccount */ - serviceAccount?: (google.cloud.batch.v1alpha.IServiceAccount|null); - - /** AllocationPolicy labels */ - labels?: ({ [k: string]: string }|null); - - /** AllocationPolicy network */ - network?: (google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy|null); - - /** AllocationPolicy placement */ - placement?: (google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy|null); - - /** AllocationPolicy tags */ - tags?: (string[]|null); - } - - /** Represents an AllocationPolicy. */ - class AllocationPolicy implements IAllocationPolicy { - - /** - * Constructs a new AllocationPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IAllocationPolicy); - - /** AllocationPolicy location. */ - public location?: (google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy|null); - - /** AllocationPolicy instance. */ - public instance?: (google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy|null); - - /** AllocationPolicy instances. */ - public instances: google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate[]; - - /** AllocationPolicy instanceTemplates. */ - public instanceTemplates: string[]; - - /** AllocationPolicy provisioningModels. */ - public provisioningModels: google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel[]; - - /** AllocationPolicy serviceAccountEmail. */ - public serviceAccountEmail: string; - - /** AllocationPolicy serviceAccount. */ - public serviceAccount?: (google.cloud.batch.v1alpha.IServiceAccount|null); - - /** AllocationPolicy labels. */ - public labels: { [k: string]: string }; - - /** AllocationPolicy network. */ - public network?: (google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy|null); - - /** AllocationPolicy placement. */ - public placement?: (google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy|null); - - /** AllocationPolicy tags. */ - public tags: string[]; - - /** - * Creates a new AllocationPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns AllocationPolicy instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IAllocationPolicy): google.cloud.batch.v1alpha.AllocationPolicy; - - /** - * Encodes the specified AllocationPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.verify|verify} messages. - * @param message AllocationPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IAllocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AllocationPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.verify|verify} messages. - * @param message AllocationPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IAllocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AllocationPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AllocationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy; - - /** - * Decodes an AllocationPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AllocationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy; - - /** - * Verifies an AllocationPolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AllocationPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AllocationPolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy; - - /** - * Creates a plain object from an AllocationPolicy message. Also converts values to other types if specified. - * @param message AllocationPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AllocationPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AllocationPolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AllocationPolicy { - - /** Properties of a LocationPolicy. */ - interface ILocationPolicy { - - /** LocationPolicy allowedLocations */ - allowedLocations?: (string[]|null); - - /** LocationPolicy deniedLocations */ - deniedLocations?: (string[]|null); - } - - /** Represents a LocationPolicy. */ - class LocationPolicy implements ILocationPolicy { - - /** - * Constructs a new LocationPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy); - - /** LocationPolicy allowedLocations. */ - public allowedLocations: string[]; - - /** LocationPolicy deniedLocations. */ - public deniedLocations: string[]; - - /** - * Creates a new LocationPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns LocationPolicy instance - */ - public static create(properties?: google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy): google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy; - - /** - * Encodes the specified LocationPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.verify|verify} messages. - * @param message LocationPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LocationPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.verify|verify} messages. - * @param message LocationPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LocationPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LocationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy; - - /** - * Decodes a LocationPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LocationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy; - - /** - * Verifies a LocationPolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LocationPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LocationPolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy; - - /** - * Creates a plain object from a LocationPolicy message. Also converts values to other types if specified. - * @param message LocationPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LocationPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LocationPolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Disk. */ - interface IDisk { - - /** Disk image */ - image?: (string|null); - - /** Disk snapshot */ - snapshot?: (string|null); - - /** Disk type */ - type?: (string|null); - - /** Disk sizeGb */ - sizeGb?: (number|Long|string|null); - - /** Disk diskInterface */ - diskInterface?: (string|null); - } - - /** Represents a Disk. */ - class Disk implements IDisk { - - /** - * Constructs a new Disk. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IDisk); - - /** Disk image. */ - public image?: (string|null); - - /** Disk snapshot. */ - public snapshot?: (string|null); - - /** Disk type. */ - public type: string; - - /** Disk sizeGb. */ - public sizeGb: (number|Long|string); - - /** Disk diskInterface. */ - public diskInterface: string; - - /** Disk dataSource. */ - public dataSource?: ("image"|"snapshot"); - - /** - * Creates a new Disk instance using the specified properties. - * @param [properties] Properties to set - * @returns Disk instance - */ - public static create(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IDisk): google.cloud.batch.v1alpha.AllocationPolicy.Disk; - - /** - * Encodes the specified Disk message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.Disk.verify|verify} messages. - * @param message Disk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.AllocationPolicy.IDisk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Disk message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.Disk.verify|verify} messages. - * @param message Disk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.AllocationPolicy.IDisk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Disk message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Disk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy.Disk; - - /** - * Decodes a Disk message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Disk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy.Disk; - - /** - * Verifies a Disk message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Disk message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Disk - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy.Disk; - - /** - * Creates a plain object from a Disk message. Also converts values to other types if specified. - * @param message Disk - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy.Disk, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Disk to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Disk - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AttachedDisk. */ - interface IAttachedDisk { - - /** AttachedDisk newDisk */ - newDisk?: (google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null); - - /** AttachedDisk existingDisk */ - existingDisk?: (string|null); - - /** AttachedDisk deviceName */ - deviceName?: (string|null); - } - - /** Represents an AttachedDisk. */ - class AttachedDisk implements IAttachedDisk { - - /** - * Constructs a new AttachedDisk. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk); - - /** AttachedDisk newDisk. */ - public newDisk?: (google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null); - - /** AttachedDisk existingDisk. */ - public existingDisk?: (string|null); - - /** AttachedDisk deviceName. */ - public deviceName: string; - - /** AttachedDisk attached. */ - public attached?: ("newDisk"|"existingDisk"); - - /** - * Creates a new AttachedDisk instance using the specified properties. - * @param [properties] Properties to set - * @returns AttachedDisk instance - */ - public static create(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk): google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk; - - /** - * Encodes the specified AttachedDisk message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.verify|verify} messages. - * @param message AttachedDisk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AttachedDisk message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.verify|verify} messages. - * @param message AttachedDisk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AttachedDisk message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AttachedDisk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk; - - /** - * Decodes an AttachedDisk message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AttachedDisk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk; - - /** - * Verifies an AttachedDisk message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AttachedDisk message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AttachedDisk - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk; - - /** - * Creates a plain object from an AttachedDisk message. Also converts values to other types if specified. - * @param message AttachedDisk - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AttachedDisk to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AttachedDisk - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Accelerator. */ - interface IAccelerator { - - /** Accelerator type */ - type?: (string|null); - - /** Accelerator count */ - count?: (number|Long|string|null); - - /** Accelerator installGpuDrivers */ - installGpuDrivers?: (boolean|null); - - /** Accelerator driverVersion */ - driverVersion?: (string|null); - } - - /** Represents an Accelerator. */ - class Accelerator implements IAccelerator { - - /** - * Constructs a new Accelerator. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator); - - /** Accelerator type. */ - public type: string; - - /** Accelerator count. */ - public count: (number|Long|string); - - /** Accelerator installGpuDrivers. */ - public installGpuDrivers: boolean; - - /** Accelerator driverVersion. */ - public driverVersion: string; - - /** - * Creates a new Accelerator instance using the specified properties. - * @param [properties] Properties to set - * @returns Accelerator instance - */ - public static create(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator): google.cloud.batch.v1alpha.AllocationPolicy.Accelerator; - - /** - * Encodes the specified Accelerator message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.verify|verify} messages. - * @param message Accelerator message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Accelerator message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.verify|verify} messages. - * @param message Accelerator message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Accelerator message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Accelerator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy.Accelerator; - - /** - * Decodes an Accelerator message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Accelerator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy.Accelerator; - - /** - * Verifies an Accelerator message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Accelerator message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Accelerator - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy.Accelerator; - - /** - * Creates a plain object from an Accelerator message. Also converts values to other types if specified. - * @param message Accelerator - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy.Accelerator, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Accelerator to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Accelerator - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InstancePolicy. */ - interface IInstancePolicy { - - /** InstancePolicy allowedMachineTypes */ - allowedMachineTypes?: (string[]|null); - - /** InstancePolicy machineType */ - machineType?: (string|null); - - /** InstancePolicy minCpuPlatform */ - minCpuPlatform?: (string|null); - - /** InstancePolicy provisioningModel */ - provisioningModel?: (google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel|keyof typeof google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel|null); - - /** InstancePolicy accelerators */ - accelerators?: (google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator[]|null); - - /** InstancePolicy bootDisk */ - bootDisk?: (google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null); - - /** InstancePolicy disks */ - disks?: (google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk[]|null); - - /** InstancePolicy reservation */ - reservation?: (string|null); - } - - /** Represents an InstancePolicy. */ - class InstancePolicy implements IInstancePolicy { - - /** - * Constructs a new InstancePolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy); - - /** InstancePolicy allowedMachineTypes. */ - public allowedMachineTypes: string[]; - - /** InstancePolicy machineType. */ - public machineType: string; - - /** InstancePolicy minCpuPlatform. */ - public minCpuPlatform: string; - - /** InstancePolicy provisioningModel. */ - public provisioningModel: (google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel|keyof typeof google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel); - - /** InstancePolicy accelerators. */ - public accelerators: google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator[]; - - /** InstancePolicy bootDisk. */ - public bootDisk?: (google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null); - - /** InstancePolicy disks. */ - public disks: google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk[]; - - /** InstancePolicy reservation. */ - public reservation: string; - - /** - * Creates a new InstancePolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns InstancePolicy instance - */ - public static create(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy): google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy; - - /** - * Encodes the specified InstancePolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.verify|verify} messages. - * @param message InstancePolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InstancePolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.verify|verify} messages. - * @param message InstancePolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InstancePolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InstancePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy; - - /** - * Decodes an InstancePolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InstancePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy; - - /** - * Verifies an InstancePolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InstancePolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InstancePolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy; - - /** - * Creates a plain object from an InstancePolicy message. Also converts values to other types if specified. - * @param message InstancePolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InstancePolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InstancePolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InstancePolicyOrTemplate. */ - interface IInstancePolicyOrTemplate { - - /** InstancePolicyOrTemplate policy */ - policy?: (google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy|null); - - /** InstancePolicyOrTemplate instanceTemplate */ - instanceTemplate?: (string|null); - - /** InstancePolicyOrTemplate installGpuDrivers */ - installGpuDrivers?: (boolean|null); - - /** InstancePolicyOrTemplate installOpsAgent */ - installOpsAgent?: (boolean|null); - - /** InstancePolicyOrTemplate blockProjectSshKeys */ - blockProjectSshKeys?: (boolean|null); - } - - /** Represents an InstancePolicyOrTemplate. */ - class InstancePolicyOrTemplate implements IInstancePolicyOrTemplate { - - /** - * Constructs a new InstancePolicyOrTemplate. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate); - - /** InstancePolicyOrTemplate policy. */ - public policy?: (google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy|null); - - /** InstancePolicyOrTemplate instanceTemplate. */ - public instanceTemplate?: (string|null); - - /** InstancePolicyOrTemplate installGpuDrivers. */ - public installGpuDrivers: boolean; - - /** InstancePolicyOrTemplate installOpsAgent. */ - public installOpsAgent: boolean; - - /** InstancePolicyOrTemplate blockProjectSshKeys. */ - public blockProjectSshKeys: boolean; - - /** InstancePolicyOrTemplate policyTemplate. */ - public policyTemplate?: ("policy"|"instanceTemplate"); - - /** - * Creates a new InstancePolicyOrTemplate instance using the specified properties. - * @param [properties] Properties to set - * @returns InstancePolicyOrTemplate instance - */ - public static create(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate): google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate; - - /** - * Encodes the specified InstancePolicyOrTemplate message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.verify|verify} messages. - * @param message InstancePolicyOrTemplate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InstancePolicyOrTemplate message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.verify|verify} messages. - * @param message InstancePolicyOrTemplate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InstancePolicyOrTemplate message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InstancePolicyOrTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate; - - /** - * Decodes an InstancePolicyOrTemplate message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InstancePolicyOrTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate; - - /** - * Verifies an InstancePolicyOrTemplate message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InstancePolicyOrTemplate message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InstancePolicyOrTemplate - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate; - - /** - * Creates a plain object from an InstancePolicyOrTemplate message. Also converts values to other types if specified. - * @param message InstancePolicyOrTemplate - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InstancePolicyOrTemplate to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InstancePolicyOrTemplate - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a NetworkInterface. */ - interface INetworkInterface { - - /** NetworkInterface network */ - network?: (string|null); - - /** NetworkInterface subnetwork */ - subnetwork?: (string|null); - - /** NetworkInterface noExternalIpAddress */ - noExternalIpAddress?: (boolean|null); - } - - /** Represents a NetworkInterface. */ - class NetworkInterface implements INetworkInterface { - - /** - * Constructs a new NetworkInterface. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface); - - /** NetworkInterface network. */ - public network: string; - - /** NetworkInterface subnetwork. */ - public subnetwork: string; - - /** NetworkInterface noExternalIpAddress. */ - public noExternalIpAddress: boolean; - - /** - * Creates a new NetworkInterface instance using the specified properties. - * @param [properties] Properties to set - * @returns NetworkInterface instance - */ - public static create(properties?: google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface): google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface; - - /** - * Encodes the specified NetworkInterface message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.verify|verify} messages. - * @param message NetworkInterface message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NetworkInterface message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.verify|verify} messages. - * @param message NetworkInterface message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NetworkInterface message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NetworkInterface - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface; - - /** - * Decodes a NetworkInterface message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NetworkInterface - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface; - - /** - * Verifies a NetworkInterface message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NetworkInterface message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NetworkInterface - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface; - - /** - * Creates a plain object from a NetworkInterface message. Also converts values to other types if specified. - * @param message NetworkInterface - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NetworkInterface to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NetworkInterface - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a NetworkPolicy. */ - interface INetworkPolicy { - - /** NetworkPolicy networkInterfaces */ - networkInterfaces?: (google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface[]|null); - } - - /** Represents a NetworkPolicy. */ - class NetworkPolicy implements INetworkPolicy { - - /** - * Constructs a new NetworkPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy); - - /** NetworkPolicy networkInterfaces. */ - public networkInterfaces: google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface[]; - - /** - * Creates a new NetworkPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns NetworkPolicy instance - */ - public static create(properties?: google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy): google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy; - - /** - * Encodes the specified NetworkPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.verify|verify} messages. - * @param message NetworkPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NetworkPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.verify|verify} messages. - * @param message NetworkPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NetworkPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NetworkPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy; - - /** - * Decodes a NetworkPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NetworkPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy; - - /** - * Verifies a NetworkPolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NetworkPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NetworkPolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy; - - /** - * Creates a plain object from a NetworkPolicy message. Also converts values to other types if specified. - * @param message NetworkPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NetworkPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NetworkPolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PlacementPolicy. */ - interface IPlacementPolicy { - - /** PlacementPolicy collocation */ - collocation?: (string|null); - - /** PlacementPolicy maxDistance */ - maxDistance?: (number|Long|string|null); - } - - /** Represents a PlacementPolicy. */ - class PlacementPolicy implements IPlacementPolicy { - - /** - * Constructs a new PlacementPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy); - - /** PlacementPolicy collocation. */ - public collocation: string; - - /** PlacementPolicy maxDistance. */ - public maxDistance: (number|Long|string); - - /** - * Creates a new PlacementPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns PlacementPolicy instance - */ - public static create(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy): google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy; - - /** - * Encodes the specified PlacementPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.verify|verify} messages. - * @param message PlacementPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PlacementPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.verify|verify} messages. - * @param message PlacementPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PlacementPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PlacementPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy; - - /** - * Decodes a PlacementPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PlacementPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy; - - /** - * Verifies a PlacementPolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PlacementPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PlacementPolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy; - - /** - * Creates a plain object from a PlacementPolicy message. Also converts values to other types if specified. - * @param message PlacementPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PlacementPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PlacementPolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** ProvisioningModel enum. */ - enum ProvisioningModel { - PROVISIONING_MODEL_UNSPECIFIED = 0, - STANDARD = 1, - SPOT = 2, - PREEMPTIBLE = 3 - } - } - - /** Properties of a TaskGroup. */ - interface ITaskGroup { - - /** TaskGroup name */ - name?: (string|null); - - /** TaskGroup taskSpec */ - taskSpec?: (google.cloud.batch.v1alpha.ITaskSpec|null); - - /** TaskGroup taskCount */ - taskCount?: (number|Long|string|null); - - /** TaskGroup parallelism */ - parallelism?: (number|Long|string|null); - - /** TaskGroup schedulingPolicy */ - schedulingPolicy?: (google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy|keyof typeof google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy|null); - - /** TaskGroup allocationPolicy */ - allocationPolicy?: (google.cloud.batch.v1alpha.IAllocationPolicy|null); - - /** TaskGroup labels */ - labels?: ({ [k: string]: string }|null); - - /** TaskGroup taskEnvironments */ - taskEnvironments?: (google.cloud.batch.v1alpha.IEnvironment[]|null); - - /** TaskGroup taskCountPerNode */ - taskCountPerNode?: (number|Long|string|null); - - /** TaskGroup requireHostsFile */ - requireHostsFile?: (boolean|null); - - /** TaskGroup permissiveSsh */ - permissiveSsh?: (boolean|null); - - /** TaskGroup runAsNonRoot */ - runAsNonRoot?: (boolean|null); - - /** TaskGroup serviceAccount */ - serviceAccount?: (google.cloud.batch.v1alpha.IServiceAccount|null); - } - - /** Represents a TaskGroup. */ - class TaskGroup implements ITaskGroup { - - /** - * Constructs a new TaskGroup. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.ITaskGroup); - - /** TaskGroup name. */ - public name: string; - - /** TaskGroup taskSpec. */ - public taskSpec?: (google.cloud.batch.v1alpha.ITaskSpec|null); - - /** TaskGroup taskCount. */ - public taskCount: (number|Long|string); - - /** TaskGroup parallelism. */ - public parallelism: (number|Long|string); - - /** TaskGroup schedulingPolicy. */ - public schedulingPolicy: (google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy|keyof typeof google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy); - - /** TaskGroup allocationPolicy. */ - public allocationPolicy?: (google.cloud.batch.v1alpha.IAllocationPolicy|null); - - /** TaskGroup labels. */ - public labels: { [k: string]: string }; - - /** TaskGroup taskEnvironments. */ - public taskEnvironments: google.cloud.batch.v1alpha.IEnvironment[]; - - /** TaskGroup taskCountPerNode. */ - public taskCountPerNode: (number|Long|string); - - /** TaskGroup requireHostsFile. */ - public requireHostsFile: boolean; - - /** TaskGroup permissiveSsh. */ - public permissiveSsh: boolean; - - /** TaskGroup runAsNonRoot. */ - public runAsNonRoot: boolean; - - /** TaskGroup serviceAccount. */ - public serviceAccount?: (google.cloud.batch.v1alpha.IServiceAccount|null); - - /** - * Creates a new TaskGroup instance using the specified properties. - * @param [properties] Properties to set - * @returns TaskGroup instance - */ - public static create(properties?: google.cloud.batch.v1alpha.ITaskGroup): google.cloud.batch.v1alpha.TaskGroup; - - /** - * Encodes the specified TaskGroup message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskGroup.verify|verify} messages. - * @param message TaskGroup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.ITaskGroup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TaskGroup message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskGroup.verify|verify} messages. - * @param message TaskGroup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.ITaskGroup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TaskGroup message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TaskGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.TaskGroup; - - /** - * Decodes a TaskGroup message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TaskGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.TaskGroup; - - /** - * Verifies a TaskGroup message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TaskGroup message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TaskGroup - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.TaskGroup; - - /** - * Creates a plain object from a TaskGroup message. Also converts values to other types if specified. - * @param message TaskGroup - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.TaskGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TaskGroup to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TaskGroup - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace TaskGroup { - - /** SchedulingPolicy enum. */ - enum SchedulingPolicy { - SCHEDULING_POLICY_UNSPECIFIED = 0, - AS_SOON_AS_POSSIBLE = 1, - IN_ORDER = 2 - } - } - - /** Properties of a ServiceAccount. */ - interface IServiceAccount { - - /** ServiceAccount email */ - email?: (string|null); - - /** ServiceAccount scopes */ - scopes?: (string[]|null); - } - - /** Represents a ServiceAccount. */ - class ServiceAccount implements IServiceAccount { - - /** - * Constructs a new ServiceAccount. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IServiceAccount); - - /** ServiceAccount email. */ - public email: string; - - /** ServiceAccount scopes. */ - public scopes: string[]; - - /** - * Creates a new ServiceAccount instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceAccount instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IServiceAccount): google.cloud.batch.v1alpha.ServiceAccount; - - /** - * Encodes the specified ServiceAccount message. Does not implicitly {@link google.cloud.batch.v1alpha.ServiceAccount.verify|verify} messages. - * @param message ServiceAccount message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IServiceAccount, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceAccount message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ServiceAccount.verify|verify} messages. - * @param message ServiceAccount message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IServiceAccount, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceAccount message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ServiceAccount; - - /** - * Decodes a ServiceAccount message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ServiceAccount; - - /** - * Verifies a ServiceAccount message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceAccount message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceAccount - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ServiceAccount; - - /** - * Creates a plain object from a ServiceAccount message. Also converts values to other types if specified. - * @param message ServiceAccount - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.ServiceAccount, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceAccount to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceAccount - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ComputeResource. */ - interface IComputeResource { - - /** ComputeResource cpuMilli */ - cpuMilli?: (number|Long|string|null); - - /** ComputeResource memoryMib */ - memoryMib?: (number|Long|string|null); - - /** ComputeResource gpuCount */ - gpuCount?: (number|Long|string|null); - - /** ComputeResource bootDiskMib */ - bootDiskMib?: (number|Long|string|null); - } - - /** Represents a ComputeResource. */ - class ComputeResource implements IComputeResource { - - /** - * Constructs a new ComputeResource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IComputeResource); - - /** ComputeResource cpuMilli. */ - public cpuMilli: (number|Long|string); - - /** ComputeResource memoryMib. */ - public memoryMib: (number|Long|string); - - /** ComputeResource gpuCount. */ - public gpuCount: (number|Long|string); - - /** ComputeResource bootDiskMib. */ - public bootDiskMib: (number|Long|string); - - /** - * Creates a new ComputeResource instance using the specified properties. - * @param [properties] Properties to set - * @returns ComputeResource instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IComputeResource): google.cloud.batch.v1alpha.ComputeResource; - - /** - * Encodes the specified ComputeResource message. Does not implicitly {@link google.cloud.batch.v1alpha.ComputeResource.verify|verify} messages. - * @param message ComputeResource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IComputeResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ComputeResource message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ComputeResource.verify|verify} messages. - * @param message ComputeResource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IComputeResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ComputeResource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ComputeResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ComputeResource; - - /** - * Decodes a ComputeResource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ComputeResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ComputeResource; - - /** - * Verifies a ComputeResource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ComputeResource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ComputeResource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ComputeResource; - - /** - * Creates a plain object from a ComputeResource message. Also converts values to other types if specified. - * @param message ComputeResource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.ComputeResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ComputeResource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ComputeResource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a StatusEvent. */ - interface IStatusEvent { - - /** StatusEvent type */ - type?: (string|null); - - /** StatusEvent description */ - description?: (string|null); - - /** StatusEvent eventTime */ - eventTime?: (google.protobuf.ITimestamp|null); - - /** StatusEvent taskExecution */ - taskExecution?: (google.cloud.batch.v1alpha.ITaskExecution|null); - - /** StatusEvent taskState */ - taskState?: (google.cloud.batch.v1alpha.TaskStatus.State|keyof typeof google.cloud.batch.v1alpha.TaskStatus.State|null); - } - - /** Represents a StatusEvent. */ - class StatusEvent implements IStatusEvent { - - /** - * Constructs a new StatusEvent. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IStatusEvent); - - /** StatusEvent type. */ - public type: string; - - /** StatusEvent description. */ - public description: string; - - /** StatusEvent eventTime. */ - public eventTime?: (google.protobuf.ITimestamp|null); - - /** StatusEvent taskExecution. */ - public taskExecution?: (google.cloud.batch.v1alpha.ITaskExecution|null); - - /** StatusEvent taskState. */ - public taskState: (google.cloud.batch.v1alpha.TaskStatus.State|keyof typeof google.cloud.batch.v1alpha.TaskStatus.State); - - /** - * Creates a new StatusEvent instance using the specified properties. - * @param [properties] Properties to set - * @returns StatusEvent instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IStatusEvent): google.cloud.batch.v1alpha.StatusEvent; - - /** - * Encodes the specified StatusEvent message. Does not implicitly {@link google.cloud.batch.v1alpha.StatusEvent.verify|verify} messages. - * @param message StatusEvent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IStatusEvent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StatusEvent message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.StatusEvent.verify|verify} messages. - * @param message StatusEvent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IStatusEvent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StatusEvent message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StatusEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.StatusEvent; - - /** - * Decodes a StatusEvent message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StatusEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.StatusEvent; - - /** - * Verifies a StatusEvent message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StatusEvent message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StatusEvent - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.StatusEvent; - - /** - * Creates a plain object from a StatusEvent message. Also converts values to other types if specified. - * @param message StatusEvent - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.StatusEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StatusEvent to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StatusEvent - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TaskExecution. */ - interface ITaskExecution { - - /** TaskExecution exitCode */ - exitCode?: (number|null); - - /** TaskExecution stderrSnippet */ - stderrSnippet?: (string|null); - } - - /** Represents a TaskExecution. */ - class TaskExecution implements ITaskExecution { - - /** - * Constructs a new TaskExecution. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.ITaskExecution); - - /** TaskExecution exitCode. */ - public exitCode: number; - - /** TaskExecution stderrSnippet. */ - public stderrSnippet: string; - - /** - * Creates a new TaskExecution instance using the specified properties. - * @param [properties] Properties to set - * @returns TaskExecution instance - */ - public static create(properties?: google.cloud.batch.v1alpha.ITaskExecution): google.cloud.batch.v1alpha.TaskExecution; - - /** - * Encodes the specified TaskExecution message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskExecution.verify|verify} messages. - * @param message TaskExecution message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.ITaskExecution, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TaskExecution message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskExecution.verify|verify} messages. - * @param message TaskExecution message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.ITaskExecution, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TaskExecution message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TaskExecution - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.TaskExecution; - - /** - * Decodes a TaskExecution message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TaskExecution - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.TaskExecution; - - /** - * Verifies a TaskExecution message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TaskExecution message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TaskExecution - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.TaskExecution; - - /** - * Creates a plain object from a TaskExecution message. Also converts values to other types if specified. - * @param message TaskExecution - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.TaskExecution, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TaskExecution to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TaskExecution - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TaskStatus. */ - interface ITaskStatus { - - /** TaskStatus state */ - state?: (google.cloud.batch.v1alpha.TaskStatus.State|keyof typeof google.cloud.batch.v1alpha.TaskStatus.State|null); - - /** TaskStatus statusEvents */ - statusEvents?: (google.cloud.batch.v1alpha.IStatusEvent[]|null); - - /** TaskStatus resourceUsage */ - resourceUsage?: (google.cloud.batch.v1alpha.ITaskResourceUsage|null); - } - - /** Represents a TaskStatus. */ - class TaskStatus implements ITaskStatus { - - /** - * Constructs a new TaskStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.ITaskStatus); - - /** TaskStatus state. */ - public state: (google.cloud.batch.v1alpha.TaskStatus.State|keyof typeof google.cloud.batch.v1alpha.TaskStatus.State); - - /** TaskStatus statusEvents. */ - public statusEvents: google.cloud.batch.v1alpha.IStatusEvent[]; - - /** TaskStatus resourceUsage. */ - public resourceUsage?: (google.cloud.batch.v1alpha.ITaskResourceUsage|null); - - /** - * Creates a new TaskStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns TaskStatus instance - */ - public static create(properties?: google.cloud.batch.v1alpha.ITaskStatus): google.cloud.batch.v1alpha.TaskStatus; - - /** - * Encodes the specified TaskStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskStatus.verify|verify} messages. - * @param message TaskStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.ITaskStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TaskStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskStatus.verify|verify} messages. - * @param message TaskStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.ITaskStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TaskStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TaskStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.TaskStatus; - - /** - * Decodes a TaskStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TaskStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.TaskStatus; - - /** - * Verifies a TaskStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TaskStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TaskStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.TaskStatus; - - /** - * Creates a plain object from a TaskStatus message. Also converts values to other types if specified. - * @param message TaskStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.TaskStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TaskStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TaskStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace TaskStatus { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - PENDING = 1, - ASSIGNED = 2, - RUNNING = 3, - FAILED = 4, - SUCCEEDED = 5, - UNEXECUTED = 6 - } - } - - /** Properties of a TaskResourceUsage. */ - interface ITaskResourceUsage { - - /** TaskResourceUsage coreHours */ - coreHours?: (number|null); - } - - /** Represents a TaskResourceUsage. */ - class TaskResourceUsage implements ITaskResourceUsage { - - /** - * Constructs a new TaskResourceUsage. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.ITaskResourceUsage); - - /** TaskResourceUsage coreHours. */ - public coreHours: number; - - /** - * Creates a new TaskResourceUsage instance using the specified properties. - * @param [properties] Properties to set - * @returns TaskResourceUsage instance - */ - public static create(properties?: google.cloud.batch.v1alpha.ITaskResourceUsage): google.cloud.batch.v1alpha.TaskResourceUsage; - - /** - * Encodes the specified TaskResourceUsage message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskResourceUsage.verify|verify} messages. - * @param message TaskResourceUsage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.ITaskResourceUsage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TaskResourceUsage message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskResourceUsage.verify|verify} messages. - * @param message TaskResourceUsage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.ITaskResourceUsage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TaskResourceUsage message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TaskResourceUsage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.TaskResourceUsage; - - /** - * Decodes a TaskResourceUsage message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TaskResourceUsage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.TaskResourceUsage; - - /** - * Verifies a TaskResourceUsage message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TaskResourceUsage message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TaskResourceUsage - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.TaskResourceUsage; - - /** - * Creates a plain object from a TaskResourceUsage message. Also converts values to other types if specified. - * @param message TaskResourceUsage - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.TaskResourceUsage, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TaskResourceUsage to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TaskResourceUsage - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Runnable. */ - interface IRunnable { - - /** Runnable container */ - container?: (google.cloud.batch.v1alpha.Runnable.IContainer|null); - - /** Runnable script */ - script?: (google.cloud.batch.v1alpha.Runnable.IScript|null); - - /** Runnable barrier */ - barrier?: (google.cloud.batch.v1alpha.Runnable.IBarrier|null); - - /** Runnable displayName */ - displayName?: (string|null); - - /** Runnable ignoreExitStatus */ - ignoreExitStatus?: (boolean|null); - - /** Runnable background */ - background?: (boolean|null); - - /** Runnable alwaysRun */ - alwaysRun?: (boolean|null); - - /** Runnable environment */ - environment?: (google.cloud.batch.v1alpha.IEnvironment|null); - - /** Runnable timeout */ - timeout?: (google.protobuf.IDuration|null); - - /** Runnable labels */ - labels?: ({ [k: string]: string }|null); - } - - /** Represents a Runnable. */ - class Runnable implements IRunnable { - - /** - * Constructs a new Runnable. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IRunnable); - - /** Runnable container. */ - public container?: (google.cloud.batch.v1alpha.Runnable.IContainer|null); - - /** Runnable script. */ - public script?: (google.cloud.batch.v1alpha.Runnable.IScript|null); - - /** Runnable barrier. */ - public barrier?: (google.cloud.batch.v1alpha.Runnable.IBarrier|null); - - /** Runnable displayName. */ - public displayName: string; - - /** Runnable ignoreExitStatus. */ - public ignoreExitStatus: boolean; - - /** Runnable background. */ - public background: boolean; - - /** Runnable alwaysRun. */ - public alwaysRun: boolean; - - /** Runnable environment. */ - public environment?: (google.cloud.batch.v1alpha.IEnvironment|null); - - /** Runnable timeout. */ - public timeout?: (google.protobuf.IDuration|null); - - /** Runnable labels. */ - public labels: { [k: string]: string }; - - /** Runnable executable. */ - public executable?: ("container"|"script"|"barrier"); - - /** - * Creates a new Runnable instance using the specified properties. - * @param [properties] Properties to set - * @returns Runnable instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IRunnable): google.cloud.batch.v1alpha.Runnable; - - /** - * Encodes the specified Runnable message. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.verify|verify} messages. - * @param message Runnable message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IRunnable, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Runnable message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.verify|verify} messages. - * @param message Runnable message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IRunnable, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Runnable message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Runnable - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Runnable; - - /** - * Decodes a Runnable message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Runnable - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Runnable; - - /** - * Verifies a Runnable message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Runnable message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Runnable - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Runnable; - - /** - * Creates a plain object from a Runnable message. Also converts values to other types if specified. - * @param message Runnable - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.Runnable, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Runnable to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Runnable - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Runnable { - - /** Properties of a Container. */ - interface IContainer { - - /** Container imageUri */ - imageUri?: (string|null); - - /** Container commands */ - commands?: (string[]|null); - - /** Container entrypoint */ - entrypoint?: (string|null); - - /** Container volumes */ - volumes?: (string[]|null); - - /** Container options */ - options?: (string|null); - - /** Container blockExternalNetwork */ - blockExternalNetwork?: (boolean|null); - - /** Container username */ - username?: (string|null); - - /** Container password */ - password?: (string|null); - - /** Container enableImageStreaming */ - enableImageStreaming?: (boolean|null); - } - - /** Represents a Container. */ - class Container implements IContainer { - - /** - * Constructs a new Container. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.Runnable.IContainer); - - /** Container imageUri. */ - public imageUri: string; - - /** Container commands. */ - public commands: string[]; - - /** Container entrypoint. */ - public entrypoint: string; - - /** Container volumes. */ - public volumes: string[]; - - /** Container options. */ - public options: string; - - /** Container blockExternalNetwork. */ - public blockExternalNetwork: boolean; - - /** Container username. */ - public username: string; - - /** Container password. */ - public password: string; - - /** Container enableImageStreaming. */ - public enableImageStreaming: boolean; - - /** - * Creates a new Container instance using the specified properties. - * @param [properties] Properties to set - * @returns Container instance - */ - public static create(properties?: google.cloud.batch.v1alpha.Runnable.IContainer): google.cloud.batch.v1alpha.Runnable.Container; - - /** - * Encodes the specified Container message. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Container.verify|verify} messages. - * @param message Container message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.Runnable.IContainer, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Container message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Container.verify|verify} messages. - * @param message Container message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.Runnable.IContainer, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Container message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Container - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Runnable.Container; - - /** - * Decodes a Container message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Container - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Runnable.Container; - - /** - * Verifies a Container message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Container message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Container - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Runnable.Container; - - /** - * Creates a plain object from a Container message. Also converts values to other types if specified. - * @param message Container - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.Runnable.Container, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Container to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Container - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Script. */ - interface IScript { - - /** Script path */ - path?: (string|null); - - /** Script text */ - text?: (string|null); - } - - /** Represents a Script. */ - class Script implements IScript { - - /** - * Constructs a new Script. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.Runnable.IScript); - - /** Script path. */ - public path?: (string|null); - - /** Script text. */ - public text?: (string|null); - - /** Script command. */ - public command?: ("path"|"text"); - - /** - * Creates a new Script instance using the specified properties. - * @param [properties] Properties to set - * @returns Script instance - */ - public static create(properties?: google.cloud.batch.v1alpha.Runnable.IScript): google.cloud.batch.v1alpha.Runnable.Script; - - /** - * Encodes the specified Script message. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Script.verify|verify} messages. - * @param message Script message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.Runnable.IScript, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Script message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Script.verify|verify} messages. - * @param message Script message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.Runnable.IScript, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Script message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Script - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Runnable.Script; - - /** - * Decodes a Script message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Script - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Runnable.Script; - - /** - * Verifies a Script message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Script message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Script - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Runnable.Script; - - /** - * Creates a plain object from a Script message. Also converts values to other types if specified. - * @param message Script - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.Runnable.Script, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Script to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Script - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Barrier. */ - interface IBarrier { - - /** Barrier name */ - name?: (string|null); - } - - /** Represents a Barrier. */ - class Barrier implements IBarrier { - - /** - * Constructs a new Barrier. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.Runnable.IBarrier); - - /** Barrier name. */ - public name: string; - - /** - * Creates a new Barrier instance using the specified properties. - * @param [properties] Properties to set - * @returns Barrier instance - */ - public static create(properties?: google.cloud.batch.v1alpha.Runnable.IBarrier): google.cloud.batch.v1alpha.Runnable.Barrier; - - /** - * Encodes the specified Barrier message. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Barrier.verify|verify} messages. - * @param message Barrier message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.Runnable.IBarrier, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Barrier message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Barrier.verify|verify} messages. - * @param message Barrier message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.Runnable.IBarrier, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Barrier message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Barrier - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Runnable.Barrier; - - /** - * Decodes a Barrier message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Barrier - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Runnable.Barrier; - - /** - * Verifies a Barrier message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Barrier message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Barrier - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Runnable.Barrier; - - /** - * Creates a plain object from a Barrier message. Also converts values to other types if specified. - * @param message Barrier - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.Runnable.Barrier, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Barrier to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Barrier - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a TaskSpec. */ - interface ITaskSpec { - - /** TaskSpec runnables */ - runnables?: (google.cloud.batch.v1alpha.IRunnable[]|null); - - /** TaskSpec computeResource */ - computeResource?: (google.cloud.batch.v1alpha.IComputeResource|null); - - /** TaskSpec maxRunDuration */ - maxRunDuration?: (google.protobuf.IDuration|null); - - /** TaskSpec maxRetryCount */ - maxRetryCount?: (number|null); - - /** TaskSpec lifecyclePolicies */ - lifecyclePolicies?: (google.cloud.batch.v1alpha.ILifecyclePolicy[]|null); - - /** TaskSpec environments */ - environments?: ({ [k: string]: string }|null); - - /** TaskSpec volumes */ - volumes?: (google.cloud.batch.v1alpha.IVolume[]|null); - - /** TaskSpec environment */ - environment?: (google.cloud.batch.v1alpha.IEnvironment|null); - } - - /** Represents a TaskSpec. */ - class TaskSpec implements ITaskSpec { - - /** - * Constructs a new TaskSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.ITaskSpec); - - /** TaskSpec runnables. */ - public runnables: google.cloud.batch.v1alpha.IRunnable[]; - - /** TaskSpec computeResource. */ - public computeResource?: (google.cloud.batch.v1alpha.IComputeResource|null); - - /** TaskSpec maxRunDuration. */ - public maxRunDuration?: (google.protobuf.IDuration|null); - - /** TaskSpec maxRetryCount. */ - public maxRetryCount: number; - - /** TaskSpec lifecyclePolicies. */ - public lifecyclePolicies: google.cloud.batch.v1alpha.ILifecyclePolicy[]; - - /** TaskSpec environments. */ - public environments: { [k: string]: string }; - - /** TaskSpec volumes. */ - public volumes: google.cloud.batch.v1alpha.IVolume[]; - - /** TaskSpec environment. */ - public environment?: (google.cloud.batch.v1alpha.IEnvironment|null); - - /** - * Creates a new TaskSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns TaskSpec instance - */ - public static create(properties?: google.cloud.batch.v1alpha.ITaskSpec): google.cloud.batch.v1alpha.TaskSpec; - - /** - * Encodes the specified TaskSpec message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskSpec.verify|verify} messages. - * @param message TaskSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.ITaskSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TaskSpec message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskSpec.verify|verify} messages. - * @param message TaskSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.ITaskSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TaskSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TaskSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.TaskSpec; - - /** - * Decodes a TaskSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TaskSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.TaskSpec; - - /** - * Verifies a TaskSpec message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TaskSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TaskSpec - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.TaskSpec; - - /** - * Creates a plain object from a TaskSpec message. Also converts values to other types if specified. - * @param message TaskSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.TaskSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TaskSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TaskSpec - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a LifecyclePolicy. */ - interface ILifecyclePolicy { - - /** LifecyclePolicy action */ - action?: (google.cloud.batch.v1alpha.LifecyclePolicy.Action|keyof typeof google.cloud.batch.v1alpha.LifecyclePolicy.Action|null); - - /** LifecyclePolicy actionCondition */ - actionCondition?: (google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition|null); - } - - /** Represents a LifecyclePolicy. */ - class LifecyclePolicy implements ILifecyclePolicy { - - /** - * Constructs a new LifecyclePolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.ILifecyclePolicy); - - /** LifecyclePolicy action. */ - public action: (google.cloud.batch.v1alpha.LifecyclePolicy.Action|keyof typeof google.cloud.batch.v1alpha.LifecyclePolicy.Action); - - /** LifecyclePolicy actionCondition. */ - public actionCondition?: (google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition|null); - - /** - * Creates a new LifecyclePolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns LifecyclePolicy instance - */ - public static create(properties?: google.cloud.batch.v1alpha.ILifecyclePolicy): google.cloud.batch.v1alpha.LifecyclePolicy; - - /** - * Encodes the specified LifecyclePolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.LifecyclePolicy.verify|verify} messages. - * @param message LifecyclePolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.ILifecyclePolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LifecyclePolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.LifecyclePolicy.verify|verify} messages. - * @param message LifecyclePolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.ILifecyclePolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LifecyclePolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LifecyclePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.LifecyclePolicy; - - /** - * Decodes a LifecyclePolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LifecyclePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.LifecyclePolicy; - - /** - * Verifies a LifecyclePolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LifecyclePolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LifecyclePolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.LifecyclePolicy; - - /** - * Creates a plain object from a LifecyclePolicy message. Also converts values to other types if specified. - * @param message LifecyclePolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.LifecyclePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LifecyclePolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LifecyclePolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace LifecyclePolicy { - - /** Properties of an ActionCondition. */ - interface IActionCondition { - - /** ActionCondition exitCodes */ - exitCodes?: (number[]|null); - } - - /** Represents an ActionCondition. */ - class ActionCondition implements IActionCondition { - - /** - * Constructs a new ActionCondition. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition); - - /** ActionCondition exitCodes. */ - public exitCodes: number[]; - - /** - * Creates a new ActionCondition instance using the specified properties. - * @param [properties] Properties to set - * @returns ActionCondition instance - */ - public static create(properties?: google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition): google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition; - - /** - * Encodes the specified ActionCondition message. Does not implicitly {@link google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.verify|verify} messages. - * @param message ActionCondition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ActionCondition message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.verify|verify} messages. - * @param message ActionCondition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ActionCondition message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ActionCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition; - - /** - * Decodes an ActionCondition message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ActionCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition; - - /** - * Verifies an ActionCondition message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ActionCondition message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ActionCondition - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition; - - /** - * Creates a plain object from an ActionCondition message. Also converts values to other types if specified. - * @param message ActionCondition - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ActionCondition to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ActionCondition - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Action enum. */ - enum Action { - ACTION_UNSPECIFIED = 0, - RETRY_TASK = 1, - FAIL_TASK = 2 - } - } - - /** Properties of a Task. */ - interface ITask { - - /** Task name */ - name?: (string|null); - - /** Task status */ - status?: (google.cloud.batch.v1alpha.ITaskStatus|null); - } - - /** Represents a Task. */ - class Task implements ITask { - - /** - * Constructs a new Task. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.ITask); - - /** Task name. */ - public name: string; - - /** Task status. */ - public status?: (google.cloud.batch.v1alpha.ITaskStatus|null); - - /** - * Creates a new Task instance using the specified properties. - * @param [properties] Properties to set - * @returns Task instance - */ - public static create(properties?: google.cloud.batch.v1alpha.ITask): google.cloud.batch.v1alpha.Task; - - /** - * Encodes the specified Task message. Does not implicitly {@link google.cloud.batch.v1alpha.Task.verify|verify} messages. - * @param message Task message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.ITask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Task message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Task.verify|verify} messages. - * @param message Task message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.ITask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Task message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Task - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Task; - - /** - * Decodes a Task message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Task - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Task; - - /** - * Verifies a Task message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Task message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Task - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Task; - - /** - * Creates a plain object from a Task message. Also converts values to other types if specified. - * @param message Task - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.Task, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Task to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Task - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Environment. */ - interface IEnvironment { - - /** Environment variables */ - variables?: ({ [k: string]: string }|null); - - /** Environment secretVariables */ - secretVariables?: ({ [k: string]: string }|null); - - /** Environment encryptedVariables */ - encryptedVariables?: (google.cloud.batch.v1alpha.Environment.IKMSEnvMap|null); - } - - /** Represents an Environment. */ - class Environment implements IEnvironment { - - /** - * Constructs a new Environment. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IEnvironment); - - /** Environment variables. */ - public variables: { [k: string]: string }; - - /** Environment secretVariables. */ - public secretVariables: { [k: string]: string }; - - /** Environment encryptedVariables. */ - public encryptedVariables?: (google.cloud.batch.v1alpha.Environment.IKMSEnvMap|null); - - /** - * Creates a new Environment instance using the specified properties. - * @param [properties] Properties to set - * @returns Environment instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IEnvironment): google.cloud.batch.v1alpha.Environment; - - /** - * Encodes the specified Environment message. Does not implicitly {@link google.cloud.batch.v1alpha.Environment.verify|verify} messages. - * @param message Environment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Environment.verify|verify} messages. - * @param message Environment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Environment message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Environment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Environment; - - /** - * Decodes an Environment message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Environment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Environment; - - /** - * Verifies an Environment message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Environment message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Environment - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Environment; - - /** - * Creates a plain object from an Environment message. Also converts values to other types if specified. - * @param message Environment - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.Environment, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Environment to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Environment - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Environment { - - /** Properties of a KMSEnvMap. */ - interface IKMSEnvMap { - - /** KMSEnvMap keyName */ - keyName?: (string|null); - - /** KMSEnvMap cipherText */ - cipherText?: (string|null); - } - - /** Represents a KMSEnvMap. */ - class KMSEnvMap implements IKMSEnvMap { - - /** - * Constructs a new KMSEnvMap. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.Environment.IKMSEnvMap); - - /** KMSEnvMap keyName. */ - public keyName: string; - - /** KMSEnvMap cipherText. */ - public cipherText: string; - - /** - * Creates a new KMSEnvMap instance using the specified properties. - * @param [properties] Properties to set - * @returns KMSEnvMap instance - */ - public static create(properties?: google.cloud.batch.v1alpha.Environment.IKMSEnvMap): google.cloud.batch.v1alpha.Environment.KMSEnvMap; - - /** - * Encodes the specified KMSEnvMap message. Does not implicitly {@link google.cloud.batch.v1alpha.Environment.KMSEnvMap.verify|verify} messages. - * @param message KMSEnvMap message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.Environment.IKMSEnvMap, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified KMSEnvMap message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Environment.KMSEnvMap.verify|verify} messages. - * @param message KMSEnvMap message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.Environment.IKMSEnvMap, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a KMSEnvMap message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns KMSEnvMap - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Environment.KMSEnvMap; - - /** - * Decodes a KMSEnvMap message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns KMSEnvMap - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Environment.KMSEnvMap; - - /** - * Verifies a KMSEnvMap message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a KMSEnvMap message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns KMSEnvMap - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Environment.KMSEnvMap; - - /** - * Creates a plain object from a KMSEnvMap message. Also converts values to other types if specified. - * @param message KMSEnvMap - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.Environment.KMSEnvMap, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this KMSEnvMap to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for KMSEnvMap - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a Volume. */ - interface IVolume { - - /** Volume nfs */ - nfs?: (google.cloud.batch.v1alpha.INFS|null); - - /** Volume pd */ - pd?: (google.cloud.batch.v1alpha.IPD|null); - - /** Volume gcs */ - gcs?: (google.cloud.batch.v1alpha.IGCS|null); - - /** Volume deviceName */ - deviceName?: (string|null); - - /** Volume mountPath */ - mountPath?: (string|null); - - /** Volume mountOptions */ - mountOptions?: (string[]|null); - } - - /** Represents a Volume. */ - class Volume implements IVolume { - - /** - * Constructs a new Volume. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IVolume); - - /** Volume nfs. */ - public nfs?: (google.cloud.batch.v1alpha.INFS|null); - - /** Volume pd. */ - public pd?: (google.cloud.batch.v1alpha.IPD|null); - - /** Volume gcs. */ - public gcs?: (google.cloud.batch.v1alpha.IGCS|null); - - /** Volume deviceName. */ - public deviceName?: (string|null); - - /** Volume mountPath. */ - public mountPath: string; - - /** Volume mountOptions. */ - public mountOptions: string[]; - - /** Volume source. */ - public source?: ("nfs"|"pd"|"gcs"|"deviceName"); - - /** - * Creates a new Volume instance using the specified properties. - * @param [properties] Properties to set - * @returns Volume instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IVolume): google.cloud.batch.v1alpha.Volume; - - /** - * Encodes the specified Volume message. Does not implicitly {@link google.cloud.batch.v1alpha.Volume.verify|verify} messages. - * @param message Volume message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IVolume, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Volume message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Volume.verify|verify} messages. - * @param message Volume message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IVolume, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Volume message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Volume - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Volume; - - /** - * Decodes a Volume message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Volume - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Volume; - - /** - * Verifies a Volume message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Volume message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Volume - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Volume; - - /** - * Creates a plain object from a Volume message. Also converts values to other types if specified. - * @param message Volume - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.Volume, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Volume to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Volume - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a NFS. */ - interface INFS { - - /** NFS server */ - server?: (string|null); - - /** NFS remotePath */ - remotePath?: (string|null); - } - - /** Represents a NFS. */ - class NFS implements INFS { - - /** - * Constructs a new NFS. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.INFS); - - /** NFS server. */ - public server: string; - - /** NFS remotePath. */ - public remotePath: string; - - /** - * Creates a new NFS instance using the specified properties. - * @param [properties] Properties to set - * @returns NFS instance - */ - public static create(properties?: google.cloud.batch.v1alpha.INFS): google.cloud.batch.v1alpha.NFS; - - /** - * Encodes the specified NFS message. Does not implicitly {@link google.cloud.batch.v1alpha.NFS.verify|verify} messages. - * @param message NFS message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.INFS, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NFS message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.NFS.verify|verify} messages. - * @param message NFS message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.INFS, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NFS message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NFS - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.NFS; - - /** - * Decodes a NFS message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NFS - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.NFS; - - /** - * Verifies a NFS message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NFS message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NFS - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.NFS; - - /** - * Creates a plain object from a NFS message. Also converts values to other types if specified. - * @param message NFS - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.NFS, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NFS to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NFS - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PD. */ - interface IPD { - - /** PD disk */ - disk?: (string|null); - - /** PD device */ - device?: (string|null); - - /** PD existing */ - existing?: (boolean|null); - } - - /** Represents a PD. */ - class PD implements IPD { - - /** - * Constructs a new PD. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IPD); - - /** PD disk. */ - public disk: string; - - /** PD device. */ - public device: string; - - /** PD existing. */ - public existing: boolean; - - /** - * Creates a new PD instance using the specified properties. - * @param [properties] Properties to set - * @returns PD instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IPD): google.cloud.batch.v1alpha.PD; - - /** - * Encodes the specified PD message. Does not implicitly {@link google.cloud.batch.v1alpha.PD.verify|verify} messages. - * @param message PD message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IPD, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PD message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.PD.verify|verify} messages. - * @param message PD message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IPD, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PD message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PD - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.PD; - - /** - * Decodes a PD message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PD - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.PD; - - /** - * Verifies a PD message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PD message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PD - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.PD; - - /** - * Creates a plain object from a PD message. Also converts values to other types if specified. - * @param message PD - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.PD, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PD to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PD - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GCS. */ - interface IGCS { - - /** GCS remotePath */ - remotePath?: (string|null); - } - - /** Represents a GCS. */ - class GCS implements IGCS { - - /** - * Constructs a new GCS. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IGCS); - - /** GCS remotePath. */ - public remotePath: string; - - /** - * Creates a new GCS instance using the specified properties. - * @param [properties] Properties to set - * @returns GCS instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IGCS): google.cloud.batch.v1alpha.GCS; - - /** - * Encodes the specified GCS message. Does not implicitly {@link google.cloud.batch.v1alpha.GCS.verify|verify} messages. - * @param message GCS message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IGCS, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GCS message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.GCS.verify|verify} messages. - * @param message GCS message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IGCS, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GCS message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GCS - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.GCS; - - /** - * Decodes a GCS message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GCS - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.GCS; - - /** - * Verifies a GCS message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GCS message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GCS - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.GCS; - - /** - * Creates a plain object from a GCS message. Also converts values to other types if specified. - * @param message GCS - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.GCS, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GCS to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GCS - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** CalendarPeriod enum. */ - enum CalendarPeriod { - CALENDAR_PERIOD_UNSPECIFIED = 0, - MONTH = 1, - QUARTER = 2, - YEAR = 3, - WEEK = 4, - DAY = 5 - } - - /** ResourceAllowanceState enum. */ - enum ResourceAllowanceState { - RESOURCE_ALLOWANCE_STATE_UNSPECIFIED = 0, - RESOURCE_ALLOWANCE_ACTIVE = 1, - RESOURCE_ALLOWANCE_DEPLETED = 2 - } - - /** Properties of a ResourceAllowance. */ - interface IResourceAllowance { - - /** ResourceAllowance usageResourceAllowance */ - usageResourceAllowance?: (google.cloud.batch.v1alpha.IUsageResourceAllowance|null); - - /** ResourceAllowance name */ - name?: (string|null); - - /** ResourceAllowance uid */ - uid?: (string|null); - - /** ResourceAllowance createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** ResourceAllowance labels */ - labels?: ({ [k: string]: string }|null); - - /** ResourceAllowance notifications */ - notifications?: (google.cloud.batch.v1alpha.INotification[]|null); - } - - /** Represents a ResourceAllowance. */ - class ResourceAllowance implements IResourceAllowance { - - /** - * Constructs a new ResourceAllowance. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IResourceAllowance); - - /** ResourceAllowance usageResourceAllowance. */ - public usageResourceAllowance?: (google.cloud.batch.v1alpha.IUsageResourceAllowance|null); - - /** ResourceAllowance name. */ - public name: string; - - /** ResourceAllowance uid. */ - public uid: string; - - /** ResourceAllowance createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** ResourceAllowance labels. */ - public labels: { [k: string]: string }; - - /** ResourceAllowance notifications. */ - public notifications: google.cloud.batch.v1alpha.INotification[]; - - /** ResourceAllowance resourceAllowance. */ - public resourceAllowance?: "usageResourceAllowance"; - - /** - * Creates a new ResourceAllowance instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceAllowance instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IResourceAllowance): google.cloud.batch.v1alpha.ResourceAllowance; - - /** - * Encodes the specified ResourceAllowance message. Does not implicitly {@link google.cloud.batch.v1alpha.ResourceAllowance.verify|verify} messages. - * @param message ResourceAllowance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IResourceAllowance, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceAllowance message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ResourceAllowance.verify|verify} messages. - * @param message ResourceAllowance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IResourceAllowance, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceAllowance message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceAllowance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ResourceAllowance; - - /** - * Decodes a ResourceAllowance message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceAllowance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ResourceAllowance; - - /** - * Verifies a ResourceAllowance message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceAllowance message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceAllowance - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ResourceAllowance; - - /** - * Creates a plain object from a ResourceAllowance message. Also converts values to other types if specified. - * @param message ResourceAllowance - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.ResourceAllowance, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceAllowance to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceAllowance - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a UsageResourceAllowance. */ - interface IUsageResourceAllowance { - - /** UsageResourceAllowance spec */ - spec?: (google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec|null); - - /** UsageResourceAllowance status */ - status?: (google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus|null); - } - - /** Represents a UsageResourceAllowance. */ - class UsageResourceAllowance implements IUsageResourceAllowance { - - /** - * Constructs a new UsageResourceAllowance. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IUsageResourceAllowance); - - /** UsageResourceAllowance spec. */ - public spec?: (google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec|null); - - /** UsageResourceAllowance status. */ - public status?: (google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus|null); - - /** - * Creates a new UsageResourceAllowance instance using the specified properties. - * @param [properties] Properties to set - * @returns UsageResourceAllowance instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IUsageResourceAllowance): google.cloud.batch.v1alpha.UsageResourceAllowance; - - /** - * Encodes the specified UsageResourceAllowance message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowance.verify|verify} messages. - * @param message UsageResourceAllowance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IUsageResourceAllowance, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UsageResourceAllowance message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowance.verify|verify} messages. - * @param message UsageResourceAllowance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IUsageResourceAllowance, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a UsageResourceAllowance message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UsageResourceAllowance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.UsageResourceAllowance; - - /** - * Decodes a UsageResourceAllowance message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UsageResourceAllowance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.UsageResourceAllowance; - - /** - * Verifies a UsageResourceAllowance message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a UsageResourceAllowance message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UsageResourceAllowance - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.UsageResourceAllowance; - - /** - * Creates a plain object from a UsageResourceAllowance message. Also converts values to other types if specified. - * @param message UsageResourceAllowance - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.UsageResourceAllowance, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UsageResourceAllowance to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UsageResourceAllowance - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a UsageResourceAllowanceSpec. */ - interface IUsageResourceAllowanceSpec { - - /** UsageResourceAllowanceSpec type */ - type?: (string|null); - - /** UsageResourceAllowanceSpec limit */ - limit?: (google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit|null); - } - - /** Represents a UsageResourceAllowanceSpec. */ - class UsageResourceAllowanceSpec implements IUsageResourceAllowanceSpec { - - /** - * Constructs a new UsageResourceAllowanceSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec); - - /** UsageResourceAllowanceSpec type. */ - public type: string; - - /** UsageResourceAllowanceSpec limit. */ - public limit?: (google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit|null); - - /** - * Creates a new UsageResourceAllowanceSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns UsageResourceAllowanceSpec instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec): google.cloud.batch.v1alpha.UsageResourceAllowanceSpec; - - /** - * Encodes the specified UsageResourceAllowanceSpec message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.verify|verify} messages. - * @param message UsageResourceAllowanceSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UsageResourceAllowanceSpec message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.verify|verify} messages. - * @param message UsageResourceAllowanceSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a UsageResourceAllowanceSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UsageResourceAllowanceSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.UsageResourceAllowanceSpec; - - /** - * Decodes a UsageResourceAllowanceSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UsageResourceAllowanceSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.UsageResourceAllowanceSpec; - - /** - * Verifies a UsageResourceAllowanceSpec message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a UsageResourceAllowanceSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UsageResourceAllowanceSpec - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.UsageResourceAllowanceSpec; - - /** - * Creates a plain object from a UsageResourceAllowanceSpec message. Also converts values to other types if specified. - * @param message UsageResourceAllowanceSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.UsageResourceAllowanceSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UsageResourceAllowanceSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UsageResourceAllowanceSpec - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace UsageResourceAllowanceSpec { - - /** Properties of a Limit. */ - interface ILimit { - - /** Limit calendarPeriod */ - calendarPeriod?: (google.cloud.batch.v1alpha.CalendarPeriod|keyof typeof google.cloud.batch.v1alpha.CalendarPeriod|null); - - /** Limit limit */ - limit?: (number|null); - } - - /** Represents a Limit. */ - class Limit implements ILimit { - - /** - * Constructs a new Limit. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit); - - /** Limit calendarPeriod. */ - public calendarPeriod?: (google.cloud.batch.v1alpha.CalendarPeriod|keyof typeof google.cloud.batch.v1alpha.CalendarPeriod|null); - - /** Limit limit. */ - public limit?: (number|null); - - /** Limit duration. */ - public duration?: "calendarPeriod"; - - /** Limit _limit. */ - public _limit?: "limit"; - - /** - * Creates a new Limit instance using the specified properties. - * @param [properties] Properties to set - * @returns Limit instance - */ - public static create(properties?: google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit): google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit; - - /** - * Encodes the specified Limit message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit.verify|verify} messages. - * @param message Limit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Limit message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit.verify|verify} messages. - * @param message Limit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Limit message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Limit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit; - - /** - * Decodes a Limit message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Limit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit; - - /** - * Verifies a Limit message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Limit message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Limit - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit; - - /** - * Creates a plain object from a Limit message. Also converts values to other types if specified. - * @param message Limit - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Limit to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Limit - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a UsageResourceAllowanceStatus. */ - interface IUsageResourceAllowanceStatus { - - /** UsageResourceAllowanceStatus state */ - state?: (google.cloud.batch.v1alpha.ResourceAllowanceState|keyof typeof google.cloud.batch.v1alpha.ResourceAllowanceState|null); - - /** UsageResourceAllowanceStatus limitStatus */ - limitStatus?: (google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus|null); - - /** UsageResourceAllowanceStatus report */ - report?: (google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport|null); - } - - /** Represents a UsageResourceAllowanceStatus. */ - class UsageResourceAllowanceStatus implements IUsageResourceAllowanceStatus { - - /** - * Constructs a new UsageResourceAllowanceStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus); - - /** UsageResourceAllowanceStatus state. */ - public state: (google.cloud.batch.v1alpha.ResourceAllowanceState|keyof typeof google.cloud.batch.v1alpha.ResourceAllowanceState); - - /** UsageResourceAllowanceStatus limitStatus. */ - public limitStatus?: (google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus|null); - - /** UsageResourceAllowanceStatus report. */ - public report?: (google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport|null); - - /** - * Creates a new UsageResourceAllowanceStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns UsageResourceAllowanceStatus instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus; - - /** - * Encodes the specified UsageResourceAllowanceStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.verify|verify} messages. - * @param message UsageResourceAllowanceStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UsageResourceAllowanceStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.verify|verify} messages. - * @param message UsageResourceAllowanceStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a UsageResourceAllowanceStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UsageResourceAllowanceStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus; - - /** - * Decodes a UsageResourceAllowanceStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UsageResourceAllowanceStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus; - - /** - * Verifies a UsageResourceAllowanceStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a UsageResourceAllowanceStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UsageResourceAllowanceStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus; - - /** - * Creates a plain object from a UsageResourceAllowanceStatus message. Also converts values to other types if specified. - * @param message UsageResourceAllowanceStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UsageResourceAllowanceStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UsageResourceAllowanceStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace UsageResourceAllowanceStatus { - - /** Properties of a LimitStatus. */ - interface ILimitStatus { - - /** LimitStatus consumptionInterval */ - consumptionInterval?: (google.type.IInterval|null); - - /** LimitStatus limit */ - limit?: (number|null); - - /** LimitStatus consumed */ - consumed?: (number|null); - } - - /** Represents a LimitStatus. */ - class LimitStatus implements ILimitStatus { - - /** - * Constructs a new LimitStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus); - - /** LimitStatus consumptionInterval. */ - public consumptionInterval?: (google.type.IInterval|null); - - /** LimitStatus limit. */ - public limit?: (number|null); - - /** LimitStatus consumed. */ - public consumed?: (number|null); - - /** LimitStatus _limit. */ - public _limit?: "limit"; - - /** LimitStatus _consumed. */ - public _consumed?: "consumed"; - - /** - * Creates a new LimitStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns LimitStatus instance - */ - public static create(properties?: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus; - - /** - * Encodes the specified LimitStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.verify|verify} messages. - * @param message LimitStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LimitStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.verify|verify} messages. - * @param message LimitStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LimitStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LimitStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus; - - /** - * Decodes a LimitStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LimitStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus; - - /** - * Verifies a LimitStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LimitStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LimitStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus; - - /** - * Creates a plain object from a LimitStatus message. Also converts values to other types if specified. - * @param message LimitStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LimitStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LimitStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PeriodConsumption. */ - interface IPeriodConsumption { - - /** PeriodConsumption consumptionInterval */ - consumptionInterval?: (google.type.IInterval|null); - - /** PeriodConsumption consumed */ - consumed?: (number|null); - } - - /** Represents a PeriodConsumption. */ - class PeriodConsumption implements IPeriodConsumption { - - /** - * Constructs a new PeriodConsumption. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption); - - /** PeriodConsumption consumptionInterval. */ - public consumptionInterval?: (google.type.IInterval|null); - - /** PeriodConsumption consumed. */ - public consumed?: (number|null); - - /** PeriodConsumption _consumed. */ - public _consumed?: "consumed"; - - /** - * Creates a new PeriodConsumption instance using the specified properties. - * @param [properties] Properties to set - * @returns PeriodConsumption instance - */ - public static create(properties?: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption; - - /** - * Encodes the specified PeriodConsumption message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.verify|verify} messages. - * @param message PeriodConsumption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PeriodConsumption message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.verify|verify} messages. - * @param message PeriodConsumption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PeriodConsumption message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PeriodConsumption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption; - - /** - * Decodes a PeriodConsumption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PeriodConsumption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption; - - /** - * Verifies a PeriodConsumption message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PeriodConsumption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PeriodConsumption - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption; - - /** - * Creates a plain object from a PeriodConsumption message. Also converts values to other types if specified. - * @param message PeriodConsumption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PeriodConsumption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PeriodConsumption - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ConsumptionReport. */ - interface IConsumptionReport { - - /** ConsumptionReport latestPeriodConsumptions */ - latestPeriodConsumptions?: ({ [k: string]: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption }|null); - } - - /** Represents a ConsumptionReport. */ - class ConsumptionReport implements IConsumptionReport { - - /** - * Constructs a new ConsumptionReport. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport); - - /** ConsumptionReport latestPeriodConsumptions. */ - public latestPeriodConsumptions: { [k: string]: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption }; - - /** - * Creates a new ConsumptionReport instance using the specified properties. - * @param [properties] Properties to set - * @returns ConsumptionReport instance - */ - public static create(properties?: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport; - - /** - * Encodes the specified ConsumptionReport message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.verify|verify} messages. - * @param message ConsumptionReport message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ConsumptionReport message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.verify|verify} messages. - * @param message ConsumptionReport message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConsumptionReport message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConsumptionReport - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport; - - /** - * Decodes a ConsumptionReport message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConsumptionReport - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport; - - /** - * Verifies a ConsumptionReport message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ConsumptionReport message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConsumptionReport - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport; - - /** - * Creates a plain object from a ConsumptionReport message. Also converts values to other types if specified. - * @param message ConsumptionReport - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ConsumptionReport to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ConsumptionReport - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a Notification. */ - interface INotification { - - /** Notification pubsubTopic */ - pubsubTopic?: (string|null); - } - - /** Represents a Notification. */ - class Notification implements INotification { - - /** - * Constructs a new Notification. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.INotification); - - /** Notification pubsubTopic. */ - public pubsubTopic: string; - - /** - * Creates a new Notification instance using the specified properties. - * @param [properties] Properties to set - * @returns Notification instance - */ - public static create(properties?: google.cloud.batch.v1alpha.INotification): google.cloud.batch.v1alpha.Notification; - - /** - * Encodes the specified Notification message. Does not implicitly {@link google.cloud.batch.v1alpha.Notification.verify|verify} messages. - * @param message Notification message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.INotification, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Notification message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Notification.verify|verify} messages. - * @param message Notification message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.INotification, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Notification message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Notification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Notification; - - /** - * Decodes a Notification message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Notification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Notification; - - /** - * Verifies a Notification message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Notification message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Notification - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Notification; - - /** - * Creates a plain object from a Notification message. Also converts values to other types if specified. - * @param message Notification - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.Notification, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Notification to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Notification - * @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); - } - - /** Represents a CommonLanguageSettings. */ - class CommonLanguageSettings implements ICommonLanguageSettings { - - /** - * Constructs a new CommonLanguageSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICommonLanguageSettings); - - /** CommonLanguageSettings referenceDocsUri. */ - public referenceDocsUri: string; - - /** CommonLanguageSettings destinations. */ - public destinations: google.api.ClientLibraryDestination[]; - - /** - * Creates a new CommonLanguageSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns CommonLanguageSettings instance - */ - public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; - - /** - * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @param message CommonLanguageSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @param message CommonLanguageSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; - - /** - * Verifies a CommonLanguageSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CommonLanguageSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; - - /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. - * @param message CommonLanguageSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CommonLanguageSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CommonLanguageSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ClientLibrarySettings. */ - interface IClientLibrarySettings { - - /** ClientLibrarySettings version */ - version?: (string|null); - - /** ClientLibrarySettings launchStage */ - launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); - - /** ClientLibrarySettings restNumericEnums */ - restNumericEnums?: (boolean|null); - - /** ClientLibrarySettings javaSettings */ - javaSettings?: (google.api.IJavaSettings|null); - - /** ClientLibrarySettings cppSettings */ - cppSettings?: (google.api.ICppSettings|null); - - /** ClientLibrarySettings phpSettings */ - phpSettings?: (google.api.IPhpSettings|null); - - /** ClientLibrarySettings pythonSettings */ - pythonSettings?: (google.api.IPythonSettings|null); - - /** ClientLibrarySettings nodeSettings */ - nodeSettings?: (google.api.INodeSettings|null); - - /** ClientLibrarySettings dotnetSettings */ - dotnetSettings?: (google.api.IDotnetSettings|null); - - /** ClientLibrarySettings rubySettings */ - rubySettings?: (google.api.IRubySettings|null); - - /** ClientLibrarySettings goSettings */ - goSettings?: (google.api.IGoSettings|null); - } - - /** Represents a ClientLibrarySettings. */ - class ClientLibrarySettings implements IClientLibrarySettings { - - /** - * Constructs a new ClientLibrarySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IClientLibrarySettings); - - /** ClientLibrarySettings version. */ - public version: string; - - /** ClientLibrarySettings launchStage. */ - public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); - - /** ClientLibrarySettings restNumericEnums. */ - public restNumericEnums: boolean; - - /** ClientLibrarySettings javaSettings. */ - public javaSettings?: (google.api.IJavaSettings|null); - - /** ClientLibrarySettings cppSettings. */ - public cppSettings?: (google.api.ICppSettings|null); - - /** ClientLibrarySettings phpSettings. */ - public phpSettings?: (google.api.IPhpSettings|null); - - /** ClientLibrarySettings pythonSettings. */ - public pythonSettings?: (google.api.IPythonSettings|null); - - /** ClientLibrarySettings nodeSettings. */ - public nodeSettings?: (google.api.INodeSettings|null); - - /** ClientLibrarySettings dotnetSettings. */ - public dotnetSettings?: (google.api.IDotnetSettings|null); - - /** ClientLibrarySettings rubySettings. */ - public rubySettings?: (google.api.IRubySettings|null); - - /** ClientLibrarySettings goSettings. */ - public goSettings?: (google.api.IGoSettings|null); - - /** - * Creates a new ClientLibrarySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns ClientLibrarySettings instance - */ - public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; - - /** - * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @param message ClientLibrarySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @param message ClientLibrarySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; - - /** - * Verifies a ClientLibrarySettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClientLibrarySettings - */ - public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; - - /** - * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. - * @param message ClientLibrarySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClientLibrarySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ClientLibrarySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Publishing. */ - interface IPublishing { - - /** Publishing methodSettings */ - methodSettings?: (google.api.IMethodSettings[]|null); - - /** Publishing newIssueUri */ - newIssueUri?: (string|null); - - /** Publishing documentationUri */ - documentationUri?: (string|null); - - /** Publishing apiShortName */ - apiShortName?: (string|null); - - /** Publishing githubLabel */ - githubLabel?: (string|null); - - /** Publishing codeownerGithubTeams */ - codeownerGithubTeams?: (string[]|null); - - /** Publishing docTagPrefix */ - docTagPrefix?: (string|null); - - /** Publishing organization */ - organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); - - /** Publishing librarySettings */ - librarySettings?: (google.api.IClientLibrarySettings[]|null); - - /** Publishing protoReferenceDocumentationUri */ - protoReferenceDocumentationUri?: (string|null); - - /** Publishing restReferenceDocumentationUri */ - restReferenceDocumentationUri?: (string|null); - } - - /** Represents a Publishing. */ - class Publishing implements IPublishing { - - /** - * Constructs a new Publishing. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPublishing); - - /** Publishing methodSettings. */ - public methodSettings: google.api.IMethodSettings[]; - - /** Publishing newIssueUri. */ - public newIssueUri: string; - - /** Publishing documentationUri. */ - public documentationUri: string; - - /** Publishing apiShortName. */ - public apiShortName: string; - - /** Publishing githubLabel. */ - public githubLabel: string; - - /** Publishing codeownerGithubTeams. */ - public codeownerGithubTeams: string[]; - - /** Publishing docTagPrefix. */ - public docTagPrefix: string; - - /** Publishing organization. */ - public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); - - /** Publishing librarySettings. */ - public librarySettings: google.api.IClientLibrarySettings[]; - - /** Publishing protoReferenceDocumentationUri. */ - public protoReferenceDocumentationUri: string; - - /** Publishing restReferenceDocumentationUri. */ - public restReferenceDocumentationUri: string; - - /** - * Creates a new Publishing instance using the specified properties. - * @param [properties] Properties to set - * @returns Publishing instance - */ - public static create(properties?: google.api.IPublishing): google.api.Publishing; - - /** - * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @param message Publishing message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @param message Publishing message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Publishing message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; - - /** - * Decodes a Publishing message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; - - /** - * Verifies a Publishing message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Publishing message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Publishing - */ - public static fromObject(object: { [k: string]: any }): google.api.Publishing; - - /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @param message Publishing - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Publishing to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Publishing - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a JavaSettings. */ - interface IJavaSettings { - - /** JavaSettings libraryPackage */ - libraryPackage?: (string|null); - - /** JavaSettings serviceClassNames */ - serviceClassNames?: ({ [k: string]: string }|null); - - /** JavaSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a JavaSettings. */ - class JavaSettings implements IJavaSettings { - - /** - * Constructs a new JavaSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IJavaSettings); - - /** JavaSettings libraryPackage. */ - public libraryPackage: string; - - /** JavaSettings serviceClassNames. */ - public serviceClassNames: { [k: string]: string }; - - /** JavaSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new JavaSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns JavaSettings instance - */ - public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; - - /** - * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @param message JavaSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @param message JavaSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a JavaSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; - - /** - * Decodes a JavaSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; - - /** - * Verifies a JavaSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns JavaSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; - - /** - * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. - * @param message JavaSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this JavaSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for JavaSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CppSettings. */ - interface ICppSettings { - - /** CppSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a CppSettings. */ - class CppSettings implements ICppSettings { - - /** - * Constructs a new CppSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICppSettings); - - /** CppSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new CppSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns CppSettings instance - */ - public static create(properties?: google.api.ICppSettings): google.api.CppSettings; - - /** - * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @param message CppSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @param message CppSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CppSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; - - /** - * Decodes a CppSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; - - /** - * Verifies a CppSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CppSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.CppSettings; - - /** - * Creates a plain object from a CppSettings message. Also converts values to other types if specified. - * @param message CppSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CppSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CppSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PhpSettings. */ - interface IPhpSettings { - - /** PhpSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a PhpSettings. */ - class PhpSettings implements IPhpSettings { - - /** - * Constructs a new PhpSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPhpSettings); - - /** PhpSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new PhpSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns PhpSettings instance - */ - public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; - - /** - * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @param message PhpSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @param message PhpSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PhpSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; - - /** - * Decodes a PhpSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; - - /** - * Verifies a PhpSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PhpSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; - - /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @param message PhpSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PhpSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PhpSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PythonSettings. */ - interface IPythonSettings { - - /** PythonSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a PythonSettings. */ - class PythonSettings implements IPythonSettings { - - /** - * Constructs a new PythonSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPythonSettings); - - /** PythonSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new PythonSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns PythonSettings instance - */ - public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; - - /** - * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @param message PythonSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @param message PythonSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PythonSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; - - /** - * Decodes a PythonSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; - - /** - * Verifies a PythonSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PythonSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; - - /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. - * @param message PythonSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PythonSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PythonSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a NodeSettings. */ - interface INodeSettings { - - /** NodeSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a NodeSettings. */ - class NodeSettings implements INodeSettings { - - /** - * Constructs a new NodeSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.INodeSettings); - - /** NodeSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new NodeSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns NodeSettings instance - */ - public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; - - /** - * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @param message NodeSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @param message NodeSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NodeSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; - - /** - * Decodes a NodeSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; - - /** - * Verifies a NodeSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NodeSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; - - /** - * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. - * @param message NodeSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NodeSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NodeSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DotnetSettings. */ - interface IDotnetSettings { - - /** DotnetSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - - /** DotnetSettings renamedServices */ - renamedServices?: ({ [k: string]: string }|null); - - /** DotnetSettings renamedResources */ - renamedResources?: ({ [k: string]: string }|null); - - /** DotnetSettings ignoredResources */ - ignoredResources?: (string[]|null); - - /** DotnetSettings forcedNamespaceAliases */ - forcedNamespaceAliases?: (string[]|null); - - /** DotnetSettings handwrittenSignatures */ - handwrittenSignatures?: (string[]|null); - } - - /** Represents a DotnetSettings. */ - class DotnetSettings implements IDotnetSettings { - - /** - * Constructs a new DotnetSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IDotnetSettings); - - /** DotnetSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** DotnetSettings renamedServices. */ - public renamedServices: { [k: string]: string }; - - /** DotnetSettings renamedResources. */ - public renamedResources: { [k: string]: string }; - - /** DotnetSettings ignoredResources. */ - public ignoredResources: string[]; - - /** DotnetSettings forcedNamespaceAliases. */ - public forcedNamespaceAliases: string[]; - - /** DotnetSettings handwrittenSignatures. */ - public handwrittenSignatures: string[]; - - /** - * Creates a new DotnetSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns DotnetSettings instance - */ - public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; - - /** - * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @param message DotnetSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @param message DotnetSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; - - /** - * Verifies a DotnetSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DotnetSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; - - /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @param message DotnetSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DotnetSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DotnetSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RubySettings. */ - interface IRubySettings { - - /** RubySettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a RubySettings. */ - class RubySettings implements IRubySettings { - - /** - * Constructs a new RubySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IRubySettings); - - /** RubySettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new RubySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns RubySettings instance - */ - public static create(properties?: google.api.IRubySettings): google.api.RubySettings; - - /** - * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @param message RubySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @param message RubySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RubySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; - - /** - * Decodes a RubySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; - - /** - * Verifies a RubySettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RubySettings - */ - public static fromObject(object: { [k: string]: any }): google.api.RubySettings; - - /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @param message RubySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RubySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RubySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GoSettings. */ - interface IGoSettings { - - /** GoSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a GoSettings. */ - class GoSettings implements IGoSettings { - - /** - * Constructs a new GoSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IGoSettings); - - /** GoSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new GoSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns GoSettings instance - */ - public static create(properties?: google.api.IGoSettings): google.api.GoSettings; - - /** - * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @param message GoSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @param message GoSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GoSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; - - /** - * Decodes a GoSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; - - /** - * Verifies a GoSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GoSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.GoSettings; - - /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. - * @param message GoSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GoSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GoSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodSettings. */ - interface IMethodSettings { - - /** MethodSettings selector */ - selector?: (string|null); - - /** MethodSettings longRunning */ - longRunning?: (google.api.MethodSettings.ILongRunning|null); - - /** MethodSettings autoPopulatedFields */ - autoPopulatedFields?: (string[]|null); - } - - /** Represents a MethodSettings. */ - class MethodSettings implements IMethodSettings { - - /** - * Constructs a new MethodSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IMethodSettings); - - /** MethodSettings selector. */ - public selector: string; - - /** MethodSettings longRunning. */ - public longRunning?: (google.api.MethodSettings.ILongRunning|null); - - /** MethodSettings autoPopulatedFields. */ - public autoPopulatedFields: string[]; - - /** - * Creates a new MethodSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodSettings instance - */ - public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; - - /** - * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @param message MethodSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @param message MethodSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; - - /** - * Decodes a MethodSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; - - /** - * Verifies a MethodSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; - - /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @param message MethodSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MethodSettings { - - /** Properties of a LongRunning. */ - interface ILongRunning { - - /** LongRunning initialPollDelay */ - initialPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning pollDelayMultiplier */ - pollDelayMultiplier?: (number|null); - - /** LongRunning maxPollDelay */ - maxPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning totalPollTimeout */ - totalPollTimeout?: (google.protobuf.IDuration|null); - } - - /** Represents a LongRunning. */ - class LongRunning implements ILongRunning { - - /** - * Constructs a new LongRunning. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.MethodSettings.ILongRunning); - - /** LongRunning initialPollDelay. */ - public initialPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning pollDelayMultiplier. */ - public pollDelayMultiplier: number; - - /** LongRunning maxPollDelay. */ - public maxPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning totalPollTimeout. */ - public totalPollTimeout?: (google.protobuf.IDuration|null); - - /** - * Creates a new LongRunning instance using the specified properties. - * @param [properties] Properties to set - * @returns LongRunning instance - */ - public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; - - /** - * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @param message LongRunning message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @param message LongRunning message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LongRunning message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; - - /** - * Decodes a LongRunning message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; - - /** - * Verifies a LongRunning message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LongRunning - */ - public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; - - /** - * Creates a plain object from a LongRunning message. Also converts values to other types if specified. - * @param message LongRunning - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LongRunning to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LongRunning - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** ClientLibraryOrganization enum. */ - enum ClientLibraryOrganization { - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, - CLOUD = 1, - ADS = 2, - PHOTOS = 3, - STREET_VIEW = 4, - SHOPPING = 5, - GEO = 6, - GENERATIVE_AI = 7 - } - - /** ClientLibraryDestination enum. */ - enum ClientLibraryDestination { - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, - GITHUB = 10, - PACKAGE_MANAGER = 20 - } - - /** LaunchStage enum. */ - enum LaunchStage { - LAUNCH_STAGE_UNSPECIFIED = 0, - UNIMPLEMENTED = 6, - PRELAUNCH = 7, - EARLY_ACCESS = 1, - ALPHA = 2, - BETA = 3, - GA = 4, - DEPRECATED = 5 - } - - /** 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 FieldInfo. */ - interface IFieldInfo { - - /** FieldInfo format */ - format?: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format|null); - } - - /** Represents a FieldInfo. */ - class FieldInfo implements IFieldInfo { - - /** - * Constructs a new FieldInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IFieldInfo); - - /** FieldInfo format. */ - public format: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format); - - /** - * Creates a new FieldInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldInfo instance - */ - public static create(properties?: google.api.IFieldInfo): google.api.FieldInfo; - - /** - * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @param message FieldInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @param message FieldInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldInfo - * @throws {Error} If the payload is not 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.FieldInfo; - - /** - * Decodes a FieldInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldInfo - * @throws {Error} If the payload 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.FieldInfo; - - /** - * Verifies a FieldInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldInfo - */ - public static fromObject(object: { [k: string]: any }): google.api.FieldInfo; - - /** - * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. - * @param message FieldInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.FieldInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldInfo { - - /** Format enum. */ - enum Format { - FORMAT_UNSPECIFIED = 0, - UUID4 = 1, - IPV4 = 2, - IPV6 = 3, - IPV4_OR_IPV6 = 4 - } - } - - /** Properties of a ResourceDescriptor. */ - interface IResourceDescriptor { - - /** ResourceDescriptor type */ - type?: (string|null); - - /** ResourceDescriptor pattern */ - pattern?: (string[]|null); - - /** ResourceDescriptor nameField */ - nameField?: (string|null); - - /** ResourceDescriptor history */ - history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); - - /** ResourceDescriptor plural */ - plural?: (string|null); - - /** ResourceDescriptor singular */ - singular?: (string|null); - - /** ResourceDescriptor style */ - style?: (google.api.ResourceDescriptor.Style[]|null); - } - - /** Represents a ResourceDescriptor. */ - class ResourceDescriptor implements IResourceDescriptor { - - /** - * Constructs a new ResourceDescriptor. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceDescriptor); - - /** ResourceDescriptor type. */ - public type: string; - - /** ResourceDescriptor pattern. */ - public pattern: string[]; - - /** ResourceDescriptor nameField. */ - public nameField: string; - - /** ResourceDescriptor history. */ - public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); - - /** ResourceDescriptor plural. */ - public plural: string; - - /** ResourceDescriptor singular. */ - public singular: string; - - /** ResourceDescriptor style. */ - public style: google.api.ResourceDescriptor.Style[]; - - /** - * Creates a new ResourceDescriptor instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceDescriptor instance - */ - public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; - - /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; - - /** - * Verifies a ResourceDescriptor message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceDescriptor - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; - - /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @param message ResourceDescriptor - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceDescriptor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceDescriptor - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ResourceDescriptor { - - /** History enum. */ - enum History { - HISTORY_UNSPECIFIED = 0, - ORIGINALLY_SINGLE_PATTERN = 1, - FUTURE_MULTI_PATTERN = 2 - } - - /** Style enum. */ - enum Style { - STYLE_UNSPECIFIED = 0, - DECLARATIVE_FRIENDLY = 1 - } - } - - /** Properties of a ResourceReference. */ - interface IResourceReference { - - /** ResourceReference type */ - type?: (string|null); - - /** ResourceReference childType */ - childType?: (string|null); - } - - /** Represents a ResourceReference. */ - class ResourceReference implements IResourceReference { - - /** - * Constructs a new ResourceReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceReference); - - /** ResourceReference type. */ - public type: string; - - /** ResourceReference childType. */ - public childType: string; - - /** - * Creates a new ResourceReference instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceReference instance - */ - public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; - - /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceReference message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; - - /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; - - /** - * Verifies a ResourceReference message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceReference - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; - - /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @param message ResourceReference - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceReference - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace protobuf. */ - namespace protobuf { - - /** Properties of a FileDescriptorSet. */ - interface IFileDescriptorSet { - - /** FileDescriptorSet file */ - file?: (google.protobuf.IFileDescriptorProto[]|null); - } - - /** Represents a FileDescriptorSet. */ - class FileDescriptorSet implements IFileDescriptorSet { - - /** - * Constructs a new FileDescriptorSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorSet); - - /** FileDescriptorSet file. */ - public file: google.protobuf.IFileDescriptorProto[]; - - /** - * Creates a new FileDescriptorSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorSet instance - */ - public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; - - /** - * Verifies a FileDescriptorSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @param message FileDescriptorSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileDescriptorSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Edition enum. */ - enum Edition { - EDITION_UNKNOWN = 0, - EDITION_PROTO2 = 998, - EDITION_PROTO3 = 999, - EDITION_2023 = 1000, - EDITION_2024 = 1001, - EDITION_1_TEST_ONLY = 1, - EDITION_2_TEST_ONLY = 2, - EDITION_99997_TEST_ONLY = 99997, - EDITION_99998_TEST_ONLY = 99998, - EDITION_99999_TEST_ONLY = 99999, - EDITION_MAX = 2147483647 - } - - /** Properties of a FileDescriptorProto. */ - interface IFileDescriptorProto { - - /** FileDescriptorProto name */ - name?: (string|null); - - /** FileDescriptorProto package */ - "package"?: (string|null); - - /** FileDescriptorProto dependency */ - dependency?: (string[]|null); - - /** FileDescriptorProto publicDependency */ - publicDependency?: (number[]|null); - - /** FileDescriptorProto weakDependency */ - weakDependency?: (number[]|null); - - /** FileDescriptorProto messageType */ - messageType?: (google.protobuf.IDescriptorProto[]|null); - - /** FileDescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** FileDescriptorProto service */ - service?: (google.protobuf.IServiceDescriptorProto[]|null); - - /** FileDescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** FileDescriptorProto options */ - options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo */ - sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax */ - syntax?: (string|null); - - /** FileDescriptorProto edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FileDescriptorProto. */ - class FileDescriptorProto implements IFileDescriptorProto { - - /** - * Constructs a new FileDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorProto); - - /** FileDescriptorProto name. */ - public name: string; - - /** FileDescriptorProto package. */ - public package: string; - - /** FileDescriptorProto dependency. */ - public dependency: string[]; - - /** FileDescriptorProto publicDependency. */ - public publicDependency: number[]; - - /** FileDescriptorProto weakDependency. */ - public weakDependency: number[]; - - /** FileDescriptorProto messageType. */ - public messageType: google.protobuf.IDescriptorProto[]; - - /** FileDescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** FileDescriptorProto service. */ - public service: google.protobuf.IServiceDescriptorProto[]; - - /** FileDescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** FileDescriptorProto options. */ - public options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo. */ - public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax. */ - public syntax: string; - - /** FileDescriptorProto edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; - - /** - * Verifies a FileDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @param message FileDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DescriptorProto. */ - interface IDescriptorProto { - - /** DescriptorProto name */ - name?: (string|null); - - /** DescriptorProto field */ - field?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto nestedType */ - nestedType?: (google.protobuf.IDescriptorProto[]|null); - - /** DescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** DescriptorProto extensionRange */ - extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); - - /** DescriptorProto oneofDecl */ - oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); - - /** DescriptorProto options */ - options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange */ - reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); - - /** DescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents a DescriptorProto. */ - class DescriptorProto implements IDescriptorProto { - - /** - * Constructs a new DescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDescriptorProto); - - /** DescriptorProto name. */ - public name: string; - - /** DescriptorProto field. */ - public field: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto nestedType. */ - public nestedType: google.protobuf.IDescriptorProto[]; - - /** DescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** DescriptorProto extensionRange. */ - public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; - - /** DescriptorProto oneofDecl. */ - public oneofDecl: google.protobuf.IOneofDescriptorProto[]; - - /** DescriptorProto options. */ - public options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange. */ - public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; - - /** DescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns DescriptorProto instance - */ - public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; - - /** - * Verifies a DescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @param message DescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DescriptorProto { - - /** Properties of an ExtensionRange. */ - interface IExtensionRange { - - /** ExtensionRange start */ - start?: (number|null); - - /** ExtensionRange end */ - end?: (number|null); - - /** ExtensionRange options */ - options?: (google.protobuf.IExtensionRangeOptions|null); - } - - /** Represents an ExtensionRange. */ - class ExtensionRange implements IExtensionRange { - - /** - * Constructs a new ExtensionRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); - - /** ExtensionRange start. */ - public start: number; - - /** ExtensionRange end. */ - public end: number; - - /** ExtensionRange options. */ - public options?: (google.protobuf.IExtensionRangeOptions|null); - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Verifies an ExtensionRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @param message ExtensionRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtensionRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ReservedRange. */ - interface IReservedRange { - - /** ReservedRange start */ - start?: (number|null); - - /** ReservedRange end */ - end?: (number|null); - } - - /** Represents a ReservedRange. */ - class ReservedRange implements IReservedRange { - - /** - * Constructs a new ReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); - - /** ReservedRange start. */ - public start: number; - - /** ReservedRange end. */ - public end: number; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ReservedRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Verifies a ReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @param message ReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ExtensionRangeOptions. */ - interface IExtensionRangeOptions { - - /** ExtensionRangeOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ExtensionRangeOptions declaration */ - declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); - - /** ExtensionRangeOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification */ - verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); - } - - /** Represents an ExtensionRangeOptions. */ - class ExtensionRangeOptions implements IExtensionRangeOptions { - - /** - * Constructs a new ExtensionRangeOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IExtensionRangeOptions); - - /** ExtensionRangeOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** ExtensionRangeOptions declaration. */ - public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; - - /** ExtensionRangeOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification. */ - public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRangeOptions instance - */ - public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; - - /** - * Verifies an ExtensionRangeOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRangeOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @param message ExtensionRangeOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ExtensionRangeOptions { - - /** Properties of a Declaration. */ - interface IDeclaration { - - /** Declaration number */ - number?: (number|null); - - /** Declaration fullName */ - fullName?: (string|null); - - /** Declaration type */ - type?: (string|null); - - /** Declaration reserved */ - reserved?: (boolean|null); - - /** Declaration repeated */ - repeated?: (boolean|null); - } - - /** Represents a Declaration. */ - class Declaration implements IDeclaration { - - /** - * Constructs a new Declaration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); - - /** Declaration number. */ - public number: number; - - /** Declaration fullName. */ - public fullName: string; - - /** Declaration type. */ - public type: string; - - /** Declaration reserved. */ - public reserved: boolean; - - /** Declaration repeated. */ - public repeated: boolean; - - /** - * Creates a new Declaration instance using the specified properties. - * @param [properties] Properties to set - * @returns Declaration instance - */ - public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Verifies a Declaration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Declaration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Declaration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @param message Declaration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Declaration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Declaration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** VerificationState enum. */ - enum VerificationState { - DECLARATION = 0, - UNVERIFIED = 1 - } - } - - /** Properties of a FieldDescriptorProto. */ - interface IFieldDescriptorProto { - - /** FieldDescriptorProto name */ - name?: (string|null); - - /** FieldDescriptorProto number */ - number?: (number|null); - - /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); - - /** FieldDescriptorProto type */ - type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); - - /** FieldDescriptorProto typeName */ - typeName?: (string|null); - - /** FieldDescriptorProto extendee */ - extendee?: (string|null); - - /** FieldDescriptorProto defaultValue */ - defaultValue?: (string|null); - - /** FieldDescriptorProto oneofIndex */ - oneofIndex?: (number|null); - - /** FieldDescriptorProto jsonName */ - jsonName?: (string|null); - - /** FieldDescriptorProto options */ - options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional */ - proto3Optional?: (boolean|null); - } - - /** Represents a FieldDescriptorProto. */ - class FieldDescriptorProto implements IFieldDescriptorProto { - - /** - * Constructs a new FieldDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldDescriptorProto); - - /** FieldDescriptorProto name. */ - public name: string; - - /** FieldDescriptorProto number. */ - public number: number; - - /** FieldDescriptorProto label. */ - public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); - - /** FieldDescriptorProto type. */ - public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); - - /** FieldDescriptorProto typeName. */ - public typeName: string; - - /** FieldDescriptorProto extendee. */ - public extendee: string; - - /** FieldDescriptorProto defaultValue. */ - public defaultValue: string; - - /** FieldDescriptorProto oneofIndex. */ - public oneofIndex: number; - - /** FieldDescriptorProto jsonName. */ - public jsonName: string; - - /** FieldDescriptorProto options. */ - public options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional. */ - public proto3Optional: boolean; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; - - /** - * Verifies a FieldDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @param message FieldDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldDescriptorProto { - - /** Type enum. */ - enum Type { - TYPE_DOUBLE = 1, - TYPE_FLOAT = 2, - TYPE_INT64 = 3, - TYPE_UINT64 = 4, - TYPE_INT32 = 5, - TYPE_FIXED64 = 6, - TYPE_FIXED32 = 7, - TYPE_BOOL = 8, - TYPE_STRING = 9, - TYPE_GROUP = 10, - TYPE_MESSAGE = 11, - TYPE_BYTES = 12, - TYPE_UINT32 = 13, - TYPE_ENUM = 14, - TYPE_SFIXED32 = 15, - TYPE_SFIXED64 = 16, - TYPE_SINT32 = 17, - TYPE_SINT64 = 18 - } - - /** Label enum. */ - enum Label { - LABEL_OPTIONAL = 1, - LABEL_REPEATED = 3, - LABEL_REQUIRED = 2 - } - } - - /** Properties of an OneofDescriptorProto. */ - interface IOneofDescriptorProto { - - /** OneofDescriptorProto name */ - name?: (string|null); - - /** OneofDescriptorProto options */ - options?: (google.protobuf.IOneofOptions|null); - } - - /** Represents an OneofDescriptorProto. */ - class OneofDescriptorProto implements IOneofDescriptorProto { - - /** - * Constructs a new OneofDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofDescriptorProto); - - /** OneofDescriptorProto name. */ - public name: string; - - /** OneofDescriptorProto options. */ - public options?: (google.protobuf.IOneofOptions|null); - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofDescriptorProto instance - */ - public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; - - /** - * Verifies an OneofDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @param message OneofDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OneofDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumDescriptorProto. */ - interface IEnumDescriptorProto { - - /** EnumDescriptorProto name */ - name?: (string|null); - - /** EnumDescriptorProto value */ - value?: (google.protobuf.IEnumValueDescriptorProto[]|null); - - /** EnumDescriptorProto options */ - options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange */ - reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); - - /** EnumDescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents an EnumDescriptorProto. */ - class EnumDescriptorProto implements IEnumDescriptorProto { - - /** - * Constructs a new EnumDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumDescriptorProto); - - /** EnumDescriptorProto name. */ - public name: string; - - /** EnumDescriptorProto value. */ - public value: google.protobuf.IEnumValueDescriptorProto[]; - - /** EnumDescriptorProto options. */ - public options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange. */ - public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; - - /** EnumDescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; - - /** - * Verifies an EnumDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @param message EnumDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EnumDescriptorProto { - - /** Properties of an EnumReservedRange. */ - interface IEnumReservedRange { - - /** EnumReservedRange start */ - start?: (number|null); - - /** EnumReservedRange end */ - end?: (number|null); - } - - /** Represents an EnumReservedRange. */ - class EnumReservedRange implements IEnumReservedRange { - - /** - * Constructs a new EnumReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); - - /** EnumReservedRange start. */ - public start: number; - - /** EnumReservedRange end. */ - public end: number; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumReservedRange instance - */ - public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Verifies an EnumReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @param message EnumReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an EnumValueDescriptorProto. */ - interface IEnumValueDescriptorProto { - - /** EnumValueDescriptorProto name */ - name?: (string|null); - - /** EnumValueDescriptorProto number */ - number?: (number|null); - - /** EnumValueDescriptorProto options */ - options?: (google.protobuf.IEnumValueOptions|null); - } - - /** Represents an EnumValueDescriptorProto. */ - class EnumValueDescriptorProto implements IEnumValueDescriptorProto { - - /** - * Constructs a new EnumValueDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueDescriptorProto); - - /** EnumValueDescriptorProto name. */ - public name: string; - - /** EnumValueDescriptorProto number. */ - public number: number; - - /** EnumValueDescriptorProto options. */ - public options?: (google.protobuf.IEnumValueOptions|null); - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; - - /** - * Verifies an EnumValueDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @param message EnumValueDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceDescriptorProto. */ - interface IServiceDescriptorProto { - - /** ServiceDescriptorProto name */ - name?: (string|null); - - /** ServiceDescriptorProto method */ - method?: (google.protobuf.IMethodDescriptorProto[]|null); - - /** ServiceDescriptorProto options */ - options?: (google.protobuf.IServiceOptions|null); - } - - /** Represents a ServiceDescriptorProto. */ - class ServiceDescriptorProto implements IServiceDescriptorProto { - - /** - * Constructs a new ServiceDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceDescriptorProto); - - /** ServiceDescriptorProto name. */ - public name: string; - - /** ServiceDescriptorProto method. */ - public method: google.protobuf.IMethodDescriptorProto[]; - - /** ServiceDescriptorProto options. */ - public options?: (google.protobuf.IServiceOptions|null); - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceDescriptorProto instance - */ - public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; - - /** - * Verifies a ServiceDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @param message ServiceDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodDescriptorProto. */ - interface IMethodDescriptorProto { - - /** MethodDescriptorProto name */ - name?: (string|null); - - /** MethodDescriptorProto inputType */ - inputType?: (string|null); - - /** MethodDescriptorProto outputType */ - outputType?: (string|null); - - /** MethodDescriptorProto options */ - options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming */ - clientStreaming?: (boolean|null); - - /** MethodDescriptorProto serverStreaming */ - serverStreaming?: (boolean|null); - } - - /** Represents a MethodDescriptorProto. */ - class MethodDescriptorProto implements IMethodDescriptorProto { - - /** - * Constructs a new MethodDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodDescriptorProto); - - /** MethodDescriptorProto name. */ - public name: string; - - /** MethodDescriptorProto inputType. */ - public inputType: string; - - /** MethodDescriptorProto outputType. */ - public outputType: string; - - /** MethodDescriptorProto options. */ - public options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming. */ - public clientStreaming: boolean; - - /** MethodDescriptorProto serverStreaming. */ - public serverStreaming: boolean; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodDescriptorProto instance - */ - public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; - - /** - * Verifies a MethodDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @param message MethodDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FileOptions. */ - interface IFileOptions { - - /** FileOptions javaPackage */ - javaPackage?: (string|null); - - /** FileOptions javaOuterClassname */ - javaOuterClassname?: (string|null); - - /** FileOptions javaMultipleFiles */ - javaMultipleFiles?: (boolean|null); - - /** FileOptions javaGenerateEqualsAndHash */ - javaGenerateEqualsAndHash?: (boolean|null); - - /** FileOptions javaStringCheckUtf8 */ - javaStringCheckUtf8?: (boolean|null); - - /** FileOptions optimizeFor */ - optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); - - /** FileOptions goPackage */ - goPackage?: (string|null); - - /** FileOptions ccGenericServices */ - ccGenericServices?: (boolean|null); - - /** FileOptions javaGenericServices */ - javaGenericServices?: (boolean|null); - - /** FileOptions pyGenericServices */ - pyGenericServices?: (boolean|null); - - /** FileOptions deprecated */ - deprecated?: (boolean|null); - - /** FileOptions ccEnableArenas */ - ccEnableArenas?: (boolean|null); - - /** FileOptions objcClassPrefix */ - objcClassPrefix?: (string|null); - - /** FileOptions csharpNamespace */ - csharpNamespace?: (string|null); - - /** FileOptions swiftPrefix */ - swiftPrefix?: (string|null); - - /** FileOptions phpClassPrefix */ - phpClassPrefix?: (string|null); - - /** FileOptions phpNamespace */ - phpNamespace?: (string|null); - - /** FileOptions phpMetadataNamespace */ - phpMetadataNamespace?: (string|null); - - /** FileOptions rubyPackage */ - rubyPackage?: (string|null); - - /** FileOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** FileOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FileOptions .google.api.resourceDefinition */ - ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); - } - - /** Represents a FileOptions. */ - class FileOptions implements IFileOptions { - - /** - * Constructs a new FileOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileOptions); - - /** FileOptions javaPackage. */ - public javaPackage: string; - - /** FileOptions javaOuterClassname. */ - public javaOuterClassname: string; - - /** FileOptions javaMultipleFiles. */ - public javaMultipleFiles: boolean; - - /** FileOptions javaGenerateEqualsAndHash. */ - public javaGenerateEqualsAndHash: boolean; - - /** FileOptions javaStringCheckUtf8. */ - public javaStringCheckUtf8: boolean; - - /** FileOptions optimizeFor. */ - public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); - - /** FileOptions goPackage. */ - public goPackage: string; - - /** FileOptions ccGenericServices. */ - public ccGenericServices: boolean; - - /** FileOptions javaGenericServices. */ - public javaGenericServices: boolean; - - /** FileOptions pyGenericServices. */ - public pyGenericServices: boolean; - - /** FileOptions deprecated. */ - public deprecated: boolean; - - /** FileOptions ccEnableArenas. */ - public ccEnableArenas: boolean; - - /** FileOptions objcClassPrefix. */ - public objcClassPrefix: string; - - /** FileOptions csharpNamespace. */ - public csharpNamespace: string; - - /** FileOptions swiftPrefix. */ - public swiftPrefix: string; - - /** FileOptions phpClassPrefix. */ - public phpClassPrefix: string; - - /** FileOptions phpNamespace. */ - public phpNamespace: string; - - /** FileOptions phpMetadataNamespace. */ - public phpMetadataNamespace: string; - - /** FileOptions rubyPackage. */ - public rubyPackage: string; - - /** FileOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** FileOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FileOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FileOptions instance - */ - public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; - - /** - * Verifies a FileOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @param message FileOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FileOptions { - - /** OptimizeMode enum. */ - enum OptimizeMode { - SPEED = 1, - CODE_SIZE = 2, - LITE_RUNTIME = 3 - } - } - - /** Properties of a MessageOptions. */ - interface IMessageOptions { - - /** MessageOptions messageSetWireFormat */ - messageSetWireFormat?: (boolean|null); - - /** MessageOptions noStandardDescriptorAccessor */ - noStandardDescriptorAccessor?: (boolean|null); - - /** MessageOptions deprecated */ - deprecated?: (boolean|null); - - /** MessageOptions mapEntry */ - mapEntry?: (boolean|null); - - /** MessageOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** MessageOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** MessageOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MessageOptions .google.api.resource */ - ".google.api.resource"?: (google.api.IResourceDescriptor|null); - } - - /** Represents a MessageOptions. */ - class MessageOptions implements IMessageOptions { - - /** - * Constructs a new MessageOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMessageOptions); - - /** MessageOptions messageSetWireFormat. */ - public messageSetWireFormat: boolean; - - /** MessageOptions noStandardDescriptorAccessor. */ - public noStandardDescriptorAccessor: boolean; - - /** MessageOptions deprecated. */ - public deprecated: boolean; - - /** MessageOptions mapEntry. */ - public mapEntry: boolean; - - /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; - - /** MessageOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** MessageOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MessageOptions instance - */ - public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; - - /** - * Verifies a MessageOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MessageOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @param message MessageOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MessageOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MessageOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FieldOptions. */ - interface IFieldOptions { - - /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); - - /** FieldOptions packed */ - packed?: (boolean|null); - - /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); - - /** FieldOptions lazy */ - lazy?: (boolean|null); - - /** FieldOptions unverifiedLazy */ - unverifiedLazy?: (boolean|null); - - /** FieldOptions deprecated */ - deprecated?: (boolean|null); - - /** FieldOptions weak */ - weak?: (boolean|null); - - /** FieldOptions debugRedact */ - debugRedact?: (boolean|null); - - /** FieldOptions retention */ - retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); - - /** FieldOptions targets */ - targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); - - /** FieldOptions editionDefaults */ - editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); - - /** FieldOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** FieldOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FieldOptions .google.api.fieldBehavior */ - ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); - - /** FieldOptions .google.api.fieldInfo */ - ".google.api.fieldInfo"?: (google.api.IFieldInfo|null); - - /** FieldOptions .google.api.resourceReference */ - ".google.api.resourceReference"?: (google.api.IResourceReference|null); - } - - /** Represents a FieldOptions. */ - class FieldOptions implements IFieldOptions { - - /** - * Constructs a new FieldOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldOptions); - - /** FieldOptions ctype. */ - public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); - - /** FieldOptions packed. */ - public packed: boolean; - - /** FieldOptions jstype. */ - public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); - - /** FieldOptions lazy. */ - public lazy: boolean; - - /** FieldOptions unverifiedLazy. */ - public unverifiedLazy: boolean; - - /** FieldOptions deprecated. */ - public deprecated: boolean; - - /** FieldOptions weak. */ - public weak: boolean; - - /** FieldOptions debugRedact. */ - public debugRedact: boolean; - - /** FieldOptions retention. */ - public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); - - /** FieldOptions targets. */ - public targets: google.protobuf.FieldOptions.OptionTargetType[]; - - /** FieldOptions editionDefaults. */ - public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; - - /** FieldOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** FieldOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldOptions instance - */ - public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; - - /** - * Verifies a FieldOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @param message FieldOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldOptions { - - /** CType enum. */ - enum CType { - STRING = 0, - CORD = 1, - STRING_PIECE = 2 - } - - /** JSType enum. */ - enum JSType { - JS_NORMAL = 0, - JS_STRING = 1, - JS_NUMBER = 2 - } - - /** OptionRetention enum. */ - enum OptionRetention { - RETENTION_UNKNOWN = 0, - RETENTION_RUNTIME = 1, - RETENTION_SOURCE = 2 - } - - /** OptionTargetType enum. */ - enum OptionTargetType { - TARGET_TYPE_UNKNOWN = 0, - TARGET_TYPE_FILE = 1, - TARGET_TYPE_EXTENSION_RANGE = 2, - TARGET_TYPE_MESSAGE = 3, - TARGET_TYPE_FIELD = 4, - TARGET_TYPE_ONEOF = 5, - TARGET_TYPE_ENUM = 6, - TARGET_TYPE_ENUM_ENTRY = 7, - TARGET_TYPE_SERVICE = 8, - TARGET_TYPE_METHOD = 9 - } - - /** Properties of an EditionDefault. */ - interface IEditionDefault { - - /** EditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** EditionDefault value */ - value?: (string|null); - } - - /** Represents an EditionDefault. */ - class EditionDefault implements IEditionDefault { - - /** - * Constructs a new EditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); - - /** EditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** EditionDefault value. */ - public value: string; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns EditionDefault instance - */ - public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; - - /** - * Verifies an EditionDefault message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @param message EditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an OneofOptions. */ - interface IOneofOptions { - - /** OneofOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** OneofOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an OneofOptions. */ - class OneofOptions implements IOneofOptions { - - /** - * Constructs a new OneofOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofOptions); - - /** OneofOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** OneofOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofOptions instance - */ - public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; - - /** - * Verifies an OneofOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @param message OneofOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OneofOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumOptions. */ - interface IEnumOptions { - - /** EnumOptions allowAlias */ - allowAlias?: (boolean|null); - - /** EnumOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** EnumOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** EnumOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumOptions. */ - class EnumOptions implements IEnumOptions { - - /** - * Constructs a new EnumOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumOptions); - - /** EnumOptions allowAlias. */ - public allowAlias: boolean; - - /** EnumOptions deprecated. */ - public deprecated: boolean; - - /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; - - /** EnumOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** EnumOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumOptions instance - */ - public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; - - /** - * Verifies an EnumOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @param message EnumOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumValueOptions. */ - interface IEnumValueOptions { - - /** EnumValueOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumValueOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact */ - debugRedact?: (boolean|null); - - /** EnumValueOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumValueOptions. */ - class EnumValueOptions implements IEnumValueOptions { - - /** - * Constructs a new EnumValueOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueOptions); - - /** EnumValueOptions deprecated. */ - public deprecated: boolean; - - /** EnumValueOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact. */ - public debugRedact: boolean; - - /** EnumValueOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueOptions instance - */ - public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; - - /** - * Verifies an EnumValueOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @param message EnumValueOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceOptions. */ - interface IServiceOptions { - - /** ServiceOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** ServiceOptions deprecated */ - deprecated?: (boolean|null); - - /** ServiceOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ServiceOptions .google.api.defaultHost */ - ".google.api.defaultHost"?: (string|null); - - /** ServiceOptions .google.api.oauthScopes */ - ".google.api.oauthScopes"?: (string|null); - - /** ServiceOptions .google.api.apiVersion */ - ".google.api.apiVersion"?: (string|null); - } - - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { - - /** - * Constructs a new ServiceOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceOptions); - - /** ServiceOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** ServiceOptions deprecated. */ - public deprecated: boolean; - - /** ServiceOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceOptions instance - */ - public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; - - /** - * Verifies a ServiceOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @param message ServiceOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodOptions. */ - interface IMethodOptions { - - /** MethodOptions deprecated */ - deprecated?: (boolean|null); - - /** MethodOptions idempotencyLevel */ - idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); - - /** MethodOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** MethodOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MethodOptions .google.api.http */ - ".google.api.http"?: (google.api.IHttpRule|null); - - /** MethodOptions .google.api.methodSignature */ - ".google.api.methodSignature"?: (string[]|null); - - /** MethodOptions .google.longrunning.operationInfo */ - ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); - } - - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { - - /** - * Constructs a new MethodOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodOptions); - - /** MethodOptions deprecated. */ - public deprecated: boolean; - - /** MethodOptions idempotencyLevel. */ - public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); - - /** MethodOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** MethodOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MethodOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodOptions instance - */ - public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; - - /** - * Verifies a MethodOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @param message MethodOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MethodOptions { - - /** IdempotencyLevel enum. */ - enum IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0, - NO_SIDE_EFFECTS = 1, - IDEMPOTENT = 2 - } - } - - /** Properties of an UninterpretedOption. */ - interface IUninterpretedOption { - - /** UninterpretedOption name */ - name?: (google.protobuf.UninterpretedOption.INamePart[]|null); - - /** UninterpretedOption identifierValue */ - identifierValue?: (string|null); - - /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|Long|string|null); - - /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|Long|string|null); - - /** UninterpretedOption doubleValue */ - doubleValue?: (number|null); - - /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|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|string); - - /** UninterpretedOption aggregateValue. */ - public aggregateValue: string; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @param [properties] Properties to set - * @returns UninterpretedOption instance - */ - public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; - - /** - * Verifies an UninterpretedOption message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UninterpretedOption - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @param message UninterpretedOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UninterpretedOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UninterpretedOption - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace UninterpretedOption { - - /** Properties of a NamePart. */ - interface INamePart { - - /** NamePart namePart */ - namePart: string; - - /** NamePart isExtension */ - isExtension: boolean; - } - - /** Represents a NamePart. */ - class NamePart implements INamePart { - - /** - * Constructs a new NamePart. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.UninterpretedOption.INamePart); - - /** NamePart namePart. */ - public namePart: string; - - /** NamePart isExtension. */ - public isExtension: boolean; - - /** - * Creates a new NamePart instance using the specified properties. - * @param [properties] Properties to set - * @returns NamePart instance - */ - public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; - - /** - * Verifies a NamePart message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NamePart - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @param message NamePart - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NamePart to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NamePart - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a FeatureSet. */ - interface IFeatureSet { - - /** FeatureSet fieldPresence */ - fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); - - /** FeatureSet enumType */ - enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); - - /** FeatureSet repeatedFieldEncoding */ - repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); - - /** FeatureSet utf8Validation */ - utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); - - /** FeatureSet messageEncoding */ - messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); - - /** FeatureSet jsonFormat */ - jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); - } - - /** Represents a FeatureSet. */ - class FeatureSet implements IFeatureSet { - - /** - * Constructs a new FeatureSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSet); - - /** FeatureSet fieldPresence. */ - public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); - - /** FeatureSet enumType. */ - public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); - - /** FeatureSet repeatedFieldEncoding. */ - public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); - - /** FeatureSet utf8Validation. */ - public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); - - /** FeatureSet messageEncoding. */ - public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); - - /** FeatureSet jsonFormat. */ - public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); - - /** - * Creates a new FeatureSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSet instance - */ - public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; - - /** - * Verifies a FeatureSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @param message FeatureSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSet { - - /** FieldPresence enum. */ - enum FieldPresence { - FIELD_PRESENCE_UNKNOWN = 0, - EXPLICIT = 1, - IMPLICIT = 2, - LEGACY_REQUIRED = 3 - } - - /** EnumType enum. */ - enum EnumType { - ENUM_TYPE_UNKNOWN = 0, - OPEN = 1, - CLOSED = 2 - } - - /** RepeatedFieldEncoding enum. */ - enum RepeatedFieldEncoding { - REPEATED_FIELD_ENCODING_UNKNOWN = 0, - PACKED = 1, - EXPANDED = 2 - } - - /** Utf8Validation enum. */ - enum Utf8Validation { - UTF8_VALIDATION_UNKNOWN = 0, - VERIFY = 2, - NONE = 3 - } - - /** MessageEncoding enum. */ - enum MessageEncoding { - MESSAGE_ENCODING_UNKNOWN = 0, - LENGTH_PREFIXED = 1, - DELIMITED = 2 - } - - /** JsonFormat enum. */ - enum JsonFormat { - JSON_FORMAT_UNKNOWN = 0, - ALLOW = 1, - LEGACY_BEST_EFFORT = 2 - } - } - - /** Properties of a FeatureSetDefaults. */ - interface IFeatureSetDefaults { - - /** FeatureSetDefaults defaults */ - defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); - - /** FeatureSetDefaults minimumEdition */ - minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetDefaults maximumEdition */ - maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FeatureSetDefaults. */ - class FeatureSetDefaults implements IFeatureSetDefaults { - - /** - * Constructs a new FeatureSetDefaults. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSetDefaults); - - /** FeatureSetDefaults defaults. */ - public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; - - /** FeatureSetDefaults minimumEdition. */ - public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetDefaults maximumEdition. */ - public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetDefaults instance - */ - public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; - - /** - * Verifies a FeatureSetDefaults message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetDefaults - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @param message FeatureSetDefaults - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetDefaults - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSetDefaults { - - /** Properties of a FeatureSetEditionDefault. */ - interface IFeatureSetEditionDefault { - - /** FeatureSetEditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetEditionDefault features */ - features?: (google.protobuf.IFeatureSet|null); - } - - /** Represents a FeatureSetEditionDefault. */ - class FeatureSetEditionDefault implements IFeatureSetEditionDefault { - - /** - * Constructs a new FeatureSetEditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); - - /** FeatureSetEditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetEditionDefault features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetEditionDefault instance - */ - public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Verifies a FeatureSetEditionDefault message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetEditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @param message FeatureSetEditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a SourceCodeInfo. */ - interface ISourceCodeInfo { - - /** SourceCodeInfo location */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); - } - - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { - - /** - * Constructs a new SourceCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ISourceCodeInfo); - - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns SourceCodeInfo instance - */ - public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; - - /** - * Verifies a SourceCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SourceCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @param message SourceCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SourceCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SourceCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SourceCodeInfo { - - /** Properties of a Location. */ - interface ILocation { - - /** Location path */ - path?: (number[]|null); - - /** Location span */ - span?: (number[]|null); - - /** Location leadingComments */ - leadingComments?: (string|null); - - /** Location trailingComments */ - trailingComments?: (string|null); - - /** Location leadingDetachedComments */ - leadingDetachedComments?: (string[]|null); - } - - /** Represents a Location. */ - class Location implements ILocation { - - /** - * Constructs a new Location. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); - - /** Location path. */ - public path: number[]; - - /** Location span. */ - public span: number[]; - - /** Location leadingComments. */ - public leadingComments: string; - - /** Location trailingComments. */ - public trailingComments: string; - - /** Location leadingDetachedComments. */ - public leadingDetachedComments: string[]; - - /** - * Creates a new Location instance using the specified properties. - * @param [properties] Properties to set - * @returns Location instance - */ - public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Location message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; - - /** - * Verifies a Location message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Location - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @param message Location - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Location to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Location - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a GeneratedCodeInfo. */ - interface IGeneratedCodeInfo { - - /** GeneratedCodeInfo annotation */ - annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); - } - - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { - - /** - * Constructs a new GeneratedCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IGeneratedCodeInfo); - - /** GeneratedCodeInfo annotation. */ - public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns GeneratedCodeInfo instance - */ - public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; - - /** - * Verifies a GeneratedCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GeneratedCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @param message GeneratedCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace GeneratedCodeInfo { - - /** Properties of an Annotation. */ - interface IAnnotation { - - /** Annotation path */ - path?: (number[]|null); - - /** Annotation sourceFile */ - sourceFile?: (string|null); - - /** Annotation begin */ - begin?: (number|null); - - /** Annotation end */ - end?: (number|null); - - /** Annotation semantic */ - semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); - } - - /** Represents an Annotation. */ - class Annotation implements IAnnotation { - - /** - * Constructs a new Annotation. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); - - /** Annotation path. */ - public path: number[]; - - /** Annotation sourceFile. */ - public sourceFile: string; - - /** Annotation begin. */ - public begin: number; - - /** Annotation end. */ - public end: number; - - /** Annotation semantic. */ - public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); - - /** - * Creates a new Annotation instance using the specified properties. - * @param [properties] Properties to set - * @returns Annotation instance - */ - public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Verifies an Annotation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Annotation - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @param message Annotation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Annotation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Annotation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Annotation { - - /** Semantic enum. */ - enum Semantic { - NONE = 0, - SET = 1, - ALIAS = 2 - } - } - } - - /** Properties of a Duration. */ - interface IDuration { - - /** Duration seconds */ - seconds?: (number|Long|string|null); - - /** Duration nanos */ - nanos?: (number|null); - } - - /** Represents a Duration. */ - class Duration implements IDuration { - - /** - * Constructs a new Duration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDuration); - - /** Duration seconds. */ - public seconds: (number|Long|string); - - /** Duration nanos. */ - public nanos: number; - - /** - * Creates a new Duration instance using the specified properties. - * @param [properties] Properties to set - * @returns Duration instance - */ - public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; - - /** - * Verifies a Duration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Duration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @param message Duration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Duration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Duration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of 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 an Any. */ - interface IAny { - - /** Any type_url */ - type_url?: (string|null); - - /** Any value */ - value?: (Uint8Array|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|string); - - /** - * Creates a new Any instance using the specified properties. - * @param [properties] Properties to set - * @returns Any instance - */ - public static create(properties?: google.protobuf.IAny): google.protobuf.Any; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Any message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; - - /** - * Verifies an Any message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Any - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Any; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @param message Any - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Any to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Any - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Empty. */ - interface IEmpty { - } - - /** Represents an Empty. */ - class Empty implements IEmpty { - - /** - * Constructs a new Empty. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEmpty); - - /** - * Creates a new Empty instance using the specified properties. - * @param [properties] Properties to set - * @returns Empty instance - */ - public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; - - /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Empty message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; - - /** - * Decodes an Empty message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; - - /** - * Verifies an Empty message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Empty - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; - - /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @param message Empty - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Empty to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Empty - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FieldMask. */ - interface IFieldMask { - - /** FieldMask paths */ - paths?: (string[]|null); - } - - /** Represents a FieldMask. */ - class FieldMask implements IFieldMask { - - /** - * Constructs a new FieldMask. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldMask); - - /** FieldMask paths. */ - public paths: string[]; - - /** - * Creates a new FieldMask instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldMask instance - */ - public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; - - /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @param message FieldMask message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @param message FieldMask message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldMask message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; - - /** - * Decodes a FieldMask message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; - - /** - * Verifies a FieldMask message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldMask - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; - - /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. - * @param message FieldMask - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldMask to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldMask - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace type. */ - namespace type { - - /** Properties of an Interval. */ - interface IInterval { - - /** Interval startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** Interval endTime */ - endTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents an Interval. */ - class Interval implements IInterval { - - /** - * Constructs a new Interval. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.IInterval); - - /** Interval startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** Interval endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new Interval instance using the specified properties. - * @param [properties] Properties to set - * @returns Interval instance - */ - public static create(properties?: google.type.IInterval): google.type.Interval; - - /** - * Encodes the specified Interval message. Does not implicitly {@link google.type.Interval.verify|verify} messages. - * @param message Interval message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.type.IInterval, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Interval message, length delimited. Does not implicitly {@link google.type.Interval.verify|verify} messages. - * @param message Interval message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.type.IInterval, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Interval message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Interval - * @throws {Error} If the payload is not 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.Interval; - - /** - * Decodes an Interval message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Interval - * @throws {Error} If the payload 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.Interval; - - /** - * Verifies an Interval message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Interval message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Interval - */ - public static fromObject(object: { [k: string]: any }): google.type.Interval; - - /** - * Creates a plain object from an Interval message. Also converts values to other types if specified. - * @param message Interval - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.type.Interval, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Interval to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Interval - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace longrunning. */ - namespace longrunning { - - /** Represents an Operations */ - class Operations extends $protobuf.rpc.Service { - - /** - * Constructs a new Operations service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new Operations service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; - - /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListOperationsResponse - */ - public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; - - /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @returns Promise - */ - public listOperations(request: google.longrunning.IListOperationsRequest): Promise; - - /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; - - /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @returns Promise - */ - public getOperation(request: google.longrunning.IGetOperationRequest): Promise; - - /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; - - /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @returns Promise - */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; - - /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; - - /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @returns Promise - */ - public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; - - /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; - - /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @returns Promise - */ - public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; - } - - namespace Operations { - - /** - * Callback as used by {@link google.longrunning.Operations|listOperations}. - * @param error Error, if any - * @param [response] ListOperationsResponse - */ - type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|getOperation}. - * @param error Error, if any - * @param [response] Operation - */ - type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|deleteOperation}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|cancelOperation}. - * @param error Error, if any - * @param [response] Empty - */ - type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|waitOperation}. - * @param error Error, if any - * @param [response] Operation - */ - type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of an Operation. */ - interface IOperation { - - /** Operation name */ - name?: (string|null); - - /** Operation metadata */ - metadata?: (google.protobuf.IAny|null); - - /** Operation done */ - done?: (boolean|null); - - /** Operation error */ - error?: (google.rpc.IStatus|null); - - /** Operation response */ - response?: (google.protobuf.IAny|null); - } - - /** Represents an Operation. */ - class Operation implements IOperation { - - /** - * Constructs a new Operation. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IOperation); - - /** Operation name. */ - public name: string; - - /** Operation metadata. */ - public metadata?: (google.protobuf.IAny|null); - - /** Operation done. */ - public done: boolean; - - /** Operation error. */ - public error?: (google.rpc.IStatus|null); - - /** Operation response. */ - public response?: (google.protobuf.IAny|null); - - /** Operation result. */ - public result?: ("error"|"response"); - - /** - * Creates a new Operation instance using the specified properties. - * @param [properties] Properties to set - * @returns Operation instance - */ - public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; - - /** - * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @param message Operation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @param message Operation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Operation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; - - /** - * Decodes an Operation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; - - /** - * Verifies an Operation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Operation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Operation - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; - - /** - * Creates a plain object from an Operation message. Also converts values to other types if specified. - * @param message Operation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Operation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Operation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetOperationRequest. */ - interface IGetOperationRequest { - - /** GetOperationRequest name */ - name?: (string|null); - } - - /** Represents a GetOperationRequest. */ - class GetOperationRequest implements IGetOperationRequest { - - /** - * Constructs a new GetOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IGetOperationRequest); - - /** GetOperationRequest name. */ - public name: string; - - /** - * Creates a new GetOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetOperationRequest instance - */ - public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; - - /** - * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @param message GetOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @param message GetOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; - - /** - * Verifies a GetOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; - - /** - * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. - * @param message GetOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListOperationsRequest. */ - interface IListOperationsRequest { - - /** ListOperationsRequest name */ - name?: (string|null); - - /** ListOperationsRequest filter */ - filter?: (string|null); - - /** ListOperationsRequest pageSize */ - pageSize?: (number|null); - - /** ListOperationsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListOperationsRequest. */ - class ListOperationsRequest implements IListOperationsRequest { - - /** - * Constructs a new ListOperationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IListOperationsRequest); - - /** ListOperationsRequest name. */ - public name: string; - - /** ListOperationsRequest filter. */ - public filter: string; - - /** ListOperationsRequest pageSize. */ - public pageSize: number; - - /** ListOperationsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListOperationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListOperationsRequest instance - */ - public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; - - /** - * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @param message ListOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @param message ListOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; - - /** - * Verifies a ListOperationsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListOperationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; - - /** - * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. - * @param message ListOperationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListOperationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListOperationsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListOperationsResponse. */ - interface IListOperationsResponse { - - /** ListOperationsResponse operations */ - operations?: (google.longrunning.IOperation[]|null); - - /** ListOperationsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListOperationsResponse. */ - class ListOperationsResponse implements IListOperationsResponse { - - /** - * Constructs a new ListOperationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IListOperationsResponse); - - /** ListOperationsResponse operations. */ - public operations: google.longrunning.IOperation[]; - - /** ListOperationsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListOperationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListOperationsResponse instance - */ - public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; - - /** - * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @param message ListOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @param message ListOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; - - /** - * Verifies a ListOperationsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListOperationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; - - /** - * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. - * @param message ListOperationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListOperationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListOperationsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CancelOperationRequest. */ - interface ICancelOperationRequest { - - /** CancelOperationRequest name */ - name?: (string|null); - } - - /** Represents a CancelOperationRequest. */ - class CancelOperationRequest implements ICancelOperationRequest { - - /** - * Constructs a new CancelOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.ICancelOperationRequest); - - /** CancelOperationRequest name. */ - public name: string; - - /** - * Creates a new CancelOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CancelOperationRequest instance - */ - public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; - - /** - * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @param message CancelOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @param message CancelOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; - - /** - * Verifies a CancelOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CancelOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; - - /** - * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. - * @param message CancelOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CancelOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CancelOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteOperationRequest. */ - interface IDeleteOperationRequest { - - /** DeleteOperationRequest name */ - name?: (string|null); - } - - /** Represents a DeleteOperationRequest. */ - class DeleteOperationRequest implements IDeleteOperationRequest { - - /** - * Constructs a new DeleteOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IDeleteOperationRequest); - - /** DeleteOperationRequest name. */ - public name: string; - - /** - * Creates a new DeleteOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteOperationRequest instance - */ - public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; - - /** - * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @param message DeleteOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @param message DeleteOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; - - /** - * Verifies a DeleteOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; - - /** - * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. - * @param message DeleteOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a WaitOperationRequest. */ - interface IWaitOperationRequest { - - /** WaitOperationRequest name */ - name?: (string|null); - - /** WaitOperationRequest timeout */ - timeout?: (google.protobuf.IDuration|null); - } - - /** Represents a WaitOperationRequest. */ - class WaitOperationRequest implements IWaitOperationRequest { - - /** - * Constructs a new WaitOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IWaitOperationRequest); - - /** WaitOperationRequest name. */ - public name: string; - - /** WaitOperationRequest timeout. */ - public timeout?: (google.protobuf.IDuration|null); - - /** - * Creates a new WaitOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns WaitOperationRequest instance - */ - public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; - - /** - * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @param message WaitOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @param message WaitOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; - - /** - * Verifies a WaitOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WaitOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; - - /** - * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. - * @param message WaitOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WaitOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WaitOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OperationInfo. */ - interface IOperationInfo { - - /** OperationInfo responseType */ - responseType?: (string|null); - - /** OperationInfo metadataType */ - metadataType?: (string|null); - } - - /** Represents an OperationInfo. */ - class OperationInfo implements IOperationInfo { - - /** - * Constructs a new OperationInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IOperationInfo); - - /** OperationInfo responseType. */ - public responseType: string; - - /** OperationInfo metadataType. */ - public metadataType: string; - - /** - * Creates a new OperationInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns OperationInfo instance - */ - public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; - - /** - * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @param message OperationInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @param message OperationInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OperationInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; - - /** - * Decodes an OperationInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; - - /** - * Verifies an OperationInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OperationInfo - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; - - /** - * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. - * @param message OperationInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OperationInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OperationInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace rpc. */ - namespace rpc { - - /** Properties of a Status. */ - interface IStatus { - - /** Status code */ - code?: (number|null); - - /** Status message */ - message?: (string|null); - - /** Status details */ - details?: (google.protobuf.IAny[]|null); - } - - /** Represents a Status. */ - class Status implements IStatus { - - /** - * Constructs a new Status. - * @param [properties] Properties to set - */ - constructor(properties?: google.rpc.IStatus); - - /** Status code. */ - public code: number; - - /** Status message. */ - public message: string; - - /** Status details. */ - public details: google.protobuf.IAny[]; - - /** - * Creates a new Status instance using the specified properties. - * @param [properties] Properties to set - * @returns Status instance - */ - public static create(properties?: google.rpc.IStatus): google.rpc.Status; - - /** - * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @param message Status message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @param message Status message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Status message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; - - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; - - /** - * Verifies a Status message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Status - */ - public static fromObject(object: { [k: string]: any }): google.rpc.Status; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @param message Status - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Status to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Status - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } -} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.js b/owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.js deleted file mode 100644 index a1f625acff8..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.js +++ /dev/null @@ -1,42614 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*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_batch_protos || ($protobuf.roots._google_cloud_batch_protos = {}); - - $root.google = (function() { - - /** - * Namespace google. - * @exports google - * @namespace - */ - var google = {}; - - google.cloud = (function() { - - /** - * Namespace cloud. - * @memberof google - * @namespace - */ - var cloud = {}; - - cloud.batch = (function() { - - /** - * Namespace batch. - * @memberof google.cloud - * @namespace - */ - var batch = {}; - - batch.v1alpha = (function() { - - /** - * Namespace v1alpha. - * @memberof google.cloud.batch - * @namespace - */ - var v1alpha = {}; - - v1alpha.BatchService = (function() { - - /** - * Constructs a new BatchService service. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a BatchService - * @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 BatchService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (BatchService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = BatchService; - - /** - * Creates new BatchService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.batch.v1alpha.BatchService - * @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 {BatchService} RPC service. Useful where requests and/or responses are streamed. - */ - BatchService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|createJob}. - * @memberof google.cloud.batch.v1alpha.BatchService - * @typedef CreateJobCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.batch.v1alpha.Job} [response] Job - */ - - /** - * Calls CreateJob. - * @function createJob - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.ICreateJobRequest} request CreateJobRequest message or plain object - * @param {google.cloud.batch.v1alpha.BatchService.CreateJobCallback} callback Node-style callback called with the error, if any, and Job - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.createJob = function createJob(request, callback) { - return this.rpcCall(createJob, $root.google.cloud.batch.v1alpha.CreateJobRequest, $root.google.cloud.batch.v1alpha.Job, request, callback); - }, "name", { value: "CreateJob" }); - - /** - * Calls CreateJob. - * @function createJob - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.ICreateJobRequest} request CreateJobRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|getJob}. - * @memberof google.cloud.batch.v1alpha.BatchService - * @typedef GetJobCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.batch.v1alpha.Job} [response] Job - */ - - /** - * Calls GetJob. - * @function getJob - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IGetJobRequest} request GetJobRequest message or plain object - * @param {google.cloud.batch.v1alpha.BatchService.GetJobCallback} callback Node-style callback called with the error, if any, and Job - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.getJob = function getJob(request, callback) { - return this.rpcCall(getJob, $root.google.cloud.batch.v1alpha.GetJobRequest, $root.google.cloud.batch.v1alpha.Job, request, callback); - }, "name", { value: "GetJob" }); - - /** - * Calls GetJob. - * @function getJob - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IGetJobRequest} request GetJobRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|deleteJob}. - * @memberof google.cloud.batch.v1alpha.BatchService - * @typedef DeleteJobCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteJob. - * @function deleteJob - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IDeleteJobRequest} request DeleteJobRequest message or plain object - * @param {google.cloud.batch.v1alpha.BatchService.DeleteJobCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.deleteJob = function deleteJob(request, callback) { - return this.rpcCall(deleteJob, $root.google.cloud.batch.v1alpha.DeleteJobRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteJob" }); - - /** - * Calls DeleteJob. - * @function deleteJob - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IDeleteJobRequest} request DeleteJobRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|cancelJob}. - * @memberof google.cloud.batch.v1alpha.BatchService - * @typedef CancelJobCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CancelJob. - * @function cancelJob - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.ICancelJobRequest} request CancelJobRequest message or plain object - * @param {google.cloud.batch.v1alpha.BatchService.CancelJobCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.cancelJob = function cancelJob(request, callback) { - return this.rpcCall(cancelJob, $root.google.cloud.batch.v1alpha.CancelJobRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CancelJob" }); - - /** - * Calls CancelJob. - * @function cancelJob - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.ICancelJobRequest} request CancelJobRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|updateJob}. - * @memberof google.cloud.batch.v1alpha.BatchService - * @typedef UpdateJobCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.batch.v1alpha.Job} [response] Job - */ - - /** - * Calls UpdateJob. - * @function updateJob - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IUpdateJobRequest} request UpdateJobRequest message or plain object - * @param {google.cloud.batch.v1alpha.BatchService.UpdateJobCallback} callback Node-style callback called with the error, if any, and Job - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.updateJob = function updateJob(request, callback) { - return this.rpcCall(updateJob, $root.google.cloud.batch.v1alpha.UpdateJobRequest, $root.google.cloud.batch.v1alpha.Job, request, callback); - }, "name", { value: "UpdateJob" }); - - /** - * Calls UpdateJob. - * @function updateJob - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IUpdateJobRequest} request UpdateJobRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|listJobs}. - * @memberof google.cloud.batch.v1alpha.BatchService - * @typedef ListJobsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.batch.v1alpha.ListJobsResponse} [response] ListJobsResponse - */ - - /** - * Calls ListJobs. - * @function listJobs - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IListJobsRequest} request ListJobsRequest message or plain object - * @param {google.cloud.batch.v1alpha.BatchService.ListJobsCallback} callback Node-style callback called with the error, if any, and ListJobsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.listJobs = function listJobs(request, callback) { - return this.rpcCall(listJobs, $root.google.cloud.batch.v1alpha.ListJobsRequest, $root.google.cloud.batch.v1alpha.ListJobsResponse, request, callback); - }, "name", { value: "ListJobs" }); - - /** - * Calls ListJobs. - * @function listJobs - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IListJobsRequest} request ListJobsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|getTask}. - * @memberof google.cloud.batch.v1alpha.BatchService - * @typedef GetTaskCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.batch.v1alpha.Task} [response] Task - */ - - /** - * Calls GetTask. - * @function getTask - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IGetTaskRequest} request GetTaskRequest message or plain object - * @param {google.cloud.batch.v1alpha.BatchService.GetTaskCallback} callback Node-style callback called with the error, if any, and Task - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.getTask = function getTask(request, callback) { - return this.rpcCall(getTask, $root.google.cloud.batch.v1alpha.GetTaskRequest, $root.google.cloud.batch.v1alpha.Task, request, callback); - }, "name", { value: "GetTask" }); - - /** - * Calls GetTask. - * @function getTask - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IGetTaskRequest} request GetTaskRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|listTasks}. - * @memberof google.cloud.batch.v1alpha.BatchService - * @typedef ListTasksCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.batch.v1alpha.ListTasksResponse} [response] ListTasksResponse - */ - - /** - * Calls ListTasks. - * @function listTasks - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IListTasksRequest} request ListTasksRequest message or plain object - * @param {google.cloud.batch.v1alpha.BatchService.ListTasksCallback} callback Node-style callback called with the error, if any, and ListTasksResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.listTasks = function listTasks(request, callback) { - return this.rpcCall(listTasks, $root.google.cloud.batch.v1alpha.ListTasksRequest, $root.google.cloud.batch.v1alpha.ListTasksResponse, request, callback); - }, "name", { value: "ListTasks" }); - - /** - * Calls ListTasks. - * @function listTasks - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IListTasksRequest} request ListTasksRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|createResourceAllowance}. - * @memberof google.cloud.batch.v1alpha.BatchService - * @typedef CreateResourceAllowanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.batch.v1alpha.ResourceAllowance} [response] ResourceAllowance - */ - - /** - * Calls CreateResourceAllowance. - * @function createResourceAllowance - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest} request CreateResourceAllowanceRequest message or plain object - * @param {google.cloud.batch.v1alpha.BatchService.CreateResourceAllowanceCallback} callback Node-style callback called with the error, if any, and ResourceAllowance - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.createResourceAllowance = function createResourceAllowance(request, callback) { - return this.rpcCall(createResourceAllowance, $root.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest, $root.google.cloud.batch.v1alpha.ResourceAllowance, request, callback); - }, "name", { value: "CreateResourceAllowance" }); - - /** - * Calls CreateResourceAllowance. - * @function createResourceAllowance - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest} request CreateResourceAllowanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|getResourceAllowance}. - * @memberof google.cloud.batch.v1alpha.BatchService - * @typedef GetResourceAllowanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.batch.v1alpha.ResourceAllowance} [response] ResourceAllowance - */ - - /** - * Calls GetResourceAllowance. - * @function getResourceAllowance - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IGetResourceAllowanceRequest} request GetResourceAllowanceRequest message or plain object - * @param {google.cloud.batch.v1alpha.BatchService.GetResourceAllowanceCallback} callback Node-style callback called with the error, if any, and ResourceAllowance - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.getResourceAllowance = function getResourceAllowance(request, callback) { - return this.rpcCall(getResourceAllowance, $root.google.cloud.batch.v1alpha.GetResourceAllowanceRequest, $root.google.cloud.batch.v1alpha.ResourceAllowance, request, callback); - }, "name", { value: "GetResourceAllowance" }); - - /** - * Calls GetResourceAllowance. - * @function getResourceAllowance - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IGetResourceAllowanceRequest} request GetResourceAllowanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|deleteResourceAllowance}. - * @memberof google.cloud.batch.v1alpha.BatchService - * @typedef DeleteResourceAllowanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteResourceAllowance. - * @function deleteResourceAllowance - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest} request DeleteResourceAllowanceRequest message or plain object - * @param {google.cloud.batch.v1alpha.BatchService.DeleteResourceAllowanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.deleteResourceAllowance = function deleteResourceAllowance(request, callback) { - return this.rpcCall(deleteResourceAllowance, $root.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteResourceAllowance" }); - - /** - * Calls DeleteResourceAllowance. - * @function deleteResourceAllowance - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest} request DeleteResourceAllowanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|listResourceAllowances}. - * @memberof google.cloud.batch.v1alpha.BatchService - * @typedef ListResourceAllowancesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.batch.v1alpha.ListResourceAllowancesResponse} [response] ListResourceAllowancesResponse - */ - - /** - * Calls ListResourceAllowances. - * @function listResourceAllowances - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IListResourceAllowancesRequest} request ListResourceAllowancesRequest message or plain object - * @param {google.cloud.batch.v1alpha.BatchService.ListResourceAllowancesCallback} callback Node-style callback called with the error, if any, and ListResourceAllowancesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.listResourceAllowances = function listResourceAllowances(request, callback) { - return this.rpcCall(listResourceAllowances, $root.google.cloud.batch.v1alpha.ListResourceAllowancesRequest, $root.google.cloud.batch.v1alpha.ListResourceAllowancesResponse, request, callback); - }, "name", { value: "ListResourceAllowances" }); - - /** - * Calls ListResourceAllowances. - * @function listResourceAllowances - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IListResourceAllowancesRequest} request ListResourceAllowancesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|updateResourceAllowance}. - * @memberof google.cloud.batch.v1alpha.BatchService - * @typedef UpdateResourceAllowanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.batch.v1alpha.ResourceAllowance} [response] ResourceAllowance - */ - - /** - * Calls UpdateResourceAllowance. - * @function updateResourceAllowance - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest} request UpdateResourceAllowanceRequest message or plain object - * @param {google.cloud.batch.v1alpha.BatchService.UpdateResourceAllowanceCallback} callback Node-style callback called with the error, if any, and ResourceAllowance - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.updateResourceAllowance = function updateResourceAllowance(request, callback) { - return this.rpcCall(updateResourceAllowance, $root.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest, $root.google.cloud.batch.v1alpha.ResourceAllowance, request, callback); - }, "name", { value: "UpdateResourceAllowance" }); - - /** - * Calls UpdateResourceAllowance. - * @function updateResourceAllowance - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest} request UpdateResourceAllowanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return BatchService; - })(); - - v1alpha.CreateJobRequest = (function() { - - /** - * Properties of a CreateJobRequest. - * @memberof google.cloud.batch.v1alpha - * @interface ICreateJobRequest - * @property {string|null} [parent] CreateJobRequest parent - * @property {string|null} [jobId] CreateJobRequest jobId - * @property {google.cloud.batch.v1alpha.IJob|null} [job] CreateJobRequest job - * @property {string|null} [requestId] CreateJobRequest requestId - */ - - /** - * Constructs a new CreateJobRequest. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a CreateJobRequest. - * @implements ICreateJobRequest - * @constructor - * @param {google.cloud.batch.v1alpha.ICreateJobRequest=} [properties] Properties to set - */ - function CreateJobRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateJobRequest parent. - * @member {string} parent - * @memberof google.cloud.batch.v1alpha.CreateJobRequest - * @instance - */ - CreateJobRequest.prototype.parent = ""; - - /** - * CreateJobRequest jobId. - * @member {string} jobId - * @memberof google.cloud.batch.v1alpha.CreateJobRequest - * @instance - */ - CreateJobRequest.prototype.jobId = ""; - - /** - * CreateJobRequest job. - * @member {google.cloud.batch.v1alpha.IJob|null|undefined} job - * @memberof google.cloud.batch.v1alpha.CreateJobRequest - * @instance - */ - CreateJobRequest.prototype.job = null; - - /** - * CreateJobRequest requestId. - * @member {string} requestId - * @memberof google.cloud.batch.v1alpha.CreateJobRequest - * @instance - */ - CreateJobRequest.prototype.requestId = ""; - - /** - * Creates a new CreateJobRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.CreateJobRequest - * @static - * @param {google.cloud.batch.v1alpha.ICreateJobRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.CreateJobRequest} CreateJobRequest instance - */ - CreateJobRequest.create = function create(properties) { - return new CreateJobRequest(properties); - }; - - /** - * Encodes the specified CreateJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.CreateJobRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.CreateJobRequest - * @static - * @param {google.cloud.batch.v1alpha.ICreateJobRequest} message CreateJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateJobRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.jobId); - if (message.job != null && Object.hasOwnProperty.call(message, "job")) - $root.google.cloud.batch.v1alpha.Job.encode(message.job, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified CreateJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.CreateJobRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.CreateJobRequest - * @static - * @param {google.cloud.batch.v1alpha.ICreateJobRequest} message CreateJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateJobRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateJobRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.CreateJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.CreateJobRequest} CreateJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateJobRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.CreateJobRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.jobId = reader.string(); - break; - } - case 3: { - message.job = $root.google.cloud.batch.v1alpha.Job.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateJobRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.CreateJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.CreateJobRequest} CreateJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateJobRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateJobRequest message. - * @function verify - * @memberof google.cloud.batch.v1alpha.CreateJobRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateJobRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.jobId != null && message.hasOwnProperty("jobId")) - if (!$util.isString(message.jobId)) - return "jobId: string expected"; - if (message.job != null && message.hasOwnProperty("job")) { - var error = $root.google.cloud.batch.v1alpha.Job.verify(message.job); - if (error) - return "job." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a CreateJobRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.CreateJobRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.CreateJobRequest} CreateJobRequest - */ - CreateJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.CreateJobRequest) - return object; - var message = new $root.google.cloud.batch.v1alpha.CreateJobRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.jobId != null) - message.jobId = String(object.jobId); - if (object.job != null) { - if (typeof object.job !== "object") - throw TypeError(".google.cloud.batch.v1alpha.CreateJobRequest.job: object expected"); - message.job = $root.google.cloud.batch.v1alpha.Job.fromObject(object.job); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a CreateJobRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.CreateJobRequest - * @static - * @param {google.cloud.batch.v1alpha.CreateJobRequest} message CreateJobRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateJobRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.jobId = ""; - object.job = null; - object.requestId = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.jobId != null && message.hasOwnProperty("jobId")) - object.jobId = message.jobId; - if (message.job != null && message.hasOwnProperty("job")) - object.job = $root.google.cloud.batch.v1alpha.Job.toObject(message.job, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this CreateJobRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.CreateJobRequest - * @instance - * @returns {Object.} JSON object - */ - CreateJobRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateJobRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.CreateJobRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.CreateJobRequest"; - }; - - return CreateJobRequest; - })(); - - v1alpha.GetJobRequest = (function() { - - /** - * Properties of a GetJobRequest. - * @memberof google.cloud.batch.v1alpha - * @interface IGetJobRequest - * @property {string|null} [name] GetJobRequest name - */ - - /** - * Constructs a new GetJobRequest. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a GetJobRequest. - * @implements IGetJobRequest - * @constructor - * @param {google.cloud.batch.v1alpha.IGetJobRequest=} [properties] Properties to set - */ - function GetJobRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetJobRequest name. - * @member {string} name - * @memberof google.cloud.batch.v1alpha.GetJobRequest - * @instance - */ - GetJobRequest.prototype.name = ""; - - /** - * Creates a new GetJobRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.GetJobRequest - * @static - * @param {google.cloud.batch.v1alpha.IGetJobRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.GetJobRequest} GetJobRequest instance - */ - GetJobRequest.create = function create(properties) { - return new GetJobRequest(properties); - }; - - /** - * Encodes the specified GetJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.GetJobRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.GetJobRequest - * @static - * @param {google.cloud.batch.v1alpha.IGetJobRequest} message GetJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetJobRequest.encode = function encode(message, writer) { - 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 GetJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.GetJobRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.GetJobRequest - * @static - * @param {google.cloud.batch.v1alpha.IGetJobRequest} message GetJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetJobRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetJobRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.GetJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.GetJobRequest} GetJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetJobRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.GetJobRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetJobRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.GetJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.GetJobRequest} GetJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetJobRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetJobRequest message. - * @function verify - * @memberof google.cloud.batch.v1alpha.GetJobRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetJobRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetJobRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.GetJobRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.GetJobRequest} GetJobRequest - */ - GetJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.GetJobRequest) - return object; - var message = new $root.google.cloud.batch.v1alpha.GetJobRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetJobRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.GetJobRequest - * @static - * @param {google.cloud.batch.v1alpha.GetJobRequest} message GetJobRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetJobRequest.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 GetJobRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.GetJobRequest - * @instance - * @returns {Object.} JSON object - */ - GetJobRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetJobRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.GetJobRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.GetJobRequest"; - }; - - return GetJobRequest; - })(); - - v1alpha.DeleteJobRequest = (function() { - - /** - * Properties of a DeleteJobRequest. - * @memberof google.cloud.batch.v1alpha - * @interface IDeleteJobRequest - * @property {string|null} [name] DeleteJobRequest name - * @property {string|null} [reason] DeleteJobRequest reason - * @property {string|null} [requestId] DeleteJobRequest requestId - */ - - /** - * Constructs a new DeleteJobRequest. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a DeleteJobRequest. - * @implements IDeleteJobRequest - * @constructor - * @param {google.cloud.batch.v1alpha.IDeleteJobRequest=} [properties] Properties to set - */ - function DeleteJobRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteJobRequest name. - * @member {string} name - * @memberof google.cloud.batch.v1alpha.DeleteJobRequest - * @instance - */ - DeleteJobRequest.prototype.name = ""; - - /** - * DeleteJobRequest reason. - * @member {string} reason - * @memberof google.cloud.batch.v1alpha.DeleteJobRequest - * @instance - */ - DeleteJobRequest.prototype.reason = ""; - - /** - * DeleteJobRequest requestId. - * @member {string} requestId - * @memberof google.cloud.batch.v1alpha.DeleteJobRequest - * @instance - */ - DeleteJobRequest.prototype.requestId = ""; - - /** - * Creates a new DeleteJobRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.DeleteJobRequest - * @static - * @param {google.cloud.batch.v1alpha.IDeleteJobRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.DeleteJobRequest} DeleteJobRequest instance - */ - DeleteJobRequest.create = function create(properties) { - return new DeleteJobRequest(properties); - }; - - /** - * Encodes the specified DeleteJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.DeleteJobRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.DeleteJobRequest - * @static - * @param {google.cloud.batch.v1alpha.IDeleteJobRequest} message DeleteJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteJobRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.reason); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified DeleteJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.DeleteJobRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.DeleteJobRequest - * @static - * @param {google.cloud.batch.v1alpha.IDeleteJobRequest} message DeleteJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteJobRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteJobRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.DeleteJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.DeleteJobRequest} DeleteJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteJobRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.DeleteJobRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.reason = reader.string(); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteJobRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.DeleteJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.DeleteJobRequest} DeleteJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteJobRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteJobRequest message. - * @function verify - * @memberof google.cloud.batch.v1alpha.DeleteJobRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteJobRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.reason != null && message.hasOwnProperty("reason")) - if (!$util.isString(message.reason)) - return "reason: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a DeleteJobRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.DeleteJobRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.DeleteJobRequest} DeleteJobRequest - */ - DeleteJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.DeleteJobRequest) - return object; - var message = new $root.google.cloud.batch.v1alpha.DeleteJobRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.reason != null) - message.reason = String(object.reason); - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a DeleteJobRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.DeleteJobRequest - * @static - * @param {google.cloud.batch.v1alpha.DeleteJobRequest} message DeleteJobRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteJobRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.reason = ""; - object.requestId = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.reason != null && message.hasOwnProperty("reason")) - object.reason = message.reason; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this DeleteJobRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.DeleteJobRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteJobRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteJobRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.DeleteJobRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.DeleteJobRequest"; - }; - - return DeleteJobRequest; - })(); - - v1alpha.CancelJobRequest = (function() { - - /** - * Properties of a CancelJobRequest. - * @memberof google.cloud.batch.v1alpha - * @interface ICancelJobRequest - * @property {string|null} [name] CancelJobRequest name - * @property {string|null} [requestId] CancelJobRequest requestId - */ - - /** - * Constructs a new CancelJobRequest. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a CancelJobRequest. - * @implements ICancelJobRequest - * @constructor - * @param {google.cloud.batch.v1alpha.ICancelJobRequest=} [properties] Properties to set - */ - function CancelJobRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CancelJobRequest name. - * @member {string} name - * @memberof google.cloud.batch.v1alpha.CancelJobRequest - * @instance - */ - CancelJobRequest.prototype.name = ""; - - /** - * CancelJobRequest requestId. - * @member {string} requestId - * @memberof google.cloud.batch.v1alpha.CancelJobRequest - * @instance - */ - CancelJobRequest.prototype.requestId = ""; - - /** - * Creates a new CancelJobRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.CancelJobRequest - * @static - * @param {google.cloud.batch.v1alpha.ICancelJobRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.CancelJobRequest} CancelJobRequest instance - */ - CancelJobRequest.create = function create(properties) { - return new CancelJobRequest(properties); - }; - - /** - * Encodes the specified CancelJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.CancelJobRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.CancelJobRequest - * @static - * @param {google.cloud.batch.v1alpha.ICancelJobRequest} message CancelJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelJobRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified CancelJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.CancelJobRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.CancelJobRequest - * @static - * @param {google.cloud.batch.v1alpha.ICancelJobRequest} message CancelJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelJobRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CancelJobRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.CancelJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.CancelJobRequest} CancelJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelJobRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.CancelJobRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CancelJobRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.CancelJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.CancelJobRequest} CancelJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelJobRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CancelJobRequest message. - * @function verify - * @memberof google.cloud.batch.v1alpha.CancelJobRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CancelJobRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a CancelJobRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.CancelJobRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.CancelJobRequest} CancelJobRequest - */ - CancelJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.CancelJobRequest) - return object; - var message = new $root.google.cloud.batch.v1alpha.CancelJobRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a CancelJobRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.CancelJobRequest - * @static - * @param {google.cloud.batch.v1alpha.CancelJobRequest} message CancelJobRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CancelJobRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this CancelJobRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.CancelJobRequest - * @instance - * @returns {Object.} JSON object - */ - CancelJobRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CancelJobRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.CancelJobRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CancelJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.CancelJobRequest"; - }; - - return CancelJobRequest; - })(); - - v1alpha.CancelJobResponse = (function() { - - /** - * Properties of a CancelJobResponse. - * @memberof google.cloud.batch.v1alpha - * @interface ICancelJobResponse - */ - - /** - * Constructs a new CancelJobResponse. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a CancelJobResponse. - * @implements ICancelJobResponse - * @constructor - * @param {google.cloud.batch.v1alpha.ICancelJobResponse=} [properties] Properties to set - */ - function CancelJobResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Creates a new CancelJobResponse instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.CancelJobResponse - * @static - * @param {google.cloud.batch.v1alpha.ICancelJobResponse=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.CancelJobResponse} CancelJobResponse instance - */ - CancelJobResponse.create = function create(properties) { - return new CancelJobResponse(properties); - }; - - /** - * Encodes the specified CancelJobResponse message. Does not implicitly {@link google.cloud.batch.v1alpha.CancelJobResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.CancelJobResponse - * @static - * @param {google.cloud.batch.v1alpha.ICancelJobResponse} message CancelJobResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelJobResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified CancelJobResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.CancelJobResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.CancelJobResponse - * @static - * @param {google.cloud.batch.v1alpha.ICancelJobResponse} message CancelJobResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelJobResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CancelJobResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.CancelJobResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.CancelJobResponse} CancelJobResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelJobResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.CancelJobResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CancelJobResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.CancelJobResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.CancelJobResponse} CancelJobResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelJobResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CancelJobResponse message. - * @function verify - * @memberof google.cloud.batch.v1alpha.CancelJobResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CancelJobResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a CancelJobResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.CancelJobResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.CancelJobResponse} CancelJobResponse - */ - CancelJobResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.CancelJobResponse) - return object; - return new $root.google.cloud.batch.v1alpha.CancelJobResponse(); - }; - - /** - * Creates a plain object from a CancelJobResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.CancelJobResponse - * @static - * @param {google.cloud.batch.v1alpha.CancelJobResponse} message CancelJobResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CancelJobResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this CancelJobResponse to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.CancelJobResponse - * @instance - * @returns {Object.} JSON object - */ - CancelJobResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CancelJobResponse - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.CancelJobResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CancelJobResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.CancelJobResponse"; - }; - - return CancelJobResponse; - })(); - - v1alpha.UpdateJobRequest = (function() { - - /** - * Properties of an UpdateJobRequest. - * @memberof google.cloud.batch.v1alpha - * @interface IUpdateJobRequest - * @property {google.cloud.batch.v1alpha.IJob|null} [job] UpdateJobRequest job - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateJobRequest updateMask - * @property {string|null} [requestId] UpdateJobRequest requestId - */ - - /** - * Constructs a new UpdateJobRequest. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents an UpdateJobRequest. - * @implements IUpdateJobRequest - * @constructor - * @param {google.cloud.batch.v1alpha.IUpdateJobRequest=} [properties] Properties to set - */ - function UpdateJobRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateJobRequest job. - * @member {google.cloud.batch.v1alpha.IJob|null|undefined} job - * @memberof google.cloud.batch.v1alpha.UpdateJobRequest - * @instance - */ - UpdateJobRequest.prototype.job = null; - - /** - * UpdateJobRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.batch.v1alpha.UpdateJobRequest - * @instance - */ - UpdateJobRequest.prototype.updateMask = null; - - /** - * UpdateJobRequest requestId. - * @member {string} requestId - * @memberof google.cloud.batch.v1alpha.UpdateJobRequest - * @instance - */ - UpdateJobRequest.prototype.requestId = ""; - - /** - * Creates a new UpdateJobRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.UpdateJobRequest - * @static - * @param {google.cloud.batch.v1alpha.IUpdateJobRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.UpdateJobRequest} UpdateJobRequest instance - */ - UpdateJobRequest.create = function create(properties) { - return new UpdateJobRequest(properties); - }; - - /** - * Encodes the specified UpdateJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.UpdateJobRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.UpdateJobRequest - * @static - * @param {google.cloud.batch.v1alpha.IUpdateJobRequest} message UpdateJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateJobRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.job != null && Object.hasOwnProperty.call(message, "job")) - $root.google.cloud.batch.v1alpha.Job.encode(message.job, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified UpdateJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UpdateJobRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.UpdateJobRequest - * @static - * @param {google.cloud.batch.v1alpha.IUpdateJobRequest} message UpdateJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateJobRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateJobRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.UpdateJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.UpdateJobRequest} UpdateJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateJobRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.UpdateJobRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.job = $root.google.cloud.batch.v1alpha.Job.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateJobRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.UpdateJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.UpdateJobRequest} UpdateJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateJobRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateJobRequest message. - * @function verify - * @memberof google.cloud.batch.v1alpha.UpdateJobRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateJobRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.job != null && message.hasOwnProperty("job")) { - var error = $root.google.cloud.batch.v1alpha.Job.verify(message.job); - if (error) - return "job." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates an UpdateJobRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.UpdateJobRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.UpdateJobRequest} UpdateJobRequest - */ - UpdateJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.UpdateJobRequest) - return object; - var message = new $root.google.cloud.batch.v1alpha.UpdateJobRequest(); - if (object.job != null) { - if (typeof object.job !== "object") - throw TypeError(".google.cloud.batch.v1alpha.UpdateJobRequest.job: object expected"); - message.job = $root.google.cloud.batch.v1alpha.Job.fromObject(object.job); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.batch.v1alpha.UpdateJobRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from an UpdateJobRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.UpdateJobRequest - * @static - * @param {google.cloud.batch.v1alpha.UpdateJobRequest} message UpdateJobRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateJobRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.job = null; - object.updateMask = null; - object.requestId = ""; - } - if (message.job != null && message.hasOwnProperty("job")) - object.job = $root.google.cloud.batch.v1alpha.Job.toObject(message.job, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this UpdateJobRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.UpdateJobRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateJobRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateJobRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.UpdateJobRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.UpdateJobRequest"; - }; - - return UpdateJobRequest; - })(); - - v1alpha.ListJobsRequest = (function() { - - /** - * Properties of a ListJobsRequest. - * @memberof google.cloud.batch.v1alpha - * @interface IListJobsRequest - * @property {string|null} [parent] ListJobsRequest parent - * @property {string|null} [filter] ListJobsRequest filter - * @property {string|null} [orderBy] ListJobsRequest orderBy - * @property {number|null} [pageSize] ListJobsRequest pageSize - * @property {string|null} [pageToken] ListJobsRequest pageToken - */ - - /** - * Constructs a new ListJobsRequest. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a ListJobsRequest. - * @implements IListJobsRequest - * @constructor - * @param {google.cloud.batch.v1alpha.IListJobsRequest=} [properties] Properties to set - */ - function ListJobsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListJobsRequest parent. - * @member {string} parent - * @memberof google.cloud.batch.v1alpha.ListJobsRequest - * @instance - */ - ListJobsRequest.prototype.parent = ""; - - /** - * ListJobsRequest filter. - * @member {string} filter - * @memberof google.cloud.batch.v1alpha.ListJobsRequest - * @instance - */ - ListJobsRequest.prototype.filter = ""; - - /** - * ListJobsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.batch.v1alpha.ListJobsRequest - * @instance - */ - ListJobsRequest.prototype.orderBy = ""; - - /** - * ListJobsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.batch.v1alpha.ListJobsRequest - * @instance - */ - ListJobsRequest.prototype.pageSize = 0; - - /** - * ListJobsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.batch.v1alpha.ListJobsRequest - * @instance - */ - ListJobsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListJobsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.ListJobsRequest - * @static - * @param {google.cloud.batch.v1alpha.IListJobsRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.ListJobsRequest} ListJobsRequest instance - */ - ListJobsRequest.create = function create(properties) { - return new ListJobsRequest(properties); - }; - - /** - * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.ListJobsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.ListJobsRequest - * @static - * @param {google.cloud.batch.v1alpha.IListJobsRequest} message ListJobsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListJobsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; - - /** - * Encodes the specified ListJobsRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListJobsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.ListJobsRequest - * @static - * @param {google.cloud.batch.v1alpha.IListJobsRequest} message ListJobsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListJobsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.ListJobsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.ListJobsRequest} ListJobsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListJobsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ListJobsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListJobsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.ListJobsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.ListJobsRequest} ListJobsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListJobsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListJobsRequest message. - * @function verify - * @memberof google.cloud.batch.v1alpha.ListJobsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListJobsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListJobsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.ListJobsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.ListJobsRequest} ListJobsRequest - */ - ListJobsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.ListJobsRequest) - return object; - var message = new $root.google.cloud.batch.v1alpha.ListJobsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListJobsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.ListJobsRequest - * @static - * @param {google.cloud.batch.v1alpha.ListJobsRequest} message ListJobsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListJobsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; - - /** - * Converts this ListJobsRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.ListJobsRequest - * @instance - * @returns {Object.} JSON object - */ - ListJobsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListJobsRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.ListJobsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListJobsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.ListJobsRequest"; - }; - - return ListJobsRequest; - })(); - - v1alpha.ListJobsResponse = (function() { - - /** - * Properties of a ListJobsResponse. - * @memberof google.cloud.batch.v1alpha - * @interface IListJobsResponse - * @property {Array.|null} [jobs] ListJobsResponse jobs - * @property {string|null} [nextPageToken] ListJobsResponse nextPageToken - * @property {Array.|null} [unreachable] ListJobsResponse unreachable - */ - - /** - * Constructs a new ListJobsResponse. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a ListJobsResponse. - * @implements IListJobsResponse - * @constructor - * @param {google.cloud.batch.v1alpha.IListJobsResponse=} [properties] Properties to set - */ - function ListJobsResponse(properties) { - this.jobs = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListJobsResponse jobs. - * @member {Array.} jobs - * @memberof google.cloud.batch.v1alpha.ListJobsResponse - * @instance - */ - ListJobsResponse.prototype.jobs = $util.emptyArray; - - /** - * ListJobsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.batch.v1alpha.ListJobsResponse - * @instance - */ - ListJobsResponse.prototype.nextPageToken = ""; - - /** - * ListJobsResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.batch.v1alpha.ListJobsResponse - * @instance - */ - ListJobsResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListJobsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.ListJobsResponse - * @static - * @param {google.cloud.batch.v1alpha.IListJobsResponse=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.ListJobsResponse} ListJobsResponse instance - */ - ListJobsResponse.create = function create(properties) { - return new ListJobsResponse(properties); - }; - - /** - * Encodes the specified ListJobsResponse message. Does not implicitly {@link google.cloud.batch.v1alpha.ListJobsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.ListJobsResponse - * @static - * @param {google.cloud.batch.v1alpha.IListJobsResponse} message ListJobsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListJobsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.jobs != null && message.jobs.length) - for (var i = 0; i < message.jobs.length; ++i) - $root.google.cloud.batch.v1alpha.Job.encode(message.jobs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; - - /** - * Encodes the specified ListJobsResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListJobsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.ListJobsResponse - * @static - * @param {google.cloud.batch.v1alpha.IListJobsResponse} message ListJobsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListJobsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListJobsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.ListJobsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.ListJobsResponse} ListJobsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListJobsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ListJobsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.jobs && message.jobs.length)) - message.jobs = []; - message.jobs.push($root.google.cloud.batch.v1alpha.Job.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListJobsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.ListJobsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.ListJobsResponse} ListJobsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListJobsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListJobsResponse message. - * @function verify - * @memberof google.cloud.batch.v1alpha.ListJobsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListJobsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.jobs != null && message.hasOwnProperty("jobs")) { - if (!Array.isArray(message.jobs)) - return "jobs: array expected"; - for (var i = 0; i < message.jobs.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.Job.verify(message.jobs[i]); - if (error) - return "jobs." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; - - /** - * Creates a ListJobsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.ListJobsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.ListJobsResponse} ListJobsResponse - */ - ListJobsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.ListJobsResponse) - return object; - var message = new $root.google.cloud.batch.v1alpha.ListJobsResponse(); - if (object.jobs) { - if (!Array.isArray(object.jobs)) - throw TypeError(".google.cloud.batch.v1alpha.ListJobsResponse.jobs: array expected"); - message.jobs = []; - for (var i = 0; i < object.jobs.length; ++i) { - if (typeof object.jobs[i] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.ListJobsResponse.jobs: object expected"); - message.jobs[i] = $root.google.cloud.batch.v1alpha.Job.fromObject(object.jobs[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.batch.v1alpha.ListJobsResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListJobsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.ListJobsResponse - * @static - * @param {google.cloud.batch.v1alpha.ListJobsResponse} message ListJobsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListJobsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.jobs = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.jobs && message.jobs.length) { - object.jobs = []; - for (var j = 0; j < message.jobs.length; ++j) - object.jobs[j] = $root.google.cloud.batch.v1alpha.Job.toObject(message.jobs[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; - - /** - * Converts this ListJobsResponse to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.ListJobsResponse - * @instance - * @returns {Object.} JSON object - */ - ListJobsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListJobsResponse - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.ListJobsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListJobsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.ListJobsResponse"; - }; - - return ListJobsResponse; - })(); - - v1alpha.ListTasksRequest = (function() { - - /** - * Properties of a ListTasksRequest. - * @memberof google.cloud.batch.v1alpha - * @interface IListTasksRequest - * @property {string|null} [parent] ListTasksRequest parent - * @property {string|null} [filter] ListTasksRequest filter - * @property {string|null} [orderBy] ListTasksRequest orderBy - * @property {number|null} [pageSize] ListTasksRequest pageSize - * @property {string|null} [pageToken] ListTasksRequest pageToken - */ - - /** - * Constructs a new ListTasksRequest. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a ListTasksRequest. - * @implements IListTasksRequest - * @constructor - * @param {google.cloud.batch.v1alpha.IListTasksRequest=} [properties] Properties to set - */ - function ListTasksRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListTasksRequest parent. - * @member {string} parent - * @memberof google.cloud.batch.v1alpha.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.parent = ""; - - /** - * ListTasksRequest filter. - * @member {string} filter - * @memberof google.cloud.batch.v1alpha.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.filter = ""; - - /** - * ListTasksRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.batch.v1alpha.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.orderBy = ""; - - /** - * ListTasksRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.batch.v1alpha.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.pageSize = 0; - - /** - * ListTasksRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.batch.v1alpha.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.pageToken = ""; - - /** - * Creates a new ListTasksRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.ListTasksRequest - * @static - * @param {google.cloud.batch.v1alpha.IListTasksRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.ListTasksRequest} ListTasksRequest instance - */ - ListTasksRequest.create = function create(properties) { - return new ListTasksRequest(properties); - }; - - /** - * Encodes the specified ListTasksRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.ListTasksRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.ListTasksRequest - * @static - * @param {google.cloud.batch.v1alpha.IListTasksRequest} message ListTasksRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTasksRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; - - /** - * Encodes the specified ListTasksRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListTasksRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.ListTasksRequest - * @static - * @param {google.cloud.batch.v1alpha.IListTasksRequest} message ListTasksRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTasksRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListTasksRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.ListTasksRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.ListTasksRequest} ListTasksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTasksRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ListTasksRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListTasksRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.ListTasksRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.ListTasksRequest} ListTasksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTasksRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListTasksRequest message. - * @function verify - * @memberof google.cloud.batch.v1alpha.ListTasksRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListTasksRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListTasksRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.ListTasksRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.ListTasksRequest} ListTasksRequest - */ - ListTasksRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.ListTasksRequest) - return object; - var message = new $root.google.cloud.batch.v1alpha.ListTasksRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListTasksRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.ListTasksRequest - * @static - * @param {google.cloud.batch.v1alpha.ListTasksRequest} message ListTasksRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListTasksRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; - - /** - * Converts this ListTasksRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.ListTasksRequest - * @instance - * @returns {Object.} JSON object - */ - ListTasksRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListTasksRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.ListTasksRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListTasksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.ListTasksRequest"; - }; - - return ListTasksRequest; - })(); - - v1alpha.ListTasksResponse = (function() { - - /** - * Properties of a ListTasksResponse. - * @memberof google.cloud.batch.v1alpha - * @interface IListTasksResponse - * @property {Array.|null} [tasks] ListTasksResponse tasks - * @property {string|null} [nextPageToken] ListTasksResponse nextPageToken - * @property {Array.|null} [unreachable] ListTasksResponse unreachable - */ - - /** - * Constructs a new ListTasksResponse. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a ListTasksResponse. - * @implements IListTasksResponse - * @constructor - * @param {google.cloud.batch.v1alpha.IListTasksResponse=} [properties] Properties to set - */ - function ListTasksResponse(properties) { - this.tasks = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListTasksResponse tasks. - * @member {Array.} tasks - * @memberof google.cloud.batch.v1alpha.ListTasksResponse - * @instance - */ - ListTasksResponse.prototype.tasks = $util.emptyArray; - - /** - * ListTasksResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.batch.v1alpha.ListTasksResponse - * @instance - */ - ListTasksResponse.prototype.nextPageToken = ""; - - /** - * ListTasksResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.batch.v1alpha.ListTasksResponse - * @instance - */ - ListTasksResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListTasksResponse instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.ListTasksResponse - * @static - * @param {google.cloud.batch.v1alpha.IListTasksResponse=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.ListTasksResponse} ListTasksResponse instance - */ - ListTasksResponse.create = function create(properties) { - return new ListTasksResponse(properties); - }; - - /** - * Encodes the specified ListTasksResponse message. Does not implicitly {@link google.cloud.batch.v1alpha.ListTasksResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.ListTasksResponse - * @static - * @param {google.cloud.batch.v1alpha.IListTasksResponse} message ListTasksResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTasksResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tasks != null && message.tasks.length) - for (var i = 0; i < message.tasks.length; ++i) - $root.google.cloud.batch.v1alpha.Task.encode(message.tasks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; - - /** - * Encodes the specified ListTasksResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListTasksResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.ListTasksResponse - * @static - * @param {google.cloud.batch.v1alpha.IListTasksResponse} message ListTasksResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTasksResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListTasksResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.ListTasksResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.ListTasksResponse} ListTasksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTasksResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ListTasksResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.tasks && message.tasks.length)) - message.tasks = []; - message.tasks.push($root.google.cloud.batch.v1alpha.Task.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListTasksResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.ListTasksResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.ListTasksResponse} ListTasksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTasksResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListTasksResponse message. - * @function verify - * @memberof google.cloud.batch.v1alpha.ListTasksResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListTasksResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tasks != null && message.hasOwnProperty("tasks")) { - if (!Array.isArray(message.tasks)) - return "tasks: array expected"; - for (var i = 0; i < message.tasks.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.Task.verify(message.tasks[i]); - if (error) - return "tasks." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; - - /** - * Creates a ListTasksResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.ListTasksResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.ListTasksResponse} ListTasksResponse - */ - ListTasksResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.ListTasksResponse) - return object; - var message = new $root.google.cloud.batch.v1alpha.ListTasksResponse(); - if (object.tasks) { - if (!Array.isArray(object.tasks)) - throw TypeError(".google.cloud.batch.v1alpha.ListTasksResponse.tasks: array expected"); - message.tasks = []; - for (var i = 0; i < object.tasks.length; ++i) { - if (typeof object.tasks[i] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.ListTasksResponse.tasks: object expected"); - message.tasks[i] = $root.google.cloud.batch.v1alpha.Task.fromObject(object.tasks[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.batch.v1alpha.ListTasksResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListTasksResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.ListTasksResponse - * @static - * @param {google.cloud.batch.v1alpha.ListTasksResponse} message ListTasksResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListTasksResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.tasks = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.tasks && message.tasks.length) { - object.tasks = []; - for (var j = 0; j < message.tasks.length; ++j) - object.tasks[j] = $root.google.cloud.batch.v1alpha.Task.toObject(message.tasks[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; - - /** - * Converts this ListTasksResponse to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.ListTasksResponse - * @instance - * @returns {Object.} JSON object - */ - ListTasksResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListTasksResponse - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.ListTasksResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListTasksResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.ListTasksResponse"; - }; - - return ListTasksResponse; - })(); - - v1alpha.GetTaskRequest = (function() { - - /** - * Properties of a GetTaskRequest. - * @memberof google.cloud.batch.v1alpha - * @interface IGetTaskRequest - * @property {string|null} [name] GetTaskRequest name - */ - - /** - * Constructs a new GetTaskRequest. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a GetTaskRequest. - * @implements IGetTaskRequest - * @constructor - * @param {google.cloud.batch.v1alpha.IGetTaskRequest=} [properties] Properties to set - */ - function GetTaskRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTaskRequest name. - * @member {string} name - * @memberof google.cloud.batch.v1alpha.GetTaskRequest - * @instance - */ - GetTaskRequest.prototype.name = ""; - - /** - * Creates a new GetTaskRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.GetTaskRequest - * @static - * @param {google.cloud.batch.v1alpha.IGetTaskRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.GetTaskRequest} GetTaskRequest instance - */ - GetTaskRequest.create = function create(properties) { - return new GetTaskRequest(properties); - }; - - /** - * Encodes the specified GetTaskRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.GetTaskRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.GetTaskRequest - * @static - * @param {google.cloud.batch.v1alpha.IGetTaskRequest} message GetTaskRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTaskRequest.encode = function encode(message, writer) { - 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 GetTaskRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.GetTaskRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.GetTaskRequest - * @static - * @param {google.cloud.batch.v1alpha.IGetTaskRequest} message GetTaskRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTaskRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTaskRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.GetTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.GetTaskRequest} GetTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTaskRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.GetTaskRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTaskRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.GetTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.GetTaskRequest} GetTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTaskRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTaskRequest message. - * @function verify - * @memberof google.cloud.batch.v1alpha.GetTaskRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTaskRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetTaskRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.GetTaskRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.GetTaskRequest} GetTaskRequest - */ - GetTaskRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.GetTaskRequest) - return object; - var message = new $root.google.cloud.batch.v1alpha.GetTaskRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetTaskRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.GetTaskRequest - * @static - * @param {google.cloud.batch.v1alpha.GetTaskRequest} message GetTaskRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTaskRequest.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 GetTaskRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.GetTaskRequest - * @instance - * @returns {Object.} JSON object - */ - GetTaskRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetTaskRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.GetTaskRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetTaskRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.GetTaskRequest"; - }; - - return GetTaskRequest; - })(); - - v1alpha.CreateResourceAllowanceRequest = (function() { - - /** - * Properties of a CreateResourceAllowanceRequest. - * @memberof google.cloud.batch.v1alpha - * @interface ICreateResourceAllowanceRequest - * @property {string|null} [parent] CreateResourceAllowanceRequest parent - * @property {string|null} [resourceAllowanceId] CreateResourceAllowanceRequest resourceAllowanceId - * @property {google.cloud.batch.v1alpha.IResourceAllowance|null} [resourceAllowance] CreateResourceAllowanceRequest resourceAllowance - * @property {string|null} [requestId] CreateResourceAllowanceRequest requestId - */ - - /** - * Constructs a new CreateResourceAllowanceRequest. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a CreateResourceAllowanceRequest. - * @implements ICreateResourceAllowanceRequest - * @constructor - * @param {google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest=} [properties] Properties to set - */ - function CreateResourceAllowanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateResourceAllowanceRequest parent. - * @member {string} parent - * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest - * @instance - */ - CreateResourceAllowanceRequest.prototype.parent = ""; - - /** - * CreateResourceAllowanceRequest resourceAllowanceId. - * @member {string} resourceAllowanceId - * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest - * @instance - */ - CreateResourceAllowanceRequest.prototype.resourceAllowanceId = ""; - - /** - * CreateResourceAllowanceRequest resourceAllowance. - * @member {google.cloud.batch.v1alpha.IResourceAllowance|null|undefined} resourceAllowance - * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest - * @instance - */ - CreateResourceAllowanceRequest.prototype.resourceAllowance = null; - - /** - * CreateResourceAllowanceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest - * @instance - */ - CreateResourceAllowanceRequest.prototype.requestId = ""; - - /** - * Creates a new CreateResourceAllowanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest - * @static - * @param {google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.CreateResourceAllowanceRequest} CreateResourceAllowanceRequest instance - */ - CreateResourceAllowanceRequest.create = function create(properties) { - return new CreateResourceAllowanceRequest(properties); - }; - - /** - * Encodes the specified CreateResourceAllowanceRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.CreateResourceAllowanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest - * @static - * @param {google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest} message CreateResourceAllowanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateResourceAllowanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.resourceAllowanceId != null && Object.hasOwnProperty.call(message, "resourceAllowanceId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceAllowanceId); - if (message.resourceAllowance != null && Object.hasOwnProperty.call(message, "resourceAllowance")) - $root.google.cloud.batch.v1alpha.ResourceAllowance.encode(message.resourceAllowance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified CreateResourceAllowanceRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.CreateResourceAllowanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest - * @static - * @param {google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest} message CreateResourceAllowanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateResourceAllowanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateResourceAllowanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.CreateResourceAllowanceRequest} CreateResourceAllowanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateResourceAllowanceRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.resourceAllowanceId = reader.string(); - break; - } - case 3: { - message.resourceAllowance = $root.google.cloud.batch.v1alpha.ResourceAllowance.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateResourceAllowanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.CreateResourceAllowanceRequest} CreateResourceAllowanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateResourceAllowanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateResourceAllowanceRequest message. - * @function verify - * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateResourceAllowanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.resourceAllowanceId != null && message.hasOwnProperty("resourceAllowanceId")) - if (!$util.isString(message.resourceAllowanceId)) - return "resourceAllowanceId: string expected"; - if (message.resourceAllowance != null && message.hasOwnProperty("resourceAllowance")) { - var error = $root.google.cloud.batch.v1alpha.ResourceAllowance.verify(message.resourceAllowance); - if (error) - return "resourceAllowance." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a CreateResourceAllowanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.CreateResourceAllowanceRequest} CreateResourceAllowanceRequest - */ - CreateResourceAllowanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest) - return object; - var message = new $root.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.resourceAllowanceId != null) - message.resourceAllowanceId = String(object.resourceAllowanceId); - if (object.resourceAllowance != null) { - if (typeof object.resourceAllowance !== "object") - throw TypeError(".google.cloud.batch.v1alpha.CreateResourceAllowanceRequest.resourceAllowance: object expected"); - message.resourceAllowance = $root.google.cloud.batch.v1alpha.ResourceAllowance.fromObject(object.resourceAllowance); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a CreateResourceAllowanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest - * @static - * @param {google.cloud.batch.v1alpha.CreateResourceAllowanceRequest} message CreateResourceAllowanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateResourceAllowanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.resourceAllowanceId = ""; - object.resourceAllowance = null; - object.requestId = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.resourceAllowanceId != null && message.hasOwnProperty("resourceAllowanceId")) - object.resourceAllowanceId = message.resourceAllowanceId; - if (message.resourceAllowance != null && message.hasOwnProperty("resourceAllowance")) - object.resourceAllowance = $root.google.cloud.batch.v1alpha.ResourceAllowance.toObject(message.resourceAllowance, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this CreateResourceAllowanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest - * @instance - * @returns {Object.} JSON object - */ - CreateResourceAllowanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateResourceAllowanceRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateResourceAllowanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.CreateResourceAllowanceRequest"; - }; - - return CreateResourceAllowanceRequest; - })(); - - v1alpha.GetResourceAllowanceRequest = (function() { - - /** - * Properties of a GetResourceAllowanceRequest. - * @memberof google.cloud.batch.v1alpha - * @interface IGetResourceAllowanceRequest - * @property {string|null} [name] GetResourceAllowanceRequest name - */ - - /** - * Constructs a new GetResourceAllowanceRequest. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a GetResourceAllowanceRequest. - * @implements IGetResourceAllowanceRequest - * @constructor - * @param {google.cloud.batch.v1alpha.IGetResourceAllowanceRequest=} [properties] Properties to set - */ - function GetResourceAllowanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetResourceAllowanceRequest name. - * @member {string} name - * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest - * @instance - */ - GetResourceAllowanceRequest.prototype.name = ""; - - /** - * Creates a new GetResourceAllowanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest - * @static - * @param {google.cloud.batch.v1alpha.IGetResourceAllowanceRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.GetResourceAllowanceRequest} GetResourceAllowanceRequest instance - */ - GetResourceAllowanceRequest.create = function create(properties) { - return new GetResourceAllowanceRequest(properties); - }; - - /** - * Encodes the specified GetResourceAllowanceRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.GetResourceAllowanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest - * @static - * @param {google.cloud.batch.v1alpha.IGetResourceAllowanceRequest} message GetResourceAllowanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetResourceAllowanceRequest.encode = function encode(message, writer) { - 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 GetResourceAllowanceRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.GetResourceAllowanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest - * @static - * @param {google.cloud.batch.v1alpha.IGetResourceAllowanceRequest} message GetResourceAllowanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetResourceAllowanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetResourceAllowanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.GetResourceAllowanceRequest} GetResourceAllowanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetResourceAllowanceRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.GetResourceAllowanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetResourceAllowanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.GetResourceAllowanceRequest} GetResourceAllowanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetResourceAllowanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetResourceAllowanceRequest message. - * @function verify - * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetResourceAllowanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetResourceAllowanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.GetResourceAllowanceRequest} GetResourceAllowanceRequest - */ - GetResourceAllowanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.GetResourceAllowanceRequest) - return object; - var message = new $root.google.cloud.batch.v1alpha.GetResourceAllowanceRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetResourceAllowanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest - * @static - * @param {google.cloud.batch.v1alpha.GetResourceAllowanceRequest} message GetResourceAllowanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetResourceAllowanceRequest.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 GetResourceAllowanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest - * @instance - * @returns {Object.} JSON object - */ - GetResourceAllowanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetResourceAllowanceRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetResourceAllowanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.GetResourceAllowanceRequest"; - }; - - return GetResourceAllowanceRequest; - })(); - - v1alpha.DeleteResourceAllowanceRequest = (function() { - - /** - * Properties of a DeleteResourceAllowanceRequest. - * @memberof google.cloud.batch.v1alpha - * @interface IDeleteResourceAllowanceRequest - * @property {string|null} [name] DeleteResourceAllowanceRequest name - * @property {string|null} [reason] DeleteResourceAllowanceRequest reason - * @property {string|null} [requestId] DeleteResourceAllowanceRequest requestId - */ - - /** - * Constructs a new DeleteResourceAllowanceRequest. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a DeleteResourceAllowanceRequest. - * @implements IDeleteResourceAllowanceRequest - * @constructor - * @param {google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest=} [properties] Properties to set - */ - function DeleteResourceAllowanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteResourceAllowanceRequest name. - * @member {string} name - * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest - * @instance - */ - DeleteResourceAllowanceRequest.prototype.name = ""; - - /** - * DeleteResourceAllowanceRequest reason. - * @member {string} reason - * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest - * @instance - */ - DeleteResourceAllowanceRequest.prototype.reason = ""; - - /** - * DeleteResourceAllowanceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest - * @instance - */ - DeleteResourceAllowanceRequest.prototype.requestId = ""; - - /** - * Creates a new DeleteResourceAllowanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest - * @static - * @param {google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest} DeleteResourceAllowanceRequest instance - */ - DeleteResourceAllowanceRequest.create = function create(properties) { - return new DeleteResourceAllowanceRequest(properties); - }; - - /** - * Encodes the specified DeleteResourceAllowanceRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest - * @static - * @param {google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest} message DeleteResourceAllowanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteResourceAllowanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.reason); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified DeleteResourceAllowanceRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest - * @static - * @param {google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest} message DeleteResourceAllowanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteResourceAllowanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteResourceAllowanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest} DeleteResourceAllowanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteResourceAllowanceRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.reason = reader.string(); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteResourceAllowanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest} DeleteResourceAllowanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteResourceAllowanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteResourceAllowanceRequest message. - * @function verify - * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteResourceAllowanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.reason != null && message.hasOwnProperty("reason")) - if (!$util.isString(message.reason)) - return "reason: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a DeleteResourceAllowanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest} DeleteResourceAllowanceRequest - */ - DeleteResourceAllowanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest) - return object; - var message = new $root.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.reason != null) - message.reason = String(object.reason); - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a DeleteResourceAllowanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest - * @static - * @param {google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest} message DeleteResourceAllowanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteResourceAllowanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.reason = ""; - object.requestId = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.reason != null && message.hasOwnProperty("reason")) - object.reason = message.reason; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this DeleteResourceAllowanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteResourceAllowanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteResourceAllowanceRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteResourceAllowanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest"; - }; - - return DeleteResourceAllowanceRequest; - })(); - - v1alpha.ListResourceAllowancesRequest = (function() { - - /** - * Properties of a ListResourceAllowancesRequest. - * @memberof google.cloud.batch.v1alpha - * @interface IListResourceAllowancesRequest - * @property {string|null} [parent] ListResourceAllowancesRequest parent - * @property {number|null} [pageSize] ListResourceAllowancesRequest pageSize - * @property {string|null} [pageToken] ListResourceAllowancesRequest pageToken - */ - - /** - * Constructs a new ListResourceAllowancesRequest. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a ListResourceAllowancesRequest. - * @implements IListResourceAllowancesRequest - * @constructor - * @param {google.cloud.batch.v1alpha.IListResourceAllowancesRequest=} [properties] Properties to set - */ - function ListResourceAllowancesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListResourceAllowancesRequest parent. - * @member {string} parent - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest - * @instance - */ - ListResourceAllowancesRequest.prototype.parent = ""; - - /** - * ListResourceAllowancesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest - * @instance - */ - ListResourceAllowancesRequest.prototype.pageSize = 0; - - /** - * ListResourceAllowancesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest - * @instance - */ - ListResourceAllowancesRequest.prototype.pageToken = ""; - - /** - * Creates a new ListResourceAllowancesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest - * @static - * @param {google.cloud.batch.v1alpha.IListResourceAllowancesRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.ListResourceAllowancesRequest} ListResourceAllowancesRequest instance - */ - ListResourceAllowancesRequest.create = function create(properties) { - return new ListResourceAllowancesRequest(properties); - }; - - /** - * Encodes the specified ListResourceAllowancesRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.ListResourceAllowancesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest - * @static - * @param {google.cloud.batch.v1alpha.IListResourceAllowancesRequest} message ListResourceAllowancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListResourceAllowancesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListResourceAllowancesRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListResourceAllowancesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest - * @static - * @param {google.cloud.batch.v1alpha.IListResourceAllowancesRequest} message ListResourceAllowancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListResourceAllowancesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListResourceAllowancesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.ListResourceAllowancesRequest} ListResourceAllowancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListResourceAllowancesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ListResourceAllowancesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListResourceAllowancesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.ListResourceAllowancesRequest} ListResourceAllowancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListResourceAllowancesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListResourceAllowancesRequest message. - * @function verify - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListResourceAllowancesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListResourceAllowancesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.ListResourceAllowancesRequest} ListResourceAllowancesRequest - */ - ListResourceAllowancesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.ListResourceAllowancesRequest) - return object; - var message = new $root.google.cloud.batch.v1alpha.ListResourceAllowancesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListResourceAllowancesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest - * @static - * @param {google.cloud.batch.v1alpha.ListResourceAllowancesRequest} message ListResourceAllowancesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListResourceAllowancesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListResourceAllowancesRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest - * @instance - * @returns {Object.} JSON object - */ - ListResourceAllowancesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListResourceAllowancesRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListResourceAllowancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.ListResourceAllowancesRequest"; - }; - - return ListResourceAllowancesRequest; - })(); - - v1alpha.ListResourceAllowancesResponse = (function() { - - /** - * Properties of a ListResourceAllowancesResponse. - * @memberof google.cloud.batch.v1alpha - * @interface IListResourceAllowancesResponse - * @property {Array.|null} [resourceAllowances] ListResourceAllowancesResponse resourceAllowances - * @property {string|null} [nextPageToken] ListResourceAllowancesResponse nextPageToken - * @property {Array.|null} [unreachable] ListResourceAllowancesResponse unreachable - */ - - /** - * Constructs a new ListResourceAllowancesResponse. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a ListResourceAllowancesResponse. - * @implements IListResourceAllowancesResponse - * @constructor - * @param {google.cloud.batch.v1alpha.IListResourceAllowancesResponse=} [properties] Properties to set - */ - function ListResourceAllowancesResponse(properties) { - this.resourceAllowances = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListResourceAllowancesResponse resourceAllowances. - * @member {Array.} resourceAllowances - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse - * @instance - */ - ListResourceAllowancesResponse.prototype.resourceAllowances = $util.emptyArray; - - /** - * ListResourceAllowancesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse - * @instance - */ - ListResourceAllowancesResponse.prototype.nextPageToken = ""; - - /** - * ListResourceAllowancesResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse - * @instance - */ - ListResourceAllowancesResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListResourceAllowancesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse - * @static - * @param {google.cloud.batch.v1alpha.IListResourceAllowancesResponse=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.ListResourceAllowancesResponse} ListResourceAllowancesResponse instance - */ - ListResourceAllowancesResponse.create = function create(properties) { - return new ListResourceAllowancesResponse(properties); - }; - - /** - * Encodes the specified ListResourceAllowancesResponse message. Does not implicitly {@link google.cloud.batch.v1alpha.ListResourceAllowancesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse - * @static - * @param {google.cloud.batch.v1alpha.IListResourceAllowancesResponse} message ListResourceAllowancesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListResourceAllowancesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resourceAllowances != null && message.resourceAllowances.length) - for (var i = 0; i < message.resourceAllowances.length; ++i) - $root.google.cloud.batch.v1alpha.ResourceAllowance.encode(message.resourceAllowances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; - - /** - * Encodes the specified ListResourceAllowancesResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListResourceAllowancesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse - * @static - * @param {google.cloud.batch.v1alpha.IListResourceAllowancesResponse} message ListResourceAllowancesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListResourceAllowancesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListResourceAllowancesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.ListResourceAllowancesResponse} ListResourceAllowancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListResourceAllowancesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ListResourceAllowancesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.resourceAllowances && message.resourceAllowances.length)) - message.resourceAllowances = []; - message.resourceAllowances.push($root.google.cloud.batch.v1alpha.ResourceAllowance.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListResourceAllowancesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.ListResourceAllowancesResponse} ListResourceAllowancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListResourceAllowancesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListResourceAllowancesResponse message. - * @function verify - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListResourceAllowancesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resourceAllowances != null && message.hasOwnProperty("resourceAllowances")) { - if (!Array.isArray(message.resourceAllowances)) - return "resourceAllowances: array expected"; - for (var i = 0; i < message.resourceAllowances.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.ResourceAllowance.verify(message.resourceAllowances[i]); - if (error) - return "resourceAllowances." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; - - /** - * Creates a ListResourceAllowancesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.ListResourceAllowancesResponse} ListResourceAllowancesResponse - */ - ListResourceAllowancesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.ListResourceAllowancesResponse) - return object; - var message = new $root.google.cloud.batch.v1alpha.ListResourceAllowancesResponse(); - if (object.resourceAllowances) { - if (!Array.isArray(object.resourceAllowances)) - throw TypeError(".google.cloud.batch.v1alpha.ListResourceAllowancesResponse.resourceAllowances: array expected"); - message.resourceAllowances = []; - for (var i = 0; i < object.resourceAllowances.length; ++i) { - if (typeof object.resourceAllowances[i] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.ListResourceAllowancesResponse.resourceAllowances: object expected"); - message.resourceAllowances[i] = $root.google.cloud.batch.v1alpha.ResourceAllowance.fromObject(object.resourceAllowances[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.batch.v1alpha.ListResourceAllowancesResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListResourceAllowancesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse - * @static - * @param {google.cloud.batch.v1alpha.ListResourceAllowancesResponse} message ListResourceAllowancesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListResourceAllowancesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.resourceAllowances = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.resourceAllowances && message.resourceAllowances.length) { - object.resourceAllowances = []; - for (var j = 0; j < message.resourceAllowances.length; ++j) - object.resourceAllowances[j] = $root.google.cloud.batch.v1alpha.ResourceAllowance.toObject(message.resourceAllowances[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; - - /** - * Converts this ListResourceAllowancesResponse to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse - * @instance - * @returns {Object.} JSON object - */ - ListResourceAllowancesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListResourceAllowancesResponse - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListResourceAllowancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.ListResourceAllowancesResponse"; - }; - - return ListResourceAllowancesResponse; - })(); - - v1alpha.UpdateResourceAllowanceRequest = (function() { - - /** - * Properties of an UpdateResourceAllowanceRequest. - * @memberof google.cloud.batch.v1alpha - * @interface IUpdateResourceAllowanceRequest - * @property {google.cloud.batch.v1alpha.IResourceAllowance|null} [resourceAllowance] UpdateResourceAllowanceRequest resourceAllowance - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateResourceAllowanceRequest updateMask - * @property {string|null} [requestId] UpdateResourceAllowanceRequest requestId - */ - - /** - * Constructs a new UpdateResourceAllowanceRequest. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents an UpdateResourceAllowanceRequest. - * @implements IUpdateResourceAllowanceRequest - * @constructor - * @param {google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest=} [properties] Properties to set - */ - function UpdateResourceAllowanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateResourceAllowanceRequest resourceAllowance. - * @member {google.cloud.batch.v1alpha.IResourceAllowance|null|undefined} resourceAllowance - * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest - * @instance - */ - UpdateResourceAllowanceRequest.prototype.resourceAllowance = null; - - /** - * UpdateResourceAllowanceRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest - * @instance - */ - UpdateResourceAllowanceRequest.prototype.updateMask = null; - - /** - * UpdateResourceAllowanceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest - * @instance - */ - UpdateResourceAllowanceRequest.prototype.requestId = ""; - - /** - * Creates a new UpdateResourceAllowanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest - * @static - * @param {google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest} UpdateResourceAllowanceRequest instance - */ - UpdateResourceAllowanceRequest.create = function create(properties) { - return new UpdateResourceAllowanceRequest(properties); - }; - - /** - * Encodes the specified UpdateResourceAllowanceRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest - * @static - * @param {google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest} message UpdateResourceAllowanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateResourceAllowanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resourceAllowance != null && Object.hasOwnProperty.call(message, "resourceAllowance")) - $root.google.cloud.batch.v1alpha.ResourceAllowance.encode(message.resourceAllowance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified UpdateResourceAllowanceRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest - * @static - * @param {google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest} message UpdateResourceAllowanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateResourceAllowanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateResourceAllowanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest} UpdateResourceAllowanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateResourceAllowanceRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.resourceAllowance = $root.google.cloud.batch.v1alpha.ResourceAllowance.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateResourceAllowanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest} UpdateResourceAllowanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateResourceAllowanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateResourceAllowanceRequest message. - * @function verify - * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateResourceAllowanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resourceAllowance != null && message.hasOwnProperty("resourceAllowance")) { - var error = $root.google.cloud.batch.v1alpha.ResourceAllowance.verify(message.resourceAllowance); - if (error) - return "resourceAllowance." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates an UpdateResourceAllowanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest} UpdateResourceAllowanceRequest - */ - UpdateResourceAllowanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest) - return object; - var message = new $root.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest(); - if (object.resourceAllowance != null) { - if (typeof object.resourceAllowance !== "object") - throw TypeError(".google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest.resourceAllowance: object expected"); - message.resourceAllowance = $root.google.cloud.batch.v1alpha.ResourceAllowance.fromObject(object.resourceAllowance); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from an UpdateResourceAllowanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest - * @static - * @param {google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest} message UpdateResourceAllowanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateResourceAllowanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.resourceAllowance = null; - object.updateMask = null; - object.requestId = ""; - } - if (message.resourceAllowance != null && message.hasOwnProperty("resourceAllowance")) - object.resourceAllowance = $root.google.cloud.batch.v1alpha.ResourceAllowance.toObject(message.resourceAllowance, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this UpdateResourceAllowanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateResourceAllowanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateResourceAllowanceRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateResourceAllowanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest"; - }; - - return UpdateResourceAllowanceRequest; - })(); - - v1alpha.OperationMetadata = (function() { - - /** - * Properties of an OperationMetadata. - * @memberof google.cloud.batch.v1alpha - * @interface IOperationMetadata - * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime - * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime - * @property {string|null} [target] OperationMetadata target - * @property {string|null} [verb] OperationMetadata verb - * @property {string|null} [statusMessage] OperationMetadata statusMessage - * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation - * @property {string|null} [apiVersion] OperationMetadata apiVersion - */ - - /** - * Constructs a new OperationMetadata. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents an OperationMetadata. - * @implements IOperationMetadata - * @constructor - * @param {google.cloud.batch.v1alpha.IOperationMetadata=} [properties] Properties to set - */ - function OperationMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OperationMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.batch.v1alpha.OperationMetadata - * @instance - */ - OperationMetadata.prototype.createTime = null; - - /** - * OperationMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.batch.v1alpha.OperationMetadata - * @instance - */ - OperationMetadata.prototype.endTime = null; - - /** - * OperationMetadata target. - * @member {string} target - * @memberof google.cloud.batch.v1alpha.OperationMetadata - * @instance - */ - OperationMetadata.prototype.target = ""; - - /** - * OperationMetadata verb. - * @member {string} verb - * @memberof google.cloud.batch.v1alpha.OperationMetadata - * @instance - */ - OperationMetadata.prototype.verb = ""; - - /** - * OperationMetadata statusMessage. - * @member {string} statusMessage - * @memberof google.cloud.batch.v1alpha.OperationMetadata - * @instance - */ - OperationMetadata.prototype.statusMessage = ""; - - /** - * OperationMetadata requestedCancellation. - * @member {boolean} requestedCancellation - * @memberof google.cloud.batch.v1alpha.OperationMetadata - * @instance - */ - OperationMetadata.prototype.requestedCancellation = false; - - /** - * OperationMetadata apiVersion. - * @member {string} apiVersion - * @memberof google.cloud.batch.v1alpha.OperationMetadata - * @instance - */ - OperationMetadata.prototype.apiVersion = ""; - - /** - * Creates a new OperationMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.OperationMetadata - * @static - * @param {google.cloud.batch.v1alpha.IOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.OperationMetadata} OperationMetadata instance - */ - OperationMetadata.create = function create(properties) { - return new OperationMetadata(properties); - }; - - /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.batch.v1alpha.OperationMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.OperationMetadata - * @static - * @param {google.cloud.batch.v1alpha.IOperationMetadata} message OperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, 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.target != null && Object.hasOwnProperty.call(message, "target")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); - if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); - if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); - if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); - if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); - return writer; - }; - - /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.OperationMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.OperationMetadata - * @static - * @param {google.cloud.batch.v1alpha.IOperationMetadata} message OperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.OperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.OperationMetadata} OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationMetadata.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.OperationMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.target = reader.string(); - break; - } - case 4: { - message.verb = reader.string(); - break; - } - case 5: { - message.statusMessage = reader.string(); - break; - } - case 6: { - message.requestedCancellation = reader.bool(); - break; - } - case 7: { - message.apiVersion = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.OperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.OperationMetadata} OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OperationMetadata message. - * @function verify - * @memberof google.cloud.batch.v1alpha.OperationMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OperationMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - if (message.target != null && message.hasOwnProperty("target")) - if (!$util.isString(message.target)) - return "target: string expected"; - if (message.verb != null && message.hasOwnProperty("verb")) - if (!$util.isString(message.verb)) - return "verb: string expected"; - if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) - if (!$util.isString(message.statusMessage)) - return "statusMessage: string expected"; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - if (typeof message.requestedCancellation !== "boolean") - return "requestedCancellation: boolean expected"; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - if (!$util.isString(message.apiVersion)) - return "apiVersion: string expected"; - return null; - }; - - /** - * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.OperationMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.OperationMetadata} OperationMetadata - */ - OperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.OperationMetadata) - return object; - var message = new $root.google.cloud.batch.v1alpha.OperationMetadata(); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.batch.v1alpha.OperationMetadata.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.batch.v1alpha.OperationMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.target != null) - message.target = String(object.target); - if (object.verb != null) - message.verb = String(object.verb); - if (object.statusMessage != null) - message.statusMessage = String(object.statusMessage); - if (object.requestedCancellation != null) - message.requestedCancellation = Boolean(object.requestedCancellation); - if (object.apiVersion != null) - message.apiVersion = String(object.apiVersion); - return message; - }; - - /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.OperationMetadata - * @static - * @param {google.cloud.batch.v1alpha.OperationMetadata} message OperationMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OperationMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.createTime = null; - object.endTime = null; - object.target = ""; - object.verb = ""; - object.statusMessage = ""; - object.requestedCancellation = false; - object.apiVersion = ""; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.target != null && message.hasOwnProperty("target")) - object.target = message.target; - if (message.verb != null && message.hasOwnProperty("verb")) - object.verb = message.verb; - if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) - object.statusMessage = message.statusMessage; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - object.requestedCancellation = message.requestedCancellation; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - object.apiVersion = message.apiVersion; - return object; - }; - - /** - * Converts this OperationMetadata to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.OperationMetadata - * @instance - * @returns {Object.} JSON object - */ - OperationMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OperationMetadata - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.OperationMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.OperationMetadata"; - }; - - return OperationMetadata; - })(); - - v1alpha.Job = (function() { - - /** - * Properties of a Job. - * @memberof google.cloud.batch.v1alpha - * @interface IJob - * @property {string|null} [name] Job name - * @property {string|null} [uid] Job uid - * @property {number|Long|null} [priority] Job priority - * @property {Array.|null} [taskGroups] Job taskGroups - * @property {google.cloud.batch.v1alpha.Job.SchedulingPolicy|null} [schedulingPolicy] Job schedulingPolicy - * @property {Array.|null} [dependencies] Job dependencies - * @property {google.cloud.batch.v1alpha.IAllocationPolicy|null} [allocationPolicy] Job allocationPolicy - * @property {Object.|null} [labels] Job labels - * @property {google.cloud.batch.v1alpha.IJobStatus|null} [status] Job status - * @property {google.cloud.batch.v1alpha.IJobNotification|null} [notification] Job notification - * @property {google.protobuf.ITimestamp|null} [createTime] Job createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Job updateTime - * @property {google.cloud.batch.v1alpha.ILogsPolicy|null} [logsPolicy] Job logsPolicy - * @property {Array.|null} [notifications] Job notifications - */ - - /** - * Constructs a new Job. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a Job. - * @implements IJob - * @constructor - * @param {google.cloud.batch.v1alpha.IJob=} [properties] Properties to set - */ - function Job(properties) { - this.taskGroups = []; - this.dependencies = []; - this.labels = {}; - this.notifications = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Job name. - * @member {string} name - * @memberof google.cloud.batch.v1alpha.Job - * @instance - */ - Job.prototype.name = ""; - - /** - * Job uid. - * @member {string} uid - * @memberof google.cloud.batch.v1alpha.Job - * @instance - */ - Job.prototype.uid = ""; - - /** - * Job priority. - * @member {number|Long} priority - * @memberof google.cloud.batch.v1alpha.Job - * @instance - */ - Job.prototype.priority = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Job taskGroups. - * @member {Array.} taskGroups - * @memberof google.cloud.batch.v1alpha.Job - * @instance - */ - Job.prototype.taskGroups = $util.emptyArray; - - /** - * Job schedulingPolicy. - * @member {google.cloud.batch.v1alpha.Job.SchedulingPolicy} schedulingPolicy - * @memberof google.cloud.batch.v1alpha.Job - * @instance - */ - Job.prototype.schedulingPolicy = 0; - - /** - * Job dependencies. - * @member {Array.} dependencies - * @memberof google.cloud.batch.v1alpha.Job - * @instance - */ - Job.prototype.dependencies = $util.emptyArray; - - /** - * Job allocationPolicy. - * @member {google.cloud.batch.v1alpha.IAllocationPolicy|null|undefined} allocationPolicy - * @memberof google.cloud.batch.v1alpha.Job - * @instance - */ - Job.prototype.allocationPolicy = null; - - /** - * Job labels. - * @member {Object.} labels - * @memberof google.cloud.batch.v1alpha.Job - * @instance - */ - Job.prototype.labels = $util.emptyObject; - - /** - * Job status. - * @member {google.cloud.batch.v1alpha.IJobStatus|null|undefined} status - * @memberof google.cloud.batch.v1alpha.Job - * @instance - */ - Job.prototype.status = null; - - /** - * Job notification. - * @member {google.cloud.batch.v1alpha.IJobNotification|null|undefined} notification - * @memberof google.cloud.batch.v1alpha.Job - * @instance - */ - Job.prototype.notification = null; - - /** - * Job createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.batch.v1alpha.Job - * @instance - */ - Job.prototype.createTime = null; - - /** - * Job updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.batch.v1alpha.Job - * @instance - */ - Job.prototype.updateTime = null; - - /** - * Job logsPolicy. - * @member {google.cloud.batch.v1alpha.ILogsPolicy|null|undefined} logsPolicy - * @memberof google.cloud.batch.v1alpha.Job - * @instance - */ - Job.prototype.logsPolicy = null; - - /** - * Job notifications. - * @member {Array.} notifications - * @memberof google.cloud.batch.v1alpha.Job - * @instance - */ - Job.prototype.notifications = $util.emptyArray; - - /** - * Creates a new Job instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.Job - * @static - * @param {google.cloud.batch.v1alpha.IJob=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.Job} Job instance - */ - Job.create = function create(properties) { - return new Job(properties); - }; - - /** - * Encodes the specified Job message. Does not implicitly {@link google.cloud.batch.v1alpha.Job.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.Job - * @static - * @param {google.cloud.batch.v1alpha.IJob} message Job message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Job.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); - if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.priority); - if (message.taskGroups != null && message.taskGroups.length) - for (var i = 0; i < message.taskGroups.length; ++i) - $root.google.cloud.batch.v1alpha.TaskGroup.encode(message.taskGroups[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.schedulingPolicy != null && Object.hasOwnProperty.call(message, "schedulingPolicy")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.schedulingPolicy); - if (message.dependencies != null && message.dependencies.length) - for (var i = 0; i < message.dependencies.length; ++i) - $root.google.cloud.batch.v1alpha.JobDependency.encode(message.dependencies[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.allocationPolicy != null && Object.hasOwnProperty.call(message, "allocationPolicy")) - $root.google.cloud.batch.v1alpha.AllocationPolicy.encode(message.allocationPolicy, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.cloud.batch.v1alpha.JobStatus.encode(message.status, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.notification != null && Object.hasOwnProperty.call(message, "notification")) - $root.google.cloud.batch.v1alpha.JobNotification.encode(message.notification, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.logsPolicy != null && Object.hasOwnProperty.call(message, "logsPolicy")) - $root.google.cloud.batch.v1alpha.LogsPolicy.encode(message.logsPolicy, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.notifications != null && message.notifications.length) - for (var i = 0; i < message.notifications.length; ++i) - $root.google.cloud.batch.v1alpha.JobNotification.encode(message.notifications[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Job.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.Job - * @static - * @param {google.cloud.batch.v1alpha.IJob} message Job message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Job.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Job message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.Job - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.Job} Job - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Job.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Job(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.uid = reader.string(); - break; - } - case 3: { - message.priority = reader.int64(); - break; - } - case 4: { - if (!(message.taskGroups && message.taskGroups.length)) - message.taskGroups = []; - message.taskGroups.push($root.google.cloud.batch.v1alpha.TaskGroup.decode(reader, reader.uint32())); - break; - } - case 5: { - message.schedulingPolicy = reader.int32(); - break; - } - case 6: { - if (!(message.dependencies && message.dependencies.length)) - message.dependencies = []; - message.dependencies.push($root.google.cloud.batch.v1alpha.JobDependency.decode(reader, reader.uint32())); - break; - } - case 7: { - message.allocationPolicy = $root.google.cloud.batch.v1alpha.AllocationPolicy.decode(reader, reader.uint32()); - break; - } - case 8: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 9: { - message.status = $root.google.cloud.batch.v1alpha.JobStatus.decode(reader, reader.uint32()); - break; - } - case 10: { - message.notification = $root.google.cloud.batch.v1alpha.JobNotification.decode(reader, reader.uint32()); - break; - } - case 11: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 12: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 13: { - message.logsPolicy = $root.google.cloud.batch.v1alpha.LogsPolicy.decode(reader, reader.uint32()); - break; - } - case 14: { - if (!(message.notifications && message.notifications.length)) - message.notifications = []; - message.notifications.push($root.google.cloud.batch.v1alpha.JobNotification.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Job message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.Job - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.Job} Job - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Job.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Job message. - * @function verify - * @memberof google.cloud.batch.v1alpha.Job - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Job.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.uid != null && message.hasOwnProperty("uid")) - if (!$util.isString(message.uid)) - return "uid: string expected"; - if (message.priority != null && message.hasOwnProperty("priority")) - if (!$util.isInteger(message.priority) && !(message.priority && $util.isInteger(message.priority.low) && $util.isInteger(message.priority.high))) - return "priority: integer|Long expected"; - if (message.taskGroups != null && message.hasOwnProperty("taskGroups")) { - if (!Array.isArray(message.taskGroups)) - return "taskGroups: array expected"; - for (var i = 0; i < message.taskGroups.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.TaskGroup.verify(message.taskGroups[i]); - if (error) - return "taskGroups." + error; - } - } - if (message.schedulingPolicy != null && message.hasOwnProperty("schedulingPolicy")) - switch (message.schedulingPolicy) { - default: - return "schedulingPolicy: enum value expected"; - case 0: - case 1: - break; - } - if (message.dependencies != null && message.hasOwnProperty("dependencies")) { - if (!Array.isArray(message.dependencies)) - return "dependencies: array expected"; - for (var i = 0; i < message.dependencies.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.JobDependency.verify(message.dependencies[i]); - if (error) - return "dependencies." + error; - } - } - if (message.allocationPolicy != null && message.hasOwnProperty("allocationPolicy")) { - var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.verify(message.allocationPolicy); - if (error) - return "allocationPolicy." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.status != null && message.hasOwnProperty("status")) { - var error = $root.google.cloud.batch.v1alpha.JobStatus.verify(message.status); - if (error) - return "status." + error; - } - if (message.notification != null && message.hasOwnProperty("notification")) { - var error = $root.google.cloud.batch.v1alpha.JobNotification.verify(message.notification); - if (error) - return "notification." + error; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.logsPolicy != null && message.hasOwnProperty("logsPolicy")) { - var error = $root.google.cloud.batch.v1alpha.LogsPolicy.verify(message.logsPolicy); - if (error) - return "logsPolicy." + error; - } - if (message.notifications != null && message.hasOwnProperty("notifications")) { - if (!Array.isArray(message.notifications)) - return "notifications: array expected"; - for (var i = 0; i < message.notifications.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.JobNotification.verify(message.notifications[i]); - if (error) - return "notifications." + error; - } - } - return null; - }; - - /** - * Creates a Job message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.Job - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.Job} Job - */ - Job.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.Job) - return object; - var message = new $root.google.cloud.batch.v1alpha.Job(); - if (object.name != null) - message.name = String(object.name); - if (object.uid != null) - message.uid = String(object.uid); - if (object.priority != null) - if ($util.Long) - (message.priority = $util.Long.fromValue(object.priority)).unsigned = false; - else if (typeof object.priority === "string") - message.priority = parseInt(object.priority, 10); - else if (typeof object.priority === "number") - message.priority = object.priority; - else if (typeof object.priority === "object") - message.priority = new $util.LongBits(object.priority.low >>> 0, object.priority.high >>> 0).toNumber(); - if (object.taskGroups) { - if (!Array.isArray(object.taskGroups)) - throw TypeError(".google.cloud.batch.v1alpha.Job.taskGroups: array expected"); - message.taskGroups = []; - for (var i = 0; i < object.taskGroups.length; ++i) { - if (typeof object.taskGroups[i] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Job.taskGroups: object expected"); - message.taskGroups[i] = $root.google.cloud.batch.v1alpha.TaskGroup.fromObject(object.taskGroups[i]); - } - } - switch (object.schedulingPolicy) { - default: - if (typeof object.schedulingPolicy === "number") { - message.schedulingPolicy = object.schedulingPolicy; - break; - } - break; - case "SCHEDULING_POLICY_UNSPECIFIED": - case 0: - message.schedulingPolicy = 0; - break; - case "AS_SOON_AS_POSSIBLE": - case 1: - message.schedulingPolicy = 1; - break; - } - if (object.dependencies) { - if (!Array.isArray(object.dependencies)) - throw TypeError(".google.cloud.batch.v1alpha.Job.dependencies: array expected"); - message.dependencies = []; - for (var i = 0; i < object.dependencies.length; ++i) { - if (typeof object.dependencies[i] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Job.dependencies: object expected"); - message.dependencies[i] = $root.google.cloud.batch.v1alpha.JobDependency.fromObject(object.dependencies[i]); - } - } - if (object.allocationPolicy != null) { - if (typeof object.allocationPolicy !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Job.allocationPolicy: object expected"); - message.allocationPolicy = $root.google.cloud.batch.v1alpha.AllocationPolicy.fromObject(object.allocationPolicy); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Job.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - if (object.status != null) { - if (typeof object.status !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Job.status: object expected"); - message.status = $root.google.cloud.batch.v1alpha.JobStatus.fromObject(object.status); - } - if (object.notification != null) { - if (typeof object.notification !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Job.notification: object expected"); - message.notification = $root.google.cloud.batch.v1alpha.JobNotification.fromObject(object.notification); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Job.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Job.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.logsPolicy != null) { - if (typeof object.logsPolicy !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Job.logsPolicy: object expected"); - message.logsPolicy = $root.google.cloud.batch.v1alpha.LogsPolicy.fromObject(object.logsPolicy); - } - if (object.notifications) { - if (!Array.isArray(object.notifications)) - throw TypeError(".google.cloud.batch.v1alpha.Job.notifications: array expected"); - message.notifications = []; - for (var i = 0; i < object.notifications.length; ++i) { - if (typeof object.notifications[i] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Job.notifications: object expected"); - message.notifications[i] = $root.google.cloud.batch.v1alpha.JobNotification.fromObject(object.notifications[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Job message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.Job - * @static - * @param {google.cloud.batch.v1alpha.Job} message Job - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Job.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.taskGroups = []; - object.dependencies = []; - object.notifications = []; - } - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.uid = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.priority = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.priority = options.longs === String ? "0" : 0; - object.schedulingPolicy = options.enums === String ? "SCHEDULING_POLICY_UNSPECIFIED" : 0; - object.allocationPolicy = null; - object.status = null; - object.notification = null; - object.createTime = null; - object.updateTime = null; - object.logsPolicy = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - if (message.priority != null && message.hasOwnProperty("priority")) - if (typeof message.priority === "number") - object.priority = options.longs === String ? String(message.priority) : message.priority; - else - object.priority = options.longs === String ? $util.Long.prototype.toString.call(message.priority) : options.longs === Number ? new $util.LongBits(message.priority.low >>> 0, message.priority.high >>> 0).toNumber() : message.priority; - if (message.taskGroups && message.taskGroups.length) { - object.taskGroups = []; - for (var j = 0; j < message.taskGroups.length; ++j) - object.taskGroups[j] = $root.google.cloud.batch.v1alpha.TaskGroup.toObject(message.taskGroups[j], options); - } - if (message.schedulingPolicy != null && message.hasOwnProperty("schedulingPolicy")) - object.schedulingPolicy = options.enums === String ? $root.google.cloud.batch.v1alpha.Job.SchedulingPolicy[message.schedulingPolicy] === undefined ? message.schedulingPolicy : $root.google.cloud.batch.v1alpha.Job.SchedulingPolicy[message.schedulingPolicy] : message.schedulingPolicy; - if (message.dependencies && message.dependencies.length) { - object.dependencies = []; - for (var j = 0; j < message.dependencies.length; ++j) - object.dependencies[j] = $root.google.cloud.batch.v1alpha.JobDependency.toObject(message.dependencies[j], options); - } - if (message.allocationPolicy != null && message.hasOwnProperty("allocationPolicy")) - object.allocationPolicy = $root.google.cloud.batch.v1alpha.AllocationPolicy.toObject(message.allocationPolicy, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.cloud.batch.v1alpha.JobStatus.toObject(message.status, options); - if (message.notification != null && message.hasOwnProperty("notification")) - object.notification = $root.google.cloud.batch.v1alpha.JobNotification.toObject(message.notification, options); - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.logsPolicy != null && message.hasOwnProperty("logsPolicy")) - object.logsPolicy = $root.google.cloud.batch.v1alpha.LogsPolicy.toObject(message.logsPolicy, options); - if (message.notifications && message.notifications.length) { - object.notifications = []; - for (var j = 0; j < message.notifications.length; ++j) - object.notifications[j] = $root.google.cloud.batch.v1alpha.JobNotification.toObject(message.notifications[j], options); - } - return object; - }; - - /** - * Converts this Job to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.Job - * @instance - * @returns {Object.} JSON object - */ - Job.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Job - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.Job - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Job.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.Job"; - }; - - /** - * SchedulingPolicy enum. - * @name google.cloud.batch.v1alpha.Job.SchedulingPolicy - * @enum {number} - * @property {number} SCHEDULING_POLICY_UNSPECIFIED=0 SCHEDULING_POLICY_UNSPECIFIED value - * @property {number} AS_SOON_AS_POSSIBLE=1 AS_SOON_AS_POSSIBLE value - */ - Job.SchedulingPolicy = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SCHEDULING_POLICY_UNSPECIFIED"] = 0; - values[valuesById[1] = "AS_SOON_AS_POSSIBLE"] = 1; - return values; - })(); - - return Job; - })(); - - v1alpha.LogsPolicy = (function() { - - /** - * Properties of a LogsPolicy. - * @memberof google.cloud.batch.v1alpha - * @interface ILogsPolicy - * @property {google.cloud.batch.v1alpha.LogsPolicy.Destination|null} [destination] LogsPolicy destination - * @property {string|null} [logsPath] LogsPolicy logsPath - * @property {google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption|null} [cloudLoggingOption] LogsPolicy cloudLoggingOption - */ - - /** - * Constructs a new LogsPolicy. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a LogsPolicy. - * @implements ILogsPolicy - * @constructor - * @param {google.cloud.batch.v1alpha.ILogsPolicy=} [properties] Properties to set - */ - function LogsPolicy(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LogsPolicy destination. - * @member {google.cloud.batch.v1alpha.LogsPolicy.Destination} destination - * @memberof google.cloud.batch.v1alpha.LogsPolicy - * @instance - */ - LogsPolicy.prototype.destination = 0; - - /** - * LogsPolicy logsPath. - * @member {string} logsPath - * @memberof google.cloud.batch.v1alpha.LogsPolicy - * @instance - */ - LogsPolicy.prototype.logsPath = ""; - - /** - * LogsPolicy cloudLoggingOption. - * @member {google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption|null|undefined} cloudLoggingOption - * @memberof google.cloud.batch.v1alpha.LogsPolicy - * @instance - */ - LogsPolicy.prototype.cloudLoggingOption = null; - - /** - * Creates a new LogsPolicy instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.LogsPolicy - * @static - * @param {google.cloud.batch.v1alpha.ILogsPolicy=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.LogsPolicy} LogsPolicy instance - */ - LogsPolicy.create = function create(properties) { - return new LogsPolicy(properties); - }; - - /** - * Encodes the specified LogsPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.LogsPolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.LogsPolicy - * @static - * @param {google.cloud.batch.v1alpha.ILogsPolicy} message LogsPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LogsPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.destination); - if (message.logsPath != null && Object.hasOwnProperty.call(message, "logsPath")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.logsPath); - if (message.cloudLoggingOption != null && Object.hasOwnProperty.call(message, "cloudLoggingOption")) - $root.google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption.encode(message.cloudLoggingOption, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LogsPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.LogsPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.LogsPolicy - * @static - * @param {google.cloud.batch.v1alpha.ILogsPolicy} message LogsPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LogsPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LogsPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.LogsPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.LogsPolicy} LogsPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LogsPolicy.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.LogsPolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.destination = reader.int32(); - break; - } - case 2: { - message.logsPath = reader.string(); - break; - } - case 3: { - message.cloudLoggingOption = $root.google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LogsPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.LogsPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.LogsPolicy} LogsPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LogsPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LogsPolicy message. - * @function verify - * @memberof google.cloud.batch.v1alpha.LogsPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LogsPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.destination != null && message.hasOwnProperty("destination")) - switch (message.destination) { - default: - return "destination: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.logsPath != null && message.hasOwnProperty("logsPath")) - if (!$util.isString(message.logsPath)) - return "logsPath: string expected"; - if (message.cloudLoggingOption != null && message.hasOwnProperty("cloudLoggingOption")) { - var error = $root.google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption.verify(message.cloudLoggingOption); - if (error) - return "cloudLoggingOption." + error; - } - return null; - }; - - /** - * Creates a LogsPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.LogsPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.LogsPolicy} LogsPolicy - */ - LogsPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.LogsPolicy) - return object; - var message = new $root.google.cloud.batch.v1alpha.LogsPolicy(); - switch (object.destination) { - default: - if (typeof object.destination === "number") { - message.destination = object.destination; - break; - } - break; - case "DESTINATION_UNSPECIFIED": - case 0: - message.destination = 0; - break; - case "CLOUD_LOGGING": - case 1: - message.destination = 1; - break; - case "PATH": - case 2: - message.destination = 2; - break; - } - if (object.logsPath != null) - message.logsPath = String(object.logsPath); - if (object.cloudLoggingOption != null) { - if (typeof object.cloudLoggingOption !== "object") - throw TypeError(".google.cloud.batch.v1alpha.LogsPolicy.cloudLoggingOption: object expected"); - message.cloudLoggingOption = $root.google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption.fromObject(object.cloudLoggingOption); - } - return message; - }; - - /** - * Creates a plain object from a LogsPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.LogsPolicy - * @static - * @param {google.cloud.batch.v1alpha.LogsPolicy} message LogsPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LogsPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.destination = options.enums === String ? "DESTINATION_UNSPECIFIED" : 0; - object.logsPath = ""; - object.cloudLoggingOption = null; - } - if (message.destination != null && message.hasOwnProperty("destination")) - object.destination = options.enums === String ? $root.google.cloud.batch.v1alpha.LogsPolicy.Destination[message.destination] === undefined ? message.destination : $root.google.cloud.batch.v1alpha.LogsPolicy.Destination[message.destination] : message.destination; - if (message.logsPath != null && message.hasOwnProperty("logsPath")) - object.logsPath = message.logsPath; - if (message.cloudLoggingOption != null && message.hasOwnProperty("cloudLoggingOption")) - object.cloudLoggingOption = $root.google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption.toObject(message.cloudLoggingOption, options); - return object; - }; - - /** - * Converts this LogsPolicy to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.LogsPolicy - * @instance - * @returns {Object.} JSON object - */ - LogsPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LogsPolicy - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.LogsPolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LogsPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.LogsPolicy"; - }; - - LogsPolicy.CloudLoggingOption = (function() { - - /** - * Properties of a CloudLoggingOption. - * @memberof google.cloud.batch.v1alpha.LogsPolicy - * @interface ICloudLoggingOption - * @property {boolean|null} [useGenericTaskMonitoredResource] CloudLoggingOption useGenericTaskMonitoredResource - */ - - /** - * Constructs a new CloudLoggingOption. - * @memberof google.cloud.batch.v1alpha.LogsPolicy - * @classdesc Represents a CloudLoggingOption. - * @implements ICloudLoggingOption - * @constructor - * @param {google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption=} [properties] Properties to set - */ - function CloudLoggingOption(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CloudLoggingOption useGenericTaskMonitoredResource. - * @member {boolean} useGenericTaskMonitoredResource - * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption - * @instance - */ - CloudLoggingOption.prototype.useGenericTaskMonitoredResource = false; - - /** - * Creates a new CloudLoggingOption instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption - * @static - * @param {google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption} CloudLoggingOption instance - */ - CloudLoggingOption.create = function create(properties) { - return new CloudLoggingOption(properties); - }; - - /** - * Encodes the specified CloudLoggingOption message. Does not implicitly {@link google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption - * @static - * @param {google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption} message CloudLoggingOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudLoggingOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.useGenericTaskMonitoredResource != null && Object.hasOwnProperty.call(message, "useGenericTaskMonitoredResource")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.useGenericTaskMonitoredResource); - return writer; - }; - - /** - * Encodes the specified CloudLoggingOption message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption - * @static - * @param {google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption} message CloudLoggingOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudLoggingOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CloudLoggingOption message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption} CloudLoggingOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudLoggingOption.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.useGenericTaskMonitoredResource = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CloudLoggingOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption} CloudLoggingOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudLoggingOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CloudLoggingOption message. - * @function verify - * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CloudLoggingOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.useGenericTaskMonitoredResource != null && message.hasOwnProperty("useGenericTaskMonitoredResource")) - if (typeof message.useGenericTaskMonitoredResource !== "boolean") - return "useGenericTaskMonitoredResource: boolean expected"; - return null; - }; - - /** - * Creates a CloudLoggingOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption} CloudLoggingOption - */ - CloudLoggingOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption) - return object; - var message = new $root.google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption(); - if (object.useGenericTaskMonitoredResource != null) - message.useGenericTaskMonitoredResource = Boolean(object.useGenericTaskMonitoredResource); - return message; - }; - - /** - * Creates a plain object from a CloudLoggingOption message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption - * @static - * @param {google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption} message CloudLoggingOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CloudLoggingOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.useGenericTaskMonitoredResource = false; - if (message.useGenericTaskMonitoredResource != null && message.hasOwnProperty("useGenericTaskMonitoredResource")) - object.useGenericTaskMonitoredResource = message.useGenericTaskMonitoredResource; - return object; - }; - - /** - * Converts this CloudLoggingOption to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption - * @instance - * @returns {Object.} JSON object - */ - CloudLoggingOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CloudLoggingOption - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CloudLoggingOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption"; - }; - - return CloudLoggingOption; - })(); - - /** - * Destination enum. - * @name google.cloud.batch.v1alpha.LogsPolicy.Destination - * @enum {number} - * @property {number} DESTINATION_UNSPECIFIED=0 DESTINATION_UNSPECIFIED value - * @property {number} CLOUD_LOGGING=1 CLOUD_LOGGING value - * @property {number} PATH=2 PATH value - */ - LogsPolicy.Destination = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DESTINATION_UNSPECIFIED"] = 0; - values[valuesById[1] = "CLOUD_LOGGING"] = 1; - values[valuesById[2] = "PATH"] = 2; - return values; - })(); - - return LogsPolicy; - })(); - - v1alpha.JobDependency = (function() { - - /** - * Properties of a JobDependency. - * @memberof google.cloud.batch.v1alpha - * @interface IJobDependency - * @property {Object.|null} [items] JobDependency items - */ - - /** - * Constructs a new JobDependency. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a JobDependency. - * @implements IJobDependency - * @constructor - * @param {google.cloud.batch.v1alpha.IJobDependency=} [properties] Properties to set - */ - function JobDependency(properties) { - this.items = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * JobDependency items. - * @member {Object.} items - * @memberof google.cloud.batch.v1alpha.JobDependency - * @instance - */ - JobDependency.prototype.items = $util.emptyObject; - - /** - * Creates a new JobDependency instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.JobDependency - * @static - * @param {google.cloud.batch.v1alpha.IJobDependency=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.JobDependency} JobDependency instance - */ - JobDependency.create = function create(properties) { - return new JobDependency(properties); - }; - - /** - * Encodes the specified JobDependency message. Does not implicitly {@link google.cloud.batch.v1alpha.JobDependency.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.JobDependency - * @static - * @param {google.cloud.batch.v1alpha.IJobDependency} message JobDependency message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JobDependency.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.items != null && Object.hasOwnProperty.call(message, "items")) - for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.items[keys[i]]).ldelim(); - return writer; - }; - - /** - * Encodes the specified JobDependency message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobDependency.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.JobDependency - * @static - * @param {google.cloud.batch.v1alpha.IJobDependency} message JobDependency message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JobDependency.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a JobDependency message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.JobDependency - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.JobDependency} JobDependency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JobDependency.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.JobDependency(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (message.items === $util.emptyObject) - message.items = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = 0; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.int32(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.items[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a JobDependency message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.JobDependency - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.JobDependency} JobDependency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JobDependency.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a JobDependency message. - * @function verify - * @memberof google.cloud.batch.v1alpha.JobDependency - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - JobDependency.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.items != null && message.hasOwnProperty("items")) { - if (!$util.isObject(message.items)) - return "items: object expected"; - var key = Object.keys(message.items); - for (var i = 0; i < key.length; ++i) - switch (message.items[key[i]]) { - default: - return "items: enum value{k:string} expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - } - return null; - }; - - /** - * Creates a JobDependency message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.JobDependency - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.JobDependency} JobDependency - */ - JobDependency.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.JobDependency) - return object; - var message = new $root.google.cloud.batch.v1alpha.JobDependency(); - if (object.items) { - if (typeof object.items !== "object") - throw TypeError(".google.cloud.batch.v1alpha.JobDependency.items: object expected"); - message.items = {}; - for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) - switch (object.items[keys[i]]) { - default: - if (typeof object.items[keys[i]] === "number") { - message.items[keys[i]] = object.items[keys[i]]; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.items[keys[i]] = 0; - break; - case "SUCCEEDED": - case 1: - message.items[keys[i]] = 1; - break; - case "FAILED": - case 2: - message.items[keys[i]] = 2; - break; - case "FINISHED": - case 3: - message.items[keys[i]] = 3; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a JobDependency message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.JobDependency - * @static - * @param {google.cloud.batch.v1alpha.JobDependency} message JobDependency - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - JobDependency.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.items = {}; - var keys2; - if (message.items && (keys2 = Object.keys(message.items)).length) { - object.items = {}; - for (var j = 0; j < keys2.length; ++j) - object.items[keys2[j]] = options.enums === String ? $root.google.cloud.batch.v1alpha.JobDependency.Type[message.items[keys2[j]]] === undefined ? message.items[keys2[j]] : $root.google.cloud.batch.v1alpha.JobDependency.Type[message.items[keys2[j]]] : message.items[keys2[j]]; - } - return object; - }; - - /** - * Converts this JobDependency to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.JobDependency - * @instance - * @returns {Object.} JSON object - */ - JobDependency.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for JobDependency - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.JobDependency - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - JobDependency.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.JobDependency"; - }; - - /** - * Type enum. - * @name google.cloud.batch.v1alpha.JobDependency.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} SUCCEEDED=1 SUCCEEDED value - * @property {number} FAILED=2 FAILED value - * @property {number} FINISHED=3 FINISHED value - */ - JobDependency.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SUCCEEDED"] = 1; - values[valuesById[2] = "FAILED"] = 2; - values[valuesById[3] = "FINISHED"] = 3; - return values; - })(); - - return JobDependency; - })(); - - v1alpha.JobStatus = (function() { - - /** - * Properties of a JobStatus. - * @memberof google.cloud.batch.v1alpha - * @interface IJobStatus - * @property {google.cloud.batch.v1alpha.JobStatus.State|null} [state] JobStatus state - * @property {Array.|null} [statusEvents] JobStatus statusEvents - * @property {Object.|null} [taskGroups] JobStatus taskGroups - * @property {google.protobuf.IDuration|null} [runDuration] JobStatus runDuration - * @property {google.cloud.batch.v1alpha.IResourceUsage|null} [resourceUsage] JobStatus resourceUsage - */ - - /** - * Constructs a new JobStatus. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a JobStatus. - * @implements IJobStatus - * @constructor - * @param {google.cloud.batch.v1alpha.IJobStatus=} [properties] Properties to set - */ - function JobStatus(properties) { - this.statusEvents = []; - this.taskGroups = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * JobStatus state. - * @member {google.cloud.batch.v1alpha.JobStatus.State} state - * @memberof google.cloud.batch.v1alpha.JobStatus - * @instance - */ - JobStatus.prototype.state = 0; - - /** - * JobStatus statusEvents. - * @member {Array.} statusEvents - * @memberof google.cloud.batch.v1alpha.JobStatus - * @instance - */ - JobStatus.prototype.statusEvents = $util.emptyArray; - - /** - * JobStatus taskGroups. - * @member {Object.} taskGroups - * @memberof google.cloud.batch.v1alpha.JobStatus - * @instance - */ - JobStatus.prototype.taskGroups = $util.emptyObject; - - /** - * JobStatus runDuration. - * @member {google.protobuf.IDuration|null|undefined} runDuration - * @memberof google.cloud.batch.v1alpha.JobStatus - * @instance - */ - JobStatus.prototype.runDuration = null; - - /** - * JobStatus resourceUsage. - * @member {google.cloud.batch.v1alpha.IResourceUsage|null|undefined} resourceUsage - * @memberof google.cloud.batch.v1alpha.JobStatus - * @instance - */ - JobStatus.prototype.resourceUsage = null; - - /** - * Creates a new JobStatus instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.JobStatus - * @static - * @param {google.cloud.batch.v1alpha.IJobStatus=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.JobStatus} JobStatus instance - */ - JobStatus.create = function create(properties) { - return new JobStatus(properties); - }; - - /** - * Encodes the specified JobStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.JobStatus - * @static - * @param {google.cloud.batch.v1alpha.IJobStatus} message JobStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JobStatus.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); - if (message.statusEvents != null && message.statusEvents.length) - for (var i = 0; i < message.statusEvents.length; ++i) - $root.google.cloud.batch.v1alpha.StatusEvent.encode(message.statusEvents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.taskGroups != null && Object.hasOwnProperty.call(message, "taskGroups")) - for (var keys = Object.keys(message.taskGroups), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.encode(message.taskGroups[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.runDuration != null && Object.hasOwnProperty.call(message, "runDuration")) - $root.google.protobuf.Duration.encode(message.runDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.resourceUsage != null && Object.hasOwnProperty.call(message, "resourceUsage")) - $root.google.cloud.batch.v1alpha.ResourceUsage.encode(message.resourceUsage, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified JobStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.JobStatus - * @static - * @param {google.cloud.batch.v1alpha.IJobStatus} message JobStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JobStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a JobStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.JobStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.JobStatus} JobStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JobStatus.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.JobStatus(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.state = reader.int32(); - break; - } - case 2: { - if (!(message.statusEvents && message.statusEvents.length)) - message.statusEvents = []; - message.statusEvents.push($root.google.cloud.batch.v1alpha.StatusEvent.decode(reader, reader.uint32())); - break; - } - case 4: { - if (message.taskGroups === $util.emptyObject) - message.taskGroups = {}; - 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.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.taskGroups[key] = value; - break; - } - case 5: { - message.runDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 6: { - message.resourceUsage = $root.google.cloud.batch.v1alpha.ResourceUsage.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a JobStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.JobStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.JobStatus} JobStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JobStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a JobStatus message. - * @function verify - * @memberof google.cloud.batch.v1alpha.JobStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - JobStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - if (message.statusEvents != null && message.hasOwnProperty("statusEvents")) { - if (!Array.isArray(message.statusEvents)) - return "statusEvents: array expected"; - for (var i = 0; i < message.statusEvents.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.StatusEvent.verify(message.statusEvents[i]); - if (error) - return "statusEvents." + error; - } - } - if (message.taskGroups != null && message.hasOwnProperty("taskGroups")) { - if (!$util.isObject(message.taskGroups)) - return "taskGroups: object expected"; - var key = Object.keys(message.taskGroups); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.verify(message.taskGroups[key[i]]); - if (error) - return "taskGroups." + error; - } - } - if (message.runDuration != null && message.hasOwnProperty("runDuration")) { - var error = $root.google.protobuf.Duration.verify(message.runDuration); - if (error) - return "runDuration." + error; - } - if (message.resourceUsage != null && message.hasOwnProperty("resourceUsage")) { - var error = $root.google.cloud.batch.v1alpha.ResourceUsage.verify(message.resourceUsage); - if (error) - return "resourceUsage." + error; - } - return null; - }; - - /** - * Creates a JobStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.JobStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.JobStatus} JobStatus - */ - JobStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.JobStatus) - return object; - var message = new $root.google.cloud.batch.v1alpha.JobStatus(); - 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 "QUEUED": - case 1: - message.state = 1; - break; - case "SCHEDULED": - case 2: - message.state = 2; - break; - case "RUNNING": - case 3: - message.state = 3; - break; - case "SUCCEEDED": - case 4: - message.state = 4; - break; - case "FAILED": - case 5: - message.state = 5; - break; - case "DELETION_IN_PROGRESS": - case 6: - message.state = 6; - break; - case "CANCELLATION_IN_PROGRESS": - case 7: - message.state = 7; - break; - case "CANCELLED": - case 8: - message.state = 8; - break; - } - if (object.statusEvents) { - if (!Array.isArray(object.statusEvents)) - throw TypeError(".google.cloud.batch.v1alpha.JobStatus.statusEvents: array expected"); - message.statusEvents = []; - for (var i = 0; i < object.statusEvents.length; ++i) { - if (typeof object.statusEvents[i] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.JobStatus.statusEvents: object expected"); - message.statusEvents[i] = $root.google.cloud.batch.v1alpha.StatusEvent.fromObject(object.statusEvents[i]); - } - } - if (object.taskGroups) { - if (typeof object.taskGroups !== "object") - throw TypeError(".google.cloud.batch.v1alpha.JobStatus.taskGroups: object expected"); - message.taskGroups = {}; - for (var keys = Object.keys(object.taskGroups), i = 0; i < keys.length; ++i) { - if (typeof object.taskGroups[keys[i]] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.JobStatus.taskGroups: object expected"); - message.taskGroups[keys[i]] = $root.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.fromObject(object.taskGroups[keys[i]]); - } - } - if (object.runDuration != null) { - if (typeof object.runDuration !== "object") - throw TypeError(".google.cloud.batch.v1alpha.JobStatus.runDuration: object expected"); - message.runDuration = $root.google.protobuf.Duration.fromObject(object.runDuration); - } - if (object.resourceUsage != null) { - if (typeof object.resourceUsage !== "object") - throw TypeError(".google.cloud.batch.v1alpha.JobStatus.resourceUsage: object expected"); - message.resourceUsage = $root.google.cloud.batch.v1alpha.ResourceUsage.fromObject(object.resourceUsage); - } - return message; - }; - - /** - * Creates a plain object from a JobStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.JobStatus - * @static - * @param {google.cloud.batch.v1alpha.JobStatus} message JobStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - JobStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.statusEvents = []; - if (options.objects || options.defaults) - object.taskGroups = {}; - if (options.defaults) { - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.runDuration = null; - object.resourceUsage = null; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.batch.v1alpha.JobStatus.State[message.state] === undefined ? message.state : $root.google.cloud.batch.v1alpha.JobStatus.State[message.state] : message.state; - if (message.statusEvents && message.statusEvents.length) { - object.statusEvents = []; - for (var j = 0; j < message.statusEvents.length; ++j) - object.statusEvents[j] = $root.google.cloud.batch.v1alpha.StatusEvent.toObject(message.statusEvents[j], options); - } - var keys2; - if (message.taskGroups && (keys2 = Object.keys(message.taskGroups)).length) { - object.taskGroups = {}; - for (var j = 0; j < keys2.length; ++j) - object.taskGroups[keys2[j]] = $root.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.toObject(message.taskGroups[keys2[j]], options); - } - if (message.runDuration != null && message.hasOwnProperty("runDuration")) - object.runDuration = $root.google.protobuf.Duration.toObject(message.runDuration, options); - if (message.resourceUsage != null && message.hasOwnProperty("resourceUsage")) - object.resourceUsage = $root.google.cloud.batch.v1alpha.ResourceUsage.toObject(message.resourceUsage, options); - return object; - }; - - /** - * Converts this JobStatus to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.JobStatus - * @instance - * @returns {Object.} JSON object - */ - JobStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for JobStatus - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.JobStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - JobStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.JobStatus"; - }; - - JobStatus.InstanceStatus = (function() { - - /** - * Properties of an InstanceStatus. - * @memberof google.cloud.batch.v1alpha.JobStatus - * @interface IInstanceStatus - * @property {string|null} [machineType] InstanceStatus machineType - * @property {google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel|null} [provisioningModel] InstanceStatus provisioningModel - * @property {number|Long|null} [taskPack] InstanceStatus taskPack - * @property {google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null} [bootDisk] InstanceStatus bootDisk - */ - - /** - * Constructs a new InstanceStatus. - * @memberof google.cloud.batch.v1alpha.JobStatus - * @classdesc Represents an InstanceStatus. - * @implements IInstanceStatus - * @constructor - * @param {google.cloud.batch.v1alpha.JobStatus.IInstanceStatus=} [properties] Properties to set - */ - function InstanceStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InstanceStatus machineType. - * @member {string} machineType - * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus - * @instance - */ - InstanceStatus.prototype.machineType = ""; - - /** - * InstanceStatus provisioningModel. - * @member {google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel} provisioningModel - * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus - * @instance - */ - InstanceStatus.prototype.provisioningModel = 0; - - /** - * InstanceStatus taskPack. - * @member {number|Long} taskPack - * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus - * @instance - */ - InstanceStatus.prototype.taskPack = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * InstanceStatus bootDisk. - * @member {google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null|undefined} bootDisk - * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus - * @instance - */ - InstanceStatus.prototype.bootDisk = null; - - /** - * Creates a new InstanceStatus instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus - * @static - * @param {google.cloud.batch.v1alpha.JobStatus.IInstanceStatus=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.JobStatus.InstanceStatus} InstanceStatus instance - */ - InstanceStatus.create = function create(properties) { - return new InstanceStatus(properties); - }; - - /** - * Encodes the specified InstanceStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.InstanceStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus - * @static - * @param {google.cloud.batch.v1alpha.JobStatus.IInstanceStatus} message InstanceStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.machineType); - if (message.provisioningModel != null && Object.hasOwnProperty.call(message, "provisioningModel")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.provisioningModel); - if (message.taskPack != null && Object.hasOwnProperty.call(message, "taskPack")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.taskPack); - if (message.bootDisk != null && Object.hasOwnProperty.call(message, "bootDisk")) - $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.encode(message.bootDisk, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified InstanceStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.InstanceStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus - * @static - * @param {google.cloud.batch.v1alpha.JobStatus.IInstanceStatus} message InstanceStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InstanceStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.JobStatus.InstanceStatus} InstanceStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceStatus.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.JobStatus.InstanceStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.machineType = reader.string(); - break; - } - case 2: { - message.provisioningModel = reader.int32(); - break; - } - case 3: { - message.taskPack = reader.int64(); - break; - } - case 4: { - message.bootDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InstanceStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.JobStatus.InstanceStatus} InstanceStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InstanceStatus message. - * @function verify - * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstanceStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.machineType != null && message.hasOwnProperty("machineType")) - if (!$util.isString(message.machineType)) - return "machineType: string expected"; - if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) - switch (message.provisioningModel) { - default: - return "provisioningModel: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.taskPack != null && message.hasOwnProperty("taskPack")) - if (!$util.isInteger(message.taskPack) && !(message.taskPack && $util.isInteger(message.taskPack.low) && $util.isInteger(message.taskPack.high))) - return "taskPack: integer|Long expected"; - if (message.bootDisk != null && message.hasOwnProperty("bootDisk")) { - var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.verify(message.bootDisk); - if (error) - return "bootDisk." + error; - } - return null; - }; - - /** - * Creates an InstanceStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.JobStatus.InstanceStatus} InstanceStatus - */ - InstanceStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.JobStatus.InstanceStatus) - return object; - var message = new $root.google.cloud.batch.v1alpha.JobStatus.InstanceStatus(); - if (object.machineType != null) - message.machineType = String(object.machineType); - switch (object.provisioningModel) { - default: - if (typeof object.provisioningModel === "number") { - message.provisioningModel = object.provisioningModel; - break; - } - break; - case "PROVISIONING_MODEL_UNSPECIFIED": - case 0: - message.provisioningModel = 0; - break; - case "STANDARD": - case 1: - message.provisioningModel = 1; - break; - case "SPOT": - case 2: - message.provisioningModel = 2; - break; - case "PREEMPTIBLE": - case 3: - message.provisioningModel = 3; - break; - } - if (object.taskPack != null) - if ($util.Long) - (message.taskPack = $util.Long.fromValue(object.taskPack)).unsigned = false; - else if (typeof object.taskPack === "string") - message.taskPack = parseInt(object.taskPack, 10); - else if (typeof object.taskPack === "number") - message.taskPack = object.taskPack; - else if (typeof object.taskPack === "object") - message.taskPack = new $util.LongBits(object.taskPack.low >>> 0, object.taskPack.high >>> 0).toNumber(); - if (object.bootDisk != null) { - if (typeof object.bootDisk !== "object") - throw TypeError(".google.cloud.batch.v1alpha.JobStatus.InstanceStatus.bootDisk: object expected"); - message.bootDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.fromObject(object.bootDisk); - } - return message; - }; - - /** - * Creates a plain object from an InstanceStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus - * @static - * @param {google.cloud.batch.v1alpha.JobStatus.InstanceStatus} message InstanceStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstanceStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.machineType = ""; - object.provisioningModel = options.enums === String ? "PROVISIONING_MODEL_UNSPECIFIED" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.taskPack = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.taskPack = options.longs === String ? "0" : 0; - object.bootDisk = null; - } - if (message.machineType != null && message.hasOwnProperty("machineType")) - object.machineType = message.machineType; - if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) - object.provisioningModel = options.enums === String ? $root.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel[message.provisioningModel] === undefined ? message.provisioningModel : $root.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel[message.provisioningModel] : message.provisioningModel; - if (message.taskPack != null && message.hasOwnProperty("taskPack")) - if (typeof message.taskPack === "number") - object.taskPack = options.longs === String ? String(message.taskPack) : message.taskPack; - else - object.taskPack = options.longs === String ? $util.Long.prototype.toString.call(message.taskPack) : options.longs === Number ? new $util.LongBits(message.taskPack.low >>> 0, message.taskPack.high >>> 0).toNumber() : message.taskPack; - if (message.bootDisk != null && message.hasOwnProperty("bootDisk")) - object.bootDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.toObject(message.bootDisk, options); - return object; - }; - - /** - * Converts this InstanceStatus to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus - * @instance - * @returns {Object.} JSON object - */ - InstanceStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InstanceStatus - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstanceStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.JobStatus.InstanceStatus"; - }; - - return InstanceStatus; - })(); - - JobStatus.TaskGroupStatus = (function() { - - /** - * Properties of a TaskGroupStatus. - * @memberof google.cloud.batch.v1alpha.JobStatus - * @interface ITaskGroupStatus - * @property {Object.|null} [counts] TaskGroupStatus counts - * @property {Array.|null} [instances] TaskGroupStatus instances - */ - - /** - * Constructs a new TaskGroupStatus. - * @memberof google.cloud.batch.v1alpha.JobStatus - * @classdesc Represents a TaskGroupStatus. - * @implements ITaskGroupStatus - * @constructor - * @param {google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus=} [properties] Properties to set - */ - function TaskGroupStatus(properties) { - this.counts = {}; - this.instances = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TaskGroupStatus counts. - * @member {Object.} counts - * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus - * @instance - */ - TaskGroupStatus.prototype.counts = $util.emptyObject; - - /** - * TaskGroupStatus instances. - * @member {Array.} instances - * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus - * @instance - */ - TaskGroupStatus.prototype.instances = $util.emptyArray; - - /** - * Creates a new TaskGroupStatus instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus - * @static - * @param {google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus} TaskGroupStatus instance - */ - TaskGroupStatus.create = function create(properties) { - return new TaskGroupStatus(properties); - }; - - /** - * Encodes the specified TaskGroupStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus - * @static - * @param {google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus} message TaskGroupStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskGroupStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.counts != null && Object.hasOwnProperty.call(message, "counts")) - for (var keys = Object.keys(message.counts), i = 0; i < keys.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int64(message.counts[keys[i]]).ldelim(); - if (message.instances != null && message.instances.length) - for (var i = 0; i < message.instances.length; ++i) - $root.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.encode(message.instances[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TaskGroupStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus - * @static - * @param {google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus} message TaskGroupStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskGroupStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TaskGroupStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus} TaskGroupStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskGroupStatus.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (message.counts === $util.emptyObject) - message.counts = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = 0; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.int64(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.counts[key] = value; - break; - } - case 2: { - if (!(message.instances && message.instances.length)) - message.instances = []; - message.instances.push($root.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TaskGroupStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus} TaskGroupStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskGroupStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TaskGroupStatus message. - * @function verify - * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TaskGroupStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.counts != null && message.hasOwnProperty("counts")) { - if (!$util.isObject(message.counts)) - return "counts: object expected"; - var key = Object.keys(message.counts); - for (var i = 0; i < key.length; ++i) - if (!$util.isInteger(message.counts[key[i]]) && !(message.counts[key[i]] && $util.isInteger(message.counts[key[i]].low) && $util.isInteger(message.counts[key[i]].high))) - return "counts: integer|Long{k:string} expected"; - } - if (message.instances != null && message.hasOwnProperty("instances")) { - if (!Array.isArray(message.instances)) - return "instances: array expected"; - for (var i = 0; i < message.instances.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.verify(message.instances[i]); - if (error) - return "instances." + error; - } - } - return null; - }; - - /** - * Creates a TaskGroupStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus} TaskGroupStatus - */ - TaskGroupStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus) - return object; - var message = new $root.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus(); - if (object.counts) { - if (typeof object.counts !== "object") - throw TypeError(".google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.counts: object expected"); - message.counts = {}; - for (var keys = Object.keys(object.counts), i = 0; i < keys.length; ++i) - if ($util.Long) - (message.counts[keys[i]] = $util.Long.fromValue(object.counts[keys[i]])).unsigned = false; - else if (typeof object.counts[keys[i]] === "string") - message.counts[keys[i]] = parseInt(object.counts[keys[i]], 10); - else if (typeof object.counts[keys[i]] === "number") - message.counts[keys[i]] = object.counts[keys[i]]; - else if (typeof object.counts[keys[i]] === "object") - message.counts[keys[i]] = new $util.LongBits(object.counts[keys[i]].low >>> 0, object.counts[keys[i]].high >>> 0).toNumber(); - } - if (object.instances) { - if (!Array.isArray(object.instances)) - throw TypeError(".google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.instances: array expected"); - message.instances = []; - for (var i = 0; i < object.instances.length; ++i) { - if (typeof object.instances[i] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.instances: object expected"); - message.instances[i] = $root.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.fromObject(object.instances[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a TaskGroupStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus - * @static - * @param {google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus} message TaskGroupStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TaskGroupStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.instances = []; - if (options.objects || options.defaults) - object.counts = {}; - var keys2; - if (message.counts && (keys2 = Object.keys(message.counts)).length) { - object.counts = {}; - for (var j = 0; j < keys2.length; ++j) - if (typeof message.counts[keys2[j]] === "number") - object.counts[keys2[j]] = options.longs === String ? String(message.counts[keys2[j]]) : message.counts[keys2[j]]; - else - object.counts[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.counts[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.counts[keys2[j]].low >>> 0, message.counts[keys2[j]].high >>> 0).toNumber() : message.counts[keys2[j]]; - } - if (message.instances && message.instances.length) { - object.instances = []; - for (var j = 0; j < message.instances.length; ++j) - object.instances[j] = $root.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.toObject(message.instances[j], options); - } - return object; - }; - - /** - * Converts this TaskGroupStatus to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus - * @instance - * @returns {Object.} JSON object - */ - TaskGroupStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TaskGroupStatus - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TaskGroupStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus"; - }; - - return TaskGroupStatus; - })(); - - /** - * State enum. - * @name google.cloud.batch.v1alpha.JobStatus.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} QUEUED=1 QUEUED value - * @property {number} SCHEDULED=2 SCHEDULED value - * @property {number} RUNNING=3 RUNNING value - * @property {number} SUCCEEDED=4 SUCCEEDED value - * @property {number} FAILED=5 FAILED value - * @property {number} DELETION_IN_PROGRESS=6 DELETION_IN_PROGRESS value - * @property {number} CANCELLATION_IN_PROGRESS=7 CANCELLATION_IN_PROGRESS value - * @property {number} CANCELLED=8 CANCELLED value - */ - JobStatus.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "QUEUED"] = 1; - values[valuesById[2] = "SCHEDULED"] = 2; - values[valuesById[3] = "RUNNING"] = 3; - values[valuesById[4] = "SUCCEEDED"] = 4; - values[valuesById[5] = "FAILED"] = 5; - values[valuesById[6] = "DELETION_IN_PROGRESS"] = 6; - values[valuesById[7] = "CANCELLATION_IN_PROGRESS"] = 7; - values[valuesById[8] = "CANCELLED"] = 8; - return values; - })(); - - return JobStatus; - })(); - - v1alpha.ResourceUsage = (function() { - - /** - * Properties of a ResourceUsage. - * @memberof google.cloud.batch.v1alpha - * @interface IResourceUsage - * @property {number|null} [coreHours] ResourceUsage coreHours - */ - - /** - * Constructs a new ResourceUsage. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a ResourceUsage. - * @implements IResourceUsage - * @constructor - * @param {google.cloud.batch.v1alpha.IResourceUsage=} [properties] Properties to set - */ - function ResourceUsage(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceUsage coreHours. - * @member {number} coreHours - * @memberof google.cloud.batch.v1alpha.ResourceUsage - * @instance - */ - ResourceUsage.prototype.coreHours = 0; - - /** - * Creates a new ResourceUsage instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.ResourceUsage - * @static - * @param {google.cloud.batch.v1alpha.IResourceUsage=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.ResourceUsage} ResourceUsage instance - */ - ResourceUsage.create = function create(properties) { - return new ResourceUsage(properties); - }; - - /** - * Encodes the specified ResourceUsage message. Does not implicitly {@link google.cloud.batch.v1alpha.ResourceUsage.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.ResourceUsage - * @static - * @param {google.cloud.batch.v1alpha.IResourceUsage} message ResourceUsage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceUsage.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.coreHours != null && Object.hasOwnProperty.call(message, "coreHours")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.coreHours); - return writer; - }; - - /** - * Encodes the specified ResourceUsage message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ResourceUsage.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.ResourceUsage - * @static - * @param {google.cloud.batch.v1alpha.IResourceUsage} message ResourceUsage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceUsage.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceUsage message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.ResourceUsage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.ResourceUsage} ResourceUsage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceUsage.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ResourceUsage(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.coreHours = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceUsage message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.ResourceUsage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.ResourceUsage} ResourceUsage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceUsage.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceUsage message. - * @function verify - * @memberof google.cloud.batch.v1alpha.ResourceUsage - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceUsage.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.coreHours != null && message.hasOwnProperty("coreHours")) - if (typeof message.coreHours !== "number") - return "coreHours: number expected"; - return null; - }; - - /** - * Creates a ResourceUsage message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.ResourceUsage - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.ResourceUsage} ResourceUsage - */ - ResourceUsage.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.ResourceUsage) - return object; - var message = new $root.google.cloud.batch.v1alpha.ResourceUsage(); - if (object.coreHours != null) - message.coreHours = Number(object.coreHours); - return message; - }; - - /** - * Creates a plain object from a ResourceUsage message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.ResourceUsage - * @static - * @param {google.cloud.batch.v1alpha.ResourceUsage} message ResourceUsage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceUsage.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.coreHours = 0; - if (message.coreHours != null && message.hasOwnProperty("coreHours")) - object.coreHours = options.json && !isFinite(message.coreHours) ? String(message.coreHours) : message.coreHours; - return object; - }; - - /** - * Converts this ResourceUsage to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.ResourceUsage - * @instance - * @returns {Object.} JSON object - */ - ResourceUsage.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceUsage - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.ResourceUsage - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceUsage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.ResourceUsage"; - }; - - return ResourceUsage; - })(); - - v1alpha.JobNotification = (function() { - - /** - * Properties of a JobNotification. - * @memberof google.cloud.batch.v1alpha - * @interface IJobNotification - * @property {string|null} [pubsubTopic] JobNotification pubsubTopic - * @property {google.cloud.batch.v1alpha.JobNotification.IMessage|null} [message] JobNotification message - */ - - /** - * Constructs a new JobNotification. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a JobNotification. - * @implements IJobNotification - * @constructor - * @param {google.cloud.batch.v1alpha.IJobNotification=} [properties] Properties to set - */ - function JobNotification(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * JobNotification pubsubTopic. - * @member {string} pubsubTopic - * @memberof google.cloud.batch.v1alpha.JobNotification - * @instance - */ - JobNotification.prototype.pubsubTopic = ""; - - /** - * JobNotification message. - * @member {google.cloud.batch.v1alpha.JobNotification.IMessage|null|undefined} message - * @memberof google.cloud.batch.v1alpha.JobNotification - * @instance - */ - JobNotification.prototype.message = null; - - /** - * Creates a new JobNotification instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.JobNotification - * @static - * @param {google.cloud.batch.v1alpha.IJobNotification=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.JobNotification} JobNotification instance - */ - JobNotification.create = function create(properties) { - return new JobNotification(properties); - }; - - /** - * Encodes the specified JobNotification message. Does not implicitly {@link google.cloud.batch.v1alpha.JobNotification.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.JobNotification - * @static - * @param {google.cloud.batch.v1alpha.IJobNotification} message JobNotification message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JobNotification.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pubsubTopic != null && Object.hasOwnProperty.call(message, "pubsubTopic")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.pubsubTopic); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - $root.google.cloud.batch.v1alpha.JobNotification.Message.encode(message.message, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified JobNotification message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobNotification.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.JobNotification - * @static - * @param {google.cloud.batch.v1alpha.IJobNotification} message JobNotification message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JobNotification.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a JobNotification message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.JobNotification - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.JobNotification} JobNotification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JobNotification.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.JobNotification(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.pubsubTopic = reader.string(); - break; - } - case 2: { - message.message = $root.google.cloud.batch.v1alpha.JobNotification.Message.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a JobNotification message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.JobNotification - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.JobNotification} JobNotification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JobNotification.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a JobNotification message. - * @function verify - * @memberof google.cloud.batch.v1alpha.JobNotification - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - JobNotification.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) - if (!$util.isString(message.pubsubTopic)) - return "pubsubTopic: string expected"; - if (message.message != null && message.hasOwnProperty("message")) { - var error = $root.google.cloud.batch.v1alpha.JobNotification.Message.verify(message.message); - if (error) - return "message." + error; - } - return null; - }; - - /** - * Creates a JobNotification message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.JobNotification - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.JobNotification} JobNotification - */ - JobNotification.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.JobNotification) - return object; - var message = new $root.google.cloud.batch.v1alpha.JobNotification(); - if (object.pubsubTopic != null) - message.pubsubTopic = String(object.pubsubTopic); - if (object.message != null) { - if (typeof object.message !== "object") - throw TypeError(".google.cloud.batch.v1alpha.JobNotification.message: object expected"); - message.message = $root.google.cloud.batch.v1alpha.JobNotification.Message.fromObject(object.message); - } - return message; - }; - - /** - * Creates a plain object from a JobNotification message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.JobNotification - * @static - * @param {google.cloud.batch.v1alpha.JobNotification} message JobNotification - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - JobNotification.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.pubsubTopic = ""; - object.message = null; - } - if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) - object.pubsubTopic = message.pubsubTopic; - if (message.message != null && message.hasOwnProperty("message")) - object.message = $root.google.cloud.batch.v1alpha.JobNotification.Message.toObject(message.message, options); - return object; - }; - - /** - * Converts this JobNotification to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.JobNotification - * @instance - * @returns {Object.} JSON object - */ - JobNotification.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for JobNotification - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.JobNotification - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - JobNotification.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.JobNotification"; - }; - - JobNotification.Message = (function() { - - /** - * Properties of a Message. - * @memberof google.cloud.batch.v1alpha.JobNotification - * @interface IMessage - * @property {google.cloud.batch.v1alpha.JobNotification.Type|null} [type] Message type - * @property {google.cloud.batch.v1alpha.JobStatus.State|null} [newJobState] Message newJobState - * @property {google.cloud.batch.v1alpha.TaskStatus.State|null} [newTaskState] Message newTaskState - */ - - /** - * Constructs a new Message. - * @memberof google.cloud.batch.v1alpha.JobNotification - * @classdesc Represents a Message. - * @implements IMessage - * @constructor - * @param {google.cloud.batch.v1alpha.JobNotification.IMessage=} [properties] Properties to set - */ - function Message(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Message type. - * @member {google.cloud.batch.v1alpha.JobNotification.Type} type - * @memberof google.cloud.batch.v1alpha.JobNotification.Message - * @instance - */ - Message.prototype.type = 0; - - /** - * Message newJobState. - * @member {google.cloud.batch.v1alpha.JobStatus.State} newJobState - * @memberof google.cloud.batch.v1alpha.JobNotification.Message - * @instance - */ - Message.prototype.newJobState = 0; - - /** - * Message newTaskState. - * @member {google.cloud.batch.v1alpha.TaskStatus.State} newTaskState - * @memberof google.cloud.batch.v1alpha.JobNotification.Message - * @instance - */ - Message.prototype.newTaskState = 0; - - /** - * Creates a new Message instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.JobNotification.Message - * @static - * @param {google.cloud.batch.v1alpha.JobNotification.IMessage=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.JobNotification.Message} Message instance - */ - Message.create = function create(properties) { - return new Message(properties); - }; - - /** - * Encodes the specified Message message. Does not implicitly {@link google.cloud.batch.v1alpha.JobNotification.Message.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.JobNotification.Message - * @static - * @param {google.cloud.batch.v1alpha.JobNotification.IMessage} message Message message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Message.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); - if (message.newJobState != null && Object.hasOwnProperty.call(message, "newJobState")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.newJobState); - if (message.newTaskState != null && Object.hasOwnProperty.call(message, "newTaskState")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.newTaskState); - return writer; - }; - - /** - * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobNotification.Message.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.JobNotification.Message - * @static - * @param {google.cloud.batch.v1alpha.JobNotification.IMessage} message Message message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Message.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Message message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.JobNotification.Message - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.JobNotification.Message} Message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Message.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.JobNotification.Message(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.type = reader.int32(); - break; - } - case 2: { - message.newJobState = reader.int32(); - break; - } - case 3: { - message.newTaskState = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Message message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.JobNotification.Message - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.JobNotification.Message} Message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Message.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Message message. - * @function verify - * @memberof google.cloud.batch.v1alpha.JobNotification.Message - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Message.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.newJobState != null && message.hasOwnProperty("newJobState")) - switch (message.newJobState) { - default: - return "newJobState: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - if (message.newTaskState != null && message.hasOwnProperty("newTaskState")) - switch (message.newTaskState) { - default: - return "newTaskState: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - return null; - }; - - /** - * Creates a Message message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.JobNotification.Message - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.JobNotification.Message} Message - */ - Message.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.JobNotification.Message) - return object; - var message = new $root.google.cloud.batch.v1alpha.JobNotification.Message(); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "JOB_STATE_CHANGED": - case 1: - message.type = 1; - break; - case "TASK_STATE_CHANGED": - case 2: - message.type = 2; - break; - } - switch (object.newJobState) { - default: - if (typeof object.newJobState === "number") { - message.newJobState = object.newJobState; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.newJobState = 0; - break; - case "QUEUED": - case 1: - message.newJobState = 1; - break; - case "SCHEDULED": - case 2: - message.newJobState = 2; - break; - case "RUNNING": - case 3: - message.newJobState = 3; - break; - case "SUCCEEDED": - case 4: - message.newJobState = 4; - break; - case "FAILED": - case 5: - message.newJobState = 5; - break; - case "DELETION_IN_PROGRESS": - case 6: - message.newJobState = 6; - break; - case "CANCELLATION_IN_PROGRESS": - case 7: - message.newJobState = 7; - break; - case "CANCELLED": - case 8: - message.newJobState = 8; - break; - } - switch (object.newTaskState) { - default: - if (typeof object.newTaskState === "number") { - message.newTaskState = object.newTaskState; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.newTaskState = 0; - break; - case "PENDING": - case 1: - message.newTaskState = 1; - break; - case "ASSIGNED": - case 2: - message.newTaskState = 2; - break; - case "RUNNING": - case 3: - message.newTaskState = 3; - break; - case "FAILED": - case 4: - message.newTaskState = 4; - break; - case "SUCCEEDED": - case 5: - message.newTaskState = 5; - break; - case "UNEXECUTED": - case 6: - message.newTaskState = 6; - break; - } - return message; - }; - - /** - * Creates a plain object from a Message message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.JobNotification.Message - * @static - * @param {google.cloud.batch.v1alpha.JobNotification.Message} message Message - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Message.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.newJobState = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.newTaskState = options.enums === String ? "STATE_UNSPECIFIED" : 0; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.batch.v1alpha.JobNotification.Type[message.type] === undefined ? message.type : $root.google.cloud.batch.v1alpha.JobNotification.Type[message.type] : message.type; - if (message.newJobState != null && message.hasOwnProperty("newJobState")) - object.newJobState = options.enums === String ? $root.google.cloud.batch.v1alpha.JobStatus.State[message.newJobState] === undefined ? message.newJobState : $root.google.cloud.batch.v1alpha.JobStatus.State[message.newJobState] : message.newJobState; - if (message.newTaskState != null && message.hasOwnProperty("newTaskState")) - object.newTaskState = options.enums === String ? $root.google.cloud.batch.v1alpha.TaskStatus.State[message.newTaskState] === undefined ? message.newTaskState : $root.google.cloud.batch.v1alpha.TaskStatus.State[message.newTaskState] : message.newTaskState; - return object; - }; - - /** - * Converts this Message to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.JobNotification.Message - * @instance - * @returns {Object.} JSON object - */ - Message.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Message - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.JobNotification.Message - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Message.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.JobNotification.Message"; - }; - - return Message; - })(); - - /** - * Type enum. - * @name google.cloud.batch.v1alpha.JobNotification.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} JOB_STATE_CHANGED=1 JOB_STATE_CHANGED value - * @property {number} TASK_STATE_CHANGED=2 TASK_STATE_CHANGED value - */ - JobNotification.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "JOB_STATE_CHANGED"] = 1; - values[valuesById[2] = "TASK_STATE_CHANGED"] = 2; - return values; - })(); - - return JobNotification; - })(); - - v1alpha.AllocationPolicy = (function() { - - /** - * Properties of an AllocationPolicy. - * @memberof google.cloud.batch.v1alpha - * @interface IAllocationPolicy - * @property {google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy|null} [location] AllocationPolicy location - * @property {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy|null} [instance] AllocationPolicy instance - * @property {Array.|null} [instances] AllocationPolicy instances - * @property {Array.|null} [instanceTemplates] AllocationPolicy instanceTemplates - * @property {Array.|null} [provisioningModels] AllocationPolicy provisioningModels - * @property {string|null} [serviceAccountEmail] AllocationPolicy serviceAccountEmail - * @property {google.cloud.batch.v1alpha.IServiceAccount|null} [serviceAccount] AllocationPolicy serviceAccount - * @property {Object.|null} [labels] AllocationPolicy labels - * @property {google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy|null} [network] AllocationPolicy network - * @property {google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy|null} [placement] AllocationPolicy placement - * @property {Array.|null} [tags] AllocationPolicy tags - */ - - /** - * Constructs a new AllocationPolicy. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents an AllocationPolicy. - * @implements IAllocationPolicy - * @constructor - * @param {google.cloud.batch.v1alpha.IAllocationPolicy=} [properties] Properties to set - */ - function AllocationPolicy(properties) { - this.instances = []; - this.instanceTemplates = []; - this.provisioningModels = []; - this.labels = {}; - this.tags = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AllocationPolicy location. - * @member {google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy|null|undefined} location - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @instance - */ - AllocationPolicy.prototype.location = null; - - /** - * AllocationPolicy instance. - * @member {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy|null|undefined} instance - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @instance - */ - AllocationPolicy.prototype.instance = null; - - /** - * AllocationPolicy instances. - * @member {Array.} instances - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @instance - */ - AllocationPolicy.prototype.instances = $util.emptyArray; - - /** - * AllocationPolicy instanceTemplates. - * @member {Array.} instanceTemplates - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @instance - */ - AllocationPolicy.prototype.instanceTemplates = $util.emptyArray; - - /** - * AllocationPolicy provisioningModels. - * @member {Array.} provisioningModels - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @instance - */ - AllocationPolicy.prototype.provisioningModels = $util.emptyArray; - - /** - * AllocationPolicy serviceAccountEmail. - * @member {string} serviceAccountEmail - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @instance - */ - AllocationPolicy.prototype.serviceAccountEmail = ""; - - /** - * AllocationPolicy serviceAccount. - * @member {google.cloud.batch.v1alpha.IServiceAccount|null|undefined} serviceAccount - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @instance - */ - AllocationPolicy.prototype.serviceAccount = null; - - /** - * AllocationPolicy labels. - * @member {Object.} labels - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @instance - */ - AllocationPolicy.prototype.labels = $util.emptyObject; - - /** - * AllocationPolicy network. - * @member {google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy|null|undefined} network - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @instance - */ - AllocationPolicy.prototype.network = null; - - /** - * AllocationPolicy placement. - * @member {google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy|null|undefined} placement - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @instance - */ - AllocationPolicy.prototype.placement = null; - - /** - * AllocationPolicy tags. - * @member {Array.} tags - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @instance - */ - AllocationPolicy.prototype.tags = $util.emptyArray; - - /** - * Creates a new AllocationPolicy instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @static - * @param {google.cloud.batch.v1alpha.IAllocationPolicy=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.AllocationPolicy} AllocationPolicy instance - */ - AllocationPolicy.create = function create(properties) { - return new AllocationPolicy(properties); - }; - - /** - * Encodes the specified AllocationPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @static - * @param {google.cloud.batch.v1alpha.IAllocationPolicy} message AllocationPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AllocationPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - $root.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.encode(message.location, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.encode(message.instance, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.instanceTemplates != null && message.instanceTemplates.length) - for (var i = 0; i < message.instanceTemplates.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.instanceTemplates[i]); - if (message.provisioningModels != null && message.provisioningModels.length) { - writer.uint32(/* id 4, wireType 2 =*/34).fork(); - for (var i = 0; i < message.provisioningModels.length; ++i) - writer.int32(message.provisioningModels[i]); - writer.ldelim(); - } - if (message.serviceAccountEmail != null && Object.hasOwnProperty.call(message, "serviceAccountEmail")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.serviceAccountEmail); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.network != null && Object.hasOwnProperty.call(message, "network")) - $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.encode(message.network, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.instances != null && message.instances.length) - for (var i = 0; i < message.instances.length; ++i) - $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.encode(message.instances[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) - $root.google.cloud.batch.v1alpha.ServiceAccount.encode(message.serviceAccount, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.placement != null && Object.hasOwnProperty.call(message, "placement")) - $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.encode(message.placement, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.tags != null && message.tags.length) - for (var i = 0; i < message.tags.length; ++i) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.tags[i]); - return writer; - }; - - /** - * Encodes the specified AllocationPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @static - * @param {google.cloud.batch.v1alpha.IAllocationPolicy} message AllocationPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AllocationPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AllocationPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.AllocationPolicy} AllocationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AllocationPolicy.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.location = $root.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.decode(reader, reader.uint32()); - break; - } - case 2: { - message.instance = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.decode(reader, reader.uint32()); - break; - } - case 8: { - if (!(message.instances && message.instances.length)) - message.instances = []; - message.instances.push($root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.instanceTemplates && message.instanceTemplates.length)) - message.instanceTemplates = []; - message.instanceTemplates.push(reader.string()); - break; - } - case 4: { - if (!(message.provisioningModels && message.provisioningModels.length)) - message.provisioningModels = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.provisioningModels.push(reader.int32()); - } else - message.provisioningModels.push(reader.int32()); - break; - } - case 5: { - message.serviceAccountEmail = reader.string(); - break; - } - case 9: { - message.serviceAccount = $root.google.cloud.batch.v1alpha.ServiceAccount.decode(reader, reader.uint32()); - break; - } - case 6: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 7: { - message.network = $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.decode(reader, reader.uint32()); - break; - } - case 10: { - message.placement = $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.decode(reader, reader.uint32()); - break; - } - case 11: { - if (!(message.tags && message.tags.length)) - message.tags = []; - message.tags.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AllocationPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.AllocationPolicy} AllocationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AllocationPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AllocationPolicy message. - * @function verify - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AllocationPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) { - var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.verify(message.location); - if (error) - return "location." + error; - } - if (message.instance != null && message.hasOwnProperty("instance")) { - var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.verify(message.instance); - if (error) - return "instance." + error; - } - if (message.instances != null && message.hasOwnProperty("instances")) { - if (!Array.isArray(message.instances)) - return "instances: array expected"; - for (var i = 0; i < message.instances.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.verify(message.instances[i]); - if (error) - return "instances." + error; - } - } - if (message.instanceTemplates != null && message.hasOwnProperty("instanceTemplates")) { - if (!Array.isArray(message.instanceTemplates)) - return "instanceTemplates: array expected"; - for (var i = 0; i < message.instanceTemplates.length; ++i) - if (!$util.isString(message.instanceTemplates[i])) - return "instanceTemplates: string[] expected"; - } - if (message.provisioningModels != null && message.hasOwnProperty("provisioningModels")) { - if (!Array.isArray(message.provisioningModels)) - return "provisioningModels: array expected"; - for (var i = 0; i < message.provisioningModels.length; ++i) - switch (message.provisioningModels[i]) { - default: - return "provisioningModels: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - } - if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) - if (!$util.isString(message.serviceAccountEmail)) - return "serviceAccountEmail: string expected"; - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) { - var error = $root.google.cloud.batch.v1alpha.ServiceAccount.verify(message.serviceAccount); - if (error) - return "serviceAccount." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.network != null && message.hasOwnProperty("network")) { - var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.verify(message.network); - if (error) - return "network." + error; - } - if (message.placement != null && message.hasOwnProperty("placement")) { - var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.verify(message.placement); - if (error) - return "placement." + error; - } - if (message.tags != null && message.hasOwnProperty("tags")) { - if (!Array.isArray(message.tags)) - return "tags: array expected"; - for (var i = 0; i < message.tags.length; ++i) - if (!$util.isString(message.tags[i])) - return "tags: string[] expected"; - } - return null; - }; - - /** - * Creates an AllocationPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.AllocationPolicy} AllocationPolicy - */ - AllocationPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy) - return object; - var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy(); - if (object.location != null) { - if (typeof object.location !== "object") - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.location: object expected"); - message.location = $root.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.fromObject(object.location); - } - if (object.instance != null) { - if (typeof object.instance !== "object") - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.instance: object expected"); - message.instance = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.fromObject(object.instance); - } - if (object.instances) { - if (!Array.isArray(object.instances)) - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.instances: array expected"); - message.instances = []; - for (var i = 0; i < object.instances.length; ++i) { - if (typeof object.instances[i] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.instances: object expected"); - message.instances[i] = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.fromObject(object.instances[i]); - } - } - if (object.instanceTemplates) { - if (!Array.isArray(object.instanceTemplates)) - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.instanceTemplates: array expected"); - message.instanceTemplates = []; - for (var i = 0; i < object.instanceTemplates.length; ++i) - message.instanceTemplates[i] = String(object.instanceTemplates[i]); - } - if (object.provisioningModels) { - if (!Array.isArray(object.provisioningModels)) - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.provisioningModels: array expected"); - message.provisioningModels = []; - for (var i = 0; i < object.provisioningModels.length; ++i) - switch (object.provisioningModels[i]) { - default: - if (typeof object.provisioningModels[i] === "number") { - message.provisioningModels[i] = object.provisioningModels[i]; - break; - } - case "PROVISIONING_MODEL_UNSPECIFIED": - case 0: - message.provisioningModels[i] = 0; - break; - case "STANDARD": - case 1: - message.provisioningModels[i] = 1; - break; - case "SPOT": - case 2: - message.provisioningModels[i] = 2; - break; - case "PREEMPTIBLE": - case 3: - message.provisioningModels[i] = 3; - break; - } - } - if (object.serviceAccountEmail != null) - message.serviceAccountEmail = String(object.serviceAccountEmail); - if (object.serviceAccount != null) { - if (typeof object.serviceAccount !== "object") - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.serviceAccount: object expected"); - message.serviceAccount = $root.google.cloud.batch.v1alpha.ServiceAccount.fromObject(object.serviceAccount); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - if (object.network != null) { - if (typeof object.network !== "object") - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.network: object expected"); - message.network = $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.fromObject(object.network); - } - if (object.placement != null) { - if (typeof object.placement !== "object") - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.placement: object expected"); - message.placement = $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.fromObject(object.placement); - } - if (object.tags) { - if (!Array.isArray(object.tags)) - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.tags: array expected"); - message.tags = []; - for (var i = 0; i < object.tags.length; ++i) - message.tags[i] = String(object.tags[i]); - } - return message; - }; - - /** - * Creates a plain object from an AllocationPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy} message AllocationPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AllocationPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.instanceTemplates = []; - object.provisioningModels = []; - object.instances = []; - object.tags = []; - } - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.location = null; - object.instance = null; - object.serviceAccountEmail = ""; - object.network = null; - object.serviceAccount = null; - object.placement = null; - } - if (message.location != null && message.hasOwnProperty("location")) - object.location = $root.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.toObject(message.location, options); - if (message.instance != null && message.hasOwnProperty("instance")) - object.instance = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.toObject(message.instance, options); - if (message.instanceTemplates && message.instanceTemplates.length) { - object.instanceTemplates = []; - for (var j = 0; j < message.instanceTemplates.length; ++j) - object.instanceTemplates[j] = message.instanceTemplates[j]; - } - if (message.provisioningModels && message.provisioningModels.length) { - object.provisioningModels = []; - for (var j = 0; j < message.provisioningModels.length; ++j) - object.provisioningModels[j] = options.enums === String ? $root.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel[message.provisioningModels[j]] === undefined ? message.provisioningModels[j] : $root.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel[message.provisioningModels[j]] : message.provisioningModels[j]; - } - if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) - object.serviceAccountEmail = message.serviceAccountEmail; - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.network != null && message.hasOwnProperty("network")) - object.network = $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.toObject(message.network, options); - if (message.instances && message.instances.length) { - object.instances = []; - for (var j = 0; j < message.instances.length; ++j) - object.instances[j] = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.toObject(message.instances[j], options); - } - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - object.serviceAccount = $root.google.cloud.batch.v1alpha.ServiceAccount.toObject(message.serviceAccount, options); - if (message.placement != null && message.hasOwnProperty("placement")) - object.placement = $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.toObject(message.placement, options); - if (message.tags && message.tags.length) { - object.tags = []; - for (var j = 0; j < message.tags.length; ++j) - object.tags[j] = message.tags[j]; - } - return object; - }; - - /** - * Converts this AllocationPolicy to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @instance - * @returns {Object.} JSON object - */ - AllocationPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AllocationPolicy - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AllocationPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy"; - }; - - AllocationPolicy.LocationPolicy = (function() { - - /** - * Properties of a LocationPolicy. - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @interface ILocationPolicy - * @property {Array.|null} [allowedLocations] LocationPolicy allowedLocations - * @property {Array.|null} [deniedLocations] LocationPolicy deniedLocations - */ - - /** - * Constructs a new LocationPolicy. - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @classdesc Represents a LocationPolicy. - * @implements ILocationPolicy - * @constructor - * @param {google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy=} [properties] Properties to set - */ - function LocationPolicy(properties) { - this.allowedLocations = []; - this.deniedLocations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LocationPolicy allowedLocations. - * @member {Array.} allowedLocations - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy - * @instance - */ - LocationPolicy.prototype.allowedLocations = $util.emptyArray; - - /** - * LocationPolicy deniedLocations. - * @member {Array.} deniedLocations - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy - * @instance - */ - LocationPolicy.prototype.deniedLocations = $util.emptyArray; - - /** - * Creates a new LocationPolicy instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy} LocationPolicy instance - */ - LocationPolicy.create = function create(properties) { - return new LocationPolicy(properties); - }; - - /** - * Encodes the specified LocationPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy} message LocationPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LocationPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowedLocations != null && message.allowedLocations.length) - for (var i = 0; i < message.allowedLocations.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedLocations[i]); - if (message.deniedLocations != null && message.deniedLocations.length) - for (var i = 0; i < message.deniedLocations.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.deniedLocations[i]); - return writer; - }; - - /** - * Encodes the specified LocationPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy} message LocationPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LocationPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LocationPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy} LocationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LocationPolicy.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.allowedLocations && message.allowedLocations.length)) - message.allowedLocations = []; - message.allowedLocations.push(reader.string()); - break; - } - case 2: { - if (!(message.deniedLocations && message.deniedLocations.length)) - message.deniedLocations = []; - message.deniedLocations.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LocationPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy} LocationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LocationPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LocationPolicy message. - * @function verify - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LocationPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowedLocations != null && message.hasOwnProperty("allowedLocations")) { - if (!Array.isArray(message.allowedLocations)) - return "allowedLocations: array expected"; - for (var i = 0; i < message.allowedLocations.length; ++i) - if (!$util.isString(message.allowedLocations[i])) - return "allowedLocations: string[] expected"; - } - if (message.deniedLocations != null && message.hasOwnProperty("deniedLocations")) { - if (!Array.isArray(message.deniedLocations)) - return "deniedLocations: array expected"; - for (var i = 0; i < message.deniedLocations.length; ++i) - if (!$util.isString(message.deniedLocations[i])) - return "deniedLocations: string[] expected"; - } - return null; - }; - - /** - * Creates a LocationPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy} LocationPolicy - */ - LocationPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy) - return object; - var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy(); - if (object.allowedLocations) { - if (!Array.isArray(object.allowedLocations)) - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.allowedLocations: array expected"); - message.allowedLocations = []; - for (var i = 0; i < object.allowedLocations.length; ++i) - message.allowedLocations[i] = String(object.allowedLocations[i]); - } - if (object.deniedLocations) { - if (!Array.isArray(object.deniedLocations)) - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.deniedLocations: array expected"); - message.deniedLocations = []; - for (var i = 0; i < object.deniedLocations.length; ++i) - message.deniedLocations[i] = String(object.deniedLocations[i]); - } - return message; - }; - - /** - * Creates a plain object from a LocationPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy} message LocationPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LocationPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.allowedLocations = []; - object.deniedLocations = []; - } - if (message.allowedLocations && message.allowedLocations.length) { - object.allowedLocations = []; - for (var j = 0; j < message.allowedLocations.length; ++j) - object.allowedLocations[j] = message.allowedLocations[j]; - } - if (message.deniedLocations && message.deniedLocations.length) { - object.deniedLocations = []; - for (var j = 0; j < message.deniedLocations.length; ++j) - object.deniedLocations[j] = message.deniedLocations[j]; - } - return object; - }; - - /** - * Converts this LocationPolicy to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy - * @instance - * @returns {Object.} JSON object - */ - LocationPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LocationPolicy - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LocationPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy"; - }; - - return LocationPolicy; - })(); - - AllocationPolicy.Disk = (function() { - - /** - * Properties of a Disk. - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @interface IDisk - * @property {string|null} [image] Disk image - * @property {string|null} [snapshot] Disk snapshot - * @property {string|null} [type] Disk type - * @property {number|Long|null} [sizeGb] Disk sizeGb - * @property {string|null} [diskInterface] Disk diskInterface - */ - - /** - * Constructs a new Disk. - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @classdesc Represents a Disk. - * @implements IDisk - * @constructor - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IDisk=} [properties] Properties to set - */ - function Disk(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Disk image. - * @member {string|null|undefined} image - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk - * @instance - */ - Disk.prototype.image = null; - - /** - * Disk snapshot. - * @member {string|null|undefined} snapshot - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk - * @instance - */ - Disk.prototype.snapshot = null; - - /** - * Disk type. - * @member {string} type - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk - * @instance - */ - Disk.prototype.type = ""; - - /** - * Disk sizeGb. - * @member {number|Long} sizeGb - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk - * @instance - */ - Disk.prototype.sizeGb = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Disk diskInterface. - * @member {string} diskInterface - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk - * @instance - */ - Disk.prototype.diskInterface = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Disk dataSource. - * @member {"image"|"snapshot"|undefined} dataSource - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk - * @instance - */ - Object.defineProperty(Disk.prototype, "dataSource", { - get: $util.oneOfGetter($oneOfFields = ["image", "snapshot"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Disk instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IDisk=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.Disk} Disk instance - */ - Disk.create = function create(properties) { - return new Disk(properties); - }; - - /** - * Encodes the specified Disk message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.Disk.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IDisk} message Disk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Disk.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.sizeGb != null && Object.hasOwnProperty.call(message, "sizeGb")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.sizeGb); - if (message.image != null && Object.hasOwnProperty.call(message, "image")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.image); - if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.snapshot); - if (message.diskInterface != null && Object.hasOwnProperty.call(message, "diskInterface")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.diskInterface); - return writer; - }; - - /** - * Encodes the specified Disk message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.Disk.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IDisk} message Disk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Disk.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Disk message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.Disk} Disk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Disk.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 4: { - message.image = reader.string(); - break; - } - case 5: { - message.snapshot = reader.string(); - break; - } - case 1: { - message.type = reader.string(); - break; - } - case 2: { - message.sizeGb = reader.int64(); - break; - } - case 6: { - message.diskInterface = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Disk message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.Disk} Disk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Disk.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Disk message. - * @function verify - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Disk.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.image != null && message.hasOwnProperty("image")) { - properties.dataSource = 1; - if (!$util.isString(message.image)) - return "image: string expected"; - } - if (message.snapshot != null && message.hasOwnProperty("snapshot")) { - if (properties.dataSource === 1) - return "dataSource: multiple values"; - properties.dataSource = 1; - if (!$util.isString(message.snapshot)) - return "snapshot: string expected"; - } - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) - if (!$util.isInteger(message.sizeGb) && !(message.sizeGb && $util.isInteger(message.sizeGb.low) && $util.isInteger(message.sizeGb.high))) - return "sizeGb: integer|Long expected"; - if (message.diskInterface != null && message.hasOwnProperty("diskInterface")) - if (!$util.isString(message.diskInterface)) - return "diskInterface: string expected"; - return null; - }; - - /** - * Creates a Disk message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.Disk} Disk - */ - Disk.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk) - return object; - var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk(); - if (object.image != null) - message.image = String(object.image); - if (object.snapshot != null) - message.snapshot = String(object.snapshot); - if (object.type != null) - message.type = String(object.type); - if (object.sizeGb != null) - if ($util.Long) - (message.sizeGb = $util.Long.fromValue(object.sizeGb)).unsigned = false; - else if (typeof object.sizeGb === "string") - message.sizeGb = parseInt(object.sizeGb, 10); - else if (typeof object.sizeGb === "number") - message.sizeGb = object.sizeGb; - else if (typeof object.sizeGb === "object") - message.sizeGb = new $util.LongBits(object.sizeGb.low >>> 0, object.sizeGb.high >>> 0).toNumber(); - if (object.diskInterface != null) - message.diskInterface = String(object.diskInterface); - return message; - }; - - /** - * Creates a plain object from a Disk message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.Disk} message Disk - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Disk.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.sizeGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sizeGb = options.longs === String ? "0" : 0; - object.diskInterface = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) - if (typeof message.sizeGb === "number") - object.sizeGb = options.longs === String ? String(message.sizeGb) : message.sizeGb; - else - object.sizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.sizeGb) : options.longs === Number ? new $util.LongBits(message.sizeGb.low >>> 0, message.sizeGb.high >>> 0).toNumber() : message.sizeGb; - if (message.image != null && message.hasOwnProperty("image")) { - object.image = message.image; - if (options.oneofs) - object.dataSource = "image"; - } - if (message.snapshot != null && message.hasOwnProperty("snapshot")) { - object.snapshot = message.snapshot; - if (options.oneofs) - object.dataSource = "snapshot"; - } - if (message.diskInterface != null && message.hasOwnProperty("diskInterface")) - object.diskInterface = message.diskInterface; - return object; - }; - - /** - * Converts this Disk to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk - * @instance - * @returns {Object.} JSON object - */ - Disk.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Disk - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Disk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy.Disk"; - }; - - return Disk; - })(); - - AllocationPolicy.AttachedDisk = (function() { - - /** - * Properties of an AttachedDisk. - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @interface IAttachedDisk - * @property {google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null} [newDisk] AttachedDisk newDisk - * @property {string|null} [existingDisk] AttachedDisk existingDisk - * @property {string|null} [deviceName] AttachedDisk deviceName - */ - - /** - * Constructs a new AttachedDisk. - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @classdesc Represents an AttachedDisk. - * @implements IAttachedDisk - * @constructor - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk=} [properties] Properties to set - */ - function AttachedDisk(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AttachedDisk newDisk. - * @member {google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null|undefined} newDisk - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk - * @instance - */ - AttachedDisk.prototype.newDisk = null; - - /** - * AttachedDisk existingDisk. - * @member {string|null|undefined} existingDisk - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk - * @instance - */ - AttachedDisk.prototype.existingDisk = null; - - /** - * AttachedDisk deviceName. - * @member {string} deviceName - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk - * @instance - */ - AttachedDisk.prototype.deviceName = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * AttachedDisk attached. - * @member {"newDisk"|"existingDisk"|undefined} attached - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk - * @instance - */ - Object.defineProperty(AttachedDisk.prototype, "attached", { - get: $util.oneOfGetter($oneOfFields = ["newDisk", "existingDisk"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new AttachedDisk instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk} AttachedDisk instance - */ - AttachedDisk.create = function create(properties) { - return new AttachedDisk(properties); - }; - - /** - * Encodes the specified AttachedDisk message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk} message AttachedDisk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttachedDisk.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.newDisk != null && Object.hasOwnProperty.call(message, "newDisk")) - $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.encode(message.newDisk, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.existingDisk != null && Object.hasOwnProperty.call(message, "existingDisk")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.existingDisk); - if (message.deviceName != null && Object.hasOwnProperty.call(message, "deviceName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.deviceName); - return writer; - }; - - /** - * Encodes the specified AttachedDisk message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk} message AttachedDisk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttachedDisk.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AttachedDisk message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk} AttachedDisk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttachedDisk.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.newDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.decode(reader, reader.uint32()); - break; - } - case 2: { - message.existingDisk = reader.string(); - break; - } - case 3: { - message.deviceName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AttachedDisk message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk} AttachedDisk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttachedDisk.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AttachedDisk message. - * @function verify - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AttachedDisk.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.newDisk != null && message.hasOwnProperty("newDisk")) { - properties.attached = 1; - { - var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.verify(message.newDisk); - if (error) - return "newDisk." + error; - } - } - if (message.existingDisk != null && message.hasOwnProperty("existingDisk")) { - if (properties.attached === 1) - return "attached: multiple values"; - properties.attached = 1; - if (!$util.isString(message.existingDisk)) - return "existingDisk: string expected"; - } - if (message.deviceName != null && message.hasOwnProperty("deviceName")) - if (!$util.isString(message.deviceName)) - return "deviceName: string expected"; - return null; - }; - - /** - * Creates an AttachedDisk message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk} AttachedDisk - */ - AttachedDisk.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk) - return object; - var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk(); - if (object.newDisk != null) { - if (typeof object.newDisk !== "object") - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.newDisk: object expected"); - message.newDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.fromObject(object.newDisk); - } - if (object.existingDisk != null) - message.existingDisk = String(object.existingDisk); - if (object.deviceName != null) - message.deviceName = String(object.deviceName); - return message; - }; - - /** - * Creates a plain object from an AttachedDisk message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk} message AttachedDisk - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AttachedDisk.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.deviceName = ""; - if (message.newDisk != null && message.hasOwnProperty("newDisk")) { - object.newDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.toObject(message.newDisk, options); - if (options.oneofs) - object.attached = "newDisk"; - } - if (message.existingDisk != null && message.hasOwnProperty("existingDisk")) { - object.existingDisk = message.existingDisk; - if (options.oneofs) - object.attached = "existingDisk"; - } - if (message.deviceName != null && message.hasOwnProperty("deviceName")) - object.deviceName = message.deviceName; - return object; - }; - - /** - * Converts this AttachedDisk to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk - * @instance - * @returns {Object.} JSON object - */ - AttachedDisk.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AttachedDisk - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AttachedDisk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk"; - }; - - return AttachedDisk; - })(); - - AllocationPolicy.Accelerator = (function() { - - /** - * Properties of an Accelerator. - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @interface IAccelerator - * @property {string|null} [type] Accelerator type - * @property {number|Long|null} [count] Accelerator count - * @property {boolean|null} [installGpuDrivers] Accelerator installGpuDrivers - * @property {string|null} [driverVersion] Accelerator driverVersion - */ - - /** - * Constructs a new Accelerator. - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @classdesc Represents an Accelerator. - * @implements IAccelerator - * @constructor - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator=} [properties] Properties to set - */ - function Accelerator(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Accelerator type. - * @member {string} type - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator - * @instance - */ - Accelerator.prototype.type = ""; - - /** - * Accelerator count. - * @member {number|Long} count - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator - * @instance - */ - Accelerator.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Accelerator installGpuDrivers. - * @member {boolean} installGpuDrivers - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator - * @instance - */ - Accelerator.prototype.installGpuDrivers = false; - - /** - * Accelerator driverVersion. - * @member {string} driverVersion - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator - * @instance - */ - Accelerator.prototype.driverVersion = ""; - - /** - * Creates a new Accelerator instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.Accelerator} Accelerator instance - */ - Accelerator.create = function create(properties) { - return new Accelerator(properties); - }; - - /** - * Encodes the specified Accelerator message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator} message Accelerator message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Accelerator.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); - if (message.installGpuDrivers != null && Object.hasOwnProperty.call(message, "installGpuDrivers")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.installGpuDrivers); - if (message.driverVersion != null && Object.hasOwnProperty.call(message, "driverVersion")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.driverVersion); - return writer; - }; - - /** - * Encodes the specified Accelerator message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator} message Accelerator message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Accelerator.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Accelerator message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.Accelerator} Accelerator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Accelerator.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - message.count = reader.int64(); - break; - } - case 3: { - message.installGpuDrivers = reader.bool(); - break; - } - case 4: { - message.driverVersion = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Accelerator message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.Accelerator} Accelerator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Accelerator.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Accelerator message. - * @function verify - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Accelerator.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) - return "count: integer|Long expected"; - if (message.installGpuDrivers != null && message.hasOwnProperty("installGpuDrivers")) - if (typeof message.installGpuDrivers !== "boolean") - return "installGpuDrivers: boolean expected"; - if (message.driverVersion != null && message.hasOwnProperty("driverVersion")) - if (!$util.isString(message.driverVersion)) - return "driverVersion: string expected"; - return null; - }; - - /** - * Creates an Accelerator message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.Accelerator} Accelerator - */ - Accelerator.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator) - return object; - var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator(); - if (object.type != null) - message.type = String(object.type); - if (object.count != null) - if ($util.Long) - (message.count = $util.Long.fromValue(object.count)).unsigned = false; - else if (typeof object.count === "string") - message.count = parseInt(object.count, 10); - else if (typeof object.count === "number") - message.count = object.count; - else if (typeof object.count === "object") - message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); - if (object.installGpuDrivers != null) - message.installGpuDrivers = Boolean(object.installGpuDrivers); - if (object.driverVersion != null) - message.driverVersion = String(object.driverVersion); - return message; - }; - - /** - * Creates a plain object from an Accelerator message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.Accelerator} message Accelerator - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Accelerator.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.count = options.longs === String ? "0" : 0; - object.installGpuDrivers = false; - object.driverVersion = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.count != null && message.hasOwnProperty("count")) - if (typeof message.count === "number") - object.count = options.longs === String ? String(message.count) : message.count; - else - object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; - if (message.installGpuDrivers != null && message.hasOwnProperty("installGpuDrivers")) - object.installGpuDrivers = message.installGpuDrivers; - if (message.driverVersion != null && message.hasOwnProperty("driverVersion")) - object.driverVersion = message.driverVersion; - return object; - }; - - /** - * Converts this Accelerator to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator - * @instance - * @returns {Object.} JSON object - */ - Accelerator.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Accelerator - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Accelerator.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy.Accelerator"; - }; - - return Accelerator; - })(); - - AllocationPolicy.InstancePolicy = (function() { - - /** - * Properties of an InstancePolicy. - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @interface IInstancePolicy - * @property {Array.|null} [allowedMachineTypes] InstancePolicy allowedMachineTypes - * @property {string|null} [machineType] InstancePolicy machineType - * @property {string|null} [minCpuPlatform] InstancePolicy minCpuPlatform - * @property {google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel|null} [provisioningModel] InstancePolicy provisioningModel - * @property {Array.|null} [accelerators] InstancePolicy accelerators - * @property {google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null} [bootDisk] InstancePolicy bootDisk - * @property {Array.|null} [disks] InstancePolicy disks - * @property {string|null} [reservation] InstancePolicy reservation - */ - - /** - * Constructs a new InstancePolicy. - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @classdesc Represents an InstancePolicy. - * @implements IInstancePolicy - * @constructor - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy=} [properties] Properties to set - */ - function InstancePolicy(properties) { - this.allowedMachineTypes = []; - this.accelerators = []; - this.disks = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InstancePolicy allowedMachineTypes. - * @member {Array.} allowedMachineTypes - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy - * @instance - */ - InstancePolicy.prototype.allowedMachineTypes = $util.emptyArray; - - /** - * InstancePolicy machineType. - * @member {string} machineType - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy - * @instance - */ - InstancePolicy.prototype.machineType = ""; - - /** - * InstancePolicy minCpuPlatform. - * @member {string} minCpuPlatform - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy - * @instance - */ - InstancePolicy.prototype.minCpuPlatform = ""; - - /** - * InstancePolicy provisioningModel. - * @member {google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel} provisioningModel - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy - * @instance - */ - InstancePolicy.prototype.provisioningModel = 0; - - /** - * InstancePolicy accelerators. - * @member {Array.} accelerators - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy - * @instance - */ - InstancePolicy.prototype.accelerators = $util.emptyArray; - - /** - * InstancePolicy bootDisk. - * @member {google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null|undefined} bootDisk - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy - * @instance - */ - InstancePolicy.prototype.bootDisk = null; - - /** - * InstancePolicy disks. - * @member {Array.} disks - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy - * @instance - */ - InstancePolicy.prototype.disks = $util.emptyArray; - - /** - * InstancePolicy reservation. - * @member {string} reservation - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy - * @instance - */ - InstancePolicy.prototype.reservation = ""; - - /** - * Creates a new InstancePolicy instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy} InstancePolicy instance - */ - InstancePolicy.create = function create(properties) { - return new InstancePolicy(properties); - }; - - /** - * Encodes the specified InstancePolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy} message InstancePolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstancePolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowedMachineTypes != null && message.allowedMachineTypes.length) - for (var i = 0; i < message.allowedMachineTypes.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedMachineTypes[i]); - if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.machineType); - if (message.minCpuPlatform != null && Object.hasOwnProperty.call(message, "minCpuPlatform")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.minCpuPlatform); - if (message.provisioningModel != null && Object.hasOwnProperty.call(message, "provisioningModel")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.provisioningModel); - if (message.accelerators != null && message.accelerators.length) - for (var i = 0; i < message.accelerators.length; ++i) - $root.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.encode(message.accelerators[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.disks != null && message.disks.length) - for (var i = 0; i < message.disks.length; ++i) - $root.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.encode(message.disks[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.reservation != null && Object.hasOwnProperty.call(message, "reservation")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.reservation); - if (message.bootDisk != null && Object.hasOwnProperty.call(message, "bootDisk")) - $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.encode(message.bootDisk, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified InstancePolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy} message InstancePolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstancePolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InstancePolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy} InstancePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstancePolicy.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.allowedMachineTypes && message.allowedMachineTypes.length)) - message.allowedMachineTypes = []; - message.allowedMachineTypes.push(reader.string()); - break; - } - case 2: { - message.machineType = reader.string(); - break; - } - case 3: { - message.minCpuPlatform = reader.string(); - break; - } - case 4: { - message.provisioningModel = reader.int32(); - break; - } - case 5: { - if (!(message.accelerators && message.accelerators.length)) - message.accelerators = []; - message.accelerators.push($root.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.decode(reader, reader.uint32())); - break; - } - case 8: { - message.bootDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.decode(reader, reader.uint32()); - break; - } - case 6: { - if (!(message.disks && message.disks.length)) - message.disks = []; - message.disks.push($root.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.decode(reader, reader.uint32())); - break; - } - case 7: { - message.reservation = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InstancePolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy} InstancePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstancePolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InstancePolicy message. - * @function verify - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstancePolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowedMachineTypes != null && message.hasOwnProperty("allowedMachineTypes")) { - if (!Array.isArray(message.allowedMachineTypes)) - return "allowedMachineTypes: array expected"; - for (var i = 0; i < message.allowedMachineTypes.length; ++i) - if (!$util.isString(message.allowedMachineTypes[i])) - return "allowedMachineTypes: string[] expected"; - } - if (message.machineType != null && message.hasOwnProperty("machineType")) - if (!$util.isString(message.machineType)) - return "machineType: string expected"; - if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) - if (!$util.isString(message.minCpuPlatform)) - return "minCpuPlatform: string expected"; - if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) - switch (message.provisioningModel) { - default: - return "provisioningModel: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.accelerators != null && message.hasOwnProperty("accelerators")) { - if (!Array.isArray(message.accelerators)) - return "accelerators: array expected"; - for (var i = 0; i < message.accelerators.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.verify(message.accelerators[i]); - if (error) - return "accelerators." + error; - } - } - if (message.bootDisk != null && message.hasOwnProperty("bootDisk")) { - var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.verify(message.bootDisk); - if (error) - return "bootDisk." + error; - } - if (message.disks != null && message.hasOwnProperty("disks")) { - if (!Array.isArray(message.disks)) - return "disks: array expected"; - for (var i = 0; i < message.disks.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.verify(message.disks[i]); - if (error) - return "disks." + error; - } - } - if (message.reservation != null && message.hasOwnProperty("reservation")) - if (!$util.isString(message.reservation)) - return "reservation: string expected"; - return null; - }; - - /** - * Creates an InstancePolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy} InstancePolicy - */ - InstancePolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy) - return object; - var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy(); - if (object.allowedMachineTypes) { - if (!Array.isArray(object.allowedMachineTypes)) - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.allowedMachineTypes: array expected"); - message.allowedMachineTypes = []; - for (var i = 0; i < object.allowedMachineTypes.length; ++i) - message.allowedMachineTypes[i] = String(object.allowedMachineTypes[i]); - } - if (object.machineType != null) - message.machineType = String(object.machineType); - if (object.minCpuPlatform != null) - message.minCpuPlatform = String(object.minCpuPlatform); - switch (object.provisioningModel) { - default: - if (typeof object.provisioningModel === "number") { - message.provisioningModel = object.provisioningModel; - break; - } - break; - case "PROVISIONING_MODEL_UNSPECIFIED": - case 0: - message.provisioningModel = 0; - break; - case "STANDARD": - case 1: - message.provisioningModel = 1; - break; - case "SPOT": - case 2: - message.provisioningModel = 2; - break; - case "PREEMPTIBLE": - case 3: - message.provisioningModel = 3; - break; - } - if (object.accelerators) { - if (!Array.isArray(object.accelerators)) - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.accelerators: array expected"); - message.accelerators = []; - for (var i = 0; i < object.accelerators.length; ++i) { - if (typeof object.accelerators[i] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.accelerators: object expected"); - message.accelerators[i] = $root.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.fromObject(object.accelerators[i]); - } - } - if (object.bootDisk != null) { - if (typeof object.bootDisk !== "object") - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.bootDisk: object expected"); - message.bootDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.fromObject(object.bootDisk); - } - if (object.disks) { - if (!Array.isArray(object.disks)) - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.disks: array expected"); - message.disks = []; - for (var i = 0; i < object.disks.length; ++i) { - if (typeof object.disks[i] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.disks: object expected"); - message.disks[i] = $root.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.fromObject(object.disks[i]); - } - } - if (object.reservation != null) - message.reservation = String(object.reservation); - return message; - }; - - /** - * Creates a plain object from an InstancePolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy} message InstancePolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstancePolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.allowedMachineTypes = []; - object.accelerators = []; - object.disks = []; - } - if (options.defaults) { - object.machineType = ""; - object.minCpuPlatform = ""; - object.provisioningModel = options.enums === String ? "PROVISIONING_MODEL_UNSPECIFIED" : 0; - object.reservation = ""; - object.bootDisk = null; - } - if (message.allowedMachineTypes && message.allowedMachineTypes.length) { - object.allowedMachineTypes = []; - for (var j = 0; j < message.allowedMachineTypes.length; ++j) - object.allowedMachineTypes[j] = message.allowedMachineTypes[j]; - } - if (message.machineType != null && message.hasOwnProperty("machineType")) - object.machineType = message.machineType; - if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) - object.minCpuPlatform = message.minCpuPlatform; - if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) - object.provisioningModel = options.enums === String ? $root.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel[message.provisioningModel] === undefined ? message.provisioningModel : $root.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel[message.provisioningModel] : message.provisioningModel; - if (message.accelerators && message.accelerators.length) { - object.accelerators = []; - for (var j = 0; j < message.accelerators.length; ++j) - object.accelerators[j] = $root.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.toObject(message.accelerators[j], options); - } - if (message.disks && message.disks.length) { - object.disks = []; - for (var j = 0; j < message.disks.length; ++j) - object.disks[j] = $root.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.toObject(message.disks[j], options); - } - if (message.reservation != null && message.hasOwnProperty("reservation")) - object.reservation = message.reservation; - if (message.bootDisk != null && message.hasOwnProperty("bootDisk")) - object.bootDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.toObject(message.bootDisk, options); - return object; - }; - - /** - * Converts this InstancePolicy to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy - * @instance - * @returns {Object.} JSON object - */ - InstancePolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InstancePolicy - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstancePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy"; - }; - - return InstancePolicy; - })(); - - AllocationPolicy.InstancePolicyOrTemplate = (function() { - - /** - * Properties of an InstancePolicyOrTemplate. - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @interface IInstancePolicyOrTemplate - * @property {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy|null} [policy] InstancePolicyOrTemplate policy - * @property {string|null} [instanceTemplate] InstancePolicyOrTemplate instanceTemplate - * @property {boolean|null} [installGpuDrivers] InstancePolicyOrTemplate installGpuDrivers - * @property {boolean|null} [installOpsAgent] InstancePolicyOrTemplate installOpsAgent - * @property {boolean|null} [blockProjectSshKeys] InstancePolicyOrTemplate blockProjectSshKeys - */ - - /** - * Constructs a new InstancePolicyOrTemplate. - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @classdesc Represents an InstancePolicyOrTemplate. - * @implements IInstancePolicyOrTemplate - * @constructor - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate=} [properties] Properties to set - */ - function InstancePolicyOrTemplate(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InstancePolicyOrTemplate policy. - * @member {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy|null|undefined} policy - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate - * @instance - */ - InstancePolicyOrTemplate.prototype.policy = null; - - /** - * InstancePolicyOrTemplate instanceTemplate. - * @member {string|null|undefined} instanceTemplate - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate - * @instance - */ - InstancePolicyOrTemplate.prototype.instanceTemplate = null; - - /** - * InstancePolicyOrTemplate installGpuDrivers. - * @member {boolean} installGpuDrivers - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate - * @instance - */ - InstancePolicyOrTemplate.prototype.installGpuDrivers = false; - - /** - * InstancePolicyOrTemplate installOpsAgent. - * @member {boolean} installOpsAgent - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate - * @instance - */ - InstancePolicyOrTemplate.prototype.installOpsAgent = false; - - /** - * InstancePolicyOrTemplate blockProjectSshKeys. - * @member {boolean} blockProjectSshKeys - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate - * @instance - */ - InstancePolicyOrTemplate.prototype.blockProjectSshKeys = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * InstancePolicyOrTemplate policyTemplate. - * @member {"policy"|"instanceTemplate"|undefined} policyTemplate - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate - * @instance - */ - Object.defineProperty(InstancePolicyOrTemplate.prototype, "policyTemplate", { - get: $util.oneOfGetter($oneOfFields = ["policy", "instanceTemplate"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new InstancePolicyOrTemplate instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate} InstancePolicyOrTemplate instance - */ - InstancePolicyOrTemplate.create = function create(properties) { - return new InstancePolicyOrTemplate(properties); - }; - - /** - * Encodes the specified InstancePolicyOrTemplate message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate} message InstancePolicyOrTemplate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstancePolicyOrTemplate.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) - $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.encode(message.policy, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.instanceTemplate != null && Object.hasOwnProperty.call(message, "instanceTemplate")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceTemplate); - if (message.installGpuDrivers != null && Object.hasOwnProperty.call(message, "installGpuDrivers")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.installGpuDrivers); - if (message.installOpsAgent != null && Object.hasOwnProperty.call(message, "installOpsAgent")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.installOpsAgent); - if (message.blockProjectSshKeys != null && Object.hasOwnProperty.call(message, "blockProjectSshKeys")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.blockProjectSshKeys); - return writer; - }; - - /** - * Encodes the specified InstancePolicyOrTemplate message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate} message InstancePolicyOrTemplate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstancePolicyOrTemplate.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InstancePolicyOrTemplate message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate} InstancePolicyOrTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstancePolicyOrTemplate.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.policy = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.decode(reader, reader.uint32()); - break; - } - case 2: { - message.instanceTemplate = reader.string(); - break; - } - case 3: { - message.installGpuDrivers = reader.bool(); - break; - } - case 4: { - message.installOpsAgent = reader.bool(); - break; - } - case 5: { - message.blockProjectSshKeys = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InstancePolicyOrTemplate message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate} InstancePolicyOrTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstancePolicyOrTemplate.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InstancePolicyOrTemplate message. - * @function verify - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstancePolicyOrTemplate.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.policy != null && message.hasOwnProperty("policy")) { - properties.policyTemplate = 1; - { - var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.verify(message.policy); - if (error) - return "policy." + error; - } - } - if (message.instanceTemplate != null && message.hasOwnProperty("instanceTemplate")) { - if (properties.policyTemplate === 1) - return "policyTemplate: multiple values"; - properties.policyTemplate = 1; - if (!$util.isString(message.instanceTemplate)) - return "instanceTemplate: string expected"; - } - if (message.installGpuDrivers != null && message.hasOwnProperty("installGpuDrivers")) - if (typeof message.installGpuDrivers !== "boolean") - return "installGpuDrivers: boolean expected"; - if (message.installOpsAgent != null && message.hasOwnProperty("installOpsAgent")) - if (typeof message.installOpsAgent !== "boolean") - return "installOpsAgent: boolean expected"; - if (message.blockProjectSshKeys != null && message.hasOwnProperty("blockProjectSshKeys")) - if (typeof message.blockProjectSshKeys !== "boolean") - return "blockProjectSshKeys: boolean expected"; - return null; - }; - - /** - * Creates an InstancePolicyOrTemplate message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate} InstancePolicyOrTemplate - */ - InstancePolicyOrTemplate.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate) - return object; - var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate(); - if (object.policy != null) { - if (typeof object.policy !== "object") - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.policy: object expected"); - message.policy = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.fromObject(object.policy); - } - if (object.instanceTemplate != null) - message.instanceTemplate = String(object.instanceTemplate); - if (object.installGpuDrivers != null) - message.installGpuDrivers = Boolean(object.installGpuDrivers); - if (object.installOpsAgent != null) - message.installOpsAgent = Boolean(object.installOpsAgent); - if (object.blockProjectSshKeys != null) - message.blockProjectSshKeys = Boolean(object.blockProjectSshKeys); - return message; - }; - - /** - * Creates a plain object from an InstancePolicyOrTemplate message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate} message InstancePolicyOrTemplate - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstancePolicyOrTemplate.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.installGpuDrivers = false; - object.installOpsAgent = false; - object.blockProjectSshKeys = false; - } - if (message.policy != null && message.hasOwnProperty("policy")) { - object.policy = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.toObject(message.policy, options); - if (options.oneofs) - object.policyTemplate = "policy"; - } - if (message.instanceTemplate != null && message.hasOwnProperty("instanceTemplate")) { - object.instanceTemplate = message.instanceTemplate; - if (options.oneofs) - object.policyTemplate = "instanceTemplate"; - } - if (message.installGpuDrivers != null && message.hasOwnProperty("installGpuDrivers")) - object.installGpuDrivers = message.installGpuDrivers; - if (message.installOpsAgent != null && message.hasOwnProperty("installOpsAgent")) - object.installOpsAgent = message.installOpsAgent; - if (message.blockProjectSshKeys != null && message.hasOwnProperty("blockProjectSshKeys")) - object.blockProjectSshKeys = message.blockProjectSshKeys; - return object; - }; - - /** - * Converts this InstancePolicyOrTemplate to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate - * @instance - * @returns {Object.} JSON object - */ - InstancePolicyOrTemplate.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InstancePolicyOrTemplate - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstancePolicyOrTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate"; - }; - - return InstancePolicyOrTemplate; - })(); - - AllocationPolicy.NetworkInterface = (function() { - - /** - * Properties of a NetworkInterface. - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @interface INetworkInterface - * @property {string|null} [network] NetworkInterface network - * @property {string|null} [subnetwork] NetworkInterface subnetwork - * @property {boolean|null} [noExternalIpAddress] NetworkInterface noExternalIpAddress - */ - - /** - * Constructs a new NetworkInterface. - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @classdesc Represents a NetworkInterface. - * @implements INetworkInterface - * @constructor - * @param {google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface=} [properties] Properties to set - */ - function NetworkInterface(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NetworkInterface network. - * @member {string} network - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface - * @instance - */ - NetworkInterface.prototype.network = ""; - - /** - * NetworkInterface subnetwork. - * @member {string} subnetwork - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface - * @instance - */ - NetworkInterface.prototype.subnetwork = ""; - - /** - * NetworkInterface noExternalIpAddress. - * @member {boolean} noExternalIpAddress - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface - * @instance - */ - NetworkInterface.prototype.noExternalIpAddress = false; - - /** - * Creates a new NetworkInterface instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface} NetworkInterface instance - */ - NetworkInterface.create = function create(properties) { - return new NetworkInterface(properties); - }; - - /** - * Encodes the specified NetworkInterface message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface} message NetworkInterface message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NetworkInterface.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.network != null && Object.hasOwnProperty.call(message, "network")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.network); - if (message.subnetwork != null && Object.hasOwnProperty.call(message, "subnetwork")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.subnetwork); - if (message.noExternalIpAddress != null && Object.hasOwnProperty.call(message, "noExternalIpAddress")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.noExternalIpAddress); - return writer; - }; - - /** - * Encodes the specified NetworkInterface message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface} message NetworkInterface message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NetworkInterface.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NetworkInterface message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface} NetworkInterface - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NetworkInterface.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.network = reader.string(); - break; - } - case 2: { - message.subnetwork = reader.string(); - break; - } - case 3: { - message.noExternalIpAddress = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NetworkInterface message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface} NetworkInterface - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NetworkInterface.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NetworkInterface message. - * @function verify - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NetworkInterface.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.network != null && message.hasOwnProperty("network")) - if (!$util.isString(message.network)) - return "network: string expected"; - if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) - if (!$util.isString(message.subnetwork)) - return "subnetwork: string expected"; - if (message.noExternalIpAddress != null && message.hasOwnProperty("noExternalIpAddress")) - if (typeof message.noExternalIpAddress !== "boolean") - return "noExternalIpAddress: boolean expected"; - return null; - }; - - /** - * Creates a NetworkInterface message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface} NetworkInterface - */ - NetworkInterface.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface) - return object; - var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface(); - if (object.network != null) - message.network = String(object.network); - if (object.subnetwork != null) - message.subnetwork = String(object.subnetwork); - if (object.noExternalIpAddress != null) - message.noExternalIpAddress = Boolean(object.noExternalIpAddress); - return message; - }; - - /** - * Creates a plain object from a NetworkInterface message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface} message NetworkInterface - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NetworkInterface.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.network = ""; - object.subnetwork = ""; - object.noExternalIpAddress = false; - } - if (message.network != null && message.hasOwnProperty("network")) - object.network = message.network; - if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) - object.subnetwork = message.subnetwork; - if (message.noExternalIpAddress != null && message.hasOwnProperty("noExternalIpAddress")) - object.noExternalIpAddress = message.noExternalIpAddress; - return object; - }; - - /** - * Converts this NetworkInterface to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface - * @instance - * @returns {Object.} JSON object - */ - NetworkInterface.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NetworkInterface - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NetworkInterface.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface"; - }; - - return NetworkInterface; - })(); - - AllocationPolicy.NetworkPolicy = (function() { - - /** - * Properties of a NetworkPolicy. - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @interface INetworkPolicy - * @property {Array.|null} [networkInterfaces] NetworkPolicy networkInterfaces - */ - - /** - * Constructs a new NetworkPolicy. - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @classdesc Represents a NetworkPolicy. - * @implements INetworkPolicy - * @constructor - * @param {google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy=} [properties] Properties to set - */ - function NetworkPolicy(properties) { - this.networkInterfaces = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NetworkPolicy networkInterfaces. - * @member {Array.} networkInterfaces - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy - * @instance - */ - NetworkPolicy.prototype.networkInterfaces = $util.emptyArray; - - /** - * Creates a new NetworkPolicy instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy} NetworkPolicy instance - */ - NetworkPolicy.create = function create(properties) { - return new NetworkPolicy(properties); - }; - - /** - * Encodes the specified NetworkPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy} message NetworkPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NetworkPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.networkInterfaces != null && message.networkInterfaces.length) - for (var i = 0; i < message.networkInterfaces.length; ++i) - $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.encode(message.networkInterfaces[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified NetworkPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy} message NetworkPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NetworkPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NetworkPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy} NetworkPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NetworkPolicy.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.networkInterfaces && message.networkInterfaces.length)) - message.networkInterfaces = []; - message.networkInterfaces.push($root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NetworkPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy} NetworkPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NetworkPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NetworkPolicy message. - * @function verify - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NetworkPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.networkInterfaces != null && message.hasOwnProperty("networkInterfaces")) { - if (!Array.isArray(message.networkInterfaces)) - return "networkInterfaces: array expected"; - for (var i = 0; i < message.networkInterfaces.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.verify(message.networkInterfaces[i]); - if (error) - return "networkInterfaces." + error; - } - } - return null; - }; - - /** - * Creates a NetworkPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy} NetworkPolicy - */ - NetworkPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy) - return object; - var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy(); - if (object.networkInterfaces) { - if (!Array.isArray(object.networkInterfaces)) - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.networkInterfaces: array expected"); - message.networkInterfaces = []; - for (var i = 0; i < object.networkInterfaces.length; ++i) { - if (typeof object.networkInterfaces[i] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.networkInterfaces: object expected"); - message.networkInterfaces[i] = $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.fromObject(object.networkInterfaces[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a NetworkPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy} message NetworkPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NetworkPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.networkInterfaces = []; - if (message.networkInterfaces && message.networkInterfaces.length) { - object.networkInterfaces = []; - for (var j = 0; j < message.networkInterfaces.length; ++j) - object.networkInterfaces[j] = $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.toObject(message.networkInterfaces[j], options); - } - return object; - }; - - /** - * Converts this NetworkPolicy to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy - * @instance - * @returns {Object.} JSON object - */ - NetworkPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NetworkPolicy - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NetworkPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy"; - }; - - return NetworkPolicy; - })(); - - AllocationPolicy.PlacementPolicy = (function() { - - /** - * Properties of a PlacementPolicy. - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @interface IPlacementPolicy - * @property {string|null} [collocation] PlacementPolicy collocation - * @property {number|Long|null} [maxDistance] PlacementPolicy maxDistance - */ - - /** - * Constructs a new PlacementPolicy. - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @classdesc Represents a PlacementPolicy. - * @implements IPlacementPolicy - * @constructor - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy=} [properties] Properties to set - */ - function PlacementPolicy(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PlacementPolicy collocation. - * @member {string} collocation - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy - * @instance - */ - PlacementPolicy.prototype.collocation = ""; - - /** - * PlacementPolicy maxDistance. - * @member {number|Long} maxDistance - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy - * @instance - */ - PlacementPolicy.prototype.maxDistance = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new PlacementPolicy instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy} PlacementPolicy instance - */ - PlacementPolicy.create = function create(properties) { - return new PlacementPolicy(properties); - }; - - /** - * Encodes the specified PlacementPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy} message PlacementPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PlacementPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.collocation != null && Object.hasOwnProperty.call(message, "collocation")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.collocation); - if (message.maxDistance != null && Object.hasOwnProperty.call(message, "maxDistance")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.maxDistance); - return writer; - }; - - /** - * Encodes the specified PlacementPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy} message PlacementPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PlacementPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PlacementPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy} PlacementPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PlacementPolicy.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.collocation = reader.string(); - break; - } - case 2: { - message.maxDistance = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PlacementPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy} PlacementPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PlacementPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PlacementPolicy message. - * @function verify - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PlacementPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.collocation != null && message.hasOwnProperty("collocation")) - if (!$util.isString(message.collocation)) - return "collocation: string expected"; - if (message.maxDistance != null && message.hasOwnProperty("maxDistance")) - if (!$util.isInteger(message.maxDistance) && !(message.maxDistance && $util.isInteger(message.maxDistance.low) && $util.isInteger(message.maxDistance.high))) - return "maxDistance: integer|Long expected"; - return null; - }; - - /** - * Creates a PlacementPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy} PlacementPolicy - */ - PlacementPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy) - return object; - var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy(); - if (object.collocation != null) - message.collocation = String(object.collocation); - if (object.maxDistance != null) - if ($util.Long) - (message.maxDistance = $util.Long.fromValue(object.maxDistance)).unsigned = false; - else if (typeof object.maxDistance === "string") - message.maxDistance = parseInt(object.maxDistance, 10); - else if (typeof object.maxDistance === "number") - message.maxDistance = object.maxDistance; - else if (typeof object.maxDistance === "object") - message.maxDistance = new $util.LongBits(object.maxDistance.low >>> 0, object.maxDistance.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a PlacementPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy} message PlacementPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PlacementPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.collocation = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.maxDistance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.maxDistance = options.longs === String ? "0" : 0; - } - if (message.collocation != null && message.hasOwnProperty("collocation")) - object.collocation = message.collocation; - if (message.maxDistance != null && message.hasOwnProperty("maxDistance")) - if (typeof message.maxDistance === "number") - object.maxDistance = options.longs === String ? String(message.maxDistance) : message.maxDistance; - else - object.maxDistance = options.longs === String ? $util.Long.prototype.toString.call(message.maxDistance) : options.longs === Number ? new $util.LongBits(message.maxDistance.low >>> 0, message.maxDistance.high >>> 0).toNumber() : message.maxDistance; - return object; - }; - - /** - * Converts this PlacementPolicy to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy - * @instance - * @returns {Object.} JSON object - */ - PlacementPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PlacementPolicy - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PlacementPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy"; - }; - - return PlacementPolicy; - })(); - - /** - * ProvisioningModel enum. - * @name google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel - * @enum {number} - * @property {number} PROVISIONING_MODEL_UNSPECIFIED=0 PROVISIONING_MODEL_UNSPECIFIED value - * @property {number} STANDARD=1 STANDARD value - * @property {number} SPOT=2 SPOT value - * @property {number} PREEMPTIBLE=3 PREEMPTIBLE value - */ - AllocationPolicy.ProvisioningModel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PROVISIONING_MODEL_UNSPECIFIED"] = 0; - values[valuesById[1] = "STANDARD"] = 1; - values[valuesById[2] = "SPOT"] = 2; - values[valuesById[3] = "PREEMPTIBLE"] = 3; - return values; - })(); - - return AllocationPolicy; - })(); - - v1alpha.TaskGroup = (function() { - - /** - * Properties of a TaskGroup. - * @memberof google.cloud.batch.v1alpha - * @interface ITaskGroup - * @property {string|null} [name] TaskGroup name - * @property {google.cloud.batch.v1alpha.ITaskSpec|null} [taskSpec] TaskGroup taskSpec - * @property {number|Long|null} [taskCount] TaskGroup taskCount - * @property {number|Long|null} [parallelism] TaskGroup parallelism - * @property {google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy|null} [schedulingPolicy] TaskGroup schedulingPolicy - * @property {google.cloud.batch.v1alpha.IAllocationPolicy|null} [allocationPolicy] TaskGroup allocationPolicy - * @property {Object.|null} [labels] TaskGroup labels - * @property {Array.|null} [taskEnvironments] TaskGroup taskEnvironments - * @property {number|Long|null} [taskCountPerNode] TaskGroup taskCountPerNode - * @property {boolean|null} [requireHostsFile] TaskGroup requireHostsFile - * @property {boolean|null} [permissiveSsh] TaskGroup permissiveSsh - * @property {boolean|null} [runAsNonRoot] TaskGroup runAsNonRoot - * @property {google.cloud.batch.v1alpha.IServiceAccount|null} [serviceAccount] TaskGroup serviceAccount - */ - - /** - * Constructs a new TaskGroup. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a TaskGroup. - * @implements ITaskGroup - * @constructor - * @param {google.cloud.batch.v1alpha.ITaskGroup=} [properties] Properties to set - */ - function TaskGroup(properties) { - this.labels = {}; - this.taskEnvironments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TaskGroup name. - * @member {string} name - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @instance - */ - TaskGroup.prototype.name = ""; - - /** - * TaskGroup taskSpec. - * @member {google.cloud.batch.v1alpha.ITaskSpec|null|undefined} taskSpec - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @instance - */ - TaskGroup.prototype.taskSpec = null; - - /** - * TaskGroup taskCount. - * @member {number|Long} taskCount - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @instance - */ - TaskGroup.prototype.taskCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * TaskGroup parallelism. - * @member {number|Long} parallelism - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @instance - */ - TaskGroup.prototype.parallelism = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * TaskGroup schedulingPolicy. - * @member {google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy} schedulingPolicy - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @instance - */ - TaskGroup.prototype.schedulingPolicy = 0; - - /** - * TaskGroup allocationPolicy. - * @member {google.cloud.batch.v1alpha.IAllocationPolicy|null|undefined} allocationPolicy - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @instance - */ - TaskGroup.prototype.allocationPolicy = null; - - /** - * TaskGroup labels. - * @member {Object.} labels - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @instance - */ - TaskGroup.prototype.labels = $util.emptyObject; - - /** - * TaskGroup taskEnvironments. - * @member {Array.} taskEnvironments - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @instance - */ - TaskGroup.prototype.taskEnvironments = $util.emptyArray; - - /** - * TaskGroup taskCountPerNode. - * @member {number|Long} taskCountPerNode - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @instance - */ - TaskGroup.prototype.taskCountPerNode = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * TaskGroup requireHostsFile. - * @member {boolean} requireHostsFile - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @instance - */ - TaskGroup.prototype.requireHostsFile = false; - - /** - * TaskGroup permissiveSsh. - * @member {boolean} permissiveSsh - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @instance - */ - TaskGroup.prototype.permissiveSsh = false; - - /** - * TaskGroup runAsNonRoot. - * @member {boolean} runAsNonRoot - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @instance - */ - TaskGroup.prototype.runAsNonRoot = false; - - /** - * TaskGroup serviceAccount. - * @member {google.cloud.batch.v1alpha.IServiceAccount|null|undefined} serviceAccount - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @instance - */ - TaskGroup.prototype.serviceAccount = null; - - /** - * Creates a new TaskGroup instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @static - * @param {google.cloud.batch.v1alpha.ITaskGroup=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.TaskGroup} TaskGroup instance - */ - TaskGroup.create = function create(properties) { - return new TaskGroup(properties); - }; - - /** - * Encodes the specified TaskGroup message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskGroup.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @static - * @param {google.cloud.batch.v1alpha.ITaskGroup} message TaskGroup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskGroup.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.taskSpec != null && Object.hasOwnProperty.call(message, "taskSpec")) - $root.google.cloud.batch.v1alpha.TaskSpec.encode(message.taskSpec, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.taskCount != null && Object.hasOwnProperty.call(message, "taskCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.taskCount); - if (message.parallelism != null && Object.hasOwnProperty.call(message, "parallelism")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.parallelism); - if (message.schedulingPolicy != null && Object.hasOwnProperty.call(message, "schedulingPolicy")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.schedulingPolicy); - if (message.allocationPolicy != null && Object.hasOwnProperty.call(message, "allocationPolicy")) - $root.google.cloud.batch.v1alpha.AllocationPolicy.encode(message.allocationPolicy, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.taskEnvironments != null && message.taskEnvironments.length) - for (var i = 0; i < message.taskEnvironments.length; ++i) - $root.google.cloud.batch.v1alpha.Environment.encode(message.taskEnvironments[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.taskCountPerNode != null && Object.hasOwnProperty.call(message, "taskCountPerNode")) - writer.uint32(/* id 10, wireType 0 =*/80).int64(message.taskCountPerNode); - if (message.requireHostsFile != null && Object.hasOwnProperty.call(message, "requireHostsFile")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.requireHostsFile); - if (message.permissiveSsh != null && Object.hasOwnProperty.call(message, "permissiveSsh")) - writer.uint32(/* id 12, wireType 0 =*/96).bool(message.permissiveSsh); - if (message.runAsNonRoot != null && Object.hasOwnProperty.call(message, "runAsNonRoot")) - writer.uint32(/* id 14, wireType 0 =*/112).bool(message.runAsNonRoot); - if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) - $root.google.cloud.batch.v1alpha.ServiceAccount.encode(message.serviceAccount, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TaskGroup message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskGroup.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @static - * @param {google.cloud.batch.v1alpha.ITaskGroup} message TaskGroup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskGroup.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TaskGroup message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.TaskGroup} TaskGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskGroup.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.TaskGroup(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.taskSpec = $root.google.cloud.batch.v1alpha.TaskSpec.decode(reader, reader.uint32()); - break; - } - case 4: { - message.taskCount = reader.int64(); - break; - } - case 5: { - message.parallelism = reader.int64(); - break; - } - case 6: { - message.schedulingPolicy = reader.int32(); - break; - } - case 7: { - message.allocationPolicy = $root.google.cloud.batch.v1alpha.AllocationPolicy.decode(reader, reader.uint32()); - break; - } - case 8: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 9: { - if (!(message.taskEnvironments && message.taskEnvironments.length)) - message.taskEnvironments = []; - message.taskEnvironments.push($root.google.cloud.batch.v1alpha.Environment.decode(reader, reader.uint32())); - break; - } - case 10: { - message.taskCountPerNode = reader.int64(); - break; - } - case 11: { - message.requireHostsFile = reader.bool(); - break; - } - case 12: { - message.permissiveSsh = reader.bool(); - break; - } - case 14: { - message.runAsNonRoot = reader.bool(); - break; - } - case 15: { - message.serviceAccount = $root.google.cloud.batch.v1alpha.ServiceAccount.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TaskGroup message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.TaskGroup} TaskGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskGroup.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TaskGroup message. - * @function verify - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TaskGroup.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.taskSpec != null && message.hasOwnProperty("taskSpec")) { - var error = $root.google.cloud.batch.v1alpha.TaskSpec.verify(message.taskSpec); - if (error) - return "taskSpec." + error; - } - if (message.taskCount != null && message.hasOwnProperty("taskCount")) - if (!$util.isInteger(message.taskCount) && !(message.taskCount && $util.isInteger(message.taskCount.low) && $util.isInteger(message.taskCount.high))) - return "taskCount: integer|Long expected"; - if (message.parallelism != null && message.hasOwnProperty("parallelism")) - if (!$util.isInteger(message.parallelism) && !(message.parallelism && $util.isInteger(message.parallelism.low) && $util.isInteger(message.parallelism.high))) - return "parallelism: integer|Long expected"; - if (message.schedulingPolicy != null && message.hasOwnProperty("schedulingPolicy")) - switch (message.schedulingPolicy) { - default: - return "schedulingPolicy: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.allocationPolicy != null && message.hasOwnProperty("allocationPolicy")) { - var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.verify(message.allocationPolicy); - if (error) - return "allocationPolicy." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.taskEnvironments != null && message.hasOwnProperty("taskEnvironments")) { - if (!Array.isArray(message.taskEnvironments)) - return "taskEnvironments: array expected"; - for (var i = 0; i < message.taskEnvironments.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.Environment.verify(message.taskEnvironments[i]); - if (error) - return "taskEnvironments." + error; - } - } - if (message.taskCountPerNode != null && message.hasOwnProperty("taskCountPerNode")) - if (!$util.isInteger(message.taskCountPerNode) && !(message.taskCountPerNode && $util.isInteger(message.taskCountPerNode.low) && $util.isInteger(message.taskCountPerNode.high))) - return "taskCountPerNode: integer|Long expected"; - if (message.requireHostsFile != null && message.hasOwnProperty("requireHostsFile")) - if (typeof message.requireHostsFile !== "boolean") - return "requireHostsFile: boolean expected"; - if (message.permissiveSsh != null && message.hasOwnProperty("permissiveSsh")) - if (typeof message.permissiveSsh !== "boolean") - return "permissiveSsh: boolean expected"; - if (message.runAsNonRoot != null && message.hasOwnProperty("runAsNonRoot")) - if (typeof message.runAsNonRoot !== "boolean") - return "runAsNonRoot: boolean expected"; - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) { - var error = $root.google.cloud.batch.v1alpha.ServiceAccount.verify(message.serviceAccount); - if (error) - return "serviceAccount." + error; - } - return null; - }; - - /** - * Creates a TaskGroup message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.TaskGroup} TaskGroup - */ - TaskGroup.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.TaskGroup) - return object; - var message = new $root.google.cloud.batch.v1alpha.TaskGroup(); - if (object.name != null) - message.name = String(object.name); - if (object.taskSpec != null) { - if (typeof object.taskSpec !== "object") - throw TypeError(".google.cloud.batch.v1alpha.TaskGroup.taskSpec: object expected"); - message.taskSpec = $root.google.cloud.batch.v1alpha.TaskSpec.fromObject(object.taskSpec); - } - if (object.taskCount != null) - if ($util.Long) - (message.taskCount = $util.Long.fromValue(object.taskCount)).unsigned = false; - else if (typeof object.taskCount === "string") - message.taskCount = parseInt(object.taskCount, 10); - else if (typeof object.taskCount === "number") - message.taskCount = object.taskCount; - else if (typeof object.taskCount === "object") - message.taskCount = new $util.LongBits(object.taskCount.low >>> 0, object.taskCount.high >>> 0).toNumber(); - if (object.parallelism != null) - if ($util.Long) - (message.parallelism = $util.Long.fromValue(object.parallelism)).unsigned = false; - else if (typeof object.parallelism === "string") - message.parallelism = parseInt(object.parallelism, 10); - else if (typeof object.parallelism === "number") - message.parallelism = object.parallelism; - else if (typeof object.parallelism === "object") - message.parallelism = new $util.LongBits(object.parallelism.low >>> 0, object.parallelism.high >>> 0).toNumber(); - switch (object.schedulingPolicy) { - default: - if (typeof object.schedulingPolicy === "number") { - message.schedulingPolicy = object.schedulingPolicy; - break; - } - break; - case "SCHEDULING_POLICY_UNSPECIFIED": - case 0: - message.schedulingPolicy = 0; - break; - case "AS_SOON_AS_POSSIBLE": - case 1: - message.schedulingPolicy = 1; - break; - case "IN_ORDER": - case 2: - message.schedulingPolicy = 2; - break; - } - if (object.allocationPolicy != null) { - if (typeof object.allocationPolicy !== "object") - throw TypeError(".google.cloud.batch.v1alpha.TaskGroup.allocationPolicy: object expected"); - message.allocationPolicy = $root.google.cloud.batch.v1alpha.AllocationPolicy.fromObject(object.allocationPolicy); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.batch.v1alpha.TaskGroup.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - if (object.taskEnvironments) { - if (!Array.isArray(object.taskEnvironments)) - throw TypeError(".google.cloud.batch.v1alpha.TaskGroup.taskEnvironments: array expected"); - message.taskEnvironments = []; - for (var i = 0; i < object.taskEnvironments.length; ++i) { - if (typeof object.taskEnvironments[i] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.TaskGroup.taskEnvironments: object expected"); - message.taskEnvironments[i] = $root.google.cloud.batch.v1alpha.Environment.fromObject(object.taskEnvironments[i]); - } - } - if (object.taskCountPerNode != null) - if ($util.Long) - (message.taskCountPerNode = $util.Long.fromValue(object.taskCountPerNode)).unsigned = false; - else if (typeof object.taskCountPerNode === "string") - message.taskCountPerNode = parseInt(object.taskCountPerNode, 10); - else if (typeof object.taskCountPerNode === "number") - message.taskCountPerNode = object.taskCountPerNode; - else if (typeof object.taskCountPerNode === "object") - message.taskCountPerNode = new $util.LongBits(object.taskCountPerNode.low >>> 0, object.taskCountPerNode.high >>> 0).toNumber(); - if (object.requireHostsFile != null) - message.requireHostsFile = Boolean(object.requireHostsFile); - if (object.permissiveSsh != null) - message.permissiveSsh = Boolean(object.permissiveSsh); - if (object.runAsNonRoot != null) - message.runAsNonRoot = Boolean(object.runAsNonRoot); - if (object.serviceAccount != null) { - if (typeof object.serviceAccount !== "object") - throw TypeError(".google.cloud.batch.v1alpha.TaskGroup.serviceAccount: object expected"); - message.serviceAccount = $root.google.cloud.batch.v1alpha.ServiceAccount.fromObject(object.serviceAccount); - } - return message; - }; - - /** - * Creates a plain object from a TaskGroup message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @static - * @param {google.cloud.batch.v1alpha.TaskGroup} message TaskGroup - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TaskGroup.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.taskEnvironments = []; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.taskSpec = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.taskCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.taskCount = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.parallelism = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.parallelism = options.longs === String ? "0" : 0; - object.schedulingPolicy = options.enums === String ? "SCHEDULING_POLICY_UNSPECIFIED" : 0; - object.allocationPolicy = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.taskCountPerNode = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.taskCountPerNode = options.longs === String ? "0" : 0; - object.requireHostsFile = false; - object.permissiveSsh = false; - object.runAsNonRoot = false; - object.serviceAccount = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.taskSpec != null && message.hasOwnProperty("taskSpec")) - object.taskSpec = $root.google.cloud.batch.v1alpha.TaskSpec.toObject(message.taskSpec, options); - if (message.taskCount != null && message.hasOwnProperty("taskCount")) - if (typeof message.taskCount === "number") - object.taskCount = options.longs === String ? String(message.taskCount) : message.taskCount; - else - object.taskCount = options.longs === String ? $util.Long.prototype.toString.call(message.taskCount) : options.longs === Number ? new $util.LongBits(message.taskCount.low >>> 0, message.taskCount.high >>> 0).toNumber() : message.taskCount; - if (message.parallelism != null && message.hasOwnProperty("parallelism")) - if (typeof message.parallelism === "number") - object.parallelism = options.longs === String ? String(message.parallelism) : message.parallelism; - else - object.parallelism = options.longs === String ? $util.Long.prototype.toString.call(message.parallelism) : options.longs === Number ? new $util.LongBits(message.parallelism.low >>> 0, message.parallelism.high >>> 0).toNumber() : message.parallelism; - if (message.schedulingPolicy != null && message.hasOwnProperty("schedulingPolicy")) - object.schedulingPolicy = options.enums === String ? $root.google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy[message.schedulingPolicy] === undefined ? message.schedulingPolicy : $root.google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy[message.schedulingPolicy] : message.schedulingPolicy; - if (message.allocationPolicy != null && message.hasOwnProperty("allocationPolicy")) - object.allocationPolicy = $root.google.cloud.batch.v1alpha.AllocationPolicy.toObject(message.allocationPolicy, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.taskEnvironments && message.taskEnvironments.length) { - object.taskEnvironments = []; - for (var j = 0; j < message.taskEnvironments.length; ++j) - object.taskEnvironments[j] = $root.google.cloud.batch.v1alpha.Environment.toObject(message.taskEnvironments[j], options); - } - if (message.taskCountPerNode != null && message.hasOwnProperty("taskCountPerNode")) - if (typeof message.taskCountPerNode === "number") - object.taskCountPerNode = options.longs === String ? String(message.taskCountPerNode) : message.taskCountPerNode; - else - object.taskCountPerNode = options.longs === String ? $util.Long.prototype.toString.call(message.taskCountPerNode) : options.longs === Number ? new $util.LongBits(message.taskCountPerNode.low >>> 0, message.taskCountPerNode.high >>> 0).toNumber() : message.taskCountPerNode; - if (message.requireHostsFile != null && message.hasOwnProperty("requireHostsFile")) - object.requireHostsFile = message.requireHostsFile; - if (message.permissiveSsh != null && message.hasOwnProperty("permissiveSsh")) - object.permissiveSsh = message.permissiveSsh; - if (message.runAsNonRoot != null && message.hasOwnProperty("runAsNonRoot")) - object.runAsNonRoot = message.runAsNonRoot; - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - object.serviceAccount = $root.google.cloud.batch.v1alpha.ServiceAccount.toObject(message.serviceAccount, options); - return object; - }; - - /** - * Converts this TaskGroup to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @instance - * @returns {Object.} JSON object - */ - TaskGroup.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TaskGroup - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TaskGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.TaskGroup"; - }; - - /** - * SchedulingPolicy enum. - * @name google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy - * @enum {number} - * @property {number} SCHEDULING_POLICY_UNSPECIFIED=0 SCHEDULING_POLICY_UNSPECIFIED value - * @property {number} AS_SOON_AS_POSSIBLE=1 AS_SOON_AS_POSSIBLE value - * @property {number} IN_ORDER=2 IN_ORDER value - */ - TaskGroup.SchedulingPolicy = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SCHEDULING_POLICY_UNSPECIFIED"] = 0; - values[valuesById[1] = "AS_SOON_AS_POSSIBLE"] = 1; - values[valuesById[2] = "IN_ORDER"] = 2; - return values; - })(); - - return TaskGroup; - })(); - - v1alpha.ServiceAccount = (function() { - - /** - * Properties of a ServiceAccount. - * @memberof google.cloud.batch.v1alpha - * @interface IServiceAccount - * @property {string|null} [email] ServiceAccount email - * @property {Array.|null} [scopes] ServiceAccount scopes - */ - - /** - * Constructs a new ServiceAccount. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a ServiceAccount. - * @implements IServiceAccount - * @constructor - * @param {google.cloud.batch.v1alpha.IServiceAccount=} [properties] Properties to set - */ - function ServiceAccount(properties) { - this.scopes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceAccount email. - * @member {string} email - * @memberof google.cloud.batch.v1alpha.ServiceAccount - * @instance - */ - ServiceAccount.prototype.email = ""; - - /** - * ServiceAccount scopes. - * @member {Array.} scopes - * @memberof google.cloud.batch.v1alpha.ServiceAccount - * @instance - */ - ServiceAccount.prototype.scopes = $util.emptyArray; - - /** - * Creates a new ServiceAccount instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.ServiceAccount - * @static - * @param {google.cloud.batch.v1alpha.IServiceAccount=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.ServiceAccount} ServiceAccount instance - */ - ServiceAccount.create = function create(properties) { - return new ServiceAccount(properties); - }; - - /** - * Encodes the specified ServiceAccount message. Does not implicitly {@link google.cloud.batch.v1alpha.ServiceAccount.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.ServiceAccount - * @static - * @param {google.cloud.batch.v1alpha.IServiceAccount} message ServiceAccount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceAccount.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.email != null && Object.hasOwnProperty.call(message, "email")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.email); - if (message.scopes != null && message.scopes.length) - for (var i = 0; i < message.scopes.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.scopes[i]); - return writer; - }; - - /** - * Encodes the specified ServiceAccount message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ServiceAccount.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.ServiceAccount - * @static - * @param {google.cloud.batch.v1alpha.IServiceAccount} message ServiceAccount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceAccount.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceAccount message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.ServiceAccount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.ServiceAccount} ServiceAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceAccount.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ServiceAccount(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.email = reader.string(); - break; - } - case 2: { - if (!(message.scopes && message.scopes.length)) - message.scopes = []; - message.scopes.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceAccount message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.ServiceAccount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.ServiceAccount} ServiceAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceAccount.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceAccount message. - * @function verify - * @memberof google.cloud.batch.v1alpha.ServiceAccount - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceAccount.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.email != null && message.hasOwnProperty("email")) - if (!$util.isString(message.email)) - return "email: string expected"; - if (message.scopes != null && message.hasOwnProperty("scopes")) { - if (!Array.isArray(message.scopes)) - return "scopes: array expected"; - for (var i = 0; i < message.scopes.length; ++i) - if (!$util.isString(message.scopes[i])) - return "scopes: string[] expected"; - } - return null; - }; - - /** - * Creates a ServiceAccount message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.ServiceAccount - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.ServiceAccount} ServiceAccount - */ - ServiceAccount.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.ServiceAccount) - return object; - var message = new $root.google.cloud.batch.v1alpha.ServiceAccount(); - if (object.email != null) - message.email = String(object.email); - if (object.scopes) { - if (!Array.isArray(object.scopes)) - throw TypeError(".google.cloud.batch.v1alpha.ServiceAccount.scopes: array expected"); - message.scopes = []; - for (var i = 0; i < object.scopes.length; ++i) - message.scopes[i] = String(object.scopes[i]); - } - return message; - }; - - /** - * Creates a plain object from a ServiceAccount message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.ServiceAccount - * @static - * @param {google.cloud.batch.v1alpha.ServiceAccount} message ServiceAccount - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceAccount.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.scopes = []; - if (options.defaults) - object.email = ""; - if (message.email != null && message.hasOwnProperty("email")) - object.email = message.email; - if (message.scopes && message.scopes.length) { - object.scopes = []; - for (var j = 0; j < message.scopes.length; ++j) - object.scopes[j] = message.scopes[j]; - } - return object; - }; - - /** - * Converts this ServiceAccount to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.ServiceAccount - * @instance - * @returns {Object.} JSON object - */ - ServiceAccount.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceAccount - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.ServiceAccount - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceAccount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.ServiceAccount"; - }; - - return ServiceAccount; - })(); - - v1alpha.ComputeResource = (function() { - - /** - * Properties of a ComputeResource. - * @memberof google.cloud.batch.v1alpha - * @interface IComputeResource - * @property {number|Long|null} [cpuMilli] ComputeResource cpuMilli - * @property {number|Long|null} [memoryMib] ComputeResource memoryMib - * @property {number|Long|null} [gpuCount] ComputeResource gpuCount - * @property {number|Long|null} [bootDiskMib] ComputeResource bootDiskMib - */ - - /** - * Constructs a new ComputeResource. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a ComputeResource. - * @implements IComputeResource - * @constructor - * @param {google.cloud.batch.v1alpha.IComputeResource=} [properties] Properties to set - */ - function ComputeResource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ComputeResource cpuMilli. - * @member {number|Long} cpuMilli - * @memberof google.cloud.batch.v1alpha.ComputeResource - * @instance - */ - ComputeResource.prototype.cpuMilli = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ComputeResource memoryMib. - * @member {number|Long} memoryMib - * @memberof google.cloud.batch.v1alpha.ComputeResource - * @instance - */ - ComputeResource.prototype.memoryMib = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ComputeResource gpuCount. - * @member {number|Long} gpuCount - * @memberof google.cloud.batch.v1alpha.ComputeResource - * @instance - */ - ComputeResource.prototype.gpuCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ComputeResource bootDiskMib. - * @member {number|Long} bootDiskMib - * @memberof google.cloud.batch.v1alpha.ComputeResource - * @instance - */ - ComputeResource.prototype.bootDiskMib = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new ComputeResource instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.ComputeResource - * @static - * @param {google.cloud.batch.v1alpha.IComputeResource=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.ComputeResource} ComputeResource instance - */ - ComputeResource.create = function create(properties) { - return new ComputeResource(properties); - }; - - /** - * Encodes the specified ComputeResource message. Does not implicitly {@link google.cloud.batch.v1alpha.ComputeResource.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.ComputeResource - * @static - * @param {google.cloud.batch.v1alpha.IComputeResource} message ComputeResource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ComputeResource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cpuMilli != null && Object.hasOwnProperty.call(message, "cpuMilli")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.cpuMilli); - if (message.memoryMib != null && Object.hasOwnProperty.call(message, "memoryMib")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.memoryMib); - if (message.gpuCount != null && Object.hasOwnProperty.call(message, "gpuCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.gpuCount); - if (message.bootDiskMib != null && Object.hasOwnProperty.call(message, "bootDiskMib")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.bootDiskMib); - return writer; - }; - - /** - * Encodes the specified ComputeResource message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ComputeResource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.ComputeResource - * @static - * @param {google.cloud.batch.v1alpha.IComputeResource} message ComputeResource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ComputeResource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ComputeResource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.ComputeResource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.ComputeResource} ComputeResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ComputeResource.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ComputeResource(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.cpuMilli = reader.int64(); - break; - } - case 2: { - message.memoryMib = reader.int64(); - break; - } - case 3: { - message.gpuCount = reader.int64(); - break; - } - case 4: { - message.bootDiskMib = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ComputeResource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.ComputeResource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.ComputeResource} ComputeResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ComputeResource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ComputeResource message. - * @function verify - * @memberof google.cloud.batch.v1alpha.ComputeResource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ComputeResource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.cpuMilli != null && message.hasOwnProperty("cpuMilli")) - if (!$util.isInteger(message.cpuMilli) && !(message.cpuMilli && $util.isInteger(message.cpuMilli.low) && $util.isInteger(message.cpuMilli.high))) - return "cpuMilli: integer|Long expected"; - if (message.memoryMib != null && message.hasOwnProperty("memoryMib")) - if (!$util.isInteger(message.memoryMib) && !(message.memoryMib && $util.isInteger(message.memoryMib.low) && $util.isInteger(message.memoryMib.high))) - return "memoryMib: integer|Long expected"; - if (message.gpuCount != null && message.hasOwnProperty("gpuCount")) - if (!$util.isInteger(message.gpuCount) && !(message.gpuCount && $util.isInteger(message.gpuCount.low) && $util.isInteger(message.gpuCount.high))) - return "gpuCount: integer|Long expected"; - if (message.bootDiskMib != null && message.hasOwnProperty("bootDiskMib")) - if (!$util.isInteger(message.bootDiskMib) && !(message.bootDiskMib && $util.isInteger(message.bootDiskMib.low) && $util.isInteger(message.bootDiskMib.high))) - return "bootDiskMib: integer|Long expected"; - return null; - }; - - /** - * Creates a ComputeResource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.ComputeResource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.ComputeResource} ComputeResource - */ - ComputeResource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.ComputeResource) - return object; - var message = new $root.google.cloud.batch.v1alpha.ComputeResource(); - if (object.cpuMilli != null) - if ($util.Long) - (message.cpuMilli = $util.Long.fromValue(object.cpuMilli)).unsigned = false; - else if (typeof object.cpuMilli === "string") - message.cpuMilli = parseInt(object.cpuMilli, 10); - else if (typeof object.cpuMilli === "number") - message.cpuMilli = object.cpuMilli; - else if (typeof object.cpuMilli === "object") - message.cpuMilli = new $util.LongBits(object.cpuMilli.low >>> 0, object.cpuMilli.high >>> 0).toNumber(); - if (object.memoryMib != null) - if ($util.Long) - (message.memoryMib = $util.Long.fromValue(object.memoryMib)).unsigned = false; - else if (typeof object.memoryMib === "string") - message.memoryMib = parseInt(object.memoryMib, 10); - else if (typeof object.memoryMib === "number") - message.memoryMib = object.memoryMib; - else if (typeof object.memoryMib === "object") - message.memoryMib = new $util.LongBits(object.memoryMib.low >>> 0, object.memoryMib.high >>> 0).toNumber(); - if (object.gpuCount != null) - if ($util.Long) - (message.gpuCount = $util.Long.fromValue(object.gpuCount)).unsigned = false; - else if (typeof object.gpuCount === "string") - message.gpuCount = parseInt(object.gpuCount, 10); - else if (typeof object.gpuCount === "number") - message.gpuCount = object.gpuCount; - else if (typeof object.gpuCount === "object") - message.gpuCount = new $util.LongBits(object.gpuCount.low >>> 0, object.gpuCount.high >>> 0).toNumber(); - if (object.bootDiskMib != null) - if ($util.Long) - (message.bootDiskMib = $util.Long.fromValue(object.bootDiskMib)).unsigned = false; - else if (typeof object.bootDiskMib === "string") - message.bootDiskMib = parseInt(object.bootDiskMib, 10); - else if (typeof object.bootDiskMib === "number") - message.bootDiskMib = object.bootDiskMib; - else if (typeof object.bootDiskMib === "object") - message.bootDiskMib = new $util.LongBits(object.bootDiskMib.low >>> 0, object.bootDiskMib.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a ComputeResource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.ComputeResource - * @static - * @param {google.cloud.batch.v1alpha.ComputeResource} message ComputeResource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ComputeResource.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.cpuMilli = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.cpuMilli = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.memoryMib = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.memoryMib = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.gpuCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.gpuCount = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.bootDiskMib = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.bootDiskMib = options.longs === String ? "0" : 0; - } - if (message.cpuMilli != null && message.hasOwnProperty("cpuMilli")) - if (typeof message.cpuMilli === "number") - object.cpuMilli = options.longs === String ? String(message.cpuMilli) : message.cpuMilli; - else - object.cpuMilli = options.longs === String ? $util.Long.prototype.toString.call(message.cpuMilli) : options.longs === Number ? new $util.LongBits(message.cpuMilli.low >>> 0, message.cpuMilli.high >>> 0).toNumber() : message.cpuMilli; - if (message.memoryMib != null && message.hasOwnProperty("memoryMib")) - if (typeof message.memoryMib === "number") - object.memoryMib = options.longs === String ? String(message.memoryMib) : message.memoryMib; - else - object.memoryMib = options.longs === String ? $util.Long.prototype.toString.call(message.memoryMib) : options.longs === Number ? new $util.LongBits(message.memoryMib.low >>> 0, message.memoryMib.high >>> 0).toNumber() : message.memoryMib; - if (message.gpuCount != null && message.hasOwnProperty("gpuCount")) - if (typeof message.gpuCount === "number") - object.gpuCount = options.longs === String ? String(message.gpuCount) : message.gpuCount; - else - object.gpuCount = options.longs === String ? $util.Long.prototype.toString.call(message.gpuCount) : options.longs === Number ? new $util.LongBits(message.gpuCount.low >>> 0, message.gpuCount.high >>> 0).toNumber() : message.gpuCount; - if (message.bootDiskMib != null && message.hasOwnProperty("bootDiskMib")) - if (typeof message.bootDiskMib === "number") - object.bootDiskMib = options.longs === String ? String(message.bootDiskMib) : message.bootDiskMib; - else - object.bootDiskMib = options.longs === String ? $util.Long.prototype.toString.call(message.bootDiskMib) : options.longs === Number ? new $util.LongBits(message.bootDiskMib.low >>> 0, message.bootDiskMib.high >>> 0).toNumber() : message.bootDiskMib; - return object; - }; - - /** - * Converts this ComputeResource to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.ComputeResource - * @instance - * @returns {Object.} JSON object - */ - ComputeResource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ComputeResource - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.ComputeResource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ComputeResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.ComputeResource"; - }; - - return ComputeResource; - })(); - - v1alpha.StatusEvent = (function() { - - /** - * Properties of a StatusEvent. - * @memberof google.cloud.batch.v1alpha - * @interface IStatusEvent - * @property {string|null} [type] StatusEvent type - * @property {string|null} [description] StatusEvent description - * @property {google.protobuf.ITimestamp|null} [eventTime] StatusEvent eventTime - * @property {google.cloud.batch.v1alpha.ITaskExecution|null} [taskExecution] StatusEvent taskExecution - * @property {google.cloud.batch.v1alpha.TaskStatus.State|null} [taskState] StatusEvent taskState - */ - - /** - * Constructs a new StatusEvent. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a StatusEvent. - * @implements IStatusEvent - * @constructor - * @param {google.cloud.batch.v1alpha.IStatusEvent=} [properties] Properties to set - */ - function StatusEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StatusEvent type. - * @member {string} type - * @memberof google.cloud.batch.v1alpha.StatusEvent - * @instance - */ - StatusEvent.prototype.type = ""; - - /** - * StatusEvent description. - * @member {string} description - * @memberof google.cloud.batch.v1alpha.StatusEvent - * @instance - */ - StatusEvent.prototype.description = ""; - - /** - * StatusEvent eventTime. - * @member {google.protobuf.ITimestamp|null|undefined} eventTime - * @memberof google.cloud.batch.v1alpha.StatusEvent - * @instance - */ - StatusEvent.prototype.eventTime = null; - - /** - * StatusEvent taskExecution. - * @member {google.cloud.batch.v1alpha.ITaskExecution|null|undefined} taskExecution - * @memberof google.cloud.batch.v1alpha.StatusEvent - * @instance - */ - StatusEvent.prototype.taskExecution = null; - - /** - * StatusEvent taskState. - * @member {google.cloud.batch.v1alpha.TaskStatus.State} taskState - * @memberof google.cloud.batch.v1alpha.StatusEvent - * @instance - */ - StatusEvent.prototype.taskState = 0; - - /** - * Creates a new StatusEvent instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.StatusEvent - * @static - * @param {google.cloud.batch.v1alpha.IStatusEvent=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.StatusEvent} StatusEvent instance - */ - StatusEvent.create = function create(properties) { - return new StatusEvent(properties); - }; - - /** - * Encodes the specified StatusEvent message. Does not implicitly {@link google.cloud.batch.v1alpha.StatusEvent.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.StatusEvent - * @static - * @param {google.cloud.batch.v1alpha.IStatusEvent} message StatusEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StatusEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); - if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) - $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); - if (message.taskExecution != null && Object.hasOwnProperty.call(message, "taskExecution")) - $root.google.cloud.batch.v1alpha.TaskExecution.encode(message.taskExecution, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.taskState != null && Object.hasOwnProperty.call(message, "taskState")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.taskState); - return writer; - }; - - /** - * Encodes the specified StatusEvent message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.StatusEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.StatusEvent - * @static - * @param {google.cloud.batch.v1alpha.IStatusEvent} message StatusEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StatusEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StatusEvent message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.StatusEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.StatusEvent} StatusEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StatusEvent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.StatusEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 3: { - message.type = reader.string(); - break; - } - case 1: { - message.description = reader.string(); - break; - } - case 2: { - message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.taskExecution = $root.google.cloud.batch.v1alpha.TaskExecution.decode(reader, reader.uint32()); - break; - } - case 5: { - message.taskState = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StatusEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.StatusEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.StatusEvent} StatusEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StatusEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StatusEvent message. - * @function verify - * @memberof google.cloud.batch.v1alpha.StatusEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StatusEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.eventTime != null && message.hasOwnProperty("eventTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.eventTime); - if (error) - return "eventTime." + error; - } - if (message.taskExecution != null && message.hasOwnProperty("taskExecution")) { - var error = $root.google.cloud.batch.v1alpha.TaskExecution.verify(message.taskExecution); - if (error) - return "taskExecution." + error; - } - if (message.taskState != null && message.hasOwnProperty("taskState")) - switch (message.taskState) { - default: - return "taskState: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - return null; - }; - - /** - * Creates a StatusEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.StatusEvent - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.StatusEvent} StatusEvent - */ - StatusEvent.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.StatusEvent) - return object; - var message = new $root.google.cloud.batch.v1alpha.StatusEvent(); - if (object.type != null) - message.type = String(object.type); - if (object.description != null) - message.description = String(object.description); - if (object.eventTime != null) { - if (typeof object.eventTime !== "object") - throw TypeError(".google.cloud.batch.v1alpha.StatusEvent.eventTime: object expected"); - message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); - } - if (object.taskExecution != null) { - if (typeof object.taskExecution !== "object") - throw TypeError(".google.cloud.batch.v1alpha.StatusEvent.taskExecution: object expected"); - message.taskExecution = $root.google.cloud.batch.v1alpha.TaskExecution.fromObject(object.taskExecution); - } - switch (object.taskState) { - default: - if (typeof object.taskState === "number") { - message.taskState = object.taskState; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.taskState = 0; - break; - case "PENDING": - case 1: - message.taskState = 1; - break; - case "ASSIGNED": - case 2: - message.taskState = 2; - break; - case "RUNNING": - case 3: - message.taskState = 3; - break; - case "FAILED": - case 4: - message.taskState = 4; - break; - case "SUCCEEDED": - case 5: - message.taskState = 5; - break; - case "UNEXECUTED": - case 6: - message.taskState = 6; - break; - } - return message; - }; - - /** - * Creates a plain object from a StatusEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.StatusEvent - * @static - * @param {google.cloud.batch.v1alpha.StatusEvent} message StatusEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StatusEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.description = ""; - object.eventTime = null; - object.type = ""; - object.taskExecution = null; - object.taskState = options.enums === String ? "STATE_UNSPECIFIED" : 0; - } - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.eventTime != null && message.hasOwnProperty("eventTime")) - object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.taskExecution != null && message.hasOwnProperty("taskExecution")) - object.taskExecution = $root.google.cloud.batch.v1alpha.TaskExecution.toObject(message.taskExecution, options); - if (message.taskState != null && message.hasOwnProperty("taskState")) - object.taskState = options.enums === String ? $root.google.cloud.batch.v1alpha.TaskStatus.State[message.taskState] === undefined ? message.taskState : $root.google.cloud.batch.v1alpha.TaskStatus.State[message.taskState] : message.taskState; - return object; - }; - - /** - * Converts this StatusEvent to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.StatusEvent - * @instance - * @returns {Object.} JSON object - */ - StatusEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StatusEvent - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.StatusEvent - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StatusEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.StatusEvent"; - }; - - return StatusEvent; - })(); - - v1alpha.TaskExecution = (function() { - - /** - * Properties of a TaskExecution. - * @memberof google.cloud.batch.v1alpha - * @interface ITaskExecution - * @property {number|null} [exitCode] TaskExecution exitCode - * @property {string|null} [stderrSnippet] TaskExecution stderrSnippet - */ - - /** - * Constructs a new TaskExecution. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a TaskExecution. - * @implements ITaskExecution - * @constructor - * @param {google.cloud.batch.v1alpha.ITaskExecution=} [properties] Properties to set - */ - function TaskExecution(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TaskExecution exitCode. - * @member {number} exitCode - * @memberof google.cloud.batch.v1alpha.TaskExecution - * @instance - */ - TaskExecution.prototype.exitCode = 0; - - /** - * TaskExecution stderrSnippet. - * @member {string} stderrSnippet - * @memberof google.cloud.batch.v1alpha.TaskExecution - * @instance - */ - TaskExecution.prototype.stderrSnippet = ""; - - /** - * Creates a new TaskExecution instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.TaskExecution - * @static - * @param {google.cloud.batch.v1alpha.ITaskExecution=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.TaskExecution} TaskExecution instance - */ - TaskExecution.create = function create(properties) { - return new TaskExecution(properties); - }; - - /** - * Encodes the specified TaskExecution message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskExecution.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.TaskExecution - * @static - * @param {google.cloud.batch.v1alpha.ITaskExecution} message TaskExecution message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskExecution.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.exitCode != null && Object.hasOwnProperty.call(message, "exitCode")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.exitCode); - if (message.stderrSnippet != null && Object.hasOwnProperty.call(message, "stderrSnippet")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.stderrSnippet); - return writer; - }; - - /** - * Encodes the specified TaskExecution message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskExecution.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.TaskExecution - * @static - * @param {google.cloud.batch.v1alpha.ITaskExecution} message TaskExecution message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskExecution.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TaskExecution message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.TaskExecution - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.TaskExecution} TaskExecution - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskExecution.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.TaskExecution(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.exitCode = reader.int32(); - break; - } - case 2: { - message.stderrSnippet = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TaskExecution message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.TaskExecution - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.TaskExecution} TaskExecution - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskExecution.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TaskExecution message. - * @function verify - * @memberof google.cloud.batch.v1alpha.TaskExecution - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TaskExecution.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.exitCode != null && message.hasOwnProperty("exitCode")) - if (!$util.isInteger(message.exitCode)) - return "exitCode: integer expected"; - if (message.stderrSnippet != null && message.hasOwnProperty("stderrSnippet")) - if (!$util.isString(message.stderrSnippet)) - return "stderrSnippet: string expected"; - return null; - }; - - /** - * Creates a TaskExecution message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.TaskExecution - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.TaskExecution} TaskExecution - */ - TaskExecution.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.TaskExecution) - return object; - var message = new $root.google.cloud.batch.v1alpha.TaskExecution(); - if (object.exitCode != null) - message.exitCode = object.exitCode | 0; - if (object.stderrSnippet != null) - message.stderrSnippet = String(object.stderrSnippet); - return message; - }; - - /** - * Creates a plain object from a TaskExecution message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.TaskExecution - * @static - * @param {google.cloud.batch.v1alpha.TaskExecution} message TaskExecution - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TaskExecution.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.exitCode = 0; - object.stderrSnippet = ""; - } - if (message.exitCode != null && message.hasOwnProperty("exitCode")) - object.exitCode = message.exitCode; - if (message.stderrSnippet != null && message.hasOwnProperty("stderrSnippet")) - object.stderrSnippet = message.stderrSnippet; - return object; - }; - - /** - * Converts this TaskExecution to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.TaskExecution - * @instance - * @returns {Object.} JSON object - */ - TaskExecution.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TaskExecution - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.TaskExecution - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TaskExecution.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.TaskExecution"; - }; - - return TaskExecution; - })(); - - v1alpha.TaskStatus = (function() { - - /** - * Properties of a TaskStatus. - * @memberof google.cloud.batch.v1alpha - * @interface ITaskStatus - * @property {google.cloud.batch.v1alpha.TaskStatus.State|null} [state] TaskStatus state - * @property {Array.|null} [statusEvents] TaskStatus statusEvents - * @property {google.cloud.batch.v1alpha.ITaskResourceUsage|null} [resourceUsage] TaskStatus resourceUsage - */ - - /** - * Constructs a new TaskStatus. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a TaskStatus. - * @implements ITaskStatus - * @constructor - * @param {google.cloud.batch.v1alpha.ITaskStatus=} [properties] Properties to set - */ - function TaskStatus(properties) { - this.statusEvents = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TaskStatus state. - * @member {google.cloud.batch.v1alpha.TaskStatus.State} state - * @memberof google.cloud.batch.v1alpha.TaskStatus - * @instance - */ - TaskStatus.prototype.state = 0; - - /** - * TaskStatus statusEvents. - * @member {Array.} statusEvents - * @memberof google.cloud.batch.v1alpha.TaskStatus - * @instance - */ - TaskStatus.prototype.statusEvents = $util.emptyArray; - - /** - * TaskStatus resourceUsage. - * @member {google.cloud.batch.v1alpha.ITaskResourceUsage|null|undefined} resourceUsage - * @memberof google.cloud.batch.v1alpha.TaskStatus - * @instance - */ - TaskStatus.prototype.resourceUsage = null; - - /** - * Creates a new TaskStatus instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.TaskStatus - * @static - * @param {google.cloud.batch.v1alpha.ITaskStatus=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.TaskStatus} TaskStatus instance - */ - TaskStatus.create = function create(properties) { - return new TaskStatus(properties); - }; - - /** - * Encodes the specified TaskStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.TaskStatus - * @static - * @param {google.cloud.batch.v1alpha.ITaskStatus} message TaskStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskStatus.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); - if (message.statusEvents != null && message.statusEvents.length) - for (var i = 0; i < message.statusEvents.length; ++i) - $root.google.cloud.batch.v1alpha.StatusEvent.encode(message.statusEvents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.resourceUsage != null && Object.hasOwnProperty.call(message, "resourceUsage")) - $root.google.cloud.batch.v1alpha.TaskResourceUsage.encode(message.resourceUsage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TaskStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.TaskStatus - * @static - * @param {google.cloud.batch.v1alpha.ITaskStatus} message TaskStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TaskStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.TaskStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.TaskStatus} TaskStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskStatus.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.TaskStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.state = reader.int32(); - break; - } - case 2: { - if (!(message.statusEvents && message.statusEvents.length)) - message.statusEvents = []; - message.statusEvents.push($root.google.cloud.batch.v1alpha.StatusEvent.decode(reader, reader.uint32())); - break; - } - case 3: { - message.resourceUsage = $root.google.cloud.batch.v1alpha.TaskResourceUsage.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TaskStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.TaskStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.TaskStatus} TaskStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TaskStatus message. - * @function verify - * @memberof google.cloud.batch.v1alpha.TaskStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TaskStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.statusEvents != null && message.hasOwnProperty("statusEvents")) { - if (!Array.isArray(message.statusEvents)) - return "statusEvents: array expected"; - for (var i = 0; i < message.statusEvents.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.StatusEvent.verify(message.statusEvents[i]); - if (error) - return "statusEvents." + error; - } - } - if (message.resourceUsage != null && message.hasOwnProperty("resourceUsage")) { - var error = $root.google.cloud.batch.v1alpha.TaskResourceUsage.verify(message.resourceUsage); - if (error) - return "resourceUsage." + error; - } - return null; - }; - - /** - * Creates a TaskStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.TaskStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.TaskStatus} TaskStatus - */ - TaskStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.TaskStatus) - return object; - var message = new $root.google.cloud.batch.v1alpha.TaskStatus(); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "PENDING": - case 1: - message.state = 1; - break; - case "ASSIGNED": - case 2: - message.state = 2; - break; - case "RUNNING": - case 3: - message.state = 3; - break; - case "FAILED": - case 4: - message.state = 4; - break; - case "SUCCEEDED": - case 5: - message.state = 5; - break; - case "UNEXECUTED": - case 6: - message.state = 6; - break; - } - if (object.statusEvents) { - if (!Array.isArray(object.statusEvents)) - throw TypeError(".google.cloud.batch.v1alpha.TaskStatus.statusEvents: array expected"); - message.statusEvents = []; - for (var i = 0; i < object.statusEvents.length; ++i) { - if (typeof object.statusEvents[i] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.TaskStatus.statusEvents: object expected"); - message.statusEvents[i] = $root.google.cloud.batch.v1alpha.StatusEvent.fromObject(object.statusEvents[i]); - } - } - if (object.resourceUsage != null) { - if (typeof object.resourceUsage !== "object") - throw TypeError(".google.cloud.batch.v1alpha.TaskStatus.resourceUsage: object expected"); - message.resourceUsage = $root.google.cloud.batch.v1alpha.TaskResourceUsage.fromObject(object.resourceUsage); - } - return message; - }; - - /** - * Creates a plain object from a TaskStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.TaskStatus - * @static - * @param {google.cloud.batch.v1alpha.TaskStatus} message TaskStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TaskStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.statusEvents = []; - if (options.defaults) { - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.resourceUsage = null; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.batch.v1alpha.TaskStatus.State[message.state] === undefined ? message.state : $root.google.cloud.batch.v1alpha.TaskStatus.State[message.state] : message.state; - if (message.statusEvents && message.statusEvents.length) { - object.statusEvents = []; - for (var j = 0; j < message.statusEvents.length; ++j) - object.statusEvents[j] = $root.google.cloud.batch.v1alpha.StatusEvent.toObject(message.statusEvents[j], options); - } - if (message.resourceUsage != null && message.hasOwnProperty("resourceUsage")) - object.resourceUsage = $root.google.cloud.batch.v1alpha.TaskResourceUsage.toObject(message.resourceUsage, options); - return object; - }; - - /** - * Converts this TaskStatus to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.TaskStatus - * @instance - * @returns {Object.} JSON object - */ - TaskStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TaskStatus - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.TaskStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TaskStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.TaskStatus"; - }; - - /** - * State enum. - * @name google.cloud.batch.v1alpha.TaskStatus.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} PENDING=1 PENDING value - * @property {number} ASSIGNED=2 ASSIGNED value - * @property {number} RUNNING=3 RUNNING value - * @property {number} FAILED=4 FAILED value - * @property {number} SUCCEEDED=5 SUCCEEDED value - * @property {number} UNEXECUTED=6 UNEXECUTED value - */ - TaskStatus.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PENDING"] = 1; - values[valuesById[2] = "ASSIGNED"] = 2; - values[valuesById[3] = "RUNNING"] = 3; - values[valuesById[4] = "FAILED"] = 4; - values[valuesById[5] = "SUCCEEDED"] = 5; - values[valuesById[6] = "UNEXECUTED"] = 6; - return values; - })(); - - return TaskStatus; - })(); - - v1alpha.TaskResourceUsage = (function() { - - /** - * Properties of a TaskResourceUsage. - * @memberof google.cloud.batch.v1alpha - * @interface ITaskResourceUsage - * @property {number|null} [coreHours] TaskResourceUsage coreHours - */ - - /** - * Constructs a new TaskResourceUsage. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a TaskResourceUsage. - * @implements ITaskResourceUsage - * @constructor - * @param {google.cloud.batch.v1alpha.ITaskResourceUsage=} [properties] Properties to set - */ - function TaskResourceUsage(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TaskResourceUsage coreHours. - * @member {number} coreHours - * @memberof google.cloud.batch.v1alpha.TaskResourceUsage - * @instance - */ - TaskResourceUsage.prototype.coreHours = 0; - - /** - * Creates a new TaskResourceUsage instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.TaskResourceUsage - * @static - * @param {google.cloud.batch.v1alpha.ITaskResourceUsage=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.TaskResourceUsage} TaskResourceUsage instance - */ - TaskResourceUsage.create = function create(properties) { - return new TaskResourceUsage(properties); - }; - - /** - * Encodes the specified TaskResourceUsage message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskResourceUsage.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.TaskResourceUsage - * @static - * @param {google.cloud.batch.v1alpha.ITaskResourceUsage} message TaskResourceUsage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskResourceUsage.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.coreHours != null && Object.hasOwnProperty.call(message, "coreHours")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.coreHours); - return writer; - }; - - /** - * Encodes the specified TaskResourceUsage message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskResourceUsage.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.TaskResourceUsage - * @static - * @param {google.cloud.batch.v1alpha.ITaskResourceUsage} message TaskResourceUsage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskResourceUsage.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TaskResourceUsage message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.TaskResourceUsage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.TaskResourceUsage} TaskResourceUsage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskResourceUsage.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.TaskResourceUsage(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.coreHours = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TaskResourceUsage message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.TaskResourceUsage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.TaskResourceUsage} TaskResourceUsage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskResourceUsage.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TaskResourceUsage message. - * @function verify - * @memberof google.cloud.batch.v1alpha.TaskResourceUsage - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TaskResourceUsage.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.coreHours != null && message.hasOwnProperty("coreHours")) - if (typeof message.coreHours !== "number") - return "coreHours: number expected"; - return null; - }; - - /** - * Creates a TaskResourceUsage message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.TaskResourceUsage - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.TaskResourceUsage} TaskResourceUsage - */ - TaskResourceUsage.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.TaskResourceUsage) - return object; - var message = new $root.google.cloud.batch.v1alpha.TaskResourceUsage(); - if (object.coreHours != null) - message.coreHours = Number(object.coreHours); - return message; - }; - - /** - * Creates a plain object from a TaskResourceUsage message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.TaskResourceUsage - * @static - * @param {google.cloud.batch.v1alpha.TaskResourceUsage} message TaskResourceUsage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TaskResourceUsage.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.coreHours = 0; - if (message.coreHours != null && message.hasOwnProperty("coreHours")) - object.coreHours = options.json && !isFinite(message.coreHours) ? String(message.coreHours) : message.coreHours; - return object; - }; - - /** - * Converts this TaskResourceUsage to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.TaskResourceUsage - * @instance - * @returns {Object.} JSON object - */ - TaskResourceUsage.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TaskResourceUsage - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.TaskResourceUsage - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TaskResourceUsage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.TaskResourceUsage"; - }; - - return TaskResourceUsage; - })(); - - v1alpha.Runnable = (function() { - - /** - * Properties of a Runnable. - * @memberof google.cloud.batch.v1alpha - * @interface IRunnable - * @property {google.cloud.batch.v1alpha.Runnable.IContainer|null} [container] Runnable container - * @property {google.cloud.batch.v1alpha.Runnable.IScript|null} [script] Runnable script - * @property {google.cloud.batch.v1alpha.Runnable.IBarrier|null} [barrier] Runnable barrier - * @property {string|null} [displayName] Runnable displayName - * @property {boolean|null} [ignoreExitStatus] Runnable ignoreExitStatus - * @property {boolean|null} [background] Runnable background - * @property {boolean|null} [alwaysRun] Runnable alwaysRun - * @property {google.cloud.batch.v1alpha.IEnvironment|null} [environment] Runnable environment - * @property {google.protobuf.IDuration|null} [timeout] Runnable timeout - * @property {Object.|null} [labels] Runnable labels - */ - - /** - * Constructs a new Runnable. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a Runnable. - * @implements IRunnable - * @constructor - * @param {google.cloud.batch.v1alpha.IRunnable=} [properties] Properties to set - */ - function Runnable(properties) { - this.labels = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Runnable container. - * @member {google.cloud.batch.v1alpha.Runnable.IContainer|null|undefined} container - * @memberof google.cloud.batch.v1alpha.Runnable - * @instance - */ - Runnable.prototype.container = null; - - /** - * Runnable script. - * @member {google.cloud.batch.v1alpha.Runnable.IScript|null|undefined} script - * @memberof google.cloud.batch.v1alpha.Runnable - * @instance - */ - Runnable.prototype.script = null; - - /** - * Runnable barrier. - * @member {google.cloud.batch.v1alpha.Runnable.IBarrier|null|undefined} barrier - * @memberof google.cloud.batch.v1alpha.Runnable - * @instance - */ - Runnable.prototype.barrier = null; - - /** - * Runnable displayName. - * @member {string} displayName - * @memberof google.cloud.batch.v1alpha.Runnable - * @instance - */ - Runnable.prototype.displayName = ""; - - /** - * Runnable ignoreExitStatus. - * @member {boolean} ignoreExitStatus - * @memberof google.cloud.batch.v1alpha.Runnable - * @instance - */ - Runnable.prototype.ignoreExitStatus = false; - - /** - * Runnable background. - * @member {boolean} background - * @memberof google.cloud.batch.v1alpha.Runnable - * @instance - */ - Runnable.prototype.background = false; - - /** - * Runnable alwaysRun. - * @member {boolean} alwaysRun - * @memberof google.cloud.batch.v1alpha.Runnable - * @instance - */ - Runnable.prototype.alwaysRun = false; - - /** - * Runnable environment. - * @member {google.cloud.batch.v1alpha.IEnvironment|null|undefined} environment - * @memberof google.cloud.batch.v1alpha.Runnable - * @instance - */ - Runnable.prototype.environment = null; - - /** - * Runnable timeout. - * @member {google.protobuf.IDuration|null|undefined} timeout - * @memberof google.cloud.batch.v1alpha.Runnable - * @instance - */ - Runnable.prototype.timeout = null; - - /** - * Runnable labels. - * @member {Object.} labels - * @memberof google.cloud.batch.v1alpha.Runnable - * @instance - */ - Runnable.prototype.labels = $util.emptyObject; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Runnable executable. - * @member {"container"|"script"|"barrier"|undefined} executable - * @memberof google.cloud.batch.v1alpha.Runnable - * @instance - */ - Object.defineProperty(Runnable.prototype, "executable", { - get: $util.oneOfGetter($oneOfFields = ["container", "script", "barrier"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Runnable instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.Runnable - * @static - * @param {google.cloud.batch.v1alpha.IRunnable=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.Runnable} Runnable instance - */ - Runnable.create = function create(properties) { - return new Runnable(properties); - }; - - /** - * Encodes the specified Runnable message. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.Runnable - * @static - * @param {google.cloud.batch.v1alpha.IRunnable} message Runnable message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Runnable.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.container != null && Object.hasOwnProperty.call(message, "container")) - $root.google.cloud.batch.v1alpha.Runnable.Container.encode(message.container, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.script != null && Object.hasOwnProperty.call(message, "script")) - $root.google.cloud.batch.v1alpha.Runnable.Script.encode(message.script, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.ignoreExitStatus != null && Object.hasOwnProperty.call(message, "ignoreExitStatus")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.ignoreExitStatus); - if (message.background != null && Object.hasOwnProperty.call(message, "background")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.background); - if (message.alwaysRun != null && Object.hasOwnProperty.call(message, "alwaysRun")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.alwaysRun); - if (message.barrier != null && Object.hasOwnProperty.call(message, "barrier")) - $root.google.cloud.batch.v1alpha.Runnable.Barrier.encode(message.barrier, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) - $root.google.cloud.batch.v1alpha.Environment.encode(message.environment, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) - $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - 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 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.displayName); - return writer; - }; - - /** - * Encodes the specified Runnable message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.Runnable - * @static - * @param {google.cloud.batch.v1alpha.IRunnable} message Runnable message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Runnable.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Runnable message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.Runnable - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.Runnable} Runnable - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Runnable.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Runnable(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.container = $root.google.cloud.batch.v1alpha.Runnable.Container.decode(reader, reader.uint32()); - break; - } - case 2: { - message.script = $root.google.cloud.batch.v1alpha.Runnable.Script.decode(reader, reader.uint32()); - break; - } - case 6: { - message.barrier = $root.google.cloud.batch.v1alpha.Runnable.Barrier.decode(reader, reader.uint32()); - break; - } - case 10: { - message.displayName = reader.string(); - break; - } - case 3: { - message.ignoreExitStatus = reader.bool(); - break; - } - case 4: { - message.background = reader.bool(); - break; - } - case 5: { - message.alwaysRun = reader.bool(); - break; - } - case 7: { - message.environment = $root.google.cloud.batch.v1alpha.Environment.decode(reader, reader.uint32()); - break; - } - case 8: { - message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 9: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Runnable message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.Runnable - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.Runnable} Runnable - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Runnable.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Runnable message. - * @function verify - * @memberof google.cloud.batch.v1alpha.Runnable - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Runnable.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.container != null && message.hasOwnProperty("container")) { - properties.executable = 1; - { - var error = $root.google.cloud.batch.v1alpha.Runnable.Container.verify(message.container); - if (error) - return "container." + error; - } - } - if (message.script != null && message.hasOwnProperty("script")) { - if (properties.executable === 1) - return "executable: multiple values"; - properties.executable = 1; - { - var error = $root.google.cloud.batch.v1alpha.Runnable.Script.verify(message.script); - if (error) - return "script." + error; - } - } - if (message.barrier != null && message.hasOwnProperty("barrier")) { - if (properties.executable === 1) - return "executable: multiple values"; - properties.executable = 1; - { - var error = $root.google.cloud.batch.v1alpha.Runnable.Barrier.verify(message.barrier); - if (error) - return "barrier." + error; - } - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.ignoreExitStatus != null && message.hasOwnProperty("ignoreExitStatus")) - if (typeof message.ignoreExitStatus !== "boolean") - return "ignoreExitStatus: boolean expected"; - if (message.background != null && message.hasOwnProperty("background")) - if (typeof message.background !== "boolean") - return "background: boolean expected"; - if (message.alwaysRun != null && message.hasOwnProperty("alwaysRun")) - if (typeof message.alwaysRun !== "boolean") - return "alwaysRun: boolean expected"; - if (message.environment != null && message.hasOwnProperty("environment")) { - var error = $root.google.cloud.batch.v1alpha.Environment.verify(message.environment); - if (error) - return "environment." + error; - } - if (message.timeout != null && message.hasOwnProperty("timeout")) { - var error = $root.google.protobuf.Duration.verify(message.timeout); - if (error) - return "timeout." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - return null; - }; - - /** - * Creates a Runnable message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.Runnable - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.Runnable} Runnable - */ - Runnable.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.Runnable) - return object; - var message = new $root.google.cloud.batch.v1alpha.Runnable(); - if (object.container != null) { - if (typeof object.container !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Runnable.container: object expected"); - message.container = $root.google.cloud.batch.v1alpha.Runnable.Container.fromObject(object.container); - } - if (object.script != null) { - if (typeof object.script !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Runnable.script: object expected"); - message.script = $root.google.cloud.batch.v1alpha.Runnable.Script.fromObject(object.script); - } - if (object.barrier != null) { - if (typeof object.barrier !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Runnable.barrier: object expected"); - message.barrier = $root.google.cloud.batch.v1alpha.Runnable.Barrier.fromObject(object.barrier); - } - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.ignoreExitStatus != null) - message.ignoreExitStatus = Boolean(object.ignoreExitStatus); - if (object.background != null) - message.background = Boolean(object.background); - if (object.alwaysRun != null) - message.alwaysRun = Boolean(object.alwaysRun); - if (object.environment != null) { - if (typeof object.environment !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Runnable.environment: object expected"); - message.environment = $root.google.cloud.batch.v1alpha.Environment.fromObject(object.environment); - } - if (object.timeout != null) { - if (typeof object.timeout !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Runnable.timeout: object expected"); - message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Runnable.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - return message; - }; - - /** - * Creates a plain object from a Runnable message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.Runnable - * @static - * @param {google.cloud.batch.v1alpha.Runnable} message Runnable - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Runnable.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.ignoreExitStatus = false; - object.background = false; - object.alwaysRun = false; - object.environment = null; - object.timeout = null; - object.displayName = ""; - } - if (message.container != null && message.hasOwnProperty("container")) { - object.container = $root.google.cloud.batch.v1alpha.Runnable.Container.toObject(message.container, options); - if (options.oneofs) - object.executable = "container"; - } - if (message.script != null && message.hasOwnProperty("script")) { - object.script = $root.google.cloud.batch.v1alpha.Runnable.Script.toObject(message.script, options); - if (options.oneofs) - object.executable = "script"; - } - if (message.ignoreExitStatus != null && message.hasOwnProperty("ignoreExitStatus")) - object.ignoreExitStatus = message.ignoreExitStatus; - if (message.background != null && message.hasOwnProperty("background")) - object.background = message.background; - if (message.alwaysRun != null && message.hasOwnProperty("alwaysRun")) - object.alwaysRun = message.alwaysRun; - if (message.barrier != null && message.hasOwnProperty("barrier")) { - object.barrier = $root.google.cloud.batch.v1alpha.Runnable.Barrier.toObject(message.barrier, options); - if (options.oneofs) - object.executable = "barrier"; - } - if (message.environment != null && message.hasOwnProperty("environment")) - object.environment = $root.google.cloud.batch.v1alpha.Environment.toObject(message.environment, options); - if (message.timeout != null && message.hasOwnProperty("timeout")) - object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - return object; - }; - - /** - * Converts this Runnable to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.Runnable - * @instance - * @returns {Object.} JSON object - */ - Runnable.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Runnable - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.Runnable - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Runnable.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.Runnable"; - }; - - Runnable.Container = (function() { - - /** - * Properties of a Container. - * @memberof google.cloud.batch.v1alpha.Runnable - * @interface IContainer - * @property {string|null} [imageUri] Container imageUri - * @property {Array.|null} [commands] Container commands - * @property {string|null} [entrypoint] Container entrypoint - * @property {Array.|null} [volumes] Container volumes - * @property {string|null} [options] Container options - * @property {boolean|null} [blockExternalNetwork] Container blockExternalNetwork - * @property {string|null} [username] Container username - * @property {string|null} [password] Container password - * @property {boolean|null} [enableImageStreaming] Container enableImageStreaming - */ - - /** - * Constructs a new Container. - * @memberof google.cloud.batch.v1alpha.Runnable - * @classdesc Represents a Container. - * @implements IContainer - * @constructor - * @param {google.cloud.batch.v1alpha.Runnable.IContainer=} [properties] Properties to set - */ - function Container(properties) { - this.commands = []; - this.volumes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Container imageUri. - * @member {string} imageUri - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @instance - */ - Container.prototype.imageUri = ""; - - /** - * Container commands. - * @member {Array.} commands - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @instance - */ - Container.prototype.commands = $util.emptyArray; - - /** - * Container entrypoint. - * @member {string} entrypoint - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @instance - */ - Container.prototype.entrypoint = ""; - - /** - * Container volumes. - * @member {Array.} volumes - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @instance - */ - Container.prototype.volumes = $util.emptyArray; - - /** - * Container options. - * @member {string} options - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @instance - */ - Container.prototype.options = ""; - - /** - * Container blockExternalNetwork. - * @member {boolean} blockExternalNetwork - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @instance - */ - Container.prototype.blockExternalNetwork = false; - - /** - * Container username. - * @member {string} username - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @instance - */ - Container.prototype.username = ""; - - /** - * Container password. - * @member {string} password - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @instance - */ - Container.prototype.password = ""; - - /** - * Container enableImageStreaming. - * @member {boolean} enableImageStreaming - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @instance - */ - Container.prototype.enableImageStreaming = false; - - /** - * Creates a new Container instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @static - * @param {google.cloud.batch.v1alpha.Runnable.IContainer=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.Runnable.Container} Container instance - */ - Container.create = function create(properties) { - return new Container(properties); - }; - - /** - * Encodes the specified Container message. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Container.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @static - * @param {google.cloud.batch.v1alpha.Runnable.IContainer} message Container message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Container.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.imageUri != null && Object.hasOwnProperty.call(message, "imageUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.imageUri); - if (message.commands != null && message.commands.length) - for (var i = 0; i < message.commands.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.commands[i]); - if (message.entrypoint != null && Object.hasOwnProperty.call(message, "entrypoint")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.entrypoint); - if (message.volumes != null && message.volumes.length) - for (var i = 0; i < message.volumes.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.volumes[i]); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.options); - if (message.blockExternalNetwork != null && Object.hasOwnProperty.call(message, "blockExternalNetwork")) - writer.uint32(/* id 9, wireType 0 =*/72).bool(message.blockExternalNetwork); - if (message.username != null && Object.hasOwnProperty.call(message, "username")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.username); - if (message.password != null && Object.hasOwnProperty.call(message, "password")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.password); - if (message.enableImageStreaming != null && Object.hasOwnProperty.call(message, "enableImageStreaming")) - writer.uint32(/* id 12, wireType 0 =*/96).bool(message.enableImageStreaming); - return writer; - }; - - /** - * Encodes the specified Container message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Container.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @static - * @param {google.cloud.batch.v1alpha.Runnable.IContainer} message Container message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Container.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Container message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.Runnable.Container} Container - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Container.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Runnable.Container(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.imageUri = reader.string(); - break; - } - case 2: { - if (!(message.commands && message.commands.length)) - message.commands = []; - message.commands.push(reader.string()); - break; - } - case 3: { - message.entrypoint = reader.string(); - break; - } - case 7: { - if (!(message.volumes && message.volumes.length)) - message.volumes = []; - message.volumes.push(reader.string()); - break; - } - case 8: { - message.options = reader.string(); - break; - } - case 9: { - message.blockExternalNetwork = reader.bool(); - break; - } - case 10: { - message.username = reader.string(); - break; - } - case 11: { - message.password = reader.string(); - break; - } - case 12: { - message.enableImageStreaming = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Container message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.Runnable.Container} Container - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Container.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Container message. - * @function verify - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Container.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.imageUri != null && message.hasOwnProperty("imageUri")) - if (!$util.isString(message.imageUri)) - return "imageUri: string expected"; - if (message.commands != null && message.hasOwnProperty("commands")) { - if (!Array.isArray(message.commands)) - return "commands: array expected"; - for (var i = 0; i < message.commands.length; ++i) - if (!$util.isString(message.commands[i])) - return "commands: string[] expected"; - } - if (message.entrypoint != null && message.hasOwnProperty("entrypoint")) - if (!$util.isString(message.entrypoint)) - return "entrypoint: string expected"; - if (message.volumes != null && message.hasOwnProperty("volumes")) { - if (!Array.isArray(message.volumes)) - return "volumes: array expected"; - for (var i = 0; i < message.volumes.length; ++i) - if (!$util.isString(message.volumes[i])) - return "volumes: string[] expected"; - } - if (message.options != null && message.hasOwnProperty("options")) - if (!$util.isString(message.options)) - return "options: string expected"; - if (message.blockExternalNetwork != null && message.hasOwnProperty("blockExternalNetwork")) - if (typeof message.blockExternalNetwork !== "boolean") - return "blockExternalNetwork: boolean expected"; - if (message.username != null && message.hasOwnProperty("username")) - if (!$util.isString(message.username)) - return "username: string expected"; - if (message.password != null && message.hasOwnProperty("password")) - if (!$util.isString(message.password)) - return "password: string expected"; - if (message.enableImageStreaming != null && message.hasOwnProperty("enableImageStreaming")) - if (typeof message.enableImageStreaming !== "boolean") - return "enableImageStreaming: boolean expected"; - return null; - }; - - /** - * Creates a Container message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.Runnable.Container} Container - */ - Container.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.Runnable.Container) - return object; - var message = new $root.google.cloud.batch.v1alpha.Runnable.Container(); - if (object.imageUri != null) - message.imageUri = String(object.imageUri); - if (object.commands) { - if (!Array.isArray(object.commands)) - throw TypeError(".google.cloud.batch.v1alpha.Runnable.Container.commands: array expected"); - message.commands = []; - for (var i = 0; i < object.commands.length; ++i) - message.commands[i] = String(object.commands[i]); - } - if (object.entrypoint != null) - message.entrypoint = String(object.entrypoint); - if (object.volumes) { - if (!Array.isArray(object.volumes)) - throw TypeError(".google.cloud.batch.v1alpha.Runnable.Container.volumes: array expected"); - message.volumes = []; - for (var i = 0; i < object.volumes.length; ++i) - message.volumes[i] = String(object.volumes[i]); - } - if (object.options != null) - message.options = String(object.options); - if (object.blockExternalNetwork != null) - message.blockExternalNetwork = Boolean(object.blockExternalNetwork); - if (object.username != null) - message.username = String(object.username); - if (object.password != null) - message.password = String(object.password); - if (object.enableImageStreaming != null) - message.enableImageStreaming = Boolean(object.enableImageStreaming); - return message; - }; - - /** - * Creates a plain object from a Container message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @static - * @param {google.cloud.batch.v1alpha.Runnable.Container} message Container - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Container.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.commands = []; - object.volumes = []; - } - if (options.defaults) { - object.imageUri = ""; - object.entrypoint = ""; - object.options = ""; - object.blockExternalNetwork = false; - object.username = ""; - object.password = ""; - object.enableImageStreaming = false; - } - if (message.imageUri != null && message.hasOwnProperty("imageUri")) - object.imageUri = message.imageUri; - if (message.commands && message.commands.length) { - object.commands = []; - for (var j = 0; j < message.commands.length; ++j) - object.commands[j] = message.commands[j]; - } - if (message.entrypoint != null && message.hasOwnProperty("entrypoint")) - object.entrypoint = message.entrypoint; - if (message.volumes && message.volumes.length) { - object.volumes = []; - for (var j = 0; j < message.volumes.length; ++j) - object.volumes[j] = message.volumes[j]; - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = message.options; - if (message.blockExternalNetwork != null && message.hasOwnProperty("blockExternalNetwork")) - object.blockExternalNetwork = message.blockExternalNetwork; - if (message.username != null && message.hasOwnProperty("username")) - object.username = message.username; - if (message.password != null && message.hasOwnProperty("password")) - object.password = message.password; - if (message.enableImageStreaming != null && message.hasOwnProperty("enableImageStreaming")) - object.enableImageStreaming = message.enableImageStreaming; - return object; - }; - - /** - * Converts this Container to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @instance - * @returns {Object.} JSON object - */ - Container.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Container - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Container.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.Runnable.Container"; - }; - - return Container; - })(); - - Runnable.Script = (function() { - - /** - * Properties of a Script. - * @memberof google.cloud.batch.v1alpha.Runnable - * @interface IScript - * @property {string|null} [path] Script path - * @property {string|null} [text] Script text - */ - - /** - * Constructs a new Script. - * @memberof google.cloud.batch.v1alpha.Runnable - * @classdesc Represents a Script. - * @implements IScript - * @constructor - * @param {google.cloud.batch.v1alpha.Runnable.IScript=} [properties] Properties to set - */ - function Script(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Script path. - * @member {string|null|undefined} path - * @memberof google.cloud.batch.v1alpha.Runnable.Script - * @instance - */ - Script.prototype.path = null; - - /** - * Script text. - * @member {string|null|undefined} text - * @memberof google.cloud.batch.v1alpha.Runnable.Script - * @instance - */ - Script.prototype.text = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Script command. - * @member {"path"|"text"|undefined} command - * @memberof google.cloud.batch.v1alpha.Runnable.Script - * @instance - */ - Object.defineProperty(Script.prototype, "command", { - get: $util.oneOfGetter($oneOfFields = ["path", "text"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Script instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.Runnable.Script - * @static - * @param {google.cloud.batch.v1alpha.Runnable.IScript=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.Runnable.Script} Script instance - */ - Script.create = function create(properties) { - return new Script(properties); - }; - - /** - * Encodes the specified Script message. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Script.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.Runnable.Script - * @static - * @param {google.cloud.batch.v1alpha.Runnable.IScript} message Script message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Script.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.path); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.text); - return writer; - }; - - /** - * Encodes the specified Script message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Script.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.Runnable.Script - * @static - * @param {google.cloud.batch.v1alpha.Runnable.IScript} message Script message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Script.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Script message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.Runnable.Script - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.Runnable.Script} Script - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Script.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Runnable.Script(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.path = reader.string(); - break; - } - case 2: { - message.text = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Script message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.Runnable.Script - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.Runnable.Script} Script - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Script.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Script message. - * @function verify - * @memberof google.cloud.batch.v1alpha.Runnable.Script - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Script.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.path != null && message.hasOwnProperty("path")) { - properties.command = 1; - if (!$util.isString(message.path)) - return "path: string expected"; - } - if (message.text != null && message.hasOwnProperty("text")) { - if (properties.command === 1) - return "command: multiple values"; - properties.command = 1; - if (!$util.isString(message.text)) - return "text: string expected"; - } - return null; - }; - - /** - * Creates a Script message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.Runnable.Script - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.Runnable.Script} Script - */ - Script.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.Runnable.Script) - return object; - var message = new $root.google.cloud.batch.v1alpha.Runnable.Script(); - if (object.path != null) - message.path = String(object.path); - if (object.text != null) - message.text = String(object.text); - return message; - }; - - /** - * Creates a plain object from a Script message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.Runnable.Script - * @static - * @param {google.cloud.batch.v1alpha.Runnable.Script} message Script - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Script.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.path != null && message.hasOwnProperty("path")) { - object.path = message.path; - if (options.oneofs) - object.command = "path"; - } - if (message.text != null && message.hasOwnProperty("text")) { - object.text = message.text; - if (options.oneofs) - object.command = "text"; - } - return object; - }; - - /** - * Converts this Script to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.Runnable.Script - * @instance - * @returns {Object.} JSON object - */ - Script.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Script - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.Runnable.Script - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Script.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.Runnable.Script"; - }; - - return Script; - })(); - - Runnable.Barrier = (function() { - - /** - * Properties of a Barrier. - * @memberof google.cloud.batch.v1alpha.Runnable - * @interface IBarrier - * @property {string|null} [name] Barrier name - */ - - /** - * Constructs a new Barrier. - * @memberof google.cloud.batch.v1alpha.Runnable - * @classdesc Represents a Barrier. - * @implements IBarrier - * @constructor - * @param {google.cloud.batch.v1alpha.Runnable.IBarrier=} [properties] Properties to set - */ - function Barrier(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Barrier name. - * @member {string} name - * @memberof google.cloud.batch.v1alpha.Runnable.Barrier - * @instance - */ - Barrier.prototype.name = ""; - - /** - * Creates a new Barrier instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.Runnable.Barrier - * @static - * @param {google.cloud.batch.v1alpha.Runnable.IBarrier=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.Runnable.Barrier} Barrier instance - */ - Barrier.create = function create(properties) { - return new Barrier(properties); - }; - - /** - * Encodes the specified Barrier message. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Barrier.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.Runnable.Barrier - * @static - * @param {google.cloud.batch.v1alpha.Runnable.IBarrier} message Barrier message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Barrier.encode = function encode(message, writer) { - 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 Barrier message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Barrier.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.Runnable.Barrier - * @static - * @param {google.cloud.batch.v1alpha.Runnable.IBarrier} message Barrier message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Barrier.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Barrier message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.Runnable.Barrier - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.Runnable.Barrier} Barrier - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Barrier.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Runnable.Barrier(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Barrier message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.Runnable.Barrier - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.Runnable.Barrier} Barrier - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Barrier.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Barrier message. - * @function verify - * @memberof google.cloud.batch.v1alpha.Runnable.Barrier - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Barrier.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a Barrier message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.Runnable.Barrier - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.Runnable.Barrier} Barrier - */ - Barrier.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.Runnable.Barrier) - return object; - var message = new $root.google.cloud.batch.v1alpha.Runnable.Barrier(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a Barrier message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.Runnable.Barrier - * @static - * @param {google.cloud.batch.v1alpha.Runnable.Barrier} message Barrier - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Barrier.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 Barrier to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.Runnable.Barrier - * @instance - * @returns {Object.} JSON object - */ - Barrier.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Barrier - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.Runnable.Barrier - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Barrier.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.Runnable.Barrier"; - }; - - return Barrier; - })(); - - return Runnable; - })(); - - v1alpha.TaskSpec = (function() { - - /** - * Properties of a TaskSpec. - * @memberof google.cloud.batch.v1alpha - * @interface ITaskSpec - * @property {Array.|null} [runnables] TaskSpec runnables - * @property {google.cloud.batch.v1alpha.IComputeResource|null} [computeResource] TaskSpec computeResource - * @property {google.protobuf.IDuration|null} [maxRunDuration] TaskSpec maxRunDuration - * @property {number|null} [maxRetryCount] TaskSpec maxRetryCount - * @property {Array.|null} [lifecyclePolicies] TaskSpec lifecyclePolicies - * @property {Object.|null} [environments] TaskSpec environments - * @property {Array.|null} [volumes] TaskSpec volumes - * @property {google.cloud.batch.v1alpha.IEnvironment|null} [environment] TaskSpec environment - */ - - /** - * Constructs a new TaskSpec. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a TaskSpec. - * @implements ITaskSpec - * @constructor - * @param {google.cloud.batch.v1alpha.ITaskSpec=} [properties] Properties to set - */ - function TaskSpec(properties) { - this.runnables = []; - this.lifecyclePolicies = []; - this.environments = {}; - this.volumes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TaskSpec runnables. - * @member {Array.} runnables - * @memberof google.cloud.batch.v1alpha.TaskSpec - * @instance - */ - TaskSpec.prototype.runnables = $util.emptyArray; - - /** - * TaskSpec computeResource. - * @member {google.cloud.batch.v1alpha.IComputeResource|null|undefined} computeResource - * @memberof google.cloud.batch.v1alpha.TaskSpec - * @instance - */ - TaskSpec.prototype.computeResource = null; - - /** - * TaskSpec maxRunDuration. - * @member {google.protobuf.IDuration|null|undefined} maxRunDuration - * @memberof google.cloud.batch.v1alpha.TaskSpec - * @instance - */ - TaskSpec.prototype.maxRunDuration = null; - - /** - * TaskSpec maxRetryCount. - * @member {number} maxRetryCount - * @memberof google.cloud.batch.v1alpha.TaskSpec - * @instance - */ - TaskSpec.prototype.maxRetryCount = 0; - - /** - * TaskSpec lifecyclePolicies. - * @member {Array.} lifecyclePolicies - * @memberof google.cloud.batch.v1alpha.TaskSpec - * @instance - */ - TaskSpec.prototype.lifecyclePolicies = $util.emptyArray; - - /** - * TaskSpec environments. - * @member {Object.} environments - * @memberof google.cloud.batch.v1alpha.TaskSpec - * @instance - */ - TaskSpec.prototype.environments = $util.emptyObject; - - /** - * TaskSpec volumes. - * @member {Array.} volumes - * @memberof google.cloud.batch.v1alpha.TaskSpec - * @instance - */ - TaskSpec.prototype.volumes = $util.emptyArray; - - /** - * TaskSpec environment. - * @member {google.cloud.batch.v1alpha.IEnvironment|null|undefined} environment - * @memberof google.cloud.batch.v1alpha.TaskSpec - * @instance - */ - TaskSpec.prototype.environment = null; - - /** - * Creates a new TaskSpec instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.TaskSpec - * @static - * @param {google.cloud.batch.v1alpha.ITaskSpec=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.TaskSpec} TaskSpec instance - */ - TaskSpec.create = function create(properties) { - return new TaskSpec(properties); - }; - - /** - * Encodes the specified TaskSpec message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskSpec.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.TaskSpec - * @static - * @param {google.cloud.batch.v1alpha.ITaskSpec} message TaskSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.computeResource != null && Object.hasOwnProperty.call(message, "computeResource")) - $root.google.cloud.batch.v1alpha.ComputeResource.encode(message.computeResource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.maxRunDuration != null && Object.hasOwnProperty.call(message, "maxRunDuration")) - $root.google.protobuf.Duration.encode(message.maxRunDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.maxRetryCount != null && Object.hasOwnProperty.call(message, "maxRetryCount")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxRetryCount); - if (message.environments != null && Object.hasOwnProperty.call(message, "environments")) - for (var keys = Object.keys(message.environments), i = 0; i < keys.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.environments[keys[i]]).ldelim(); - if (message.volumes != null && message.volumes.length) - for (var i = 0; i < message.volumes.length; ++i) - $root.google.cloud.batch.v1alpha.Volume.encode(message.volumes[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.runnables != null && message.runnables.length) - for (var i = 0; i < message.runnables.length; ++i) - $root.google.cloud.batch.v1alpha.Runnable.encode(message.runnables[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.lifecyclePolicies != null && message.lifecyclePolicies.length) - for (var i = 0; i < message.lifecyclePolicies.length; ++i) - $root.google.cloud.batch.v1alpha.LifecyclePolicy.encode(message.lifecyclePolicies[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) - $root.google.cloud.batch.v1alpha.Environment.encode(message.environment, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TaskSpec message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.TaskSpec - * @static - * @param {google.cloud.batch.v1alpha.ITaskSpec} message TaskSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TaskSpec message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.TaskSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.TaskSpec} TaskSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskSpec.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.TaskSpec(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 8: { - if (!(message.runnables && message.runnables.length)) - message.runnables = []; - message.runnables.push($root.google.cloud.batch.v1alpha.Runnable.decode(reader, reader.uint32())); - break; - } - case 3: { - message.computeResource = $root.google.cloud.batch.v1alpha.ComputeResource.decode(reader, reader.uint32()); - break; - } - case 4: { - message.maxRunDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 5: { - message.maxRetryCount = reader.int32(); - break; - } - case 9: { - if (!(message.lifecyclePolicies && message.lifecyclePolicies.length)) - message.lifecyclePolicies = []; - message.lifecyclePolicies.push($root.google.cloud.batch.v1alpha.LifecyclePolicy.decode(reader, reader.uint32())); - break; - } - case 6: { - if (message.environments === $util.emptyObject) - message.environments = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.environments[key] = value; - break; - } - case 7: { - if (!(message.volumes && message.volumes.length)) - message.volumes = []; - message.volumes.push($root.google.cloud.batch.v1alpha.Volume.decode(reader, reader.uint32())); - break; - } - case 10: { - message.environment = $root.google.cloud.batch.v1alpha.Environment.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TaskSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.TaskSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.TaskSpec} TaskSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TaskSpec message. - * @function verify - * @memberof google.cloud.batch.v1alpha.TaskSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TaskSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.runnables != null && message.hasOwnProperty("runnables")) { - if (!Array.isArray(message.runnables)) - return "runnables: array expected"; - for (var i = 0; i < message.runnables.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.Runnable.verify(message.runnables[i]); - if (error) - return "runnables." + error; - } - } - if (message.computeResource != null && message.hasOwnProperty("computeResource")) { - var error = $root.google.cloud.batch.v1alpha.ComputeResource.verify(message.computeResource); - if (error) - return "computeResource." + error; - } - if (message.maxRunDuration != null && message.hasOwnProperty("maxRunDuration")) { - var error = $root.google.protobuf.Duration.verify(message.maxRunDuration); - if (error) - return "maxRunDuration." + error; - } - if (message.maxRetryCount != null && message.hasOwnProperty("maxRetryCount")) - if (!$util.isInteger(message.maxRetryCount)) - return "maxRetryCount: integer expected"; - if (message.lifecyclePolicies != null && message.hasOwnProperty("lifecyclePolicies")) { - if (!Array.isArray(message.lifecyclePolicies)) - return "lifecyclePolicies: array expected"; - for (var i = 0; i < message.lifecyclePolicies.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.LifecyclePolicy.verify(message.lifecyclePolicies[i]); - if (error) - return "lifecyclePolicies." + error; - } - } - if (message.environments != null && message.hasOwnProperty("environments")) { - if (!$util.isObject(message.environments)) - return "environments: object expected"; - var key = Object.keys(message.environments); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.environments[key[i]])) - return "environments: string{k:string} expected"; - } - if (message.volumes != null && message.hasOwnProperty("volumes")) { - if (!Array.isArray(message.volumes)) - return "volumes: array expected"; - for (var i = 0; i < message.volumes.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.Volume.verify(message.volumes[i]); - if (error) - return "volumes." + error; - } - } - if (message.environment != null && message.hasOwnProperty("environment")) { - var error = $root.google.cloud.batch.v1alpha.Environment.verify(message.environment); - if (error) - return "environment." + error; - } - return null; - }; - - /** - * Creates a TaskSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.TaskSpec - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.TaskSpec} TaskSpec - */ - TaskSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.TaskSpec) - return object; - var message = new $root.google.cloud.batch.v1alpha.TaskSpec(); - if (object.runnables) { - if (!Array.isArray(object.runnables)) - throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.runnables: array expected"); - message.runnables = []; - for (var i = 0; i < object.runnables.length; ++i) { - if (typeof object.runnables[i] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.runnables: object expected"); - message.runnables[i] = $root.google.cloud.batch.v1alpha.Runnable.fromObject(object.runnables[i]); - } - } - if (object.computeResource != null) { - if (typeof object.computeResource !== "object") - throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.computeResource: object expected"); - message.computeResource = $root.google.cloud.batch.v1alpha.ComputeResource.fromObject(object.computeResource); - } - if (object.maxRunDuration != null) { - if (typeof object.maxRunDuration !== "object") - throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.maxRunDuration: object expected"); - message.maxRunDuration = $root.google.protobuf.Duration.fromObject(object.maxRunDuration); - } - if (object.maxRetryCount != null) - message.maxRetryCount = object.maxRetryCount | 0; - if (object.lifecyclePolicies) { - if (!Array.isArray(object.lifecyclePolicies)) - throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.lifecyclePolicies: array expected"); - message.lifecyclePolicies = []; - for (var i = 0; i < object.lifecyclePolicies.length; ++i) { - if (typeof object.lifecyclePolicies[i] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.lifecyclePolicies: object expected"); - message.lifecyclePolicies[i] = $root.google.cloud.batch.v1alpha.LifecyclePolicy.fromObject(object.lifecyclePolicies[i]); - } - } - if (object.environments) { - if (typeof object.environments !== "object") - throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.environments: object expected"); - message.environments = {}; - for (var keys = Object.keys(object.environments), i = 0; i < keys.length; ++i) - message.environments[keys[i]] = String(object.environments[keys[i]]); - } - if (object.volumes) { - if (!Array.isArray(object.volumes)) - throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.volumes: array expected"); - message.volumes = []; - for (var i = 0; i < object.volumes.length; ++i) { - if (typeof object.volumes[i] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.volumes: object expected"); - message.volumes[i] = $root.google.cloud.batch.v1alpha.Volume.fromObject(object.volumes[i]); - } - } - if (object.environment != null) { - if (typeof object.environment !== "object") - throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.environment: object expected"); - message.environment = $root.google.cloud.batch.v1alpha.Environment.fromObject(object.environment); - } - return message; - }; - - /** - * Creates a plain object from a TaskSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.TaskSpec - * @static - * @param {google.cloud.batch.v1alpha.TaskSpec} message TaskSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TaskSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.volumes = []; - object.runnables = []; - object.lifecyclePolicies = []; - } - if (options.objects || options.defaults) - object.environments = {}; - if (options.defaults) { - object.computeResource = null; - object.maxRunDuration = null; - object.maxRetryCount = 0; - object.environment = null; - } - if (message.computeResource != null && message.hasOwnProperty("computeResource")) - object.computeResource = $root.google.cloud.batch.v1alpha.ComputeResource.toObject(message.computeResource, options); - if (message.maxRunDuration != null && message.hasOwnProperty("maxRunDuration")) - object.maxRunDuration = $root.google.protobuf.Duration.toObject(message.maxRunDuration, options); - if (message.maxRetryCount != null && message.hasOwnProperty("maxRetryCount")) - object.maxRetryCount = message.maxRetryCount; - var keys2; - if (message.environments && (keys2 = Object.keys(message.environments)).length) { - object.environments = {}; - for (var j = 0; j < keys2.length; ++j) - object.environments[keys2[j]] = message.environments[keys2[j]]; - } - if (message.volumes && message.volumes.length) { - object.volumes = []; - for (var j = 0; j < message.volumes.length; ++j) - object.volumes[j] = $root.google.cloud.batch.v1alpha.Volume.toObject(message.volumes[j], options); - } - if (message.runnables && message.runnables.length) { - object.runnables = []; - for (var j = 0; j < message.runnables.length; ++j) - object.runnables[j] = $root.google.cloud.batch.v1alpha.Runnable.toObject(message.runnables[j], options); - } - if (message.lifecyclePolicies && message.lifecyclePolicies.length) { - object.lifecyclePolicies = []; - for (var j = 0; j < message.lifecyclePolicies.length; ++j) - object.lifecyclePolicies[j] = $root.google.cloud.batch.v1alpha.LifecyclePolicy.toObject(message.lifecyclePolicies[j], options); - } - if (message.environment != null && message.hasOwnProperty("environment")) - object.environment = $root.google.cloud.batch.v1alpha.Environment.toObject(message.environment, options); - return object; - }; - - /** - * Converts this TaskSpec to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.TaskSpec - * @instance - * @returns {Object.} JSON object - */ - TaskSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TaskSpec - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.TaskSpec - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TaskSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.TaskSpec"; - }; - - return TaskSpec; - })(); - - v1alpha.LifecyclePolicy = (function() { - - /** - * Properties of a LifecyclePolicy. - * @memberof google.cloud.batch.v1alpha - * @interface ILifecyclePolicy - * @property {google.cloud.batch.v1alpha.LifecyclePolicy.Action|null} [action] LifecyclePolicy action - * @property {google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition|null} [actionCondition] LifecyclePolicy actionCondition - */ - - /** - * Constructs a new LifecyclePolicy. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a LifecyclePolicy. - * @implements ILifecyclePolicy - * @constructor - * @param {google.cloud.batch.v1alpha.ILifecyclePolicy=} [properties] Properties to set - */ - function LifecyclePolicy(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LifecyclePolicy action. - * @member {google.cloud.batch.v1alpha.LifecyclePolicy.Action} action - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy - * @instance - */ - LifecyclePolicy.prototype.action = 0; - - /** - * LifecyclePolicy actionCondition. - * @member {google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition|null|undefined} actionCondition - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy - * @instance - */ - LifecyclePolicy.prototype.actionCondition = null; - - /** - * Creates a new LifecyclePolicy instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy - * @static - * @param {google.cloud.batch.v1alpha.ILifecyclePolicy=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.LifecyclePolicy} LifecyclePolicy instance - */ - LifecyclePolicy.create = function create(properties) { - return new LifecyclePolicy(properties); - }; - - /** - * Encodes the specified LifecyclePolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.LifecyclePolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy - * @static - * @param {google.cloud.batch.v1alpha.ILifecyclePolicy} message LifecyclePolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LifecyclePolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); - if (message.actionCondition != null && Object.hasOwnProperty.call(message, "actionCondition")) - $root.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.encode(message.actionCondition, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LifecyclePolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.LifecyclePolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy - * @static - * @param {google.cloud.batch.v1alpha.ILifecyclePolicy} message LifecyclePolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LifecyclePolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LifecyclePolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.LifecyclePolicy} LifecyclePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LifecyclePolicy.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.LifecyclePolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.action = reader.int32(); - break; - } - case 2: { - message.actionCondition = $root.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LifecyclePolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.LifecyclePolicy} LifecyclePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LifecyclePolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LifecyclePolicy message. - * @function verify - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LifecyclePolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.action != null && message.hasOwnProperty("action")) - switch (message.action) { - default: - return "action: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.actionCondition != null && message.hasOwnProperty("actionCondition")) { - var error = $root.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.verify(message.actionCondition); - if (error) - return "actionCondition." + error; - } - return null; - }; - - /** - * Creates a LifecyclePolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.LifecyclePolicy} LifecyclePolicy - */ - LifecyclePolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.LifecyclePolicy) - return object; - var message = new $root.google.cloud.batch.v1alpha.LifecyclePolicy(); - switch (object.action) { - default: - if (typeof object.action === "number") { - message.action = object.action; - break; - } - break; - case "ACTION_UNSPECIFIED": - case 0: - message.action = 0; - break; - case "RETRY_TASK": - case 1: - message.action = 1; - break; - case "FAIL_TASK": - case 2: - message.action = 2; - break; - } - if (object.actionCondition != null) { - if (typeof object.actionCondition !== "object") - throw TypeError(".google.cloud.batch.v1alpha.LifecyclePolicy.actionCondition: object expected"); - message.actionCondition = $root.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.fromObject(object.actionCondition); - } - return message; - }; - - /** - * Creates a plain object from a LifecyclePolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy - * @static - * @param {google.cloud.batch.v1alpha.LifecyclePolicy} message LifecyclePolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LifecyclePolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; - object.actionCondition = null; - } - if (message.action != null && message.hasOwnProperty("action")) - object.action = options.enums === String ? $root.google.cloud.batch.v1alpha.LifecyclePolicy.Action[message.action] === undefined ? message.action : $root.google.cloud.batch.v1alpha.LifecyclePolicy.Action[message.action] : message.action; - if (message.actionCondition != null && message.hasOwnProperty("actionCondition")) - object.actionCondition = $root.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.toObject(message.actionCondition, options); - return object; - }; - - /** - * Converts this LifecyclePolicy to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy - * @instance - * @returns {Object.} JSON object - */ - LifecyclePolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LifecyclePolicy - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LifecyclePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.LifecyclePolicy"; - }; - - LifecyclePolicy.ActionCondition = (function() { - - /** - * Properties of an ActionCondition. - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy - * @interface IActionCondition - * @property {Array.|null} [exitCodes] ActionCondition exitCodes - */ - - /** - * Constructs a new ActionCondition. - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy - * @classdesc Represents an ActionCondition. - * @implements IActionCondition - * @constructor - * @param {google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition=} [properties] Properties to set - */ - function ActionCondition(properties) { - this.exitCodes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ActionCondition exitCodes. - * @member {Array.} exitCodes - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition - * @instance - */ - ActionCondition.prototype.exitCodes = $util.emptyArray; - - /** - * Creates a new ActionCondition instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition - * @static - * @param {google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition} ActionCondition instance - */ - ActionCondition.create = function create(properties) { - return new ActionCondition(properties); - }; - - /** - * Encodes the specified ActionCondition message. Does not implicitly {@link google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition - * @static - * @param {google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition} message ActionCondition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ActionCondition.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.exitCodes != null && message.exitCodes.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.exitCodes.length; ++i) - writer.int32(message.exitCodes[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified ActionCondition message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition - * @static - * @param {google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition} message ActionCondition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ActionCondition.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ActionCondition message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition} ActionCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ActionCondition.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.exitCodes && message.exitCodes.length)) - message.exitCodes = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.exitCodes.push(reader.int32()); - } else - message.exitCodes.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ActionCondition message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition} ActionCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ActionCondition.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ActionCondition message. - * @function verify - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ActionCondition.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.exitCodes != null && message.hasOwnProperty("exitCodes")) { - if (!Array.isArray(message.exitCodes)) - return "exitCodes: array expected"; - for (var i = 0; i < message.exitCodes.length; ++i) - if (!$util.isInteger(message.exitCodes[i])) - return "exitCodes: integer[] expected"; - } - return null; - }; - - /** - * Creates an ActionCondition message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition} ActionCondition - */ - ActionCondition.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition) - return object; - var message = new $root.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition(); - if (object.exitCodes) { - if (!Array.isArray(object.exitCodes)) - throw TypeError(".google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.exitCodes: array expected"); - message.exitCodes = []; - for (var i = 0; i < object.exitCodes.length; ++i) - message.exitCodes[i] = object.exitCodes[i] | 0; - } - return message; - }; - - /** - * Creates a plain object from an ActionCondition message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition - * @static - * @param {google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition} message ActionCondition - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ActionCondition.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.exitCodes = []; - if (message.exitCodes && message.exitCodes.length) { - object.exitCodes = []; - for (var j = 0; j < message.exitCodes.length; ++j) - object.exitCodes[j] = message.exitCodes[j]; - } - return object; - }; - - /** - * Converts this ActionCondition to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition - * @instance - * @returns {Object.} JSON object - */ - ActionCondition.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ActionCondition - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ActionCondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition"; - }; - - return ActionCondition; - })(); - - /** - * Action enum. - * @name google.cloud.batch.v1alpha.LifecyclePolicy.Action - * @enum {number} - * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value - * @property {number} RETRY_TASK=1 RETRY_TASK value - * @property {number} FAIL_TASK=2 FAIL_TASK value - */ - LifecyclePolicy.Action = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "RETRY_TASK"] = 1; - values[valuesById[2] = "FAIL_TASK"] = 2; - return values; - })(); - - return LifecyclePolicy; - })(); - - v1alpha.Task = (function() { - - /** - * Properties of a Task. - * @memberof google.cloud.batch.v1alpha - * @interface ITask - * @property {string|null} [name] Task name - * @property {google.cloud.batch.v1alpha.ITaskStatus|null} [status] Task status - */ - - /** - * Constructs a new Task. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a Task. - * @implements ITask - * @constructor - * @param {google.cloud.batch.v1alpha.ITask=} [properties] Properties to set - */ - function Task(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Task name. - * @member {string} name - * @memberof google.cloud.batch.v1alpha.Task - * @instance - */ - Task.prototype.name = ""; - - /** - * Task status. - * @member {google.cloud.batch.v1alpha.ITaskStatus|null|undefined} status - * @memberof google.cloud.batch.v1alpha.Task - * @instance - */ - Task.prototype.status = null; - - /** - * Creates a new Task instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.Task - * @static - * @param {google.cloud.batch.v1alpha.ITask=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.Task} Task instance - */ - Task.create = function create(properties) { - return new Task(properties); - }; - - /** - * Encodes the specified Task message. Does not implicitly {@link google.cloud.batch.v1alpha.Task.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.Task - * @static - * @param {google.cloud.batch.v1alpha.ITask} message Task message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Task.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.cloud.batch.v1alpha.TaskStatus.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Task message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Task.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.Task - * @static - * @param {google.cloud.batch.v1alpha.ITask} message Task message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Task.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Task message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.Task - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.Task} Task - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Task.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Task(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.status = $root.google.cloud.batch.v1alpha.TaskStatus.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Task message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.Task - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.Task} Task - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Task.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Task message. - * @function verify - * @memberof google.cloud.batch.v1alpha.Task - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Task.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.status != null && message.hasOwnProperty("status")) { - var error = $root.google.cloud.batch.v1alpha.TaskStatus.verify(message.status); - if (error) - return "status." + error; - } - return null; - }; - - /** - * Creates a Task message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.Task - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.Task} Task - */ - Task.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.Task) - return object; - var message = new $root.google.cloud.batch.v1alpha.Task(); - if (object.name != null) - message.name = String(object.name); - if (object.status != null) { - if (typeof object.status !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Task.status: object expected"); - message.status = $root.google.cloud.batch.v1alpha.TaskStatus.fromObject(object.status); - } - return message; - }; - - /** - * Creates a plain object from a Task message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.Task - * @static - * @param {google.cloud.batch.v1alpha.Task} message Task - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Task.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.status = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.cloud.batch.v1alpha.TaskStatus.toObject(message.status, options); - return object; - }; - - /** - * Converts this Task to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.Task - * @instance - * @returns {Object.} JSON object - */ - Task.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Task - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.Task - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Task.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.Task"; - }; - - return Task; - })(); - - v1alpha.Environment = (function() { - - /** - * Properties of an Environment. - * @memberof google.cloud.batch.v1alpha - * @interface IEnvironment - * @property {Object.|null} [variables] Environment variables - * @property {Object.|null} [secretVariables] Environment secretVariables - * @property {google.cloud.batch.v1alpha.Environment.IKMSEnvMap|null} [encryptedVariables] Environment encryptedVariables - */ - - /** - * Constructs a new Environment. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents an Environment. - * @implements IEnvironment - * @constructor - * @param {google.cloud.batch.v1alpha.IEnvironment=} [properties] Properties to set - */ - function Environment(properties) { - this.variables = {}; - this.secretVariables = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Environment variables. - * @member {Object.} variables - * @memberof google.cloud.batch.v1alpha.Environment - * @instance - */ - Environment.prototype.variables = $util.emptyObject; - - /** - * Environment secretVariables. - * @member {Object.} secretVariables - * @memberof google.cloud.batch.v1alpha.Environment - * @instance - */ - Environment.prototype.secretVariables = $util.emptyObject; - - /** - * Environment encryptedVariables. - * @member {google.cloud.batch.v1alpha.Environment.IKMSEnvMap|null|undefined} encryptedVariables - * @memberof google.cloud.batch.v1alpha.Environment - * @instance - */ - Environment.prototype.encryptedVariables = null; - - /** - * Creates a new Environment instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.Environment - * @static - * @param {google.cloud.batch.v1alpha.IEnvironment=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.Environment} Environment instance - */ - Environment.create = function create(properties) { - return new Environment(properties); - }; - - /** - * Encodes the specified Environment message. Does not implicitly {@link google.cloud.batch.v1alpha.Environment.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.Environment - * @static - * @param {google.cloud.batch.v1alpha.IEnvironment} message Environment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Environment.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.variables != null && Object.hasOwnProperty.call(message, "variables")) - for (var keys = Object.keys(message.variables), i = 0; i < keys.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.variables[keys[i]]).ldelim(); - if (message.secretVariables != null && Object.hasOwnProperty.call(message, "secretVariables")) - for (var keys = Object.keys(message.secretVariables), 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.secretVariables[keys[i]]).ldelim(); - if (message.encryptedVariables != null && Object.hasOwnProperty.call(message, "encryptedVariables")) - $root.google.cloud.batch.v1alpha.Environment.KMSEnvMap.encode(message.encryptedVariables, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Environment.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.Environment - * @static - * @param {google.cloud.batch.v1alpha.IEnvironment} message Environment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Environment.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Environment message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.Environment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.Environment} Environment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Environment.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Environment(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (message.variables === $util.emptyObject) - message.variables = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.variables[key] = value; - break; - } - case 2: { - if (message.secretVariables === $util.emptyObject) - message.secretVariables = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.secretVariables[key] = value; - break; - } - case 3: { - message.encryptedVariables = $root.google.cloud.batch.v1alpha.Environment.KMSEnvMap.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Environment message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.Environment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.Environment} Environment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Environment.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Environment message. - * @function verify - * @memberof google.cloud.batch.v1alpha.Environment - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Environment.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.variables != null && message.hasOwnProperty("variables")) { - if (!$util.isObject(message.variables)) - return "variables: object expected"; - var key = Object.keys(message.variables); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.variables[key[i]])) - return "variables: string{k:string} expected"; - } - if (message.secretVariables != null && message.hasOwnProperty("secretVariables")) { - if (!$util.isObject(message.secretVariables)) - return "secretVariables: object expected"; - var key = Object.keys(message.secretVariables); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.secretVariables[key[i]])) - return "secretVariables: string{k:string} expected"; - } - if (message.encryptedVariables != null && message.hasOwnProperty("encryptedVariables")) { - var error = $root.google.cloud.batch.v1alpha.Environment.KMSEnvMap.verify(message.encryptedVariables); - if (error) - return "encryptedVariables." + error; - } - return null; - }; - - /** - * Creates an Environment message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.Environment - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.Environment} Environment - */ - Environment.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.Environment) - return object; - var message = new $root.google.cloud.batch.v1alpha.Environment(); - if (object.variables) { - if (typeof object.variables !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Environment.variables: object expected"); - message.variables = {}; - for (var keys = Object.keys(object.variables), i = 0; i < keys.length; ++i) - message.variables[keys[i]] = String(object.variables[keys[i]]); - } - if (object.secretVariables) { - if (typeof object.secretVariables !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Environment.secretVariables: object expected"); - message.secretVariables = {}; - for (var keys = Object.keys(object.secretVariables), i = 0; i < keys.length; ++i) - message.secretVariables[keys[i]] = String(object.secretVariables[keys[i]]); - } - if (object.encryptedVariables != null) { - if (typeof object.encryptedVariables !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Environment.encryptedVariables: object expected"); - message.encryptedVariables = $root.google.cloud.batch.v1alpha.Environment.KMSEnvMap.fromObject(object.encryptedVariables); - } - return message; - }; - - /** - * Creates a plain object from an Environment message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.Environment - * @static - * @param {google.cloud.batch.v1alpha.Environment} message Environment - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Environment.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) { - object.variables = {}; - object.secretVariables = {}; - } - if (options.defaults) - object.encryptedVariables = null; - var keys2; - if (message.variables && (keys2 = Object.keys(message.variables)).length) { - object.variables = {}; - for (var j = 0; j < keys2.length; ++j) - object.variables[keys2[j]] = message.variables[keys2[j]]; - } - if (message.secretVariables && (keys2 = Object.keys(message.secretVariables)).length) { - object.secretVariables = {}; - for (var j = 0; j < keys2.length; ++j) - object.secretVariables[keys2[j]] = message.secretVariables[keys2[j]]; - } - if (message.encryptedVariables != null && message.hasOwnProperty("encryptedVariables")) - object.encryptedVariables = $root.google.cloud.batch.v1alpha.Environment.KMSEnvMap.toObject(message.encryptedVariables, options); - return object; - }; - - /** - * Converts this Environment to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.Environment - * @instance - * @returns {Object.} JSON object - */ - Environment.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Environment - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.Environment - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Environment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.Environment"; - }; - - Environment.KMSEnvMap = (function() { - - /** - * Properties of a KMSEnvMap. - * @memberof google.cloud.batch.v1alpha.Environment - * @interface IKMSEnvMap - * @property {string|null} [keyName] KMSEnvMap keyName - * @property {string|null} [cipherText] KMSEnvMap cipherText - */ - - /** - * Constructs a new KMSEnvMap. - * @memberof google.cloud.batch.v1alpha.Environment - * @classdesc Represents a KMSEnvMap. - * @implements IKMSEnvMap - * @constructor - * @param {google.cloud.batch.v1alpha.Environment.IKMSEnvMap=} [properties] Properties to set - */ - function KMSEnvMap(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * KMSEnvMap keyName. - * @member {string} keyName - * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap - * @instance - */ - KMSEnvMap.prototype.keyName = ""; - - /** - * KMSEnvMap cipherText. - * @member {string} cipherText - * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap - * @instance - */ - KMSEnvMap.prototype.cipherText = ""; - - /** - * Creates a new KMSEnvMap instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap - * @static - * @param {google.cloud.batch.v1alpha.Environment.IKMSEnvMap=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.Environment.KMSEnvMap} KMSEnvMap instance - */ - KMSEnvMap.create = function create(properties) { - return new KMSEnvMap(properties); - }; - - /** - * Encodes the specified KMSEnvMap message. Does not implicitly {@link google.cloud.batch.v1alpha.Environment.KMSEnvMap.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap - * @static - * @param {google.cloud.batch.v1alpha.Environment.IKMSEnvMap} message KMSEnvMap message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KMSEnvMap.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.keyName != null && Object.hasOwnProperty.call(message, "keyName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.keyName); - if (message.cipherText != null && Object.hasOwnProperty.call(message, "cipherText")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.cipherText); - return writer; - }; - - /** - * Encodes the specified KMSEnvMap message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Environment.KMSEnvMap.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap - * @static - * @param {google.cloud.batch.v1alpha.Environment.IKMSEnvMap} message KMSEnvMap message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KMSEnvMap.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a KMSEnvMap message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.Environment.KMSEnvMap} KMSEnvMap - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KMSEnvMap.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Environment.KMSEnvMap(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.keyName = reader.string(); - break; - } - case 2: { - message.cipherText = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a KMSEnvMap message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.Environment.KMSEnvMap} KMSEnvMap - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KMSEnvMap.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a KMSEnvMap message. - * @function verify - * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KMSEnvMap.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.keyName != null && message.hasOwnProperty("keyName")) - if (!$util.isString(message.keyName)) - return "keyName: string expected"; - if (message.cipherText != null && message.hasOwnProperty("cipherText")) - if (!$util.isString(message.cipherText)) - return "cipherText: string expected"; - return null; - }; - - /** - * Creates a KMSEnvMap message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.Environment.KMSEnvMap} KMSEnvMap - */ - KMSEnvMap.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.Environment.KMSEnvMap) - return object; - var message = new $root.google.cloud.batch.v1alpha.Environment.KMSEnvMap(); - if (object.keyName != null) - message.keyName = String(object.keyName); - if (object.cipherText != null) - message.cipherText = String(object.cipherText); - return message; - }; - - /** - * Creates a plain object from a KMSEnvMap message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap - * @static - * @param {google.cloud.batch.v1alpha.Environment.KMSEnvMap} message KMSEnvMap - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KMSEnvMap.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.keyName = ""; - object.cipherText = ""; - } - if (message.keyName != null && message.hasOwnProperty("keyName")) - object.keyName = message.keyName; - if (message.cipherText != null && message.hasOwnProperty("cipherText")) - object.cipherText = message.cipherText; - return object; - }; - - /** - * Converts this KMSEnvMap to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap - * @instance - * @returns {Object.} JSON object - */ - KMSEnvMap.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for KMSEnvMap - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - KMSEnvMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.Environment.KMSEnvMap"; - }; - - return KMSEnvMap; - })(); - - return Environment; - })(); - - v1alpha.Volume = (function() { - - /** - * Properties of a Volume. - * @memberof google.cloud.batch.v1alpha - * @interface IVolume - * @property {google.cloud.batch.v1alpha.INFS|null} [nfs] Volume nfs - * @property {google.cloud.batch.v1alpha.IPD|null} [pd] Volume pd - * @property {google.cloud.batch.v1alpha.IGCS|null} [gcs] Volume gcs - * @property {string|null} [deviceName] Volume deviceName - * @property {string|null} [mountPath] Volume mountPath - * @property {Array.|null} [mountOptions] Volume mountOptions - */ - - /** - * Constructs a new Volume. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a Volume. - * @implements IVolume - * @constructor - * @param {google.cloud.batch.v1alpha.IVolume=} [properties] Properties to set - */ - function Volume(properties) { - this.mountOptions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Volume nfs. - * @member {google.cloud.batch.v1alpha.INFS|null|undefined} nfs - * @memberof google.cloud.batch.v1alpha.Volume - * @instance - */ - Volume.prototype.nfs = null; - - /** - * Volume pd. - * @member {google.cloud.batch.v1alpha.IPD|null|undefined} pd - * @memberof google.cloud.batch.v1alpha.Volume - * @instance - */ - Volume.prototype.pd = null; - - /** - * Volume gcs. - * @member {google.cloud.batch.v1alpha.IGCS|null|undefined} gcs - * @memberof google.cloud.batch.v1alpha.Volume - * @instance - */ - Volume.prototype.gcs = null; - - /** - * Volume deviceName. - * @member {string|null|undefined} deviceName - * @memberof google.cloud.batch.v1alpha.Volume - * @instance - */ - Volume.prototype.deviceName = null; - - /** - * Volume mountPath. - * @member {string} mountPath - * @memberof google.cloud.batch.v1alpha.Volume - * @instance - */ - Volume.prototype.mountPath = ""; - - /** - * Volume mountOptions. - * @member {Array.} mountOptions - * @memberof google.cloud.batch.v1alpha.Volume - * @instance - */ - Volume.prototype.mountOptions = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Volume source. - * @member {"nfs"|"pd"|"gcs"|"deviceName"|undefined} source - * @memberof google.cloud.batch.v1alpha.Volume - * @instance - */ - Object.defineProperty(Volume.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["nfs", "pd", "gcs", "deviceName"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Volume instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.Volume - * @static - * @param {google.cloud.batch.v1alpha.IVolume=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.Volume} Volume instance - */ - Volume.create = function create(properties) { - return new Volume(properties); - }; - - /** - * Encodes the specified Volume message. Does not implicitly {@link google.cloud.batch.v1alpha.Volume.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.Volume - * @static - * @param {google.cloud.batch.v1alpha.IVolume} message Volume message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Volume.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nfs != null && Object.hasOwnProperty.call(message, "nfs")) - $root.google.cloud.batch.v1alpha.NFS.encode(message.nfs, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pd != null && Object.hasOwnProperty.call(message, "pd")) - $root.google.cloud.batch.v1alpha.PD.encode(message.pd, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.gcs != null && Object.hasOwnProperty.call(message, "gcs")) - $root.google.cloud.batch.v1alpha.GCS.encode(message.gcs, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.mountPath != null && Object.hasOwnProperty.call(message, "mountPath")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.mountPath); - if (message.mountOptions != null && message.mountOptions.length) - for (var i = 0; i < message.mountOptions.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.mountOptions[i]); - if (message.deviceName != null && Object.hasOwnProperty.call(message, "deviceName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.deviceName); - return writer; - }; - - /** - * Encodes the specified Volume message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Volume.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.Volume - * @static - * @param {google.cloud.batch.v1alpha.IVolume} message Volume message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Volume.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Volume message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.Volume - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.Volume} Volume - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Volume.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Volume(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.nfs = $root.google.cloud.batch.v1alpha.NFS.decode(reader, reader.uint32()); - break; - } - case 2: { - message.pd = $root.google.cloud.batch.v1alpha.PD.decode(reader, reader.uint32()); - break; - } - case 3: { - message.gcs = $root.google.cloud.batch.v1alpha.GCS.decode(reader, reader.uint32()); - break; - } - case 6: { - message.deviceName = reader.string(); - break; - } - case 4: { - message.mountPath = reader.string(); - break; - } - case 5: { - if (!(message.mountOptions && message.mountOptions.length)) - message.mountOptions = []; - message.mountOptions.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Volume message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.Volume - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.Volume} Volume - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Volume.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Volume message. - * @function verify - * @memberof google.cloud.batch.v1alpha.Volume - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Volume.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.nfs != null && message.hasOwnProperty("nfs")) { - properties.source = 1; - { - var error = $root.google.cloud.batch.v1alpha.NFS.verify(message.nfs); - if (error) - return "nfs." + error; - } - } - if (message.pd != null && message.hasOwnProperty("pd")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.batch.v1alpha.PD.verify(message.pd); - if (error) - return "pd." + error; - } - } - if (message.gcs != null && message.hasOwnProperty("gcs")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.batch.v1alpha.GCS.verify(message.gcs); - if (error) - return "gcs." + error; - } - } - if (message.deviceName != null && message.hasOwnProperty("deviceName")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - if (!$util.isString(message.deviceName)) - return "deviceName: string expected"; - } - if (message.mountPath != null && message.hasOwnProperty("mountPath")) - if (!$util.isString(message.mountPath)) - return "mountPath: string expected"; - if (message.mountOptions != null && message.hasOwnProperty("mountOptions")) { - if (!Array.isArray(message.mountOptions)) - return "mountOptions: array expected"; - for (var i = 0; i < message.mountOptions.length; ++i) - if (!$util.isString(message.mountOptions[i])) - return "mountOptions: string[] expected"; - } - return null; - }; - - /** - * Creates a Volume message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.Volume - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.Volume} Volume - */ - Volume.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.Volume) - return object; - var message = new $root.google.cloud.batch.v1alpha.Volume(); - if (object.nfs != null) { - if (typeof object.nfs !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Volume.nfs: object expected"); - message.nfs = $root.google.cloud.batch.v1alpha.NFS.fromObject(object.nfs); - } - if (object.pd != null) { - if (typeof object.pd !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Volume.pd: object expected"); - message.pd = $root.google.cloud.batch.v1alpha.PD.fromObject(object.pd); - } - if (object.gcs != null) { - if (typeof object.gcs !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Volume.gcs: object expected"); - message.gcs = $root.google.cloud.batch.v1alpha.GCS.fromObject(object.gcs); - } - if (object.deviceName != null) - message.deviceName = String(object.deviceName); - if (object.mountPath != null) - message.mountPath = String(object.mountPath); - if (object.mountOptions) { - if (!Array.isArray(object.mountOptions)) - throw TypeError(".google.cloud.batch.v1alpha.Volume.mountOptions: array expected"); - message.mountOptions = []; - for (var i = 0; i < object.mountOptions.length; ++i) - message.mountOptions[i] = String(object.mountOptions[i]); - } - return message; - }; - - /** - * Creates a plain object from a Volume message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.Volume - * @static - * @param {google.cloud.batch.v1alpha.Volume} message Volume - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Volume.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.mountOptions = []; - if (options.defaults) - object.mountPath = ""; - if (message.nfs != null && message.hasOwnProperty("nfs")) { - object.nfs = $root.google.cloud.batch.v1alpha.NFS.toObject(message.nfs, options); - if (options.oneofs) - object.source = "nfs"; - } - if (message.pd != null && message.hasOwnProperty("pd")) { - object.pd = $root.google.cloud.batch.v1alpha.PD.toObject(message.pd, options); - if (options.oneofs) - object.source = "pd"; - } - if (message.gcs != null && message.hasOwnProperty("gcs")) { - object.gcs = $root.google.cloud.batch.v1alpha.GCS.toObject(message.gcs, options); - if (options.oneofs) - object.source = "gcs"; - } - if (message.mountPath != null && message.hasOwnProperty("mountPath")) - object.mountPath = message.mountPath; - if (message.mountOptions && message.mountOptions.length) { - object.mountOptions = []; - for (var j = 0; j < message.mountOptions.length; ++j) - object.mountOptions[j] = message.mountOptions[j]; - } - if (message.deviceName != null && message.hasOwnProperty("deviceName")) { - object.deviceName = message.deviceName; - if (options.oneofs) - object.source = "deviceName"; - } - return object; - }; - - /** - * Converts this Volume to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.Volume - * @instance - * @returns {Object.} JSON object - */ - Volume.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Volume - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.Volume - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Volume.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.Volume"; - }; - - return Volume; - })(); - - v1alpha.NFS = (function() { - - /** - * Properties of a NFS. - * @memberof google.cloud.batch.v1alpha - * @interface INFS - * @property {string|null} [server] NFS server - * @property {string|null} [remotePath] NFS remotePath - */ - - /** - * Constructs a new NFS. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a NFS. - * @implements INFS - * @constructor - * @param {google.cloud.batch.v1alpha.INFS=} [properties] Properties to set - */ - function NFS(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NFS server. - * @member {string} server - * @memberof google.cloud.batch.v1alpha.NFS - * @instance - */ - NFS.prototype.server = ""; - - /** - * NFS remotePath. - * @member {string} remotePath - * @memberof google.cloud.batch.v1alpha.NFS - * @instance - */ - NFS.prototype.remotePath = ""; - - /** - * Creates a new NFS instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.NFS - * @static - * @param {google.cloud.batch.v1alpha.INFS=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.NFS} NFS instance - */ - NFS.create = function create(properties) { - return new NFS(properties); - }; - - /** - * Encodes the specified NFS message. Does not implicitly {@link google.cloud.batch.v1alpha.NFS.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.NFS - * @static - * @param {google.cloud.batch.v1alpha.INFS} message NFS message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NFS.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.server != null && Object.hasOwnProperty.call(message, "server")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.server); - if (message.remotePath != null && Object.hasOwnProperty.call(message, "remotePath")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.remotePath); - return writer; - }; - - /** - * Encodes the specified NFS message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.NFS.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.NFS - * @static - * @param {google.cloud.batch.v1alpha.INFS} message NFS message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NFS.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NFS message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.NFS - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.NFS} NFS - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NFS.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.NFS(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.server = reader.string(); - break; - } - case 2: { - message.remotePath = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NFS message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.NFS - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.NFS} NFS - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NFS.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NFS message. - * @function verify - * @memberof google.cloud.batch.v1alpha.NFS - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NFS.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.server != null && message.hasOwnProperty("server")) - if (!$util.isString(message.server)) - return "server: string expected"; - if (message.remotePath != null && message.hasOwnProperty("remotePath")) - if (!$util.isString(message.remotePath)) - return "remotePath: string expected"; - return null; - }; - - /** - * Creates a NFS message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.NFS - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.NFS} NFS - */ - NFS.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.NFS) - return object; - var message = new $root.google.cloud.batch.v1alpha.NFS(); - if (object.server != null) - message.server = String(object.server); - if (object.remotePath != null) - message.remotePath = String(object.remotePath); - return message; - }; - - /** - * Creates a plain object from a NFS message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.NFS - * @static - * @param {google.cloud.batch.v1alpha.NFS} message NFS - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NFS.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.server = ""; - object.remotePath = ""; - } - if (message.server != null && message.hasOwnProperty("server")) - object.server = message.server; - if (message.remotePath != null && message.hasOwnProperty("remotePath")) - object.remotePath = message.remotePath; - return object; - }; - - /** - * Converts this NFS to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.NFS - * @instance - * @returns {Object.} JSON object - */ - NFS.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NFS - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.NFS - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NFS.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.NFS"; - }; - - return NFS; - })(); - - v1alpha.PD = (function() { - - /** - * Properties of a PD. - * @memberof google.cloud.batch.v1alpha - * @interface IPD - * @property {string|null} [disk] PD disk - * @property {string|null} [device] PD device - * @property {boolean|null} [existing] PD existing - */ - - /** - * Constructs a new PD. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a PD. - * @implements IPD - * @constructor - * @param {google.cloud.batch.v1alpha.IPD=} [properties] Properties to set - */ - function PD(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PD disk. - * @member {string} disk - * @memberof google.cloud.batch.v1alpha.PD - * @instance - */ - PD.prototype.disk = ""; - - /** - * PD device. - * @member {string} device - * @memberof google.cloud.batch.v1alpha.PD - * @instance - */ - PD.prototype.device = ""; - - /** - * PD existing. - * @member {boolean} existing - * @memberof google.cloud.batch.v1alpha.PD - * @instance - */ - PD.prototype.existing = false; - - /** - * Creates a new PD instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.PD - * @static - * @param {google.cloud.batch.v1alpha.IPD=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.PD} PD instance - */ - PD.create = function create(properties) { - return new PD(properties); - }; - - /** - * Encodes the specified PD message. Does not implicitly {@link google.cloud.batch.v1alpha.PD.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.PD - * @static - * @param {google.cloud.batch.v1alpha.IPD} message PD message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PD.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.disk != null && Object.hasOwnProperty.call(message, "disk")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.disk); - if (message.device != null && Object.hasOwnProperty.call(message, "device")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.device); - if (message.existing != null && Object.hasOwnProperty.call(message, "existing")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.existing); - return writer; - }; - - /** - * Encodes the specified PD message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.PD.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.PD - * @static - * @param {google.cloud.batch.v1alpha.IPD} message PD message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PD.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PD message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.PD - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.PD} PD - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PD.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.PD(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.disk = reader.string(); - break; - } - case 2: { - message.device = reader.string(); - break; - } - case 3: { - message.existing = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PD message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.PD - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.PD} PD - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PD.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PD message. - * @function verify - * @memberof google.cloud.batch.v1alpha.PD - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PD.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.disk != null && message.hasOwnProperty("disk")) - if (!$util.isString(message.disk)) - return "disk: string expected"; - if (message.device != null && message.hasOwnProperty("device")) - if (!$util.isString(message.device)) - return "device: string expected"; - if (message.existing != null && message.hasOwnProperty("existing")) - if (typeof message.existing !== "boolean") - return "existing: boolean expected"; - return null; - }; - - /** - * Creates a PD message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.PD - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.PD} PD - */ - PD.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.PD) - return object; - var message = new $root.google.cloud.batch.v1alpha.PD(); - if (object.disk != null) - message.disk = String(object.disk); - if (object.device != null) - message.device = String(object.device); - if (object.existing != null) - message.existing = Boolean(object.existing); - return message; - }; - - /** - * Creates a plain object from a PD message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.PD - * @static - * @param {google.cloud.batch.v1alpha.PD} message PD - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PD.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.disk = ""; - object.device = ""; - object.existing = false; - } - if (message.disk != null && message.hasOwnProperty("disk")) - object.disk = message.disk; - if (message.device != null && message.hasOwnProperty("device")) - object.device = message.device; - if (message.existing != null && message.hasOwnProperty("existing")) - object.existing = message.existing; - return object; - }; - - /** - * Converts this PD to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.PD - * @instance - * @returns {Object.} JSON object - */ - PD.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PD - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.PD - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PD.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.PD"; - }; - - return PD; - })(); - - v1alpha.GCS = (function() { - - /** - * Properties of a GCS. - * @memberof google.cloud.batch.v1alpha - * @interface IGCS - * @property {string|null} [remotePath] GCS remotePath - */ - - /** - * Constructs a new GCS. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a GCS. - * @implements IGCS - * @constructor - * @param {google.cloud.batch.v1alpha.IGCS=} [properties] Properties to set - */ - function GCS(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GCS remotePath. - * @member {string} remotePath - * @memberof google.cloud.batch.v1alpha.GCS - * @instance - */ - GCS.prototype.remotePath = ""; - - /** - * Creates a new GCS instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.GCS - * @static - * @param {google.cloud.batch.v1alpha.IGCS=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.GCS} GCS instance - */ - GCS.create = function create(properties) { - return new GCS(properties); - }; - - /** - * Encodes the specified GCS message. Does not implicitly {@link google.cloud.batch.v1alpha.GCS.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.GCS - * @static - * @param {google.cloud.batch.v1alpha.IGCS} message GCS message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GCS.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.remotePath != null && Object.hasOwnProperty.call(message, "remotePath")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.remotePath); - return writer; - }; - - /** - * Encodes the specified GCS message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.GCS.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.GCS - * @static - * @param {google.cloud.batch.v1alpha.IGCS} message GCS message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GCS.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GCS message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.GCS - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.GCS} GCS - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GCS.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.GCS(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.remotePath = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GCS message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.GCS - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.GCS} GCS - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GCS.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GCS message. - * @function verify - * @memberof google.cloud.batch.v1alpha.GCS - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GCS.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.remotePath != null && message.hasOwnProperty("remotePath")) - if (!$util.isString(message.remotePath)) - return "remotePath: string expected"; - return null; - }; - - /** - * Creates a GCS message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.GCS - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.GCS} GCS - */ - GCS.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.GCS) - return object; - var message = new $root.google.cloud.batch.v1alpha.GCS(); - if (object.remotePath != null) - message.remotePath = String(object.remotePath); - return message; - }; - - /** - * Creates a plain object from a GCS message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.GCS - * @static - * @param {google.cloud.batch.v1alpha.GCS} message GCS - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GCS.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.remotePath = ""; - if (message.remotePath != null && message.hasOwnProperty("remotePath")) - object.remotePath = message.remotePath; - return object; - }; - - /** - * Converts this GCS to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.GCS - * @instance - * @returns {Object.} JSON object - */ - GCS.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GCS - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.GCS - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GCS.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.GCS"; - }; - - return GCS; - })(); - - /** - * CalendarPeriod enum. - * @name google.cloud.batch.v1alpha.CalendarPeriod - * @enum {number} - * @property {number} CALENDAR_PERIOD_UNSPECIFIED=0 CALENDAR_PERIOD_UNSPECIFIED value - * @property {number} MONTH=1 MONTH value - * @property {number} QUARTER=2 QUARTER value - * @property {number} YEAR=3 YEAR value - * @property {number} WEEK=4 WEEK value - * @property {number} DAY=5 DAY value - */ - v1alpha.CalendarPeriod = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CALENDAR_PERIOD_UNSPECIFIED"] = 0; - values[valuesById[1] = "MONTH"] = 1; - values[valuesById[2] = "QUARTER"] = 2; - values[valuesById[3] = "YEAR"] = 3; - values[valuesById[4] = "WEEK"] = 4; - values[valuesById[5] = "DAY"] = 5; - return values; - })(); - - /** - * ResourceAllowanceState enum. - * @name google.cloud.batch.v1alpha.ResourceAllowanceState - * @enum {number} - * @property {number} RESOURCE_ALLOWANCE_STATE_UNSPECIFIED=0 RESOURCE_ALLOWANCE_STATE_UNSPECIFIED value - * @property {number} RESOURCE_ALLOWANCE_ACTIVE=1 RESOURCE_ALLOWANCE_ACTIVE value - * @property {number} RESOURCE_ALLOWANCE_DEPLETED=2 RESOURCE_ALLOWANCE_DEPLETED value - */ - v1alpha.ResourceAllowanceState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RESOURCE_ALLOWANCE_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RESOURCE_ALLOWANCE_ACTIVE"] = 1; - values[valuesById[2] = "RESOURCE_ALLOWANCE_DEPLETED"] = 2; - return values; - })(); - - v1alpha.ResourceAllowance = (function() { - - /** - * Properties of a ResourceAllowance. - * @memberof google.cloud.batch.v1alpha - * @interface IResourceAllowance - * @property {google.cloud.batch.v1alpha.IUsageResourceAllowance|null} [usageResourceAllowance] ResourceAllowance usageResourceAllowance - * @property {string|null} [name] ResourceAllowance name - * @property {string|null} [uid] ResourceAllowance uid - * @property {google.protobuf.ITimestamp|null} [createTime] ResourceAllowance createTime - * @property {Object.|null} [labels] ResourceAllowance labels - * @property {Array.|null} [notifications] ResourceAllowance notifications - */ - - /** - * Constructs a new ResourceAllowance. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a ResourceAllowance. - * @implements IResourceAllowance - * @constructor - * @param {google.cloud.batch.v1alpha.IResourceAllowance=} [properties] Properties to set - */ - function ResourceAllowance(properties) { - this.labels = {}; - this.notifications = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceAllowance usageResourceAllowance. - * @member {google.cloud.batch.v1alpha.IUsageResourceAllowance|null|undefined} usageResourceAllowance - * @memberof google.cloud.batch.v1alpha.ResourceAllowance - * @instance - */ - ResourceAllowance.prototype.usageResourceAllowance = null; - - /** - * ResourceAllowance name. - * @member {string} name - * @memberof google.cloud.batch.v1alpha.ResourceAllowance - * @instance - */ - ResourceAllowance.prototype.name = ""; - - /** - * ResourceAllowance uid. - * @member {string} uid - * @memberof google.cloud.batch.v1alpha.ResourceAllowance - * @instance - */ - ResourceAllowance.prototype.uid = ""; - - /** - * ResourceAllowance createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.batch.v1alpha.ResourceAllowance - * @instance - */ - ResourceAllowance.prototype.createTime = null; - - /** - * ResourceAllowance labels. - * @member {Object.} labels - * @memberof google.cloud.batch.v1alpha.ResourceAllowance - * @instance - */ - ResourceAllowance.prototype.labels = $util.emptyObject; - - /** - * ResourceAllowance notifications. - * @member {Array.} notifications - * @memberof google.cloud.batch.v1alpha.ResourceAllowance - * @instance - */ - ResourceAllowance.prototype.notifications = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ResourceAllowance resourceAllowance. - * @member {"usageResourceAllowance"|undefined} resourceAllowance - * @memberof google.cloud.batch.v1alpha.ResourceAllowance - * @instance - */ - Object.defineProperty(ResourceAllowance.prototype, "resourceAllowance", { - get: $util.oneOfGetter($oneOfFields = ["usageResourceAllowance"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ResourceAllowance instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.ResourceAllowance - * @static - * @param {google.cloud.batch.v1alpha.IResourceAllowance=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.ResourceAllowance} ResourceAllowance instance - */ - ResourceAllowance.create = function create(properties) { - return new ResourceAllowance(properties); - }; - - /** - * Encodes the specified ResourceAllowance message. Does not implicitly {@link google.cloud.batch.v1alpha.ResourceAllowance.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.ResourceAllowance - * @static - * @param {google.cloud.batch.v1alpha.IResourceAllowance} message ResourceAllowance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceAllowance.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.usageResourceAllowance != null && Object.hasOwnProperty.call(message, "usageResourceAllowance")) - $root.google.cloud.batch.v1alpha.UsageResourceAllowance.encode(message.usageResourceAllowance, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.notifications != null && message.notifications.length) - for (var i = 0; i < message.notifications.length; ++i) - $root.google.cloud.batch.v1alpha.Notification.encode(message.notifications[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ResourceAllowance message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ResourceAllowance.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.ResourceAllowance - * @static - * @param {google.cloud.batch.v1alpha.IResourceAllowance} message ResourceAllowance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceAllowance.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceAllowance message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.ResourceAllowance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.ResourceAllowance} ResourceAllowance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceAllowance.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ResourceAllowance(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 4: { - message.usageResourceAllowance = $root.google.cloud.batch.v1alpha.UsageResourceAllowance.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.uid = reader.string(); - break; - } - case 3: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 6: { - if (!(message.notifications && message.notifications.length)) - message.notifications = []; - message.notifications.push($root.google.cloud.batch.v1alpha.Notification.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceAllowance message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.ResourceAllowance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.ResourceAllowance} ResourceAllowance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceAllowance.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceAllowance message. - * @function verify - * @memberof google.cloud.batch.v1alpha.ResourceAllowance - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceAllowance.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.usageResourceAllowance != null && message.hasOwnProperty("usageResourceAllowance")) { - properties.resourceAllowance = 1; - { - var error = $root.google.cloud.batch.v1alpha.UsageResourceAllowance.verify(message.usageResourceAllowance); - if (error) - return "usageResourceAllowance." + error; - } - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.uid != null && message.hasOwnProperty("uid")) - if (!$util.isString(message.uid)) - return "uid: string expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.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.notifications != null && message.hasOwnProperty("notifications")) { - if (!Array.isArray(message.notifications)) - return "notifications: array expected"; - for (var i = 0; i < message.notifications.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.Notification.verify(message.notifications[i]); - if (error) - return "notifications." + error; - } - } - return null; - }; - - /** - * Creates a ResourceAllowance message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.ResourceAllowance - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.ResourceAllowance} ResourceAllowance - */ - ResourceAllowance.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.ResourceAllowance) - return object; - var message = new $root.google.cloud.batch.v1alpha.ResourceAllowance(); - if (object.usageResourceAllowance != null) { - if (typeof object.usageResourceAllowance !== "object") - throw TypeError(".google.cloud.batch.v1alpha.ResourceAllowance.usageResourceAllowance: object expected"); - message.usageResourceAllowance = $root.google.cloud.batch.v1alpha.UsageResourceAllowance.fromObject(object.usageResourceAllowance); - } - if (object.name != null) - message.name = String(object.name); - if (object.uid != null) - message.uid = String(object.uid); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.batch.v1alpha.ResourceAllowance.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.batch.v1alpha.ResourceAllowance.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - if (object.notifications) { - if (!Array.isArray(object.notifications)) - throw TypeError(".google.cloud.batch.v1alpha.ResourceAllowance.notifications: array expected"); - message.notifications = []; - for (var i = 0; i < object.notifications.length; ++i) { - if (typeof object.notifications[i] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.ResourceAllowance.notifications: object expected"); - message.notifications[i] = $root.google.cloud.batch.v1alpha.Notification.fromObject(object.notifications[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ResourceAllowance message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.ResourceAllowance - * @static - * @param {google.cloud.batch.v1alpha.ResourceAllowance} message ResourceAllowance - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceAllowance.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.notifications = []; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.uid = ""; - object.createTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.usageResourceAllowance != null && message.hasOwnProperty("usageResourceAllowance")) { - object.usageResourceAllowance = $root.google.cloud.batch.v1alpha.UsageResourceAllowance.toObject(message.usageResourceAllowance, options); - if (options.oneofs) - object.resourceAllowance = "usageResourceAllowance"; - } - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.notifications && message.notifications.length) { - object.notifications = []; - for (var j = 0; j < message.notifications.length; ++j) - object.notifications[j] = $root.google.cloud.batch.v1alpha.Notification.toObject(message.notifications[j], options); - } - return object; - }; - - /** - * Converts this ResourceAllowance to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.ResourceAllowance - * @instance - * @returns {Object.} JSON object - */ - ResourceAllowance.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceAllowance - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.ResourceAllowance - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceAllowance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.ResourceAllowance"; - }; - - return ResourceAllowance; - })(); - - v1alpha.UsageResourceAllowance = (function() { - - /** - * Properties of a UsageResourceAllowance. - * @memberof google.cloud.batch.v1alpha - * @interface IUsageResourceAllowance - * @property {google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec|null} [spec] UsageResourceAllowance spec - * @property {google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus|null} [status] UsageResourceAllowance status - */ - - /** - * Constructs a new UsageResourceAllowance. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a UsageResourceAllowance. - * @implements IUsageResourceAllowance - * @constructor - * @param {google.cloud.batch.v1alpha.IUsageResourceAllowance=} [properties] Properties to set - */ - function UsageResourceAllowance(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UsageResourceAllowance spec. - * @member {google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec|null|undefined} spec - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance - * @instance - */ - UsageResourceAllowance.prototype.spec = null; - - /** - * UsageResourceAllowance status. - * @member {google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus|null|undefined} status - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance - * @instance - */ - UsageResourceAllowance.prototype.status = null; - - /** - * Creates a new UsageResourceAllowance instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance - * @static - * @param {google.cloud.batch.v1alpha.IUsageResourceAllowance=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowance} UsageResourceAllowance instance - */ - UsageResourceAllowance.create = function create(properties) { - return new UsageResourceAllowance(properties); - }; - - /** - * Encodes the specified UsageResourceAllowance message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowance.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance - * @static - * @param {google.cloud.batch.v1alpha.IUsageResourceAllowance} message UsageResourceAllowance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UsageResourceAllowance.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.spec != null && Object.hasOwnProperty.call(message, "spec")) - $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.encode(message.spec, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UsageResourceAllowance message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowance.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance - * @static - * @param {google.cloud.batch.v1alpha.IUsageResourceAllowance} message UsageResourceAllowance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UsageResourceAllowance.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a UsageResourceAllowance message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowance} UsageResourceAllowance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UsageResourceAllowance.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowance(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.spec = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.decode(reader, reader.uint32()); - break; - } - case 2: { - message.status = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a UsageResourceAllowance message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowance} UsageResourceAllowance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UsageResourceAllowance.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a UsageResourceAllowance message. - * @function verify - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UsageResourceAllowance.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.spec != null && message.hasOwnProperty("spec")) { - var error = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.verify(message.spec); - if (error) - return "spec." + error; - } - if (message.status != null && message.hasOwnProperty("status")) { - var error = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.verify(message.status); - if (error) - return "status." + error; - } - return null; - }; - - /** - * Creates a UsageResourceAllowance message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowance} UsageResourceAllowance - */ - UsageResourceAllowance.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.UsageResourceAllowance) - return object; - var message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowance(); - if (object.spec != null) { - if (typeof object.spec !== "object") - throw TypeError(".google.cloud.batch.v1alpha.UsageResourceAllowance.spec: object expected"); - message.spec = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.fromObject(object.spec); - } - if (object.status != null) { - if (typeof object.status !== "object") - throw TypeError(".google.cloud.batch.v1alpha.UsageResourceAllowance.status: object expected"); - message.status = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.fromObject(object.status); - } - return message; - }; - - /** - * Creates a plain object from a UsageResourceAllowance message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowance} message UsageResourceAllowance - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UsageResourceAllowance.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.spec = null; - object.status = null; - } - if (message.spec != null && message.hasOwnProperty("spec")) - object.spec = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.toObject(message.spec, options); - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.toObject(message.status, options); - return object; - }; - - /** - * Converts this UsageResourceAllowance to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance - * @instance - * @returns {Object.} JSON object - */ - UsageResourceAllowance.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UsageResourceAllowance - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UsageResourceAllowance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.UsageResourceAllowance"; - }; - - return UsageResourceAllowance; - })(); - - v1alpha.UsageResourceAllowanceSpec = (function() { - - /** - * Properties of a UsageResourceAllowanceSpec. - * @memberof google.cloud.batch.v1alpha - * @interface IUsageResourceAllowanceSpec - * @property {string|null} [type] UsageResourceAllowanceSpec type - * @property {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit|null} [limit] UsageResourceAllowanceSpec limit - */ - - /** - * Constructs a new UsageResourceAllowanceSpec. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a UsageResourceAllowanceSpec. - * @implements IUsageResourceAllowanceSpec - * @constructor - * @param {google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec=} [properties] Properties to set - */ - function UsageResourceAllowanceSpec(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UsageResourceAllowanceSpec type. - * @member {string} type - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec - * @instance - */ - UsageResourceAllowanceSpec.prototype.type = ""; - - /** - * UsageResourceAllowanceSpec limit. - * @member {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit|null|undefined} limit - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec - * @instance - */ - UsageResourceAllowanceSpec.prototype.limit = null; - - /** - * Creates a new UsageResourceAllowanceSpec instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec - * @static - * @param {google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec} UsageResourceAllowanceSpec instance - */ - UsageResourceAllowanceSpec.create = function create(properties) { - return new UsageResourceAllowanceSpec(properties); - }; - - /** - * Encodes the specified UsageResourceAllowanceSpec message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec - * @static - * @param {google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec} message UsageResourceAllowanceSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UsageResourceAllowanceSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit.encode(message.limit, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UsageResourceAllowanceSpec message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec - * @static - * @param {google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec} message UsageResourceAllowanceSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UsageResourceAllowanceSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a UsageResourceAllowanceSpec message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec} UsageResourceAllowanceSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UsageResourceAllowanceSpec.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - message.limit = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a UsageResourceAllowanceSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec} UsageResourceAllowanceSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UsageResourceAllowanceSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a UsageResourceAllowanceSpec message. - * @function verify - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UsageResourceAllowanceSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.limit != null && message.hasOwnProperty("limit")) { - var error = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit.verify(message.limit); - if (error) - return "limit." + error; - } - return null; - }; - - /** - * Creates a UsageResourceAllowanceSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec} UsageResourceAllowanceSpec - */ - UsageResourceAllowanceSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec) - return object; - var message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec(); - if (object.type != null) - message.type = String(object.type); - if (object.limit != null) { - if (typeof object.limit !== "object") - throw TypeError(".google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.limit: object expected"); - message.limit = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit.fromObject(object.limit); - } - return message; - }; - - /** - * Creates a plain object from a UsageResourceAllowanceSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec} message UsageResourceAllowanceSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UsageResourceAllowanceSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = ""; - object.limit = null; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.limit != null && message.hasOwnProperty("limit")) - object.limit = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit.toObject(message.limit, options); - return object; - }; - - /** - * Converts this UsageResourceAllowanceSpec to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec - * @instance - * @returns {Object.} JSON object - */ - UsageResourceAllowanceSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UsageResourceAllowanceSpec - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UsageResourceAllowanceSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.UsageResourceAllowanceSpec"; - }; - - UsageResourceAllowanceSpec.Limit = (function() { - - /** - * Properties of a Limit. - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec - * @interface ILimit - * @property {google.cloud.batch.v1alpha.CalendarPeriod|null} [calendarPeriod] Limit calendarPeriod - * @property {number|null} [limit] Limit limit - */ - - /** - * Constructs a new Limit. - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec - * @classdesc Represents a Limit. - * @implements ILimit - * @constructor - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit=} [properties] Properties to set - */ - function Limit(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Limit calendarPeriod. - * @member {google.cloud.batch.v1alpha.CalendarPeriod|null|undefined} calendarPeriod - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit - * @instance - */ - Limit.prototype.calendarPeriod = null; - - /** - * Limit limit. - * @member {number|null|undefined} limit - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit - * @instance - */ - Limit.prototype.limit = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Limit duration. - * @member {"calendarPeriod"|undefined} duration - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit - * @instance - */ - Object.defineProperty(Limit.prototype, "duration", { - get: $util.oneOfGetter($oneOfFields = ["calendarPeriod"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Limit _limit. - * @member {"limit"|undefined} _limit - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit - * @instance - */ - Object.defineProperty(Limit.prototype, "_limit", { - get: $util.oneOfGetter($oneOfFields = ["limit"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Limit instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit} Limit instance - */ - Limit.create = function create(properties) { - return new Limit(properties); - }; - - /** - * Encodes the specified Limit message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit} message Limit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Limit.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.calendarPeriod != null && Object.hasOwnProperty.call(message, "calendarPeriod")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.calendarPeriod); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.limit); - return writer; - }; - - /** - * Encodes the specified Limit message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit} message Limit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Limit.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Limit message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit} Limit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Limit.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.calendarPeriod = reader.int32(); - break; - } - case 2: { - message.limit = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Limit message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit} Limit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Limit.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Limit message. - * @function verify - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Limit.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.calendarPeriod != null && message.hasOwnProperty("calendarPeriod")) { - properties.duration = 1; - switch (message.calendarPeriod) { - default: - return "calendarPeriod: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - } - if (message.limit != null && message.hasOwnProperty("limit")) { - properties._limit = 1; - if (typeof message.limit !== "number") - return "limit: number expected"; - } - return null; - }; - - /** - * Creates a Limit message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit} Limit - */ - Limit.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit) - return object; - var message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit(); - switch (object.calendarPeriod) { - default: - if (typeof object.calendarPeriod === "number") { - message.calendarPeriod = object.calendarPeriod; - break; - } - break; - case "CALENDAR_PERIOD_UNSPECIFIED": - case 0: - message.calendarPeriod = 0; - break; - case "MONTH": - case 1: - message.calendarPeriod = 1; - break; - case "QUARTER": - case 2: - message.calendarPeriod = 2; - break; - case "YEAR": - case 3: - message.calendarPeriod = 3; - break; - case "WEEK": - case 4: - message.calendarPeriod = 4; - break; - case "DAY": - case 5: - message.calendarPeriod = 5; - break; - } - if (object.limit != null) - message.limit = Number(object.limit); - return message; - }; - - /** - * Creates a plain object from a Limit message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit} message Limit - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Limit.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.calendarPeriod != null && message.hasOwnProperty("calendarPeriod")) { - object.calendarPeriod = options.enums === String ? $root.google.cloud.batch.v1alpha.CalendarPeriod[message.calendarPeriod] === undefined ? message.calendarPeriod : $root.google.cloud.batch.v1alpha.CalendarPeriod[message.calendarPeriod] : message.calendarPeriod; - if (options.oneofs) - object.duration = "calendarPeriod"; - } - if (message.limit != null && message.hasOwnProperty("limit")) { - object.limit = options.json && !isFinite(message.limit) ? String(message.limit) : message.limit; - if (options.oneofs) - object._limit = "limit"; - } - return object; - }; - - /** - * Converts this Limit to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit - * @instance - * @returns {Object.} JSON object - */ - Limit.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Limit - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Limit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit"; - }; - - return Limit; - })(); - - return UsageResourceAllowanceSpec; - })(); - - v1alpha.UsageResourceAllowanceStatus = (function() { - - /** - * Properties of a UsageResourceAllowanceStatus. - * @memberof google.cloud.batch.v1alpha - * @interface IUsageResourceAllowanceStatus - * @property {google.cloud.batch.v1alpha.ResourceAllowanceState|null} [state] UsageResourceAllowanceStatus state - * @property {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus|null} [limitStatus] UsageResourceAllowanceStatus limitStatus - * @property {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport|null} [report] UsageResourceAllowanceStatus report - */ - - /** - * Constructs a new UsageResourceAllowanceStatus. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a UsageResourceAllowanceStatus. - * @implements IUsageResourceAllowanceStatus - * @constructor - * @param {google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus=} [properties] Properties to set - */ - function UsageResourceAllowanceStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UsageResourceAllowanceStatus state. - * @member {google.cloud.batch.v1alpha.ResourceAllowanceState} state - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @instance - */ - UsageResourceAllowanceStatus.prototype.state = 0; - - /** - * UsageResourceAllowanceStatus limitStatus. - * @member {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus|null|undefined} limitStatus - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @instance - */ - UsageResourceAllowanceStatus.prototype.limitStatus = null; - - /** - * UsageResourceAllowanceStatus report. - * @member {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport|null|undefined} report - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @instance - */ - UsageResourceAllowanceStatus.prototype.report = null; - - /** - * Creates a new UsageResourceAllowanceStatus instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @static - * @param {google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus} UsageResourceAllowanceStatus instance - */ - UsageResourceAllowanceStatus.create = function create(properties) { - return new UsageResourceAllowanceStatus(properties); - }; - - /** - * Encodes the specified UsageResourceAllowanceStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @static - * @param {google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus} message UsageResourceAllowanceStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UsageResourceAllowanceStatus.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); - if (message.limitStatus != null && Object.hasOwnProperty.call(message, "limitStatus")) - $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.encode(message.limitStatus, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.report != null && Object.hasOwnProperty.call(message, "report")) - $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.encode(message.report, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UsageResourceAllowanceStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @static - * @param {google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus} message UsageResourceAllowanceStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UsageResourceAllowanceStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a UsageResourceAllowanceStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus} UsageResourceAllowanceStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UsageResourceAllowanceStatus.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.state = reader.int32(); - break; - } - case 2: { - message.limitStatus = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.decode(reader, reader.uint32()); - break; - } - case 3: { - message.report = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a UsageResourceAllowanceStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus} UsageResourceAllowanceStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UsageResourceAllowanceStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a UsageResourceAllowanceStatus message. - * @function verify - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UsageResourceAllowanceStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.limitStatus != null && message.hasOwnProperty("limitStatus")) { - var error = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.verify(message.limitStatus); - if (error) - return "limitStatus." + error; - } - if (message.report != null && message.hasOwnProperty("report")) { - var error = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.verify(message.report); - if (error) - return "report." + error; - } - return null; - }; - - /** - * Creates a UsageResourceAllowanceStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus} UsageResourceAllowanceStatus - */ - UsageResourceAllowanceStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus) - return object; - var message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus(); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "RESOURCE_ALLOWANCE_STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "RESOURCE_ALLOWANCE_ACTIVE": - case 1: - message.state = 1; - break; - case "RESOURCE_ALLOWANCE_DEPLETED": - case 2: - message.state = 2; - break; - } - if (object.limitStatus != null) { - if (typeof object.limitStatus !== "object") - throw TypeError(".google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.limitStatus: object expected"); - message.limitStatus = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.fromObject(object.limitStatus); - } - if (object.report != null) { - if (typeof object.report !== "object") - throw TypeError(".google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.report: object expected"); - message.report = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.fromObject(object.report); - } - return message; - }; - - /** - * Creates a plain object from a UsageResourceAllowanceStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus} message UsageResourceAllowanceStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UsageResourceAllowanceStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.state = options.enums === String ? "RESOURCE_ALLOWANCE_STATE_UNSPECIFIED" : 0; - object.limitStatus = null; - object.report = null; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.batch.v1alpha.ResourceAllowanceState[message.state] === undefined ? message.state : $root.google.cloud.batch.v1alpha.ResourceAllowanceState[message.state] : message.state; - if (message.limitStatus != null && message.hasOwnProperty("limitStatus")) - object.limitStatus = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.toObject(message.limitStatus, options); - if (message.report != null && message.hasOwnProperty("report")) - object.report = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.toObject(message.report, options); - return object; - }; - - /** - * Converts this UsageResourceAllowanceStatus to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @instance - * @returns {Object.} JSON object - */ - UsageResourceAllowanceStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UsageResourceAllowanceStatus - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UsageResourceAllowanceStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.UsageResourceAllowanceStatus"; - }; - - UsageResourceAllowanceStatus.LimitStatus = (function() { - - /** - * Properties of a LimitStatus. - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @interface ILimitStatus - * @property {google.type.IInterval|null} [consumptionInterval] LimitStatus consumptionInterval - * @property {number|null} [limit] LimitStatus limit - * @property {number|null} [consumed] LimitStatus consumed - */ - - /** - * Constructs a new LimitStatus. - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @classdesc Represents a LimitStatus. - * @implements ILimitStatus - * @constructor - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus=} [properties] Properties to set - */ - function LimitStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LimitStatus consumptionInterval. - * @member {google.type.IInterval|null|undefined} consumptionInterval - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus - * @instance - */ - LimitStatus.prototype.consumptionInterval = null; - - /** - * LimitStatus limit. - * @member {number|null|undefined} limit - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus - * @instance - */ - LimitStatus.prototype.limit = null; - - /** - * LimitStatus consumed. - * @member {number|null|undefined} consumed - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus - * @instance - */ - LimitStatus.prototype.consumed = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * LimitStatus _limit. - * @member {"limit"|undefined} _limit - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus - * @instance - */ - Object.defineProperty(LimitStatus.prototype, "_limit", { - get: $util.oneOfGetter($oneOfFields = ["limit"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * LimitStatus _consumed. - * @member {"consumed"|undefined} _consumed - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus - * @instance - */ - Object.defineProperty(LimitStatus.prototype, "_consumed", { - get: $util.oneOfGetter($oneOfFields = ["consumed"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new LimitStatus instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus} LimitStatus instance - */ - LimitStatus.create = function create(properties) { - return new LimitStatus(properties); - }; - - /** - * Encodes the specified LimitStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus} message LimitStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LimitStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.consumptionInterval != null && Object.hasOwnProperty.call(message, "consumptionInterval")) - $root.google.type.Interval.encode(message.consumptionInterval, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.limit); - if (message.consumed != null && Object.hasOwnProperty.call(message, "consumed")) - writer.uint32(/* id 3, wireType 1 =*/25).double(message.consumed); - return writer; - }; - - /** - * Encodes the specified LimitStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus} message LimitStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LimitStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LimitStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus} LimitStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LimitStatus.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.consumptionInterval = $root.google.type.Interval.decode(reader, reader.uint32()); - break; - } - case 2: { - message.limit = reader.double(); - break; - } - case 3: { - message.consumed = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LimitStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus} LimitStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LimitStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LimitStatus message. - * @function verify - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LimitStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.consumptionInterval != null && message.hasOwnProperty("consumptionInterval")) { - var error = $root.google.type.Interval.verify(message.consumptionInterval); - if (error) - return "consumptionInterval." + error; - } - if (message.limit != null && message.hasOwnProperty("limit")) { - properties._limit = 1; - if (typeof message.limit !== "number") - return "limit: number expected"; - } - if (message.consumed != null && message.hasOwnProperty("consumed")) { - properties._consumed = 1; - if (typeof message.consumed !== "number") - return "consumed: number expected"; - } - return null; - }; - - /** - * Creates a LimitStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus} LimitStatus - */ - LimitStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus) - return object; - var message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus(); - if (object.consumptionInterval != null) { - if (typeof object.consumptionInterval !== "object") - throw TypeError(".google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.consumptionInterval: object expected"); - message.consumptionInterval = $root.google.type.Interval.fromObject(object.consumptionInterval); - } - if (object.limit != null) - message.limit = Number(object.limit); - if (object.consumed != null) - message.consumed = Number(object.consumed); - return message; - }; - - /** - * Creates a plain object from a LimitStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus} message LimitStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LimitStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.consumptionInterval = null; - if (message.consumptionInterval != null && message.hasOwnProperty("consumptionInterval")) - object.consumptionInterval = $root.google.type.Interval.toObject(message.consumptionInterval, options); - if (message.limit != null && message.hasOwnProperty("limit")) { - object.limit = options.json && !isFinite(message.limit) ? String(message.limit) : message.limit; - if (options.oneofs) - object._limit = "limit"; - } - if (message.consumed != null && message.hasOwnProperty("consumed")) { - object.consumed = options.json && !isFinite(message.consumed) ? String(message.consumed) : message.consumed; - if (options.oneofs) - object._consumed = "consumed"; - } - return object; - }; - - /** - * Converts this LimitStatus to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus - * @instance - * @returns {Object.} JSON object - */ - LimitStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LimitStatus - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LimitStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus"; - }; - - return LimitStatus; - })(); - - UsageResourceAllowanceStatus.PeriodConsumption = (function() { - - /** - * Properties of a PeriodConsumption. - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @interface IPeriodConsumption - * @property {google.type.IInterval|null} [consumptionInterval] PeriodConsumption consumptionInterval - * @property {number|null} [consumed] PeriodConsumption consumed - */ - - /** - * Constructs a new PeriodConsumption. - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @classdesc Represents a PeriodConsumption. - * @implements IPeriodConsumption - * @constructor - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption=} [properties] Properties to set - */ - function PeriodConsumption(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PeriodConsumption consumptionInterval. - * @member {google.type.IInterval|null|undefined} consumptionInterval - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption - * @instance - */ - PeriodConsumption.prototype.consumptionInterval = null; - - /** - * PeriodConsumption consumed. - * @member {number|null|undefined} consumed - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption - * @instance - */ - PeriodConsumption.prototype.consumed = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * PeriodConsumption _consumed. - * @member {"consumed"|undefined} _consumed - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption - * @instance - */ - Object.defineProperty(PeriodConsumption.prototype, "_consumed", { - get: $util.oneOfGetter($oneOfFields = ["consumed"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new PeriodConsumption instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption} PeriodConsumption instance - */ - PeriodConsumption.create = function create(properties) { - return new PeriodConsumption(properties); - }; - - /** - * Encodes the specified PeriodConsumption message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption} message PeriodConsumption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PeriodConsumption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.consumptionInterval != null && Object.hasOwnProperty.call(message, "consumptionInterval")) - $root.google.type.Interval.encode(message.consumptionInterval, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.consumed != null && Object.hasOwnProperty.call(message, "consumed")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.consumed); - return writer; - }; - - /** - * Encodes the specified PeriodConsumption message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption} message PeriodConsumption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PeriodConsumption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PeriodConsumption message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption} PeriodConsumption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PeriodConsumption.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.consumptionInterval = $root.google.type.Interval.decode(reader, reader.uint32()); - break; - } - case 2: { - message.consumed = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PeriodConsumption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption} PeriodConsumption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PeriodConsumption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PeriodConsumption message. - * @function verify - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PeriodConsumption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.consumptionInterval != null && message.hasOwnProperty("consumptionInterval")) { - var error = $root.google.type.Interval.verify(message.consumptionInterval); - if (error) - return "consumptionInterval." + error; - } - if (message.consumed != null && message.hasOwnProperty("consumed")) { - properties._consumed = 1; - if (typeof message.consumed !== "number") - return "consumed: number expected"; - } - return null; - }; - - /** - * Creates a PeriodConsumption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption} PeriodConsumption - */ - PeriodConsumption.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption) - return object; - var message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption(); - if (object.consumptionInterval != null) { - if (typeof object.consumptionInterval !== "object") - throw TypeError(".google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.consumptionInterval: object expected"); - message.consumptionInterval = $root.google.type.Interval.fromObject(object.consumptionInterval); - } - if (object.consumed != null) - message.consumed = Number(object.consumed); - return message; - }; - - /** - * Creates a plain object from a PeriodConsumption message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption} message PeriodConsumption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PeriodConsumption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.consumptionInterval = null; - if (message.consumptionInterval != null && message.hasOwnProperty("consumptionInterval")) - object.consumptionInterval = $root.google.type.Interval.toObject(message.consumptionInterval, options); - if (message.consumed != null && message.hasOwnProperty("consumed")) { - object.consumed = options.json && !isFinite(message.consumed) ? String(message.consumed) : message.consumed; - if (options.oneofs) - object._consumed = "consumed"; - } - return object; - }; - - /** - * Converts this PeriodConsumption to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption - * @instance - * @returns {Object.} JSON object - */ - PeriodConsumption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PeriodConsumption - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PeriodConsumption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption"; - }; - - return PeriodConsumption; - })(); - - UsageResourceAllowanceStatus.ConsumptionReport = (function() { - - /** - * Properties of a ConsumptionReport. - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @interface IConsumptionReport - * @property {Object.|null} [latestPeriodConsumptions] ConsumptionReport latestPeriodConsumptions - */ - - /** - * Constructs a new ConsumptionReport. - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @classdesc Represents a ConsumptionReport. - * @implements IConsumptionReport - * @constructor - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport=} [properties] Properties to set - */ - function ConsumptionReport(properties) { - this.latestPeriodConsumptions = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConsumptionReport latestPeriodConsumptions. - * @member {Object.} latestPeriodConsumptions - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport - * @instance - */ - ConsumptionReport.prototype.latestPeriodConsumptions = $util.emptyObject; - - /** - * Creates a new ConsumptionReport instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport} ConsumptionReport instance - */ - ConsumptionReport.create = function create(properties) { - return new ConsumptionReport(properties); - }; - - /** - * Encodes the specified ConsumptionReport message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport} message ConsumptionReport message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsumptionReport.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.latestPeriodConsumptions != null && Object.hasOwnProperty.call(message, "latestPeriodConsumptions")) - for (var keys = Object.keys(message.latestPeriodConsumptions), 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.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.encode(message.latestPeriodConsumptions[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - return writer; - }; - - /** - * Encodes the specified ConsumptionReport message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport} message ConsumptionReport message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsumptionReport.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConsumptionReport message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport} ConsumptionReport - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsumptionReport.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (message.latestPeriodConsumptions === $util.emptyObject) - message.latestPeriodConsumptions = {}; - 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.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.latestPeriodConsumptions[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConsumptionReport message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport} ConsumptionReport - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsumptionReport.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConsumptionReport message. - * @function verify - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConsumptionReport.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.latestPeriodConsumptions != null && message.hasOwnProperty("latestPeriodConsumptions")) { - if (!$util.isObject(message.latestPeriodConsumptions)) - return "latestPeriodConsumptions: object expected"; - var key = Object.keys(message.latestPeriodConsumptions); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.verify(message.latestPeriodConsumptions[key[i]]); - if (error) - return "latestPeriodConsumptions." + error; - } - } - return null; - }; - - /** - * Creates a ConsumptionReport message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport} ConsumptionReport - */ - ConsumptionReport.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport) - return object; - var message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport(); - if (object.latestPeriodConsumptions) { - if (typeof object.latestPeriodConsumptions !== "object") - throw TypeError(".google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.latestPeriodConsumptions: object expected"); - message.latestPeriodConsumptions = {}; - for (var keys = Object.keys(object.latestPeriodConsumptions), i = 0; i < keys.length; ++i) { - if (typeof object.latestPeriodConsumptions[keys[i]] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.latestPeriodConsumptions: object expected"); - message.latestPeriodConsumptions[keys[i]] = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.fromObject(object.latestPeriodConsumptions[keys[i]]); - } - } - return message; - }; - - /** - * Creates a plain object from a ConsumptionReport message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport} message ConsumptionReport - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConsumptionReport.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.latestPeriodConsumptions = {}; - var keys2; - if (message.latestPeriodConsumptions && (keys2 = Object.keys(message.latestPeriodConsumptions)).length) { - object.latestPeriodConsumptions = {}; - for (var j = 0; j < keys2.length; ++j) - object.latestPeriodConsumptions[keys2[j]] = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.toObject(message.latestPeriodConsumptions[keys2[j]], options); - } - return object; - }; - - /** - * Converts this ConsumptionReport to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport - * @instance - * @returns {Object.} JSON object - */ - ConsumptionReport.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ConsumptionReport - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ConsumptionReport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport"; - }; - - return ConsumptionReport; - })(); - - return UsageResourceAllowanceStatus; - })(); - - v1alpha.Notification = (function() { - - /** - * Properties of a Notification. - * @memberof google.cloud.batch.v1alpha - * @interface INotification - * @property {string|null} [pubsubTopic] Notification pubsubTopic - */ - - /** - * Constructs a new Notification. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a Notification. - * @implements INotification - * @constructor - * @param {google.cloud.batch.v1alpha.INotification=} [properties] Properties to set - */ - function Notification(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Notification pubsubTopic. - * @member {string} pubsubTopic - * @memberof google.cloud.batch.v1alpha.Notification - * @instance - */ - Notification.prototype.pubsubTopic = ""; - - /** - * Creates a new Notification instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.Notification - * @static - * @param {google.cloud.batch.v1alpha.INotification=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.Notification} Notification instance - */ - Notification.create = function create(properties) { - return new Notification(properties); - }; - - /** - * Encodes the specified Notification message. Does not implicitly {@link google.cloud.batch.v1alpha.Notification.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.Notification - * @static - * @param {google.cloud.batch.v1alpha.INotification} message Notification message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Notification.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pubsubTopic != null && Object.hasOwnProperty.call(message, "pubsubTopic")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.pubsubTopic); - return writer; - }; - - /** - * Encodes the specified Notification message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Notification.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.Notification - * @static - * @param {google.cloud.batch.v1alpha.INotification} message Notification message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Notification.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Notification message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.Notification - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.Notification} Notification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Notification.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Notification(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.pubsubTopic = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Notification message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.Notification - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.Notification} Notification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Notification.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Notification message. - * @function verify - * @memberof google.cloud.batch.v1alpha.Notification - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Notification.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) - if (!$util.isString(message.pubsubTopic)) - return "pubsubTopic: string expected"; - return null; - }; - - /** - * Creates a Notification message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.Notification - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.Notification} Notification - */ - Notification.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.Notification) - return object; - var message = new $root.google.cloud.batch.v1alpha.Notification(); - if (object.pubsubTopic != null) - message.pubsubTopic = String(object.pubsubTopic); - return message; - }; - - /** - * Creates a plain object from a Notification message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.Notification - * @static - * @param {google.cloud.batch.v1alpha.Notification} message Notification - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Notification.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.pubsubTopic = ""; - if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) - object.pubsubTopic = message.pubsubTopic; - return object; - }; - - /** - * Converts this Notification to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.Notification - * @instance - * @returns {Object.} JSON object - */ - Notification.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Notification - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.Notification - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Notification.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.Notification"; - }; - - return Notification; - })(); - - return v1alpha; - })(); - - return batch; - })(); - - return cloud; - })(); - - google.api = (function() { - - /** - * Namespace api. - * @memberof google - * @namespace - */ - var api = {}; - - api.Http = (function() { - - /** - * Properties of a Http. - * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion - */ - - /** - * Constructs a new Http. - * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp - * @constructor - * @param {google.api.IHttp=} [properties] Properties to set - */ - function Http(properties) { - this.rules = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http - * @instance - */ - Http.prototype.rules = $util.emptyArray; - - /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http - * @instance - */ - Http.prototype.fullyDecodeReservedExpansion = false; - - /** - * Creates a new Http instance using the specified properties. - * @function create - * @memberof google.api.Http - * @static - * @param {google.api.IHttp=} [properties] Properties to set - * @returns {google.api.Http} Http instance - */ - Http.create = function create(properties) { - return new Http(properties); - }; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encode - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rules != null && message.rules.length) - for (var i = 0; i < message.rules.length; ++i) - $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); - return writer; - }; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Http message from the specified reader or buffer. - * @function decode - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - } - case 2: { - message.fullyDecodeReservedExpansion = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Http message. - * @function verify - * @memberof google.api.Http - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Http.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.rules != null && message.hasOwnProperty("rules")) { - if (!Array.isArray(message.rules)) - return "rules: array expected"; - for (var i = 0; i < message.rules.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.rules[i]); - if (error) - return "rules." + error; - } - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - if (typeof message.fullyDecodeReservedExpansion !== "boolean") - return "fullyDecodeReservedExpansion: boolean expected"; - return null; - }; - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Http - * @static - * @param {Object.} object Plain object - * @returns {google.api.Http} Http - */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) - return object; - var message = new $root.google.api.Http(); - if (object.rules) { - if (!Array.isArray(object.rules)) - throw TypeError(".google.api.Http.rules: array expected"); - message.rules = []; - for (var i = 0; i < object.rules.length; ++i) { - if (typeof object.rules[i] !== "object") - throw TypeError(".google.api.Http.rules: object expected"); - message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); - } - } - if (object.fullyDecodeReservedExpansion != null) - message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); - return message; - }; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Http - * @static - * @param {google.api.Http} message Http - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Http.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.rules = []; - if (options.defaults) - object.fullyDecodeReservedExpansion = false; - if (message.rules && message.rules.length) { - object.rules = []; - for (var j = 0; j < message.rules.length; ++j) - object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; - return object; - }; - - /** - * Converts this Http to JSON. - * @function toJSON - * @memberof google.api.Http - * @instance - * @returns {Object.} JSON object - */ - Http.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Http - * @function getTypeUrl - * @memberof google.api.Http - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Http"; - }; - - return Http; - })(); - - api.HttpRule = (function() { - - /** - * Properties of a HttpRule. - * @memberof google.api - * @interface IHttpRule - * @property {string|null} [selector] HttpRule selector - * @property {string|null} [get] HttpRule get - * @property {string|null} [put] HttpRule put - * @property {string|null} [post] HttpRule post - * @property {string|null} ["delete"] HttpRule delete - * @property {string|null} [patch] HttpRule patch - * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom - * @property {string|null} [body] HttpRule body - * @property {string|null} [responseBody] HttpRule responseBody - * @property {Array.|null} [additionalBindings] HttpRule additionalBindings - */ - - /** - * Constructs a new HttpRule. - * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule - * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set - */ - function HttpRule(properties) { - this.additionalBindings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; - - /** - * HttpRule get. - * @member {string|null|undefined} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = null; - - /** - * HttpRule put. - * @member {string|null|undefined} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = null; - - /** - * HttpRule post. - * @member {string|null|undefined} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = null; - - /** - * HttpRule delete. - * @member {string|null|undefined} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = null; - - /** - * HttpRule patch. - * @member {string|null|undefined} patch - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.patch = null; - - /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.custom = null; - - /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.body = ""; - - /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.responseBody = ""; - - /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule - * @instance - */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new HttpRule instance using the specified properties. - * @function create - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance - */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); - }; - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encode - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && Object.hasOwnProperty.call(message, "get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && Object.hasOwnProperty.call(message, "put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && Object.hasOwnProperty.call(message, "post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) - $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.additionalBindings != null && message.additionalBindings.length) - for (var i = 0; i < message.additionalBindings.length; ++i) - $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); - return writer; - }; - - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @function decode - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.selector = reader.string(); - break; - } - case 2: { - message.get = reader.string(); - break; - } - case 3: { - message.put = reader.string(); - break; - } - case 4: { - message.post = reader.string(); - break; - } - case 5: { - message["delete"] = reader.string(); - break; - } - case 6: { - message.patch = reader.string(); - break; - } - case 8: { - message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); - break; - } - case 7: { - message.body = reader.string(); - break; - } - case 12: { - message.responseBody = reader.string(); - break; - } - case 11: { - if (!(message.additionalBindings && message.additionalBindings.length)) - message.additionalBindings = []; - message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HttpRule message. - * @function verify - * @memberof google.api.HttpRule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HttpRule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.get != null && message.hasOwnProperty("get")) { - properties.pattern = 1; - if (!$util.isString(message.get)) - return "get: string expected"; - } - if (message.put != null && message.hasOwnProperty("put")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.put)) - return "put: string expected"; - } - if (message.post != null && message.hasOwnProperty("post")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.post)) - return "post: string expected"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message["delete"])) - return "delete: string expected"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.patch)) - return "patch: string expected"; - } - if (message.custom != null && message.hasOwnProperty("custom")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - { - var error = $root.google.api.CustomHttpPattern.verify(message.custom); - if (error) - return "custom." + error; - } - } - if (message.body != null && message.hasOwnProperty("body")) - if (!$util.isString(message.body)) - return "body: string expected"; - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - if (!$util.isString(message.responseBody)) - return "responseBody: string expected"; - if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { - if (!Array.isArray(message.additionalBindings)) - return "additionalBindings: array expected"; - for (var i = 0; i < message.additionalBindings.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); - if (error) - return "additionalBindings." + error; - } - } - return null; - }; - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.HttpRule - * @static - * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule - */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) - return object; - var message = new $root.google.api.HttpRule(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.get != null) - message.get = String(object.get); - if (object.put != null) - message.put = String(object.put); - if (object.post != null) - message.post = String(object.post); - if (object["delete"] != null) - message["delete"] = String(object["delete"]); - if (object.patch != null) - message.patch = String(object.patch); - if (object.custom != null) { - if (typeof object.custom !== "object") - throw TypeError(".google.api.HttpRule.custom: object expected"); - message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); - } - if (object.body != null) - message.body = String(object.body); - if (object.responseBody != null) - message.responseBody = String(object.responseBody); - if (object.additionalBindings) { - if (!Array.isArray(object.additionalBindings)) - throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); - message.additionalBindings = []; - for (var i = 0; i < object.additionalBindings.length; ++i) { - if (typeof object.additionalBindings[i] !== "object") - throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); - message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.HttpRule - * @static - * @param {google.api.HttpRule} message HttpRule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HttpRule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.additionalBindings = []; - if (options.defaults) { - object.selector = ""; - object.body = ""; - object.responseBody = ""; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.get != null && message.hasOwnProperty("get")) { - object.get = message.get; - if (options.oneofs) - object.pattern = "get"; - } - if (message.put != null && message.hasOwnProperty("put")) { - object.put = message.put; - if (options.oneofs) - object.pattern = "put"; - } - if (message.post != null && message.hasOwnProperty("post")) { - object.post = message.post; - if (options.oneofs) - object.pattern = "post"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - object["delete"] = message["delete"]; - if (options.oneofs) - object.pattern = "delete"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - object.patch = message.patch; - if (options.oneofs) - object.pattern = "patch"; - } - if (message.body != null && message.hasOwnProperty("body")) - object.body = message.body; - if (message.custom != null && message.hasOwnProperty("custom")) { - object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); - if (options.oneofs) - object.pattern = "custom"; - } - if (message.additionalBindings && message.additionalBindings.length) { - object.additionalBindings = []; - for (var j = 0; j < message.additionalBindings.length; ++j) - object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); - } - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; - return object; - }; - - /** - * Converts this HttpRule to JSON. - * @function toJSON - * @memberof google.api.HttpRule - * @instance - * @returns {Object.} JSON object - */ - HttpRule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HttpRule - * @function getTypeUrl - * @memberof google.api.HttpRule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.HttpRule"; - }; - - return HttpRule; - })(); - - api.CustomHttpPattern = (function() { - - /** - * Properties of a CustomHttpPattern. - * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path - */ - - /** - * Constructs a new CustomHttpPattern. - * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern - * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - */ - function CustomHttpPattern(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.kind = ""; - - /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.path = ""; - - /** - * Creates a new CustomHttpPattern instance using the specified properties. - * @function create - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance - */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); - }; - - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encode - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); - return writer; - }; - - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @function decode - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.kind = reader.string(); - break; - } - case 2: { - message.path = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CustomHttpPattern message. - * @function verify - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CustomHttpPattern.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - if (!$util.isString(message.kind)) - return "kind: string expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; - return null; - }; - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) - return object; - var message = new $root.google.api.CustomHttpPattern(); - if (object.kind != null) - message.kind = String(object.kind); - if (object.path != null) - message.path = String(object.path); - return message; - }; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomHttpPattern.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.kind = ""; - object.path = ""; - } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - return object; - }; - - /** - * Converts this CustomHttpPattern to JSON. - * @function toJSON - * @memberof google.api.CustomHttpPattern - * @instance - * @returns {Object.} JSON object - */ - CustomHttpPattern.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CustomHttpPattern - * @function getTypeUrl - * @memberof google.api.CustomHttpPattern - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CustomHttpPattern"; - }; - - return CustomHttpPattern; - })(); - - api.CommonLanguageSettings = (function() { - - /** - * Properties of a CommonLanguageSettings. - * @memberof google.api - * @interface ICommonLanguageSettings - * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri - * @property {Array.|null} [destinations] CommonLanguageSettings destinations - */ - - /** - * Constructs a new CommonLanguageSettings. - * @memberof google.api - * @classdesc Represents a CommonLanguageSettings. - * @implements ICommonLanguageSettings - * @constructor - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set - */ - function CommonLanguageSettings(properties) { - this.destinations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CommonLanguageSettings referenceDocsUri. - * @member {string} referenceDocsUri - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.referenceDocsUri = ""; - - /** - * CommonLanguageSettings destinations. - * @member {Array.} destinations - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.destinations = $util.emptyArray; - - /** - * Creates a new CommonLanguageSettings instance using the specified properties. - * @function create - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance - */ - CommonLanguageSettings.create = function create(properties) { - return new CommonLanguageSettings(properties); - }; - - /** - * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @function encode - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonLanguageSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); - if (message.destinations != null && message.destinations.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.destinations.length; ++i) - writer.int32(message.destinations[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.CommonLanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonLanguageSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.referenceDocsUri = reader.string(); - break; - } - case 2: { - if (!(message.destinations && message.destinations.length)) - message.destinations = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.destinations.push(reader.int32()); - } else - message.destinations.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CommonLanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CommonLanguageSettings message. - * @function verify - * @memberof google.api.CommonLanguageSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CommonLanguageSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) - if (!$util.isString(message.referenceDocsUri)) - return "referenceDocsUri: string expected"; - if (message.destinations != null && message.hasOwnProperty("destinations")) { - if (!Array.isArray(message.destinations)) - return "destinations: array expected"; - for (var i = 0; i < message.destinations.length; ++i) - switch (message.destinations[i]) { - default: - return "destinations: enum value[] expected"; - case 0: - case 10: - case 20: - break; - } - } - return null; - }; - - /** - * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CommonLanguageSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - */ - CommonLanguageSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CommonLanguageSettings) - return object; - var message = new $root.google.api.CommonLanguageSettings(); - if (object.referenceDocsUri != null) - message.referenceDocsUri = String(object.referenceDocsUri); - if (object.destinations) { - if (!Array.isArray(object.destinations)) - throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); - message.destinations = []; - for (var i = 0; i < object.destinations.length; ++i) - switch (object.destinations[i]) { - default: - if (typeof object.destinations[i] === "number") { - message.destinations[i] = object.destinations[i]; - break; - } - case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": - case 0: - message.destinations[i] = 0; - break; - case "GITHUB": - case 10: - message.destinations[i] = 10; - break; - case "PACKAGE_MANAGER": - case 20: - message.destinations[i] = 20; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CommonLanguageSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.destinations = []; - if (options.defaults) - object.referenceDocsUri = ""; - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) - object.referenceDocsUri = message.referenceDocsUri; - if (message.destinations && message.destinations.length) { - object.destinations = []; - for (var j = 0; j < message.destinations.length; ++j) - object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; - } - return object; - }; - - /** - * Converts this CommonLanguageSettings to JSON. - * @function toJSON - * @memberof google.api.CommonLanguageSettings - * @instance - * @returns {Object.} JSON object - */ - CommonLanguageSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CommonLanguageSettings - * @function getTypeUrl - * @memberof google.api.CommonLanguageSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CommonLanguageSettings"; - }; - - return CommonLanguageSettings; - })(); - - api.ClientLibrarySettings = (function() { - - /** - * Properties of a ClientLibrarySettings. - * @memberof google.api - * @interface IClientLibrarySettings - * @property {string|null} [version] ClientLibrarySettings version - * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage - * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums - * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings - * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings - * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings - * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings - * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings - * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings - * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings - * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings - */ - - /** - * Constructs a new ClientLibrarySettings. - * @memberof google.api - * @classdesc Represents a ClientLibrarySettings. - * @implements IClientLibrarySettings - * @constructor - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - */ - function ClientLibrarySettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientLibrarySettings version. - * @member {string} version - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.version = ""; - - /** - * ClientLibrarySettings launchStage. - * @member {google.api.LaunchStage} launchStage - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.launchStage = 0; - - /** - * ClientLibrarySettings restNumericEnums. - * @member {boolean} restNumericEnums - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.restNumericEnums = false; - - /** - * ClientLibrarySettings javaSettings. - * @member {google.api.IJavaSettings|null|undefined} javaSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.javaSettings = null; - - /** - * ClientLibrarySettings cppSettings. - * @member {google.api.ICppSettings|null|undefined} cppSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.cppSettings = null; - - /** - * ClientLibrarySettings phpSettings. - * @member {google.api.IPhpSettings|null|undefined} phpSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.phpSettings = null; - - /** - * ClientLibrarySettings pythonSettings. - * @member {google.api.IPythonSettings|null|undefined} pythonSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.pythonSettings = null; - - /** - * ClientLibrarySettings nodeSettings. - * @member {google.api.INodeSettings|null|undefined} nodeSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.nodeSettings = null; - - /** - * ClientLibrarySettings dotnetSettings. - * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.dotnetSettings = null; - - /** - * ClientLibrarySettings rubySettings. - * @member {google.api.IRubySettings|null|undefined} rubySettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.rubySettings = null; - - /** - * ClientLibrarySettings goSettings. - * @member {google.api.IGoSettings|null|undefined} goSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.goSettings = null; - - /** - * Creates a new ClientLibrarySettings instance using the specified properties. - * @function create - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance - */ - ClientLibrarySettings.create = function create(properties) { - return new ClientLibrarySettings(properties); - }; - - /** - * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @function encode - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientLibrarySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); - if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); - if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) - $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) - $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) - $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) - $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) - $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); - if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) - $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) - $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) - $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.ClientLibrarySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientLibrarySettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.version = reader.string(); - break; - } - case 2: { - message.launchStage = reader.int32(); - break; - } - case 3: { - message.restNumericEnums = reader.bool(); - break; - } - case 21: { - message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); - break; - } - case 22: { - message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); - break; - } - case 23: { - message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); - break; - } - case 24: { - message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); - break; - } - case 25: { - message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); - break; - } - case 26: { - message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); - break; - } - case 27: { - message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); - break; - } - case 28: { - message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ClientLibrarySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientLibrarySettings message. - * @function verify - * @memberof google.api.ClientLibrarySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientLibrarySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - switch (message.launchStage) { - default: - return "launchStage: enum value expected"; - case 0: - case 6: - case 7: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) - if (typeof message.restNumericEnums !== "boolean") - return "restNumericEnums: boolean expected"; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { - var error = $root.google.api.JavaSettings.verify(message.javaSettings); - if (error) - return "javaSettings." + error; - } - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { - var error = $root.google.api.CppSettings.verify(message.cppSettings); - if (error) - return "cppSettings." + error; - } - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { - var error = $root.google.api.PhpSettings.verify(message.phpSettings); - if (error) - return "phpSettings." + error; - } - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { - var error = $root.google.api.PythonSettings.verify(message.pythonSettings); - if (error) - return "pythonSettings." + error; - } - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { - var error = $root.google.api.NodeSettings.verify(message.nodeSettings); - if (error) - return "nodeSettings." + error; - } - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { - var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); - if (error) - return "dotnetSettings." + error; - } - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { - var error = $root.google.api.RubySettings.verify(message.rubySettings); - if (error) - return "rubySettings." + error; - } - if (message.goSettings != null && message.hasOwnProperty("goSettings")) { - var error = $root.google.api.GoSettings.verify(message.goSettings); - if (error) - return "goSettings." + error; - } - return null; - }; - - /** - * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ClientLibrarySettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - */ - ClientLibrarySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ClientLibrarySettings) - return object; - var message = new $root.google.api.ClientLibrarySettings(); - if (object.version != null) - message.version = String(object.version); - switch (object.launchStage) { - default: - if (typeof object.launchStage === "number") { - message.launchStage = object.launchStage; - break; - } - break; - case "LAUNCH_STAGE_UNSPECIFIED": - case 0: - message.launchStage = 0; - break; - case "UNIMPLEMENTED": - case 6: - message.launchStage = 6; - break; - case "PRELAUNCH": - case 7: - message.launchStage = 7; - break; - case "EARLY_ACCESS": - case 1: - message.launchStage = 1; - break; - case "ALPHA": - case 2: - message.launchStage = 2; - break; - case "BETA": - case 3: - message.launchStage = 3; - break; - case "GA": - case 4: - message.launchStage = 4; - break; - case "DEPRECATED": - case 5: - message.launchStage = 5; - break; - } - if (object.restNumericEnums != null) - message.restNumericEnums = Boolean(object.restNumericEnums); - if (object.javaSettings != null) { - if (typeof object.javaSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); - message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); - } - if (object.cppSettings != null) { - if (typeof object.cppSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); - message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); - } - if (object.phpSettings != null) { - if (typeof object.phpSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); - message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); - } - if (object.pythonSettings != null) { - if (typeof object.pythonSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); - message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); - } - if (object.nodeSettings != null) { - if (typeof object.nodeSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); - message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); - } - if (object.dotnetSettings != null) { - if (typeof object.dotnetSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); - message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); - } - if (object.rubySettings != null) { - if (typeof object.rubySettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); - message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); - } - if (object.goSettings != null) { - if (typeof object.goSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); - message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); - } - return message; - }; - - /** - * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientLibrarySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.version = ""; - object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - object.restNumericEnums = false; - object.javaSettings = null; - object.cppSettings = null; - object.phpSettings = null; - object.pythonSettings = null; - object.nodeSettings = null; - object.dotnetSettings = null; - object.rubySettings = null; - object.goSettings = null; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) - object.restNumericEnums = message.restNumericEnums; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) - object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) - object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) - object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) - object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) - object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) - object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) - object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); - if (message.goSettings != null && message.hasOwnProperty("goSettings")) - object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); - return object; - }; - - /** - * Converts this ClientLibrarySettings to JSON. - * @function toJSON - * @memberof google.api.ClientLibrarySettings - * @instance - * @returns {Object.} JSON object - */ - ClientLibrarySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClientLibrarySettings - * @function getTypeUrl - * @memberof google.api.ClientLibrarySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ClientLibrarySettings"; - }; - - return ClientLibrarySettings; - })(); - - api.Publishing = (function() { - - /** - * Properties of a Publishing. - * @memberof google.api - * @interface IPublishing - * @property {Array.|null} [methodSettings] Publishing methodSettings - * @property {string|null} [newIssueUri] Publishing newIssueUri - * @property {string|null} [documentationUri] Publishing documentationUri - * @property {string|null} [apiShortName] Publishing apiShortName - * @property {string|null} [githubLabel] Publishing githubLabel - * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams - * @property {string|null} [docTagPrefix] Publishing docTagPrefix - * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization - * @property {Array.|null} [librarySettings] Publishing librarySettings - * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri - * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri - */ - - /** - * Constructs a new Publishing. - * @memberof google.api - * @classdesc Represents a Publishing. - * @implements IPublishing - * @constructor - * @param {google.api.IPublishing=} [properties] Properties to set - */ - function Publishing(properties) { - this.methodSettings = []; - this.codeownerGithubTeams = []; - this.librarySettings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Publishing methodSettings. - * @member {Array.} methodSettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.methodSettings = $util.emptyArray; - - /** - * Publishing newIssueUri. - * @member {string} newIssueUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.newIssueUri = ""; - - /** - * Publishing documentationUri. - * @member {string} documentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.documentationUri = ""; - - /** - * Publishing apiShortName. - * @member {string} apiShortName - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.apiShortName = ""; - - /** - * Publishing githubLabel. - * @member {string} githubLabel - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.githubLabel = ""; - - /** - * Publishing codeownerGithubTeams. - * @member {Array.} codeownerGithubTeams - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.codeownerGithubTeams = $util.emptyArray; - - /** - * Publishing docTagPrefix. - * @member {string} docTagPrefix - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.docTagPrefix = ""; - - /** - * Publishing organization. - * @member {google.api.ClientLibraryOrganization} organization - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.organization = 0; - - /** - * Publishing librarySettings. - * @member {Array.} librarySettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.librarySettings = $util.emptyArray; - - /** - * Publishing protoReferenceDocumentationUri. - * @member {string} protoReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.protoReferenceDocumentationUri = ""; - - /** - * Publishing restReferenceDocumentationUri. - * @member {string} restReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.restReferenceDocumentationUri = ""; - - /** - * Creates a new Publishing instance using the specified properties. - * @function create - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing=} [properties] Properties to set - * @returns {google.api.Publishing} Publishing instance - */ - Publishing.create = function create(properties) { - return new Publishing(properties); - }; - - /** - * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @function encode - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing} message Publishing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Publishing.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.methodSettings != null && message.methodSettings.length) - for (var i = 0; i < message.methodSettings.length; ++i) - $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) - writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); - if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) - writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); - if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) - writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); - if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) - writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); - if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) - for (var i = 0; i < message.codeownerGithubTeams.length; ++i) - writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); - if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) - writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); - if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) - writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); - if (message.librarySettings != null && message.librarySettings.length) - for (var i = 0; i < message.librarySettings.length; ++i) - $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); - if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) - writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); - if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) - writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); - return writer; - }; - - /** - * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing} message Publishing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Publishing.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Publishing message from the specified reader or buffer. - * @function decode - * @memberof google.api.Publishing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Publishing} Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Publishing.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - if (!(message.methodSettings && message.methodSettings.length)) - message.methodSettings = []; - message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); - break; - } - case 101: { - message.newIssueUri = reader.string(); - break; - } - case 102: { - message.documentationUri = reader.string(); - break; - } - case 103: { - message.apiShortName = reader.string(); - break; - } - case 104: { - message.githubLabel = reader.string(); - break; - } - case 105: { - if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) - message.codeownerGithubTeams = []; - message.codeownerGithubTeams.push(reader.string()); - break; - } - case 106: { - message.docTagPrefix = reader.string(); - break; - } - case 107: { - message.organization = reader.int32(); - break; - } - case 109: { - if (!(message.librarySettings && message.librarySettings.length)) - message.librarySettings = []; - message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); - break; - } - case 110: { - message.protoReferenceDocumentationUri = reader.string(); - break; - } - case 111: { - message.restReferenceDocumentationUri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Publishing message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Publishing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Publishing} Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Publishing.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Publishing message. - * @function verify - * @memberof google.api.Publishing - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Publishing.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { - if (!Array.isArray(message.methodSettings)) - return "methodSettings: array expected"; - for (var i = 0; i < message.methodSettings.length; ++i) { - var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); - if (error) - return "methodSettings." + error; - } - } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) - if (!$util.isString(message.newIssueUri)) - return "newIssueUri: string expected"; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - if (!$util.isString(message.documentationUri)) - return "documentationUri: string expected"; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) - if (!$util.isString(message.apiShortName)) - return "apiShortName: string expected"; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) - if (!$util.isString(message.githubLabel)) - return "githubLabel: string expected"; - if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { - if (!Array.isArray(message.codeownerGithubTeams)) - return "codeownerGithubTeams: array expected"; - for (var i = 0; i < message.codeownerGithubTeams.length; ++i) - if (!$util.isString(message.codeownerGithubTeams[i])) - return "codeownerGithubTeams: string[] expected"; - } - if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) - if (!$util.isString(message.docTagPrefix)) - return "docTagPrefix: string expected"; - if (message.organization != null && message.hasOwnProperty("organization")) - switch (message.organization) { - default: - return "organization: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { - if (!Array.isArray(message.librarySettings)) - return "librarySettings: array expected"; - for (var i = 0; i < message.librarySettings.length; ++i) { - var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); - if (error) - return "librarySettings." + error; - } - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - if (!$util.isString(message.protoReferenceDocumentationUri)) - return "protoReferenceDocumentationUri: string expected"; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - if (!$util.isString(message.restReferenceDocumentationUri)) - return "restReferenceDocumentationUri: string expected"; - return null; - }; - - /** - * Creates a Publishing message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Publishing - * @static - * @param {Object.} object Plain object - * @returns {google.api.Publishing} Publishing - */ - Publishing.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Publishing) - return object; - var message = new $root.google.api.Publishing(); - if (object.methodSettings) { - if (!Array.isArray(object.methodSettings)) - throw TypeError(".google.api.Publishing.methodSettings: array expected"); - message.methodSettings = []; - for (var i = 0; i < object.methodSettings.length; ++i) { - if (typeof object.methodSettings[i] !== "object") - throw TypeError(".google.api.Publishing.methodSettings: object expected"); - message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); - } - } - if (object.newIssueUri != null) - message.newIssueUri = String(object.newIssueUri); - if (object.documentationUri != null) - message.documentationUri = String(object.documentationUri); - if (object.apiShortName != null) - message.apiShortName = String(object.apiShortName); - if (object.githubLabel != null) - message.githubLabel = String(object.githubLabel); - if (object.codeownerGithubTeams) { - if (!Array.isArray(object.codeownerGithubTeams)) - throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); - message.codeownerGithubTeams = []; - for (var i = 0; i < object.codeownerGithubTeams.length; ++i) - message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); - } - if (object.docTagPrefix != null) - message.docTagPrefix = String(object.docTagPrefix); - switch (object.organization) { - default: - if (typeof object.organization === "number") { - message.organization = object.organization; - break; - } - break; - case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": - case 0: - message.organization = 0; - break; - case "CLOUD": - case 1: - message.organization = 1; - break; - case "ADS": - case 2: - message.organization = 2; - break; - case "PHOTOS": - case 3: - message.organization = 3; - break; - case "STREET_VIEW": - case 4: - message.organization = 4; - break; - case "SHOPPING": - case 5: - message.organization = 5; - break; - case "GEO": - case 6: - message.organization = 6; - break; - case "GENERATIVE_AI": - case 7: - message.organization = 7; - break; - } - if (object.librarySettings) { - if (!Array.isArray(object.librarySettings)) - throw TypeError(".google.api.Publishing.librarySettings: array expected"); - message.librarySettings = []; - for (var i = 0; i < object.librarySettings.length; ++i) { - if (typeof object.librarySettings[i] !== "object") - throw TypeError(".google.api.Publishing.librarySettings: object expected"); - message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); - } - } - if (object.protoReferenceDocumentationUri != null) - message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); - if (object.restReferenceDocumentationUri != null) - message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); - return message; - }; - - /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Publishing - * @static - * @param {google.api.Publishing} message Publishing - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Publishing.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.methodSettings = []; - object.codeownerGithubTeams = []; - object.librarySettings = []; - } - if (options.defaults) { - object.newIssueUri = ""; - object.documentationUri = ""; - object.apiShortName = ""; - object.githubLabel = ""; - object.docTagPrefix = ""; - object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; - object.protoReferenceDocumentationUri = ""; - object.restReferenceDocumentationUri = ""; - } - if (message.methodSettings && message.methodSettings.length) { - object.methodSettings = []; - for (var j = 0; j < message.methodSettings.length; ++j) - object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); - } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) - object.newIssueUri = message.newIssueUri; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - object.documentationUri = message.documentationUri; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) - object.apiShortName = message.apiShortName; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) - object.githubLabel = message.githubLabel; - if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { - object.codeownerGithubTeams = []; - for (var j = 0; j < message.codeownerGithubTeams.length; ++j) - object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; - } - if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) - object.docTagPrefix = message.docTagPrefix; - if (message.organization != null && message.hasOwnProperty("organization")) - object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; - if (message.librarySettings && message.librarySettings.length) { - object.librarySettings = []; - for (var j = 0; j < message.librarySettings.length; ++j) - object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; - return object; - }; - - /** - * Converts this Publishing to JSON. - * @function toJSON - * @memberof google.api.Publishing - * @instance - * @returns {Object.} JSON object - */ - Publishing.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Publishing - * @function getTypeUrl - * @memberof google.api.Publishing - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Publishing"; - }; - - return Publishing; - })(); - - api.JavaSettings = (function() { - - /** - * Properties of a JavaSettings. - * @memberof google.api - * @interface IJavaSettings - * @property {string|null} [libraryPackage] JavaSettings libraryPackage - * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames - * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common - */ - - /** - * Constructs a new JavaSettings. - * @memberof google.api - * @classdesc Represents a JavaSettings. - * @implements IJavaSettings - * @constructor - * @param {google.api.IJavaSettings=} [properties] Properties to set - */ - function JavaSettings(properties) { - this.serviceClassNames = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * JavaSettings libraryPackage. - * @member {string} libraryPackage - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.libraryPackage = ""; - - /** - * JavaSettings serviceClassNames. - * @member {Object.} serviceClassNames - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.serviceClassNames = $util.emptyObject; - - /** - * JavaSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.common = null; - - /** - * Creates a new JavaSettings instance using the specified properties. - * @function create - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings=} [properties] Properties to set - * @returns {google.api.JavaSettings} JavaSettings instance - */ - JavaSettings.create = function create(properties) { - return new JavaSettings(properties); - }; - - /** - * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @function encode - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JavaSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); - if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) - for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a JavaSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.JavaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.JavaSettings} JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JavaSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.libraryPackage = reader.string(); - break; - } - case 2: { - if (message.serviceClassNames === $util.emptyObject) - message.serviceClassNames = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.serviceClassNames[key] = value; - break; - } - case 3: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a JavaSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.JavaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.JavaSettings} JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JavaSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a JavaSettings message. - * @function verify - * @memberof google.api.JavaSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - JavaSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) - if (!$util.isString(message.libraryPackage)) - return "libraryPackage: string expected"; - if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { - if (!$util.isObject(message.serviceClassNames)) - return "serviceClassNames: object expected"; - var key = Object.keys(message.serviceClassNames); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.serviceClassNames[key[i]])) - return "serviceClassNames: string{k:string} expected"; - } - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.JavaSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.JavaSettings} JavaSettings - */ - JavaSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.JavaSettings) - return object; - var message = new $root.google.api.JavaSettings(); - if (object.libraryPackage != null) - message.libraryPackage = String(object.libraryPackage); - if (object.serviceClassNames) { - if (typeof object.serviceClassNames !== "object") - throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); - message.serviceClassNames = {}; - for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) - message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); - } - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.JavaSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.JavaSettings - * @static - * @param {google.api.JavaSettings} message JavaSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - JavaSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.serviceClassNames = {}; - if (options.defaults) { - object.libraryPackage = ""; - object.common = null; - } - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) - object.libraryPackage = message.libraryPackage; - var keys2; - if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { - object.serviceClassNames = {}; - for (var j = 0; j < keys2.length; ++j) - object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; - } - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this JavaSettings to JSON. - * @function toJSON - * @memberof google.api.JavaSettings - * @instance - * @returns {Object.} JSON object - */ - JavaSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for JavaSettings - * @function getTypeUrl - * @memberof google.api.JavaSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.JavaSettings"; - }; - - return JavaSettings; - })(); - - api.CppSettings = (function() { - - /** - * Properties of a CppSettings. - * @memberof google.api - * @interface ICppSettings - * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common - */ - - /** - * Constructs a new CppSettings. - * @memberof google.api - * @classdesc Represents a CppSettings. - * @implements ICppSettings - * @constructor - * @param {google.api.ICppSettings=} [properties] Properties to set - */ - function CppSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CppSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.CppSettings - * @instance - */ - CppSettings.prototype.common = null; - - /** - * Creates a new CppSettings instance using the specified properties. - * @function create - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings=} [properties] Properties to set - * @returns {google.api.CppSettings} CppSettings instance - */ - CppSettings.create = function create(properties) { - return new CppSettings(properties); - }; - - /** - * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @function encode - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings} message CppSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CppSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings} message CppSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CppSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CppSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.CppSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CppSettings} CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CppSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CppSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CppSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CppSettings} CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CppSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CppSettings message. - * @function verify - * @memberof google.api.CppSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CppSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CppSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CppSettings} CppSettings - */ - CppSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CppSettings) - return object; - var message = new $root.google.api.CppSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.CppSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a CppSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CppSettings - * @static - * @param {google.api.CppSettings} message CppSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CppSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this CppSettings to JSON. - * @function toJSON - * @memberof google.api.CppSettings - * @instance - * @returns {Object.} JSON object - */ - CppSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CppSettings - * @function getTypeUrl - * @memberof google.api.CppSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CppSettings"; - }; - - return CppSettings; - })(); - - api.PhpSettings = (function() { - - /** - * Properties of a PhpSettings. - * @memberof google.api - * @interface IPhpSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common - */ - - /** - * Constructs a new PhpSettings. - * @memberof google.api - * @classdesc Represents a PhpSettings. - * @implements IPhpSettings - * @constructor - * @param {google.api.IPhpSettings=} [properties] Properties to set - */ - function PhpSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PhpSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PhpSettings - * @instance - */ - PhpSettings.prototype.common = null; - - /** - * Creates a new PhpSettings instance using the specified properties. - * @function create - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings=} [properties] Properties to set - * @returns {google.api.PhpSettings} PhpSettings instance - */ - PhpSettings.create = function create(properties) { - return new PhpSettings(properties); - }; - - /** - * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @function encode - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhpSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PhpSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.PhpSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PhpSettings} PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhpSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PhpSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PhpSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PhpSettings} PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhpSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PhpSettings message. - * @function verify - * @memberof google.api.PhpSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PhpSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PhpSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PhpSettings} PhpSettings - */ - PhpSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PhpSettings) - return object; - var message = new $root.google.api.PhpSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PhpSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PhpSettings - * @static - * @param {google.api.PhpSettings} message PhpSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PhpSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this PhpSettings to JSON. - * @function toJSON - * @memberof google.api.PhpSettings - * @instance - * @returns {Object.} JSON object - */ - PhpSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PhpSettings - * @function getTypeUrl - * @memberof google.api.PhpSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PhpSettings"; - }; - - return PhpSettings; - })(); - - api.PythonSettings = (function() { - - /** - * Properties of a PythonSettings. - * @memberof google.api - * @interface IPythonSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common - */ - - /** - * Constructs a new PythonSettings. - * @memberof google.api - * @classdesc Represents a PythonSettings. - * @implements IPythonSettings - * @constructor - * @param {google.api.IPythonSettings=} [properties] Properties to set - */ - function PythonSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PythonSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PythonSettings - * @instance - */ - PythonSettings.prototype.common = null; - - /** - * Creates a new PythonSettings instance using the specified properties. - * @function create - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings=} [properties] Properties to set - * @returns {google.api.PythonSettings} PythonSettings instance - */ - PythonSettings.create = function create(properties) { - return new PythonSettings(properties); - }; - - /** - * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @function encode - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PythonSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.PythonSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PythonSettings} PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PythonSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PythonSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PythonSettings} PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PythonSettings message. - * @function verify - * @memberof google.api.PythonSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PythonSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PythonSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PythonSettings} PythonSettings - */ - PythonSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PythonSettings) - return object; - var message = new $root.google.api.PythonSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PythonSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PythonSettings - * @static - * @param {google.api.PythonSettings} message PythonSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PythonSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this PythonSettings to JSON. - * @function toJSON - * @memberof google.api.PythonSettings - * @instance - * @returns {Object.} JSON object - */ - PythonSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PythonSettings - * @function getTypeUrl - * @memberof google.api.PythonSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PythonSettings"; - }; - - return PythonSettings; - })(); - - api.NodeSettings = (function() { - - /** - * Properties of a NodeSettings. - * @memberof google.api - * @interface INodeSettings - * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common - */ - - /** - * Constructs a new NodeSettings. - * @memberof google.api - * @classdesc Represents a NodeSettings. - * @implements INodeSettings - * @constructor - * @param {google.api.INodeSettings=} [properties] Properties to set - */ - function NodeSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NodeSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.NodeSettings - * @instance - */ - NodeSettings.prototype.common = null; - - /** - * Creates a new NodeSettings instance using the specified properties. - * @function create - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings=} [properties] Properties to set - * @returns {google.api.NodeSettings} NodeSettings instance - */ - NodeSettings.create = function create(properties) { - return new NodeSettings(properties); - }; - - /** - * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @function encode - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NodeSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.NodeSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.NodeSettings} NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NodeSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.NodeSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.NodeSettings} NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NodeSettings message. - * @function verify - * @memberof google.api.NodeSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NodeSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.NodeSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.NodeSettings} NodeSettings - */ - NodeSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.NodeSettings) - return object; - var message = new $root.google.api.NodeSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.NodeSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.NodeSettings - * @static - * @param {google.api.NodeSettings} message NodeSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NodeSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this NodeSettings to JSON. - * @function toJSON - * @memberof google.api.NodeSettings - * @instance - * @returns {Object.} JSON object - */ - NodeSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NodeSettings - * @function getTypeUrl - * @memberof google.api.NodeSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.NodeSettings"; - }; - - return NodeSettings; - })(); - - api.DotnetSettings = (function() { - - /** - * Properties of a DotnetSettings. - * @memberof google.api - * @interface IDotnetSettings - * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common - * @property {Object.|null} [renamedServices] DotnetSettings renamedServices - * @property {Object.|null} [renamedResources] DotnetSettings renamedResources - * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources - * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases - * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures - */ - - /** - * Constructs a new DotnetSettings. - * @memberof google.api - * @classdesc Represents a DotnetSettings. - * @implements IDotnetSettings - * @constructor - * @param {google.api.IDotnetSettings=} [properties] Properties to set - */ - function DotnetSettings(properties) { - this.renamedServices = {}; - this.renamedResources = {}; - this.ignoredResources = []; - this.forcedNamespaceAliases = []; - this.handwrittenSignatures = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DotnetSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.common = null; - - /** - * DotnetSettings renamedServices. - * @member {Object.} renamedServices - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedServices = $util.emptyObject; - - /** - * DotnetSettings renamedResources. - * @member {Object.} renamedResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedResources = $util.emptyObject; - - /** - * DotnetSettings ignoredResources. - * @member {Array.} ignoredResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.ignoredResources = $util.emptyArray; - - /** - * DotnetSettings forcedNamespaceAliases. - * @member {Array.} forcedNamespaceAliases - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; - - /** - * DotnetSettings handwrittenSignatures. - * @member {Array.} handwrittenSignatures - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; - - /** - * Creates a new DotnetSettings instance using the specified properties. - * @function create - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings=} [properties] Properties to set - * @returns {google.api.DotnetSettings} DotnetSettings instance - */ - DotnetSettings.create = function create(properties) { - return new DotnetSettings(properties); - }; - - /** - * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @function encode - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DotnetSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) - for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); - if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) - for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); - if (message.ignoredResources != null && message.ignoredResources.length) - for (var i = 0; i < message.ignoredResources.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); - if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); - if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); - return writer; - }; - - /** - * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.DotnetSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.DotnetSettings} DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DotnetSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - case 2: { - if (message.renamedServices === $util.emptyObject) - message.renamedServices = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.renamedServices[key] = value; - break; - } - case 3: { - if (message.renamedResources === $util.emptyObject) - message.renamedResources = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.renamedResources[key] = value; - break; - } - case 4: { - if (!(message.ignoredResources && message.ignoredResources.length)) - message.ignoredResources = []; - message.ignoredResources.push(reader.string()); - break; - } - case 5: { - if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) - message.forcedNamespaceAliases = []; - message.forcedNamespaceAliases.push(reader.string()); - break; - } - case 6: { - if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) - message.handwrittenSignatures = []; - message.handwrittenSignatures.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.DotnetSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.DotnetSettings} DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DotnetSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DotnetSettings message. - * @function verify - * @memberof google.api.DotnetSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DotnetSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { - if (!$util.isObject(message.renamedServices)) - return "renamedServices: object expected"; - var key = Object.keys(message.renamedServices); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedServices[key[i]])) - return "renamedServices: string{k:string} expected"; - } - if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { - if (!$util.isObject(message.renamedResources)) - return "renamedResources: object expected"; - var key = Object.keys(message.renamedResources); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedResources[key[i]])) - return "renamedResources: string{k:string} expected"; - } - if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { - if (!Array.isArray(message.ignoredResources)) - return "ignoredResources: array expected"; - for (var i = 0; i < message.ignoredResources.length; ++i) - if (!$util.isString(message.ignoredResources[i])) - return "ignoredResources: string[] expected"; - } - if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { - if (!Array.isArray(message.forcedNamespaceAliases)) - return "forcedNamespaceAliases: array expected"; - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - if (!$util.isString(message.forcedNamespaceAliases[i])) - return "forcedNamespaceAliases: string[] expected"; - } - if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { - if (!Array.isArray(message.handwrittenSignatures)) - return "handwrittenSignatures: array expected"; - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - if (!$util.isString(message.handwrittenSignatures[i])) - return "handwrittenSignatures: string[] expected"; - } - return null; - }; - - /** - * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.DotnetSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.DotnetSettings} DotnetSettings - */ - DotnetSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.DotnetSettings) - return object; - var message = new $root.google.api.DotnetSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.DotnetSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - if (object.renamedServices) { - if (typeof object.renamedServices !== "object") - throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); - message.renamedServices = {}; - for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) - message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); - } - if (object.renamedResources) { - if (typeof object.renamedResources !== "object") - throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); - message.renamedResources = {}; - for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) - message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); - } - if (object.ignoredResources) { - if (!Array.isArray(object.ignoredResources)) - throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); - message.ignoredResources = []; - for (var i = 0; i < object.ignoredResources.length; ++i) - message.ignoredResources[i] = String(object.ignoredResources[i]); - } - if (object.forcedNamespaceAliases) { - if (!Array.isArray(object.forcedNamespaceAliases)) - throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); - message.forcedNamespaceAliases = []; - for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) - message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); - } - if (object.handwrittenSignatures) { - if (!Array.isArray(object.handwrittenSignatures)) - throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); - message.handwrittenSignatures = []; - for (var i = 0; i < object.handwrittenSignatures.length; ++i) - message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); - } - return message; - }; - - /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.DotnetSettings} message DotnetSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DotnetSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.ignoredResources = []; - object.forcedNamespaceAliases = []; - object.handwrittenSignatures = []; - } - if (options.objects || options.defaults) { - object.renamedServices = {}; - object.renamedResources = {}; - } - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - var keys2; - if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { - object.renamedServices = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; - } - if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { - object.renamedResources = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; - } - if (message.ignoredResources && message.ignoredResources.length) { - object.ignoredResources = []; - for (var j = 0; j < message.ignoredResources.length; ++j) - object.ignoredResources[j] = message.ignoredResources[j]; - } - if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { - object.forcedNamespaceAliases = []; - for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) - object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; - } - if (message.handwrittenSignatures && message.handwrittenSignatures.length) { - object.handwrittenSignatures = []; - for (var j = 0; j < message.handwrittenSignatures.length; ++j) - object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; - } - return object; - }; - - /** - * Converts this DotnetSettings to JSON. - * @function toJSON - * @memberof google.api.DotnetSettings - * @instance - * @returns {Object.} JSON object - */ - DotnetSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DotnetSettings - * @function getTypeUrl - * @memberof google.api.DotnetSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.DotnetSettings"; - }; - - return DotnetSettings; - })(); - - api.RubySettings = (function() { - - /** - * Properties of a RubySettings. - * @memberof google.api - * @interface IRubySettings - * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common - */ - - /** - * Constructs a new RubySettings. - * @memberof google.api - * @classdesc Represents a RubySettings. - * @implements IRubySettings - * @constructor - * @param {google.api.IRubySettings=} [properties] Properties to set - */ - function RubySettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RubySettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.RubySettings - * @instance - */ - RubySettings.prototype.common = null; - - /** - * Creates a new RubySettings instance using the specified properties. - * @function create - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings=} [properties] Properties to set - * @returns {google.api.RubySettings} RubySettings instance - */ - RubySettings.create = function create(properties) { - return new RubySettings(properties); - }; - - /** - * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @function encode - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings} message RubySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RubySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings} message RubySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RubySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RubySettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.RubySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.RubySettings} RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RubySettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RubySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.RubySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.RubySettings} RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RubySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RubySettings message. - * @function verify - * @memberof google.api.RubySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RubySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.RubySettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.RubySettings} RubySettings - */ - RubySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.RubySettings) - return object; - var message = new $root.google.api.RubySettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.RubySettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.RubySettings - * @static - * @param {google.api.RubySettings} message RubySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RubySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this RubySettings to JSON. - * @function toJSON - * @memberof google.api.RubySettings - * @instance - * @returns {Object.} JSON object - */ - RubySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RubySettings - * @function getTypeUrl - * @memberof google.api.RubySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.RubySettings"; - }; - - return RubySettings; - })(); - - api.GoSettings = (function() { - - /** - * Properties of a GoSettings. - * @memberof google.api - * @interface IGoSettings - * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common - */ - - /** - * Constructs a new GoSettings. - * @memberof google.api - * @classdesc Represents a GoSettings. - * @implements IGoSettings - * @constructor - * @param {google.api.IGoSettings=} [properties] Properties to set - */ - function GoSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GoSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.GoSettings - * @instance - */ - GoSettings.prototype.common = null; - - /** - * Creates a new GoSettings instance using the specified properties. - * @function create - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings=} [properties] Properties to set - * @returns {google.api.GoSettings} GoSettings instance - */ - GoSettings.create = function create(properties) { - return new GoSettings(properties); - }; - - /** - * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @function encode - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings} message GoSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings} message GoSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GoSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.GoSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.GoSettings} GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GoSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.GoSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.GoSettings} GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GoSettings message. - * @function verify - * @memberof google.api.GoSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GoSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.GoSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.GoSettings} GoSettings - */ - GoSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.GoSettings) - return object; - var message = new $root.google.api.GoSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.GoSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.GoSettings - * @static - * @param {google.api.GoSettings} message GoSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GoSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this GoSettings to JSON. - * @function toJSON - * @memberof google.api.GoSettings - * @instance - * @returns {Object.} JSON object - */ - GoSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GoSettings - * @function getTypeUrl - * @memberof google.api.GoSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.GoSettings"; - }; - - return GoSettings; - })(); - - api.MethodSettings = (function() { - - /** - * Properties of a MethodSettings. - * @memberof google.api - * @interface IMethodSettings - * @property {string|null} [selector] MethodSettings selector - * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning - * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields - */ - - /** - * Constructs a new MethodSettings. - * @memberof google.api - * @classdesc Represents a MethodSettings. - * @implements IMethodSettings - * @constructor - * @param {google.api.IMethodSettings=} [properties] Properties to set - */ - function MethodSettings(properties) { - this.autoPopulatedFields = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodSettings selector. - * @member {string} selector - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.selector = ""; - - /** - * MethodSettings longRunning. - * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.longRunning = null; - - /** - * MethodSettings autoPopulatedFields. - * @member {Array.} autoPopulatedFields - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; - - /** - * Creates a new MethodSettings instance using the specified properties. - * @function create - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings=} [properties] Properties to set - * @returns {google.api.MethodSettings} MethodSettings instance - */ - MethodSettings.create = function create(properties) { - return new MethodSettings(properties); - }; - - /** - * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @function encode - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) - $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); - return writer; - }; - - /** - * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.MethodSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MethodSettings} MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.selector = reader.string(); - break; - } - case 2: { - message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) - message.autoPopulatedFields = []; - message.autoPopulatedFields.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MethodSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MethodSettings} MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodSettings message. - * @function verify - * @memberof google.api.MethodSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) { - var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); - if (error) - return "longRunning." + error; - } - if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { - if (!Array.isArray(message.autoPopulatedFields)) - return "autoPopulatedFields: array expected"; - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - if (!$util.isString(message.autoPopulatedFields[i])) - return "autoPopulatedFields: string[] expected"; - } - return null; - }; - - /** - * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings} MethodSettings - */ - MethodSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MethodSettings) - return object; - var message = new $root.google.api.MethodSettings(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.longRunning != null) { - if (typeof object.longRunning !== "object") - throw TypeError(".google.api.MethodSettings.longRunning: object expected"); - message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); - } - if (object.autoPopulatedFields) { - if (!Array.isArray(object.autoPopulatedFields)) - throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); - message.autoPopulatedFields = []; - for (var i = 0; i < object.autoPopulatedFields.length; ++i) - message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); - } - return message; - }; - - /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings - * @static - * @param {google.api.MethodSettings} message MethodSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.autoPopulatedFields = []; - if (options.defaults) { - object.selector = ""; - object.longRunning = null; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) - object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); - if (message.autoPopulatedFields && message.autoPopulatedFields.length) { - object.autoPopulatedFields = []; - for (var j = 0; j < message.autoPopulatedFields.length; ++j) - object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; - } - return object; - }; - - /** - * Converts this MethodSettings to JSON. - * @function toJSON - * @memberof google.api.MethodSettings - * @instance - * @returns {Object.} JSON object - */ - MethodSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodSettings - * @function getTypeUrl - * @memberof google.api.MethodSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.MethodSettings"; - }; - - MethodSettings.LongRunning = (function() { - - /** - * Properties of a LongRunning. - * @memberof google.api.MethodSettings - * @interface ILongRunning - * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay - * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier - * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay - * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout - */ - - /** - * Constructs a new LongRunning. - * @memberof google.api.MethodSettings - * @classdesc Represents a LongRunning. - * @implements ILongRunning - * @constructor - * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set - */ - function LongRunning(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LongRunning initialPollDelay. - * @member {google.protobuf.IDuration|null|undefined} initialPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.initialPollDelay = null; - - /** - * LongRunning pollDelayMultiplier. - * @member {number} pollDelayMultiplier - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.pollDelayMultiplier = 0; - - /** - * LongRunning maxPollDelay. - * @member {google.protobuf.IDuration|null|undefined} maxPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.maxPollDelay = null; - - /** - * LongRunning totalPollTimeout. - * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.totalPollTimeout = null; - - /** - * Creates a new LongRunning instance using the specified properties. - * @function create - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set - * @returns {google.api.MethodSettings.LongRunning} LongRunning instance - */ - LongRunning.create = function create(properties) { - return new LongRunning(properties); - }; - - /** - * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @function encode - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LongRunning.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) - $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); - if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) - $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) - $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LongRunning.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LongRunning message from the specified reader or buffer. - * @function decode - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MethodSettings.LongRunning} LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LongRunning.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 2: { - message.pollDelayMultiplier = reader.float(); - break; - } - case 3: { - message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LongRunning message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MethodSettings.LongRunning} LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LongRunning.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LongRunning message. - * @function verify - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LongRunning.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { - var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); - if (error) - return "initialPollDelay." + error; - } - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) - if (typeof message.pollDelayMultiplier !== "number") - return "pollDelayMultiplier: number expected"; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { - var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); - if (error) - return "maxPollDelay." + error; - } - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { - var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); - if (error) - return "totalPollTimeout." + error; - } - return null; - }; - - /** - * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings.LongRunning} LongRunning - */ - LongRunning.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MethodSettings.LongRunning) - return object; - var message = new $root.google.api.MethodSettings.LongRunning(); - if (object.initialPollDelay != null) { - if (typeof object.initialPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); - message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); - } - if (object.pollDelayMultiplier != null) - message.pollDelayMultiplier = Number(object.pollDelayMultiplier); - if (object.maxPollDelay != null) { - if (typeof object.maxPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); - message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); - } - if (object.totalPollTimeout != null) { - if (typeof object.totalPollTimeout !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); - message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); - } - return message; - }; - - /** - * Creates a plain object from a LongRunning message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.LongRunning} message LongRunning - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LongRunning.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.initialPollDelay = null; - object.pollDelayMultiplier = 0; - object.maxPollDelay = null; - object.totalPollTimeout = null; - } - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) - object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) - object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) - object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) - object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); - return object; - }; - - /** - * Converts this LongRunning to JSON. - * @function toJSON - * @memberof google.api.MethodSettings.LongRunning - * @instance - * @returns {Object.} JSON object - */ - LongRunning.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LongRunning - * @function getTypeUrl - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; - }; - - return LongRunning; - })(); - - return MethodSettings; - })(); - - /** - * ClientLibraryOrganization enum. - * @name google.api.ClientLibraryOrganization - * @enum {number} - * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value - * @property {number} CLOUD=1 CLOUD value - * @property {number} ADS=2 ADS value - * @property {number} PHOTOS=3 PHOTOS value - * @property {number} STREET_VIEW=4 STREET_VIEW value - * @property {number} SHOPPING=5 SHOPPING value - * @property {number} GEO=6 GEO value - * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value - */ - api.ClientLibraryOrganization = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; - values[valuesById[1] = "CLOUD"] = 1; - values[valuesById[2] = "ADS"] = 2; - values[valuesById[3] = "PHOTOS"] = 3; - values[valuesById[4] = "STREET_VIEW"] = 4; - values[valuesById[5] = "SHOPPING"] = 5; - values[valuesById[6] = "GEO"] = 6; - values[valuesById[7] = "GENERATIVE_AI"] = 7; - return values; - })(); - - /** - * ClientLibraryDestination enum. - * @name google.api.ClientLibraryDestination - * @enum {number} - * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value - * @property {number} GITHUB=10 GITHUB value - * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value - */ - api.ClientLibraryDestination = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; - values[valuesById[10] = "GITHUB"] = 10; - values[valuesById[20] = "PACKAGE_MANAGER"] = 20; - return values; - })(); - - /** - * LaunchStage enum. - * @name google.api.LaunchStage - * @enum {number} - * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value - * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value - * @property {number} PRELAUNCH=7 PRELAUNCH value - * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value - * @property {number} ALPHA=2 ALPHA value - * @property {number} BETA=3 BETA value - * @property {number} GA=4 GA value - * @property {number} DEPRECATED=5 DEPRECATED value - */ - api.LaunchStage = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; - values[valuesById[6] = "UNIMPLEMENTED"] = 6; - values[valuesById[7] = "PRELAUNCH"] = 7; - values[valuesById[1] = "EARLY_ACCESS"] = 1; - values[valuesById[2] = "ALPHA"] = 2; - values[valuesById[3] = "BETA"] = 3; - values[valuesById[4] = "GA"] = 4; - values[valuesById[5] = "DEPRECATED"] = 5; - return values; - })(); - - /** - * 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.FieldInfo = (function() { - - /** - * Properties of a FieldInfo. - * @memberof google.api - * @interface IFieldInfo - * @property {google.api.FieldInfo.Format|null} [format] FieldInfo format - */ - - /** - * Constructs a new FieldInfo. - * @memberof google.api - * @classdesc Represents a FieldInfo. - * @implements IFieldInfo - * @constructor - * @param {google.api.IFieldInfo=} [properties] Properties to set - */ - function FieldInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldInfo format. - * @member {google.api.FieldInfo.Format} format - * @memberof google.api.FieldInfo - * @instance - */ - FieldInfo.prototype.format = 0; - - /** - * Creates a new FieldInfo instance using the specified properties. - * @function create - * @memberof google.api.FieldInfo - * @static - * @param {google.api.IFieldInfo=} [properties] Properties to set - * @returns {google.api.FieldInfo} FieldInfo instance - */ - FieldInfo.create = function create(properties) { - return new FieldInfo(properties); - }; - - /** - * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @function encode - * @memberof google.api.FieldInfo - * @static - * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.format != null && Object.hasOwnProperty.call(message, "format")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.format); - return writer; - }; - - /** - * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.FieldInfo - * @static - * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldInfo message from the specified reader or buffer. - * @function decode - * @memberof google.api.FieldInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.FieldInfo} FieldInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.FieldInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.format = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.FieldInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.FieldInfo} FieldInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldInfo message. - * @function verify - * @memberof google.api.FieldInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.format != null && message.hasOwnProperty("format")) - switch (message.format) { - default: - return "format: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - return null; - }; - - /** - * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.FieldInfo - * @static - * @param {Object.} object Plain object - * @returns {google.api.FieldInfo} FieldInfo - */ - FieldInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.FieldInfo) - return object; - var message = new $root.google.api.FieldInfo(); - switch (object.format) { - default: - if (typeof object.format === "number") { - message.format = object.format; - break; - } - break; - case "FORMAT_UNSPECIFIED": - case 0: - message.format = 0; - break; - case "UUID4": - case 1: - message.format = 1; - break; - case "IPV4": - case 2: - message.format = 2; - break; - case "IPV6": - case 3: - message.format = 3; - break; - case "IPV4_OR_IPV6": - case 4: - message.format = 4; - break; - } - return message; - }; - - /** - * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.FieldInfo - * @static - * @param {google.api.FieldInfo} message FieldInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.format = options.enums === String ? "FORMAT_UNSPECIFIED" : 0; - if (message.format != null && message.hasOwnProperty("format")) - object.format = options.enums === String ? $root.google.api.FieldInfo.Format[message.format] === undefined ? message.format : $root.google.api.FieldInfo.Format[message.format] : message.format; - return object; - }; - - /** - * Converts this FieldInfo to JSON. - * @function toJSON - * @memberof google.api.FieldInfo - * @instance - * @returns {Object.} JSON object - */ - FieldInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldInfo - * @function getTypeUrl - * @memberof google.api.FieldInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.FieldInfo"; - }; - - /** - * Format enum. - * @name google.api.FieldInfo.Format - * @enum {number} - * @property {number} FORMAT_UNSPECIFIED=0 FORMAT_UNSPECIFIED value - * @property {number} UUID4=1 UUID4 value - * @property {number} IPV4=2 IPV4 value - * @property {number} IPV6=3 IPV6 value - * @property {number} IPV4_OR_IPV6=4 IPV4_OR_IPV6 value - */ - FieldInfo.Format = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FORMAT_UNSPECIFIED"] = 0; - values[valuesById[1] = "UUID4"] = 1; - values[valuesById[2] = "IPV4"] = 2; - values[valuesById[3] = "IPV6"] = 3; - values[valuesById[4] = "IPV4_OR_IPV6"] = 4; - return values; - })(); - - return FieldInfo; - })(); - - api.ResourceDescriptor = (function() { - - /** - * Properties of a ResourceDescriptor. - * @memberof google.api - * @interface IResourceDescriptor - * @property {string|null} [type] ResourceDescriptor type - * @property {Array.|null} [pattern] ResourceDescriptor pattern - * @property {string|null} [nameField] ResourceDescriptor nameField - * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history - * @property {string|null} [plural] ResourceDescriptor plural - * @property {string|null} [singular] ResourceDescriptor singular - * @property {Array.|null} [style] ResourceDescriptor style - */ - - /** - * Constructs a new ResourceDescriptor. - * @memberof google.api - * @classdesc Represents a ResourceDescriptor. - * @implements IResourceDescriptor - * @constructor - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - */ - function ResourceDescriptor(properties) { - this.pattern = []; - this.style = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceDescriptor type. - * @member {string} type - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.type = ""; - - /** - * ResourceDescriptor pattern. - * @member {Array.} pattern - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.pattern = $util.emptyArray; - - /** - * ResourceDescriptor nameField. - * @member {string} nameField - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.nameField = ""; - - /** - * ResourceDescriptor history. - * @member {google.api.ResourceDescriptor.History} history - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.history = 0; - - /** - * ResourceDescriptor plural. - * @member {string} plural - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.plural = ""; - - /** - * ResourceDescriptor singular. - * @member {string} singular - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.singular = ""; - - /** - * ResourceDescriptor style. - * @member {Array.} style - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.style = $util.emptyArray; - - /** - * Creates a new ResourceDescriptor instance using the specified properties. - * @function create - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance - */ - ResourceDescriptor.create = function create(properties) { - return new ResourceDescriptor(properties); - }; - - /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @function encode - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceDescriptor.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.pattern != null && message.pattern.length) - for (var i = 0; i < message.pattern.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); - if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && Object.hasOwnProperty.call(message, "history")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); - if (message.style != null && message.style.length) { - writer.uint32(/* id 10, wireType 2 =*/82).fork(); - for (var i = 0; i < message.style.length; ++i) - writer.int32(message.style[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. - * @function decode - * @memberof google.api.ResourceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceDescriptor.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - if (!(message.pattern && message.pattern.length)) - message.pattern = []; - message.pattern.push(reader.string()); - break; - } - case 3: { - message.nameField = reader.string(); - break; - } - case 4: { - message.history = reader.int32(); - break; - } - case 5: { - message.plural = reader.string(); - break; - } - case 6: { - message.singular = reader.string(); - break; - } - case 10: { - if (!(message.style && message.style.length)) - message.style = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.style.push(reader.int32()); - } else - message.style.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ResourceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceDescriptor message. - * @function verify - * @memberof google.api.ResourceDescriptor - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceDescriptor.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.pattern != null && message.hasOwnProperty("pattern")) { - if (!Array.isArray(message.pattern)) - return "pattern: array expected"; - for (var i = 0; i < message.pattern.length; ++i) - if (!$util.isString(message.pattern[i])) - return "pattern: string[] expected"; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - if (!$util.isString(message.nameField)) - return "nameField: string expected"; - if (message.history != null && message.hasOwnProperty("history")) - switch (message.history) { - default: - return "history: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.plural != null && message.hasOwnProperty("plural")) - if (!$util.isString(message.plural)) - return "plural: string expected"; - if (message.singular != null && message.hasOwnProperty("singular")) - if (!$util.isString(message.singular)) - return "singular: string expected"; - if (message.style != null && message.hasOwnProperty("style")) { - if (!Array.isArray(message.style)) - return "style: array expected"; - for (var i = 0; i < message.style.length; ++i) - switch (message.style[i]) { - default: - return "style: enum value[] expected"; - case 0: - case 1: - break; - } - } - return null; - }; - - /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ResourceDescriptor - * @static - * @param {Object.} object Plain object - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - */ - ResourceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceDescriptor) - return object; - var message = new $root.google.api.ResourceDescriptor(); - if (object.type != null) - message.type = String(object.type); - if (object.pattern) { - if (!Array.isArray(object.pattern)) - throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); - message.pattern = []; - for (var i = 0; i < object.pattern.length; ++i) - message.pattern[i] = String(object.pattern[i]); - } - if (object.nameField != null) - message.nameField = String(object.nameField); - switch (object.history) { - default: - if (typeof object.history === "number") { - message.history = object.history; - break; - } - break; - case "HISTORY_UNSPECIFIED": - case 0: - message.history = 0; - break; - case "ORIGINALLY_SINGLE_PATTERN": - case 1: - message.history = 1; - break; - case "FUTURE_MULTI_PATTERN": - case 2: - message.history = 2; - break; - } - if (object.plural != null) - message.plural = String(object.plural); - if (object.singular != null) - message.singular = String(object.singular); - if (object.style) { - if (!Array.isArray(object.style)) - throw TypeError(".google.api.ResourceDescriptor.style: array expected"); - message.style = []; - for (var i = 0; i < object.style.length; ++i) - switch (object.style[i]) { - default: - if (typeof object.style[i] === "number") { - message.style[i] = object.style[i]; - break; - } - case "STYLE_UNSPECIFIED": - case 0: - message.style[i] = 0; - break; - case "DECLARATIVE_FRIENDLY": - case 1: - message.style[i] = 1; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.ResourceDescriptor} message ResourceDescriptor - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceDescriptor.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.pattern = []; - object.style = []; - } - if (options.defaults) { - object.type = ""; - object.nameField = ""; - object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; - object.plural = ""; - object.singular = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.pattern && message.pattern.length) { - object.pattern = []; - for (var j = 0; j < message.pattern.length; ++j) - object.pattern[j] = message.pattern[j]; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - object.nameField = message.nameField; - if (message.history != null && message.hasOwnProperty("history")) - object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; - if (message.plural != null && message.hasOwnProperty("plural")) - object.plural = message.plural; - if (message.singular != null && message.hasOwnProperty("singular")) - object.singular = message.singular; - if (message.style && message.style.length) { - object.style = []; - for (var j = 0; j < message.style.length; ++j) - object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; - } - return object; - }; - - /** - * Converts this ResourceDescriptor to JSON. - * @function toJSON - * @memberof google.api.ResourceDescriptor - * @instance - * @returns {Object.} JSON object - */ - ResourceDescriptor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceDescriptor - * @function getTypeUrl - * @memberof google.api.ResourceDescriptor - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ResourceDescriptor"; - }; - - /** - * History enum. - * @name google.api.ResourceDescriptor.History - * @enum {number} - * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value - * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value - * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value - */ - ResourceDescriptor.History = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; - values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; - values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; - return values; - })(); - - /** - * Style enum. - * @name google.api.ResourceDescriptor.Style - * @enum {number} - * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value - * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value - */ - ResourceDescriptor.Style = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; - return values; - })(); - - return ResourceDescriptor; - })(); - - api.ResourceReference = (function() { - - /** - * Properties of a ResourceReference. - * @memberof google.api - * @interface IResourceReference - * @property {string|null} [type] ResourceReference type - * @property {string|null} [childType] ResourceReference childType - */ - - /** - * Constructs a new ResourceReference. - * @memberof google.api - * @classdesc Represents a ResourceReference. - * @implements IResourceReference - * @constructor - * @param {google.api.IResourceReference=} [properties] Properties to set - */ - function ResourceReference(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceReference type. - * @member {string} type - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.type = ""; - - /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.childType = ""; - - /** - * Creates a new ResourceReference instance using the specified properties. - * @function create - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference=} [properties] Properties to set - * @returns {google.api.ResourceReference} ResourceReference instance - */ - ResourceReference.create = function create(properties) { - return new ResourceReference(properties); - }; - - /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @function encode - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceReference.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); - return writer; - }; - - /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceReference message from the specified reader or buffer. - * @function decode - * @memberof google.api.ResourceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceReference} ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceReference.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - message.childType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ResourceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceReference} ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceReference.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceReference message. - * @function verify - * @memberof google.api.ResourceReference - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceReference.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.childType != null && message.hasOwnProperty("childType")) - if (!$util.isString(message.childType)) - return "childType: string expected"; - return null; - }; - - /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ResourceReference - * @static - * @param {Object.} object Plain object - * @returns {google.api.ResourceReference} ResourceReference - */ - ResourceReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceReference) - return object; - var message = new $root.google.api.ResourceReference(); - if (object.type != null) - message.type = String(object.type); - if (object.childType != null) - message.childType = String(object.childType); - return message; - }; - - /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ResourceReference - * @static - * @param {google.api.ResourceReference} message ResourceReference - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceReference.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = ""; - object.childType = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.childType != null && message.hasOwnProperty("childType")) - object.childType = message.childType; - return object; - }; - - /** - * Converts this ResourceReference to JSON. - * @function toJSON - * @memberof google.api.ResourceReference - * @instance - * @returns {Object.} JSON object - */ - ResourceReference.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceReference - * @function getTypeUrl - * @memberof google.api.ResourceReference - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ResourceReference"; - }; - - return ResourceReference; - })(); - - return api; - })(); - - google.protobuf = (function() { - - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - var protobuf = {}; - - protobuf.FileDescriptorSet = (function() { - - /** - * Properties of a FileDescriptorSet. - * @memberof google.protobuf - * @interface IFileDescriptorSet - * @property {Array.|null} [file] FileDescriptorSet file - */ - - /** - * Constructs a new FileDescriptorSet. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorSet. - * @implements IFileDescriptorSet - * @constructor - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - */ - function FileDescriptorSet(properties) { - this.file = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorSet file. - * @member {Array.} file - * @memberof google.protobuf.FileDescriptorSet - * @instance - */ - FileDescriptorSet.prototype.file = $util.emptyArray; - - /** - * Creates a new FileDescriptorSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance - */ - FileDescriptorSet.create = function create(properties) { - return new FileDescriptorSet(properties); - }; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.file != null && message.file.length) - for (var i = 0; i < message.file.length; ++i) - $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.file && message.file.length)) - message.file = []; - message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorSet message. - * @function verify - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.file != null && message.hasOwnProperty("file")) { - if (!Array.isArray(message.file)) - return "file: array expected"; - for (var i = 0; i < message.file.length; ++i) { - var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); - if (error) - return "file." + error; - } - } - return null; - }; - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - */ - FileDescriptorSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorSet) - return object; - var message = new $root.google.protobuf.FileDescriptorSet(); - if (object.file) { - if (!Array.isArray(object.file)) - throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); - message.file = []; - for (var i = 0; i < object.file.length; ++i) { - if (typeof object.file[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); - message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.file = []; - if (message.file && message.file.length) { - object.file = []; - for (var j = 0; j < message.file.length; ++j) - object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); - } - return object; - }; - - /** - * Converts this FileDescriptorSet to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorSet - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorSet - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; - }; - - return FileDescriptorSet; - })(); - - /** - * Edition enum. - * @name google.protobuf.Edition - * @enum {number} - * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value - * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value - * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value - * @property {number} EDITION_2023=1000 EDITION_2023 value - * @property {number} EDITION_2024=1001 EDITION_2024 value - * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value - * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value - * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value - * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value - * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value - * @property {number} EDITION_MAX=2147483647 EDITION_MAX value - */ - protobuf.Edition = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EDITION_UNKNOWN"] = 0; - values[valuesById[998] = "EDITION_PROTO2"] = 998; - values[valuesById[999] = "EDITION_PROTO3"] = 999; - values[valuesById[1000] = "EDITION_2023"] = 1000; - values[valuesById[1001] = "EDITION_2024"] = 1001; - values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; - values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; - values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; - values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; - values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; - values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; - return values; - })(); - - protobuf.FileDescriptorProto = (function() { - - /** - * Properties of a FileDescriptorProto. - * @memberof google.protobuf - * @interface IFileDescriptorProto - * @property {string|null} [name] FileDescriptorProto name - * @property {string|null} ["package"] FileDescriptorProto package - * @property {Array.|null} [dependency] FileDescriptorProto dependency - * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency - * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency - * @property {Array.|null} [messageType] FileDescriptorProto messageType - * @property {Array.|null} [enumType] FileDescriptorProto enumType - * @property {Array.|null} [service] FileDescriptorProto service - * @property {Array.|null} [extension] FileDescriptorProto extension - * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options - * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo - * @property {string|null} [syntax] FileDescriptorProto syntax - * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition - */ - - /** - * Constructs a new FileDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorProto. - * @implements IFileDescriptorProto - * @constructor - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - */ - function FileDescriptorProto(properties) { - this.dependency = []; - this.publicDependency = []; - this.weakDependency = []; - this.messageType = []; - this.enumType = []; - this.service = []; - this.extension = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.name = ""; - - /** - * FileDescriptorProto package. - * @member {string} package - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype["package"] = ""; - - /** - * FileDescriptorProto dependency. - * @member {Array.} dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.dependency = $util.emptyArray; - - /** - * FileDescriptorProto publicDependency. - * @member {Array.} publicDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.publicDependency = $util.emptyArray; - - /** - * FileDescriptorProto weakDependency. - * @member {Array.} weakDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.weakDependency = $util.emptyArray; - - /** - * FileDescriptorProto messageType. - * @member {Array.} messageType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.messageType = $util.emptyArray; - - /** - * FileDescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * FileDescriptorProto service. - * @member {Array.} service - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.service = $util.emptyArray; - - /** - * FileDescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.extension = $util.emptyArray; - - /** - * FileDescriptorProto options. - * @member {google.protobuf.IFileOptions|null|undefined} options - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.options = null; - - /** - * FileDescriptorProto sourceCodeInfo. - * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.sourceCodeInfo = null; - - /** - * FileDescriptorProto syntax. - * @member {string} syntax - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.syntax = ""; - - /** - * FileDescriptorProto edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.edition = 0; - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance - */ - FileDescriptorProto.create = function create(properties) { - return new FileDescriptorProto(properties); - }; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); - if (message.dependency != null && message.dependency.length) - for (var i = 0; i < message.dependency.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); - if (message.messageType != null && message.messageType.length) - for (var i = 0; i < message.messageType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.service != null && message.service.length) - for (var i = 0; i < message.service.length; ++i) - $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) - $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.publicDependency != null && message.publicDependency.length) - for (var i = 0; i < message.publicDependency.length; ++i) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); - if (message.weakDependency != null && message.weakDependency.length) - for (var i = 0; i < message.weakDependency.length; ++i) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); - if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message["package"] = reader.string(); - break; - } - case 3: { - if (!(message.dependency && message.dependency.length)) - message.dependency = []; - message.dependency.push(reader.string()); - break; - } - case 10: { - if (!(message.publicDependency && message.publicDependency.length)) - message.publicDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.publicDependency.push(reader.int32()); - } else - message.publicDependency.push(reader.int32()); - break; - } - case 11: { - if (!(message.weakDependency && message.weakDependency.length)) - message.weakDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.weakDependency.push(reader.int32()); - } else - message.weakDependency.push(reader.int32()); - break; - } - case 4: { - if (!(message.messageType && message.messageType.length)) - message.messageType = []; - message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.service && message.service.length)) - message.service = []; - message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 7: { - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 8: { - message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); - break; - } - case 12: { - message.syntax = reader.string(); - break; - } - case 14: { - message.edition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorProto message. - * @function verify - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message["package"] != null && message.hasOwnProperty("package")) - if (!$util.isString(message["package"])) - return "package: string expected"; - if (message.dependency != null && message.hasOwnProperty("dependency")) { - if (!Array.isArray(message.dependency)) - return "dependency: array expected"; - for (var i = 0; i < message.dependency.length; ++i) - if (!$util.isString(message.dependency[i])) - return "dependency: string[] expected"; - } - if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { - if (!Array.isArray(message.publicDependency)) - return "publicDependency: array expected"; - for (var i = 0; i < message.publicDependency.length; ++i) - if (!$util.isInteger(message.publicDependency[i])) - return "publicDependency: integer[] expected"; - } - if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { - if (!Array.isArray(message.weakDependency)) - return "weakDependency: array expected"; - for (var i = 0; i < message.weakDependency.length; ++i) - if (!$util.isInteger(message.weakDependency[i])) - return "weakDependency: integer[] expected"; - } - if (message.messageType != null && message.hasOwnProperty("messageType")) { - if (!Array.isArray(message.messageType)) - return "messageType: array expected"; - for (var i = 0; i < message.messageType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); - if (error) - return "messageType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.service != null && message.hasOwnProperty("service")) { - if (!Array.isArray(message.service)) - return "service: array expected"; - for (var i = 0; i < message.service.length; ++i) { - var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); - if (error) - return "service." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FileOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { - var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); - if (error) - return "sourceCodeInfo." + error; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - if (!$util.isString(message.syntax)) - return "syntax: string expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - */ - FileDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorProto) - return object; - var message = new $root.google.protobuf.FileDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object["package"] != null) - message["package"] = String(object["package"]); - if (object.dependency) { - if (!Array.isArray(object.dependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); - message.dependency = []; - for (var i = 0; i < object.dependency.length; ++i) - message.dependency[i] = String(object.dependency[i]); - } - if (object.publicDependency) { - if (!Array.isArray(object.publicDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); - message.publicDependency = []; - for (var i = 0; i < object.publicDependency.length; ++i) - message.publicDependency[i] = object.publicDependency[i] | 0; - } - if (object.weakDependency) { - if (!Array.isArray(object.weakDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); - message.weakDependency = []; - for (var i = 0; i < object.weakDependency.length; ++i) - message.weakDependency[i] = object.weakDependency[i] | 0; - } - if (object.messageType) { - if (!Array.isArray(object.messageType)) - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); - message.messageType = []; - for (var i = 0; i < object.messageType.length; ++i) { - if (typeof object.messageType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); - message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.service) { - if (!Array.isArray(object.service)) - throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); - message.service = []; - for (var i = 0; i < object.service.length; ++i) { - if (typeof object.service[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); - message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FileOptions.fromObject(object.options); - } - if (object.sourceCodeInfo != null) { - if (typeof object.sourceCodeInfo !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); - } - if (object.syntax != null) - message.syntax = String(object.syntax); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.dependency = []; - object.messageType = []; - object.enumType = []; - object.service = []; - object.extension = []; - object.publicDependency = []; - object.weakDependency = []; - } - if (options.defaults) { - object.name = ""; - object["package"] = ""; - object.options = null; - object.sourceCodeInfo = null; - object.syntax = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message["package"] != null && message.hasOwnProperty("package")) - object["package"] = message["package"]; - if (message.dependency && message.dependency.length) { - object.dependency = []; - for (var j = 0; j < message.dependency.length; ++j) - object.dependency[j] = message.dependency[j]; - } - if (message.messageType && message.messageType.length) { - object.messageType = []; - for (var j = 0; j < message.messageType.length; ++j) - object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.service && message.service.length) { - object.service = []; - for (var j = 0; j < message.service.length; ++j) - object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) - object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); - if (message.publicDependency && message.publicDependency.length) { - object.publicDependency = []; - for (var j = 0; j < message.publicDependency.length; ++j) - object.publicDependency[j] = message.publicDependency[j]; - } - if (message.weakDependency && message.weakDependency.length) { - object.weakDependency = []; - for (var j = 0; j < message.weakDependency.length; ++j) - object.weakDependency[j] = message.weakDependency[j]; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - object.syntax = message.syntax; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this FileDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; - }; - - return FileDescriptorProto; - })(); - - protobuf.DescriptorProto = (function() { - - /** - * Properties of a DescriptorProto. - * @memberof google.protobuf - * @interface IDescriptorProto - * @property {string|null} [name] DescriptorProto name - * @property {Array.|null} [field] DescriptorProto field - * @property {Array.|null} [extension] DescriptorProto extension - * @property {Array.|null} [nestedType] DescriptorProto nestedType - * @property {Array.|null} [enumType] DescriptorProto enumType - * @property {Array.|null} [extensionRange] DescriptorProto extensionRange - * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl - * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options - * @property {Array.|null} [reservedRange] DescriptorProto reservedRange - * @property {Array.|null} [reservedName] DescriptorProto reservedName - */ - - /** - * Constructs a new DescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a DescriptorProto. - * @implements IDescriptorProto - * @constructor - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - */ - function DescriptorProto(properties) { - this.field = []; - this.extension = []; - this.nestedType = []; - this.enumType = []; - this.extensionRange = []; - this.oneofDecl = []; - this.reservedRange = []; - this.reservedName = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DescriptorProto name. - * @member {string} name - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.name = ""; - - /** - * DescriptorProto field. - * @member {Array.} field - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.field = $util.emptyArray; - - /** - * DescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extension = $util.emptyArray; - - /** - * DescriptorProto nestedType. - * @member {Array.} nestedType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.nestedType = $util.emptyArray; - - /** - * DescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * DescriptorProto extensionRange. - * @member {Array.} extensionRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extensionRange = $util.emptyArray; - - /** - * DescriptorProto oneofDecl. - * @member {Array.} oneofDecl - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.oneofDecl = $util.emptyArray; - - /** - * DescriptorProto options. - * @member {google.protobuf.IMessageOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.options = null; - - /** - * DescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * DescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto} DescriptorProto instance - */ - DescriptorProto.create = function create(properties) { - return new DescriptorProto(properties); - }; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.field != null && message.field.length) - for (var i = 0; i < message.field.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nestedType != null && message.nestedType.length) - for (var i = 0; i < message.nestedType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.extensionRange != null && message.extensionRange.length) - for (var i = 0; i < message.extensionRange.length; ++i) - $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.oneofDecl != null && message.oneofDecl.length) - for (var i = 0; i < message.oneofDecl.length; ++i) - $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); - return writer; - }; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.field && message.field.length)) - message.field = []; - message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.nestedType && message.nestedType.length)) - message.nestedType = []; - message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - } - case 4: { - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.extensionRange && message.extensionRange.length)) - message.extensionRange = []; - message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); - break; - } - case 8: { - if (!(message.oneofDecl && message.oneofDecl.length)) - message.oneofDecl = []; - message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 7: { - message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); - break; - } - case 10: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DescriptorProto message. - * @function verify - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.field != null && message.hasOwnProperty("field")) { - if (!Array.isArray(message.field)) - return "field: array expected"; - for (var i = 0; i < message.field.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); - if (error) - return "field." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.nestedType != null && message.hasOwnProperty("nestedType")) { - if (!Array.isArray(message.nestedType)) - return "nestedType: array expected"; - for (var i = 0; i < message.nestedType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); - if (error) - return "nestedType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { - if (!Array.isArray(message.extensionRange)) - return "extensionRange: array expected"; - for (var i = 0; i < message.extensionRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); - if (error) - return "extensionRange." + error; - } - } - if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { - if (!Array.isArray(message.oneofDecl)) - return "oneofDecl: array expected"; - for (var i = 0; i < message.oneofDecl.length; ++i) { - var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); - if (error) - return "oneofDecl." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MessageOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto} DescriptorProto - */ - DescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto) - return object; - var message = new $root.google.protobuf.DescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.field) { - if (!Array.isArray(object.field)) - throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); - message.field = []; - for (var i = 0; i < object.field.length; ++i) { - if (typeof object.field[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); - message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.nestedType) { - if (!Array.isArray(object.nestedType)) - throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); - message.nestedType = []; - for (var i = 0; i < object.nestedType.length; ++i) { - if (typeof object.nestedType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); - message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.extensionRange) { - if (!Array.isArray(object.extensionRange)) - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); - message.extensionRange = []; - for (var i = 0; i < object.extensionRange.length; ++i) { - if (typeof object.extensionRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); - message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); - } - } - if (object.oneofDecl) { - if (!Array.isArray(object.oneofDecl)) - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); - message.oneofDecl = []; - for (var i = 0; i < object.oneofDecl.length; ++i) { - if (typeof object.oneofDecl[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); - message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.DescriptorProto} message DescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.field = []; - object.nestedType = []; - object.enumType = []; - object.extensionRange = []; - object.extension = []; - object.oneofDecl = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.field && message.field.length) { - object.field = []; - for (var j = 0; j < message.field.length; ++j) - object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); - } - if (message.nestedType && message.nestedType.length) { - object.nestedType = []; - for (var j = 0; j < message.nestedType.length; ++j) - object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.extensionRange && message.extensionRange.length) { - object.extensionRange = []; - for (var j = 0; j < message.extensionRange.length; ++j) - object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); - if (message.oneofDecl && message.oneofDecl.length) { - object.oneofDecl = []; - for (var j = 0; j < message.oneofDecl.length; ++j) - object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); - } - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this DescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto - * @instance - * @returns {Object.} JSON object - */ - DescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto"; - }; - - DescriptorProto.ExtensionRange = (function() { - - /** - * Properties of an ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @interface IExtensionRange - * @property {number|null} [start] ExtensionRange start - * @property {number|null} [end] ExtensionRange end - * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options - */ - - /** - * Constructs a new ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents an ExtensionRange. - * @implements IExtensionRange - * @constructor - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - */ - function ExtensionRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.start = 0; - - /** - * ExtensionRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.end = 0; - - /** - * ExtensionRange options. - * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.options = null; - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance - */ - ExtensionRange.create = function create(properties) { - return new ExtensionRange(properties); - }; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - case 3: { - message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - */ - ExtensionRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); - message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - object.options = null; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ExtensionRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - * @returns {Object.} JSON object - */ - ExtensionRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; - }; - - return ExtensionRange; - })(); - - DescriptorProto.ReservedRange = (function() { - - /** - * Properties of a ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @interface IReservedRange - * @property {number|null} [start] ReservedRange start - * @property {number|null} [end] ReservedRange end - */ - - /** - * Constructs a new ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents a ReservedRange. - * @implements IReservedRange - * @constructor - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - */ - function ReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReservedRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.start = 0; - - /** - * ReservedRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.end = 0; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance - */ - ReservedRange.create = function create(properties) { - return new ReservedRange(properties); - }; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReservedRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - */ - ReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this ReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - * @returns {Object.} JSON object - */ - ReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReservedRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; - }; - - return ReservedRange; - })(); - - return DescriptorProto; - })(); - - protobuf.ExtensionRangeOptions = (function() { - - /** - * Properties of an ExtensionRangeOptions. - * @memberof google.protobuf - * @interface IExtensionRangeOptions - * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption - * @property {Array.|null} [declaration] ExtensionRangeOptions declaration - * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features - * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification - */ - - /** - * Constructs a new ExtensionRangeOptions. - * @memberof google.protobuf - * @classdesc Represents an ExtensionRangeOptions. - * @implements IExtensionRangeOptions - * @constructor - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - */ - function ExtensionRangeOptions(properties) { - this.uninterpretedOption = []; - this.declaration = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRangeOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ExtensionRangeOptions declaration. - * @member {Array.} declaration - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.declaration = $util.emptyArray; - - /** - * ExtensionRangeOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.features = null; - - /** - * ExtensionRangeOptions verification. - * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.verification = 1; - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance - */ - ExtensionRangeOptions.create = function create(properties) { - return new ExtensionRangeOptions(properties); - }; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.declaration != null && message.declaration.length) - for (var i = 0; i < message.declaration.length; ++i) - $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.declaration && message.declaration.length)) - message.declaration = []; - message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); - break; - } - case 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.verification = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRangeOptions message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRangeOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message.declaration != null && message.hasOwnProperty("declaration")) { - if (!Array.isArray(message.declaration)) - return "declaration: array expected"; - for (var i = 0; i < message.declaration.length; ++i) { - var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); - if (error) - return "declaration." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.verification != null && message.hasOwnProperty("verification")) - switch (message.verification) { - default: - return "verification: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - */ - ExtensionRangeOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions(); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object.declaration) { - if (!Array.isArray(object.declaration)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); - message.declaration = []; - for (var i = 0; i < object.declaration.length; ++i) { - if (typeof object.declaration[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); - message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - switch (object.verification) { - case "DECLARATION": - case 0: - message.verification = 0; - break; - default: - if (typeof object.verification === "number") { - message.verification = object.verification; - break; - } - break; - case "UNVERIFIED": - case 1: - message.verification = 1; - break; - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRangeOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.declaration = []; - object.uninterpretedOption = []; - } - if (options.defaults) { - object.verification = options.enums === String ? "UNVERIFIED" : 1; - object.features = null; - } - if (message.declaration && message.declaration.length) { - object.declaration = []; - for (var j = 0; j < message.declaration.length; ++j) - object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); - } - if (message.verification != null && message.hasOwnProperty("verification")) - object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - * @returns {Object.} JSON object - */ - ExtensionRangeOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; - }; - - ExtensionRangeOptions.Declaration = (function() { - - /** - * Properties of a Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @interface IDeclaration - * @property {number|null} [number] Declaration number - * @property {string|null} [fullName] Declaration fullName - * @property {string|null} [type] Declaration type - * @property {boolean|null} [reserved] Declaration reserved - * @property {boolean|null} [repeated] Declaration repeated - */ - - /** - * Constructs a new Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @classdesc Represents a Declaration. - * @implements IDeclaration - * @constructor - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - */ - function Declaration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Declaration number. - * @member {number} number - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.number = 0; - - /** - * Declaration fullName. - * @member {string} fullName - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.fullName = ""; - - /** - * Declaration type. - * @member {string} type - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.type = ""; - - /** - * Declaration reserved. - * @member {boolean} reserved - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.reserved = false; - - /** - * Declaration repeated. - * @member {boolean} repeated - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.repeated = false; - - /** - * Creates a new Declaration instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance - */ - Declaration.create = function create(properties) { - return new Declaration(properties); - }; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); - if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); - if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); - if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); - return writer; - }; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.number = reader.int32(); - break; - } - case 2: { - message.fullName = reader.string(); - break; - } - case 3: { - message.type = reader.string(); - break; - } - case 5: { - message.reserved = reader.bool(); - break; - } - case 6: { - message.repeated = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Declaration message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Declaration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.fullName != null && message.hasOwnProperty("fullName")) - if (!$util.isString(message.fullName)) - return "fullName: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.reserved != null && message.hasOwnProperty("reserved")) - if (typeof message.reserved !== "boolean") - return "reserved: boolean expected"; - if (message.repeated != null && message.hasOwnProperty("repeated")) - if (typeof message.repeated !== "boolean") - return "repeated: boolean expected"; - return null; - }; - - /** - * Creates a Declaration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - */ - Declaration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - if (object.number != null) - message.number = object.number | 0; - if (object.fullName != null) - message.fullName = String(object.fullName); - if (object.type != null) - message.type = String(object.type); - if (object.reserved != null) - message.reserved = Boolean(object.reserved); - if (object.repeated != null) - message.repeated = Boolean(object.repeated); - return message; - }; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Declaration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.number = 0; - object.fullName = ""; - object.type = ""; - object.reserved = false; - object.repeated = false; - } - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.fullName != null && message.hasOwnProperty("fullName")) - object.fullName = message.fullName; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.reserved != null && message.hasOwnProperty("reserved")) - object.reserved = message.reserved; - if (message.repeated != null && message.hasOwnProperty("repeated")) - object.repeated = message.repeated; - return object; - }; - - /** - * Converts this Declaration to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - * @returns {Object.} JSON object - */ - Declaration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Declaration - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; - }; - - return Declaration; - })(); - - /** - * VerificationState enum. - * @name google.protobuf.ExtensionRangeOptions.VerificationState - * @enum {number} - * @property {number} DECLARATION=0 DECLARATION value - * @property {number} UNVERIFIED=1 UNVERIFIED value - */ - ExtensionRangeOptions.VerificationState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DECLARATION"] = 0; - values[valuesById[1] = "UNVERIFIED"] = 1; - return values; - })(); - - return ExtensionRangeOptions; - })(); - - protobuf.FieldDescriptorProto = (function() { - - /** - * Properties of a FieldDescriptorProto. - * @memberof google.protobuf - * @interface IFieldDescriptorProto - * @property {string|null} [name] FieldDescriptorProto name - * @property {number|null} [number] FieldDescriptorProto number - * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label - * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type - * @property {string|null} [typeName] FieldDescriptorProto typeName - * @property {string|null} [extendee] FieldDescriptorProto extendee - * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue - * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex - * @property {string|null} [jsonName] FieldDescriptorProto jsonName - * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options - * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional - */ - - /** - * Constructs a new FieldDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FieldDescriptorProto. - * @implements IFieldDescriptorProto - * @constructor - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - */ - function FieldDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.name = ""; - - /** - * FieldDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.number = 0; - - /** - * FieldDescriptorProto label. - * @member {google.protobuf.FieldDescriptorProto.Label} label - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.label = 1; - - /** - * FieldDescriptorProto type. - * @member {google.protobuf.FieldDescriptorProto.Type} type - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.type = 1; - - /** - * FieldDescriptorProto typeName. - * @member {string} typeName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.typeName = ""; - - /** - * FieldDescriptorProto extendee. - * @member {string} extendee - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.extendee = ""; - - /** - * FieldDescriptorProto defaultValue. - * @member {string} defaultValue - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.defaultValue = ""; - - /** - * FieldDescriptorProto oneofIndex. - * @member {number} oneofIndex - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.oneofIndex = 0; - - /** - * FieldDescriptorProto jsonName. - * @member {string} jsonName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.jsonName = ""; - - /** - * FieldDescriptorProto options. - * @member {google.protobuf.IFieldOptions|null|undefined} options - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.options = null; - - /** - * FieldDescriptorProto proto3Optional. - * @member {boolean} proto3Optional - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.proto3Optional = false; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance - */ - FieldDescriptorProto.create = function create(properties) { - return new FieldDescriptorProto(properties); - }; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && Object.hasOwnProperty.call(message, "label")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); - if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); - if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); - if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); - return writer; - }; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.number = reader.int32(); - break; - } - case 4: { - message.label = reader.int32(); - break; - } - case 5: { - message.type = reader.int32(); - break; - } - case 6: { - message.typeName = reader.string(); - break; - } - case 2: { - message.extendee = reader.string(); - break; - } - case 7: { - message.defaultValue = reader.string(); - break; - } - case 9: { - message.oneofIndex = reader.int32(); - break; - } - case 10: { - message.jsonName = reader.string(); - break; - } - case 8: { - message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); - break; - } - case 17: { - message.proto3Optional = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldDescriptorProto message. - * @function verify - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.label != null && message.hasOwnProperty("label")) - switch (message.label) { - default: - return "label: enum value expected"; - case 1: - case 3: - case 2: - break; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - break; - } - if (message.typeName != null && message.hasOwnProperty("typeName")) - if (!$util.isString(message.typeName)) - return "typeName: string expected"; - if (message.extendee != null && message.hasOwnProperty("extendee")) - if (!$util.isString(message.extendee)) - return "extendee: string expected"; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - if (!$util.isString(message.defaultValue)) - return "defaultValue: string expected"; - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - if (!$util.isInteger(message.oneofIndex)) - return "oneofIndex: integer expected"; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - if (!$util.isString(message.jsonName)) - return "jsonName: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FieldOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - if (typeof message.proto3Optional !== "boolean") - return "proto3Optional: boolean expected"; - return null; - }; - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - */ - FieldDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldDescriptorProto) - return object; - var message = new $root.google.protobuf.FieldDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - switch (object.label) { - default: - if (typeof object.label === "number") { - message.label = object.label; - break; - } - break; - case "LABEL_OPTIONAL": - case 1: - message.label = 1; - break; - case "LABEL_REPEATED": - case 3: - message.label = 3; - break; - case "LABEL_REQUIRED": - case 2: - message.label = 2; - break; - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_DOUBLE": - case 1: - message.type = 1; - break; - case "TYPE_FLOAT": - case 2: - message.type = 2; - break; - case "TYPE_INT64": - case 3: - message.type = 3; - break; - case "TYPE_UINT64": - case 4: - message.type = 4; - break; - case "TYPE_INT32": - case 5: - message.type = 5; - break; - case "TYPE_FIXED64": - case 6: - message.type = 6; - break; - case "TYPE_FIXED32": - case 7: - message.type = 7; - break; - case "TYPE_BOOL": - case 8: - message.type = 8; - break; - case "TYPE_STRING": - case 9: - message.type = 9; - break; - case "TYPE_GROUP": - case 10: - message.type = 10; - break; - case "TYPE_MESSAGE": - case 11: - message.type = 11; - break; - case "TYPE_BYTES": - case 12: - message.type = 12; - break; - case "TYPE_UINT32": - case 13: - message.type = 13; - break; - case "TYPE_ENUM": - case 14: - message.type = 14; - break; - case "TYPE_SFIXED32": - case 15: - message.type = 15; - break; - case "TYPE_SFIXED64": - case 16: - message.type = 16; - break; - case "TYPE_SINT32": - case 17: - message.type = 17; - break; - case "TYPE_SINT64": - case 18: - message.type = 18; - break; - } - if (object.typeName != null) - message.typeName = String(object.typeName); - if (object.extendee != null) - message.extendee = String(object.extendee); - if (object.defaultValue != null) - message.defaultValue = String(object.defaultValue); - if (object.oneofIndex != null) - message.oneofIndex = object.oneofIndex | 0; - if (object.jsonName != null) - message.jsonName = String(object.jsonName); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); - } - if (object.proto3Optional != null) - message.proto3Optional = Boolean(object.proto3Optional); - return message; - }; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.extendee = ""; - object.number = 0; - object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; - object.type = options.enums === String ? "TYPE_DOUBLE" : 1; - object.typeName = ""; - object.defaultValue = ""; - object.options = null; - object.oneofIndex = 0; - object.jsonName = ""; - object.proto3Optional = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.extendee != null && message.hasOwnProperty("extendee")) - object.extendee = message.extendee; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.label != null && message.hasOwnProperty("label")) - object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; - if (message.typeName != null && message.hasOwnProperty("typeName")) - object.typeName = message.typeName; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - object.defaultValue = message.defaultValue; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - object.oneofIndex = message.oneofIndex; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - object.jsonName = message.jsonName; - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - object.proto3Optional = message.proto3Optional; - return object; - }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FieldDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FieldDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; - }; - - /** - * Type enum. - * @name google.protobuf.FieldDescriptorProto.Type - * @enum {number} - * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value - * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value - * @property {number} TYPE_INT64=3 TYPE_INT64 value - * @property {number} TYPE_UINT64=4 TYPE_UINT64 value - * @property {number} TYPE_INT32=5 TYPE_INT32 value - * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value - * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value - * @property {number} TYPE_BOOL=8 TYPE_BOOL value - * @property {number} TYPE_STRING=9 TYPE_STRING value - * @property {number} TYPE_GROUP=10 TYPE_GROUP value - * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value - * @property {number} TYPE_BYTES=12 TYPE_BYTES value - * @property {number} TYPE_UINT32=13 TYPE_UINT32 value - * @property {number} TYPE_ENUM=14 TYPE_ENUM value - * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value - * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value - * @property {number} TYPE_SINT32=17 TYPE_SINT32 value - * @property {number} TYPE_SINT64=18 TYPE_SINT64 value - */ - FieldDescriptorProto.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "TYPE_DOUBLE"] = 1; - values[valuesById[2] = "TYPE_FLOAT"] = 2; - values[valuesById[3] = "TYPE_INT64"] = 3; - values[valuesById[4] = "TYPE_UINT64"] = 4; - values[valuesById[5] = "TYPE_INT32"] = 5; - values[valuesById[6] = "TYPE_FIXED64"] = 6; - values[valuesById[7] = "TYPE_FIXED32"] = 7; - values[valuesById[8] = "TYPE_BOOL"] = 8; - values[valuesById[9] = "TYPE_STRING"] = 9; - values[valuesById[10] = "TYPE_GROUP"] = 10; - values[valuesById[11] = "TYPE_MESSAGE"] = 11; - values[valuesById[12] = "TYPE_BYTES"] = 12; - values[valuesById[13] = "TYPE_UINT32"] = 13; - values[valuesById[14] = "TYPE_ENUM"] = 14; - values[valuesById[15] = "TYPE_SFIXED32"] = 15; - values[valuesById[16] = "TYPE_SFIXED64"] = 16; - values[valuesById[17] = "TYPE_SINT32"] = 17; - values[valuesById[18] = "TYPE_SINT64"] = 18; - return values; - })(); - - /** - * Label enum. - * @name google.protobuf.FieldDescriptorProto.Label - * @enum {number} - * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value - * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value - * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value - */ - FieldDescriptorProto.Label = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "LABEL_OPTIONAL"] = 1; - values[valuesById[3] = "LABEL_REPEATED"] = 3; - values[valuesById[2] = "LABEL_REQUIRED"] = 2; - return values; - })(); - - return FieldDescriptorProto; - })(); - - protobuf.OneofDescriptorProto = (function() { - - /** - * Properties of an OneofDescriptorProto. - * @memberof google.protobuf - * @interface IOneofDescriptorProto - * @property {string|null} [name] OneofDescriptorProto name - * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options - */ - - /** - * Constructs a new OneofDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an OneofDescriptorProto. - * @implements IOneofDescriptorProto - * @constructor - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - */ - function OneofDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.name = ""; - - /** - * OneofDescriptorProto options. - * @member {google.protobuf.IOneofOptions|null|undefined} options - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.options = null; - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance - */ - OneofDescriptorProto.create = function create(properties) { - return new OneofDescriptorProto(properties); - }; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofDescriptorProto message. - * @function verify - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.OneofOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - */ - OneofDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofDescriptorProto) - return object; - var message = new $root.google.protobuf.OneofDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.OneofDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - OneofDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; - }; - - return OneofDescriptorProto; - })(); - - protobuf.EnumDescriptorProto = (function() { - - /** - * Properties of an EnumDescriptorProto. - * @memberof google.protobuf - * @interface IEnumDescriptorProto - * @property {string|null} [name] EnumDescriptorProto name - * @property {Array.|null} [value] EnumDescriptorProto value - * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options - * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange - * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName - */ - - /** - * Constructs a new EnumDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumDescriptorProto. - * @implements IEnumDescriptorProto - * @constructor - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - */ - function EnumDescriptorProto(properties) { - this.value = []; - this.reservedRange = []; - this.reservedName = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.name = ""; - - /** - * EnumDescriptorProto value. - * @member {Array.} value - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.value = $util.emptyArray; - - /** - * EnumDescriptorProto options. - * @member {google.protobuf.IEnumOptions|null|undefined} options - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.options = null; - - /** - * EnumDescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * EnumDescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance - */ - EnumDescriptorProto.create = function create(properties) { - return new EnumDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.value != null && message.value.length) - for (var i = 0; i < message.value.length; ++i) - $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); - return writer; - }; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.value && message.value.length)) - message.value = []; - message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); - break; - } - case 4: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.value != null && message.hasOwnProperty("value")) { - if (!Array.isArray(message.value)) - return "value: array expected"; - for (var i = 0; i < message.value.length; ++i) { - var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); - if (error) - return "value." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - */ - EnumDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.value) { - if (!Array.isArray(object.value)) - throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); - message.value = []; - for (var i = 0; i < object.value.length; ++i) { - if (typeof object.value[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); - message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.value = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.value && message.value.length) { - object.value = []; - for (var j = 0; j < message.value.length; ++j) - object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; - }; - - EnumDescriptorProto.EnumReservedRange = (function() { - - /** - * Properties of an EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @interface IEnumReservedRange - * @property {number|null} [start] EnumReservedRange start - * @property {number|null} [end] EnumReservedRange end - */ - - /** - * Constructs a new EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @classdesc Represents an EnumReservedRange. - * @implements IEnumReservedRange - * @constructor - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - */ - function EnumReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumReservedRange start. - * @member {number} start - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.start = 0; - - /** - * EnumReservedRange end. - * @member {number} end - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.end = 0; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance - */ - EnumReservedRange.create = function create(properties) { - return new EnumReservedRange(properties); - }; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumReservedRange message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - */ - EnumReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this EnumReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - * @returns {Object.} JSON object - */ - EnumReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumReservedRange - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; - }; - - return EnumReservedRange; - })(); - - return EnumDescriptorProto; - })(); - - protobuf.EnumValueDescriptorProto = (function() { - - /** - * Properties of an EnumValueDescriptorProto. - * @memberof google.protobuf - * @interface IEnumValueDescriptorProto - * @property {string|null} [name] EnumValueDescriptorProto name - * @property {number|null} [number] EnumValueDescriptorProto number - * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options - */ - - /** - * Constructs a new EnumValueDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumValueDescriptorProto. - * @implements IEnumValueDescriptorProto - * @constructor - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - */ - function EnumValueDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.name = ""; - - /** - * EnumValueDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.number = 0; - - /** - * EnumValueDescriptorProto options. - * @member {google.protobuf.IEnumValueOptions|null|undefined} options - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.options = null; - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance - */ - EnumValueDescriptorProto.create = function create(properties) { - return new EnumValueDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.number = reader.int32(); - break; - } - case 3: { - message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumValueOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - */ - EnumValueDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumValueDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.number = 0; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumValueDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; - }; - - return EnumValueDescriptorProto; - })(); - - protobuf.ServiceDescriptorProto = (function() { - - /** - * Properties of a ServiceDescriptorProto. - * @memberof google.protobuf - * @interface IServiceDescriptorProto - * @property {string|null} [name] ServiceDescriptorProto name - * @property {Array.|null} [method] ServiceDescriptorProto method - * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options - */ - - /** - * Constructs a new ServiceDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a ServiceDescriptorProto. - * @implements IServiceDescriptorProto - * @constructor - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - */ - function ServiceDescriptorProto(properties) { - this.method = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.name = ""; - - /** - * ServiceDescriptorProto method. - * @member {Array.} method - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.method = $util.emptyArray; - - /** - * ServiceDescriptorProto options. - * @member {google.protobuf.IServiceOptions|null|undefined} options - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.options = null; - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance - */ - ServiceDescriptorProto.create = function create(properties) { - return new ServiceDescriptorProto(properties); - }; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.method != null && message.method.length) - for (var i = 0; i < message.method.length; ++i) - $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.method && message.method.length)) - message.method = []; - message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceDescriptorProto message. - * @function verify - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.method != null && message.hasOwnProperty("method")) { - if (!Array.isArray(message.method)) - return "method: array expected"; - for (var i = 0; i < message.method.length; ++i) { - var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); - if (error) - return "method." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ServiceOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - */ - ServiceDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceDescriptorProto) - return object; - var message = new $root.google.protobuf.ServiceDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.method) { - if (!Array.isArray(object.method)) - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); - message.method = []; - for (var i = 0; i < object.method.length; ++i) { - if (typeof object.method[i] !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); - message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.method = []; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.method && message.method.length) { - object.method = []; - for (var j = 0; j < message.method.length; ++j) - object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - ServiceDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; - }; - - return ServiceDescriptorProto; - })(); - - protobuf.MethodDescriptorProto = (function() { - - /** - * Properties of a MethodDescriptorProto. - * @memberof google.protobuf - * @interface IMethodDescriptorProto - * @property {string|null} [name] MethodDescriptorProto name - * @property {string|null} [inputType] MethodDescriptorProto inputType - * @property {string|null} [outputType] MethodDescriptorProto outputType - * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options - * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming - * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming - */ - - /** - * Constructs a new MethodDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a MethodDescriptorProto. - * @implements IMethodDescriptorProto - * @constructor - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - */ - function MethodDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.name = ""; - - /** - * MethodDescriptorProto inputType. - * @member {string} inputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.inputType = ""; - - /** - * MethodDescriptorProto outputType. - * @member {string} outputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.outputType = ""; - - /** - * MethodDescriptorProto options. - * @member {google.protobuf.IMethodOptions|null|undefined} options - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.options = null; - - /** - * MethodDescriptorProto clientStreaming. - * @member {boolean} clientStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.clientStreaming = false; - - /** - * MethodDescriptorProto serverStreaming. - * @member {boolean} serverStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.serverStreaming = false; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance - */ - MethodDescriptorProto.create = function create(properties) { - return new MethodDescriptorProto(properties); - }; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); - if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); - if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); - return writer; - }; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.inputType = reader.string(); - break; - } - case 3: { - message.outputType = reader.string(); - break; - } - case 4: { - message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); - break; - } - case 5: { - message.clientStreaming = reader.bool(); - break; - } - case 6: { - message.serverStreaming = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodDescriptorProto message. - * @function verify - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.inputType != null && message.hasOwnProperty("inputType")) - if (!$util.isString(message.inputType)) - return "inputType: string expected"; - if (message.outputType != null && message.hasOwnProperty("outputType")) - if (!$util.isString(message.outputType)) - return "outputType: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MethodOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - if (typeof message.clientStreaming !== "boolean") - return "clientStreaming: boolean expected"; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - if (typeof message.serverStreaming !== "boolean") - return "serverStreaming: boolean expected"; - return null; - }; - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - */ - MethodDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodDescriptorProto) - return object; - var message = new $root.google.protobuf.MethodDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.inputType != null) - message.inputType = String(object.inputType); - if (object.outputType != null) - message.outputType = String(object.outputType); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); - } - if (object.clientStreaming != null) - message.clientStreaming = Boolean(object.clientStreaming); - if (object.serverStreaming != null) - message.serverStreaming = Boolean(object.serverStreaming); - return message; - }; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.inputType = ""; - object.outputType = ""; - object.options = null; - object.clientStreaming = false; - object.serverStreaming = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.inputType != null && message.hasOwnProperty("inputType")) - object.inputType = message.inputType; - if (message.outputType != null && message.hasOwnProperty("outputType")) - object.outputType = message.outputType; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - object.clientStreaming = message.clientStreaming; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - object.serverStreaming = message.serverStreaming; - return object; - }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.MethodDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - MethodDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; - }; - - return MethodDescriptorProto; - })(); - - protobuf.FileOptions = (function() { - - /** - * Properties of a FileOptions. - * @memberof google.protobuf - * @interface IFileOptions - * @property {string|null} [javaPackage] FileOptions javaPackage - * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname - * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles - * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash - * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 - * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor - * @property {string|null} [goPackage] FileOptions goPackage - * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices - * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices - * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices - * @property {boolean|null} [deprecated] FileOptions deprecated - * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas - * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix - * @property {string|null} [csharpNamespace] FileOptions csharpNamespace - * @property {string|null} [swiftPrefix] FileOptions swiftPrefix - * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix - * @property {string|null} [phpNamespace] FileOptions phpNamespace - * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace - * @property {string|null} [rubyPackage] FileOptions rubyPackage - * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features - * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption - * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition - */ - - /** - * Constructs a new FileOptions. - * @memberof google.protobuf - * @classdesc Represents a FileOptions. - * @implements IFileOptions - * @constructor - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - */ - function FileOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.resourceDefinition"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileOptions javaPackage. - * @member {string} javaPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaPackage = ""; - - /** - * FileOptions javaOuterClassname. - * @member {string} javaOuterClassname - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaOuterClassname = ""; - - /** - * FileOptions javaMultipleFiles. - * @member {boolean} javaMultipleFiles - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaMultipleFiles = false; - - /** - * FileOptions javaGenerateEqualsAndHash. - * @member {boolean} javaGenerateEqualsAndHash - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenerateEqualsAndHash = false; - - /** - * FileOptions javaStringCheckUtf8. - * @member {boolean} javaStringCheckUtf8 - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaStringCheckUtf8 = false; - - /** - * FileOptions optimizeFor. - * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.optimizeFor = 1; - - /** - * FileOptions goPackage. - * @member {string} goPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.goPackage = ""; - - /** - * FileOptions ccGenericServices. - * @member {boolean} ccGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccGenericServices = false; - - /** - * FileOptions javaGenericServices. - * @member {boolean} javaGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenericServices = false; - - /** - * FileOptions pyGenericServices. - * @member {boolean} pyGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.pyGenericServices = false; - - /** - * FileOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.deprecated = false; - - /** - * FileOptions ccEnableArenas. - * @member {boolean} ccEnableArenas - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccEnableArenas = true; - - /** - * FileOptions objcClassPrefix. - * @member {string} objcClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.objcClassPrefix = ""; - - /** - * FileOptions csharpNamespace. - * @member {string} csharpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.csharpNamespace = ""; - - /** - * FileOptions swiftPrefix. - * @member {string} swiftPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.swiftPrefix = ""; - - /** - * FileOptions phpClassPrefix. - * @member {string} phpClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpClassPrefix = ""; - - /** - * FileOptions phpNamespace. - * @member {string} phpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpNamespace = ""; - - /** - * FileOptions phpMetadataNamespace. - * @member {string} phpMetadataNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpMetadataNamespace = ""; - - /** - * FileOptions rubyPackage. - * @member {string} rubyPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.rubyPackage = ""; - - /** - * FileOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.features = null; - - /** - * FileOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FileOptions .google.api.resourceDefinition. - * @member {Array.} .google.api.resourceDefinition - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; - - /** - * Creates a new FileOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - * @returns {google.protobuf.FileOptions} FileOptions instance - */ - FileOptions.create = function create(properties) { - return new FileOptions(properties); - }; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); - if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); - if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); - if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); - if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); - if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); - if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); - if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) - writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); - if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) - writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) - writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); - if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) - writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); - if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) - writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); - if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) - writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); - if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) - writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); - if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) - writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); - if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) - writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); - if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) - writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); - if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) - writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.javaPackage = reader.string(); - break; - } - case 8: { - message.javaOuterClassname = reader.string(); - break; - } - case 10: { - message.javaMultipleFiles = reader.bool(); - break; - } - case 20: { - message.javaGenerateEqualsAndHash = reader.bool(); - break; - } - case 27: { - message.javaStringCheckUtf8 = reader.bool(); - break; - } - case 9: { - message.optimizeFor = reader.int32(); - break; - } - case 11: { - message.goPackage = reader.string(); - break; - } - case 16: { - message.ccGenericServices = reader.bool(); - break; - } - case 17: { - message.javaGenericServices = reader.bool(); - break; - } - case 18: { - message.pyGenericServices = reader.bool(); - break; - } - case 23: { - message.deprecated = reader.bool(); - break; - } - case 31: { - message.ccEnableArenas = reader.bool(); - break; - } - case 36: { - message.objcClassPrefix = reader.string(); - break; - } - case 37: { - message.csharpNamespace = reader.string(); - break; - } - case 39: { - message.swiftPrefix = reader.string(); - break; - } - case 40: { - message.phpClassPrefix = reader.string(); - break; - } - case 41: { - message.phpNamespace = reader.string(); - break; - } - case 44: { - message.phpMetadataNamespace = reader.string(); - break; - } - case 45: { - message.rubyPackage = reader.string(); - break; - } - case 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1053: { - if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) - message[".google.api.resourceDefinition"] = []; - message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileOptions message. - * @function verify - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - if (!$util.isString(message.javaPackage)) - return "javaPackage: string expected"; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - if (!$util.isString(message.javaOuterClassname)) - return "javaOuterClassname: string expected"; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - if (typeof message.javaMultipleFiles !== "boolean") - return "javaMultipleFiles: boolean expected"; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - if (typeof message.javaGenerateEqualsAndHash !== "boolean") - return "javaGenerateEqualsAndHash: boolean expected"; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - if (typeof message.javaStringCheckUtf8 !== "boolean") - return "javaStringCheckUtf8: boolean expected"; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - switch (message.optimizeFor) { - default: - return "optimizeFor: enum value expected"; - case 1: - case 2: - case 3: - break; - } - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - if (!$util.isString(message.goPackage)) - return "goPackage: string expected"; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - if (typeof message.ccGenericServices !== "boolean") - return "ccGenericServices: boolean expected"; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - if (typeof message.javaGenericServices !== "boolean") - return "javaGenericServices: boolean expected"; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - if (typeof message.pyGenericServices !== "boolean") - return "pyGenericServices: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - if (typeof message.ccEnableArenas !== "boolean") - return "ccEnableArenas: boolean expected"; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - if (!$util.isString(message.objcClassPrefix)) - return "objcClassPrefix: string expected"; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - if (!$util.isString(message.csharpNamespace)) - return "csharpNamespace: string expected"; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - if (!$util.isString(message.swiftPrefix)) - return "swiftPrefix: string expected"; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - if (!$util.isString(message.phpClassPrefix)) - return "phpClassPrefix: string expected"; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - if (!$util.isString(message.phpNamespace)) - return "phpNamespace: string expected"; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - if (!$util.isString(message.phpMetadataNamespace)) - return "phpMetadataNamespace: string expected"; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - if (!$util.isString(message.rubyPackage)) - return "rubyPackage: string expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { - if (!Array.isArray(message[".google.api.resourceDefinition"])) - return ".google.api.resourceDefinition: array expected"; - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); - if (error) - return ".google.api.resourceDefinition." + error; - } - } - return null; - }; - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileOptions} FileOptions - */ - FileOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileOptions) - return object; - var message = new $root.google.protobuf.FileOptions(); - if (object.javaPackage != null) - message.javaPackage = String(object.javaPackage); - if (object.javaOuterClassname != null) - message.javaOuterClassname = String(object.javaOuterClassname); - if (object.javaMultipleFiles != null) - message.javaMultipleFiles = Boolean(object.javaMultipleFiles); - if (object.javaGenerateEqualsAndHash != null) - message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); - if (object.javaStringCheckUtf8 != null) - message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); - switch (object.optimizeFor) { - default: - if (typeof object.optimizeFor === "number") { - message.optimizeFor = object.optimizeFor; - break; - } - break; - case "SPEED": - case 1: - message.optimizeFor = 1; - break; - case "CODE_SIZE": - case 2: - message.optimizeFor = 2; - break; - case "LITE_RUNTIME": - case 3: - message.optimizeFor = 3; - break; - } - if (object.goPackage != null) - message.goPackage = String(object.goPackage); - if (object.ccGenericServices != null) - message.ccGenericServices = Boolean(object.ccGenericServices); - if (object.javaGenericServices != null) - message.javaGenericServices = Boolean(object.javaGenericServices); - if (object.pyGenericServices != null) - message.pyGenericServices = Boolean(object.pyGenericServices); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.ccEnableArenas != null) - message.ccEnableArenas = Boolean(object.ccEnableArenas); - if (object.objcClassPrefix != null) - message.objcClassPrefix = String(object.objcClassPrefix); - if (object.csharpNamespace != null) - message.csharpNamespace = String(object.csharpNamespace); - if (object.swiftPrefix != null) - message.swiftPrefix = String(object.swiftPrefix); - if (object.phpClassPrefix != null) - message.phpClassPrefix = String(object.phpClassPrefix); - if (object.phpNamespace != null) - message.phpNamespace = String(object.phpNamespace); - if (object.phpMetadataNamespace != null) - message.phpMetadataNamespace = String(object.phpMetadataNamespace); - if (object.rubyPackage != null) - message.rubyPackage = String(object.rubyPackage); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FileOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.resourceDefinition"]) { - if (!Array.isArray(object[".google.api.resourceDefinition"])) - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); - message[".google.api.resourceDefinition"] = []; - for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { - if (typeof object[".google.api.resourceDefinition"][i] !== "object") - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); - message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.FileOptions} message FileOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.resourceDefinition"] = []; - } - if (options.defaults) { - object.javaPackage = ""; - object.javaOuterClassname = ""; - object.optimizeFor = options.enums === String ? "SPEED" : 1; - object.javaMultipleFiles = false; - object.goPackage = ""; - object.ccGenericServices = false; - object.javaGenericServices = false; - object.pyGenericServices = false; - object.javaGenerateEqualsAndHash = false; - object.deprecated = false; - object.javaStringCheckUtf8 = false; - object.ccEnableArenas = true; - object.objcClassPrefix = ""; - object.csharpNamespace = ""; - object.swiftPrefix = ""; - object.phpClassPrefix = ""; - object.phpNamespace = ""; - object.phpMetadataNamespace = ""; - object.rubyPackage = ""; - object.features = null; - } - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - object.javaPackage = message.javaPackage; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - object.javaOuterClassname = message.javaOuterClassname; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - object.javaMultipleFiles = message.javaMultipleFiles; - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - object.goPackage = message.goPackage; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - object.ccGenericServices = message.ccGenericServices; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - object.javaGenericServices = message.javaGenericServices; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - object.pyGenericServices = message.pyGenericServices; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - object.javaStringCheckUtf8 = message.javaStringCheckUtf8; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - object.ccEnableArenas = message.ccEnableArenas; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - object.objcClassPrefix = message.objcClassPrefix; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - object.csharpNamespace = message.csharpNamespace; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - object.swiftPrefix = message.swiftPrefix; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - object.phpClassPrefix = message.phpClassPrefix; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - object.phpNamespace = message.phpNamespace; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - object.phpMetadataNamespace = message.phpMetadataNamespace; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - object.rubyPackage = message.rubyPackage; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { - object[".google.api.resourceDefinition"] = []; - for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) - object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); - } - return object; - }; - - /** - * Converts this FileOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FileOptions - * @instance - * @returns {Object.} JSON object - */ - FileOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileOptions - * @function getTypeUrl - * @memberof google.protobuf.FileOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileOptions"; - }; - - /** - * OptimizeMode enum. - * @name google.protobuf.FileOptions.OptimizeMode - * @enum {number} - * @property {number} SPEED=1 SPEED value - * @property {number} CODE_SIZE=2 CODE_SIZE value - * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value - */ - FileOptions.OptimizeMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "SPEED"] = 1; - values[valuesById[2] = "CODE_SIZE"] = 2; - values[valuesById[3] = "LITE_RUNTIME"] = 3; - return values; - })(); - - return FileOptions; - })(); - - protobuf.MessageOptions = (function() { - - /** - * Properties of a MessageOptions. - * @memberof google.protobuf - * @interface IMessageOptions - * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat - * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor - * @property {boolean|null} [deprecated] MessageOptions deprecated - * @property {boolean|null} [mapEntry] MessageOptions mapEntry - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features - * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption - * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource - */ - - /** - * Constructs a new MessageOptions. - * @memberof google.protobuf - * @classdesc Represents a MessageOptions. - * @implements IMessageOptions - * @constructor - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - */ - function MessageOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MessageOptions messageSetWireFormat. - * @member {boolean} messageSetWireFormat - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.messageSetWireFormat = false; - - /** - * MessageOptions noStandardDescriptorAccessor. - * @member {boolean} noStandardDescriptorAccessor - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.noStandardDescriptorAccessor = false; - - /** - * MessageOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecated = false; - - /** - * MessageOptions mapEntry. - * @member {boolean} mapEntry - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.mapEntry = false; - - /** - * MessageOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * MessageOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.features = null; - - /** - * MessageOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * MessageOptions .google.api.resource. - * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".google.api.resource"] = null; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - * @returns {google.protobuf.MessageOptions} MessageOptions instance - */ - MessageOptions.create = function create(properties) { - return new MessageOptions(properties); - }; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); - if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.messageSetWireFormat = reader.bool(); - break; - } - case 2: { - message.noStandardDescriptorAccessor = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 7: { - message.mapEntry = reader.bool(); - break; - } - case 11: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 12: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1053: { - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MessageOptions message. - * @function verify - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MessageOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - if (typeof message.messageSetWireFormat !== "boolean") - return "messageSetWireFormat: boolean expected"; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - if (typeof message.noStandardDescriptorAccessor !== "boolean") - return "noStandardDescriptorAccessor: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - if (typeof message.mapEntry !== "boolean") - return "mapEntry: boolean expected"; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); - if (error) - return ".google.api.resource." + error; - } - return null; - }; - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MessageOptions} MessageOptions - */ - MessageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MessageOptions) - return object; - var message = new $root.google.protobuf.MessageOptions(); - if (object.messageSetWireFormat != null) - message.messageSetWireFormat = Boolean(object.messageSetWireFormat); - if (object.noStandardDescriptorAccessor != null) - message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.mapEntry != null) - message.mapEntry = Boolean(object.mapEntry); - if (object.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MessageOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.resource"] != null) { - if (typeof object[".google.api.resource"] !== "object") - throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); - } - return message; - }; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.MessageOptions} message MessageOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MessageOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.messageSetWireFormat = false; - object.noStandardDescriptorAccessor = false; - object.deprecated = false; - object.mapEntry = false; - object.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - object[".google.api.resource"] = null; - } - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - object.messageSetWireFormat = message.messageSetWireFormat; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - object.mapEntry = message.mapEntry; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) - object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); - return object; - }; - - /** - * Converts this MessageOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MessageOptions - * @instance - * @returns {Object.} JSON object - */ - MessageOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MessageOptions - * @function getTypeUrl - * @memberof google.protobuf.MessageOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MessageOptions"; - }; - - return MessageOptions; - })(); - - protobuf.FieldOptions = (function() { - - /** - * Properties of a FieldOptions. - * @memberof google.protobuf - * @interface IFieldOptions - * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype - * @property {boolean|null} [packed] FieldOptions packed - * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype - * @property {boolean|null} [lazy] FieldOptions lazy - * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy - * @property {boolean|null} [deprecated] FieldOptions deprecated - * @property {boolean|null} [weak] FieldOptions weak - * @property {boolean|null} [debugRedact] FieldOptions debugRedact - * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention - * @property {Array.|null} [targets] FieldOptions targets - * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults - * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features - * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption - * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior - * @property {google.api.IFieldInfo|null} [".google.api.fieldInfo"] FieldOptions .google.api.fieldInfo - * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference - */ - - /** - * Constructs a new FieldOptions. - * @memberof google.protobuf - * @classdesc Represents a FieldOptions. - * @implements IFieldOptions - * @constructor - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - */ - function FieldOptions(properties) { - this.targets = []; - this.editionDefaults = []; - this.uninterpretedOption = []; - this[".google.api.fieldBehavior"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldOptions ctype. - * @member {google.protobuf.FieldOptions.CType} ctype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.ctype = 0; - - /** - * FieldOptions packed. - * @member {boolean} packed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.packed = false; - - /** - * FieldOptions jstype. - * @member {google.protobuf.FieldOptions.JSType} jstype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.jstype = 0; - - /** - * FieldOptions lazy. - * @member {boolean} lazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.lazy = false; - - /** - * FieldOptions unverifiedLazy. - * @member {boolean} unverifiedLazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.unverifiedLazy = false; - - /** - * FieldOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.deprecated = false; - - /** - * FieldOptions weak. - * @member {boolean} weak - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.weak = false; - - /** - * FieldOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.debugRedact = false; - - /** - * FieldOptions retention. - * @member {google.protobuf.FieldOptions.OptionRetention} retention - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.retention = 0; - - /** - * FieldOptions targets. - * @member {Array.} targets - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.targets = $util.emptyArray; - - /** - * FieldOptions editionDefaults. - * @member {Array.} editionDefaults - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.editionDefaults = $util.emptyArray; - - /** - * FieldOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.features = null; - - /** - * FieldOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FieldOptions .google.api.fieldBehavior. - * @member {Array.} .google.api.fieldBehavior - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; - - /** - * FieldOptions .google.api.fieldInfo. - * @member {google.api.IFieldInfo|null|undefined} .google.api.fieldInfo - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.fieldInfo"] = null; - - /** - * FieldOptions .google.api.resourceReference. - * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.resourceReference"] = null; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions} FieldOptions instance - */ - FieldOptions.create = function create(properties) { - return new FieldOptions(properties); - }; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); - if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) - writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); - if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) - writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); - if (message.targets != null && message.targets.length) - for (var i = 0; i < message.targets.length; ++i) - writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); - if (message.editionDefaults != null && message.editionDefaults.length) - for (var i = 0; i < message.editionDefaults.length; ++i) - $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); - if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) - $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); - if (message[".google.api.fieldInfo"] != null && Object.hasOwnProperty.call(message, ".google.api.fieldInfo")) - $root.google.api.FieldInfo.encode(message[".google.api.fieldInfo"], writer.uint32(/* id 291403980, wireType 2 =*/2331231842).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.ctype = reader.int32(); - break; - } - case 2: { - message.packed = reader.bool(); - break; - } - case 6: { - message.jstype = reader.int32(); - break; - } - case 5: { - message.lazy = reader.bool(); - break; - } - case 15: { - message.unverifiedLazy = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 10: { - message.weak = reader.bool(); - break; - } - case 16: { - message.debugRedact = reader.bool(); - break; - } - case 17: { - message.retention = reader.int32(); - break; - } - case 19: { - if (!(message.targets && message.targets.length)) - message.targets = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.targets.push(reader.int32()); - } else - message.targets.push(reader.int32()); - break; - } - case 20: { - if (!(message.editionDefaults && message.editionDefaults.length)) - message.editionDefaults = []; - message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); - break; - } - case 21: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1052: { - if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) - message[".google.api.fieldBehavior"] = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message[".google.api.fieldBehavior"].push(reader.int32()); - } else - message[".google.api.fieldBehavior"].push(reader.int32()); - break; - } - case 291403980: { - message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.decode(reader, reader.uint32()); - break; - } - case 1055: { - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldOptions message. - * @function verify - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ctype != null && message.hasOwnProperty("ctype")) - switch (message.ctype) { - default: - return "ctype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.packed != null && message.hasOwnProperty("packed")) - if (typeof message.packed !== "boolean") - return "packed: boolean expected"; - if (message.jstype != null && message.hasOwnProperty("jstype")) - switch (message.jstype) { - default: - return "jstype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.lazy != null && message.hasOwnProperty("lazy")) - if (typeof message.lazy !== "boolean") - return "lazy: boolean expected"; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - if (typeof message.unverifiedLazy !== "boolean") - return "unverifiedLazy: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.weak != null && message.hasOwnProperty("weak")) - if (typeof message.weak !== "boolean") - return "weak: boolean expected"; - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: boolean expected"; - if (message.retention != null && message.hasOwnProperty("retention")) - switch (message.retention) { - default: - return "retention: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.targets != null && message.hasOwnProperty("targets")) { - if (!Array.isArray(message.targets)) - return "targets: array expected"; - for (var i = 0; i < message.targets.length; ++i) - switch (message.targets[i]) { - default: - return "targets: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } - } - if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { - if (!Array.isArray(message.editionDefaults)) - return "editionDefaults: array expected"; - for (var i = 0; i < message.editionDefaults.length; ++i) { - var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); - if (error) - return "editionDefaults." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { - if (!Array.isArray(message[".google.api.fieldBehavior"])) - return ".google.api.fieldBehavior: array expected"; - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - switch (message[".google.api.fieldBehavior"][i]) { - default: - return ".google.api.fieldBehavior: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - } - if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) { - var error = $root.google.api.FieldInfo.verify(message[".google.api.fieldInfo"]); - if (error) - return ".google.api.fieldInfo." + error; - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { - var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); - if (error) - return ".google.api.resourceReference." + error; - } - return null; - }; - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions} FieldOptions - */ - FieldOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions) - return object; - var message = new $root.google.protobuf.FieldOptions(); - switch (object.ctype) { - default: - if (typeof object.ctype === "number") { - message.ctype = object.ctype; - break; - } - break; - case "STRING": - case 0: - message.ctype = 0; - break; - case "CORD": - case 1: - message.ctype = 1; - break; - case "STRING_PIECE": - case 2: - message.ctype = 2; - break; - } - if (object.packed != null) - message.packed = Boolean(object.packed); - switch (object.jstype) { - default: - if (typeof object.jstype === "number") { - message.jstype = object.jstype; - break; - } - break; - case "JS_NORMAL": - case 0: - message.jstype = 0; - break; - case "JS_STRING": - case 1: - message.jstype = 1; - break; - case "JS_NUMBER": - case 2: - message.jstype = 2; - break; - } - if (object.lazy != null) - message.lazy = Boolean(object.lazy); - if (object.unverifiedLazy != null) - message.unverifiedLazy = Boolean(object.unverifiedLazy); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.weak != null) - message.weak = Boolean(object.weak); - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - switch (object.retention) { - default: - if (typeof object.retention === "number") { - message.retention = object.retention; - break; - } - break; - case "RETENTION_UNKNOWN": - case 0: - message.retention = 0; - break; - case "RETENTION_RUNTIME": - case 1: - message.retention = 1; - break; - case "RETENTION_SOURCE": - case 2: - message.retention = 2; - break; - } - if (object.targets) { - if (!Array.isArray(object.targets)) - throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); - message.targets = []; - for (var i = 0; i < object.targets.length; ++i) - switch (object.targets[i]) { - default: - if (typeof object.targets[i] === "number") { - message.targets[i] = object.targets[i]; - break; - } - case "TARGET_TYPE_UNKNOWN": - case 0: - message.targets[i] = 0; - break; - case "TARGET_TYPE_FILE": - case 1: - message.targets[i] = 1; - break; - case "TARGET_TYPE_EXTENSION_RANGE": - case 2: - message.targets[i] = 2; - break; - case "TARGET_TYPE_MESSAGE": - case 3: - message.targets[i] = 3; - break; - case "TARGET_TYPE_FIELD": - case 4: - message.targets[i] = 4; - break; - case "TARGET_TYPE_ONEOF": - case 5: - message.targets[i] = 5; - break; - case "TARGET_TYPE_ENUM": - case 6: - message.targets[i] = 6; - break; - case "TARGET_TYPE_ENUM_ENTRY": - case 7: - message.targets[i] = 7; - break; - case "TARGET_TYPE_SERVICE": - case 8: - message.targets[i] = 8; - break; - case "TARGET_TYPE_METHOD": - case 9: - message.targets[i] = 9; - break; - } - } - if (object.editionDefaults) { - if (!Array.isArray(object.editionDefaults)) - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); - message.editionDefaults = []; - for (var i = 0; i < object.editionDefaults.length; ++i) { - if (typeof object.editionDefaults[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); - message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FieldOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.fieldBehavior"]) { - if (!Array.isArray(object[".google.api.fieldBehavior"])) - throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); - message[".google.api.fieldBehavior"] = []; - for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) - switch (object[".google.api.fieldBehavior"][i]) { - default: - if (typeof object[".google.api.fieldBehavior"][i] === "number") { - message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; - break; - } - case "FIELD_BEHAVIOR_UNSPECIFIED": - case 0: - message[".google.api.fieldBehavior"][i] = 0; - break; - case "OPTIONAL": - case 1: - message[".google.api.fieldBehavior"][i] = 1; - break; - case "REQUIRED": - case 2: - message[".google.api.fieldBehavior"][i] = 2; - break; - case "OUTPUT_ONLY": - case 3: - message[".google.api.fieldBehavior"][i] = 3; - break; - case "INPUT_ONLY": - case 4: - message[".google.api.fieldBehavior"][i] = 4; - break; - case "IMMUTABLE": - case 5: - message[".google.api.fieldBehavior"][i] = 5; - break; - case "UNORDERED_LIST": - case 6: - message[".google.api.fieldBehavior"][i] = 6; - break; - case "NON_EMPTY_DEFAULT": - case 7: - message[".google.api.fieldBehavior"][i] = 7; - break; - case "IDENTIFIER": - case 8: - message[".google.api.fieldBehavior"][i] = 8; - break; - } - } - if (object[".google.api.fieldInfo"] != null) { - if (typeof object[".google.api.fieldInfo"] !== "object") - throw TypeError(".google.protobuf.FieldOptions..google.api.fieldInfo: object expected"); - message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.fromObject(object[".google.api.fieldInfo"]); - } - if (object[".google.api.resourceReference"] != null) { - if (typeof object[".google.api.resourceReference"] !== "object") - throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); - } - return message; - }; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.FieldOptions} message FieldOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.targets = []; - object.editionDefaults = []; - object.uninterpretedOption = []; - object[".google.api.fieldBehavior"] = []; - } - if (options.defaults) { - object.ctype = options.enums === String ? "STRING" : 0; - object.packed = false; - object.deprecated = false; - object.lazy = false; - object.jstype = options.enums === String ? "JS_NORMAL" : 0; - object.weak = false; - object.unverifiedLazy = false; - object.debugRedact = false; - object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; - object.features = null; - object[".google.api.resourceReference"] = null; - object[".google.api.fieldInfo"] = null; - } - if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; - if (message.packed != null && message.hasOwnProperty("packed")) - object.packed = message.packed; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.lazy != null && message.hasOwnProperty("lazy")) - object.lazy = message.lazy; - if (message.jstype != null && message.hasOwnProperty("jstype")) - object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; - if (message.weak != null && message.hasOwnProperty("weak")) - object.weak = message.weak; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - object.unverifiedLazy = message.unverifiedLazy; - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - if (message.retention != null && message.hasOwnProperty("retention")) - object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; - if (message.targets && message.targets.length) { - object.targets = []; - for (var j = 0; j < message.targets.length; ++j) - object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; - } - if (message.editionDefaults && message.editionDefaults.length) { - object.editionDefaults = []; - for (var j = 0; j < message.editionDefaults.length; ++j) - object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); - } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { - object[".google.api.fieldBehavior"] = []; - for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) - object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) - object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); - if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) - object[".google.api.fieldInfo"] = $root.google.api.FieldInfo.toObject(message[".google.api.fieldInfo"], options); - return object; - }; - - /** - * Converts this FieldOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions - * @instance - * @returns {Object.} JSON object - */ - FieldOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldOptions - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions"; - }; - - /** - * CType enum. - * @name google.protobuf.FieldOptions.CType - * @enum {number} - * @property {number} STRING=0 STRING value - * @property {number} CORD=1 CORD value - * @property {number} STRING_PIECE=2 STRING_PIECE value - */ - FieldOptions.CType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STRING"] = 0; - values[valuesById[1] = "CORD"] = 1; - values[valuesById[2] = "STRING_PIECE"] = 2; - return values; - })(); - - /** - * JSType enum. - * @name google.protobuf.FieldOptions.JSType - * @enum {number} - * @property {number} JS_NORMAL=0 JS_NORMAL value - * @property {number} JS_STRING=1 JS_STRING value - * @property {number} JS_NUMBER=2 JS_NUMBER value - */ - FieldOptions.JSType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JS_NORMAL"] = 0; - values[valuesById[1] = "JS_STRING"] = 1; - values[valuesById[2] = "JS_NUMBER"] = 2; - return values; - })(); - - /** - * OptionRetention enum. - * @name google.protobuf.FieldOptions.OptionRetention - * @enum {number} - * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value - * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value - * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value - */ - FieldOptions.OptionRetention = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; - values[valuesById[1] = "RETENTION_RUNTIME"] = 1; - values[valuesById[2] = "RETENTION_SOURCE"] = 2; - return values; - })(); - - /** - * OptionTargetType enum. - * @name google.protobuf.FieldOptions.OptionTargetType - * @enum {number} - * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value - * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value - * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value - * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value - * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value - * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value - * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value - * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value - * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value - * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value - */ - FieldOptions.OptionTargetType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; - values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; - values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; - values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; - values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; - values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; - values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; - values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; - values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; - return values; - })(); - - FieldOptions.EditionDefault = (function() { - - /** - * Properties of an EditionDefault. - * @memberof google.protobuf.FieldOptions - * @interface IEditionDefault - * @property {google.protobuf.Edition|null} [edition] EditionDefault edition - * @property {string|null} [value] EditionDefault value - */ - - /** - * Constructs a new EditionDefault. - * @memberof google.protobuf.FieldOptions - * @classdesc Represents an EditionDefault. - * @implements IEditionDefault - * @constructor - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - */ - function EditionDefault(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.edition = 0; - - /** - * EditionDefault value. - * @member {string} value - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.value = ""; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance - */ - EditionDefault.create = function create(properties) { - return new EditionDefault(properties); - }; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.value = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EditionDefault message. - * @function verify - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - */ - EditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) - return object; - var message = new $root.google.protobuf.FieldOptions.EditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.value = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this EditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - * @returns {Object.} JSON object - */ - EditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; - }; - - return EditionDefault; - })(); - - return FieldOptions; - })(); - - protobuf.OneofOptions = (function() { - - /** - * Properties of an OneofOptions. - * @memberof google.protobuf - * @interface IOneofOptions - * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features - * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption - */ - - /** - * Constructs a new OneofOptions. - * @memberof google.protobuf - * @classdesc Represents an OneofOptions. - * @implements IOneofOptions - * @constructor - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - */ - function OneofOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.features = null; - - /** - * OneofOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - * @returns {google.protobuf.OneofOptions} OneofOptions instance - */ - OneofOptions.create = function create(properties) { - return new OneofOptions(properties); - }; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofOptions message. - * @function verify - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofOptions} OneofOptions - */ - OneofOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofOptions) - return object; - var message = new $root.google.protobuf.OneofOptions(); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.OneofOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.OneofOptions} message OneofOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) - object.features = null; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this OneofOptions to JSON. - * @function toJSON - * @memberof google.protobuf.OneofOptions - * @instance - * @returns {Object.} JSON object - */ - OneofOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofOptions - * @function getTypeUrl - * @memberof google.protobuf.OneofOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofOptions"; - }; - - return OneofOptions; - })(); - - protobuf.EnumOptions = (function() { - - /** - * Properties of an EnumOptions. - * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allowAlias] EnumOptions allowAlias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features - * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption - */ - - /** - * Constructs a new EnumOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumOptions. - * @implements IEnumOptions - * @constructor - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - */ - function EnumOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumOptions allowAlias. - * @member {boolean} allowAlias - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.allowAlias = false; - - /** - * EnumOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecated = false; - - /** - * EnumOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * EnumOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.features = null; - - /** - * EnumOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumOptions} EnumOptions instance - */ - EnumOptions.create = function create(properties) { - return new EnumOptions(properties); - }; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - message.allowAlias = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 6: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 7: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumOptions message. - * @function verify - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - if (typeof message.allowAlias !== "boolean") - return "allowAlias: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumOptions} EnumOptions - */ - EnumOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumOptions) - return object; - var message = new $root.google.protobuf.EnumOptions(); - if (object.allowAlias != null) - message.allowAlias = Boolean(object.allowAlias); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.EnumOptions} message EnumOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.allowAlias = false; - object.deprecated = false; - object.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - } - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - object.allowAlias = message.allowAlias; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumOptions - * @instance - * @returns {Object.} JSON object - */ - EnumOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumOptions"; - }; - - return EnumOptions; - })(); - - protobuf.EnumValueOptions = (function() { - - /** - * Properties of an EnumValueOptions. - * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features - * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact - * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption - */ - - /** - * Constructs a new EnumValueOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumValueOptions. - * @implements IEnumValueOptions - * @constructor - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - */ - function EnumValueOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.deprecated = false; - - /** - * EnumValueOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.features = null; - - /** - * EnumValueOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.debugRedact = false; - - /** - * EnumValueOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance - */ - EnumValueOptions.create = function create(properties) { - return new EnumValueOptions(properties); - }; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.deprecated = reader.bool(); - break; - } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.debugRedact = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueOptions message. - * @function verify - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - */ - EnumValueOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueOptions) - return object; - var message = new $root.google.protobuf.EnumValueOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.EnumValueOptions} message EnumValueOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object.features = null; - object.debugRedact = false; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumValueOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueOptions - * @instance - * @returns {Object.} JSON object - */ - EnumValueOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; - }; - - return EnumValueOptions; - })(); - - protobuf.ServiceOptions = (function() { - - /** - * Properties of a ServiceOptions. - * @memberof google.protobuf - * @interface IServiceOptions - * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features - * @property {boolean|null} [deprecated] ServiceOptions deprecated - * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption - * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost - * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes - * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion - */ - - /** - * Constructs a new ServiceOptions. - * @memberof google.protobuf - * @classdesc Represents a ServiceOptions. - * @implements IServiceOptions - * @constructor - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - */ - function ServiceOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.features = null; - - /** - * ServiceOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.deprecated = false; - - /** - * ServiceOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ServiceOptions .google.api.defaultHost. - * @member {string} .google.api.defaultHost - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.defaultHost"] = ""; - - /** - * ServiceOptions .google.api.oauthScopes. - * @member {string} .google.api.oauthScopes - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.oauthScopes"] = ""; - - /** - * ServiceOptions .google.api.apiVersion. - * @member {string} .google.api.apiVersion - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.apiVersion"] = ""; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - * @returns {google.protobuf.ServiceOptions} ServiceOptions instance - */ - ServiceOptions.create = function create(properties) { - return new ServiceOptions(properties); - }; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) - writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); - if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) - writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); - if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) - writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); - return writer; - }; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 34: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 33: { - message.deprecated = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1049: { - message[".google.api.defaultHost"] = reader.string(); - break; - } - case 1050: { - message[".google.api.oauthScopes"] = reader.string(); - break; - } - case 525000001: { - message[".google.api.apiVersion"] = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceOptions message. - * @function verify - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - if (!$util.isString(message[".google.api.defaultHost"])) - return ".google.api.defaultHost: string expected"; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - if (!$util.isString(message[".google.api.oauthScopes"])) - return ".google.api.oauthScopes: string expected"; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - if (!$util.isString(message[".google.api.apiVersion"])) - return ".google.api.apiVersion: string expected"; - return null; - }; - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceOptions} ServiceOptions - */ - ServiceOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceOptions) - return object; - var message = new $root.google.protobuf.ServiceOptions(); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.defaultHost"] != null) - message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); - if (object[".google.api.oauthScopes"] != null) - message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); - if (object[".google.api.apiVersion"] != null) - message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); - return message; - }; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.ServiceOptions} message ServiceOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object.features = null; - object[".google.api.defaultHost"] = ""; - object[".google.api.oauthScopes"] = ""; - object[".google.api.apiVersion"] = ""; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; - return object; - }; - - /** - * Converts this ServiceOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceOptions - * @instance - * @returns {Object.} JSON object - */ - ServiceOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceOptions - * @function getTypeUrl - * @memberof google.protobuf.ServiceOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceOptions"; - }; - - return ServiceOptions; - })(); - - protobuf.MethodOptions = (function() { - - /** - * Properties of a MethodOptions. - * @memberof google.protobuf - * @interface IMethodOptions - * @property {boolean|null} [deprecated] MethodOptions deprecated - * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel - * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features - * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption - * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http - * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature - * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo - */ - - /** - * Constructs a new MethodOptions. - * @memberof google.protobuf - * @classdesc Represents a MethodOptions. - * @implements IMethodOptions - * @constructor - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - */ - function MethodOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.methodSignature"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.deprecated = false; - - /** - * MethodOptions idempotencyLevel. - * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.idempotencyLevel = 0; - - /** - * MethodOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.features = null; - - /** - * MethodOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * MethodOptions .google.api.http. - * @member {google.api.IHttpRule|null|undefined} .google.api.http - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.http"] = null; - - /** - * MethodOptions .google.api.methodSignature. - * @member {Array.} .google.api.methodSignature - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; - - /** - * MethodOptions .google.longrunning.operationInfo. - * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.longrunning.operationInfo"] = null; - - /** - * Creates a new MethodOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - * @returns {google.protobuf.MethodOptions} MethodOptions instance - */ - MethodOptions.create = function create(properties) { - return new MethodOptions(properties); - }; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) - writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) - $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); - if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); - if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) - $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 33: { - message.deprecated = reader.bool(); - break; - } - case 34: { - message.idempotencyLevel = reader.int32(); - break; - } - case 35: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 72295728: { - message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); - break; - } - case 1051: { - if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) - message[".google.api.methodSignature"] = []; - message[".google.api.methodSignature"].push(reader.string()); - break; - } - case 1049: { - message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodOptions message. - * @function verify - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - switch (message.idempotencyLevel) { - default: - return "idempotencyLevel: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { - var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); - if (error) - return ".google.api.http." + error; - } - if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { - if (!Array.isArray(message[".google.api.methodSignature"])) - return ".google.api.methodSignature: array expected"; - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - if (!$util.isString(message[".google.api.methodSignature"][i])) - return ".google.api.methodSignature: string[] expected"; - } - if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { - var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); - if (error) - return ".google.longrunning.operationInfo." + error; - } - return null; - }; - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodOptions} MethodOptions - */ - MethodOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodOptions) - return object; - var message = new $root.google.protobuf.MethodOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - switch (object.idempotencyLevel) { - default: - if (typeof object.idempotencyLevel === "number") { - message.idempotencyLevel = object.idempotencyLevel; - break; - } - break; - case "IDEMPOTENCY_UNKNOWN": - case 0: - message.idempotencyLevel = 0; - break; - case "NO_SIDE_EFFECTS": - case 1: - message.idempotencyLevel = 1; - break; - case "IDEMPOTENT": - case 2: - message.idempotencyLevel = 2; - break; - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MethodOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.http"] != null) { - if (typeof object[".google.api.http"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); - message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); - } - if (object[".google.api.methodSignature"]) { - if (!Array.isArray(object[".google.api.methodSignature"])) - throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); - message[".google.api.methodSignature"] = []; - for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) - message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); - } - if (object[".google.longrunning.operationInfo"] != null) { - if (typeof object[".google.longrunning.operationInfo"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); - message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); - } - return message; - }; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.MethodOptions} message MethodOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.methodSignature"] = []; - } - if (options.defaults) { - object.deprecated = false; - object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; - object.features = null; - object[".google.longrunning.operationInfo"] = null; - object[".google.api.http"] = null; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) - object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); - if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { - object[".google.api.methodSignature"] = []; - for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) - object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) - object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); - return object; - }; - - /** - * Converts this MethodOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MethodOptions - * @instance - * @returns {Object.} JSON object - */ - MethodOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodOptions - * @function getTypeUrl - * @memberof google.protobuf.MethodOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodOptions"; - }; - - /** - * IdempotencyLevel enum. - * @name google.protobuf.MethodOptions.IdempotencyLevel - * @enum {number} - * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value - * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value - * @property {number} IDEMPOTENT=2 IDEMPOTENT value - */ - MethodOptions.IdempotencyLevel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; - values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; - values[valuesById[2] = "IDEMPOTENT"] = 2; - return values; - })(); - - return MethodOptions; - })(); - - protobuf.UninterpretedOption = (function() { - - /** - * Properties of an UninterpretedOption. - * @memberof google.protobuf - * @interface IUninterpretedOption - * @property {Array.|null} [name] UninterpretedOption name - * @property {string|null} [identifierValue] UninterpretedOption identifierValue - * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue - * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue - * @property {number|null} [doubleValue] UninterpretedOption doubleValue - * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue - * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue - */ - - /** - * Constructs a new UninterpretedOption. - * @memberof google.protobuf - * @classdesc Represents an UninterpretedOption. - * @implements IUninterpretedOption - * @constructor - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - */ - function UninterpretedOption(properties) { - this.name = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UninterpretedOption name. - * @member {Array.} name - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.name = $util.emptyArray; - - /** - * UninterpretedOption identifierValue. - * @member {string} identifierValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.identifierValue = ""; - - /** - * UninterpretedOption positiveIntValue. - * @member {number|Long} positiveIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * UninterpretedOption negativeIntValue. - * @member {number|Long} negativeIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * UninterpretedOption doubleValue. - * @member {number} doubleValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.doubleValue = 0; - - /** - * UninterpretedOption stringValue. - * @member {Uint8Array} stringValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.stringValue = $util.newBuffer([]); - - /** - * UninterpretedOption aggregateValue. - * @member {string} aggregateValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.aggregateValue = ""; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance - */ - UninterpretedOption.create = function create(properties) { - return new UninterpretedOption(properties); - }; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.name.length) - for (var i = 0; i < message.name.length; ++i) - $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); - if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); - if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); - if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) - writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); - if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); - return writer; - }; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - if (!(message.name && message.name.length)) - message.name = []; - message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); - break; - } - case 3: { - message.identifierValue = reader.string(); - break; - } - case 4: { - message.positiveIntValue = reader.uint64(); - break; - } - case 5: { - message.negativeIntValue = reader.int64(); - break; - } - case 6: { - message.doubleValue = reader.double(); - break; - } - case 7: { - message.stringValue = reader.bytes(); - break; - } - case 8: { - message.aggregateValue = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UninterpretedOption message. - * @function verify - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UninterpretedOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) { - if (!Array.isArray(message.name)) - return "name: array expected"; - for (var i = 0; i < message.name.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); - if (error) - return "name." + error; - } - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - if (!$util.isString(message.identifierValue)) - return "identifierValue: string expected"; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) - return "positiveIntValue: integer|Long expected"; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) - return "negativeIntValue: integer|Long expected"; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - if (typeof message.doubleValue !== "number") - return "doubleValue: number expected"; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) - return "stringValue: buffer expected"; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - if (!$util.isString(message.aggregateValue)) - return "aggregateValue: string expected"; - return null; - }; - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - */ - UninterpretedOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption) - return object; - var message = new $root.google.protobuf.UninterpretedOption(); - if (object.name) { - if (!Array.isArray(object.name)) - throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); - message.name = []; - for (var i = 0; i < object.name.length; ++i) { - if (typeof object.name[i] !== "object") - throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); - message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); - } - } - if (object.identifierValue != null) - message.identifierValue = String(object.identifierValue); - if (object.positiveIntValue != null) - if ($util.Long) - (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; - else if (typeof object.positiveIntValue === "string") - message.positiveIntValue = parseInt(object.positiveIntValue, 10); - else if (typeof object.positiveIntValue === "number") - message.positiveIntValue = object.positiveIntValue; - else if (typeof object.positiveIntValue === "object") - message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); - if (object.negativeIntValue != null) - if ($util.Long) - (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; - else if (typeof object.negativeIntValue === "string") - message.negativeIntValue = parseInt(object.negativeIntValue, 10); - else if (typeof object.negativeIntValue === "number") - message.negativeIntValue = object.negativeIntValue; - else if (typeof object.negativeIntValue === "object") - message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); - if (object.doubleValue != null) - message.doubleValue = Number(object.doubleValue); - if (object.stringValue != null) - if (typeof object.stringValue === "string") - $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); - else if (object.stringValue.length >= 0) - message.stringValue = object.stringValue; - if (object.aggregateValue != null) - message.aggregateValue = String(object.aggregateValue); - return message; - }; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.UninterpretedOption} message UninterpretedOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UninterpretedOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.name = []; - if (options.defaults) { - object.identifierValue = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.positiveIntValue = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.negativeIntValue = options.longs === String ? "0" : 0; - object.doubleValue = 0; - if (options.bytes === String) - object.stringValue = ""; - else { - object.stringValue = []; - if (options.bytes !== Array) - object.stringValue = $util.newBuffer(object.stringValue); - } - object.aggregateValue = ""; - } - if (message.name && message.name.length) { - object.name = []; - for (var j = 0; j < message.name.length; ++j) - object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - object.identifierValue = message.identifierValue; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (typeof message.positiveIntValue === "number") - object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; - else - object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (typeof message.negativeIntValue === "number") - object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; - else - object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - object.aggregateValue = message.aggregateValue; - return object; - }; - - /** - * Converts this UninterpretedOption to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption - * @instance - * @returns {Object.} JSON object - */ - UninterpretedOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UninterpretedOption - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; - }; - - UninterpretedOption.NamePart = (function() { - - /** - * Properties of a NamePart. - * @memberof google.protobuf.UninterpretedOption - * @interface INamePart - * @property {string} namePart NamePart namePart - * @property {boolean} isExtension NamePart isExtension - */ - - /** - * Constructs a new NamePart. - * @memberof google.protobuf.UninterpretedOption - * @classdesc Represents a NamePart. - * @implements INamePart - * @constructor - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - */ - function NamePart(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NamePart namePart. - * @member {string} namePart - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.namePart = ""; - - /** - * NamePart isExtension. - * @member {boolean} isExtension - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.isExtension = false; - - /** - * Creates a new NamePart instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance - */ - NamePart.create = function create(properties) { - return new NamePart(properties); - }; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); - return writer; - }; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.namePart = reader.string(); - break; - } - case 2: { - message.isExtension = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - if (!message.hasOwnProperty("namePart")) - throw $util.ProtocolError("missing required 'namePart'", { instance: message }); - if (!message.hasOwnProperty("isExtension")) - throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); - return message; - }; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NamePart message. - * @function verify - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NamePart.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (!$util.isString(message.namePart)) - return "namePart: string expected"; - if (typeof message.isExtension !== "boolean") - return "isExtension: boolean expected"; - return null; - }; - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - */ - NamePart.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) - return object; - var message = new $root.google.protobuf.UninterpretedOption.NamePart(); - if (object.namePart != null) - message.namePart = String(object.namePart); - if (object.isExtension != null) - message.isExtension = Boolean(object.isExtension); - return message; - }; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NamePart.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.namePart = ""; - object.isExtension = false; - } - if (message.namePart != null && message.hasOwnProperty("namePart")) - object.namePart = message.namePart; - if (message.isExtension != null && message.hasOwnProperty("isExtension")) - object.isExtension = message.isExtension; - return object; - }; - - /** - * Converts this NamePart to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - * @returns {Object.} JSON object - */ - NamePart.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NamePart - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; - }; - - return NamePart; - })(); - - return UninterpretedOption; - })(); - - protobuf.FeatureSet = (function() { - - /** - * Properties of a FeatureSet. - * @memberof google.protobuf - * @interface IFeatureSet - * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence - * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType - * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding - * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation - * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding - * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat - */ - - /** - * Constructs a new FeatureSet. - * @memberof google.protobuf - * @classdesc Represents a FeatureSet. - * @implements IFeatureSet - * @constructor - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - */ - function FeatureSet(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSet fieldPresence. - * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.fieldPresence = 0; - - /** - * FeatureSet enumType. - * @member {google.protobuf.FeatureSet.EnumType} enumType - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.enumType = 0; - - /** - * FeatureSet repeatedFieldEncoding. - * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.repeatedFieldEncoding = 0; - - /** - * FeatureSet utf8Validation. - * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.utf8Validation = 0; - - /** - * FeatureSet messageEncoding. - * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.messageEncoding = 0; - - /** - * FeatureSet jsonFormat. - * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.jsonFormat = 0; - - /** - * Creates a new FeatureSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - * @returns {google.protobuf.FeatureSet} FeatureSet instance - */ - FeatureSet.create = function create(properties) { - return new FeatureSet(properties); - }; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); - if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); - if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); - if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); - if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); - if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); - return writer; - }; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.fieldPresence = reader.int32(); - break; - } - case 2: { - message.enumType = reader.int32(); - break; - } - case 3: { - message.repeatedFieldEncoding = reader.int32(); - break; - } - case 4: { - message.utf8Validation = reader.int32(); - break; - } - case 5: { - message.messageEncoding = reader.int32(); - break; - } - case 6: { - message.jsonFormat = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSet message. - * @function verify - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - switch (message.fieldPresence) { - default: - return "fieldPresence: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.enumType != null && message.hasOwnProperty("enumType")) - switch (message.enumType) { - default: - return "enumType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - switch (message.repeatedFieldEncoding) { - default: - return "repeatedFieldEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - switch (message.utf8Validation) { - default: - return "utf8Validation: enum value expected"; - case 0: - case 2: - case 3: - break; - } - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - switch (message.messageEncoding) { - default: - return "messageEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - switch (message.jsonFormat) { - default: - return "jsonFormat: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSet} FeatureSet - */ - FeatureSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSet) - return object; - var message = new $root.google.protobuf.FeatureSet(); - switch (object.fieldPresence) { - default: - if (typeof object.fieldPresence === "number") { - message.fieldPresence = object.fieldPresence; - break; - } - break; - case "FIELD_PRESENCE_UNKNOWN": - case 0: - message.fieldPresence = 0; - break; - case "EXPLICIT": - case 1: - message.fieldPresence = 1; - break; - case "IMPLICIT": - case 2: - message.fieldPresence = 2; - break; - case "LEGACY_REQUIRED": - case 3: - message.fieldPresence = 3; - break; - } - switch (object.enumType) { - default: - if (typeof object.enumType === "number") { - message.enumType = object.enumType; - break; - } - break; - case "ENUM_TYPE_UNKNOWN": - case 0: - message.enumType = 0; - break; - case "OPEN": - case 1: - message.enumType = 1; - break; - case "CLOSED": - case 2: - message.enumType = 2; - break; - } - switch (object.repeatedFieldEncoding) { - default: - if (typeof object.repeatedFieldEncoding === "number") { - message.repeatedFieldEncoding = object.repeatedFieldEncoding; - break; - } - break; - case "REPEATED_FIELD_ENCODING_UNKNOWN": - case 0: - message.repeatedFieldEncoding = 0; - break; - case "PACKED": - case 1: - message.repeatedFieldEncoding = 1; - break; - case "EXPANDED": - case 2: - message.repeatedFieldEncoding = 2; - break; - } - switch (object.utf8Validation) { - default: - if (typeof object.utf8Validation === "number") { - message.utf8Validation = object.utf8Validation; - break; - } - break; - case "UTF8_VALIDATION_UNKNOWN": - case 0: - message.utf8Validation = 0; - break; - case "VERIFY": - case 2: - message.utf8Validation = 2; - break; - case "NONE": - case 3: - message.utf8Validation = 3; - break; - } - switch (object.messageEncoding) { - default: - if (typeof object.messageEncoding === "number") { - message.messageEncoding = object.messageEncoding; - break; - } - break; - case "MESSAGE_ENCODING_UNKNOWN": - case 0: - message.messageEncoding = 0; - break; - case "LENGTH_PREFIXED": - case 1: - message.messageEncoding = 1; - break; - case "DELIMITED": - case 2: - message.messageEncoding = 2; - break; - } - switch (object.jsonFormat) { - default: - if (typeof object.jsonFormat === "number") { - message.jsonFormat = object.jsonFormat; - break; - } - break; - case "JSON_FORMAT_UNKNOWN": - case 0: - message.jsonFormat = 0; - break; - case "ALLOW": - case 1: - message.jsonFormat = 1; - break; - case "LEGACY_BEST_EFFORT": - case 2: - message.jsonFormat = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.FeatureSet} message FeatureSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; - object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; - object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; - object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; - object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; - object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; - } - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; - if (message.enumType != null && message.hasOwnProperty("enumType")) - object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; - return object; - }; - - /** - * Converts this FeatureSet to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSet - * @instance - * @returns {Object.} JSON object - */ - FeatureSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSet - * @function getTypeUrl - * @memberof google.protobuf.FeatureSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSet"; - }; - - /** - * FieldPresence enum. - * @name google.protobuf.FeatureSet.FieldPresence - * @enum {number} - * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value - * @property {number} EXPLICIT=1 EXPLICIT value - * @property {number} IMPLICIT=2 IMPLICIT value - * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value - */ - FeatureSet.FieldPresence = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; - values[valuesById[1] = "EXPLICIT"] = 1; - values[valuesById[2] = "IMPLICIT"] = 2; - values[valuesById[3] = "LEGACY_REQUIRED"] = 3; - return values; - })(); - - /** - * EnumType enum. - * @name google.protobuf.FeatureSet.EnumType - * @enum {number} - * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value - * @property {number} OPEN=1 OPEN value - * @property {number} CLOSED=2 CLOSED value - */ - FeatureSet.EnumType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "OPEN"] = 1; - values[valuesById[2] = "CLOSED"] = 2; - return values; - })(); - - /** - * RepeatedFieldEncoding enum. - * @name google.protobuf.FeatureSet.RepeatedFieldEncoding - * @enum {number} - * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value - * @property {number} PACKED=1 PACKED value - * @property {number} EXPANDED=2 EXPANDED value - */ - FeatureSet.RepeatedFieldEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "PACKED"] = 1; - values[valuesById[2] = "EXPANDED"] = 2; - return values; - })(); - - /** - * Utf8Validation enum. - * @name google.protobuf.FeatureSet.Utf8Validation - * @enum {number} - * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value - * @property {number} VERIFY=2 VERIFY value - * @property {number} NONE=3 NONE value - */ - FeatureSet.Utf8Validation = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; - values[valuesById[2] = "VERIFY"] = 2; - values[valuesById[3] = "NONE"] = 3; - return values; - })(); - - /** - * MessageEncoding enum. - * @name google.protobuf.FeatureSet.MessageEncoding - * @enum {number} - * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value - * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value - * @property {number} DELIMITED=2 DELIMITED value - */ - FeatureSet.MessageEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "LENGTH_PREFIXED"] = 1; - values[valuesById[2] = "DELIMITED"] = 2; - return values; - })(); - - /** - * JsonFormat enum. - * @name google.protobuf.FeatureSet.JsonFormat - * @enum {number} - * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value - * @property {number} ALLOW=1 ALLOW value - * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value - */ - FeatureSet.JsonFormat = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; - values[valuesById[1] = "ALLOW"] = 1; - values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; - return values; - })(); - - return FeatureSet; - })(); - - protobuf.FeatureSetDefaults = (function() { - - /** - * Properties of a FeatureSetDefaults. - * @memberof google.protobuf - * @interface IFeatureSetDefaults - * @property {Array.|null} [defaults] FeatureSetDefaults defaults - * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition - * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition - */ - - /** - * Constructs a new FeatureSetDefaults. - * @memberof google.protobuf - * @classdesc Represents a FeatureSetDefaults. - * @implements IFeatureSetDefaults - * @constructor - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - */ - function FeatureSetDefaults(properties) { - this.defaults = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSetDefaults defaults. - * @member {Array.} defaults - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.defaults = $util.emptyArray; - - /** - * FeatureSetDefaults minimumEdition. - * @member {google.protobuf.Edition} minimumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.minimumEdition = 0; - - /** - * FeatureSetDefaults maximumEdition. - * @member {google.protobuf.Edition} maximumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.maximumEdition = 0; - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance - */ - FeatureSetDefaults.create = function create(properties) { - return new FeatureSetDefaults(properties); - }; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.defaults != null && message.defaults.length) - for (var i = 0; i < message.defaults.length; ++i) - $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); - if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); - return writer; - }; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.defaults && message.defaults.length)) - message.defaults = []; - message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); - break; - } - case 4: { - message.minimumEdition = reader.int32(); - break; - } - case 5: { - message.maximumEdition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetDefaults message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetDefaults.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.defaults != null && message.hasOwnProperty("defaults")) { - if (!Array.isArray(message.defaults)) - return "defaults: array expected"; - for (var i = 0; i < message.defaults.length; ++i) { - var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); - if (error) - return "defaults." + error; - } - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - switch (message.minimumEdition) { - default: - return "minimumEdition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - switch (message.maximumEdition) { - default: - return "maximumEdition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - */ - FeatureSetDefaults.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults(); - if (object.defaults) { - if (!Array.isArray(object.defaults)) - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); - message.defaults = []; - for (var i = 0; i < object.defaults.length; ++i) { - if (typeof object.defaults[i] !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); - message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); - } - } - switch (object.minimumEdition) { - default: - if (typeof object.minimumEdition === "number") { - message.minimumEdition = object.minimumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.minimumEdition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.minimumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.minimumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.minimumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.minimumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.minimumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.minimumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.minimumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.minimumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.minimumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.minimumEdition = 2147483647; - break; - } - switch (object.maximumEdition) { - default: - if (typeof object.maximumEdition === "number") { - message.maximumEdition = object.maximumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.maximumEdition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.maximumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.maximumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.maximumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.maximumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.maximumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.maximumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.maximumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.maximumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.maximumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.maximumEdition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetDefaults.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.defaults = []; - if (options.defaults) { - object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.defaults && message.defaults.length) { - object.defaults = []; - for (var j = 0; j < message.defaults.length; ++j) - object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; - return object; - }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults - * @instance - * @returns {Object.} JSON object - */ - FeatureSetDefaults.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetDefaults - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; - }; - - FeatureSetDefaults.FeatureSetEditionDefault = (function() { - - /** - * Properties of a FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @interface IFeatureSetEditionDefault - * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition - * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features - */ - - /** - * Constructs a new FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @classdesc Represents a FeatureSetEditionDefault. - * @implements IFeatureSetEditionDefault - * @constructor - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - */ - function FeatureSetEditionDefault(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSetEditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.edition = 0; - - /** - * FeatureSetEditionDefault features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.features = null; - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance - */ - FeatureSetEditionDefault.create = function create(properties) { - return new FeatureSetEditionDefault(properties); - }; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetEditionDefault message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetEditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - return null; - }; - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - */ - FeatureSetEditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetEditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.features = null; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - * @returns {Object.} JSON object - */ - FeatureSetEditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; - }; - - return FeatureSetEditionDefault; - })(); - - return FeatureSetDefaults; - })(); - - protobuf.SourceCodeInfo = (function() { - - /** - * Properties of a SourceCodeInfo. - * @memberof google.protobuf - * @interface ISourceCodeInfo - * @property {Array.|null} [location] SourceCodeInfo location - */ - - /** - * Constructs a new SourceCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a SourceCodeInfo. - * @implements ISourceCodeInfo - * @constructor - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - */ - function SourceCodeInfo(properties) { - this.location = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SourceCodeInfo location. - * @member {Array.} location - * @memberof google.protobuf.SourceCodeInfo - * @instance - */ - SourceCodeInfo.prototype.location = $util.emptyArray; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance - */ - SourceCodeInfo.create = function create(properties) { - return new SourceCodeInfo(properties); - }; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.location != null && message.location.length) - for (var i = 0; i < message.location.length; ++i) - $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.location && message.location.length)) - message.location = []; - message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SourceCodeInfo message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SourceCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) { - if (!Array.isArray(message.location)) - return "location: array expected"; - for (var i = 0; i < message.location.length; ++i) { - var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); - if (error) - return "location." + error; - } - } - return null; - }; - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - */ - SourceCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo) - return object; - var message = new $root.google.protobuf.SourceCodeInfo(); - if (object.location) { - if (!Array.isArray(object.location)) - throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); - message.location = []; - for (var i = 0; i < object.location.length; ++i) { - if (typeof object.location[i] !== "object") - throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); - message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SourceCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.location = []; - if (message.location && message.location.length) { - object.location = []; - for (var j = 0; j < message.location.length; ++j) - object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); - } - return object; - }; - - /** - * Converts this SourceCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo - * @instance - * @returns {Object.} JSON object - */ - SourceCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SourceCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; - }; - - SourceCodeInfo.Location = (function() { - - /** - * Properties of a Location. - * @memberof google.protobuf.SourceCodeInfo - * @interface ILocation - * @property {Array.|null} [path] Location path - * @property {Array.|null} [span] Location span - * @property {string|null} [leadingComments] Location leadingComments - * @property {string|null} [trailingComments] Location trailingComments - * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments - */ - - /** - * Constructs a new Location. - * @memberof google.protobuf.SourceCodeInfo - * @classdesc Represents a Location. - * @implements ILocation - * @constructor - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - */ - function Location(properties) { - this.path = []; - this.span = []; - this.leadingDetachedComments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Location path. - * @member {Array.} path - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.path = $util.emptyArray; - - /** - * Location span. - * @member {Array.} span - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.span = $util.emptyArray; - - /** - * Location leadingComments. - * @member {string} leadingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingComments = ""; - - /** - * Location trailingComments. - * @member {string} trailingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.trailingComments = ""; - - /** - * Location leadingDetachedComments. - * @member {Array.} leadingDetachedComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingDetachedComments = $util.emptyArray; - - /** - * Creates a new Location instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo.Location} Location instance - */ - Location.create = function create(properties) { - return new Location(properties); - }; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.span != null && message.span.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.span.length; ++i) - writer.int32(message.span[i]); - writer.ldelim(); - } - if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); - if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); - return writer; - }; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Location message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - if (!(message.span && message.span.length)) - message.span = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.span.push(reader.int32()); - } else - message.span.push(reader.int32()); - break; - } - case 3: { - message.leadingComments = reader.string(); - break; - } - case 4: { - message.trailingComments = reader.string(); - break; - } - case 6: { - if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) - message.leadingDetachedComments = []; - message.leadingDetachedComments.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Location message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Location.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.span != null && message.hasOwnProperty("span")) { - if (!Array.isArray(message.span)) - return "span: array expected"; - for (var i = 0; i < message.span.length; ++i) - if (!$util.isInteger(message.span[i])) - return "span: integer[] expected"; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - if (!$util.isString(message.leadingComments)) - return "leadingComments: string expected"; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - if (!$util.isString(message.trailingComments)) - return "trailingComments: string expected"; - if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { - if (!Array.isArray(message.leadingDetachedComments)) - return "leadingDetachedComments: array expected"; - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - if (!$util.isString(message.leadingDetachedComments[i])) - return "leadingDetachedComments: string[] expected"; - } - return null; - }; - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo.Location} Location - */ - Location.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) - return object; - var message = new $root.google.protobuf.SourceCodeInfo.Location(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.span) { - if (!Array.isArray(object.span)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); - message.span = []; - for (var i = 0; i < object.span.length; ++i) - message.span[i] = object.span[i] | 0; - } - if (object.leadingComments != null) - message.leadingComments = String(object.leadingComments); - if (object.trailingComments != null) - message.trailingComments = String(object.trailingComments); - if (object.leadingDetachedComments) { - if (!Array.isArray(object.leadingDetachedComments)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); - message.leadingDetachedComments = []; - for (var i = 0; i < object.leadingDetachedComments.length; ++i) - message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); - } - return message; - }; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.Location} message Location - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Location.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.path = []; - object.span = []; - object.leadingDetachedComments = []; - } - if (options.defaults) { - object.leadingComments = ""; - object.trailingComments = ""; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.span && message.span.length) { - object.span = []; - for (var j = 0; j < message.span.length; ++j) - object.span[j] = message.span[j]; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - object.leadingComments = message.leadingComments; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - object.trailingComments = message.trailingComments; - if (message.leadingDetachedComments && message.leadingDetachedComments.length) { - object.leadingDetachedComments = []; - for (var j = 0; j < message.leadingDetachedComments.length; ++j) - object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; - } - return object; - }; - - /** - * Converts this Location to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - * @returns {Object.} JSON object - */ - Location.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Location - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; - }; - - return Location; - })(); - - return SourceCodeInfo; - })(); - - protobuf.GeneratedCodeInfo = (function() { - - /** - * Properties of a GeneratedCodeInfo. - * @memberof google.protobuf - * @interface IGeneratedCodeInfo - * @property {Array.|null} [annotation] GeneratedCodeInfo annotation - */ - - /** - * Constructs a new GeneratedCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a GeneratedCodeInfo. - * @implements IGeneratedCodeInfo - * @constructor - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - */ - function GeneratedCodeInfo(properties) { - this.annotation = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GeneratedCodeInfo annotation. - * @member {Array.} annotation - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - */ - GeneratedCodeInfo.prototype.annotation = $util.emptyArray; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance - */ - GeneratedCodeInfo.create = function create(properties) { - return new GeneratedCodeInfo(properties); - }; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.annotation != null && message.annotation.length) - for (var i = 0; i < message.annotation.length; ++i) - $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.annotation && message.annotation.length)) - message.annotation = []; - message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GeneratedCodeInfo message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GeneratedCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.annotation != null && message.hasOwnProperty("annotation")) { - if (!Array.isArray(message.annotation)) - return "annotation: array expected"; - for (var i = 0; i < message.annotation.length; ++i) { - var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); - if (error) - return "annotation." + error; - } - } - return null; - }; - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - */ - GeneratedCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo(); - if (object.annotation) { - if (!Array.isArray(object.annotation)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); - message.annotation = []; - for (var i = 0; i < object.annotation.length; ++i) { - if (typeof object.annotation[i] !== "object") - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); - message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GeneratedCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.annotation = []; - if (message.annotation && message.annotation.length) { - object.annotation = []; - for (var j = 0; j < message.annotation.length; ++j) - object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); - } - return object; - }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - * @returns {Object.} JSON object - */ - GeneratedCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; - }; - - GeneratedCodeInfo.Annotation = (function() { - - /** - * Properties of an Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @interface IAnnotation - * @property {Array.|null} [path] Annotation path - * @property {string|null} [sourceFile] Annotation sourceFile - * @property {number|null} [begin] Annotation begin - * @property {number|null} [end] Annotation end - * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic - */ - - /** - * Constructs a new Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @classdesc Represents an Annotation. - * @implements IAnnotation - * @constructor - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - */ - function Annotation(properties) { - this.path = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Annotation path. - * @member {Array.} path - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.path = $util.emptyArray; - - /** - * Annotation sourceFile. - * @member {string} sourceFile - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.sourceFile = ""; - - /** - * Annotation begin. - * @member {number} begin - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.begin = 0; - - /** - * Annotation end. - * @member {number} end - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.end = 0; - - /** - * Annotation semantic. - * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.semantic = 0; - - /** - * Creates a new Annotation instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance - */ - Annotation.create = function create(properties) { - return new Annotation(properties); - }; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); - if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); - return writer; - }; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - message.sourceFile = reader.string(); - break; - } - case 3: { - message.begin = reader.int32(); - break; - } - case 4: { - message.end = reader.int32(); - break; - } - case 5: { - message.semantic = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Annotation message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Annotation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - if (!$util.isString(message.sourceFile)) - return "sourceFile: string expected"; - if (message.begin != null && message.hasOwnProperty("begin")) - if (!$util.isInteger(message.begin)) - return "begin: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.semantic != null && message.hasOwnProperty("semantic")) - switch (message.semantic) { - default: - return "semantic: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - */ - Annotation.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.sourceFile != null) - message.sourceFile = String(object.sourceFile); - if (object.begin != null) - message.begin = object.begin | 0; - if (object.end != null) - message.end = object.end | 0; - switch (object.semantic) { - default: - if (typeof object.semantic === "number") { - message.semantic = object.semantic; - break; - } - break; - case "NONE": - case 0: - message.semantic = 0; - break; - case "SET": - case 1: - message.semantic = 1; - break; - case "ALIAS": - case 2: - message.semantic = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Annotation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.path = []; - if (options.defaults) { - object.sourceFile = ""; - object.begin = 0; - object.end = 0; - object.semantic = options.enums === String ? "NONE" : 0; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - object.sourceFile = message.sourceFile; - if (message.begin != null && message.hasOwnProperty("begin")) - object.begin = message.begin; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.semantic != null && message.hasOwnProperty("semantic")) - object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; - return object; - }; - - /** - * Converts this Annotation to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - * @returns {Object.} JSON object - */ - Annotation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Annotation - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; - }; - - /** - * Semantic enum. - * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic - * @enum {number} - * @property {number} NONE=0 NONE value - * @property {number} SET=1 SET value - * @property {number} ALIAS=2 ALIAS value - */ - Annotation.Semantic = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NONE"] = 0; - values[valuesById[1] = "SET"] = 1; - values[valuesById[2] = "ALIAS"] = 2; - return values; - })(); - - return Annotation; - })(); - - return GeneratedCodeInfo; - })(); - - protobuf.Duration = (function() { - - /** - * Properties of a Duration. - * @memberof google.protobuf - * @interface IDuration - * @property {number|Long|null} [seconds] Duration seconds - * @property {number|null} [nanos] Duration nanos - */ - - /** - * Constructs a new Duration. - * @memberof google.protobuf - * @classdesc Represents a Duration. - * @implements IDuration - * @constructor - * @param {google.protobuf.IDuration=} [properties] Properties to set - */ - function Duration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Duration seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Duration nanos. - * @member {number} nanos - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.nanos = 0; - - /** - * Creates a new Duration instance using the specified properties. - * @function create - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration=} [properties] Properties to set - * @returns {google.protobuf.Duration} Duration instance - */ - Duration.create = function create(properties) { - return new Duration(properties); - }; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Duration message. - * @function verify - * @memberof google.protobuf.Duration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Duration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Duration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Duration} Duration - */ - Duration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Duration) - return object; - var message = new $root.google.protobuf.Duration(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.Duration} message Duration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Duration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Duration to JSON. - * @function toJSON - * @memberof google.protobuf.Duration - * @instance - * @returns {Object.} JSON object - */ - Duration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Duration - * @function getTypeUrl - * @memberof google.protobuf.Duration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Duration"; - }; - - return Duration; - })(); - - protobuf.Timestamp = (function() { - - /** - * Properties of a Timestamp. - * @memberof google.protobuf - * @interface ITimestamp - * @property {number|Long|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos - */ - - /** - * Constructs a new Timestamp. - * @memberof google.protobuf - * @classdesc Represents a Timestamp. - * @implements ITimestamp - * @constructor - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - */ - function Timestamp(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Timestamp seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Timestamp nanos. - * @member {number} nanos - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.nanos = 0; - - /** - * Creates a new Timestamp instance using the specified properties. - * @function create - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - * @returns {google.protobuf.Timestamp} Timestamp instance - */ - Timestamp.create = function create(properties) { - return new Timestamp(properties); - }; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Timestamp message. - * @function verify - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Timestamp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Timestamp} Timestamp - */ - Timestamp.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Timestamp) - return object; - var message = new $root.google.protobuf.Timestamp(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.Timestamp} message Timestamp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Timestamp.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Timestamp to JSON. - * @function toJSON - * @memberof google.protobuf.Timestamp - * @instance - * @returns {Object.} JSON object - */ - Timestamp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Timestamp - * @function getTypeUrl - * @memberof google.protobuf.Timestamp - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Timestamp"; - }; - - return Timestamp; - })(); - - protobuf.Any = (function() { - - /** - * Properties of an Any. - * @memberof google.protobuf - * @interface IAny - * @property {string|null} [type_url] Any type_url - * @property {Uint8Array|null} [value] Any value - */ - - /** - * Constructs a new Any. - * @memberof google.protobuf - * @classdesc Represents an Any. - * @implements IAny - * @constructor - * @param {google.protobuf.IAny=} [properties] Properties to set - */ - function Any(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Any type_url. - * @member {string} type_url - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.type_url = ""; - - /** - * Any value. - * @member {Uint8Array} value - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.value = $util.newBuffer([]); - - /** - * Creates a new Any instance using the specified properties. - * @function create - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny=} [properties] Properties to set - * @returns {google.protobuf.Any} Any instance - */ - Any.create = function create(properties) { - return new Any(properties); - }; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Any message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.type_url = reader.string(); - break; - } - case 2: { - message.value = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Any message. - * @function verify - * @memberof google.protobuf.Any - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Any.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type_url != null && message.hasOwnProperty("type_url")) - if (!$util.isString(message.type_url)) - return "type_url: string expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Any - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Any} Any - */ - Any.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Any) - return object; - var message = new $root.google.protobuf.Any(); - if (object.type_url != null) - message.type_url = String(object.type_url); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length >= 0) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.Any} message Any - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Any.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type_url = ""; - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - } - if (message.type_url != null && message.hasOwnProperty("type_url")) - object.type_url = message.type_url; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this Any to JSON. - * @function toJSON - * @memberof google.protobuf.Any - * @instance - * @returns {Object.} JSON object - */ - Any.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Any - * @function getTypeUrl - * @memberof google.protobuf.Any - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Any"; - }; - - return Any; - })(); - - protobuf.Empty = (function() { - - /** - * Properties of an Empty. - * @memberof google.protobuf - * @interface IEmpty - */ - - /** - * Constructs a new Empty. - * @memberof google.protobuf - * @classdesc Represents an Empty. - * @implements IEmpty - * @constructor - * @param {google.protobuf.IEmpty=} [properties] Properties to set - */ - function Empty(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Creates a new Empty instance using the specified properties. - * @function create - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty=} [properties] Properties to set - * @returns {google.protobuf.Empty} Empty instance - */ - Empty.create = function create(properties) { - return new Empty(properties); - }; - - /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Empty.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Empty.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Empty message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Empty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Empty} Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Empty.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Empty message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Empty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Empty} Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Empty.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Empty message. - * @function verify - * @memberof google.protobuf.Empty - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Empty.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Empty - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Empty} Empty - */ - Empty.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Empty) - return object; - return new $root.google.protobuf.Empty(); - }; - - /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.Empty} message Empty - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Empty.toObject = function toObject() { - return {}; - }; - - /** - * Converts this Empty to JSON. - * @function toJSON - * @memberof google.protobuf.Empty - * @instance - * @returns {Object.} JSON object - */ - Empty.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Empty - * @function getTypeUrl - * @memberof google.protobuf.Empty - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Empty"; - }; - - return Empty; - })(); - - protobuf.FieldMask = (function() { - - /** - * Properties of a FieldMask. - * @memberof google.protobuf - * @interface IFieldMask - * @property {Array.|null} [paths] FieldMask paths - */ - - /** - * Constructs a new FieldMask. - * @memberof google.protobuf - * @classdesc Represents a FieldMask. - * @implements IFieldMask - * @constructor - * @param {google.protobuf.IFieldMask=} [properties] Properties to set - */ - function FieldMask(properties) { - this.paths = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldMask paths. - * @member {Array.} paths - * @memberof google.protobuf.FieldMask - * @instance - */ - FieldMask.prototype.paths = $util.emptyArray; - - /** - * Creates a new FieldMask instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask=} [properties] Properties to set - * @returns {google.protobuf.FieldMask} FieldMask instance - */ - FieldMask.create = function create(properties) { - return new FieldMask(properties); - }; - - /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldMask.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.paths != null && message.paths.length) - for (var i = 0; i < message.paths.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); - return writer; - }; - - /** - * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldMask.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldMask message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldMask - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldMask} FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldMask.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.paths && message.paths.length)) - message.paths = []; - message.paths.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldMask message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldMask - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldMask} FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldMask.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldMask message. - * @function verify - * @memberof google.protobuf.FieldMask - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldMask.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.paths != null && message.hasOwnProperty("paths")) { - if (!Array.isArray(message.paths)) - return "paths: array expected"; - for (var i = 0; i < message.paths.length; ++i) - if (!$util.isString(message.paths[i])) - return "paths: string[] expected"; - } - return null; - }; - - /** - * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldMask - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldMask} FieldMask - */ - FieldMask.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldMask) - return object; - var message = new $root.google.protobuf.FieldMask(); - if (object.paths) { - if (!Array.isArray(object.paths)) - throw TypeError(".google.protobuf.FieldMask.paths: array expected"); - message.paths = []; - for (var i = 0; i < object.paths.length; ++i) - message.paths[i] = String(object.paths[i]); - } - return message; - }; - - /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.FieldMask} message FieldMask - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldMask.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.paths = []; - if (message.paths && message.paths.length) { - object.paths = []; - for (var j = 0; j < message.paths.length; ++j) - object.paths[j] = message.paths[j]; - } - return object; - }; - - /** - * Converts this FieldMask to JSON. - * @function toJSON - * @memberof google.protobuf.FieldMask - * @instance - * @returns {Object.} JSON object - */ - FieldMask.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldMask - * @function getTypeUrl - * @memberof google.protobuf.FieldMask - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldMask"; - }; - - return FieldMask; - })(); - - return protobuf; - })(); - - google.type = (function() { - - /** - * Namespace type. - * @memberof google - * @namespace - */ - var type = {}; - - type.Interval = (function() { - - /** - * Properties of an Interval. - * @memberof google.type - * @interface IInterval - * @property {google.protobuf.ITimestamp|null} [startTime] Interval startTime - * @property {google.protobuf.ITimestamp|null} [endTime] Interval endTime - */ - - /** - * Constructs a new Interval. - * @memberof google.type - * @classdesc Represents an Interval. - * @implements IInterval - * @constructor - * @param {google.type.IInterval=} [properties] Properties to set - */ - function Interval(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Interval startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.type.Interval - * @instance - */ - Interval.prototype.startTime = null; - - /** - * Interval endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.type.Interval - * @instance - */ - Interval.prototype.endTime = null; - - /** - * Creates a new Interval instance using the specified properties. - * @function create - * @memberof google.type.Interval - * @static - * @param {google.type.IInterval=} [properties] Properties to set - * @returns {google.type.Interval} Interval instance - */ - Interval.create = function create(properties) { - return new Interval(properties); - }; - - /** - * Encodes the specified Interval message. Does not implicitly {@link google.type.Interval.verify|verify} messages. - * @function encode - * @memberof google.type.Interval - * @static - * @param {google.type.IInterval} message Interval message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Interval.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(); - return writer; - }; - - /** - * Encodes the specified Interval message, length delimited. Does not implicitly {@link google.type.Interval.verify|verify} messages. - * @function encodeDelimited - * @memberof google.type.Interval - * @static - * @param {google.type.IInterval} message Interval message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Interval.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Interval message from the specified reader or buffer. - * @function decode - * @memberof google.type.Interval - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.type.Interval} Interval - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Interval.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Interval(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Interval message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.type.Interval - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.type.Interval} Interval - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Interval.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Interval message. - * @function verify - * @memberof google.type.Interval - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Interval.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - return null; - }; - - /** - * Creates an Interval message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.type.Interval - * @static - * @param {Object.} object Plain object - * @returns {google.type.Interval} Interval - */ - Interval.fromObject = function fromObject(object) { - if (object instanceof $root.google.type.Interval) - return object; - var message = new $root.google.type.Interval(); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.type.Interval.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.type.Interval.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - return message; - }; - - /** - * Creates a plain object from an Interval message. Also converts values to other types if specified. - * @function toObject - * @memberof google.type.Interval - * @static - * @param {google.type.Interval} message Interval - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Interval.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.startTime = null; - object.endTime = null; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - return object; - }; - - /** - * Converts this Interval to JSON. - * @function toJSON - * @memberof google.type.Interval - * @instance - * @returns {Object.} JSON object - */ - Interval.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Interval - * @function getTypeUrl - * @memberof google.type.Interval - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Interval.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.type.Interval"; - }; - - return Interval; - })(); - - return type; - })(); - - google.longrunning = (function() { - - /** - * Namespace longrunning. - * @memberof google - * @namespace - */ - var longrunning = {}; - - longrunning.Operations = (function() { - - /** - * Constructs a new Operations service. - * @memberof google.longrunning - * @classdesc Represents an Operations - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Operations(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; - - /** - * Creates new Operations service using the specified rpc implementation. - * @function create - * @memberof google.longrunning.Operations - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. - */ - Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.longrunning.Operations|listOperations}. - * @memberof google.longrunning.Operations - * @typedef ListOperationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse - */ - - /** - * Calls ListOperations. - * @function listOperations - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object - * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { - return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); - }, "name", { value: "ListOperations" }); - - /** - * Calls ListOperations. - * @function listOperations - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|getOperation}. - * @memberof google.longrunning.Operations - * @typedef GetOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls GetOperation. - * @function getOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object - * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { - return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "GetOperation" }); - - /** - * Calls GetOperation. - * @function getOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|deleteOperation}. - * @memberof google.longrunning.Operations - * @typedef DeleteOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteOperation. - * @function deleteOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object - * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { - return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteOperation" }); - - /** - * Calls DeleteOperation. - * @function deleteOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|cancelOperation}. - * @memberof google.longrunning.Operations - * @typedef CancelOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls CancelOperation. - * @function cancelOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object - * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { - return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "CancelOperation" }); - - /** - * Calls CancelOperation. - * @function cancelOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|waitOperation}. - * @memberof google.longrunning.Operations - * @typedef WaitOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls WaitOperation. - * @function waitOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object - * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { - return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "WaitOperation" }); - - /** - * Calls WaitOperation. - * @function waitOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Operations; - })(); - - longrunning.Operation = (function() { - - /** - * Properties of an Operation. - * @memberof google.longrunning - * @interface IOperation - * @property {string|null} [name] Operation name - * @property {google.protobuf.IAny|null} [metadata] Operation metadata - * @property {boolean|null} [done] Operation done - * @property {google.rpc.IStatus|null} [error] Operation error - * @property {google.protobuf.IAny|null} [response] Operation response - */ - - /** - * Constructs a new Operation. - * @memberof google.longrunning - * @classdesc Represents an Operation. - * @implements IOperation - * @constructor - * @param {google.longrunning.IOperation=} [properties] Properties to set - */ - function Operation(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Operation name. - * @member {string} name - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.name = ""; - - /** - * Operation metadata. - * @member {google.protobuf.IAny|null|undefined} metadata - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.metadata = null; - - /** - * Operation done. - * @member {boolean} done - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.done = false; - - /** - * Operation error. - * @member {google.rpc.IStatus|null|undefined} error - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.error = null; - - /** - * Operation response. - * @member {google.protobuf.IAny|null|undefined} response - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.response = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Operation result. - * @member {"error"|"response"|undefined} result - * @memberof google.longrunning.Operation - * @instance - */ - Object.defineProperty(Operation.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["error", "response"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Operation instance using the specified properties. - * @function create - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation=} [properties] Properties to set - * @returns {google.longrunning.Operation} Operation instance - */ - Operation.create = function create(properties) { - return new Operation(properties); - }; - - /** - * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @function encode - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation} message Operation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Operation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.done != null && Object.hasOwnProperty.call(message, "done")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.response != null && Object.hasOwnProperty.call(message, "response")) - $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation} message Operation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Operation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Operation message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.Operation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.Operation} Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Operation.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - } - case 3: { - message.done = reader.bool(); - break; - } - case 4: { - message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 5: { - message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Operation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.Operation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.Operation} Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Operation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Operation message. - * @function verify - * @memberof google.longrunning.Operation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Operation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.protobuf.Any.verify(message.metadata); - if (error) - return "metadata." + error; - } - if (message.done != null && message.hasOwnProperty("done")) - if (typeof message.done !== "boolean") - return "done: boolean expected"; - if (message.error != null && message.hasOwnProperty("error")) { - properties.result = 1; - { - var error = $root.google.rpc.Status.verify(message.error); - if (error) - return "error." + error; - } - } - if (message.response != null && message.hasOwnProperty("response")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.google.protobuf.Any.verify(message.response); - if (error) - return "response." + error; - } - } - return null; - }; - - /** - * Creates an Operation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.Operation - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.Operation} Operation - */ - Operation.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.Operation) - return object; - var message = new $root.google.longrunning.Operation(); - if (object.name != null) - message.name = String(object.name); - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.longrunning.Operation.metadata: object expected"); - message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); - } - if (object.done != null) - message.done = Boolean(object.done); - if (object.error != null) { - if (typeof object.error !== "object") - throw TypeError(".google.longrunning.Operation.error: object expected"); - message.error = $root.google.rpc.Status.fromObject(object.error); - } - if (object.response != null) { - if (typeof object.response !== "object") - throw TypeError(".google.longrunning.Operation.response: object expected"); - message.response = $root.google.protobuf.Any.fromObject(object.response); - } - return message; - }; - - /** - * Creates a plain object from an Operation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.Operation} message Operation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Operation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.metadata = null; - object.done = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); - if (message.done != null && message.hasOwnProperty("done")) - object.done = message.done; - if (message.error != null && message.hasOwnProperty("error")) { - object.error = $root.google.rpc.Status.toObject(message.error, options); - if (options.oneofs) - object.result = "error"; - } - if (message.response != null && message.hasOwnProperty("response")) { - object.response = $root.google.protobuf.Any.toObject(message.response, options); - if (options.oneofs) - object.result = "response"; - } - return object; - }; - - /** - * Converts this Operation to JSON. - * @function toJSON - * @memberof google.longrunning.Operation - * @instance - * @returns {Object.} JSON object - */ - Operation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Operation - * @function getTypeUrl - * @memberof google.longrunning.Operation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.Operation"; - }; - - return Operation; - })(); - - longrunning.GetOperationRequest = (function() { - - /** - * Properties of a GetOperationRequest. - * @memberof google.longrunning - * @interface IGetOperationRequest - * @property {string|null} [name] GetOperationRequest name - */ - - /** - * Constructs a new GetOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a GetOperationRequest. - * @implements IGetOperationRequest - * @constructor - * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set - */ - function GetOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetOperationRequest name. - * @member {string} name - * @memberof google.longrunning.GetOperationRequest - * @instance - */ - GetOperationRequest.prototype.name = ""; - - /** - * Creates a new GetOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance - */ - GetOperationRequest.create = function create(properties) { - return new GetOperationRequest(properties); - }; - - /** - * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetOperationRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetOperationRequest message. - * @function verify - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - */ - GetOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.GetOperationRequest) - return object; - var message = new $root.google.longrunning.GetOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.GetOperationRequest} message GetOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this GetOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.GetOperationRequest - * @instance - * @returns {Object.} JSON object - */ - GetOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; - }; - - return GetOperationRequest; - })(); - - longrunning.ListOperationsRequest = (function() { - - /** - * Properties of a ListOperationsRequest. - * @memberof google.longrunning - * @interface IListOperationsRequest - * @property {string|null} [name] ListOperationsRequest name - * @property {string|null} [filter] ListOperationsRequest filter - * @property {number|null} [pageSize] ListOperationsRequest pageSize - * @property {string|null} [pageToken] ListOperationsRequest pageToken - */ - - /** - * Constructs a new ListOperationsRequest. - * @memberof google.longrunning - * @classdesc Represents a ListOperationsRequest. - * @implements IListOperationsRequest - * @constructor - * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set - */ - function ListOperationsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListOperationsRequest name. - * @member {string} name - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.name = ""; - - /** - * ListOperationsRequest filter. - * @member {string} filter - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.filter = ""; - - /** - * ListOperationsRequest pageSize. - * @member {number} pageSize - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.pageSize = 0; - - /** - * ListOperationsRequest pageToken. - * @member {string} pageToken - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListOperationsRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance - */ - ListOperationsRequest.create = function create(properties) { - return new ListOperationsRequest(properties); - }; - - /** - * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); - return writer; - }; - - /** - * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 4: { - message.name = reader.string(); - break; - } - case 1: { - message.filter = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListOperationsRequest message. - * @function verify - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListOperationsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - */ - ListOperationsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.ListOperationsRequest) - return object; - var message = new $root.google.longrunning.ListOperationsRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListOperationsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - object.name = ""; - } - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this ListOperationsRequest to JSON. - * @function toJSON - * @memberof google.longrunning.ListOperationsRequest - * @instance - * @returns {Object.} JSON object - */ - ListOperationsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListOperationsRequest - * @function getTypeUrl - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; - }; - - return ListOperationsRequest; - })(); - - longrunning.ListOperationsResponse = (function() { - - /** - * Properties of a ListOperationsResponse. - * @memberof google.longrunning - * @interface IListOperationsResponse - * @property {Array.|null} [operations] ListOperationsResponse operations - * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken - */ - - /** - * Constructs a new ListOperationsResponse. - * @memberof google.longrunning - * @classdesc Represents a ListOperationsResponse. - * @implements IListOperationsResponse - * @constructor - * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set - */ - function ListOperationsResponse(properties) { - this.operations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListOperationsResponse operations. - * @member {Array.} operations - * @memberof google.longrunning.ListOperationsResponse - * @instance - */ - ListOperationsResponse.prototype.operations = $util.emptyArray; - - /** - * ListOperationsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.longrunning.ListOperationsResponse - * @instance - */ - ListOperationsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListOperationsResponse instance using the specified properties. - * @function create - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance - */ - ListOperationsResponse.create = function create(properties) { - return new ListOperationsResponse(properties); - }; - - /** - * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @function encode - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.operations != null && message.operations.length) - for (var i = 0; i < message.operations.length; ++i) - $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.operations && message.operations.length)) - message.operations = []; - message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListOperationsResponse message. - * @function verify - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListOperationsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.operations != null && message.hasOwnProperty("operations")) { - if (!Array.isArray(message.operations)) - return "operations: array expected"; - for (var i = 0; i < message.operations.length; ++i) { - var error = $root.google.longrunning.Operation.verify(message.operations[i]); - if (error) - return "operations." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - */ - ListOperationsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.ListOperationsResponse) - return object; - var message = new $root.google.longrunning.ListOperationsResponse(); - if (object.operations) { - if (!Array.isArray(object.operations)) - throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); - message.operations = []; - for (var i = 0; i < object.operations.length; ++i) { - if (typeof object.operations[i] !== "object") - throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); - message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListOperationsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.operations = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.operations && message.operations.length) { - object.operations = []; - for (var j = 0; j < message.operations.length; ++j) - object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListOperationsResponse to JSON. - * @function toJSON - * @memberof google.longrunning.ListOperationsResponse - * @instance - * @returns {Object.} JSON object - */ - ListOperationsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListOperationsResponse - * @function getTypeUrl - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; - }; - - return ListOperationsResponse; - })(); - - longrunning.CancelOperationRequest = (function() { - - /** - * Properties of a CancelOperationRequest. - * @memberof google.longrunning - * @interface ICancelOperationRequest - * @property {string|null} [name] CancelOperationRequest name - */ - - /** - * Constructs a new CancelOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a CancelOperationRequest. - * @implements ICancelOperationRequest - * @constructor - * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set - */ - function CancelOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CancelOperationRequest name. - * @member {string} name - * @memberof google.longrunning.CancelOperationRequest - * @instance - */ - CancelOperationRequest.prototype.name = ""; - - /** - * Creates a new CancelOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance - */ - CancelOperationRequest.create = function create(properties) { - return new CancelOperationRequest(properties); - }; - - /** - * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelOperationRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CancelOperationRequest message. - * @function verify - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CancelOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - */ - CancelOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.CancelOperationRequest) - return object; - var message = new $root.google.longrunning.CancelOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CancelOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this CancelOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.CancelOperationRequest - * @instance - * @returns {Object.} JSON object - */ - CancelOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CancelOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; - }; - - return CancelOperationRequest; - })(); - - longrunning.DeleteOperationRequest = (function() { - - /** - * Properties of a DeleteOperationRequest. - * @memberof google.longrunning - * @interface IDeleteOperationRequest - * @property {string|null} [name] DeleteOperationRequest name - */ - - /** - * Constructs a new DeleteOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a DeleteOperationRequest. - * @implements IDeleteOperationRequest - * @constructor - * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set - */ - function DeleteOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteOperationRequest name. - * @member {string} name - * @memberof google.longrunning.DeleteOperationRequest - * @instance - */ - DeleteOperationRequest.prototype.name = ""; - - /** - * Creates a new DeleteOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance - */ - DeleteOperationRequest.create = function create(properties) { - return new DeleteOperationRequest(properties); - }; - - /** - * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteOperationRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteOperationRequest message. - * @function verify - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - */ - DeleteOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.DeleteOperationRequest) - return object; - var message = new $root.google.longrunning.DeleteOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this DeleteOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.DeleteOperationRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; - }; - - return DeleteOperationRequest; - })(); - - longrunning.WaitOperationRequest = (function() { - - /** - * Properties of a WaitOperationRequest. - * @memberof google.longrunning - * @interface IWaitOperationRequest - * @property {string|null} [name] WaitOperationRequest name - * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout - */ - - /** - * Constructs a new WaitOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a WaitOperationRequest. - * @implements IWaitOperationRequest - * @constructor - * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set - */ - function WaitOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WaitOperationRequest name. - * @member {string} name - * @memberof google.longrunning.WaitOperationRequest - * @instance - */ - WaitOperationRequest.prototype.name = ""; - - /** - * WaitOperationRequest timeout. - * @member {google.protobuf.IDuration|null|undefined} timeout - * @memberof google.longrunning.WaitOperationRequest - * @instance - */ - WaitOperationRequest.prototype.timeout = null; - - /** - * Creates a new WaitOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance - */ - WaitOperationRequest.create = function create(properties) { - return new WaitOperationRequest(properties); - }; - - /** - * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) - $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitOperationRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WaitOperationRequest message. - * @function verify - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WaitOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.timeout != null && message.hasOwnProperty("timeout")) { - var error = $root.google.protobuf.Duration.verify(message.timeout); - if (error) - return "timeout." + error; - } - return null; - }; - - /** - * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - */ - WaitOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.WaitOperationRequest) - return object; - var message = new $root.google.longrunning.WaitOperationRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.timeout != null) { - if (typeof object.timeout !== "object") - throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); - message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); - } - return message; - }; - - /** - * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WaitOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.timeout = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.timeout != null && message.hasOwnProperty("timeout")) - object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); - return object; - }; - - /** - * Converts this WaitOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.WaitOperationRequest - * @instance - * @returns {Object.} JSON object - */ - WaitOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WaitOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; - }; - - return WaitOperationRequest; - })(); - - longrunning.OperationInfo = (function() { - - /** - * Properties of an OperationInfo. - * @memberof google.longrunning - * @interface IOperationInfo - * @property {string|null} [responseType] OperationInfo responseType - * @property {string|null} [metadataType] OperationInfo metadataType - */ - - /** - * Constructs a new OperationInfo. - * @memberof google.longrunning - * @classdesc Represents an OperationInfo. - * @implements IOperationInfo - * @constructor - * @param {google.longrunning.IOperationInfo=} [properties] Properties to set - */ - function OperationInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OperationInfo responseType. - * @member {string} responseType - * @memberof google.longrunning.OperationInfo - * @instance - */ - OperationInfo.prototype.responseType = ""; - - /** - * OperationInfo metadataType. - * @member {string} metadataType - * @memberof google.longrunning.OperationInfo - * @instance - */ - OperationInfo.prototype.metadataType = ""; - - /** - * Creates a new OperationInfo instance using the specified properties. - * @function create - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo=} [properties] Properties to set - * @returns {google.longrunning.OperationInfo} OperationInfo instance - */ - OperationInfo.create = function create(properties) { - return new OperationInfo(properties); - }; - - /** - * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @function encode - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); - if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); - return writer; - }; - - /** - * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OperationInfo message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.OperationInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.OperationInfo} OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.responseType = reader.string(); - break; - } - case 2: { - message.metadataType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OperationInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.OperationInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.OperationInfo} OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OperationInfo message. - * @function verify - * @memberof google.longrunning.OperationInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OperationInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.responseType != null && message.hasOwnProperty("responseType")) - if (!$util.isString(message.responseType)) - return "responseType: string expected"; - if (message.metadataType != null && message.hasOwnProperty("metadataType")) - if (!$util.isString(message.metadataType)) - return "metadataType: string expected"; - return null; - }; - - /** - * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.OperationInfo - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.OperationInfo} OperationInfo - */ - OperationInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.OperationInfo) - return object; - var message = new $root.google.longrunning.OperationInfo(); - if (object.responseType != null) - message.responseType = String(object.responseType); - if (object.metadataType != null) - message.metadataType = String(object.metadataType); - return message; - }; - - /** - * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.OperationInfo} message OperationInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OperationInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.responseType = ""; - object.metadataType = ""; - } - if (message.responseType != null && message.hasOwnProperty("responseType")) - object.responseType = message.responseType; - if (message.metadataType != null && message.hasOwnProperty("metadataType")) - object.metadataType = message.metadataType; - return object; - }; - - /** - * Converts this OperationInfo to JSON. - * @function toJSON - * @memberof google.longrunning.OperationInfo - * @instance - * @returns {Object.} JSON object - */ - OperationInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OperationInfo - * @function getTypeUrl - * @memberof google.longrunning.OperationInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.OperationInfo"; - }; - - return OperationInfo; - })(); - - return longrunning; - })(); - - google.rpc = (function() { - - /** - * Namespace rpc. - * @memberof google - * @namespace - */ - var rpc = {}; - - rpc.Status = (function() { - - /** - * Properties of a Status. - * @memberof google.rpc - * @interface IStatus - * @property {number|null} [code] Status code - * @property {string|null} [message] Status message - * @property {Array.|null} [details] Status details - */ - - /** - * Constructs a new Status. - * @memberof google.rpc - * @classdesc Represents a Status. - * @implements IStatus - * @constructor - * @param {google.rpc.IStatus=} [properties] Properties to set - */ - function Status(properties) { - this.details = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Status code. - * @member {number} code - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.code = 0; - - /** - * Status message. - * @member {string} message - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.message = ""; - - /** - * Status details. - * @member {Array.} details - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.details = $util.emptyArray; - - /** - * Creates a new Status instance using the specified properties. - * @function create - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus=} [properties] Properties to set - * @returns {google.rpc.Status} Status instance - */ - Status.create = function create(properties) { - return new Status(properties); - }; - - /** - * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encode - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.code != null && Object.hasOwnProperty.call(message, "code")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); - if (message.details != null && message.details.length) - for (var i = 0; i < message.details.length; ++i) - $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encodeDelimited - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Status message from the specified reader or buffer. - * @function decode - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.code = reader.int32(); - break; - } - case 2: { - message.message = reader.string(); - break; - } - case 3: { - if (!(message.details && message.details.length)) - message.details = []; - message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Status message. - * @function verify - * @memberof google.rpc.Status - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Status.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.code != null && message.hasOwnProperty("code")) - if (!$util.isInteger(message.code)) - return "code: integer expected"; - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - if (message.details != null && message.hasOwnProperty("details")) { - if (!Array.isArray(message.details)) - return "details: array expected"; - for (var i = 0; i < message.details.length; ++i) { - var error = $root.google.protobuf.Any.verify(message.details[i]); - if (error) - return "details." + error; - } - } - return null; - }; - - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.rpc.Status - * @static - * @param {Object.} object Plain object - * @returns {google.rpc.Status} Status - */ - Status.fromObject = function fromObject(object) { - if (object instanceof $root.google.rpc.Status) - return object; - var message = new $root.google.rpc.Status(); - if (object.code != null) - message.code = object.code | 0; - if (object.message != null) - message.message = String(object.message); - if (object.details) { - if (!Array.isArray(object.details)) - throw TypeError(".google.rpc.Status.details: array expected"); - message.details = []; - for (var i = 0; i < object.details.length; ++i) { - if (typeof object.details[i] !== "object") - throw TypeError(".google.rpc.Status.details: object expected"); - message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @function toObject - * @memberof google.rpc.Status - * @static - * @param {google.rpc.Status} message Status - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Status.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.details = []; - if (options.defaults) { - object.code = 0; - object.message = ""; - } - if (message.code != null && message.hasOwnProperty("code")) - object.code = message.code; - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - if (message.details && message.details.length) { - object.details = []; - for (var j = 0; j < message.details.length; ++j) - object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); - } - return object; - }; - - /** - * Converts this Status to JSON. - * @function toJSON - * @memberof google.rpc.Status - * @instance - * @returns {Object.} JSON object - */ - Status.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Status - * @function getTypeUrl - * @memberof google.rpc.Status - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.rpc.Status"; - }; - - return Status; - })(); - - return rpc; - })(); - - return google; - })(); - - return $root; -}); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.json b/owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.json deleted file mode 100644 index 15385d6317b..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.json +++ /dev/null @@ -1,4203 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "cloud": { - "nested": { - "batch": { - "nested": { - "v1alpha": { - "options": { - "csharp_namespace": "Google.Cloud.Batch.V1Alpha", - "go_package": "cloud.google.com/go/batch/apiv1alpha/batchpb;batchpb", - "java_multiple_files": true, - "java_outer_classname": "NotificationProto", - "java_package": "com.google.cloud.batch.v1alpha", - "objc_class_prefix": "GCB", - "php_namespace": "Google\\Cloud\\Batch\\V1alpha", - "ruby_package": "Google::Cloud::Batch::V1alpha" - }, - "nested": { - "BatchService": { - "options": { - "(google.api.default_host)": "batch.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "CreateJob": { - "requestType": "CreateJobRequest", - "responseType": "Job", - "options": { - "(google.api.http).post": "/v1alpha/{parent=projects/*/locations/*}/jobs", - "(google.api.http).body": "job", - "(google.api.method_signature)": "parent,job,job_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1alpha/{parent=projects/*/locations/*}/jobs", - "body": "job" - } - }, - { - "(google.api.method_signature)": "parent,job,job_id" - } - ] - }, - "GetJob": { - "requestType": "GetJobRequest", - "responseType": "Job", - "options": { - "(google.api.http).get": "/v1alpha/{name=projects/*/locations/*/jobs/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1alpha/{name=projects/*/locations/*/jobs/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "DeleteJob": { - "requestType": "DeleteJobRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v1alpha/{name=projects/*/locations/*/jobs/*}", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "google.cloud.batch.v1alpha.OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1alpha/{name=projects/*/locations/*/jobs/*}" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "google.cloud.batch.v1alpha.OperationMetadata" - } - } - ] - }, - "CancelJob": { - "requestType": "CancelJobRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1alpha/{name=projects/*/locations/*/jobs/*}:cancel", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "google.cloud.batch.v1alpha.CancelJobResponse", - "(google.longrunning.operation_info).metadata_type": "google.cloud.batch.v1alpha.OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1alpha/{name=projects/*/locations/*/jobs/*}:cancel", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.cloud.batch.v1alpha.CancelJobResponse", - "metadata_type": "google.cloud.batch.v1alpha.OperationMetadata" - } - } - ] - }, - "UpdateJob": { - "requestType": "UpdateJobRequest", - "responseType": "Job", - "options": { - "(google.api.http).patch": "/v1alpha/{job.name=projects/*/locations/*/jobs/*}", - "(google.api.http).body": "job", - "(google.api.method_signature)": "job,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1alpha/{job.name=projects/*/locations/*/jobs/*}", - "body": "job" - } - }, - { - "(google.api.method_signature)": "job,update_mask" - } - ] - }, - "ListJobs": { - "requestType": "ListJobsRequest", - "responseType": "ListJobsResponse", - "options": { - "(google.api.http).get": "/v1alpha/{parent=projects/*/locations/*}/jobs", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1alpha/{parent=projects/*/locations/*}/jobs" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetTask": { - "requestType": "GetTaskRequest", - "responseType": "Task", - "options": { - "(google.api.http).get": "/v1alpha/{name=projects/*/locations/*/jobs/*/taskGroups/*/tasks/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1alpha/{name=projects/*/locations/*/jobs/*/taskGroups/*/tasks/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListTasks": { - "requestType": "ListTasksRequest", - "responseType": "ListTasksResponse", - "options": { - "(google.api.http).get": "/v1alpha/{parent=projects/*/locations/*/jobs/*/taskGroups/*}/tasks", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1alpha/{parent=projects/*/locations/*/jobs/*/taskGroups/*}/tasks" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "CreateResourceAllowance": { - "requestType": "CreateResourceAllowanceRequest", - "responseType": "ResourceAllowance", - "options": { - "(google.api.http).post": "/v1alpha/{parent=projects/*/locations/*}/resourceAllowances", - "(google.api.http).body": "resource_allowance", - "(google.api.method_signature)": "parent,resource_allowance,resource_allowance_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1alpha/{parent=projects/*/locations/*}/resourceAllowances", - "body": "resource_allowance" - } - }, - { - "(google.api.method_signature)": "parent,resource_allowance,resource_allowance_id" - } - ] - }, - "GetResourceAllowance": { - "requestType": "GetResourceAllowanceRequest", - "responseType": "ResourceAllowance", - "options": { - "(google.api.http).get": "/v1alpha/{name=projects/*/locations/*/resourceAllowances/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1alpha/{name=projects/*/locations/*/resourceAllowances/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "DeleteResourceAllowance": { - "requestType": "DeleteResourceAllowanceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v1alpha/{name=projects/*/locations/*/resourceAllowances/*}", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "google.cloud.batch.v1alpha.OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1alpha/{name=projects/*/locations/*/resourceAllowances/*}" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "google.cloud.batch.v1alpha.OperationMetadata" - } - } - ] - }, - "ListResourceAllowances": { - "requestType": "ListResourceAllowancesRequest", - "responseType": "ListResourceAllowancesResponse", - "options": { - "(google.api.http).get": "/v1alpha/{parent=projects/*/locations/*}/resourceAllowances", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1alpha/{parent=projects/*/locations/*}/resourceAllowances" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "UpdateResourceAllowance": { - "requestType": "UpdateResourceAllowanceRequest", - "responseType": "ResourceAllowance", - "options": { - "(google.api.http).patch": "/v1alpha/{resource_allowance.name=projects/*/locations/*/resourceAllowances/*}", - "(google.api.http).body": "resource_allowance", - "(google.api.method_signature)": "resource_allowance,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1alpha/{resource_allowance.name=projects/*/locations/*/resourceAllowances/*}", - "body": "resource_allowance" - } - }, - { - "(google.api.method_signature)": "resource_allowance,update_mask" - } - ] - } - } - }, - "CreateJobRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "batch.googleapis.com/Job" - } - }, - "jobId": { - "type": "string", - "id": 2 - }, - "job": { - "type": "Job", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GetJobRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "batch.googleapis.com/Job" - } - } - } - }, - "DeleteJobRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "reason": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CancelJobRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "batch.googleapis.com/Job" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CancelJobResponse": { - "fields": {} - }, - "UpdateJobRequest": { - "fields": { - "job": { - "type": "Job", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListJobsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1 - }, - "filter": { - "type": "string", - "id": 4 - }, - "orderBy": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListJobsResponse": { - "fields": { - "jobs": { - "rule": "repeated", - "type": "Job", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "ListTasksRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "batch.googleapis.com/TaskGroup" - } - }, - "filter": { - "type": "string", - "id": 2 - }, - "orderBy": { - "type": "string", - "id": 5 - }, - "pageSize": { - "type": "int32", - "id": 3 - }, - "pageToken": { - "type": "string", - "id": 4 - } - } - }, - "ListTasksResponse": { - "fields": { - "tasks": { - "rule": "repeated", - "type": "Task", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "GetTaskRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "batch.googleapis.com/Task" - } - } - } - }, - "CreateResourceAllowanceRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "batch.googleapis.com/ResourceAllowance" - } - }, - "resourceAllowanceId": { - "type": "string", - "id": 2 - }, - "resourceAllowance": { - "type": "ResourceAllowance", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GetResourceAllowanceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "batch.googleapis.com/ResourceAllowance" - } - } - } - }, - "DeleteResourceAllowanceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "batch.googleapis.com/ResourceAllowance" - } - }, - "reason": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListResourceAllowancesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "batch.googleapis.com/ResourceAllowance" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListResourceAllowancesResponse": { - "fields": { - "resourceAllowances": { - "rule": "repeated", - "type": "ResourceAllowance", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "UpdateResourceAllowanceRequest": { - "fields": { - "resourceAllowance": { - "type": "ResourceAllowance", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "OperationMetadata": { - "fields": { - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "target": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "verb": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "statusMessage": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "requestedCancellation": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "apiVersion": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "Job": { - "options": { - "(google.api.resource).type": "batch.googleapis.com/Job", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/jobs/{job}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "uid": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "priority": { - "type": "int64", - "id": 3 - }, - "taskGroups": { - "rule": "repeated", - "type": "TaskGroup", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "schedulingPolicy": { - "type": "SchedulingPolicy", - "id": 5 - }, - "dependencies": { - "rule": "repeated", - "type": "JobDependency", - "id": 6 - }, - "allocationPolicy": { - "type": "AllocationPolicy", - "id": 7 - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 8 - }, - "status": { - "type": "JobStatus", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "notification": { - "type": "JobNotification", - "id": 10, - "options": { - "deprecated": true - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "logsPolicy": { - "type": "LogsPolicy", - "id": 13 - }, - "notifications": { - "rule": "repeated", - "type": "JobNotification", - "id": 14 - } - }, - "nested": { - "SchedulingPolicy": { - "values": { - "SCHEDULING_POLICY_UNSPECIFIED": 0, - "AS_SOON_AS_POSSIBLE": 1 - } - } - } - }, - "LogsPolicy": { - "fields": { - "destination": { - "type": "Destination", - "id": 1 - }, - "logsPath": { - "type": "string", - "id": 2 - }, - "cloudLoggingOption": { - "type": "CloudLoggingOption", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "CloudLoggingOption": { - "fields": { - "useGenericTaskMonitoredResource": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Destination": { - "values": { - "DESTINATION_UNSPECIFIED": 0, - "CLOUD_LOGGING": 1, - "PATH": 2 - } - } - } - }, - "JobDependency": { - "fields": { - "items": { - "keyType": "string", - "type": "Type", - "id": 1 - } - }, - "nested": { - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "SUCCEEDED": 1, - "FAILED": 2, - "FINISHED": 3 - } - } - } - }, - "JobStatus": { - "fields": { - "state": { - "type": "State", - "id": 1 - }, - "statusEvents": { - "rule": "repeated", - "type": "StatusEvent", - "id": 2 - }, - "taskGroups": { - "keyType": "string", - "type": "TaskGroupStatus", - "id": 4 - }, - "runDuration": { - "type": "google.protobuf.Duration", - "id": 5 - }, - "resourceUsage": { - "type": "ResourceUsage", - "id": 6 - } - }, - "nested": { - "InstanceStatus": { - "fields": { - "machineType": { - "type": "string", - "id": 1 - }, - "provisioningModel": { - "type": "AllocationPolicy.ProvisioningModel", - "id": 2 - }, - "taskPack": { - "type": "int64", - "id": 3 - }, - "bootDisk": { - "type": "AllocationPolicy.Disk", - "id": 4 - } - } - }, - "TaskGroupStatus": { - "fields": { - "counts": { - "keyType": "string", - "type": "int64", - "id": 1 - }, - "instances": { - "rule": "repeated", - "type": "InstanceStatus", - "id": 2 - } - } - }, - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "QUEUED": 1, - "SCHEDULED": 2, - "RUNNING": 3, - "SUCCEEDED": 4, - "FAILED": 5, - "DELETION_IN_PROGRESS": 6, - "CANCELLATION_IN_PROGRESS": 7, - "CANCELLED": 8 - } - } - } - }, - "ResourceUsage": { - "fields": { - "coreHours": { - "type": "double", - "id": 1 - } - } - }, - "JobNotification": { - "fields": { - "pubsubTopic": { - "type": "string", - "id": 1 - }, - "message": { - "type": "Message", - "id": 2 - } - }, - "nested": { - "Message": { - "fields": { - "type": { - "type": "Type", - "id": 1 - }, - "newJobState": { - "type": "JobStatus.State", - "id": 2 - }, - "newTaskState": { - "type": "TaskStatus.State", - "id": 3 - } - } - }, - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "JOB_STATE_CHANGED": 1, - "TASK_STATE_CHANGED": 2 - } - } - } - }, - "AllocationPolicy": { - "fields": { - "location": { - "type": "LocationPolicy", - "id": 1 - }, - "instance": { - "type": "InstancePolicy", - "id": 2, - "options": { - "deprecated": true - } - }, - "instances": { - "rule": "repeated", - "type": "InstancePolicyOrTemplate", - "id": 8 - }, - "instanceTemplates": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "deprecated": true - } - }, - "provisioningModels": { - "rule": "repeated", - "type": "ProvisioningModel", - "id": 4, - "options": { - "deprecated": true - } - }, - "serviceAccountEmail": { - "type": "string", - "id": 5, - "options": { - "deprecated": true - } - }, - "serviceAccount": { - "type": "ServiceAccount", - "id": 9 - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 6 - }, - "network": { - "type": "NetworkPolicy", - "id": 7 - }, - "placement": { - "type": "PlacementPolicy", - "id": 10 - }, - "tags": { - "rule": "repeated", - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "LocationPolicy": { - "fields": { - "allowedLocations": { - "rule": "repeated", - "type": "string", - "id": 1 - }, - "deniedLocations": { - "rule": "repeated", - "type": "string", - "id": 2 - } - } - }, - "Disk": { - "oneofs": { - "dataSource": { - "oneof": [ - "image", - "snapshot" - ] - } - }, - "fields": { - "image": { - "type": "string", - "id": 4 - }, - "snapshot": { - "type": "string", - "id": 5 - }, - "type": { - "type": "string", - "id": 1 - }, - "sizeGb": { - "type": "int64", - "id": 2 - }, - "diskInterface": { - "type": "string", - "id": 6 - } - } - }, - "AttachedDisk": { - "oneofs": { - "attached": { - "oneof": [ - "newDisk", - "existingDisk" - ] - } - }, - "fields": { - "newDisk": { - "type": "Disk", - "id": 1 - }, - "existingDisk": { - "type": "string", - "id": 2 - }, - "deviceName": { - "type": "string", - "id": 3 - } - } - }, - "Accelerator": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "count": { - "type": "int64", - "id": 2 - }, - "installGpuDrivers": { - "type": "bool", - "id": 3, - "options": { - "deprecated": true - } - }, - "driverVersion": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "InstancePolicy": { - "fields": { - "allowedMachineTypes": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "deprecated": true - } - }, - "machineType": { - "type": "string", - "id": 2 - }, - "minCpuPlatform": { - "type": "string", - "id": 3 - }, - "provisioningModel": { - "type": "ProvisioningModel", - "id": 4 - }, - "accelerators": { - "rule": "repeated", - "type": "Accelerator", - "id": 5 - }, - "bootDisk": { - "type": "Disk", - "id": 8 - }, - "disks": { - "rule": "repeated", - "type": "AttachedDisk", - "id": 6 - }, - "reservation": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "InstancePolicyOrTemplate": { - "oneofs": { - "policyTemplate": { - "oneof": [ - "policy", - "instanceTemplate" - ] - } - }, - "fields": { - "policy": { - "type": "InstancePolicy", - "id": 1 - }, - "instanceTemplate": { - "type": "string", - "id": 2 - }, - "installGpuDrivers": { - "type": "bool", - "id": 3 - }, - "installOpsAgent": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "blockProjectSshKeys": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "NetworkInterface": { - "fields": { - "network": { - "type": "string", - "id": 1 - }, - "subnetwork": { - "type": "string", - "id": 2 - }, - "noExternalIpAddress": { - "type": "bool", - "id": 3 - } - } - }, - "NetworkPolicy": { - "fields": { - "networkInterfaces": { - "rule": "repeated", - "type": "NetworkInterface", - "id": 1 - } - } - }, - "PlacementPolicy": { - "fields": { - "collocation": { - "type": "string", - "id": 1 - }, - "maxDistance": { - "type": "int64", - "id": 2 - } - } - }, - "ProvisioningModel": { - "values": { - "PROVISIONING_MODEL_UNSPECIFIED": 0, - "STANDARD": 1, - "SPOT": 2, - "PREEMPTIBLE": 3 - } - } - } - }, - "TaskGroup": { - "options": { - "(google.api.resource).type": "batch.googleapis.com/TaskGroup", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "taskSpec": { - "type": "TaskSpec", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "taskCount": { - "type": "int64", - "id": 4 - }, - "parallelism": { - "type": "int64", - "id": 5 - }, - "schedulingPolicy": { - "type": "SchedulingPolicy", - "id": 6 - }, - "allocationPolicy": { - "type": "AllocationPolicy", - "id": 7 - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 8 - }, - "taskEnvironments": { - "rule": "repeated", - "type": "Environment", - "id": 9 - }, - "taskCountPerNode": { - "type": "int64", - "id": 10 - }, - "requireHostsFile": { - "type": "bool", - "id": 11 - }, - "permissiveSsh": { - "type": "bool", - "id": 12 - }, - "runAsNonRoot": { - "type": "bool", - "id": 14, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "serviceAccount": { - "type": "ServiceAccount", - "id": 15, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "SchedulingPolicy": { - "values": { - "SCHEDULING_POLICY_UNSPECIFIED": 0, - "AS_SOON_AS_POSSIBLE": 1, - "IN_ORDER": 2 - } - } - } - }, - "ServiceAccount": { - "fields": { - "email": { - "type": "string", - "id": 1 - }, - "scopes": { - "rule": "repeated", - "type": "string", - "id": 2 - } - } - }, - "ComputeResource": { - "fields": { - "cpuMilli": { - "type": "int64", - "id": 1 - }, - "memoryMib": { - "type": "int64", - "id": 2 - }, - "gpuCount": { - "type": "int64", - "id": 3 - }, - "bootDiskMib": { - "type": "int64", - "id": 4 - } - } - }, - "StatusEvent": { - "fields": { - "type": { - "type": "string", - "id": 3 - }, - "description": { - "type": "string", - "id": 1 - }, - "eventTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "taskExecution": { - "type": "TaskExecution", - "id": 4 - }, - "taskState": { - "type": "TaskStatus.State", - "id": 5 - } - } - }, - "TaskExecution": { - "fields": { - "exitCode": { - "type": "int32", - "id": 1 - }, - "stderrSnippet": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "TaskStatus": { - "fields": { - "state": { - "type": "State", - "id": 1 - }, - "statusEvents": { - "rule": "repeated", - "type": "StatusEvent", - "id": 2 - }, - "resourceUsage": { - "type": "TaskResourceUsage", - "id": 3 - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "PENDING": 1, - "ASSIGNED": 2, - "RUNNING": 3, - "FAILED": 4, - "SUCCEEDED": 5, - "UNEXECUTED": 6 - } - } - } - }, - "TaskResourceUsage": { - "fields": { - "coreHours": { - "type": "double", - "id": 1 - } - } - }, - "Runnable": { - "oneofs": { - "executable": { - "oneof": [ - "container", - "script", - "barrier" - ] - } - }, - "fields": { - "container": { - "type": "Container", - "id": 1 - }, - "script": { - "type": "Script", - "id": 2 - }, - "barrier": { - "type": "Barrier", - "id": 6 - }, - "displayName": { - "type": "string", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "ignoreExitStatus": { - "type": "bool", - "id": 3 - }, - "background": { - "type": "bool", - "id": 4 - }, - "alwaysRun": { - "type": "bool", - "id": 5 - }, - "environment": { - "type": "Environment", - "id": 7 - }, - "timeout": { - "type": "google.protobuf.Duration", - "id": 8 - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 9 - } - }, - "nested": { - "Container": { - "fields": { - "imageUri": { - "type": "string", - "id": 1 - }, - "commands": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "entrypoint": { - "type": "string", - "id": 3 - }, - "volumes": { - "rule": "repeated", - "type": "string", - "id": 7 - }, - "options": { - "type": "string", - "id": 8 - }, - "blockExternalNetwork": { - "type": "bool", - "id": 9 - }, - "username": { - "type": "string", - "id": 10 - }, - "password": { - "type": "string", - "id": 11 - }, - "enableImageStreaming": { - "type": "bool", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Script": { - "oneofs": { - "command": { - "oneof": [ - "path", - "text" - ] - } - }, - "fields": { - "path": { - "type": "string", - "id": 1 - }, - "text": { - "type": "string", - "id": 2 - } - } - }, - "Barrier": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - } - } - }, - "TaskSpec": { - "fields": { - "runnables": { - "rule": "repeated", - "type": "Runnable", - "id": 8 - }, - "computeResource": { - "type": "ComputeResource", - "id": 3 - }, - "maxRunDuration": { - "type": "google.protobuf.Duration", - "id": 4 - }, - "maxRetryCount": { - "type": "int32", - "id": 5 - }, - "lifecyclePolicies": { - "rule": "repeated", - "type": "LifecyclePolicy", - "id": 9 - }, - "environments": { - "keyType": "string", - "type": "string", - "id": 6, - "options": { - "deprecated": true - } - }, - "volumes": { - "rule": "repeated", - "type": "Volume", - "id": 7 - }, - "environment": { - "type": "Environment", - "id": 10 - } - } - }, - "LifecyclePolicy": { - "fields": { - "action": { - "type": "Action", - "id": 1 - }, - "actionCondition": { - "type": "ActionCondition", - "id": 2 - } - }, - "nested": { - "ActionCondition": { - "fields": { - "exitCodes": { - "rule": "repeated", - "type": "int32", - "id": 1 - } - } - }, - "Action": { - "values": { - "ACTION_UNSPECIFIED": 0, - "RETRY_TASK": 1, - "FAIL_TASK": 2 - } - } - } - }, - "Task": { - "options": { - "(google.api.resource).type": "batch.googleapis.com/Task", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}/tasks/{task}" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "status": { - "type": "TaskStatus", - "id": 2 - } - } - }, - "Environment": { - "fields": { - "variables": { - "keyType": "string", - "type": "string", - "id": 1 - }, - "secretVariables": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "encryptedVariables": { - "type": "KMSEnvMap", - "id": 3 - } - }, - "nested": { - "KMSEnvMap": { - "fields": { - "keyName": { - "type": "string", - "id": 1 - }, - "cipherText": { - "type": "string", - "id": 2 - } - } - } - } - }, - "Volume": { - "oneofs": { - "source": { - "oneof": [ - "nfs", - "pd", - "gcs", - "deviceName" - ] - } - }, - "fields": { - "nfs": { - "type": "NFS", - "id": 1 - }, - "pd": { - "type": "PD", - "id": 2, - "options": { - "deprecated": true - } - }, - "gcs": { - "type": "GCS", - "id": 3 - }, - "deviceName": { - "type": "string", - "id": 6 - }, - "mountPath": { - "type": "string", - "id": 4 - }, - "mountOptions": { - "rule": "repeated", - "type": "string", - "id": 5 - } - } - }, - "NFS": { - "fields": { - "server": { - "type": "string", - "id": 1 - }, - "remotePath": { - "type": "string", - "id": 2 - } - } - }, - "PD": { - "fields": { - "disk": { - "type": "string", - "id": 1 - }, - "device": { - "type": "string", - "id": 2 - }, - "existing": { - "type": "bool", - "id": 3, - "options": { - "deprecated": true - } - } - } - }, - "GCS": { - "fields": { - "remotePath": { - "type": "string", - "id": 1 - } - } - }, - "CalendarPeriod": { - "values": { - "CALENDAR_PERIOD_UNSPECIFIED": 0, - "MONTH": 1, - "QUARTER": 2, - "YEAR": 3, - "WEEK": 4, - "DAY": 5 - } - }, - "ResourceAllowanceState": { - "values": { - "RESOURCE_ALLOWANCE_STATE_UNSPECIFIED": 0, - "RESOURCE_ALLOWANCE_ACTIVE": 1, - "RESOURCE_ALLOWANCE_DEPLETED": 2 - } - }, - "ResourceAllowance": { - "options": { - "(google.api.resource).type": "batch.googleapis.com/ResourceAllowance", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/resourceAllowances/{resource_allowance}", - "(google.api.resource).plural": "resourceAllowances", - "(google.api.resource).singular": "resourceAllowance" - }, - "oneofs": { - "resourceAllowance": { - "oneof": [ - "usageResourceAllowance" - ] - } - }, - "fields": { - "usageResourceAllowance": { - "type": "UsageResourceAllowance", - "id": 4 - }, - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "uid": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "notifications": { - "rule": "repeated", - "type": "Notification", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "UsageResourceAllowance": { - "fields": { - "spec": { - "type": "UsageResourceAllowanceSpec", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "status": { - "type": "UsageResourceAllowanceStatus", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "UsageResourceAllowanceSpec": { - "fields": { - "type": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "limit": { - "type": "Limit", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "Limit": { - "oneofs": { - "duration": { - "oneof": [ - "calendarPeriod" - ] - }, - "_limit": { - "oneof": [ - "limit" - ] - } - }, - "fields": { - "calendarPeriod": { - "type": "CalendarPeriod", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "limit": { - "type": "double", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "proto3_optional": true - } - } - } - } - } - }, - "UsageResourceAllowanceStatus": { - "fields": { - "state": { - "type": "ResourceAllowanceState", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "limitStatus": { - "type": "LimitStatus", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "report": { - "type": "ConsumptionReport", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "LimitStatus": { - "oneofs": { - "_limit": { - "oneof": [ - "limit" - ] - }, - "_consumed": { - "oneof": [ - "consumed" - ] - } - }, - "fields": { - "consumptionInterval": { - "type": "google.type.Interval", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "limit": { - "type": "double", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "consumed": { - "type": "double", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - } - } - }, - "PeriodConsumption": { - "oneofs": { - "_consumed": { - "oneof": [ - "consumed" - ] - } - }, - "fields": { - "consumptionInterval": { - "type": "google.type.Interval", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "consumed": { - "type": "double", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - } - } - }, - "ConsumptionReport": { - "fields": { - "latestPeriodConsumptions": { - "keyType": "string", - "type": "PeriodConsumption", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - } - } - }, - "Notification": { - "fields": { - "pubsubTopic": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - } - } - } - } - } - } - }, - "api": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", - "java_multiple_files": true, - "java_outer_classname": "ResourceProto", - "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true - }, - "nested": { - "http": { - "type": "HttpRule", - "id": 72295728, - "extend": "google.protobuf.MethodOptions" - }, - "Http": { - "fields": { - "rules": { - "rule": "repeated", - "type": "HttpRule", - "id": 1 - }, - "fullyDecodeReservedExpansion": { - "type": "bool", - "id": 2 - } - } - }, - "HttpRule": { - "oneofs": { - "pattern": { - "oneof": [ - "get", - "put", - "post", - "delete", - "patch", - "custom" - ] - } - }, - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "get": { - "type": "string", - "id": 2 - }, - "put": { - "type": "string", - "id": 3 - }, - "post": { - "type": "string", - "id": 4 - }, - "delete": { - "type": "string", - "id": 5 - }, - "patch": { - "type": "string", - "id": 6 - }, - "custom": { - "type": "CustomHttpPattern", - "id": 8 - }, - "body": { - "type": "string", - "id": 7 - }, - "responseBody": { - "type": "string", - "id": 12 - }, - "additionalBindings": { - "rule": "repeated", - "type": "HttpRule", - "id": 11 - } - } - }, - "CustomHttpPattern": { - "fields": { - "kind": { - "type": "string", - "id": 1 - }, - "path": { - "type": "string", - "id": 2 - } - } - }, - "methodSignature": { - "rule": "repeated", - "type": "string", - "id": 1051, - "extend": "google.protobuf.MethodOptions" - }, - "defaultHost": { - "type": "string", - "id": 1049, - "extend": "google.protobuf.ServiceOptions" - }, - "oauthScopes": { - "type": "string", - "id": 1050, - "extend": "google.protobuf.ServiceOptions" - }, - "apiVersion": { - "type": "string", - "id": 525000001, - "extend": "google.protobuf.ServiceOptions" - }, - "CommonLanguageSettings": { - "fields": { - "referenceDocsUri": { - "type": "string", - "id": 1, - "options": { - "deprecated": true - } - }, - "destinations": { - "rule": "repeated", - "type": "ClientLibraryDestination", - "id": 2 - } - } - }, - "ClientLibrarySettings": { - "fields": { - "version": { - "type": "string", - "id": 1 - }, - "launchStage": { - "type": "LaunchStage", - "id": 2 - }, - "restNumericEnums": { - "type": "bool", - "id": 3 - }, - "javaSettings": { - "type": "JavaSettings", - "id": 21 - }, - "cppSettings": { - "type": "CppSettings", - "id": 22 - }, - "phpSettings": { - "type": "PhpSettings", - "id": 23 - }, - "pythonSettings": { - "type": "PythonSettings", - "id": 24 - }, - "nodeSettings": { - "type": "NodeSettings", - "id": 25 - }, - "dotnetSettings": { - "type": "DotnetSettings", - "id": 26 - }, - "rubySettings": { - "type": "RubySettings", - "id": 27 - }, - "goSettings": { - "type": "GoSettings", - "id": 28 - } - } - }, - "Publishing": { - "fields": { - "methodSettings": { - "rule": "repeated", - "type": "MethodSettings", - "id": 2 - }, - "newIssueUri": { - "type": "string", - "id": 101 - }, - "documentationUri": { - "type": "string", - "id": 102 - }, - "apiShortName": { - "type": "string", - "id": 103 - }, - "githubLabel": { - "type": "string", - "id": 104 - }, - "codeownerGithubTeams": { - "rule": "repeated", - "type": "string", - "id": 105 - }, - "docTagPrefix": { - "type": "string", - "id": 106 - }, - "organization": { - "type": "ClientLibraryOrganization", - "id": 107 - }, - "librarySettings": { - "rule": "repeated", - "type": "ClientLibrarySettings", - "id": 109 - }, - "protoReferenceDocumentationUri": { - "type": "string", - "id": 110 - }, - "restReferenceDocumentationUri": { - "type": "string", - "id": 111 - } - } - }, - "JavaSettings": { - "fields": { - "libraryPackage": { - "type": "string", - "id": 1 - }, - "serviceClassNames": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "common": { - "type": "CommonLanguageSettings", - "id": 3 - } - } - }, - "CppSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "PhpSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "PythonSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "NodeSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "DotnetSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - }, - "renamedServices": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "renamedResources": { - "keyType": "string", - "type": "string", - "id": 3 - }, - "ignoredResources": { - "rule": "repeated", - "type": "string", - "id": 4 - }, - "forcedNamespaceAliases": { - "rule": "repeated", - "type": "string", - "id": 5 - }, - "handwrittenSignatures": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - }, - "RubySettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "GoSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "MethodSettings": { - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "longRunning": { - "type": "LongRunning", - "id": 2 - }, - "autoPopulatedFields": { - "rule": "repeated", - "type": "string", - "id": 3 - } - }, - "nested": { - "LongRunning": { - "fields": { - "initialPollDelay": { - "type": "google.protobuf.Duration", - "id": 1 - }, - "pollDelayMultiplier": { - "type": "float", - "id": 2 - }, - "maxPollDelay": { - "type": "google.protobuf.Duration", - "id": 3 - }, - "totalPollTimeout": { - "type": "google.protobuf.Duration", - "id": 4 - } - } - } - } - }, - "ClientLibraryOrganization": { - "values": { - "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, - "CLOUD": 1, - "ADS": 2, - "PHOTOS": 3, - "STREET_VIEW": 4, - "SHOPPING": 5, - "GEO": 6, - "GENERATIVE_AI": 7 - } - }, - "ClientLibraryDestination": { - "values": { - "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, - "GITHUB": 10, - "PACKAGE_MANAGER": 20 - } - }, - "LaunchStage": { - "values": { - "LAUNCH_STAGE_UNSPECIFIED": 0, - "UNIMPLEMENTED": 6, - "PRELAUNCH": 7, - "EARLY_ACCESS": 1, - "ALPHA": 2, - "BETA": 3, - "GA": 4, - "DEPRECATED": 5 - } - }, - "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 - } - }, - "fieldInfo": { - "type": "google.api.FieldInfo", - "id": 291403980, - "extend": "google.protobuf.FieldOptions" - }, - "FieldInfo": { - "fields": { - "format": { - "type": "Format", - "id": 1 - } - }, - "nested": { - "Format": { - "values": { - "FORMAT_UNSPECIFIED": 0, - "UUID4": 1, - "IPV4": 2, - "IPV6": 3, - "IPV4_OR_IPV6": 4 - } - } - } - }, - "resourceReference": { - "type": "google.api.ResourceReference", - "id": 1055, - "extend": "google.protobuf.FieldOptions" - }, - "resourceDefinition": { - "rule": "repeated", - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.FileOptions" - }, - "resource": { - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.MessageOptions" - }, - "ResourceDescriptor": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "pattern": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "nameField": { - "type": "string", - "id": 3 - }, - "history": { - "type": "History", - "id": 4 - }, - "plural": { - "type": "string", - "id": 5 - }, - "singular": { - "type": "string", - "id": 6 - }, - "style": { - "rule": "repeated", - "type": "Style", - "id": 10 - } - }, - "nested": { - "History": { - "values": { - "HISTORY_UNSPECIFIED": 0, - "ORIGINALLY_SINGLE_PATTERN": 1, - "FUTURE_MULTI_PATTERN": 2 - } - }, - "Style": { - "values": { - "STYLE_UNSPECIFIED": 0, - "DECLARATIVE_FRIENDLY": 1 - } - } - } - }, - "ResourceReference": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "childType": { - "type": "string", - "id": 2 - } - } - } - } - }, - "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": { - "fields": { - "file": { - "rule": "repeated", - "type": "FileDescriptorProto", - "id": 1 - } - } - }, - "Edition": { - "values": { - "EDITION_UNKNOWN": 0, - "EDITION_PROTO2": 998, - "EDITION_PROTO3": 999, - "EDITION_2023": 1000, - "EDITION_2024": 1001, - "EDITION_1_TEST_ONLY": 1, - "EDITION_2_TEST_ONLY": 2, - "EDITION_99997_TEST_ONLY": 99997, - "EDITION_99998_TEST_ONLY": 99998, - "EDITION_99999_TEST_ONLY": 99999, - "EDITION_MAX": 2147483647 - } - }, - "FileDescriptorProto": { - "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, - "options": { - "packed": false - } - }, - "weakDependency": { - "rule": "repeated", - "type": "int32", - "id": 11, - "options": { - "packed": false - } - }, - "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": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "field": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 2 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 6 - }, - "nestedType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 3 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 4 - }, - "extensionRange": { - "rule": "repeated", - "type": "ExtensionRange", - "id": 5 - }, - "oneofDecl": { - "rule": "repeated", - "type": "OneofDescriptorProto", - "id": 8 - }, - "options": { - "type": "MessageOptions", - "id": 7 - }, - "reservedRange": { - "rule": "repeated", - "type": "ReservedRange", - "id": 9 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 10 - } - }, - "nested": { - "ExtensionRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "ExtensionRangeOptions", - "id": 3 - } - } - }, - "ReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "ExtensionRangeOptions": { - "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": { - "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": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "options": { - "type": "OneofOptions", - "id": 2 - } - } - }, - "EnumDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "value": { - "rule": "repeated", - "type": "EnumValueDescriptorProto", - "id": 2 - }, - "options": { - "type": "EnumOptions", - "id": 3 - }, - "reservedRange": { - "rule": "repeated", - "type": "EnumReservedRange", - "id": 4 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 5 - } - }, - "nested": { - "EnumReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "EnumValueDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "EnumValueOptions", - "id": 3 - } - } - }, - "ServiceDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "method": { - "rule": "repeated", - "type": "MethodDescriptorProto", - "id": 2 - }, - "options": { - "type": "ServiceOptions", - "id": 3 - } - } - }, - "MethodDescriptorProto": { - "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": { - "fields": { - "javaPackage": { - "type": "string", - "id": 1 - }, - "javaOuterClassname": { - "type": "string", - "id": 8 - }, - "javaMultipleFiles": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "javaGenerateEqualsAndHash": { - "type": "bool", - "id": 20, - "options": { - "deprecated": true - } - }, - "javaStringCheckUtf8": { - "type": "bool", - "id": 27, - "options": { - "default": false - } - }, - "optimizeFor": { - "type": "OptimizeMode", - "id": 9, - "options": { - "default": "SPEED" - } - }, - "goPackage": { - "type": "string", - "id": 11 - }, - "ccGenericServices": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "javaGenericServices": { - "type": "bool", - "id": 17, - "options": { - "default": false - } - }, - "pyGenericServices": { - "type": "bool", - "id": 18, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 23, - "options": { - "default": false - } - }, - "ccEnableArenas": { - "type": "bool", - "id": 31, - "options": { - "default": true - } - }, - "objcClassPrefix": { - "type": "string", - "id": 36 - }, - "csharpNamespace": { - "type": "string", - "id": 37 - }, - "swiftPrefix": { - "type": "string", - "id": 39 - }, - "phpClassPrefix": { - "type": "string", - "id": 40 - }, - "phpNamespace": { - "type": "string", - "id": 41 - }, - "phpMetadataNamespace": { - "type": "string", - "id": 44 - }, - "rubyPackage": { - "type": "string", - "id": 45 - }, - "features": { - "type": "FeatureSet", - "id": 50 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 42, - 42 - ], - [ - 38, - 38 - ] - ], - "nested": { - "OptimizeMode": { - "values": { - "SPEED": 1, - "CODE_SIZE": 2, - "LITE_RUNTIME": 3 - } - } - } - }, - "MessageOptions": { - "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": { - "fields": { - "ctype": { - "type": "CType", - "id": 1, - "options": { - "default": "STRING" - } - }, - "packed": { - "type": "bool", - "id": 2 - }, - "jstype": { - "type": "JSType", - "id": 6, - "options": { - "default": "JS_NORMAL" - } - }, - "lazy": { - "type": "bool", - "id": 5, - "options": { - "default": false - } - }, - "unverifiedLazy": { - "type": "bool", - "id": 15, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "weak": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "debugRedact": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "retention": { - "type": "OptionRetention", - "id": 17 - }, - "targets": { - "rule": "repeated", - "type": "OptionTargetType", - "id": 19, - "options": { - "packed": false - } - }, - "editionDefaults": { - "rule": "repeated", - "type": "EditionDefault", - "id": 20 - }, - "features": { - "type": "FeatureSet", - "id": 21 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 18, - 18 - ] - ], - "nested": { - "CType": { - "values": { - "STRING": 0, - "CORD": 1, - "STRING_PIECE": 2 - } - }, - "JSType": { - "values": { - "JS_NORMAL": 0, - "JS_STRING": 1, - "JS_NUMBER": 2 - } - }, - "OptionRetention": { - "values": { - "RETENTION_UNKNOWN": 0, - "RETENTION_RUNTIME": 1, - "RETENTION_SOURCE": 2 - } - }, - "OptionTargetType": { - "values": { - "TARGET_TYPE_UNKNOWN": 0, - "TARGET_TYPE_FILE": 1, - "TARGET_TYPE_EXTENSION_RANGE": 2, - "TARGET_TYPE_MESSAGE": 3, - "TARGET_TYPE_FIELD": 4, - "TARGET_TYPE_ONEOF": 5, - "TARGET_TYPE_ENUM": 6, - "TARGET_TYPE_ENUM_ENTRY": 7, - "TARGET_TYPE_SERVICE": 8, - "TARGET_TYPE_METHOD": 9 - } - }, - "EditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "value": { - "type": "string", - "id": 2 - } - } - } - } - }, - "OneofOptions": { - "fields": { - "features": { - "type": "FeatureSet", - "id": 1 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "EnumOptions": { - "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": { - "fields": { - "deprecated": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "features": { - "type": "FeatureSet", - "id": 2 - }, - "debugRedact": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "ServiceOptions": { - "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": { - "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": { - "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": { - "fields": { - "fieldPresence": { - "type": "FieldPresence", - "id": 1, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_2023", - "edition_defaults.value": "EXPLICIT" - } - }, - "enumType": { - "type": "EnumType", - "id": 2, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "OPEN" - } - }, - "repeatedFieldEncoding": { - "type": "RepeatedFieldEncoding", - "id": 3, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "PACKED" - } - }, - "utf8Validation": { - "type": "Utf8Validation", - "id": 4, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "VERIFY" - } - }, - "messageEncoding": { - "type": "MessageEncoding", - "id": 5, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO2", - "edition_defaults.value": "LENGTH_PREFIXED" - } - }, - "jsonFormat": { - "type": "JsonFormat", - "id": 6, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "ALLOW" - } - } - }, - "extensions": [ - [ - 1000, - 1000 - ], - [ - 1001, - 1001 - ], - [ - 1002, - 1002 - ], - [ - 9990, - 9990 - ], - [ - 9995, - 9999 - ], - [ - 10000, - 10000 - ] - ], - "reserved": [ - [ - 999, - 999 - ] - ], - "nested": { - "FieldPresence": { - "values": { - "FIELD_PRESENCE_UNKNOWN": 0, - "EXPLICIT": 1, - "IMPLICIT": 2, - "LEGACY_REQUIRED": 3 - } - }, - "EnumType": { - "values": { - "ENUM_TYPE_UNKNOWN": 0, - "OPEN": 1, - "CLOSED": 2 - } - }, - "RepeatedFieldEncoding": { - "values": { - "REPEATED_FIELD_ENCODING_UNKNOWN": 0, - "PACKED": 1, - "EXPANDED": 2 - } - }, - "Utf8Validation": { - "values": { - "UTF8_VALIDATION_UNKNOWN": 0, - "VERIFY": 2, - "NONE": 3 - } - }, - "MessageEncoding": { - "values": { - "MESSAGE_ENCODING_UNKNOWN": 0, - "LENGTH_PREFIXED": 1, - "DELIMITED": 2 - } - }, - "JsonFormat": { - "values": { - "JSON_FORMAT_UNKNOWN": 0, - "ALLOW": 1, - "LEGACY_BEST_EFFORT": 2 - } - } - } - }, - "FeatureSetDefaults": { - "fields": { - "defaults": { - "rule": "repeated", - "type": "FeatureSetEditionDefault", - "id": 1 - }, - "minimumEdition": { - "type": "Edition", - "id": 4 - }, - "maximumEdition": { - "type": "Edition", - "id": 5 - } - }, - "nested": { - "FeatureSetEditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "features": { - "type": "FeatureSet", - "id": 2 - } - } - } - } - }, - "SourceCodeInfo": { - "fields": { - "location": { - "rule": "repeated", - "type": "Location", - "id": 1 - } - }, - "nested": { - "Location": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1 - }, - "span": { - "rule": "repeated", - "type": "int32", - "id": 2 - }, - "leadingComments": { - "type": "string", - "id": 3 - }, - "trailingComments": { - "type": "string", - "id": 4 - }, - "leadingDetachedComments": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - } - } - }, - "GeneratedCodeInfo": { - "fields": { - "annotation": { - "rule": "repeated", - "type": "Annotation", - "id": 1 - } - }, - "nested": { - "Annotation": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1 - }, - "sourceFile": { - "type": "string", - "id": 2 - }, - "begin": { - "type": "int32", - "id": 3 - }, - "end": { - "type": "int32", - "id": 4 - }, - "semantic": { - "type": "Semantic", - "id": 5 - } - }, - "nested": { - "Semantic": { - "values": { - "NONE": 0, - "SET": 1, - "ALIAS": 2 - } - } - } - } - } - }, - "Duration": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "Timestamp": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "Any": { - "fields": { - "type_url": { - "type": "string", - "id": 1 - }, - "value": { - "type": "bytes", - "id": 2 - } - } - }, - "Empty": { - "fields": {} - }, - "FieldMask": { - "fields": { - "paths": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - } - } - }, - "type": { - "options": { - "cc_enable_arenas": true, - "go_package": "google.golang.org/genproto/googleapis/type/interval;interval", - "java_multiple_files": true, - "java_outer_classname": "IntervalProto", - "java_package": "com.google.type", - "objc_class_prefix": "GTP" - }, - "nested": { - "Interval": { - "fields": { - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - } - } - } - } - }, - "longrunning": { - "options": { - "cc_enable_arenas": true, - "csharp_namespace": "Google.LongRunning", - "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", - "java_multiple_files": true, - "java_outer_classname": "OperationsProto", - "java_package": "com.google.longrunning", - "php_namespace": "Google\\LongRunning" - }, - "nested": { - "operationInfo": { - "type": "google.longrunning.OperationInfo", - "id": 1049, - "extend": "google.protobuf.MethodOptions" - }, - "Operations": { - "options": { - "(google.api.default_host)": "longrunning.googleapis.com" - }, - "methods": { - "ListOperations": { - "requestType": "ListOperationsRequest", - "responseType": "ListOperationsResponse", - "options": { - "(google.api.http).get": "/v1/{name=operations}", - "(google.api.method_signature)": "name,filter" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=operations}" - } - }, - { - "(google.api.method_signature)": "name,filter" - } - ] - }, - "GetOperation": { - "requestType": "GetOperationRequest", - "responseType": "Operation", - "options": { - "(google.api.http).get": "/v1/{name=operations/**}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=operations/**}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "DeleteOperation": { - "requestType": "DeleteOperationRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=operations/**}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=operations/**}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CancelOperation": { - "requestType": "CancelOperationRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).post": "/v1/{name=operations/**}:cancel", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=operations/**}:cancel", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "WaitOperation": { - "requestType": "WaitOperationRequest", - "responseType": "Operation" - } - } - }, - "Operation": { - "oneofs": { - "result": { - "oneof": [ - "error", - "response" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "metadata": { - "type": "google.protobuf.Any", - "id": 2 - }, - "done": { - "type": "bool", - "id": 3 - }, - "error": { - "type": "google.rpc.Status", - "id": 4 - }, - "response": { - "type": "google.protobuf.Any", - "id": 5 - } - } - }, - "GetOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "ListOperationsRequest": { - "fields": { - "name": { - "type": "string", - "id": 4 - }, - "filter": { - "type": "string", - "id": 1 - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListOperationsResponse": { - "fields": { - "operations": { - "rule": "repeated", - "type": "Operation", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "CancelOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "DeleteOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "WaitOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "timeout": { - "type": "google.protobuf.Duration", - "id": 2 - } - } - }, - "OperationInfo": { - "fields": { - "responseType": { - "type": "string", - "id": 1 - }, - "metadataType": { - "type": "string", - "id": 2 - } - } - } - } - }, - "rpc": { - "options": { - "cc_enable_arenas": true, - "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", - "java_multiple_files": true, - "java_outer_classname": "StatusProto", - "java_package": "com.google.rpc", - "objc_class_prefix": "RPC" - }, - "nested": { - "Status": { - "fields": { - "code": { - "type": "int32", - "id": 1 - }, - "message": { - "type": "string", - "id": 2 - }, - "details": { - "rule": "repeated", - "type": "google.protobuf.Any", - "id": 3 - } - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.cancel_job.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.cancel_job.js deleted file mode 100644 index db19d7b5b83..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.cancel_job.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START batch_v1alpha_generated_BatchService_CancelJob_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Job name. - */ - // const name = 'abc123' - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callCancelJob() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await batchClient.cancelJob(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCancelJob(); - // [END batch_v1alpha_generated_BatchService_CancelJob_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.create_job.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.create_job.js deleted file mode 100644 index 29d4db9cb4e..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.create_job.js +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, job) { - // [START batch_v1alpha_generated_BatchService_CreateJob_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent resource name where the Job will be created. - * Pattern: "projects/{project}/locations/{location}" - */ - // const parent = 'abc123' - /** - * ID used to uniquely identify the Job within its parent scope. - * This field should contain at most 63 characters and must start with - * lowercase characters. - * Only lowercase characters, numbers and '-' are accepted. - * The '-' character cannot be the first or the last one. - * A system generated ID will be used if the field is not set. - * The job.name field in the request will be ignored and the created resource - * name of the Job will be "{parent}/jobs/{job_id}". - */ - // const jobId = 'abc123' - /** - * Required. The Job to create. - */ - // const job = {} - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callCreateJob() { - // Construct request - const request = { - parent, - job, - }; - - // Run request - const response = await batchClient.createJob(request); - console.log(response); - } - - callCreateJob(); - // [END batch_v1alpha_generated_BatchService_CreateJob_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.create_resource_allowance.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.create_resource_allowance.js deleted file mode 100644 index b5856107cd7..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.create_resource_allowance.js +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, resourceAllowance) { - // [START batch_v1alpha_generated_BatchService_CreateResourceAllowance_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent resource name where the ResourceAllowance will be - * created. Pattern: "projects/{project}/locations/{location}" - */ - // const parent = 'abc123' - /** - * ID used to uniquely identify the ResourceAllowance within its parent scope. - * This field should contain at most 63 characters and must start with - * lowercase characters. - * Only lowercase characters, numbers and '-' are accepted. - * The '-' character cannot be the first or the last one. - * A system generated ID will be used if the field is not set. - * The resource_allowance.name field in the request will be ignored and the - * created resource name of the ResourceAllowance will be - * "{parent}/resourceAllowances/{resource_allowance_id}". - */ - // const resourceAllowanceId = 'abc123' - /** - * Required. The ResourceAllowance to create. - */ - // const resourceAllowance = {} - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callCreateResourceAllowance() { - // Construct request - const request = { - parent, - resourceAllowance, - }; - - // Run request - const response = await batchClient.createResourceAllowance(request); - console.log(response); - } - - callCreateResourceAllowance(); - // [END batch_v1alpha_generated_BatchService_CreateResourceAllowance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.delete_job.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.delete_job.js deleted file mode 100644 index 3f513786b47..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.delete_job.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START batch_v1alpha_generated_BatchService_DeleteJob_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Job name. - */ - // const name = 'abc123' - /** - * Optional. Reason for this deletion. - */ - // const reason = 'abc123' - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callDeleteJob() { - // Construct request - const request = { - }; - - // Run request - const [operation] = await batchClient.deleteJob(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteJob(); - // [END batch_v1alpha_generated_BatchService_DeleteJob_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.delete_resource_allowance.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.delete_resource_allowance.js deleted file mode 100644 index 5b3cf737119..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.delete_resource_allowance.js +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START batch_v1alpha_generated_BatchService_DeleteResourceAllowance_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. ResourceAllowance name. - */ - // const name = 'abc123' - /** - * Optional. Reason for this deletion. - */ - // const reason = 'abc123' - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callDeleteResourceAllowance() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await batchClient.deleteResourceAllowance(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteResourceAllowance(); - // [END batch_v1alpha_generated_BatchService_DeleteResourceAllowance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_job.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_job.js deleted file mode 100644 index 4a8b7580df0..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_job.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START batch_v1alpha_generated_BatchService_GetJob_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Job name. - */ - // const name = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callGetJob() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await batchClient.getJob(request); - console.log(response); - } - - callGetJob(); - // [END batch_v1alpha_generated_BatchService_GetJob_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_resource_allowance.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_resource_allowance.js deleted file mode 100644 index 0fbe3143354..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_resource_allowance.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START batch_v1alpha_generated_BatchService_GetResourceAllowance_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. ResourceAllowance name. - */ - // const name = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callGetResourceAllowance() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await batchClient.getResourceAllowance(request); - console.log(response); - } - - callGetResourceAllowance(); - // [END batch_v1alpha_generated_BatchService_GetResourceAllowance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_task.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_task.js deleted file mode 100644 index 4de5248d352..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_task.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START batch_v1alpha_generated_BatchService_GetTask_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Task name. - */ - // const name = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callGetTask() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await batchClient.getTask(request); - console.log(response); - } - - callGetTask(); - // [END batch_v1alpha_generated_BatchService_GetTask_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_jobs.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_jobs.js deleted file mode 100644 index 42a2ecc05b5..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_jobs.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START batch_v1alpha_generated_BatchService_ListJobs_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Parent path. - */ - // const parent = 'abc123' - /** - * List filter. - */ - // const filter = 'abc123' - /** - * Optional. Sort results. Supported are "name", "name desc", "create_time", - * and "create_time desc". - */ - // const orderBy = 'abc123' - /** - * Page size. - */ - // const pageSize = 1234 - /** - * Page token. - */ - // const pageToken = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callListJobs() { - // Construct request - const request = { - }; - - // Run request - const iterable = batchClient.listJobsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListJobs(); - // [END batch_v1alpha_generated_BatchService_ListJobs_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_resource_allowances.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_resource_allowances.js deleted file mode 100644 index db9329acf53..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_resource_allowances.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START batch_v1alpha_generated_BatchService_ListResourceAllowances_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Parent path. - */ - // const parent = 'abc123' - /** - * Optional. Page size. - */ - // const pageSize = 1234 - /** - * Optional. Page token. - */ - // const pageToken = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callListResourceAllowances() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = batchClient.listResourceAllowancesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListResourceAllowances(); - // [END batch_v1alpha_generated_BatchService_ListResourceAllowances_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_tasks.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_tasks.js deleted file mode 100644 index 8214c4fede3..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_tasks.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START batch_v1alpha_generated_BatchService_ListTasks_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of a TaskGroup from which Tasks are being requested. - * Pattern: - * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" - */ - // const parent = 'abc123' - /** - * Task filter, null filter matches all Tasks. - * Filter string should be of the format State=TaskStatus.State e.g. - * State=RUNNING - */ - // const filter = 'abc123' - /** - * Not implemented. - */ - // const orderBy = 'abc123' - /** - * Page size. - */ - // const pageSize = 1234 - /** - * Page token. - */ - // const pageToken = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callListTasks() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = batchClient.listTasksAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListTasks(); - // [END batch_v1alpha_generated_BatchService_ListTasks_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.update_job.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.update_job.js deleted file mode 100644 index 3b8066040b0..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.update_job.js +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(job, updateMask) { - // [START batch_v1alpha_generated_BatchService_UpdateJob_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The Job to update. - * Only fields specified in `updateMask` are updated. - */ - // const job = {} - /** - * Required. Mask of fields to update. - * The `jobs.patch` method can only be used while a job is in the `QUEUED`, - * `SCHEDULED`, or `RUNNING` state and currently only supports increasing the - * value of the first `taskCount` field in the job's `taskGroups` field. - * Therefore, you must set the value of `updateMask` to `taskGroups`. Any - * other job fields in the update request will be ignored. - * For example, to update a job's `taskCount` to `2`, set `updateMask` to - * `taskGroups` and use the following request body: - * ``` - * { - * "taskGroups":{ - * "taskCount": 2 - * } - * } - * ``` - */ - // const updateMask = {} - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callUpdateJob() { - // Construct request - const request = { - job, - updateMask, - }; - - // Run request - const response = await batchClient.updateJob(request); - console.log(response); - } - - callUpdateJob(); - // [END batch_v1alpha_generated_BatchService_UpdateJob_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.update_resource_allowance.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.update_resource_allowance.js deleted file mode 100644 index 0cdf6071c8f..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.update_resource_allowance.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(resourceAllowance, updateMask) { - // [START batch_v1alpha_generated_BatchService_UpdateResourceAllowance_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The ResourceAllowance to update. - * Update description. - * Only fields specified in `update_mask` are updated. - */ - // const resourceAllowance = {} - /** - * Required. Mask of fields to update. - * Field mask is used to specify the fields to be overwritten in the - * ResourceAllowance resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * UpdateResourceAllowance request now only supports update on `limit` field. - */ - // const updateMask = {} - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callUpdateResourceAllowance() { - // Construct request - const request = { - resourceAllowance, - updateMask, - }; - - // Run request - const response = await batchClient.updateResourceAllowance(request); - console.log(response); - } - - callUpdateResourceAllowance(); - // [END batch_v1alpha_generated_BatchService_UpdateResourceAllowance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/snippet_metadata_google.cloud.batch.v1alpha.json b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/snippet_metadata_google.cloud.batch.v1alpha.json deleted file mode 100644 index a02256ec594..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/snippet_metadata_google.cloud.batch.v1alpha.json +++ /dev/null @@ -1,635 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-batch", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.batch.v1alpha", - "version": "v1alpha" - } - ] - }, - "snippets": [ - { - "regionTag": "batch_v1alpha_generated_BatchService_CreateJob_async", - "title": "BatchService createJob Sample", - "origin": "API_DEFINITION", - "description": " Create a Job.", - "canonical": true, - "file": "batch_service.create_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 84, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateJob", - "fullName": "google.cloud.batch.v1alpha.BatchService.CreateJob", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "job_id", - "type": "TYPE_STRING" - }, - { - "name": "job", - "type": ".google.cloud.batch.v1alpha.Job" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.batch.v1alpha.Job", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" - }, - "method": { - "shortName": "CreateJob", - "fullName": "google.cloud.batch.v1alpha.BatchService.CreateJob", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1alpha.BatchService" - } - } - } - }, - { - "regionTag": "batch_v1alpha_generated_BatchService_GetJob_async", - "title": "BatchService getJob Sample", - "origin": "API_DEFINITION", - "description": " Get a Job specified by its resource name.", - "canonical": true, - "file": "batch_service.get_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetJob", - "fullName": "google.cloud.batch.v1alpha.BatchService.GetJob", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.batch.v1alpha.Job", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" - }, - "method": { - "shortName": "GetJob", - "fullName": "google.cloud.batch.v1alpha.BatchService.GetJob", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1alpha.BatchService" - } - } - } - }, - { - "regionTag": "batch_v1alpha_generated_BatchService_DeleteJob_async", - "title": "BatchService deleteJob Sample", - "origin": "API_DEFINITION", - "description": " Delete a Job.", - "canonical": true, - "file": "batch_service.delete_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteJob", - "fullName": "google.cloud.batch.v1alpha.BatchService.DeleteJob", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "reason", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" - }, - "method": { - "shortName": "DeleteJob", - "fullName": "google.cloud.batch.v1alpha.BatchService.DeleteJob", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1alpha.BatchService" - } - } - } - }, - { - "regionTag": "batch_v1alpha_generated_BatchService_CancelJob_async", - "title": "BatchService cancelJob Sample", - "origin": "API_DEFINITION", - "description": " Cancel a Job.", - "canonical": true, - "file": "batch_service.cancel_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CancelJob", - "fullName": "google.cloud.batch.v1alpha.BatchService.CancelJob", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" - }, - "method": { - "shortName": "CancelJob", - "fullName": "google.cloud.batch.v1alpha.BatchService.CancelJob", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1alpha.BatchService" - } - } - } - }, - { - "regionTag": "batch_v1alpha_generated_BatchService_UpdateJob_async", - "title": "BatchService updateJob Sample", - "origin": "API_DEFINITION", - "description": " Update a Job.", - "canonical": true, - "file": "batch_service.update_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 87, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateJob", - "fullName": "google.cloud.batch.v1alpha.BatchService.UpdateJob", - "async": true, - "parameters": [ - { - "name": "job", - "type": ".google.cloud.batch.v1alpha.Job" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.batch.v1alpha.Job", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" - }, - "method": { - "shortName": "UpdateJob", - "fullName": "google.cloud.batch.v1alpha.BatchService.UpdateJob", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1alpha.BatchService" - } - } - } - }, - { - "regionTag": "batch_v1alpha_generated_BatchService_ListJobs_async", - "title": "BatchService listJobs Sample", - "origin": "API_DEFINITION", - "description": " List all Jobs for a project within a region.", - "canonical": true, - "file": "batch_service.list_jobs.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListJobs", - "fullName": "google.cloud.batch.v1alpha.BatchService.ListJobs", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.batch.v1alpha.ListJobsResponse", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" - }, - "method": { - "shortName": "ListJobs", - "fullName": "google.cloud.batch.v1alpha.BatchService.ListJobs", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1alpha.BatchService" - } - } - } - }, - { - "regionTag": "batch_v1alpha_generated_BatchService_GetTask_async", - "title": "BatchService getTask Sample", - "origin": "API_DEFINITION", - "description": " Return a single Task.", - "canonical": true, - "file": "batch_service.get_task.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetTask", - "fullName": "google.cloud.batch.v1alpha.BatchService.GetTask", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.batch.v1alpha.Task", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" - }, - "method": { - "shortName": "GetTask", - "fullName": "google.cloud.batch.v1alpha.BatchService.GetTask", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1alpha.BatchService" - } - } - } - }, - { - "regionTag": "batch_v1alpha_generated_BatchService_ListTasks_async", - "title": "BatchService listTasks Sample", - "origin": "API_DEFINITION", - "description": " List Tasks associated with a job.", - "canonical": true, - "file": "batch_service.list_tasks.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 75, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListTasks", - "fullName": "google.cloud.batch.v1alpha.BatchService.ListTasks", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.batch.v1alpha.ListTasksResponse", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" - }, - "method": { - "shortName": "ListTasks", - "fullName": "google.cloud.batch.v1alpha.BatchService.ListTasks", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1alpha.BatchService" - } - } - } - }, - { - "regionTag": "batch_v1alpha_generated_BatchService_CreateResourceAllowance_async", - "title": "BatchService createResourceAllowance Sample", - "origin": "API_DEFINITION", - "description": " Create a Resource Allowance.", - "canonical": true, - "file": "batch_service.create_resource_allowance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 85, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateResourceAllowance", - "fullName": "google.cloud.batch.v1alpha.BatchService.CreateResourceAllowance", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "resource_allowance_id", - "type": "TYPE_STRING" - }, - { - "name": "resource_allowance", - "type": ".google.cloud.batch.v1alpha.ResourceAllowance" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.batch.v1alpha.ResourceAllowance", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" - }, - "method": { - "shortName": "CreateResourceAllowance", - "fullName": "google.cloud.batch.v1alpha.BatchService.CreateResourceAllowance", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1alpha.BatchService" - } - } - } - }, - { - "regionTag": "batch_v1alpha_generated_BatchService_GetResourceAllowance_async", - "title": "BatchService getResourceAllowance Sample", - "origin": "API_DEFINITION", - "description": " Get a ResourceAllowance specified by its resource name.", - "canonical": true, - "file": "batch_service.get_resource_allowance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetResourceAllowance", - "fullName": "google.cloud.batch.v1alpha.BatchService.GetResourceAllowance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.batch.v1alpha.ResourceAllowance", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" - }, - "method": { - "shortName": "GetResourceAllowance", - "fullName": "google.cloud.batch.v1alpha.BatchService.GetResourceAllowance", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1alpha.BatchService" - } - } - } - }, - { - "regionTag": "batch_v1alpha_generated_BatchService_DeleteResourceAllowance_async", - "title": "BatchService deleteResourceAllowance Sample", - "origin": "API_DEFINITION", - "description": " Delete a ResourceAllowance.", - "canonical": true, - "file": "batch_service.delete_resource_allowance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 72, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteResourceAllowance", - "fullName": "google.cloud.batch.v1alpha.BatchService.DeleteResourceAllowance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "reason", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" - }, - "method": { - "shortName": "DeleteResourceAllowance", - "fullName": "google.cloud.batch.v1alpha.BatchService.DeleteResourceAllowance", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1alpha.BatchService" - } - } - } - }, - { - "regionTag": "batch_v1alpha_generated_BatchService_ListResourceAllowances_async", - "title": "BatchService listResourceAllowances Sample", - "origin": "API_DEFINITION", - "description": " List all ResourceAllowances for a project within a region.", - "canonical": true, - "file": "batch_service.list_resource_allowances.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListResourceAllowances", - "fullName": "google.cloud.batch.v1alpha.BatchService.ListResourceAllowances", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.batch.v1alpha.ListResourceAllowancesResponse", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" - }, - "method": { - "shortName": "ListResourceAllowances", - "fullName": "google.cloud.batch.v1alpha.BatchService.ListResourceAllowances", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1alpha.BatchService" - } - } - } - }, - { - "regionTag": "batch_v1alpha_generated_BatchService_UpdateResourceAllowance_async", - "title": "BatchService updateResourceAllowance Sample", - "origin": "API_DEFINITION", - "description": " Update a Resource Allowance.", - "canonical": true, - "file": "batch_service.update_resource_allowance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 80, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateResourceAllowance", - "fullName": "google.cloud.batch.v1alpha.BatchService.UpdateResourceAllowance", - "async": true, - "parameters": [ - { - "name": "resource_allowance", - "type": ".google.cloud.batch.v1alpha.ResourceAllowance" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.batch.v1alpha.ResourceAllowance", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" - }, - "method": { - "shortName": "UpdateResourceAllowance", - "fullName": "google.cloud.batch.v1alpha.BatchService.UpdateResourceAllowance", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1alpha.BatchService" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/src/index.ts b/owl-bot-staging/google-cloud-batch/v1alpha/src/index.ts deleted file mode 100644 index 8208d9bc746..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/src/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 v1alpha from './v1alpha'; -const BatchServiceClient = v1alpha.BatchServiceClient; -type BatchServiceClient = v1alpha.BatchServiceClient; -export {v1alpha, BatchServiceClient}; -export default {v1alpha, BatchServiceClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_client.ts b/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_client.ts deleted file mode 100644 index c7897648928..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_client.ts +++ /dev/null @@ -1,2441 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); - -/** - * Client JSON configuration object, loaded from - * `src/v1alpha/batch_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './batch_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Google Batch Service. - * The service manages user submitted batch jobs and allocates Google Compute - * Engine VM instances to run the jobs. - * @class - * @memberof v1alpha - */ -export class BatchServiceClient { - 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; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - locationsClient: LocationsClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - batchServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of BatchServiceClient. - * - * @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://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @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 BatchServiceClient({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 BatchServiceClient; - 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 = 'batch.' + 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; - } - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process === 'object' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - jobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - resourceAllowancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/resourceAllowances/{resource_allowance}' - ), - taskPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}/tasks/{task}' - ), - taskGroupPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}' - ), - }; - - // 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 = { - listJobs: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'jobs'), - listTasks: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'tasks'), - listResourceAllowances: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'resourceAllowances') - }; - - const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback) { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v1alpha/{name=projects/*/locations/*}',},{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1alpha/{name=projects/*}/locations',},{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1alpha/{name=projects/*/locations/*/operations/*}:cancel',body: '*',},{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1alpha/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1alpha/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1alpha/{name=projects/*/locations/*}/operations',}]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const deleteJobResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteJobMetadata = protoFilesRoot.lookup( - '.google.cloud.batch.v1alpha.OperationMetadata') as gax.protobuf.Type; - const cancelJobResponse = protoFilesRoot.lookup( - '.google.cloud.batch.v1alpha.CancelJobResponse') as gax.protobuf.Type; - const cancelJobMetadata = protoFilesRoot.lookup( - '.google.cloud.batch.v1alpha.OperationMetadata') as gax.protobuf.Type; - const deleteResourceAllowanceResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteResourceAllowanceMetadata = protoFilesRoot.lookup( - '.google.cloud.batch.v1alpha.OperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - deleteJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteJobResponse.decode.bind(deleteJobResponse), - deleteJobMetadata.decode.bind(deleteJobMetadata)), - cancelJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - cancelJobResponse.decode.bind(cancelJobResponse), - cancelJobMetadata.decode.bind(cancelJobMetadata)), - deleteResourceAllowance: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteResourceAllowanceResponse.decode.bind(deleteResourceAllowanceResponse), - deleteResourceAllowanceMetadata.decode.bind(deleteResourceAllowanceMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.batch.v1alpha.BatchService', 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.batchServiceStub) { - return this.batchServiceStub; - } - - // Put together the "service stub" for - // google.cloud.batch.v1alpha.BatchService. - this.batchServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.batch.v1alpha.BatchService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.batch.v1alpha.BatchService, - 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 batchServiceStubMethods = - ['createJob', 'getJob', 'deleteJob', 'cancelJob', 'updateJob', 'listJobs', 'getTask', 'listTasks', 'createResourceAllowance', 'getResourceAllowance', 'deleteResourceAllowance', 'listResourceAllowances', 'updateResourceAllowance']; - for (const methodName of batchServiceStubMethods) { - const callPromise = this.batchServiceStub.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.batchServiceStub; - } - - /** - * 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 'batch.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 'batch.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' - ]; - } - - 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 -- - // ------------------- -/** - * Create a Job. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name where the Job will be created. - * Pattern: "projects/{project}/locations/{location}" - * @param {string} request.jobId - * ID used to uniquely identify the Job within its parent scope. - * This field should contain at most 63 characters and must start with - * lowercase characters. - * Only lowercase characters, numbers and '-' are accepted. - * The '-' character cannot be the first or the last one. - * A system generated ID will be used if the field is not set. - * - * The job.name field in the request will be ignored and the created resource - * name of the Job will be "{parent}/jobs/{job_id}". - * @param {google.cloud.batch.v1alpha.Job} request.job - * Required. The Job to create. - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1alpha.Job|Job}. - * 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/v1alpha/batch_service.create_job.js - * region_tag:batch_v1alpha_generated_BatchService_CreateJob_async - */ - createJob( - request?: protos.google.cloud.batch.v1alpha.ICreateJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.batch.v1alpha.IJob, - protos.google.cloud.batch.v1alpha.ICreateJobRequest|undefined, {}|undefined - ]>; - createJob( - request: protos.google.cloud.batch.v1alpha.ICreateJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.batch.v1alpha.IJob, - protos.google.cloud.batch.v1alpha.ICreateJobRequest|null|undefined, - {}|null|undefined>): void; - createJob( - request: protos.google.cloud.batch.v1alpha.ICreateJobRequest, - callback: Callback< - protos.google.cloud.batch.v1alpha.IJob, - protos.google.cloud.batch.v1alpha.ICreateJobRequest|null|undefined, - {}|null|undefined>): void; - createJob( - request?: protos.google.cloud.batch.v1alpha.ICreateJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.batch.v1alpha.IJob, - protos.google.cloud.batch.v1alpha.ICreateJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.batch.v1alpha.IJob, - protos.google.cloud.batch.v1alpha.ICreateJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.batch.v1alpha.IJob, - protos.google.cloud.batch.v1alpha.ICreateJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.createJob(request, options, callback); - } -/** - * Get a Job specified by its resource name. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Job name. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1alpha.Job|Job}. - * 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/v1alpha/batch_service.get_job.js - * region_tag:batch_v1alpha_generated_BatchService_GetJob_async - */ - getJob( - request?: protos.google.cloud.batch.v1alpha.IGetJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.batch.v1alpha.IJob, - protos.google.cloud.batch.v1alpha.IGetJobRequest|undefined, {}|undefined - ]>; - getJob( - request: protos.google.cloud.batch.v1alpha.IGetJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.batch.v1alpha.IJob, - protos.google.cloud.batch.v1alpha.IGetJobRequest|null|undefined, - {}|null|undefined>): void; - getJob( - request: protos.google.cloud.batch.v1alpha.IGetJobRequest, - callback: Callback< - protos.google.cloud.batch.v1alpha.IJob, - protos.google.cloud.batch.v1alpha.IGetJobRequest|null|undefined, - {}|null|undefined>): void; - getJob( - request?: protos.google.cloud.batch.v1alpha.IGetJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.batch.v1alpha.IJob, - protos.google.cloud.batch.v1alpha.IGetJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.batch.v1alpha.IJob, - protos.google.cloud.batch.v1alpha.IGetJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.batch.v1alpha.IJob, - protos.google.cloud.batch.v1alpha.IGetJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getJob(request, options, callback); - } -/** - * Update a Job. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.batch.v1alpha.Job} request.job - * Required. The Job to update. - * Only fields specified in `updateMask` are updated. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. Mask of fields to update. - * - * The `jobs.patch` method can only be used while a job is in the `QUEUED`, - * `SCHEDULED`, or `RUNNING` state and currently only supports increasing the - * value of the first `taskCount` field in the job's `taskGroups` field. - * Therefore, you must set the value of `updateMask` to `taskGroups`. Any - * other job fields in the update request will be ignored. - * - * For example, to update a job's `taskCount` to `2`, set `updateMask` to - * `taskGroups` and use the following request body: - * ``` - * { - * "taskGroups":[{ - * "taskCount": 2 - * }] - * } - * ``` - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1alpha.Job|Job}. - * 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/v1alpha/batch_service.update_job.js - * region_tag:batch_v1alpha_generated_BatchService_UpdateJob_async - */ - updateJob( - request?: protos.google.cloud.batch.v1alpha.IUpdateJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.batch.v1alpha.IJob, - protos.google.cloud.batch.v1alpha.IUpdateJobRequest|undefined, {}|undefined - ]>; - updateJob( - request: protos.google.cloud.batch.v1alpha.IUpdateJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.batch.v1alpha.IJob, - protos.google.cloud.batch.v1alpha.IUpdateJobRequest|null|undefined, - {}|null|undefined>): void; - updateJob( - request: protos.google.cloud.batch.v1alpha.IUpdateJobRequest, - callback: Callback< - protos.google.cloud.batch.v1alpha.IJob, - protos.google.cloud.batch.v1alpha.IUpdateJobRequest|null|undefined, - {}|null|undefined>): void; - updateJob( - request?: protos.google.cloud.batch.v1alpha.IUpdateJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.batch.v1alpha.IJob, - protos.google.cloud.batch.v1alpha.IUpdateJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.batch.v1alpha.IJob, - protos.google.cloud.batch.v1alpha.IUpdateJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.batch.v1alpha.IJob, - protos.google.cloud.batch.v1alpha.IUpdateJobRequest|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({ - 'job.name': request.job!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateJob(request, options, callback); - } -/** - * Return a single Task. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Task name. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1alpha.Task|Task}. - * 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/v1alpha/batch_service.get_task.js - * region_tag:batch_v1alpha_generated_BatchService_GetTask_async - */ - getTask( - request?: protos.google.cloud.batch.v1alpha.IGetTaskRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.batch.v1alpha.ITask, - protos.google.cloud.batch.v1alpha.IGetTaskRequest|undefined, {}|undefined - ]>; - getTask( - request: protos.google.cloud.batch.v1alpha.IGetTaskRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.batch.v1alpha.ITask, - protos.google.cloud.batch.v1alpha.IGetTaskRequest|null|undefined, - {}|null|undefined>): void; - getTask( - request: protos.google.cloud.batch.v1alpha.IGetTaskRequest, - callback: Callback< - protos.google.cloud.batch.v1alpha.ITask, - protos.google.cloud.batch.v1alpha.IGetTaskRequest|null|undefined, - {}|null|undefined>): void; - getTask( - request?: protos.google.cloud.batch.v1alpha.IGetTaskRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.batch.v1alpha.ITask, - protos.google.cloud.batch.v1alpha.IGetTaskRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.batch.v1alpha.ITask, - protos.google.cloud.batch.v1alpha.IGetTaskRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.batch.v1alpha.ITask, - protos.google.cloud.batch.v1alpha.IGetTaskRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getTask(request, options, callback); - } -/** - * Create a Resource Allowance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name where the ResourceAllowance will be - * created. Pattern: "projects/{project}/locations/{location}" - * @param {string} request.resourceAllowanceId - * ID used to uniquely identify the ResourceAllowance within its parent scope. - * This field should contain at most 63 characters and must start with - * lowercase characters. - * Only lowercase characters, numbers and '-' are accepted. - * The '-' character cannot be the first or the last one. - * A system generated ID will be used if the field is not set. - * - * The resource_allowance.name field in the request will be ignored and the - * created resource name of the ResourceAllowance will be - * "{parent}/resourceAllowances/{resource_allowance_id}". - * @param {google.cloud.batch.v1alpha.ResourceAllowance} request.resourceAllowance - * Required. The ResourceAllowance to create. - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1alpha.ResourceAllowance|ResourceAllowance}. - * 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/v1alpha/batch_service.create_resource_allowance.js - * region_tag:batch_v1alpha_generated_BatchService_CreateResourceAllowance_async - */ - createResourceAllowance( - request?: protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.batch.v1alpha.IResourceAllowance, - protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest|undefined, {}|undefined - ]>; - createResourceAllowance( - request: protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.batch.v1alpha.IResourceAllowance, - protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest|null|undefined, - {}|null|undefined>): void; - createResourceAllowance( - request: protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest, - callback: Callback< - protos.google.cloud.batch.v1alpha.IResourceAllowance, - protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest|null|undefined, - {}|null|undefined>): void; - createResourceAllowance( - request?: protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.batch.v1alpha.IResourceAllowance, - protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.batch.v1alpha.IResourceAllowance, - protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.batch.v1alpha.IResourceAllowance, - protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.createResourceAllowance(request, options, callback); - } -/** - * Get a ResourceAllowance specified by its resource name. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. ResourceAllowance name. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1alpha.ResourceAllowance|ResourceAllowance}. - * 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/v1alpha/batch_service.get_resource_allowance.js - * region_tag:batch_v1alpha_generated_BatchService_GetResourceAllowance_async - */ - getResourceAllowance( - request?: protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.batch.v1alpha.IResourceAllowance, - protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest|undefined, {}|undefined - ]>; - getResourceAllowance( - request: protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.batch.v1alpha.IResourceAllowance, - protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest|null|undefined, - {}|null|undefined>): void; - getResourceAllowance( - request: protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest, - callback: Callback< - protos.google.cloud.batch.v1alpha.IResourceAllowance, - protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest|null|undefined, - {}|null|undefined>): void; - getResourceAllowance( - request?: protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.batch.v1alpha.IResourceAllowance, - protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.batch.v1alpha.IResourceAllowance, - protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.batch.v1alpha.IResourceAllowance, - protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getResourceAllowance(request, options, callback); - } -/** - * Update a Resource Allowance. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.batch.v1alpha.ResourceAllowance} request.resourceAllowance - * Required. The ResourceAllowance to update. - * Update description. - * Only fields specified in `update_mask` are updated. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. Mask of fields to update. - * - * Field mask is used to specify the fields to be overwritten in the - * ResourceAllowance resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * UpdateResourceAllowance request now only supports update on `limit` field. - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1alpha.ResourceAllowance|ResourceAllowance}. - * 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/v1alpha/batch_service.update_resource_allowance.js - * region_tag:batch_v1alpha_generated_BatchService_UpdateResourceAllowance_async - */ - updateResourceAllowance( - request?: protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.batch.v1alpha.IResourceAllowance, - protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest|undefined, {}|undefined - ]>; - updateResourceAllowance( - request: protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.batch.v1alpha.IResourceAllowance, - protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest|null|undefined, - {}|null|undefined>): void; - updateResourceAllowance( - request: protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest, - callback: Callback< - protos.google.cloud.batch.v1alpha.IResourceAllowance, - protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest|null|undefined, - {}|null|undefined>): void; - updateResourceAllowance( - request?: protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.batch.v1alpha.IResourceAllowance, - protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.batch.v1alpha.IResourceAllowance, - protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.batch.v1alpha.IResourceAllowance, - protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource_allowance.name': request.resourceAllowance!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateResourceAllowance(request, options, callback); - } - -/** - * Delete a Job. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Job name. - * @param {string} [request.reason] - * Optional. Reason for this deletion. - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v1alpha/batch_service.delete_job.js - * region_tag:batch_v1alpha_generated_BatchService_DeleteJob_async - */ - deleteJob( - request?: protos.google.cloud.batch.v1alpha.IDeleteJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteJob( - request: protos.google.cloud.batch.v1alpha.IDeleteJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteJob( - request: protos.google.cloud.batch.v1alpha.IDeleteJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteJob( - request?: protos.google.cloud.batch.v1alpha.IDeleteJobRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteJob(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteJob()`. - * @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/v1alpha/batch_service.delete_job.js - * region_tag:batch_v1alpha_generated_BatchService_DeleteJob_async - */ - async checkDeleteJobProgress(name: string): Promise>{ - 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.deleteJob, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Cancel a Job. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Job name. - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v1alpha/batch_service.cancel_job.js - * region_tag:batch_v1alpha_generated_BatchService_CancelJob_async - */ - cancelJob( - request?: protos.google.cloud.batch.v1alpha.ICancelJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - cancelJob( - request: protos.google.cloud.batch.v1alpha.ICancelJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - cancelJob( - request: protos.google.cloud.batch.v1alpha.ICancelJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - cancelJob( - request?: protos.google.cloud.batch.v1alpha.ICancelJobRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.cancelJob(request, options, callback); - } -/** - * Check the status of the long running operation returned by `cancelJob()`. - * @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/v1alpha/batch_service.cancel_job.js - * region_tag:batch_v1alpha_generated_BatchService_CancelJob_async - */ - async checkCancelJobProgress(name: string): Promise>{ - 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.cancelJob, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Delete a ResourceAllowance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. ResourceAllowance name. - * @param {string} [request.reason] - * Optional. Reason for this deletion. - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v1alpha/batch_service.delete_resource_allowance.js - * region_tag:batch_v1alpha_generated_BatchService_DeleteResourceAllowance_async - */ - deleteResourceAllowance( - request?: protos.google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteResourceAllowance( - request: protos.google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteResourceAllowance( - request: protos.google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteResourceAllowance( - request?: protos.google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteResourceAllowance(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteResourceAllowance()`. - * @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/v1alpha/batch_service.delete_resource_allowance.js - * region_tag:batch_v1alpha_generated_BatchService_DeleteResourceAllowance_async - */ - async checkDeleteResourceAllowanceProgress(name: string): Promise>{ - 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.deleteResourceAllowance, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * List all Jobs for a project within a region. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Parent path. - * @param {string} request.filter - * List filter. - * @param {string} [request.orderBy] - * Optional. Sort results. Supported are "name", "name desc", "create_time", - * and "create_time desc". - * @param {number} request.pageSize - * Page size. - * @param {string} request.pageToken - * Page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.batch.v1alpha.Job|Job}. - * 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 `listJobsAsync()` - * 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. - */ - listJobs( - request?: protos.google.cloud.batch.v1alpha.IListJobsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.batch.v1alpha.IJob[], - protos.google.cloud.batch.v1alpha.IListJobsRequest|null, - protos.google.cloud.batch.v1alpha.IListJobsResponse - ]>; - listJobs( - request: protos.google.cloud.batch.v1alpha.IListJobsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.batch.v1alpha.IListJobsRequest, - protos.google.cloud.batch.v1alpha.IListJobsResponse|null|undefined, - protos.google.cloud.batch.v1alpha.IJob>): void; - listJobs( - request: protos.google.cloud.batch.v1alpha.IListJobsRequest, - callback: PaginationCallback< - protos.google.cloud.batch.v1alpha.IListJobsRequest, - protos.google.cloud.batch.v1alpha.IListJobsResponse|null|undefined, - protos.google.cloud.batch.v1alpha.IJob>): void; - listJobs( - request?: protos.google.cloud.batch.v1alpha.IListJobsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.batch.v1alpha.IListJobsRequest, - protos.google.cloud.batch.v1alpha.IListJobsResponse|null|undefined, - protos.google.cloud.batch.v1alpha.IJob>, - callback?: PaginationCallback< - protos.google.cloud.batch.v1alpha.IListJobsRequest, - protos.google.cloud.batch.v1alpha.IListJobsResponse|null|undefined, - protos.google.cloud.batch.v1alpha.IJob>): - Promise<[ - protos.google.cloud.batch.v1alpha.IJob[], - protos.google.cloud.batch.v1alpha.IListJobsRequest|null, - protos.google.cloud.batch.v1alpha.IListJobsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listJobs(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Parent path. - * @param {string} request.filter - * List filter. - * @param {string} [request.orderBy] - * Optional. Sort results. Supported are "name", "name desc", "create_time", - * and "create_time desc". - * @param {number} request.pageSize - * Page size. - * @param {string} request.pageToken - * Page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.batch.v1alpha.Job|Job} 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 `listJobsAsync()` - * 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. - */ - listJobsStream( - request?: protos.google.cloud.batch.v1alpha.IListJobsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listJobs.createStream( - this.innerApiCalls.listJobs as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listJobs`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Parent path. - * @param {string} request.filter - * List filter. - * @param {string} [request.orderBy] - * Optional. Sort results. Supported are "name", "name desc", "create_time", - * and "create_time desc". - * @param {number} request.pageSize - * Page size. - * @param {string} request.pageToken - * Page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.batch.v1alpha.Job|Job}. 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/v1alpha/batch_service.list_jobs.js - * region_tag:batch_v1alpha_generated_BatchService_ListJobs_async - */ - listJobsAsync( - request?: protos.google.cloud.batch.v1alpha.IListJobsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listJobs.asyncIterate( - this.innerApiCalls['listJobs'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * List Tasks associated with a job. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of a TaskGroup from which Tasks are being requested. - * Pattern: - * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" - * @param {string} request.filter - * Task filter, null filter matches all Tasks. - * Filter string should be of the format State=TaskStatus.State e.g. - * State=RUNNING - * @param {string} request.orderBy - * Not implemented. - * @param {number} request.pageSize - * Page size. - * @param {string} request.pageToken - * Page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.batch.v1alpha.Task|Task}. - * 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 `listTasksAsync()` - * 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. - */ - listTasks( - request?: protos.google.cloud.batch.v1alpha.IListTasksRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.batch.v1alpha.ITask[], - protos.google.cloud.batch.v1alpha.IListTasksRequest|null, - protos.google.cloud.batch.v1alpha.IListTasksResponse - ]>; - listTasks( - request: protos.google.cloud.batch.v1alpha.IListTasksRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.batch.v1alpha.IListTasksRequest, - protos.google.cloud.batch.v1alpha.IListTasksResponse|null|undefined, - protos.google.cloud.batch.v1alpha.ITask>): void; - listTasks( - request: protos.google.cloud.batch.v1alpha.IListTasksRequest, - callback: PaginationCallback< - protos.google.cloud.batch.v1alpha.IListTasksRequest, - protos.google.cloud.batch.v1alpha.IListTasksResponse|null|undefined, - protos.google.cloud.batch.v1alpha.ITask>): void; - listTasks( - request?: protos.google.cloud.batch.v1alpha.IListTasksRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.batch.v1alpha.IListTasksRequest, - protos.google.cloud.batch.v1alpha.IListTasksResponse|null|undefined, - protos.google.cloud.batch.v1alpha.ITask>, - callback?: PaginationCallback< - protos.google.cloud.batch.v1alpha.IListTasksRequest, - protos.google.cloud.batch.v1alpha.IListTasksResponse|null|undefined, - protos.google.cloud.batch.v1alpha.ITask>): - Promise<[ - protos.google.cloud.batch.v1alpha.ITask[], - protos.google.cloud.batch.v1alpha.IListTasksRequest|null, - protos.google.cloud.batch.v1alpha.IListTasksResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listTasks(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of a TaskGroup from which Tasks are being requested. - * Pattern: - * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" - * @param {string} request.filter - * Task filter, null filter matches all Tasks. - * Filter string should be of the format State=TaskStatus.State e.g. - * State=RUNNING - * @param {string} request.orderBy - * Not implemented. - * @param {number} request.pageSize - * Page size. - * @param {string} request.pageToken - * Page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.batch.v1alpha.Task|Task} 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 `listTasksAsync()` - * 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. - */ - listTasksStream( - request?: protos.google.cloud.batch.v1alpha.IListTasksRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listTasks']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTasks.createStream( - this.innerApiCalls.listTasks as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listTasks`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of a TaskGroup from which Tasks are being requested. - * Pattern: - * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" - * @param {string} request.filter - * Task filter, null filter matches all Tasks. - * Filter string should be of the format State=TaskStatus.State e.g. - * State=RUNNING - * @param {string} request.orderBy - * Not implemented. - * @param {number} request.pageSize - * Page size. - * @param {string} request.pageToken - * Page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.batch.v1alpha.Task|Task}. 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/v1alpha/batch_service.list_tasks.js - * region_tag:batch_v1alpha_generated_BatchService_ListTasks_async - */ - listTasksAsync( - request?: protos.google.cloud.batch.v1alpha.IListTasksRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listTasks']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTasks.asyncIterate( - this.innerApiCalls['listTasks'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * List all ResourceAllowances for a project within a region. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent path. - * @param {number} [request.pageSize] - * Optional. Page size. - * @param {string} [request.pageToken] - * Optional. Page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.batch.v1alpha.ResourceAllowance|ResourceAllowance}. - * 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 `listResourceAllowancesAsync()` - * 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. - */ - listResourceAllowances( - request?: protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.batch.v1alpha.IResourceAllowance[], - protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest|null, - protos.google.cloud.batch.v1alpha.IListResourceAllowancesResponse - ]>; - listResourceAllowances( - request: protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, - protos.google.cloud.batch.v1alpha.IListResourceAllowancesResponse|null|undefined, - protos.google.cloud.batch.v1alpha.IResourceAllowance>): void; - listResourceAllowances( - request: protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, - callback: PaginationCallback< - protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, - protos.google.cloud.batch.v1alpha.IListResourceAllowancesResponse|null|undefined, - protos.google.cloud.batch.v1alpha.IResourceAllowance>): void; - listResourceAllowances( - request?: protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, - protos.google.cloud.batch.v1alpha.IListResourceAllowancesResponse|null|undefined, - protos.google.cloud.batch.v1alpha.IResourceAllowance>, - callback?: PaginationCallback< - protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, - protos.google.cloud.batch.v1alpha.IListResourceAllowancesResponse|null|undefined, - protos.google.cloud.batch.v1alpha.IResourceAllowance>): - Promise<[ - protos.google.cloud.batch.v1alpha.IResourceAllowance[], - protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest|null, - protos.google.cloud.batch.v1alpha.IListResourceAllowancesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listResourceAllowances(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent path. - * @param {number} [request.pageSize] - * Optional. Page size. - * @param {string} [request.pageToken] - * Optional. Page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.batch.v1alpha.ResourceAllowance|ResourceAllowance} 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 `listResourceAllowancesAsync()` - * 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. - */ - listResourceAllowancesStream( - request?: protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listResourceAllowances']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listResourceAllowances.createStream( - this.innerApiCalls.listResourceAllowances as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listResourceAllowances`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent path. - * @param {number} [request.pageSize] - * Optional. Page size. - * @param {string} [request.pageToken] - * Optional. Page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.batch.v1alpha.ResourceAllowance|ResourceAllowance}. 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/v1alpha/batch_service.list_resource_allowances.js - * region_tag:batch_v1alpha_generated_BatchService_ListResourceAllowances_async - */ - listResourceAllowancesAsync( - request?: protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listResourceAllowances']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listResourceAllowances.asyncIterate( - this.innerApiCalls['listResourceAllowances'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the location. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 google.cloud.location.Location | Location}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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.name - * The resource that owns the locations collection, if applicable. - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link google.cloud.location.Location | Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * 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, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@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 { - 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, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@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, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified job resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @returns {string} Resource name string. - */ - jobPath(project:string,location:string,job:string) { - return this.pathTemplates.jobPathTemplate.render({ - project: project, - location: location, - job: job, - }); - } - - /** - * Parse the project from Job resource. - * - * @param {string} jobName - * A fully-qualified path representing Job resource. - * @returns {string} A string representing the project. - */ - matchProjectFromJobName(jobName: string) { - return this.pathTemplates.jobPathTemplate.match(jobName).project; - } - - /** - * Parse the location from Job resource. - * - * @param {string} jobName - * A fully-qualified path representing Job resource. - * @returns {string} A string representing the location. - */ - matchLocationFromJobName(jobName: string) { - return this.pathTemplates.jobPathTemplate.match(jobName).location; - } - - /** - * Parse the job from Job resource. - * - * @param {string} jobName - * A fully-qualified path representing Job resource. - * @returns {string} A string representing the job. - */ - matchJobFromJobName(jobName: string) { - return this.pathTemplates.jobPathTemplate.match(jobName).job; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified project resource name string. - * - * @param {string} project - * @returns {string} Resource name string. - */ - projectPath(project:string) { - return this.pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the project from Project resource. - * - * @param {string} projectName - * A fully-qualified path representing Project resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectName(projectName: string) { - return this.pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * Return a fully-qualified resourceAllowance resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} resource_allowance - * @returns {string} Resource name string. - */ - resourceAllowancePath(project:string,location:string,resourceAllowance:string) { - return this.pathTemplates.resourceAllowancePathTemplate.render({ - project: project, - location: location, - resource_allowance: resourceAllowance, - }); - } - - /** - * Parse the project from ResourceAllowance resource. - * - * @param {string} resourceAllowanceName - * A fully-qualified path representing ResourceAllowance resource. - * @returns {string} A string representing the project. - */ - matchProjectFromResourceAllowanceName(resourceAllowanceName: string) { - return this.pathTemplates.resourceAllowancePathTemplate.match(resourceAllowanceName).project; - } - - /** - * Parse the location from ResourceAllowance resource. - * - * @param {string} resourceAllowanceName - * A fully-qualified path representing ResourceAllowance resource. - * @returns {string} A string representing the location. - */ - matchLocationFromResourceAllowanceName(resourceAllowanceName: string) { - return this.pathTemplates.resourceAllowancePathTemplate.match(resourceAllowanceName).location; - } - - /** - * Parse the resource_allowance from ResourceAllowance resource. - * - * @param {string} resourceAllowanceName - * A fully-qualified path representing ResourceAllowance resource. - * @returns {string} A string representing the resource_allowance. - */ - matchResourceAllowanceFromResourceAllowanceName(resourceAllowanceName: string) { - return this.pathTemplates.resourceAllowancePathTemplate.match(resourceAllowanceName).resource_allowance; - } - - /** - * Return a fully-qualified task resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @param {string} task_group - * @param {string} task - * @returns {string} Resource name string. - */ - taskPath(project:string,location:string,job:string,taskGroup:string,task:string) { - return this.pathTemplates.taskPathTemplate.render({ - project: project, - location: location, - job: job, - task_group: taskGroup, - task: task, - }); - } - - /** - * Parse the project from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).project; - } - - /** - * Parse the location from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).location; - } - - /** - * Parse the job from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the job. - */ - matchJobFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).job; - } - - /** - * Parse the task_group from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the task_group. - */ - matchTaskGroupFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).task_group; - } - - /** - * Parse the task from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the task. - */ - matchTaskFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).task; - } - - /** - * Return a fully-qualified taskGroup resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @param {string} task_group - * @returns {string} Resource name string. - */ - taskGroupPath(project:string,location:string,job:string,taskGroup:string) { - return this.pathTemplates.taskGroupPathTemplate.render({ - project: project, - location: location, - job: job, - task_group: taskGroup, - }); - } - - /** - * Parse the project from TaskGroup resource. - * - * @param {string} taskGroupName - * A fully-qualified path representing TaskGroup resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTaskGroupName(taskGroupName: string) { - return this.pathTemplates.taskGroupPathTemplate.match(taskGroupName).project; - } - - /** - * Parse the location from TaskGroup resource. - * - * @param {string} taskGroupName - * A fully-qualified path representing TaskGroup resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTaskGroupName(taskGroupName: string) { - return this.pathTemplates.taskGroupPathTemplate.match(taskGroupName).location; - } - - /** - * Parse the job from TaskGroup resource. - * - * @param {string} taskGroupName - * A fully-qualified path representing TaskGroup resource. - * @returns {string} A string representing the job. - */ - matchJobFromTaskGroupName(taskGroupName: string) { - return this.pathTemplates.taskGroupPathTemplate.match(taskGroupName).job; - } - - /** - * Parse the task_group from TaskGroup resource. - * - * @param {string} taskGroupName - * A fully-qualified path representing TaskGroup resource. - * @returns {string} A string representing the task_group. - */ - matchTaskGroupFromTaskGroupName(taskGroupName: string) { - return this.pathTemplates.taskGroupPathTemplate.match(taskGroupName).task_group; - } - - /** - * 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.batchServiceStub && !this._terminated) { - return this.batchServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.locationsClient.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_client_config.json b/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_client_config.json deleted file mode 100644 index 6ac4ca807a8..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_client_config.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "interfaces": { - "google.cloud.batch.v1alpha.BatchService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "unavailable": [ - "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 - }, - "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateJob": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetJob": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "DeleteJob": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CancelJob": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateJob": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListJobs": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "GetTask": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "ListTasks": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "CreateResourceAllowance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetResourceAllowance": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "DeleteResourceAllowance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListResourceAllowances": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "UpdateResourceAllowance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_proto_list.json b/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_proto_list.json deleted file mode 100644 index cd5a69f0276..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_proto_list.json +++ /dev/null @@ -1,8 +0,0 @@ -[ - "../../protos/google/cloud/batch/v1alpha/batch.proto", - "../../protos/google/cloud/batch/v1alpha/job.proto", - "../../protos/google/cloud/batch/v1alpha/notification.proto", - "../../protos/google/cloud/batch/v1alpha/resource_allowance.proto", - "../../protos/google/cloud/batch/v1alpha/task.proto", - "../../protos/google/cloud/batch/v1alpha/volume.proto" -] diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/gapic_metadata.json b/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/gapic_metadata.json deleted file mode 100644 index 4e922577356..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/gapic_metadata.json +++ /dev/null @@ -1,165 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.batch.v1alpha", - "libraryPackage": "@google-cloud/batch", - "services": { - "BatchService": { - "clients": { - "grpc": { - "libraryClient": "BatchServiceClient", - "rpcs": { - "CreateJob": { - "methods": [ - "createJob" - ] - }, - "GetJob": { - "methods": [ - "getJob" - ] - }, - "UpdateJob": { - "methods": [ - "updateJob" - ] - }, - "GetTask": { - "methods": [ - "getTask" - ] - }, - "CreateResourceAllowance": { - "methods": [ - "createResourceAllowance" - ] - }, - "GetResourceAllowance": { - "methods": [ - "getResourceAllowance" - ] - }, - "UpdateResourceAllowance": { - "methods": [ - "updateResourceAllowance" - ] - }, - "DeleteJob": { - "methods": [ - "deleteJob" - ] - }, - "CancelJob": { - "methods": [ - "cancelJob" - ] - }, - "DeleteResourceAllowance": { - "methods": [ - "deleteResourceAllowance" - ] - }, - "ListJobs": { - "methods": [ - "listJobs", - "listJobsStream", - "listJobsAsync" - ] - }, - "ListTasks": { - "methods": [ - "listTasks", - "listTasksStream", - "listTasksAsync" - ] - }, - "ListResourceAllowances": { - "methods": [ - "listResourceAllowances", - "listResourceAllowancesStream", - "listResourceAllowancesAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "BatchServiceClient", - "rpcs": { - "CreateJob": { - "methods": [ - "createJob" - ] - }, - "GetJob": { - "methods": [ - "getJob" - ] - }, - "UpdateJob": { - "methods": [ - "updateJob" - ] - }, - "GetTask": { - "methods": [ - "getTask" - ] - }, - "CreateResourceAllowance": { - "methods": [ - "createResourceAllowance" - ] - }, - "GetResourceAllowance": { - "methods": [ - "getResourceAllowance" - ] - }, - "UpdateResourceAllowance": { - "methods": [ - "updateResourceAllowance" - ] - }, - "DeleteJob": { - "methods": [ - "deleteJob" - ] - }, - "CancelJob": { - "methods": [ - "cancelJob" - ] - }, - "DeleteResourceAllowance": { - "methods": [ - "deleteResourceAllowance" - ] - }, - "ListJobs": { - "methods": [ - "listJobs", - "listJobsStream", - "listJobsAsync" - ] - }, - "ListTasks": { - "methods": [ - "listTasks", - "listTasksStream", - "listTasksAsync" - ] - }, - "ListResourceAllowances": { - "methods": [ - "listResourceAllowances", - "listResourceAllowancesStream", - "listResourceAllowancesAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/index.ts b/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/index.ts deleted file mode 100644 index fb53b495001..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {BatchServiceClient} from './batch_service_client'; diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-batch/v1alpha/system-test/fixtures/sample/src/index.js deleted file mode 100644 index b9ac0eb683e..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -/* eslint-disable node/no-missing-require, no-unused-vars */ -const batch = require('@google-cloud/batch'); - -function main() { - const batchServiceClient = new batch.BatchServiceClient(); -} - -main(); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-batch/v1alpha/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index c43e51952e7..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 {BatchServiceClient} from '@google-cloud/batch'; - -// check that the client class type name can be used -function doStuffWithBatchServiceClient(client: BatchServiceClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const batchServiceClient = new BatchServiceClient(); - doStuffWithBatchServiceClient(batchServiceClient); -} - -main(); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/system-test/install.ts b/owl-bot-staging/google-cloud-batch/v1alpha/system-test/install.ts deleted file mode 100644 index fd5bfdc71d5..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {packNTest} from 'pack-n-play'; -import {readFileSync} from 'fs'; -import {describe, it} from 'mocha'; - -describe('📦 pack-n-play test', () => { - - it('TypeScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'TypeScript user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() - } - }; - await packNTest(options); - }); - - it('JavaScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'JavaScript user can use the library', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() - } - }; - await packNTest(options); - }); - -}); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/test/gapic_batch_service_v1alpha.ts b/owl-bot-staging/google-cloud-batch/v1alpha/test/gapic_batch_service_v1alpha.ts deleted file mode 100644 index 1ef8a8bde46..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/test/gapic_batch_service_v1alpha.ts +++ /dev/null @@ -1,2938 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 batchserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos, LocationProtos} 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('v1alpha.BatchServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'batch.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient(); - 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 = batchserviceModule.v1alpha.BatchServiceClient.servicePath; - assert.strictEqual(servicePath, 'batch.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = batchserviceModule.v1alpha.BatchServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'batch.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'batch.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'batch.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 batchserviceModule.v1alpha.BatchServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'batch.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 batchserviceModule.v1alpha.BatchServiceClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'batch.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 batchserviceModule.v1alpha.BatchServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = batchserviceModule.v1alpha.BatchServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.batchServiceStub, undefined); - await client.initialize(); - assert(client.batchServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.batchServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.batchServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - 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 batchserviceModule.v1alpha.BatchServiceClient({ - 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('createJob', () => { - it('invokes createJob without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.CreateJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.CreateJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.Job() - ); - client.innerApiCalls.createJob = stubSimpleCall(expectedResponse); - const [response] = await client.createJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createJob without error using callback', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.CreateJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.CreateJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.Job() - ); - client.innerApiCalls.createJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createJob( - request, - (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.IJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createJob with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.CreateJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.CreateJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createJob(request), expectedError); - const actualRequest = (client.innerApiCalls.createJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createJob with closed client', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.CreateJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.CreateJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createJob(request), expectedError); - }); - }); - - describe('getJob', () => { - it('invokes getJob without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.GetJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.GetJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.Job() - ); - client.innerApiCalls.getJob = stubSimpleCall(expectedResponse); - const [response] = await client.getJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getJob without error using callback', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.GetJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.GetJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.Job() - ); - client.innerApiCalls.getJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getJob( - request, - (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.IJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getJob with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.GetJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.GetJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getJob(request), expectedError); - const actualRequest = (client.innerApiCalls.getJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getJob with closed client', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.GetJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.GetJobRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getJob(request), expectedError); - }); - }); - - describe('updateJob', () => { - it('invokes updateJob without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.UpdateJobRequest() - ); - request.job ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.UpdateJobRequest', ['job', 'name']); - request.job.name = defaultValue1; - const expectedHeaderRequestParams = `job.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.Job() - ); - client.innerApiCalls.updateJob = stubSimpleCall(expectedResponse); - const [response] = await client.updateJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateJob without error using callback', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.UpdateJobRequest() - ); - request.job ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.UpdateJobRequest', ['job', 'name']); - request.job.name = defaultValue1; - const expectedHeaderRequestParams = `job.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.Job() - ); - client.innerApiCalls.updateJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateJob( - request, - (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.IJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateJob with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.UpdateJobRequest() - ); - request.job ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.UpdateJobRequest', ['job', 'name']); - request.job.name = defaultValue1; - const expectedHeaderRequestParams = `job.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateJob(request), expectedError); - const actualRequest = (client.innerApiCalls.updateJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateJob with closed client', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.UpdateJobRequest() - ); - request.job ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.UpdateJobRequest', ['job', 'name']); - request.job.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateJob(request), expectedError); - }); - }); - - describe('getTask', () => { - it('invokes getTask without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.GetTaskRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.GetTaskRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.Task() - ); - client.innerApiCalls.getTask = stubSimpleCall(expectedResponse); - const [response] = await client.getTask(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getTask as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTask as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getTask without error using callback', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.GetTaskRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.GetTaskRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.Task() - ); - client.innerApiCalls.getTask = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getTask( - request, - (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.ITask|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getTask as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTask as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getTask with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.GetTaskRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.GetTaskRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getTask = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTask(request), expectedError); - const actualRequest = (client.innerApiCalls.getTask as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTask as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getTask with closed client', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.GetTaskRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.GetTaskRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getTask(request), expectedError); - }); - }); - - describe('createResourceAllowance', () => { - it('invokes createResourceAllowance without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ResourceAllowance() - ); - client.innerApiCalls.createResourceAllowance = stubSimpleCall(expectedResponse); - const [response] = await client.createResourceAllowance(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createResourceAllowance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createResourceAllowance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createResourceAllowance without error using callback', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ResourceAllowance() - ); - client.innerApiCalls.createResourceAllowance = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createResourceAllowance( - request, - (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.IResourceAllowance|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createResourceAllowance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createResourceAllowance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createResourceAllowance with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createResourceAllowance = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createResourceAllowance(request), expectedError); - const actualRequest = (client.innerApiCalls.createResourceAllowance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createResourceAllowance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createResourceAllowance with closed client', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createResourceAllowance(request), expectedError); - }); - }); - - describe('getResourceAllowance', () => { - it('invokes getResourceAllowance without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.GetResourceAllowanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.GetResourceAllowanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ResourceAllowance() - ); - client.innerApiCalls.getResourceAllowance = stubSimpleCall(expectedResponse); - const [response] = await client.getResourceAllowance(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getResourceAllowance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getResourceAllowance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getResourceAllowance without error using callback', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.GetResourceAllowanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.GetResourceAllowanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ResourceAllowance() - ); - client.innerApiCalls.getResourceAllowance = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getResourceAllowance( - request, - (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.IResourceAllowance|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getResourceAllowance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getResourceAllowance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getResourceAllowance with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.GetResourceAllowanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.GetResourceAllowanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getResourceAllowance = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getResourceAllowance(request), expectedError); - const actualRequest = (client.innerApiCalls.getResourceAllowance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getResourceAllowance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getResourceAllowance with closed client', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.GetResourceAllowanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.GetResourceAllowanceRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getResourceAllowance(request), expectedError); - }); - }); - - describe('updateResourceAllowance', () => { - it('invokes updateResourceAllowance without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest() - ); - request.resourceAllowance ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest', ['resourceAllowance', 'name']); - request.resourceAllowance.name = defaultValue1; - const expectedHeaderRequestParams = `resource_allowance.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ResourceAllowance() - ); - client.innerApiCalls.updateResourceAllowance = stubSimpleCall(expectedResponse); - const [response] = await client.updateResourceAllowance(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateResourceAllowance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateResourceAllowance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateResourceAllowance without error using callback', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest() - ); - request.resourceAllowance ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest', ['resourceAllowance', 'name']); - request.resourceAllowance.name = defaultValue1; - const expectedHeaderRequestParams = `resource_allowance.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ResourceAllowance() - ); - client.innerApiCalls.updateResourceAllowance = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateResourceAllowance( - request, - (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.IResourceAllowance|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateResourceAllowance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateResourceAllowance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateResourceAllowance with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest() - ); - request.resourceAllowance ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest', ['resourceAllowance', 'name']); - request.resourceAllowance.name = defaultValue1; - const expectedHeaderRequestParams = `resource_allowance.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateResourceAllowance = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateResourceAllowance(request), expectedError); - const actualRequest = (client.innerApiCalls.updateResourceAllowance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateResourceAllowance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateResourceAllowance with closed client', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest() - ); - request.resourceAllowance ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest', ['resourceAllowance', 'name']); - request.resourceAllowance.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateResourceAllowance(request), expectedError); - }); - }); - - describe('deleteJob', () => { - it('invokes deleteJob without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.DeleteJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.DeleteJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteJob(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteJob without error using callback', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.DeleteJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.DeleteJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteJob( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteJob with call error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.DeleteJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.DeleteJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteJob(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteJob with LRO error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.DeleteJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.DeleteJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteJob(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteJobProgress without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - 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.checkDeleteJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteJobProgress with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('cancelJob', () => { - it('invokes cancelJob without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.CancelJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.CancelJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.cancelJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.cancelJob(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.cancelJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes cancelJob without error using callback', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.CancelJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.CancelJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.cancelJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.cancelJob( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.cancelJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes cancelJob with call error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.CancelJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.CancelJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.cancelJob(request), expectedError); - const actualRequest = (client.innerApiCalls.cancelJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes cancelJob with LRO error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.CancelJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.CancelJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.cancelJob(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.cancelJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCancelJobProgress without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - 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.checkCancelJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCancelJobProgress with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCancelJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteResourceAllowance', () => { - it('invokes deleteResourceAllowance without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteResourceAllowance = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteResourceAllowance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteResourceAllowance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteResourceAllowance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteResourceAllowance without error using callback', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteResourceAllowance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteResourceAllowance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteResourceAllowance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteResourceAllowance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteResourceAllowance with call error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteResourceAllowance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteResourceAllowance(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteResourceAllowance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteResourceAllowance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteResourceAllowance with LRO error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteResourceAllowance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteResourceAllowance(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteResourceAllowance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteResourceAllowance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteResourceAllowanceProgress without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - 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.checkDeleteResourceAllowanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteResourceAllowanceProgress with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteResourceAllowanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listJobs', () => { - it('invokes listJobs without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), - ]; - client.innerApiCalls.listJobs = stubSimpleCall(expectedResponse); - const [response] = await client.listJobs(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listJobs without error using callback', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), - ]; - client.innerApiCalls.listJobs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listJobs( - request, - (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.IJob[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listJobs with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listJobs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listJobs(request), expectedError); - const actualRequest = (client.innerApiCalls.listJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listJobsStream without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), - ]; - client.descriptors.page.listJobs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.batch.v1alpha.Job[] = []; - stream.on('data', (response: protos.google.cloud.batch.v1alpha.Job) => { - 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.listJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listJobs, request)); - assert( - (client.descriptors.page.listJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listJobsStream with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listJobs.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.batch.v1alpha.Job[] = []; - stream.on('data', (response: protos.google.cloud.batch.v1alpha.Job) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listJobs, request)); - assert( - (client.descriptors.page.listJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listJobs without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), - ]; - client.descriptors.page.listJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.batch.v1alpha.IJob[] = []; - const iterable = client.listJobsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listJobs with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listJobsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.batch.v1alpha.IJob[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listTasks', () => { - it('invokes listTasks without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListTasksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), - ]; - client.innerApiCalls.listTasks = stubSimpleCall(expectedResponse); - const [response] = await client.listTasks(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listTasks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTasks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listTasks without error using callback', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListTasksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), - ]; - client.innerApiCalls.listTasks = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listTasks( - request, - (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.ITask[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listTasks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTasks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listTasks with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListTasksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listTasks = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTasks(request), expectedError); - const actualRequest = (client.innerApiCalls.listTasks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTasks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listTasksStream without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListTasksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), - ]; - client.descriptors.page.listTasks.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listTasksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.batch.v1alpha.Task[] = []; - stream.on('data', (response: protos.google.cloud.batch.v1alpha.Task) => { - 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.listTasks.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTasks, request)); - assert( - (client.descriptors.page.listTasks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listTasksStream with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListTasksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listTasks.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listTasksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.batch.v1alpha.Task[] = []; - stream.on('data', (response: protos.google.cloud.batch.v1alpha.Task) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listTasks.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTasks, request)); - assert( - (client.descriptors.page.listTasks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listTasks without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListTasksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), - ]; - client.descriptors.page.listTasks.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.batch.v1alpha.ITask[] = []; - const iterable = client.listTasksAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listTasks.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listTasks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listTasks with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListTasksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listTasks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listTasksAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.batch.v1alpha.ITask[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listTasks.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listTasks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listResourceAllowances', () => { - it('invokes listResourceAllowances without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListResourceAllowancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListResourceAllowancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), - ]; - client.innerApiCalls.listResourceAllowances = stubSimpleCall(expectedResponse); - const [response] = await client.listResourceAllowances(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listResourceAllowances as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listResourceAllowances as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listResourceAllowances without error using callback', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListResourceAllowancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListResourceAllowancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), - ]; - client.innerApiCalls.listResourceAllowances = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listResourceAllowances( - request, - (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.IResourceAllowance[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listResourceAllowances as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listResourceAllowances as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listResourceAllowances with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListResourceAllowancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListResourceAllowancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listResourceAllowances = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listResourceAllowances(request), expectedError); - const actualRequest = (client.innerApiCalls.listResourceAllowances as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listResourceAllowances as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listResourceAllowancesStream without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListResourceAllowancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListResourceAllowancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), - ]; - client.descriptors.page.listResourceAllowances.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listResourceAllowancesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.batch.v1alpha.ResourceAllowance[] = []; - stream.on('data', (response: protos.google.cloud.batch.v1alpha.ResourceAllowance) => { - 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.listResourceAllowances.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listResourceAllowances, request)); - assert( - (client.descriptors.page.listResourceAllowances.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listResourceAllowancesStream with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListResourceAllowancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListResourceAllowancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listResourceAllowances.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listResourceAllowancesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.batch.v1alpha.ResourceAllowance[] = []; - stream.on('data', (response: protos.google.cloud.batch.v1alpha.ResourceAllowance) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listResourceAllowances.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listResourceAllowances, request)); - assert( - (client.descriptors.page.listResourceAllowances.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listResourceAllowances without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListResourceAllowancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListResourceAllowancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), - ]; - client.descriptors.page.listResourceAllowances.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.batch.v1alpha.IResourceAllowance[] = []; - const iterable = client.listResourceAllowancesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listResourceAllowances.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listResourceAllowances.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listResourceAllowances with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListResourceAllowancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListResourceAllowancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listResourceAllowances.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listResourceAllowancesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.batch.v1alpha.IResourceAllowance[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listResourceAllowances.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listResourceAllowances.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation without error using callback', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.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 batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - 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 batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - 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 batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - 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 batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - describe('Path templates', () => { - - describe('job', () => { - const fakePath = "/rendered/path/job"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - }; - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.jobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.jobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('jobPath', () => { - const result = client.jobPath("projectValue", "locationValue", "jobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.jobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromJobName', () => { - const result = client.matchProjectFromJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.jobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromJobName', () => { - const result = client.matchLocationFromJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.jobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchJobFromJobName', () => { - const result = client.matchJobFromJobName(fakePath); - assert.strictEqual(result, "jobValue"); - assert((client.pathTemplates.jobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('resourceAllowance', () => { - const fakePath = "/rendered/path/resourceAllowance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - resource_allowance: "resourceAllowanceValue", - }; - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.resourceAllowancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.resourceAllowancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('resourceAllowancePath', () => { - const result = client.resourceAllowancePath("projectValue", "locationValue", "resourceAllowanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.resourceAllowancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromResourceAllowanceName', () => { - const result = client.matchProjectFromResourceAllowanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.resourceAllowancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromResourceAllowanceName', () => { - const result = client.matchLocationFromResourceAllowanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.resourceAllowancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchResourceAllowanceFromResourceAllowanceName', () => { - const result = client.matchResourceAllowanceFromResourceAllowanceName(fakePath); - assert.strictEqual(result, "resourceAllowanceValue"); - assert((client.pathTemplates.resourceAllowancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('task', () => { - const fakePath = "/rendered/path/task"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - task_group: "taskGroupValue", - task: "taskValue", - }; - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.taskPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.taskPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('taskPath', () => { - const result = client.taskPath("projectValue", "locationValue", "jobValue", "taskGroupValue", "taskValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.taskPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTaskName', () => { - const result = client.matchProjectFromTaskName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.taskPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTaskName', () => { - const result = client.matchLocationFromTaskName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.taskPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchJobFromTaskName', () => { - const result = client.matchJobFromTaskName(fakePath); - assert.strictEqual(result, "jobValue"); - assert((client.pathTemplates.taskPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTaskGroupFromTaskName', () => { - const result = client.matchTaskGroupFromTaskName(fakePath); - assert.strictEqual(result, "taskGroupValue"); - assert((client.pathTemplates.taskPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTaskFromTaskName', () => { - const result = client.matchTaskFromTaskName(fakePath); - assert.strictEqual(result, "taskValue"); - assert((client.pathTemplates.taskPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('taskGroup', () => { - const fakePath = "/rendered/path/taskGroup"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - task_group: "taskGroupValue", - }; - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.taskGroupPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.taskGroupPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('taskGroupPath', () => { - const result = client.taskGroupPath("projectValue", "locationValue", "jobValue", "taskGroupValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.taskGroupPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTaskGroupName', () => { - const result = client.matchProjectFromTaskGroupName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.taskGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTaskGroupName', () => { - const result = client.matchLocationFromTaskGroupName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.taskGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchJobFromTaskGroupName', () => { - const result = client.matchJobFromTaskGroupName(fakePath); - assert.strictEqual(result, "jobValue"); - assert((client.pathTemplates.taskGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTaskGroupFromTaskGroupName', () => { - const result = client.matchTaskGroupFromTaskGroupName(fakePath); - assert.strictEqual(result, "taskGroupValue"); - assert((client.pathTemplates.taskGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/tsconfig.json b/owl-bot-staging/google-cloud-batch/v1alpha/tsconfig.json deleted file mode 100644 index c78f1c884ef..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2018", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts" - ] -} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/webpack.config.js b/owl-bot-staging/google-cloud-batch/v1alpha/webpack.config.js deleted file mode 100644 index 04a4c53960a..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const path = require('path'); - -module.exports = { - entry: './src/index.ts', - output: { - library: 'BatchService', - filename: './batch-service.js', - }, - node: { - child_process: 'empty', - fs: 'empty', - crypto: 'empty', - }, - resolve: { - alias: { - '../../../package.json': path.resolve(__dirname, 'package.json'), - }, - extensions: ['.js', '.json', '.ts'], - }, - module: { - rules: [ - { - test: /\.tsx?$/, - use: 'ts-loader', - exclude: /node_modules/ - }, - { - test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]grpc/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]retry-request/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]gtoken/, - use: 'null-loader' - }, - ], - }, - mode: 'production', -}; diff --git a/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/batch.proto b/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/batch.proto index 738ff341aa9..7591e92c08e 100644 --- a/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/batch.proto +++ b/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/batch.proto @@ -576,9 +576,10 @@ message OperationMetadata { // Output only. Identifies whether the user has requested cancellation // of the operation. Operations that have successfully been cancelled - // have [Operation.error][] value with a - // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - // `Code.CANCELLED`. + // have + // [google.longrunning.Operation.error][google.longrunning.Operation.error] + // value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. API version used to start the operation. From 802e4c38aab9a74b6c8a657589da2efc498e6701 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 27 Dec 2024 19:01:33 +0000 Subject: [PATCH 3/4] docs: fix broken references in comments PiperOrigin-RevId: 710060918 Source-Link: https://github.com/googleapis/googleapis/commit/f7314d1e02e7651b33985c65c2d268de7fbacc1e Source-Link: https://github.com/googleapis/googleapis-gen/commit/2dee5f1a153a1a447abccefe8aa81f692407724a Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiIyZGVlNWYxYTE1M2ExYTQ0N2FiY2NlZmU4YWE4MWY2OTI0MDc3MjRhIn0= --- .../google-cloud-batch/v1/.eslintignore | 7 + .../google-cloud-batch/v1/.eslintrc.json | 3 + .../google-cloud-batch/v1/.gitignore | 14 + .../google-cloud-batch/v1/.jsdoc.js | 55 + .../google-cloud-batch/v1/.mocharc.js | 33 + .../google-cloud-batch/v1/.prettierrc.js | 22 + .../google-cloud-batch/v1/README.md | 1 + .../google-cloud-batch/v1/package.json | 58 + .../protos/google/cloud/batch/v1/batch.proto | 276 + .../v1/protos/google/cloud/batch/v1/job.proto | 693 + .../protos/google/cloud/batch/v1/task.proto | 475 + .../protos/google/cloud/batch/v1/volume.proto | 80 + .../google-cloud-batch/v1/protos/protos.d.ts | 13321 +++++ .../google-cloud-batch/v1/protos/protos.js | 35612 +++++++++++++ .../google-cloud-batch/v1/protos/protos.json | 3401 ++ .../generated/v1/batch_service.create_job.js | 92 + .../generated/v1/batch_service.delete_job.js | 79 + .../generated/v1/batch_service.get_job.js | 61 + .../generated/v1/batch_service.get_task.js | 61 + .../generated/v1/batch_service.list_jobs.js | 79 + .../generated/v1/batch_service.list_tasks.js | 79 + ...nippet_metadata_google.cloud.batch.v1.json | 303 + .../google-cloud-batch/v1/src/index.ts | 25 + .../v1/src/v1/batch_service_client.ts | 1620 + .../src/v1/batch_service_client_config.json | 68 + .../v1/src/v1/batch_service_proto_list.json | 6 + .../v1/src/v1/gapic_metadata.json | 91 + .../google-cloud-batch/v1/src/v1/index.ts | 19 + .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 32 + .../v1/system-test/install.ts | 49 + .../v1/test/gapic_batch_service_v1.ts | 1899 + .../google-cloud-batch/v1/tsconfig.json | 19 + .../google-cloud-batch/v1/webpack.config.js | 64 + .../google-cloud-batch/v1alpha/.eslintignore | 7 + .../google-cloud-batch/v1alpha/.eslintrc.json | 3 + .../google-cloud-batch/v1alpha/.gitignore | 14 + .../google-cloud-batch/v1alpha/.jsdoc.js | 55 + .../google-cloud-batch/v1alpha/.mocharc.js | 33 + .../google-cloud-batch/v1alpha/.prettierrc.js | 22 + .../google-cloud-batch/v1alpha/README.md | 1 + .../google-cloud-batch/v1alpha/package.json | 58 + .../google/cloud/batch/v1alpha/batch.proto | 587 + .../google/cloud/batch/v1alpha/job.proto | 802 + .../cloud/batch/v1alpha/notification.proto | 38 + .../batch/v1alpha/resource_allowance.proto | 208 + .../google/cloud/batch/v1alpha/task.proto | 494 + .../google/cloud/batch/v1alpha/volume.proto | 98 + .../v1alpha/protos/protos.d.ts | 16145 ++++++ .../v1alpha/protos/protos.js | 42614 ++++++++++++++++ .../v1alpha/protos/protos.json | 4203 ++ .../v1alpha/batch_service.cancel_job.js | 76 + .../v1alpha/batch_service.create_job.js | 92 + ...batch_service.create_resource_allowance.js | 93 + .../v1alpha/batch_service.delete_job.js | 79 + ...batch_service.delete_resource_allowance.js | 80 + .../v1alpha/batch_service.get_job.js | 61 + .../batch_service.get_resource_allowance.js | 61 + .../v1alpha/batch_service.get_task.js | 61 + .../v1alpha/batch_service.list_jobs.js | 79 + .../batch_service.list_resource_allowances.js | 71 + .../v1alpha/batch_service.list_tasks.js | 83 + .../v1alpha/batch_service.update_job.js | 95 + ...batch_service.update_resource_allowance.js | 88 + ...t_metadata_google.cloud.batch.v1alpha.json | 635 + .../google-cloud-batch/v1alpha/src/index.ts | 25 + .../src/v1alpha/batch_service_client.ts | 2441 + .../v1alpha/batch_service_client_config.json | 103 + .../src/v1alpha/batch_service_proto_list.json | 8 + .../v1alpha/src/v1alpha/gapic_metadata.json | 165 + .../v1alpha/src/v1alpha/index.ts | 19 + .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 32 + .../v1alpha/system-test/install.ts | 49 + .../test/gapic_batch_service_v1alpha.ts | 2938 ++ .../google-cloud-batch/v1alpha/tsconfig.json | 19 + .../v1alpha/webpack.config.js | 64 + 77 files changed, 131650 insertions(+) create mode 100644 owl-bot-staging/google-cloud-batch/v1/.eslintignore create mode 100644 owl-bot-staging/google-cloud-batch/v1/.eslintrc.json create mode 100644 owl-bot-staging/google-cloud-batch/v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-batch/v1/.jsdoc.js create mode 100644 owl-bot-staging/google-cloud-batch/v1/.mocharc.js create mode 100644 owl-bot-staging/google-cloud-batch/v1/.prettierrc.js create mode 100644 owl-bot-staging/google-cloud-batch/v1/README.md create mode 100644 owl-bot-staging/google-cloud-batch/v1/package.json create mode 100644 owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/batch.proto create mode 100644 owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/job.proto create mode 100644 owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/task.proto create mode 100644 owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/volume.proto create mode 100644 owl-bot-staging/google-cloud-batch/v1/protos/protos.d.ts create mode 100644 owl-bot-staging/google-cloud-batch/v1/protos/protos.js create mode 100644 owl-bot-staging/google-cloud-batch/v1/protos/protos.json create mode 100644 owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.create_job.js create mode 100644 owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.delete_job.js create mode 100644 owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.get_job.js create mode 100644 owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.get_task.js create mode 100644 owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.list_jobs.js create mode 100644 owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.list_tasks.js create mode 100644 owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/snippet_metadata_google.cloud.batch.v1.json create mode 100644 owl-bot-staging/google-cloud-batch/v1/src/index.ts create mode 100644 owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_client.ts create mode 100644 owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-batch/v1/src/v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-batch/v1/src/v1/index.ts create mode 100644 owl-bot-staging/google-cloud-batch/v1/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/google-cloud-batch/v1/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/google-cloud-batch/v1/system-test/install.ts create mode 100644 owl-bot-staging/google-cloud-batch/v1/test/gapic_batch_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-batch/v1/tsconfig.json create mode 100644 owl-bot-staging/google-cloud-batch/v1/webpack.config.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/.eslintignore create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/.eslintrc.json create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/.gitignore create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/.jsdoc.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/.mocharc.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/.prettierrc.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/README.md create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/package.json create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/batch.proto create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/job.proto create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/notification.proto create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/resource_allowance.proto create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/task.proto create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/volume.proto create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.d.ts create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.json create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.cancel_job.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.create_job.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.create_resource_allowance.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.delete_job.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.delete_resource_allowance.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_job.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_resource_allowance.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_task.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_jobs.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_resource_allowances.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_tasks.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.update_job.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.update_resource_allowance.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/snippet_metadata_google.cloud.batch.v1alpha.json create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/src/index.ts create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_client.ts create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/index.ts create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/system-test/install.ts create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/test/gapic_batch_service_v1alpha.ts create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/tsconfig.json create mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/webpack.config.js diff --git a/owl-bot-staging/google-cloud-batch/v1/.eslintignore b/owl-bot-staging/google-cloud-batch/v1/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-cloud-batch/v1/.eslintrc.json b/owl-bot-staging/google-cloud-batch/v1/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-cloud-batch/v1/.gitignore b/owl-bot-staging/google-cloud-batch/v1/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +/.coverage +/coverage +/.nyc_output +/docs/ +/out/ +/build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/google-cloud-batch/v1/.jsdoc.js b/owl-bot-staging/google-cloud-batch/v1/.jsdoc.js new file mode 100644 index 00000000000..f3c1e45a4fc --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2024 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/batch', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-cloud-batch/v1/.mocharc.js b/owl-bot-staging/google-cloud-batch/v1/.mocharc.js new file mode 100644 index 00000000000..13b67c34edc --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/google-cloud-batch/v1/.prettierrc.js b/owl-bot-staging/google-cloud-batch/v1/.prettierrc.js new file mode 100644 index 00000000000..9a8fd690982 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/google-cloud-batch/v1/README.md b/owl-bot-staging/google-cloud-batch/v1/README.md new file mode 100644 index 00000000000..15b2fa3f3e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/README.md @@ -0,0 +1 @@ +Batch: Nodejs Client diff --git a/owl-bot-staging/google-cloud-batch/v1/package.json b/owl-bot-staging/google-cloud-batch/v1/package.json new file mode 100644 index 00000000000..d27d57773ff --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/package.json @@ -0,0 +1,58 @@ +{ + "name": "@google-cloud/batch", + "version": "0.1.0", + "description": "Batch client for Node.js", + "repository": "googleapis/nodejs-batch", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google batch", + "batch", + "batch service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^4.3.4" + }, + "devDependencies": { + "@types/mocha": "^10.0.6", + "@types/node": "^20.12.12", + "@types/sinon": "^10.0.20", + "c8": "^9.1.0", + "gapic-tools": "^0.4.2", + "gts": "5.3.0", + "jsdoc": "^4.0.3", + "jsdoc-fresh": "^3.0.0", + "jsdoc-region-tag": "^3.0.0", + "mocha": "^10.4.0", + "pack-n-play": "^2.0.3", + "sinon": "^15.2.0", + "typescript": "5.1.6" + }, + "engines": { + "node": ">=v14" + } +} diff --git a/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/batch.proto b/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/batch.proto new file mode 100644 index 00000000000..91b902cdb18 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/batch.proto @@ -0,0 +1,276 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.batch.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/cloud/batch/v1/job.proto"; +import "google/cloud/batch/v1/task.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Batch.V1"; +option go_package = "cloud.google.com/go/batch/apiv1/batchpb;batchpb"; +option java_multiple_files = true; +option java_outer_classname = "BatchProto"; +option java_package = "com.google.cloud.batch.v1"; +option objc_class_prefix = "GCB"; +option php_namespace = "Google\\Cloud\\Batch\\V1"; +option ruby_package = "Google::Cloud::Batch::V1"; + +// Google Batch Service. +// The service manages user submitted batch jobs and allocates Google Compute +// Engine VM instances to run the jobs. +service BatchService { + option (google.api.default_host) = "batch.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Create a Job. + rpc CreateJob(CreateJobRequest) returns (Job) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/jobs" + body: "job" + }; + option (google.api.method_signature) = "parent,job,job_id"; + } + + // Get a Job specified by its resource name. + rpc GetJob(GetJobRequest) returns (Job) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/jobs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Delete a Job. + rpc DeleteJob(DeleteJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/jobs/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.batch.v1.OperationMetadata" + }; + } + + // List all Jobs for a project within a region. + rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/jobs" + }; + option (google.api.method_signature) = "parent"; + } + + // Return a single Task. + rpc GetTask(GetTaskRequest) returns (Task) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/jobs/*/taskGroups/*/tasks/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List Tasks associated with a job. + rpc ListTasks(ListTasksRequest) returns (ListTasksResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/jobs/*/taskGroups/*}/tasks" + }; + option (google.api.method_signature) = "parent"; + } +} + +// CreateJob Request. +message CreateJobRequest { + // Required. The parent resource name where the Job will be created. + // Pattern: "projects/{project}/locations/{location}" + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { child_type: "batch.googleapis.com/Job" } + ]; + + // ID used to uniquely identify the Job within its parent scope. + // This field should contain at most 63 characters and must start with + // lowercase characters. + // Only lowercase characters, numbers and '-' are accepted. + // The '-' character cannot be the first or the last one. + // A system generated ID will be used if the field is not set. + // + // The job.name field in the request will be ignored and the created resource + // name of the Job will be "{parent}/jobs/{job_id}". + string job_id = 2; + + // Required. The Job to create. + Job job = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// GetJob Request. +message GetJobRequest { + // Required. Job name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "batch.googleapis.com/Job" } + ]; +} + +// DeleteJob Request. +message DeleteJobRequest { + // Job name. + string name = 1; + + // Optional. Reason for this deletion. + string reason = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// ListJob Request. +message ListJobsRequest { + // Parent path. + string parent = 1; + + // List filter. + string filter = 4; + + // Optional. Sort results. Supported are "name", "name desc", "create_time", + // and "create_time desc". + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Page size. + int32 page_size = 2; + + // Page token. + string page_token = 3; +} + +// ListJob Response. +message ListJobsResponse { + // Jobs. + repeated Job jobs = 1; + + // Next page token. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// ListTasks Request. +message ListTasksRequest { + // Required. Name of a TaskGroup from which Tasks are being requested. + // Pattern: + // "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "batch.googleapis.com/TaskGroup" } + ]; + + // Task filter, null filter matches all Tasks. + // Filter string should be of the format State=TaskStatus.State e.g. + // State=RUNNING + string filter = 2; + + // Page size. + int32 page_size = 3; + + // Page token. + string page_token = 4; +} + +// ListTasks Response. +message ListTasksResponse { + // Tasks. + repeated Task tasks = 1; + + // Next page token. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request for a single Task by name. +message GetTaskRequest { + // Required. Task name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "batch.googleapis.com/Task" } + ]; +} + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have + // [google.longrunning.Operation.error][google.longrunning.Operation.error] + // value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/job.proto b/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/job.proto new file mode 100644 index 00000000000..a215c35b837 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/job.proto @@ -0,0 +1,693 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.batch.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/batch/v1/task.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Batch.V1"; +option go_package = "cloud.google.com/go/batch/apiv1/batchpb;batchpb"; +option java_multiple_files = true; +option java_outer_classname = "JobProto"; +option java_package = "com.google.cloud.batch.v1"; +option objc_class_prefix = "GCB"; +option php_namespace = "Google\\Cloud\\Batch\\V1"; +option ruby_package = "Google::Cloud::Batch::V1"; + +// The Cloud Batch Job description. +message Job { + option (google.api.resource) = { + type: "batch.googleapis.com/Job" + pattern: "projects/{project}/locations/{location}/jobs/{job}" + }; + + // Output only. Job name. + // For example: "projects/123456/locations/us-central1/jobs/job01". + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A system generated unique ID for the Job. + string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Priority of the Job. + // The valid value range is [0, 100). Default value is 0. + // Higher value indicates higher priority. + // A job with higher priority value is more likely to run earlier if all other + // requirements are satisfied. + int64 priority = 3; + + // Required. TaskGroups in the Job. Only one TaskGroup is supported now. + repeated TaskGroup task_groups = 4 [(google.api.field_behavior) = REQUIRED]; + + // Compute resource allocation for all TaskGroups in the Job. + AllocationPolicy allocation_policy = 7; + + // Custom labels to apply to the job and any Cloud Logging + // [LogEntry](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry) + // that it generates. + // + // Use labels to group and describe the resources they are applied to. Batch + // automatically applies predefined labels and supports multiple `labels` + // fields for each job, which each let you apply custom labels to various + // resources. Label names that start with "goog-" or "google-" are + // reserved for predefined labels. For more information about labels with + // Batch, see + // [Organize resources using + // labels](https://cloud.google.com/batch/docs/organize-resources-using-labels). + map labels = 8; + + // Output only. Job status. It is read only for users. + JobStatus status = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. When the Job was created. + google.protobuf.Timestamp create_time = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last time the Job was updated. + google.protobuf.Timestamp update_time = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Log preservation policy for the Job. + LogsPolicy logs_policy = 13; + + // Notification configurations. + repeated JobNotification notifications = 14; +} + +// LogsPolicy describes if and how a job's logs are preserved. Logs include +// information that is automatically written by the Batch service agent and any +// information that you configured the job's runnables to write to the `stdout` +// or `stderr` streams. +message LogsPolicy { + // `CloudLoggingOption` contains additional settings for Cloud Logging logs + // generated by Batch job. + message CloudLoggingOption { + // Optional. Set this field to `true` to change the [monitored resource + // type](https://cloud.google.com/monitoring/api/resources) for + // Cloud Logging logs generated by this Batch job from + // the + // [`batch.googleapis.com/Job`](https://cloud.google.com/monitoring/api/resources#tag_batch.googleapis.com/Job) + // type to the formerly used + // [`generic_task`](https://cloud.google.com/monitoring/api/resources#tag_generic_task) + // type. + bool use_generic_task_monitored_resource = 1 + [(google.api.field_behavior) = OPTIONAL]; + } + + // The destination (if any) for logs. + enum Destination { + // (Default) Logs are not preserved. + DESTINATION_UNSPECIFIED = 0; + + // Logs are streamed to Cloud Logging. Optionally, you can configure + // additional settings in the `cloudLoggingOption` field. + CLOUD_LOGGING = 1; + + // Logs are saved to the file path specified in the `logsPath` field. + PATH = 2; + } + + // If and where logs should be saved. + Destination destination = 1; + + // When `destination` is set to `PATH`, you must set this field to the path + // where you want logs to be saved. This path can point to a local directory + // on the VM or (if congifured) a directory under the mount path of any + // Cloud Storage bucket, network file system (NFS), or writable persistent + // disk that is mounted to the job. For example, if the job has a bucket with + // `mountPath` set to `/mnt/disks/my-bucket`, you can write logs to the + // root directory of the `remotePath` of that bucket by setting this field to + // `/mnt/disks/my-bucket/`. + string logs_path = 2; + + // Optional. When `destination` is set to `CLOUD_LOGGING`, you can optionally + // set this field to configure additional settings for Cloud Logging. + CloudLoggingOption cloud_logging_option = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Job status. +message JobStatus { + // VM instance status. + message InstanceStatus { + // The Compute Engine machine type. + string machine_type = 1; + + // The VM instance provisioning model. + AllocationPolicy.ProvisioningModel provisioning_model = 2; + + // The max number of tasks can be assigned to this instance type. + int64 task_pack = 3; + + // The VM boot disk. + AllocationPolicy.Disk boot_disk = 4; + } + + // Aggregated task status for a TaskGroup. + message TaskGroupStatus { + // Count of task in each state in the TaskGroup. + // The map key is task state name. + map counts = 1; + + // Status of instances allocated for the TaskGroup. + repeated InstanceStatus instances = 2; + } + + // Valid Job states. + enum State { + // Job state unspecified. + STATE_UNSPECIFIED = 0; + + // Job is admitted (validated and persisted) and waiting for resources. + QUEUED = 1; + + // Job is scheduled to run as soon as resource allocation is ready. + // The resource allocation may happen at a later time but with a high + // chance to succeed. + SCHEDULED = 2; + + // Resource allocation has been successful. At least one Task in the Job is + // RUNNING. + RUNNING = 3; + + // All Tasks in the Job have finished successfully. + SUCCEEDED = 4; + + // At least one Task in the Job has failed. + FAILED = 5; + + // The Job will be deleted, but has not been deleted yet. Typically this is + // because resources used by the Job are still being cleaned up. + DELETION_IN_PROGRESS = 6; + } + + // Job state + State state = 1; + + // Job status events + repeated StatusEvent status_events = 2; + + // Aggregated task status for each TaskGroup in the Job. + // The map key is TaskGroup ID. + map task_groups = 4; + + // The duration of time that the Job spent in status RUNNING. + google.protobuf.Duration run_duration = 5; +} + +// Notification configurations. +message JobNotification { + // Message details. + // Describe the conditions under which messages will be sent. + // If no attribute is defined, no message will be sent by default. + // One message should specify either the job or the task level attributes, + // but not both. For example, + // job level: JOB_STATE_CHANGED and/or a specified new_job_state; + // task level: TASK_STATE_CHANGED and/or a specified new_task_state. + message Message { + // The message type. + Type type = 1; + + // The new job state. + JobStatus.State new_job_state = 2; + + // The new task state. + TaskStatus.State new_task_state = 3; + } + + // The message type. + enum Type { + // Unspecified. + TYPE_UNSPECIFIED = 0; + + // Notify users that the job state has changed. + JOB_STATE_CHANGED = 1; + + // Notify users that the task state has changed. + TASK_STATE_CHANGED = 2; + } + + // The Pub/Sub topic where notifications for the job, like state + // changes, will be published. If undefined, no Pub/Sub notifications + // are sent for this job. + // + // Specify the topic using the following format: + // `projects/{project}/topics/{topic}`. + // Notably, if you want to specify a Pub/Sub topic that is in a + // different project than the job, your administrator must grant your + // project's Batch service agent permission to publish to that topic. + // + // For more information about configuring Pub/Sub notifications for + // a job, see + // https://cloud.google.com/batch/docs/enable-notifications. + string pubsub_topic = 1; + + // The attribute requirements of messages to be sent to this Pub/Sub topic. + // Without this field, no message will be sent. + Message message = 2; +} + +// A Job's resource allocation policy describes when, where, and how compute +// resources should be allocated for the Job. +message AllocationPolicy { + message LocationPolicy { + // A list of allowed location names represented by internal URLs. + // + // Each location can be a region or a zone. + // Only one region or multiple zones in one region is supported now. + // For example, + // ["regions/us-central1"] allow VMs in any zones in region us-central1. + // ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs + // in zones us-central1-a and us-central1-c. + // + // Mixing locations from different regions would cause errors. + // For example, + // ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b", + // "zones/us-west1-a"] contains locations from two distinct regions: + // us-central1 and us-west1. This combination will trigger an error. + repeated string allowed_locations = 1; + } + + // A new persistent disk or a local ssd. + // A VM can only have one local SSD setting but multiple local SSD partitions. + // See https://cloud.google.com/compute/docs/disks#pdspecs and + // https://cloud.google.com/compute/docs/disks#localssds. + message Disk { + // A data source from which a PD will be created. + oneof data_source { + // URL for a VM image to use as the data source for this disk. + // For example, the following are all valid URLs: + // + // * Specify the image by its family name: + // projects/{project}/global/images/family/{image_family} + // * Specify the image version: + // projects/{project}/global/images/{image_version} + // + // You can also use Batch customized image in short names. + // The following image values are supported for a boot disk: + // + // * `batch-debian`: use Batch Debian images. + // * `batch-cos`: use Batch Container-Optimized images. + // * `batch-hpc-rocky`: use Batch HPC Rocky Linux images. + string image = 4; + + // Name of a snapshot used as the data source. + // Snapshot is not supported as boot disk now. + string snapshot = 5; + } + + // Disk type as shown in `gcloud compute disk-types list`. + // For example, local SSD uses type "local-ssd". + // Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd" + // or "pd-standard". If not specified, "pd-standard" will be used as the + // default type for non-boot disks, "pd-balanced" will be used as the + // default type for boot disks. + string type = 1; + + // Disk size in GB. + // + // **Non-Boot Disk**: + // If the `type` specifies a persistent disk, this field + // is ignored if `data_source` is set as `image` or `snapshot`. + // If the `type` specifies a local SSD, this field should be a multiple of + // 375 GB, otherwise, the final size will be the next greater multiple of + // 375 GB. + // + // **Boot Disk**: + // Batch will calculate the boot disk size based on source + // image and task requirements if you do not speicify the size. + // If both this field and the `boot_disk_mib` field in task spec's + // `compute_resource` are defined, Batch will only honor this field. + // Also, this field should be no smaller than the source disk's + // size when the `data_source` is set as `snapshot` or `image`. + // For example, if you set an image as the `data_source` field and the + // image's default disk size 30 GB, you can only use this field to make the + // disk larger or equal to 30 GB. + int64 size_gb = 2; + + // Local SSDs are available through both "SCSI" and "NVMe" interfaces. + // If not indicated, "NVMe" will be the default one for local ssds. + // This field is ignored for persistent disks as the interface is chosen + // automatically. See + // https://cloud.google.com/compute/docs/disks/persistent-disks#choose_an_interface. + string disk_interface = 6; + } + + // A new or an existing persistent disk (PD) or a local ssd attached to a VM + // instance. + message AttachedDisk { + oneof attached { + Disk new_disk = 1; + + // Name of an existing PD. + string existing_disk = 2; + } + + // Device name that the guest operating system will see. + // It is used by Runnable.volumes field to mount disks. So please specify + // the device_name if you want Batch to help mount the disk, and it should + // match the device_name field in volumes. + string device_name = 3; + } + + // Accelerator describes Compute Engine accelerators to be attached to the VM. + message Accelerator { + // The accelerator type. For example, "nvidia-tesla-t4". + // See `gcloud compute accelerator-types list`. + string type = 1; + + // The number of accelerators of this type. + int64 count = 2; + + // Deprecated: please use instances[0].install_gpu_drivers instead. + bool install_gpu_drivers = 3 [deprecated = true]; + + // Optional. The NVIDIA GPU driver version that should be installed for this + // type. + // + // You can define the specific driver version such as "470.103.01", + // following the driver version requirements in + // https://cloud.google.com/compute/docs/gpus/install-drivers-gpu#minimum-driver. + // Batch will install the specific accelerator driver if qualified. + string driver_version = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // InstancePolicy describes an instance type and resources attached to each VM + // created by this InstancePolicy. + message InstancePolicy { + // The Compute Engine machine type. + string machine_type = 2; + + // The minimum CPU platform. + // See + // https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. + string min_cpu_platform = 3; + + // The provisioning model. + ProvisioningModel provisioning_model = 4; + + // The accelerators attached to each VM instance. + repeated Accelerator accelerators = 5; + + // Boot disk to be created and attached to each VM by this InstancePolicy. + // Boot disk will be deleted when the VM is deleted. + // Batch API now only supports booting from image. + Disk boot_disk = 8; + + // Non-boot disks to be attached for each VM created by this InstancePolicy. + // New disks will be deleted when the VM is deleted. + // A non-boot disk is a disk that can be of a device with a + // file system or a raw storage drive that is not ready for data + // storage and accessing. + repeated AttachedDisk disks = 6; + + // Optional. If not specified (default), VMs will consume any applicable + // reservation. If "NO_RESERVATION" is specified, VMs will not consume any + // reservation. Otherwise, if specified, VMs will consume only the specified + // reservation. + string reservation = 7 [(google.api.field_behavior) = OPTIONAL]; + } + + // InstancePolicyOrTemplate lets you define the type of resources to use for + // this job either with an InstancePolicy or an instance template. + // If undefined, Batch picks the type of VM to use and doesn't include + // optional VM resources such as GPUs and extra disks. + message InstancePolicyOrTemplate { + oneof policy_template { + // InstancePolicy. + InstancePolicy policy = 1; + + // Name of an instance template used to create VMs. + // Named the field as 'instance_template' instead of 'template' to avoid + // C++ keyword conflict. + // + // Batch only supports global instance templates from the same project as + // the job. + // You can specify the global instance template as a full or partial URL. + string instance_template = 2; + } + + // Set this field true if you want Batch to help fetch drivers from a third + // party location and install them for GPUs specified in + // `policy.accelerators` or `instance_template` on your behalf. Default is + // false. + // + // For Container-Optimized Image cases, Batch will install the + // accelerator driver following milestones of + // https://cloud.google.com/container-optimized-os/docs/release-notes. For + // non Container-Optimized Image cases, following + // https://github.com/GoogleCloudPlatform/compute-gpu-installation/blob/main/linux/install_gpu_driver.py. + bool install_gpu_drivers = 3; + + // Optional. Set this field true if you want Batch to install Ops Agent on + // your behalf. Default is false. + bool install_ops_agent = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Set this field to `true` if you want Batch to block + // project-level SSH keys from accessing this job's VMs. Alternatively, you + // can configure the job to specify a VM instance template that blocks + // project-level SSH keys. In either case, Batch blocks project-level SSH + // keys while creating the VMs for this job. + // + // Batch allows project-level SSH keys for a job's VMs only if all + // the following are true: + // + // + This field is undefined or set to `false`. + // + The job's VM instance template (if any) doesn't block project-level + // SSH keys. + // + // Notably, you can override this behavior by manually updating a VM to + // block or allow project-level SSH keys. For more information about + // blocking project-level SSH keys, see the Compute Engine documentation: + // https://cloud.google.com/compute/docs/connect/restrict-ssh-keys#block-keys + bool block_project_ssh_keys = 5 [(google.api.field_behavior) = OPTIONAL]; + } + + // A network interface. + message NetworkInterface { + // The URL of an existing network resource. + // You can specify the network as a full or partial URL. + // + // For example, the following are all valid URLs: + // + // * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network} + // * projects/{project}/global/networks/{network} + // * global/networks/{network} + string network = 1; + + // The URL of an existing subnetwork resource in the network. + // You can specify the subnetwork as a full or partial URL. + // + // For example, the following are all valid URLs: + // + // * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork} + // * projects/{project}/regions/{region}/subnetworks/{subnetwork} + // * regions/{region}/subnetworks/{subnetwork} + string subnetwork = 2; + + // Default is false (with an external IP address). Required if + // no external public IP address is attached to the VM. If no external + // public IP address, additional configuration is required to allow the VM + // to access Google Services. See + // https://cloud.google.com/vpc/docs/configure-private-google-access and + // https://cloud.google.com/nat/docs/gce-example#create-nat for more + // information. + bool no_external_ip_address = 3; + } + + // NetworkPolicy describes VM instance network configurations. + message NetworkPolicy { + // Network configurations. + repeated NetworkInterface network_interfaces = 1; + } + + // PlacementPolicy describes a group placement policy for the VMs controlled + // by this AllocationPolicy. + message PlacementPolicy { + // UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you + // want VMs to be located close to each other for low network latency + // between the VMs. No placement policy will be generated when collocation + // is UNSPECIFIED. + string collocation = 1; + + // When specified, causes the job to fail if more than max_distance logical + // switches are required between VMs. Batch uses the most compact possible + // placement of VMs even when max_distance is not specified. An explicit + // max_distance makes that level of compactness a strict requirement. + // Not yet implemented + int64 max_distance = 2; + } + + // Compute Engine VM instance provisioning model. + enum ProvisioningModel { + // Unspecified. + PROVISIONING_MODEL_UNSPECIFIED = 0; + + // Standard VM. + STANDARD = 1; + + // SPOT VM. + SPOT = 2; + + // Preemptible VM (PVM). + // + // Above SPOT VM is the preferable model for preemptible VM instances: the + // old preemptible VM model (indicated by this field) is the older model, + // and has been migrated to use the SPOT model as the underlying technology. + // This old model will still be supported. + PREEMPTIBLE = 3; + } + + // Location where compute resources should be allocated for the Job. + LocationPolicy location = 1; + + // Describe instances that can be created by this AllocationPolicy. + // Only instances[0] is supported now. + repeated InstancePolicyOrTemplate instances = 8; + + // Defines the service account for Batch-created VMs. If omitted, the [default + // Compute Engine service + // account](https://cloud.google.com/compute/docs/access/service-accounts#default_service_account) + // is used. Must match the service account specified in any used instance + // template configured in the Batch job. + // + // Includes the following fields: + // * email: The service account's email address. If not set, the default + // Compute Engine service account is used. + // * scopes: Additional OAuth scopes to grant the service account, beyond the + // default cloud-platform scope. (list of strings) + ServiceAccount service_account = 9; + + // Custom labels to apply to the job and all the Compute Engine resources + // that both are created by this allocation policy and support labels. + // + // Use labels to group and describe the resources they are applied to. Batch + // automatically applies predefined labels and supports multiple `labels` + // fields for each job, which each let you apply custom labels to various + // resources. Label names that start with "goog-" or "google-" are + // reserved for predefined labels. For more information about labels with + // Batch, see + // [Organize resources using + // labels](https://cloud.google.com/batch/docs/organize-resources-using-labels). + map labels = 6; + + // The network policy. + // + // If you define an instance template in the `InstancePolicyOrTemplate` field, + // Batch will use the network settings in the instance template instead of + // this field. + NetworkPolicy network = 7; + + // The placement policy. + PlacementPolicy placement = 10; + + // Optional. Tags applied to the VM instances. + // + // The tags identify valid sources or targets for network firewalls. + // Each tag must be 1-63 characters long, and comply with + // [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). + repeated string tags = 11 [(google.api.field_behavior) = OPTIONAL]; +} + +// A TaskGroup defines one or more Tasks that all share the same TaskSpec. +message TaskGroup { + option (google.api.resource) = { + type: "batch.googleapis.com/TaskGroup" + pattern: "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + }; + + // How Tasks in the TaskGroup should be scheduled relative to each other. + enum SchedulingPolicy { + // Unspecified. + SCHEDULING_POLICY_UNSPECIFIED = 0; + + // Run Tasks as soon as resources are available. + // + // Tasks might be executed in parallel depending on parallelism and + // task_count values. + AS_SOON_AS_POSSIBLE = 1; + + // Run Tasks sequentially with increased task index. + IN_ORDER = 2; + } + + // Output only. TaskGroup name. + // The system generates this field based on parent Job name. + // For example: + // "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01". + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Tasks in the group share the same task spec. + TaskSpec task_spec = 3 [(google.api.field_behavior) = REQUIRED]; + + // Number of Tasks in the TaskGroup. + // Default is 1. + int64 task_count = 4; + + // Max number of tasks that can run in parallel. + // Default to min(task_count, parallel tasks per job limit). + // See: [Job Limits](https://cloud.google.com/batch/quotas#job_limits). + // Field parallelism must be 1 if the scheduling_policy is IN_ORDER. + int64 parallelism = 5; + + // Scheduling policy for Tasks in the TaskGroup. + // The default value is AS_SOON_AS_POSSIBLE. + SchedulingPolicy scheduling_policy = 6; + + // An array of environment variable mappings, which are passed to Tasks with + // matching indices. If task_environments is used then task_count should + // not be specified in the request (and will be ignored). Task count will be + // the length of task_environments. + // + // Tasks get a BATCH_TASK_INDEX and BATCH_TASK_COUNT environment variable, in + // addition to any environment variables set in task_environments, specifying + // the number of Tasks in the Task's parent TaskGroup, and the specific Task's + // index in the TaskGroup (0 through BATCH_TASK_COUNT - 1). + repeated Environment task_environments = 9; + + // Max number of tasks that can be run on a VM at the same time. + // If not specified, the system will decide a value based on available + // compute resources on a VM and task requirements. + int64 task_count_per_node = 10; + + // When true, Batch will populate a file with a list of all VMs assigned to + // the TaskGroup and set the BATCH_HOSTS_FILE environment variable to the path + // of that file. Defaults to false. The host file supports up to 1000 VMs. + bool require_hosts_file = 11; + + // When true, Batch will configure SSH to allow passwordless login between + // VMs running the Batch tasks in the same TaskGroup. + bool permissive_ssh = 12; + + // Optional. If not set or set to false, Batch uses the root user to execute + // runnables. If set to true, Batch runs the runnables using a non-root user. + // Currently, the non-root user Batch used is generated by OS Login. For more + // information, see [About OS + // Login](https://cloud.google.com/compute/docs/oslogin). + bool run_as_non_root = 14 [(google.api.field_behavior) = OPTIONAL]; +} + +// Carries information about a Google Cloud service account. +message ServiceAccount { + // Email address of the service account. + string email = 1; + + // List of scopes to be enabled for this service account. + repeated string scopes = 2; +} diff --git a/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/task.proto b/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/task.proto new file mode 100644 index 00000000000..f9edabb2b6a --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/task.proto @@ -0,0 +1,475 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.batch.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/batch/v1/volume.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Batch.V1"; +option go_package = "cloud.google.com/go/batch/apiv1/batchpb;batchpb"; +option java_multiple_files = true; +option java_outer_classname = "TaskProto"; +option java_package = "com.google.cloud.batch.v1"; +option objc_class_prefix = "GCB"; +option php_namespace = "Google\\Cloud\\Batch\\V1"; +option ruby_package = "Google::Cloud::Batch::V1"; + +// Compute resource requirements. +// +// ComputeResource defines the amount of resources required for each task. +// Make sure your tasks have enough resources to successfully run. +// If you also define the types of resources for a job to use with the +// [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) +// field, make sure both fields are compatible with each other. +message ComputeResource { + // The milliCPU count. + // + // `cpuMilli` defines the amount of CPU resources per task in milliCPU units. + // For example, `1000` corresponds to 1 vCPU per task. If undefined, the + // default value is `2000`. + // + // If you also define the VM's machine type using the `machineType` in + // [InstancePolicy](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicy) + // field or inside the `instanceTemplate` in the + // [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) + // field, make sure the CPU resources for both fields are compatible with each + // other and with how many tasks you want to allow to run on the same VM at + // the same time. + // + // For example, if you specify the `n2-standard-2` machine type, which has 2 + // vCPUs each, you are recommended to set `cpuMilli` no more than `2000`, or + // you are recommended to run two tasks on the same VM if you set `cpuMilli` + // to `1000` or less. + int64 cpu_milli = 1; + + // Memory in MiB. + // + // `memoryMib` defines the amount of memory per task in MiB units. + // If undefined, the default value is `2000`. + // If you also define the VM's machine type using the `machineType` in + // [InstancePolicy](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicy) + // field or inside the `instanceTemplate` in the + // [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) + // field, make sure the memory resources for both fields are compatible with + // each other and with how many tasks you want to allow to run on the same VM + // at the same time. + // + // For example, if you specify the `n2-standard-2` machine type, which has 8 + // GiB each, you are recommended to set `memoryMib` to no more than `8192`, + // or you are recommended to run two tasks on the same VM if you set + // `memoryMib` to `4096` or less. + int64 memory_mib = 2; + + // Extra boot disk size in MiB for each task. + int64 boot_disk_mib = 4; +} + +// Status event. +message StatusEvent { + // Type of the event. + string type = 3; + + // Description of the event. + string description = 1; + + // The time this event occurred. + google.protobuf.Timestamp event_time = 2; + + // Task Execution. + // This field is only defined for task-level status events where the task + // fails. + TaskExecution task_execution = 4; + + // Task State. + // This field is only defined for task-level status events. + TaskStatus.State task_state = 5; +} + +// This Task Execution field includes detail information for +// task execution procedures, based on StatusEvent types. +message TaskExecution { + // The exit code of a finished task. + // + // If the task succeeded, the exit code will be 0. If the task failed but not + // due to the following reasons, the exit code will be 50000. + // + // Otherwise, it can be from different sources: + // * Batch known failures: + // https://cloud.google.com/batch/docs/troubleshooting#reserved-exit-codes. + // * Batch runnable execution failures; you can rely on Batch logs to further + // diagnose: https://cloud.google.com/batch/docs/analyze-job-using-logs. If + // there are multiple runnables failures, Batch only exposes the first error. + int32 exit_code = 1; +} + +// Status of a task. +message TaskStatus { + // Task states. + enum State { + // Unknown state. + STATE_UNSPECIFIED = 0; + + // The Task is created and waiting for resources. + PENDING = 1; + + // The Task is assigned to at least one VM. + ASSIGNED = 2; + + // The Task is running. + RUNNING = 3; + + // The Task has failed. + FAILED = 4; + + // The Task has succeeded. + SUCCEEDED = 5; + + // The Task has not been executed when the Job finishes. + UNEXECUTED = 6; + } + + // Task state. + State state = 1; + + // Detailed info about why the state is reached. + repeated StatusEvent status_events = 2; +} + +// Runnable describes instructions for executing a specific script or container +// as part of a Task. +message Runnable { + // Container runnable. + message Container { + // Required. The URI to pull the container image from. + string image_uri = 1; + + // Required for some container images. Overrides the `CMD` specified in the + // container. If there is an `ENTRYPOINT` (either in the container image or + // with the `entrypoint` field below) then these commands are appended as + // arguments to the `ENTRYPOINT`. + repeated string commands = 2; + + // Required for some container images. Overrides the `ENTRYPOINT` specified + // in the container. + string entrypoint = 3; + + // Volumes to mount (bind mount) from the host machine files or directories + // into the container, formatted to match `--volume` option for the + // `docker run` command—for example, `/foo:/bar` or `/foo:/bar:ro`. + // + // If the `TaskSpec.Volumes` field is specified but this field is not, Batch + // will mount each volume from the host machine to the container with the + // same mount path by default. In this case, the default mount option for + // containers will be read-only (`ro`) for existing persistent disks and + // read-write (`rw`) for other volume types, regardless of the original + // mount options specified in `TaskSpec.Volumes`. If you need different + // mount settings, you can explicitly configure them in this field. + repeated string volumes = 7; + + // Required for some container images. Arbitrary additional options to + // include in the `docker run` command when running this container—for + // example, `--network host`. For the `--volume` option, use the `volumes` + // field for the container. + string options = 8; + + // If set to true, external network access to and from container will be + // blocked, containers that are with block_external_network as true can + // still communicate with each other, network cannot be specified in the + // `container.options` field. + bool block_external_network = 9; + + // Required if the container image is from a private Docker registry. The + // username to login to the Docker registry that contains the image. + // + // You can either specify the username directly by using plain text or + // specify an encrypted username by using a Secret Manager secret: + // `projects/*/secrets/*/versions/*`. However, using a secret is + // recommended for enhanced security. + // + // Caution: If you specify the username using plain text, you risk the + // username being exposed to any users who can view the job or its logs. + // To avoid this risk, specify a secret that contains the username instead. + // + // Learn more about [Secret + // Manager](https://cloud.google.com/secret-manager/docs/) and [using + // Secret Manager with + // Batch](https://cloud.google.com/batch/docs/create-run-job-secret-manager). + string username = 10; + + // Required if the container image is from a private Docker registry. The + // password to login to the Docker registry that contains the image. + // + // For security, it is strongly recommended to specify an + // encrypted password by using a Secret Manager secret: + // `projects/*/secrets/*/versions/*`. + // + // Warning: If you specify the password using plain text, you risk the + // password being exposed to any users who can view the job or its logs. + // To avoid this risk, specify a secret that contains the password instead. + // + // Learn more about [Secret + // Manager](https://cloud.google.com/secret-manager/docs/) and [using + // Secret Manager with + // Batch](https://cloud.google.com/batch/docs/create-run-job-secret-manager). + string password = 11; + + // Optional. If set to true, this container runnable uses Image streaming. + // + // Use Image streaming to allow the runnable to initialize without + // waiting for the entire container image to download, which can + // significantly reduce startup time for large container images. + // + // When `enableImageStreaming` is set to true, the container + // runtime is [containerd](https://containerd.io/) instead of Docker. + // Additionally, this container runnable only supports the following + // `container` subfields: `imageUri`, + // `commands[]`, `entrypoint`, and + // `volumes[]`; any other `container` subfields are ignored. + // + // For more information about the requirements and limitations for using + // Image streaming with Batch, see the [`image-streaming` + // sample on + // GitHub](https://github.com/GoogleCloudPlatform/batch-samples/tree/main/api-samples/image-streaming). + bool enable_image_streaming = 12 [(google.api.field_behavior) = OPTIONAL]; + } + + // Script runnable. + message Script { + // Required. The source code for this script runnable. + oneof command { + // The path to a script file that is accessible from the host VM(s). + // + // Unless the script file supports the default `#!/bin/sh` shell + // interpreter, you must specify an interpreter by including a + // [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix) as the + // first line of the file. For example, to execute the script using bash, + // include `#!/bin/bash` as the first line of the file. Alternatively, + // to execute the script using Python3, include `#!/usr/bin/env python3` + // as the first line of the file. + string path = 1; + + // The text for a script. + // + // Unless the script text supports the default `#!/bin/sh` shell + // interpreter, you must specify an interpreter by including a + // [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix) at the + // beginning of the text. For example, to execute the script using bash, + // include `#!/bin/bash\n` at the beginning of the text. Alternatively, + // to execute the script using Python3, include `#!/usr/bin/env python3\n` + // at the beginning of the text. + string text = 2; + } + } + + // A barrier runnable automatically blocks the execution of subsequent + // runnables until all the tasks in the task group reach the barrier. + message Barrier { + // Barriers are identified by their index in runnable list. + // Names are not required, but if present should be an identifier. + string name = 1; + } + + // Required. The script, container, or barrier for this runnable to execute. + oneof executable { + // Container runnable. + Container container = 1; + + // Script runnable. + Script script = 2; + + // Barrier runnable. + Barrier barrier = 6; + } + + // Optional. DisplayName is an optional field that can be provided by the + // caller. If provided, it will be used in logs and other outputs to identify + // the script, making it easier for users to understand the logs. If not + // provided the index of the runnable will be used for outputs. + string display_name = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Normally, a runnable that returns a non-zero exit status fails and causes + // the task to fail. However, you can set this field to `true` to allow the + // task to continue executing its other runnables even if this runnable + // fails. + bool ignore_exit_status = 3; + + // Normally, a runnable that doesn't exit causes its task to fail. However, + // you can set this field to `true` to configure a background runnable. + // Background runnables are allowed continue running in the background while + // the task executes subsequent runnables. For example, background runnables + // are useful for providing services to other runnables or providing + // debugging-support tools like SSH servers. + // + // Specifically, background runnables are killed automatically (if they have + // not already exited) a short time after all foreground runnables have + // completed. Even though this is likely to result in a non-zero exit status + // for the background runnable, these automatic kills are not treated as task + // failures. + bool background = 4; + + // By default, after a Runnable fails, no further Runnable are executed. This + // flag indicates that this Runnable must be run even if the Task has already + // failed. This is useful for Runnables that copy output files off of the VM + // or for debugging. + // + // The always_run flag does not override the Task's overall max_run_duration. + // If the max_run_duration has expired then no further Runnables will execute, + // not even always_run Runnables. + bool always_run = 5; + + // Environment variables for this Runnable (overrides variables set for the + // whole Task or TaskGroup). + Environment environment = 7; + + // Timeout for this Runnable. + google.protobuf.Duration timeout = 8; + + // Labels for this Runnable. + map labels = 9; +} + +// Spec of a task +message TaskSpec { + // Required. The sequence of one or more runnables (executable scripts, + // executable containers, and/or barriers) for each task in this task group to + // run. Each task runs this list of runnables in order. For a task to succeed, + // all of its script and container runnables each must meet at least one of + // the following conditions: + // + // + The runnable exited with a zero status. + // + The runnable didn't finish, but you enabled its `background` subfield. + // + The runnable exited with a non-zero status, but you enabled its + // `ignore_exit_status` subfield. + repeated Runnable runnables = 8; + + // ComputeResource requirements. + ComputeResource compute_resource = 3; + + // Maximum duration the task should run before being automatically retried + // (if enabled) or automatically failed. Format the value of this field + // as a time limit in seconds followed by `s`—for example, `3600s` + // for 1 hour. The field accepts any value between 0 and the maximum listed + // for the `Duration` field type at + // https://protobuf.dev/reference/protobuf/google.protobuf/#duration; however, + // the actual maximum run time for a job will be limited to the maximum run + // time for a job listed at + // https://cloud.google.com/batch/quotas#max-job-duration. + google.protobuf.Duration max_run_duration = 4; + + // Maximum number of retries on failures. + // The default, 0, which means never retry. + // The valid value range is [0, 10]. + int32 max_retry_count = 5; + + // Lifecycle management schema when any task in a task group is failed. + // Currently we only support one lifecycle policy. + // When the lifecycle policy condition is met, + // the action in the policy will execute. + // If task execution result does not meet with the defined lifecycle + // policy, we consider it as the default policy. + // Default policy means if the exit code is 0, exit task. + // If task ends with non-zero exit code, retry the task with max_retry_count. + repeated LifecyclePolicy lifecycle_policies = 9; + + // Deprecated: please use environment(non-plural) instead. + map environments = 6 [deprecated = true]; + + // Volumes to mount before running Tasks using this TaskSpec. + repeated Volume volumes = 7; + + // Environment variables to set before running the Task. + Environment environment = 10; +} + +// LifecyclePolicy describes how to deal with task failures +// based on different conditions. +message LifecyclePolicy { + // Conditions for actions to deal with task failures. + message ActionCondition { + // Exit codes of a task execution. + // If there are more than 1 exit codes, + // when task executes with any of the exit code in the list, + // the condition is met and the action will be executed. + repeated int32 exit_codes = 1; + } + + // Action on task failures based on different conditions. + enum Action { + // Action unspecified. + ACTION_UNSPECIFIED = 0; + + // Action that tasks in the group will be scheduled to re-execute. + RETRY_TASK = 1; + + // Action that tasks in the group will be stopped immediately. + FAIL_TASK = 2; + } + + // Action to execute when ActionCondition is true. + // When RETRY_TASK is specified, we will retry failed tasks + // if we notice any exit code match and fail tasks if no match is found. + // Likewise, when FAIL_TASK is specified, we will fail tasks + // if we notice any exit code match and retry tasks if no match is found. + Action action = 1; + + // Conditions that decide why a task failure is dealt with a specific action. + ActionCondition action_condition = 2; +} + +// A Cloud Batch task. +message Task { + option (google.api.resource) = { + type: "batch.googleapis.com/Task" + pattern: "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}/tasks/{task}" + }; + + // Task name. + // The name is generated from the parent TaskGroup name and 'id' field. + // For example: + // "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01/tasks/task01". + string name = 1; + + // Task Status. + TaskStatus status = 2; +} + +// An Environment describes a collection of environment variables to set when +// executing Tasks. +message Environment { + message KMSEnvMap { + // The name of the KMS key that will be used to decrypt the cipher text. + string key_name = 1; + + // The value of the cipherText response from the `encrypt` method. + string cipher_text = 2; + } + + // A map of environment variable names to values. + map variables = 1; + + // A map of environment variable names to Secret Manager secret names. + // The VM will access the named secrets to set the value of each environment + // variable. + map secret_variables = 2; + + // An encrypted JSON dictionary where the key/value pairs correspond to + // environment variable names and their values. + KMSEnvMap encrypted_variables = 3; +} diff --git a/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/volume.proto b/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/volume.proto new file mode 100644 index 00000000000..9bf8126f634 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/volume.proto @@ -0,0 +1,80 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.batch.v1; + +option csharp_namespace = "Google.Cloud.Batch.V1"; +option go_package = "cloud.google.com/go/batch/apiv1/batchpb;batchpb"; +option java_multiple_files = true; +option java_outer_classname = "VolumeProto"; +option java_package = "com.google.cloud.batch.v1"; +option objc_class_prefix = "GCB"; +option php_namespace = "Google\\Cloud\\Batch\\V1"; +option ruby_package = "Google::Cloud::Batch::V1"; + +// Volume describes a volume and parameters for it to be mounted to a VM. +message Volume { + // The source for the volume. + oneof source { + // A Network File System (NFS) volume. For example, a + // Filestore file share. + NFS nfs = 1; + + // A Google Cloud Storage (GCS) volume. + GCS gcs = 3; + + // Device name of an attached disk volume, which should align with a + // device_name specified by + // job.allocation_policy.instances[0].policy.disks[i].device_name or + // defined by the given instance template in + // job.allocation_policy.instances[0].instance_template. + string device_name = 6; + } + + // The mount path for the volume, e.g. /mnt/disks/share. + string mount_path = 4; + + // Mount options vary based on the type of storage volume: + // + // * For a Cloud Storage bucket, all the mount options provided + // by + // the [`gcsfuse` tool](https://cloud.google.com/storage/docs/gcsfuse-cli) + // are supported. + // * For an existing persistent disk, all mount options provided by the + // [`mount` command](https://man7.org/linux/man-pages/man8/mount.8.html) + // except writing are supported. This is due to restrictions of + // [multi-writer + // mode](https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms). + // * For any other disk or a Network File System (NFS), all the + // mount options provided by the `mount` command are supported. + repeated string mount_options = 5; +} + +// Represents an NFS volume. +message NFS { + // The IP address of the NFS. + string server = 1; + + // Remote source path exported from the NFS, e.g., "/share". + string remote_path = 2; +} + +// Represents a Google Cloud Storage volume. +message GCS { + // Remote path, either a bucket name or a subdirectory of a bucket, e.g.: + // bucket_name, bucket_name/subdirectory/ + string remote_path = 1; +} diff --git a/owl-bot-staging/google-cloud-batch/v1/protos/protos.d.ts b/owl-bot-staging/google-cloud-batch/v1/protos/protos.d.ts new file mode 100644 index 00000000000..4d35440216c --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/protos/protos.d.ts @@ -0,0 +1,13321 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace batch. */ + namespace batch { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a BatchService */ + class BatchService extends $protobuf.rpc.Service { + + /** + * Constructs a new BatchService 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 BatchService 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): BatchService; + + /** + * Calls CreateJob. + * @param request CreateJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Job + */ + public createJob(request: google.cloud.batch.v1.ICreateJobRequest, callback: google.cloud.batch.v1.BatchService.CreateJobCallback): void; + + /** + * Calls CreateJob. + * @param request CreateJobRequest message or plain object + * @returns Promise + */ + public createJob(request: google.cloud.batch.v1.ICreateJobRequest): Promise; + + /** + * Calls GetJob. + * @param request GetJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Job + */ + public getJob(request: google.cloud.batch.v1.IGetJobRequest, callback: google.cloud.batch.v1.BatchService.GetJobCallback): void; + + /** + * Calls GetJob. + * @param request GetJobRequest message or plain object + * @returns Promise + */ + public getJob(request: google.cloud.batch.v1.IGetJobRequest): Promise; + + /** + * Calls DeleteJob. + * @param request DeleteJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteJob(request: google.cloud.batch.v1.IDeleteJobRequest, callback: google.cloud.batch.v1.BatchService.DeleteJobCallback): void; + + /** + * Calls DeleteJob. + * @param request DeleteJobRequest message or plain object + * @returns Promise + */ + public deleteJob(request: google.cloud.batch.v1.IDeleteJobRequest): Promise; + + /** + * Calls ListJobs. + * @param request ListJobsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListJobsResponse + */ + public listJobs(request: google.cloud.batch.v1.IListJobsRequest, callback: google.cloud.batch.v1.BatchService.ListJobsCallback): void; + + /** + * Calls ListJobs. + * @param request ListJobsRequest message or plain object + * @returns Promise + */ + public listJobs(request: google.cloud.batch.v1.IListJobsRequest): Promise; + + /** + * Calls GetTask. + * @param request GetTaskRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Task + */ + public getTask(request: google.cloud.batch.v1.IGetTaskRequest, callback: google.cloud.batch.v1.BatchService.GetTaskCallback): void; + + /** + * Calls GetTask. + * @param request GetTaskRequest message or plain object + * @returns Promise + */ + public getTask(request: google.cloud.batch.v1.IGetTaskRequest): Promise; + + /** + * Calls ListTasks. + * @param request ListTasksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTasksResponse + */ + public listTasks(request: google.cloud.batch.v1.IListTasksRequest, callback: google.cloud.batch.v1.BatchService.ListTasksCallback): void; + + /** + * Calls ListTasks. + * @param request ListTasksRequest message or plain object + * @returns Promise + */ + public listTasks(request: google.cloud.batch.v1.IListTasksRequest): Promise; + } + + namespace BatchService { + + /** + * Callback as used by {@link google.cloud.batch.v1.BatchService|createJob}. + * @param error Error, if any + * @param [response] Job + */ + type CreateJobCallback = (error: (Error|null), response?: google.cloud.batch.v1.Job) => void; + + /** + * Callback as used by {@link google.cloud.batch.v1.BatchService|getJob}. + * @param error Error, if any + * @param [response] Job + */ + type GetJobCallback = (error: (Error|null), response?: google.cloud.batch.v1.Job) => void; + + /** + * Callback as used by {@link google.cloud.batch.v1.BatchService|deleteJob}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.batch.v1.BatchService|listJobs}. + * @param error Error, if any + * @param [response] ListJobsResponse + */ + type ListJobsCallback = (error: (Error|null), response?: google.cloud.batch.v1.ListJobsResponse) => void; + + /** + * Callback as used by {@link google.cloud.batch.v1.BatchService|getTask}. + * @param error Error, if any + * @param [response] Task + */ + type GetTaskCallback = (error: (Error|null), response?: google.cloud.batch.v1.Task) => void; + + /** + * Callback as used by {@link google.cloud.batch.v1.BatchService|listTasks}. + * @param error Error, if any + * @param [response] ListTasksResponse + */ + type ListTasksCallback = (error: (Error|null), response?: google.cloud.batch.v1.ListTasksResponse) => void; + } + + /** Properties of a CreateJobRequest. */ + interface ICreateJobRequest { + + /** CreateJobRequest parent */ + parent?: (string|null); + + /** CreateJobRequest jobId */ + jobId?: (string|null); + + /** CreateJobRequest job */ + job?: (google.cloud.batch.v1.IJob|null); + + /** CreateJobRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateJobRequest. */ + class CreateJobRequest implements ICreateJobRequest { + + /** + * Constructs a new CreateJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.ICreateJobRequest); + + /** CreateJobRequest parent. */ + public parent: string; + + /** CreateJobRequest jobId. */ + public jobId: string; + + /** CreateJobRequest job. */ + public job?: (google.cloud.batch.v1.IJob|null); + + /** CreateJobRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateJobRequest instance + */ + public static create(properties?: google.cloud.batch.v1.ICreateJobRequest): google.cloud.batch.v1.CreateJobRequest; + + /** + * Encodes the specified CreateJobRequest message. Does not implicitly {@link google.cloud.batch.v1.CreateJobRequest.verify|verify} messages. + * @param message CreateJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.ICreateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.CreateJobRequest.verify|verify} messages. + * @param message CreateJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.ICreateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.CreateJobRequest; + + /** + * Decodes a CreateJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.CreateJobRequest; + + /** + * Verifies a CreateJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.CreateJobRequest; + + /** + * Creates a plain object from a CreateJobRequest message. Also converts values to other types if specified. + * @param message CreateJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.CreateJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetJobRequest. */ + interface IGetJobRequest { + + /** GetJobRequest name */ + name?: (string|null); + } + + /** Represents a GetJobRequest. */ + class GetJobRequest implements IGetJobRequest { + + /** + * Constructs a new GetJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IGetJobRequest); + + /** GetJobRequest name. */ + public name: string; + + /** + * Creates a new GetJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetJobRequest instance + */ + public static create(properties?: google.cloud.batch.v1.IGetJobRequest): google.cloud.batch.v1.GetJobRequest; + + /** + * Encodes the specified GetJobRequest message. Does not implicitly {@link google.cloud.batch.v1.GetJobRequest.verify|verify} messages. + * @param message GetJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IGetJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.GetJobRequest.verify|verify} messages. + * @param message GetJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IGetJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.GetJobRequest; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.GetJobRequest; + + /** + * Verifies a GetJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.GetJobRequest; + + /** + * Creates a plain object from a GetJobRequest message. Also converts values to other types if specified. + * @param message GetJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.GetJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteJobRequest. */ + interface IDeleteJobRequest { + + /** DeleteJobRequest name */ + name?: (string|null); + + /** DeleteJobRequest reason */ + reason?: (string|null); + + /** DeleteJobRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteJobRequest. */ + class DeleteJobRequest implements IDeleteJobRequest { + + /** + * Constructs a new DeleteJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IDeleteJobRequest); + + /** DeleteJobRequest name. */ + public name: string; + + /** DeleteJobRequest reason. */ + public reason: string; + + /** DeleteJobRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteJobRequest instance + */ + public static create(properties?: google.cloud.batch.v1.IDeleteJobRequest): google.cloud.batch.v1.DeleteJobRequest; + + /** + * Encodes the specified DeleteJobRequest message. Does not implicitly {@link google.cloud.batch.v1.DeleteJobRequest.verify|verify} messages. + * @param message DeleteJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IDeleteJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.DeleteJobRequest.verify|verify} messages. + * @param message DeleteJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IDeleteJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.DeleteJobRequest; + + /** + * Decodes a DeleteJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.DeleteJobRequest; + + /** + * Verifies a DeleteJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.DeleteJobRequest; + + /** + * Creates a plain object from a DeleteJobRequest message. Also converts values to other types if specified. + * @param message DeleteJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.DeleteJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListJobsRequest. */ + interface IListJobsRequest { + + /** ListJobsRequest parent */ + parent?: (string|null); + + /** ListJobsRequest filter */ + filter?: (string|null); + + /** ListJobsRequest orderBy */ + orderBy?: (string|null); + + /** ListJobsRequest pageSize */ + pageSize?: (number|null); + + /** ListJobsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListJobsRequest. */ + class ListJobsRequest implements IListJobsRequest { + + /** + * Constructs a new ListJobsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IListJobsRequest); + + /** ListJobsRequest parent. */ + public parent: string; + + /** ListJobsRequest filter. */ + public filter: string; + + /** ListJobsRequest orderBy. */ + public orderBy: string; + + /** ListJobsRequest pageSize. */ + public pageSize: number; + + /** ListJobsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListJobsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListJobsRequest instance + */ + public static create(properties?: google.cloud.batch.v1.IListJobsRequest): google.cloud.batch.v1.ListJobsRequest; + + /** + * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.cloud.batch.v1.ListJobsRequest.verify|verify} messages. + * @param message ListJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IListJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListJobsRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ListJobsRequest.verify|verify} messages. + * @param message ListJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IListJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.ListJobsRequest; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.ListJobsRequest; + + /** + * Verifies a ListJobsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListJobsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListJobsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.ListJobsRequest; + + /** + * Creates a plain object from a ListJobsRequest message. Also converts values to other types if specified. + * @param message ListJobsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.ListJobsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListJobsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListJobsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListJobsResponse. */ + interface IListJobsResponse { + + /** ListJobsResponse jobs */ + jobs?: (google.cloud.batch.v1.IJob[]|null); + + /** ListJobsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListJobsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListJobsResponse. */ + class ListJobsResponse implements IListJobsResponse { + + /** + * Constructs a new ListJobsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IListJobsResponse); + + /** ListJobsResponse jobs. */ + public jobs: google.cloud.batch.v1.IJob[]; + + /** ListJobsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListJobsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListJobsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListJobsResponse instance + */ + public static create(properties?: google.cloud.batch.v1.IListJobsResponse): google.cloud.batch.v1.ListJobsResponse; + + /** + * Encodes the specified ListJobsResponse message. Does not implicitly {@link google.cloud.batch.v1.ListJobsResponse.verify|verify} messages. + * @param message ListJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IListJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListJobsResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ListJobsResponse.verify|verify} messages. + * @param message ListJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IListJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.ListJobsResponse; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.ListJobsResponse; + + /** + * Verifies a ListJobsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListJobsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListJobsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.ListJobsResponse; + + /** + * Creates a plain object from a ListJobsResponse message. Also converts values to other types if specified. + * @param message ListJobsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.ListJobsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListJobsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListJobsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTasksRequest. */ + interface IListTasksRequest { + + /** ListTasksRequest parent */ + parent?: (string|null); + + /** ListTasksRequest filter */ + filter?: (string|null); + + /** ListTasksRequest pageSize */ + pageSize?: (number|null); + + /** ListTasksRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListTasksRequest. */ + class ListTasksRequest implements IListTasksRequest { + + /** + * Constructs a new ListTasksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IListTasksRequest); + + /** ListTasksRequest parent. */ + public parent: string; + + /** ListTasksRequest filter. */ + public filter: string; + + /** ListTasksRequest pageSize. */ + public pageSize: number; + + /** ListTasksRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListTasksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTasksRequest instance + */ + public static create(properties?: google.cloud.batch.v1.IListTasksRequest): google.cloud.batch.v1.ListTasksRequest; + + /** + * Encodes the specified ListTasksRequest message. Does not implicitly {@link google.cloud.batch.v1.ListTasksRequest.verify|verify} messages. + * @param message ListTasksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IListTasksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTasksRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ListTasksRequest.verify|verify} messages. + * @param message ListTasksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IListTasksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTasksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTasksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.ListTasksRequest; + + /** + * Decodes a ListTasksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTasksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.ListTasksRequest; + + /** + * Verifies a ListTasksRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTasksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTasksRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.ListTasksRequest; + + /** + * Creates a plain object from a ListTasksRequest message. Also converts values to other types if specified. + * @param message ListTasksRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.ListTasksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTasksRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTasksRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTasksResponse. */ + interface IListTasksResponse { + + /** ListTasksResponse tasks */ + tasks?: (google.cloud.batch.v1.ITask[]|null); + + /** ListTasksResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListTasksResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListTasksResponse. */ + class ListTasksResponse implements IListTasksResponse { + + /** + * Constructs a new ListTasksResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IListTasksResponse); + + /** ListTasksResponse tasks. */ + public tasks: google.cloud.batch.v1.ITask[]; + + /** ListTasksResponse nextPageToken. */ + public nextPageToken: string; + + /** ListTasksResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListTasksResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTasksResponse instance + */ + public static create(properties?: google.cloud.batch.v1.IListTasksResponse): google.cloud.batch.v1.ListTasksResponse; + + /** + * Encodes the specified ListTasksResponse message. Does not implicitly {@link google.cloud.batch.v1.ListTasksResponse.verify|verify} messages. + * @param message ListTasksResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IListTasksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTasksResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ListTasksResponse.verify|verify} messages. + * @param message ListTasksResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IListTasksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTasksResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTasksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.ListTasksResponse; + + /** + * Decodes a ListTasksResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTasksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.ListTasksResponse; + + /** + * Verifies a ListTasksResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTasksResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTasksResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.ListTasksResponse; + + /** + * Creates a plain object from a ListTasksResponse message. Also converts values to other types if specified. + * @param message ListTasksResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.ListTasksResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTasksResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTasksResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTaskRequest. */ + interface IGetTaskRequest { + + /** GetTaskRequest name */ + name?: (string|null); + } + + /** Represents a GetTaskRequest. */ + class GetTaskRequest implements IGetTaskRequest { + + /** + * Constructs a new GetTaskRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IGetTaskRequest); + + /** GetTaskRequest name. */ + public name: string; + + /** + * Creates a new GetTaskRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTaskRequest instance + */ + public static create(properties?: google.cloud.batch.v1.IGetTaskRequest): google.cloud.batch.v1.GetTaskRequest; + + /** + * Encodes the specified GetTaskRequest message. Does not implicitly {@link google.cloud.batch.v1.GetTaskRequest.verify|verify} messages. + * @param message GetTaskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IGetTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTaskRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.GetTaskRequest.verify|verify} messages. + * @param message GetTaskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IGetTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTaskRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTaskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.GetTaskRequest; + + /** + * Decodes a GetTaskRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTaskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.GetTaskRequest; + + /** + * Verifies a GetTaskRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTaskRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTaskRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.GetTaskRequest; + + /** + * Creates a plain object from a GetTaskRequest message. Also converts values to other types if specified. + * @param message GetTaskRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.GetTaskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTaskRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTaskRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IOperationMetadata); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target. */ + public target: string; + + /** OperationMetadata verb. */ + public verb: string; + + /** OperationMetadata statusMessage. */ + public statusMessage: string; + + /** OperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.batch.v1.IOperationMetadata): google.cloud.batch.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.batch.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.batch.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.OperationMetadata; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.OperationMetadata; + + /** + * Verifies an OperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.OperationMetadata; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @param message OperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Job. */ + interface IJob { + + /** Job name */ + name?: (string|null); + + /** Job uid */ + uid?: (string|null); + + /** Job priority */ + priority?: (number|Long|string|null); + + /** Job taskGroups */ + taskGroups?: (google.cloud.batch.v1.ITaskGroup[]|null); + + /** Job allocationPolicy */ + allocationPolicy?: (google.cloud.batch.v1.IAllocationPolicy|null); + + /** Job labels */ + labels?: ({ [k: string]: string }|null); + + /** Job status */ + status?: (google.cloud.batch.v1.IJobStatus|null); + + /** Job createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Job updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Job logsPolicy */ + logsPolicy?: (google.cloud.batch.v1.ILogsPolicy|null); + + /** Job notifications */ + notifications?: (google.cloud.batch.v1.IJobNotification[]|null); + } + + /** Represents a Job. */ + class Job implements IJob { + + /** + * Constructs a new Job. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IJob); + + /** Job name. */ + public name: string; + + /** Job uid. */ + public uid: string; + + /** Job priority. */ + public priority: (number|Long|string); + + /** Job taskGroups. */ + public taskGroups: google.cloud.batch.v1.ITaskGroup[]; + + /** Job allocationPolicy. */ + public allocationPolicy?: (google.cloud.batch.v1.IAllocationPolicy|null); + + /** Job labels. */ + public labels: { [k: string]: string }; + + /** Job status. */ + public status?: (google.cloud.batch.v1.IJobStatus|null); + + /** Job createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Job updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Job logsPolicy. */ + public logsPolicy?: (google.cloud.batch.v1.ILogsPolicy|null); + + /** Job notifications. */ + public notifications: google.cloud.batch.v1.IJobNotification[]; + + /** + * Creates a new Job instance using the specified properties. + * @param [properties] Properties to set + * @returns Job instance + */ + public static create(properties?: google.cloud.batch.v1.IJob): google.cloud.batch.v1.Job; + + /** + * Encodes the specified Job message. Does not implicitly {@link google.cloud.batch.v1.Job.verify|verify} messages. + * @param message Job message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Job.verify|verify} messages. + * @param message Job message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Job message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.Job; + + /** + * Decodes a Job message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.Job; + + /** + * Verifies a Job message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Job message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Job + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.Job; + + /** + * Creates a plain object from a Job message. Also converts values to other types if specified. + * @param message Job + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.Job, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Job to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Job + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LogsPolicy. */ + interface ILogsPolicy { + + /** LogsPolicy destination */ + destination?: (google.cloud.batch.v1.LogsPolicy.Destination|keyof typeof google.cloud.batch.v1.LogsPolicy.Destination|null); + + /** LogsPolicy logsPath */ + logsPath?: (string|null); + + /** LogsPolicy cloudLoggingOption */ + cloudLoggingOption?: (google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption|null); + } + + /** Represents a LogsPolicy. */ + class LogsPolicy implements ILogsPolicy { + + /** + * Constructs a new LogsPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.ILogsPolicy); + + /** LogsPolicy destination. */ + public destination: (google.cloud.batch.v1.LogsPolicy.Destination|keyof typeof google.cloud.batch.v1.LogsPolicy.Destination); + + /** LogsPolicy logsPath. */ + public logsPath: string; + + /** LogsPolicy cloudLoggingOption. */ + public cloudLoggingOption?: (google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption|null); + + /** + * Creates a new LogsPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns LogsPolicy instance + */ + public static create(properties?: google.cloud.batch.v1.ILogsPolicy): google.cloud.batch.v1.LogsPolicy; + + /** + * Encodes the specified LogsPolicy message. Does not implicitly {@link google.cloud.batch.v1.LogsPolicy.verify|verify} messages. + * @param message LogsPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.ILogsPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LogsPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.LogsPolicy.verify|verify} messages. + * @param message LogsPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.ILogsPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LogsPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LogsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.LogsPolicy; + + /** + * Decodes a LogsPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LogsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.LogsPolicy; + + /** + * Verifies a LogsPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LogsPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LogsPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.LogsPolicy; + + /** + * Creates a plain object from a LogsPolicy message. Also converts values to other types if specified. + * @param message LogsPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.LogsPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LogsPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LogsPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LogsPolicy { + + /** Properties of a CloudLoggingOption. */ + interface ICloudLoggingOption { + + /** CloudLoggingOption useGenericTaskMonitoredResource */ + useGenericTaskMonitoredResource?: (boolean|null); + } + + /** Represents a CloudLoggingOption. */ + class CloudLoggingOption implements ICloudLoggingOption { + + /** + * Constructs a new CloudLoggingOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption); + + /** CloudLoggingOption useGenericTaskMonitoredResource. */ + public useGenericTaskMonitoredResource: boolean; + + /** + * Creates a new CloudLoggingOption instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudLoggingOption instance + */ + public static create(properties?: google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption): google.cloud.batch.v1.LogsPolicy.CloudLoggingOption; + + /** + * Encodes the specified CloudLoggingOption message. Does not implicitly {@link google.cloud.batch.v1.LogsPolicy.CloudLoggingOption.verify|verify} messages. + * @param message CloudLoggingOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudLoggingOption message, length delimited. Does not implicitly {@link google.cloud.batch.v1.LogsPolicy.CloudLoggingOption.verify|verify} messages. + * @param message CloudLoggingOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudLoggingOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudLoggingOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.LogsPolicy.CloudLoggingOption; + + /** + * Decodes a CloudLoggingOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudLoggingOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.LogsPolicy.CloudLoggingOption; + + /** + * Verifies a CloudLoggingOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudLoggingOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudLoggingOption + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.LogsPolicy.CloudLoggingOption; + + /** + * Creates a plain object from a CloudLoggingOption message. Also converts values to other types if specified. + * @param message CloudLoggingOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.LogsPolicy.CloudLoggingOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudLoggingOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudLoggingOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Destination enum. */ + enum Destination { + DESTINATION_UNSPECIFIED = 0, + CLOUD_LOGGING = 1, + PATH = 2 + } + } + + /** Properties of a JobStatus. */ + interface IJobStatus { + + /** JobStatus state */ + state?: (google.cloud.batch.v1.JobStatus.State|keyof typeof google.cloud.batch.v1.JobStatus.State|null); + + /** JobStatus statusEvents */ + statusEvents?: (google.cloud.batch.v1.IStatusEvent[]|null); + + /** JobStatus taskGroups */ + taskGroups?: ({ [k: string]: google.cloud.batch.v1.JobStatus.ITaskGroupStatus }|null); + + /** JobStatus runDuration */ + runDuration?: (google.protobuf.IDuration|null); + } + + /** Represents a JobStatus. */ + class JobStatus implements IJobStatus { + + /** + * Constructs a new JobStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IJobStatus); + + /** JobStatus state. */ + public state: (google.cloud.batch.v1.JobStatus.State|keyof typeof google.cloud.batch.v1.JobStatus.State); + + /** JobStatus statusEvents. */ + public statusEvents: google.cloud.batch.v1.IStatusEvent[]; + + /** JobStatus taskGroups. */ + public taskGroups: { [k: string]: google.cloud.batch.v1.JobStatus.ITaskGroupStatus }; + + /** JobStatus runDuration. */ + public runDuration?: (google.protobuf.IDuration|null); + + /** + * Creates a new JobStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns JobStatus instance + */ + public static create(properties?: google.cloud.batch.v1.IJobStatus): google.cloud.batch.v1.JobStatus; + + /** + * Encodes the specified JobStatus message. Does not implicitly {@link google.cloud.batch.v1.JobStatus.verify|verify} messages. + * @param message JobStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IJobStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobStatus.verify|verify} messages. + * @param message JobStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IJobStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.JobStatus; + + /** + * Decodes a JobStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.JobStatus; + + /** + * Verifies a JobStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.JobStatus; + + /** + * Creates a plain object from a JobStatus message. Also converts values to other types if specified. + * @param message JobStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.JobStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace JobStatus { + + /** Properties of an InstanceStatus. */ + interface IInstanceStatus { + + /** InstanceStatus machineType */ + machineType?: (string|null); + + /** InstanceStatus provisioningModel */ + provisioningModel?: (google.cloud.batch.v1.AllocationPolicy.ProvisioningModel|keyof typeof google.cloud.batch.v1.AllocationPolicy.ProvisioningModel|null); + + /** InstanceStatus taskPack */ + taskPack?: (number|Long|string|null); + + /** InstanceStatus bootDisk */ + bootDisk?: (google.cloud.batch.v1.AllocationPolicy.IDisk|null); + } + + /** Represents an InstanceStatus. */ + class InstanceStatus implements IInstanceStatus { + + /** + * Constructs a new InstanceStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.JobStatus.IInstanceStatus); + + /** InstanceStatus machineType. */ + public machineType: string; + + /** InstanceStatus provisioningModel. */ + public provisioningModel: (google.cloud.batch.v1.AllocationPolicy.ProvisioningModel|keyof typeof google.cloud.batch.v1.AllocationPolicy.ProvisioningModel); + + /** InstanceStatus taskPack. */ + public taskPack: (number|Long|string); + + /** InstanceStatus bootDisk. */ + public bootDisk?: (google.cloud.batch.v1.AllocationPolicy.IDisk|null); + + /** + * Creates a new InstanceStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceStatus instance + */ + public static create(properties?: google.cloud.batch.v1.JobStatus.IInstanceStatus): google.cloud.batch.v1.JobStatus.InstanceStatus; + + /** + * Encodes the specified InstanceStatus message. Does not implicitly {@link google.cloud.batch.v1.JobStatus.InstanceStatus.verify|verify} messages. + * @param message InstanceStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.JobStatus.IInstanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobStatus.InstanceStatus.verify|verify} messages. + * @param message InstanceStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.JobStatus.IInstanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.JobStatus.InstanceStatus; + + /** + * Decodes an InstanceStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.JobStatus.InstanceStatus; + + /** + * Verifies an InstanceStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.JobStatus.InstanceStatus; + + /** + * Creates a plain object from an InstanceStatus message. Also converts values to other types if specified. + * @param message InstanceStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.JobStatus.InstanceStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstanceStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TaskGroupStatus. */ + interface ITaskGroupStatus { + + /** TaskGroupStatus counts */ + counts?: ({ [k: string]: (number|Long|string) }|null); + + /** TaskGroupStatus instances */ + instances?: (google.cloud.batch.v1.JobStatus.IInstanceStatus[]|null); + } + + /** Represents a TaskGroupStatus. */ + class TaskGroupStatus implements ITaskGroupStatus { + + /** + * Constructs a new TaskGroupStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.JobStatus.ITaskGroupStatus); + + /** TaskGroupStatus counts. */ + public counts: { [k: string]: (number|Long|string) }; + + /** TaskGroupStatus instances. */ + public instances: google.cloud.batch.v1.JobStatus.IInstanceStatus[]; + + /** + * Creates a new TaskGroupStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns TaskGroupStatus instance + */ + public static create(properties?: google.cloud.batch.v1.JobStatus.ITaskGroupStatus): google.cloud.batch.v1.JobStatus.TaskGroupStatus; + + /** + * Encodes the specified TaskGroupStatus message. Does not implicitly {@link google.cloud.batch.v1.JobStatus.TaskGroupStatus.verify|verify} messages. + * @param message TaskGroupStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.JobStatus.ITaskGroupStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TaskGroupStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobStatus.TaskGroupStatus.verify|verify} messages. + * @param message TaskGroupStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.JobStatus.ITaskGroupStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TaskGroupStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TaskGroupStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.JobStatus.TaskGroupStatus; + + /** + * Decodes a TaskGroupStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TaskGroupStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.JobStatus.TaskGroupStatus; + + /** + * Verifies a TaskGroupStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TaskGroupStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TaskGroupStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.JobStatus.TaskGroupStatus; + + /** + * Creates a plain object from a TaskGroupStatus message. Also converts values to other types if specified. + * @param message TaskGroupStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.JobStatus.TaskGroupStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TaskGroupStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TaskGroupStatus + * @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, + QUEUED = 1, + SCHEDULED = 2, + RUNNING = 3, + SUCCEEDED = 4, + FAILED = 5, + DELETION_IN_PROGRESS = 6 + } + } + + /** Properties of a JobNotification. */ + interface IJobNotification { + + /** JobNotification pubsubTopic */ + pubsubTopic?: (string|null); + + /** JobNotification message */ + message?: (google.cloud.batch.v1.JobNotification.IMessage|null); + } + + /** Represents a JobNotification. */ + class JobNotification implements IJobNotification { + + /** + * Constructs a new JobNotification. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IJobNotification); + + /** JobNotification pubsubTopic. */ + public pubsubTopic: string; + + /** JobNotification message. */ + public message?: (google.cloud.batch.v1.JobNotification.IMessage|null); + + /** + * Creates a new JobNotification instance using the specified properties. + * @param [properties] Properties to set + * @returns JobNotification instance + */ + public static create(properties?: google.cloud.batch.v1.IJobNotification): google.cloud.batch.v1.JobNotification; + + /** + * Encodes the specified JobNotification message. Does not implicitly {@link google.cloud.batch.v1.JobNotification.verify|verify} messages. + * @param message JobNotification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IJobNotification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobNotification message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobNotification.verify|verify} messages. + * @param message JobNotification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IJobNotification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobNotification message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobNotification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.JobNotification; + + /** + * Decodes a JobNotification message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobNotification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.JobNotification; + + /** + * Verifies a JobNotification message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobNotification message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobNotification + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.JobNotification; + + /** + * Creates a plain object from a JobNotification message. Also converts values to other types if specified. + * @param message JobNotification + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.JobNotification, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobNotification to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobNotification + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace JobNotification { + + /** Properties of a Message. */ + interface IMessage { + + /** Message type */ + type?: (google.cloud.batch.v1.JobNotification.Type|keyof typeof google.cloud.batch.v1.JobNotification.Type|null); + + /** Message newJobState */ + newJobState?: (google.cloud.batch.v1.JobStatus.State|keyof typeof google.cloud.batch.v1.JobStatus.State|null); + + /** Message newTaskState */ + newTaskState?: (google.cloud.batch.v1.TaskStatus.State|keyof typeof google.cloud.batch.v1.TaskStatus.State|null); + } + + /** Represents a Message. */ + class Message implements IMessage { + + /** + * Constructs a new Message. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.JobNotification.IMessage); + + /** Message type. */ + public type: (google.cloud.batch.v1.JobNotification.Type|keyof typeof google.cloud.batch.v1.JobNotification.Type); + + /** Message newJobState. */ + public newJobState: (google.cloud.batch.v1.JobStatus.State|keyof typeof google.cloud.batch.v1.JobStatus.State); + + /** Message newTaskState. */ + public newTaskState: (google.cloud.batch.v1.TaskStatus.State|keyof typeof google.cloud.batch.v1.TaskStatus.State); + + /** + * Creates a new Message instance using the specified properties. + * @param [properties] Properties to set + * @returns Message instance + */ + public static create(properties?: google.cloud.batch.v1.JobNotification.IMessage): google.cloud.batch.v1.JobNotification.Message; + + /** + * Encodes the specified Message message. Does not implicitly {@link google.cloud.batch.v1.JobNotification.Message.verify|verify} messages. + * @param message Message message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.JobNotification.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobNotification.Message.verify|verify} messages. + * @param message Message message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.JobNotification.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Message message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.JobNotification.Message; + + /** + * Decodes a Message message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.JobNotification.Message; + + /** + * Verifies a Message message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Message message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Message + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.JobNotification.Message; + + /** + * Creates a plain object from a Message message. Also converts values to other types if specified. + * @param message Message + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.JobNotification.Message, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Message to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Message + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + JOB_STATE_CHANGED = 1, + TASK_STATE_CHANGED = 2 + } + } + + /** Properties of an AllocationPolicy. */ + interface IAllocationPolicy { + + /** AllocationPolicy location */ + location?: (google.cloud.batch.v1.AllocationPolicy.ILocationPolicy|null); + + /** AllocationPolicy instances */ + instances?: (google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate[]|null); + + /** AllocationPolicy serviceAccount */ + serviceAccount?: (google.cloud.batch.v1.IServiceAccount|null); + + /** AllocationPolicy labels */ + labels?: ({ [k: string]: string }|null); + + /** AllocationPolicy network */ + network?: (google.cloud.batch.v1.AllocationPolicy.INetworkPolicy|null); + + /** AllocationPolicy placement */ + placement?: (google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy|null); + + /** AllocationPolicy tags */ + tags?: (string[]|null); + } + + /** Represents an AllocationPolicy. */ + class AllocationPolicy implements IAllocationPolicy { + + /** + * Constructs a new AllocationPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IAllocationPolicy); + + /** AllocationPolicy location. */ + public location?: (google.cloud.batch.v1.AllocationPolicy.ILocationPolicy|null); + + /** AllocationPolicy instances. */ + public instances: google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate[]; + + /** AllocationPolicy serviceAccount. */ + public serviceAccount?: (google.cloud.batch.v1.IServiceAccount|null); + + /** AllocationPolicy labels. */ + public labels: { [k: string]: string }; + + /** AllocationPolicy network. */ + public network?: (google.cloud.batch.v1.AllocationPolicy.INetworkPolicy|null); + + /** AllocationPolicy placement. */ + public placement?: (google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy|null); + + /** AllocationPolicy tags. */ + public tags: string[]; + + /** + * Creates a new AllocationPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns AllocationPolicy instance + */ + public static create(properties?: google.cloud.batch.v1.IAllocationPolicy): google.cloud.batch.v1.AllocationPolicy; + + /** + * Encodes the specified AllocationPolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.verify|verify} messages. + * @param message AllocationPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IAllocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AllocationPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.verify|verify} messages. + * @param message AllocationPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IAllocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AllocationPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AllocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy; + + /** + * Decodes an AllocationPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AllocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy; + + /** + * Verifies an AllocationPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AllocationPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AllocationPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy; + + /** + * Creates a plain object from an AllocationPolicy message. Also converts values to other types if specified. + * @param message AllocationPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.AllocationPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AllocationPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AllocationPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AllocationPolicy { + + /** Properties of a LocationPolicy. */ + interface ILocationPolicy { + + /** LocationPolicy allowedLocations */ + allowedLocations?: (string[]|null); + } + + /** Represents a LocationPolicy. */ + class LocationPolicy implements ILocationPolicy { + + /** + * Constructs a new LocationPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.AllocationPolicy.ILocationPolicy); + + /** LocationPolicy allowedLocations. */ + public allowedLocations: string[]; + + /** + * Creates a new LocationPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns LocationPolicy instance + */ + public static create(properties?: google.cloud.batch.v1.AllocationPolicy.ILocationPolicy): google.cloud.batch.v1.AllocationPolicy.LocationPolicy; + + /** + * Encodes the specified LocationPolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.LocationPolicy.verify|verify} messages. + * @param message LocationPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.AllocationPolicy.ILocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocationPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.LocationPolicy.verify|verify} messages. + * @param message LocationPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.AllocationPolicy.ILocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocationPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy.LocationPolicy; + + /** + * Decodes a LocationPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy.LocationPolicy; + + /** + * Verifies a LocationPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LocationPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocationPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy.LocationPolicy; + + /** + * Creates a plain object from a LocationPolicy message. Also converts values to other types if specified. + * @param message LocationPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.AllocationPolicy.LocationPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocationPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LocationPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Disk. */ + interface IDisk { + + /** Disk image */ + image?: (string|null); + + /** Disk snapshot */ + snapshot?: (string|null); + + /** Disk type */ + type?: (string|null); + + /** Disk sizeGb */ + sizeGb?: (number|Long|string|null); + + /** Disk diskInterface */ + diskInterface?: (string|null); + } + + /** Represents a Disk. */ + class Disk implements IDisk { + + /** + * Constructs a new Disk. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.AllocationPolicy.IDisk); + + /** Disk image. */ + public image?: (string|null); + + /** Disk snapshot. */ + public snapshot?: (string|null); + + /** Disk type. */ + public type: string; + + /** Disk sizeGb. */ + public sizeGb: (number|Long|string); + + /** Disk diskInterface. */ + public diskInterface: string; + + /** Disk dataSource. */ + public dataSource?: ("image"|"snapshot"); + + /** + * Creates a new Disk instance using the specified properties. + * @param [properties] Properties to set + * @returns Disk instance + */ + public static create(properties?: google.cloud.batch.v1.AllocationPolicy.IDisk): google.cloud.batch.v1.AllocationPolicy.Disk; + + /** + * Encodes the specified Disk message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.Disk.verify|verify} messages. + * @param message Disk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.AllocationPolicy.IDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Disk message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.Disk.verify|verify} messages. + * @param message Disk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.AllocationPolicy.IDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Disk message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Disk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy.Disk; + + /** + * Decodes a Disk message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Disk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy.Disk; + + /** + * Verifies a Disk message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Disk message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Disk + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy.Disk; + + /** + * Creates a plain object from a Disk message. Also converts values to other types if specified. + * @param message Disk + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.AllocationPolicy.Disk, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Disk to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Disk + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AttachedDisk. */ + interface IAttachedDisk { + + /** AttachedDisk newDisk */ + newDisk?: (google.cloud.batch.v1.AllocationPolicy.IDisk|null); + + /** AttachedDisk existingDisk */ + existingDisk?: (string|null); + + /** AttachedDisk deviceName */ + deviceName?: (string|null); + } + + /** Represents an AttachedDisk. */ + class AttachedDisk implements IAttachedDisk { + + /** + * Constructs a new AttachedDisk. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.AllocationPolicy.IAttachedDisk); + + /** AttachedDisk newDisk. */ + public newDisk?: (google.cloud.batch.v1.AllocationPolicy.IDisk|null); + + /** AttachedDisk existingDisk. */ + public existingDisk?: (string|null); + + /** AttachedDisk deviceName. */ + public deviceName: string; + + /** AttachedDisk attached. */ + public attached?: ("newDisk"|"existingDisk"); + + /** + * Creates a new AttachedDisk instance using the specified properties. + * @param [properties] Properties to set + * @returns AttachedDisk instance + */ + public static create(properties?: google.cloud.batch.v1.AllocationPolicy.IAttachedDisk): google.cloud.batch.v1.AllocationPolicy.AttachedDisk; + + /** + * Encodes the specified AttachedDisk message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.AttachedDisk.verify|verify} messages. + * @param message AttachedDisk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.AllocationPolicy.IAttachedDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttachedDisk message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.AttachedDisk.verify|verify} messages. + * @param message AttachedDisk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.AllocationPolicy.IAttachedDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttachedDisk message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttachedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy.AttachedDisk; + + /** + * Decodes an AttachedDisk message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttachedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy.AttachedDisk; + + /** + * Verifies an AttachedDisk message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AttachedDisk message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttachedDisk + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy.AttachedDisk; + + /** + * Creates a plain object from an AttachedDisk message. Also converts values to other types if specified. + * @param message AttachedDisk + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.AllocationPolicy.AttachedDisk, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttachedDisk to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AttachedDisk + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Accelerator. */ + interface IAccelerator { + + /** Accelerator type */ + type?: (string|null); + + /** Accelerator count */ + count?: (number|Long|string|null); + + /** Accelerator installGpuDrivers */ + installGpuDrivers?: (boolean|null); + + /** Accelerator driverVersion */ + driverVersion?: (string|null); + } + + /** Represents an Accelerator. */ + class Accelerator implements IAccelerator { + + /** + * Constructs a new Accelerator. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.AllocationPolicy.IAccelerator); + + /** Accelerator type. */ + public type: string; + + /** Accelerator count. */ + public count: (number|Long|string); + + /** Accelerator installGpuDrivers. */ + public installGpuDrivers: boolean; + + /** Accelerator driverVersion. */ + public driverVersion: string; + + /** + * Creates a new Accelerator instance using the specified properties. + * @param [properties] Properties to set + * @returns Accelerator instance + */ + public static create(properties?: google.cloud.batch.v1.AllocationPolicy.IAccelerator): google.cloud.batch.v1.AllocationPolicy.Accelerator; + + /** + * Encodes the specified Accelerator message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.Accelerator.verify|verify} messages. + * @param message Accelerator message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.AllocationPolicy.IAccelerator, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Accelerator message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.Accelerator.verify|verify} messages. + * @param message Accelerator message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.AllocationPolicy.IAccelerator, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Accelerator message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Accelerator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy.Accelerator; + + /** + * Decodes an Accelerator message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Accelerator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy.Accelerator; + + /** + * Verifies an Accelerator message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Accelerator message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Accelerator + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy.Accelerator; + + /** + * Creates a plain object from an Accelerator message. Also converts values to other types if specified. + * @param message Accelerator + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.AllocationPolicy.Accelerator, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Accelerator to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Accelerator + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InstancePolicy. */ + interface IInstancePolicy { + + /** InstancePolicy machineType */ + machineType?: (string|null); + + /** InstancePolicy minCpuPlatform */ + minCpuPlatform?: (string|null); + + /** InstancePolicy provisioningModel */ + provisioningModel?: (google.cloud.batch.v1.AllocationPolicy.ProvisioningModel|keyof typeof google.cloud.batch.v1.AllocationPolicy.ProvisioningModel|null); + + /** InstancePolicy accelerators */ + accelerators?: (google.cloud.batch.v1.AllocationPolicy.IAccelerator[]|null); + + /** InstancePolicy bootDisk */ + bootDisk?: (google.cloud.batch.v1.AllocationPolicy.IDisk|null); + + /** InstancePolicy disks */ + disks?: (google.cloud.batch.v1.AllocationPolicy.IAttachedDisk[]|null); + + /** InstancePolicy reservation */ + reservation?: (string|null); + } + + /** Represents an InstancePolicy. */ + class InstancePolicy implements IInstancePolicy { + + /** + * Constructs a new InstancePolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.AllocationPolicy.IInstancePolicy); + + /** InstancePolicy machineType. */ + public machineType: string; + + /** InstancePolicy minCpuPlatform. */ + public minCpuPlatform: string; + + /** InstancePolicy provisioningModel. */ + public provisioningModel: (google.cloud.batch.v1.AllocationPolicy.ProvisioningModel|keyof typeof google.cloud.batch.v1.AllocationPolicy.ProvisioningModel); + + /** InstancePolicy accelerators. */ + public accelerators: google.cloud.batch.v1.AllocationPolicy.IAccelerator[]; + + /** InstancePolicy bootDisk. */ + public bootDisk?: (google.cloud.batch.v1.AllocationPolicy.IDisk|null); + + /** InstancePolicy disks. */ + public disks: google.cloud.batch.v1.AllocationPolicy.IAttachedDisk[]; + + /** InstancePolicy reservation. */ + public reservation: string; + + /** + * Creates a new InstancePolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns InstancePolicy instance + */ + public static create(properties?: google.cloud.batch.v1.AllocationPolicy.IInstancePolicy): google.cloud.batch.v1.AllocationPolicy.InstancePolicy; + + /** + * Encodes the specified InstancePolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.InstancePolicy.verify|verify} messages. + * @param message InstancePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.AllocationPolicy.IInstancePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstancePolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.InstancePolicy.verify|verify} messages. + * @param message InstancePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.AllocationPolicy.IInstancePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstancePolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstancePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy.InstancePolicy; + + /** + * Decodes an InstancePolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstancePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy.InstancePolicy; + + /** + * Verifies an InstancePolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstancePolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstancePolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy.InstancePolicy; + + /** + * Creates a plain object from an InstancePolicy message. Also converts values to other types if specified. + * @param message InstancePolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.AllocationPolicy.InstancePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstancePolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstancePolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InstancePolicyOrTemplate. */ + interface IInstancePolicyOrTemplate { + + /** InstancePolicyOrTemplate policy */ + policy?: (google.cloud.batch.v1.AllocationPolicy.IInstancePolicy|null); + + /** InstancePolicyOrTemplate instanceTemplate */ + instanceTemplate?: (string|null); + + /** InstancePolicyOrTemplate installGpuDrivers */ + installGpuDrivers?: (boolean|null); + + /** InstancePolicyOrTemplate installOpsAgent */ + installOpsAgent?: (boolean|null); + + /** InstancePolicyOrTemplate blockProjectSshKeys */ + blockProjectSshKeys?: (boolean|null); + } + + /** Represents an InstancePolicyOrTemplate. */ + class InstancePolicyOrTemplate implements IInstancePolicyOrTemplate { + + /** + * Constructs a new InstancePolicyOrTemplate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate); + + /** InstancePolicyOrTemplate policy. */ + public policy?: (google.cloud.batch.v1.AllocationPolicy.IInstancePolicy|null); + + /** InstancePolicyOrTemplate instanceTemplate. */ + public instanceTemplate?: (string|null); + + /** InstancePolicyOrTemplate installGpuDrivers. */ + public installGpuDrivers: boolean; + + /** InstancePolicyOrTemplate installOpsAgent. */ + public installOpsAgent: boolean; + + /** InstancePolicyOrTemplate blockProjectSshKeys. */ + public blockProjectSshKeys: boolean; + + /** InstancePolicyOrTemplate policyTemplate. */ + public policyTemplate?: ("policy"|"instanceTemplate"); + + /** + * Creates a new InstancePolicyOrTemplate instance using the specified properties. + * @param [properties] Properties to set + * @returns InstancePolicyOrTemplate instance + */ + public static create(properties?: google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate): google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate; + + /** + * Encodes the specified InstancePolicyOrTemplate message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.verify|verify} messages. + * @param message InstancePolicyOrTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstancePolicyOrTemplate message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.verify|verify} messages. + * @param message InstancePolicyOrTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstancePolicyOrTemplate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstancePolicyOrTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate; + + /** + * Decodes an InstancePolicyOrTemplate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstancePolicyOrTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate; + + /** + * Verifies an InstancePolicyOrTemplate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstancePolicyOrTemplate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstancePolicyOrTemplate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate; + + /** + * Creates a plain object from an InstancePolicyOrTemplate message. Also converts values to other types if specified. + * @param message InstancePolicyOrTemplate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstancePolicyOrTemplate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstancePolicyOrTemplate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NetworkInterface. */ + interface INetworkInterface { + + /** NetworkInterface network */ + network?: (string|null); + + /** NetworkInterface subnetwork */ + subnetwork?: (string|null); + + /** NetworkInterface noExternalIpAddress */ + noExternalIpAddress?: (boolean|null); + } + + /** Represents a NetworkInterface. */ + class NetworkInterface implements INetworkInterface { + + /** + * Constructs a new NetworkInterface. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.AllocationPolicy.INetworkInterface); + + /** NetworkInterface network. */ + public network: string; + + /** NetworkInterface subnetwork. */ + public subnetwork: string; + + /** NetworkInterface noExternalIpAddress. */ + public noExternalIpAddress: boolean; + + /** + * Creates a new NetworkInterface instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkInterface instance + */ + public static create(properties?: google.cloud.batch.v1.AllocationPolicy.INetworkInterface): google.cloud.batch.v1.AllocationPolicy.NetworkInterface; + + /** + * Encodes the specified NetworkInterface message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.NetworkInterface.verify|verify} messages. + * @param message NetworkInterface message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.AllocationPolicy.INetworkInterface, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkInterface message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.NetworkInterface.verify|verify} messages. + * @param message NetworkInterface message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.AllocationPolicy.INetworkInterface, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy.NetworkInterface; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy.NetworkInterface; + + /** + * Verifies a NetworkInterface message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkInterface message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkInterface + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy.NetworkInterface; + + /** + * Creates a plain object from a NetworkInterface message. Also converts values to other types if specified. + * @param message NetworkInterface + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.AllocationPolicy.NetworkInterface, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkInterface to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NetworkInterface + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NetworkPolicy. */ + interface INetworkPolicy { + + /** NetworkPolicy networkInterfaces */ + networkInterfaces?: (google.cloud.batch.v1.AllocationPolicy.INetworkInterface[]|null); + } + + /** Represents a NetworkPolicy. */ + class NetworkPolicy implements INetworkPolicy { + + /** + * Constructs a new NetworkPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.AllocationPolicy.INetworkPolicy); + + /** NetworkPolicy networkInterfaces. */ + public networkInterfaces: google.cloud.batch.v1.AllocationPolicy.INetworkInterface[]; + + /** + * Creates a new NetworkPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkPolicy instance + */ + public static create(properties?: google.cloud.batch.v1.AllocationPolicy.INetworkPolicy): google.cloud.batch.v1.AllocationPolicy.NetworkPolicy; + + /** + * Encodes the specified NetworkPolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.verify|verify} messages. + * @param message NetworkPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.AllocationPolicy.INetworkPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.verify|verify} messages. + * @param message NetworkPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.AllocationPolicy.INetworkPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy.NetworkPolicy; + + /** + * Decodes a NetworkPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy.NetworkPolicy; + + /** + * Verifies a NetworkPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy.NetworkPolicy; + + /** + * Creates a plain object from a NetworkPolicy message. Also converts values to other types if specified. + * @param message NetworkPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.AllocationPolicy.NetworkPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NetworkPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PlacementPolicy. */ + interface IPlacementPolicy { + + /** PlacementPolicy collocation */ + collocation?: (string|null); + + /** PlacementPolicy maxDistance */ + maxDistance?: (number|Long|string|null); + } + + /** Represents a PlacementPolicy. */ + class PlacementPolicy implements IPlacementPolicy { + + /** + * Constructs a new PlacementPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy); + + /** PlacementPolicy collocation. */ + public collocation: string; + + /** PlacementPolicy maxDistance. */ + public maxDistance: (number|Long|string); + + /** + * Creates a new PlacementPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns PlacementPolicy instance + */ + public static create(properties?: google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy): google.cloud.batch.v1.AllocationPolicy.PlacementPolicy; + + /** + * Encodes the specified PlacementPolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.verify|verify} messages. + * @param message PlacementPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PlacementPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.verify|verify} messages. + * @param message PlacementPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PlacementPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PlacementPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy.PlacementPolicy; + + /** + * Decodes a PlacementPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PlacementPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy.PlacementPolicy; + + /** + * Verifies a PlacementPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PlacementPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PlacementPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy.PlacementPolicy; + + /** + * Creates a plain object from a PlacementPolicy message. Also converts values to other types if specified. + * @param message PlacementPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.AllocationPolicy.PlacementPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PlacementPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PlacementPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ProvisioningModel enum. */ + enum ProvisioningModel { + PROVISIONING_MODEL_UNSPECIFIED = 0, + STANDARD = 1, + SPOT = 2, + PREEMPTIBLE = 3 + } + } + + /** Properties of a TaskGroup. */ + interface ITaskGroup { + + /** TaskGroup name */ + name?: (string|null); + + /** TaskGroup taskSpec */ + taskSpec?: (google.cloud.batch.v1.ITaskSpec|null); + + /** TaskGroup taskCount */ + taskCount?: (number|Long|string|null); + + /** TaskGroup parallelism */ + parallelism?: (number|Long|string|null); + + /** TaskGroup schedulingPolicy */ + schedulingPolicy?: (google.cloud.batch.v1.TaskGroup.SchedulingPolicy|keyof typeof google.cloud.batch.v1.TaskGroup.SchedulingPolicy|null); + + /** TaskGroup taskEnvironments */ + taskEnvironments?: (google.cloud.batch.v1.IEnvironment[]|null); + + /** TaskGroup taskCountPerNode */ + taskCountPerNode?: (number|Long|string|null); + + /** TaskGroup requireHostsFile */ + requireHostsFile?: (boolean|null); + + /** TaskGroup permissiveSsh */ + permissiveSsh?: (boolean|null); + + /** TaskGroup runAsNonRoot */ + runAsNonRoot?: (boolean|null); + } + + /** Represents a TaskGroup. */ + class TaskGroup implements ITaskGroup { + + /** + * Constructs a new TaskGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.ITaskGroup); + + /** TaskGroup name. */ + public name: string; + + /** TaskGroup taskSpec. */ + public taskSpec?: (google.cloud.batch.v1.ITaskSpec|null); + + /** TaskGroup taskCount. */ + public taskCount: (number|Long|string); + + /** TaskGroup parallelism. */ + public parallelism: (number|Long|string); + + /** TaskGroup schedulingPolicy. */ + public schedulingPolicy: (google.cloud.batch.v1.TaskGroup.SchedulingPolicy|keyof typeof google.cloud.batch.v1.TaskGroup.SchedulingPolicy); + + /** TaskGroup taskEnvironments. */ + public taskEnvironments: google.cloud.batch.v1.IEnvironment[]; + + /** TaskGroup taskCountPerNode. */ + public taskCountPerNode: (number|Long|string); + + /** TaskGroup requireHostsFile. */ + public requireHostsFile: boolean; + + /** TaskGroup permissiveSsh. */ + public permissiveSsh: boolean; + + /** TaskGroup runAsNonRoot. */ + public runAsNonRoot: boolean; + + /** + * Creates a new TaskGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns TaskGroup instance + */ + public static create(properties?: google.cloud.batch.v1.ITaskGroup): google.cloud.batch.v1.TaskGroup; + + /** + * Encodes the specified TaskGroup message. Does not implicitly {@link google.cloud.batch.v1.TaskGroup.verify|verify} messages. + * @param message TaskGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.ITaskGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TaskGroup message, length delimited. Does not implicitly {@link google.cloud.batch.v1.TaskGroup.verify|verify} messages. + * @param message TaskGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.ITaskGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TaskGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TaskGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.TaskGroup; + + /** + * Decodes a TaskGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TaskGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.TaskGroup; + + /** + * Verifies a TaskGroup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TaskGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TaskGroup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.TaskGroup; + + /** + * Creates a plain object from a TaskGroup message. Also converts values to other types if specified. + * @param message TaskGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.TaskGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TaskGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TaskGroup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TaskGroup { + + /** SchedulingPolicy enum. */ + enum SchedulingPolicy { + SCHEDULING_POLICY_UNSPECIFIED = 0, + AS_SOON_AS_POSSIBLE = 1, + IN_ORDER = 2 + } + } + + /** Properties of a ServiceAccount. */ + interface IServiceAccount { + + /** ServiceAccount email */ + email?: (string|null); + + /** ServiceAccount scopes */ + scopes?: (string[]|null); + } + + /** Represents a ServiceAccount. */ + class ServiceAccount implements IServiceAccount { + + /** + * Constructs a new ServiceAccount. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IServiceAccount); + + /** ServiceAccount email. */ + public email: string; + + /** ServiceAccount scopes. */ + public scopes: string[]; + + /** + * Creates a new ServiceAccount instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceAccount instance + */ + public static create(properties?: google.cloud.batch.v1.IServiceAccount): google.cloud.batch.v1.ServiceAccount; + + /** + * Encodes the specified ServiceAccount message. Does not implicitly {@link google.cloud.batch.v1.ServiceAccount.verify|verify} messages. + * @param message ServiceAccount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IServiceAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceAccount message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ServiceAccount.verify|verify} messages. + * @param message ServiceAccount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IServiceAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceAccount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.ServiceAccount; + + /** + * Decodes a ServiceAccount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.ServiceAccount; + + /** + * Verifies a ServiceAccount message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceAccount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceAccount + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.ServiceAccount; + + /** + * Creates a plain object from a ServiceAccount message. Also converts values to other types if specified. + * @param message ServiceAccount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.ServiceAccount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceAccount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceAccount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ComputeResource. */ + interface IComputeResource { + + /** ComputeResource cpuMilli */ + cpuMilli?: (number|Long|string|null); + + /** ComputeResource memoryMib */ + memoryMib?: (number|Long|string|null); + + /** ComputeResource bootDiskMib */ + bootDiskMib?: (number|Long|string|null); + } + + /** Represents a ComputeResource. */ + class ComputeResource implements IComputeResource { + + /** + * Constructs a new ComputeResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IComputeResource); + + /** ComputeResource cpuMilli. */ + public cpuMilli: (number|Long|string); + + /** ComputeResource memoryMib. */ + public memoryMib: (number|Long|string); + + /** ComputeResource bootDiskMib. */ + public bootDiskMib: (number|Long|string); + + /** + * Creates a new ComputeResource instance using the specified properties. + * @param [properties] Properties to set + * @returns ComputeResource instance + */ + public static create(properties?: google.cloud.batch.v1.IComputeResource): google.cloud.batch.v1.ComputeResource; + + /** + * Encodes the specified ComputeResource message. Does not implicitly {@link google.cloud.batch.v1.ComputeResource.verify|verify} messages. + * @param message ComputeResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IComputeResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ComputeResource message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ComputeResource.verify|verify} messages. + * @param message ComputeResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IComputeResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ComputeResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ComputeResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.ComputeResource; + + /** + * Decodes a ComputeResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ComputeResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.ComputeResource; + + /** + * Verifies a ComputeResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ComputeResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ComputeResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.ComputeResource; + + /** + * Creates a plain object from a ComputeResource message. Also converts values to other types if specified. + * @param message ComputeResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.ComputeResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ComputeResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ComputeResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StatusEvent. */ + interface IStatusEvent { + + /** StatusEvent type */ + type?: (string|null); + + /** StatusEvent description */ + description?: (string|null); + + /** StatusEvent eventTime */ + eventTime?: (google.protobuf.ITimestamp|null); + + /** StatusEvent taskExecution */ + taskExecution?: (google.cloud.batch.v1.ITaskExecution|null); + + /** StatusEvent taskState */ + taskState?: (google.cloud.batch.v1.TaskStatus.State|keyof typeof google.cloud.batch.v1.TaskStatus.State|null); + } + + /** Represents a StatusEvent. */ + class StatusEvent implements IStatusEvent { + + /** + * Constructs a new StatusEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IStatusEvent); + + /** StatusEvent type. */ + public type: string; + + /** StatusEvent description. */ + public description: string; + + /** StatusEvent eventTime. */ + public eventTime?: (google.protobuf.ITimestamp|null); + + /** StatusEvent taskExecution. */ + public taskExecution?: (google.cloud.batch.v1.ITaskExecution|null); + + /** StatusEvent taskState. */ + public taskState: (google.cloud.batch.v1.TaskStatus.State|keyof typeof google.cloud.batch.v1.TaskStatus.State); + + /** + * Creates a new StatusEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns StatusEvent instance + */ + public static create(properties?: google.cloud.batch.v1.IStatusEvent): google.cloud.batch.v1.StatusEvent; + + /** + * Encodes the specified StatusEvent message. Does not implicitly {@link google.cloud.batch.v1.StatusEvent.verify|verify} messages. + * @param message StatusEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IStatusEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StatusEvent message, length delimited. Does not implicitly {@link google.cloud.batch.v1.StatusEvent.verify|verify} messages. + * @param message StatusEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IStatusEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StatusEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StatusEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.StatusEvent; + + /** + * Decodes a StatusEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StatusEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.StatusEvent; + + /** + * Verifies a StatusEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StatusEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StatusEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.StatusEvent; + + /** + * Creates a plain object from a StatusEvent message. Also converts values to other types if specified. + * @param message StatusEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.StatusEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StatusEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StatusEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TaskExecution. */ + interface ITaskExecution { + + /** TaskExecution exitCode */ + exitCode?: (number|null); + } + + /** Represents a TaskExecution. */ + class TaskExecution implements ITaskExecution { + + /** + * Constructs a new TaskExecution. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.ITaskExecution); + + /** TaskExecution exitCode. */ + public exitCode: number; + + /** + * Creates a new TaskExecution instance using the specified properties. + * @param [properties] Properties to set + * @returns TaskExecution instance + */ + public static create(properties?: google.cloud.batch.v1.ITaskExecution): google.cloud.batch.v1.TaskExecution; + + /** + * Encodes the specified TaskExecution message. Does not implicitly {@link google.cloud.batch.v1.TaskExecution.verify|verify} messages. + * @param message TaskExecution message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.ITaskExecution, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TaskExecution message, length delimited. Does not implicitly {@link google.cloud.batch.v1.TaskExecution.verify|verify} messages. + * @param message TaskExecution message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.ITaskExecution, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TaskExecution message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TaskExecution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.TaskExecution; + + /** + * Decodes a TaskExecution message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TaskExecution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.TaskExecution; + + /** + * Verifies a TaskExecution message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TaskExecution message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TaskExecution + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.TaskExecution; + + /** + * Creates a plain object from a TaskExecution message. Also converts values to other types if specified. + * @param message TaskExecution + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.TaskExecution, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TaskExecution to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TaskExecution + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TaskStatus. */ + interface ITaskStatus { + + /** TaskStatus state */ + state?: (google.cloud.batch.v1.TaskStatus.State|keyof typeof google.cloud.batch.v1.TaskStatus.State|null); + + /** TaskStatus statusEvents */ + statusEvents?: (google.cloud.batch.v1.IStatusEvent[]|null); + } + + /** Represents a TaskStatus. */ + class TaskStatus implements ITaskStatus { + + /** + * Constructs a new TaskStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.ITaskStatus); + + /** TaskStatus state. */ + public state: (google.cloud.batch.v1.TaskStatus.State|keyof typeof google.cloud.batch.v1.TaskStatus.State); + + /** TaskStatus statusEvents. */ + public statusEvents: google.cloud.batch.v1.IStatusEvent[]; + + /** + * Creates a new TaskStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns TaskStatus instance + */ + public static create(properties?: google.cloud.batch.v1.ITaskStatus): google.cloud.batch.v1.TaskStatus; + + /** + * Encodes the specified TaskStatus message. Does not implicitly {@link google.cloud.batch.v1.TaskStatus.verify|verify} messages. + * @param message TaskStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.ITaskStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TaskStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1.TaskStatus.verify|verify} messages. + * @param message TaskStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.ITaskStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TaskStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TaskStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.TaskStatus; + + /** + * Decodes a TaskStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TaskStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.TaskStatus; + + /** + * Verifies a TaskStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TaskStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TaskStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.TaskStatus; + + /** + * Creates a plain object from a TaskStatus message. Also converts values to other types if specified. + * @param message TaskStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.TaskStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TaskStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TaskStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TaskStatus { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PENDING = 1, + ASSIGNED = 2, + RUNNING = 3, + FAILED = 4, + SUCCEEDED = 5, + UNEXECUTED = 6 + } + } + + /** Properties of a Runnable. */ + interface IRunnable { + + /** Runnable container */ + container?: (google.cloud.batch.v1.Runnable.IContainer|null); + + /** Runnable script */ + script?: (google.cloud.batch.v1.Runnable.IScript|null); + + /** Runnable barrier */ + barrier?: (google.cloud.batch.v1.Runnable.IBarrier|null); + + /** Runnable displayName */ + displayName?: (string|null); + + /** Runnable ignoreExitStatus */ + ignoreExitStatus?: (boolean|null); + + /** Runnable background */ + background?: (boolean|null); + + /** Runnable alwaysRun */ + alwaysRun?: (boolean|null); + + /** Runnable environment */ + environment?: (google.cloud.batch.v1.IEnvironment|null); + + /** Runnable timeout */ + timeout?: (google.protobuf.IDuration|null); + + /** Runnable labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a Runnable. */ + class Runnable implements IRunnable { + + /** + * Constructs a new Runnable. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IRunnable); + + /** Runnable container. */ + public container?: (google.cloud.batch.v1.Runnable.IContainer|null); + + /** Runnable script. */ + public script?: (google.cloud.batch.v1.Runnable.IScript|null); + + /** Runnable barrier. */ + public barrier?: (google.cloud.batch.v1.Runnable.IBarrier|null); + + /** Runnable displayName. */ + public displayName: string; + + /** Runnable ignoreExitStatus. */ + public ignoreExitStatus: boolean; + + /** Runnable background. */ + public background: boolean; + + /** Runnable alwaysRun. */ + public alwaysRun: boolean; + + /** Runnable environment. */ + public environment?: (google.cloud.batch.v1.IEnvironment|null); + + /** Runnable timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** Runnable labels. */ + public labels: { [k: string]: string }; + + /** Runnable executable. */ + public executable?: ("container"|"script"|"barrier"); + + /** + * Creates a new Runnable instance using the specified properties. + * @param [properties] Properties to set + * @returns Runnable instance + */ + public static create(properties?: google.cloud.batch.v1.IRunnable): google.cloud.batch.v1.Runnable; + + /** + * Encodes the specified Runnable message. Does not implicitly {@link google.cloud.batch.v1.Runnable.verify|verify} messages. + * @param message Runnable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IRunnable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Runnable message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Runnable.verify|verify} messages. + * @param message Runnable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IRunnable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Runnable message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Runnable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.Runnable; + + /** + * Decodes a Runnable message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Runnable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.Runnable; + + /** + * Verifies a Runnable message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Runnable message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Runnable + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.Runnable; + + /** + * Creates a plain object from a Runnable message. Also converts values to other types if specified. + * @param message Runnable + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.Runnable, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Runnable to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Runnable + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Runnable { + + /** Properties of a Container. */ + interface IContainer { + + /** Container imageUri */ + imageUri?: (string|null); + + /** Container commands */ + commands?: (string[]|null); + + /** Container entrypoint */ + entrypoint?: (string|null); + + /** Container volumes */ + volumes?: (string[]|null); + + /** Container options */ + options?: (string|null); + + /** Container blockExternalNetwork */ + blockExternalNetwork?: (boolean|null); + + /** Container username */ + username?: (string|null); + + /** Container password */ + password?: (string|null); + + /** Container enableImageStreaming */ + enableImageStreaming?: (boolean|null); + } + + /** Represents a Container. */ + class Container implements IContainer { + + /** + * Constructs a new Container. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.Runnable.IContainer); + + /** Container imageUri. */ + public imageUri: string; + + /** Container commands. */ + public commands: string[]; + + /** Container entrypoint. */ + public entrypoint: string; + + /** Container volumes. */ + public volumes: string[]; + + /** Container options. */ + public options: string; + + /** Container blockExternalNetwork. */ + public blockExternalNetwork: boolean; + + /** Container username. */ + public username: string; + + /** Container password. */ + public password: string; + + /** Container enableImageStreaming. */ + public enableImageStreaming: boolean; + + /** + * Creates a new Container instance using the specified properties. + * @param [properties] Properties to set + * @returns Container instance + */ + public static create(properties?: google.cloud.batch.v1.Runnable.IContainer): google.cloud.batch.v1.Runnable.Container; + + /** + * Encodes the specified Container message. Does not implicitly {@link google.cloud.batch.v1.Runnable.Container.verify|verify} messages. + * @param message Container message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.Runnable.IContainer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Container message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Runnable.Container.verify|verify} messages. + * @param message Container message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.Runnable.IContainer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Container message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Container + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.Runnable.Container; + + /** + * Decodes a Container message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Container + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.Runnable.Container; + + /** + * Verifies a Container message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Container message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Container + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.Runnable.Container; + + /** + * Creates a plain object from a Container message. Also converts values to other types if specified. + * @param message Container + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.Runnable.Container, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Container to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Container + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Script. */ + interface IScript { + + /** Script path */ + path?: (string|null); + + /** Script text */ + text?: (string|null); + } + + /** Represents a Script. */ + class Script implements IScript { + + /** + * Constructs a new Script. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.Runnable.IScript); + + /** Script path. */ + public path?: (string|null); + + /** Script text. */ + public text?: (string|null); + + /** Script command. */ + public command?: ("path"|"text"); + + /** + * Creates a new Script instance using the specified properties. + * @param [properties] Properties to set + * @returns Script instance + */ + public static create(properties?: google.cloud.batch.v1.Runnable.IScript): google.cloud.batch.v1.Runnable.Script; + + /** + * Encodes the specified Script message. Does not implicitly {@link google.cloud.batch.v1.Runnable.Script.verify|verify} messages. + * @param message Script message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.Runnable.IScript, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Script message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Runnable.Script.verify|verify} messages. + * @param message Script message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.Runnable.IScript, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Script message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Script + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.Runnable.Script; + + /** + * Decodes a Script message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Script + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.Runnable.Script; + + /** + * Verifies a Script message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Script message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Script + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.Runnable.Script; + + /** + * Creates a plain object from a Script message. Also converts values to other types if specified. + * @param message Script + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.Runnable.Script, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Script to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Script + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Barrier. */ + interface IBarrier { + + /** Barrier name */ + name?: (string|null); + } + + /** Represents a Barrier. */ + class Barrier implements IBarrier { + + /** + * Constructs a new Barrier. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.Runnable.IBarrier); + + /** Barrier name. */ + public name: string; + + /** + * Creates a new Barrier instance using the specified properties. + * @param [properties] Properties to set + * @returns Barrier instance + */ + public static create(properties?: google.cloud.batch.v1.Runnable.IBarrier): google.cloud.batch.v1.Runnable.Barrier; + + /** + * Encodes the specified Barrier message. Does not implicitly {@link google.cloud.batch.v1.Runnable.Barrier.verify|verify} messages. + * @param message Barrier message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.Runnable.IBarrier, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Barrier message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Runnable.Barrier.verify|verify} messages. + * @param message Barrier message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.Runnable.IBarrier, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Barrier message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Barrier + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.Runnable.Barrier; + + /** + * Decodes a Barrier message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Barrier + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.Runnable.Barrier; + + /** + * Verifies a Barrier message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Barrier message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Barrier + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.Runnable.Barrier; + + /** + * Creates a plain object from a Barrier message. Also converts values to other types if specified. + * @param message Barrier + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.Runnable.Barrier, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Barrier to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Barrier + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TaskSpec. */ + interface ITaskSpec { + + /** TaskSpec runnables */ + runnables?: (google.cloud.batch.v1.IRunnable[]|null); + + /** TaskSpec computeResource */ + computeResource?: (google.cloud.batch.v1.IComputeResource|null); + + /** TaskSpec maxRunDuration */ + maxRunDuration?: (google.protobuf.IDuration|null); + + /** TaskSpec maxRetryCount */ + maxRetryCount?: (number|null); + + /** TaskSpec lifecyclePolicies */ + lifecyclePolicies?: (google.cloud.batch.v1.ILifecyclePolicy[]|null); + + /** TaskSpec environments */ + environments?: ({ [k: string]: string }|null); + + /** TaskSpec volumes */ + volumes?: (google.cloud.batch.v1.IVolume[]|null); + + /** TaskSpec environment */ + environment?: (google.cloud.batch.v1.IEnvironment|null); + } + + /** Represents a TaskSpec. */ + class TaskSpec implements ITaskSpec { + + /** + * Constructs a new TaskSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.ITaskSpec); + + /** TaskSpec runnables. */ + public runnables: google.cloud.batch.v1.IRunnable[]; + + /** TaskSpec computeResource. */ + public computeResource?: (google.cloud.batch.v1.IComputeResource|null); + + /** TaskSpec maxRunDuration. */ + public maxRunDuration?: (google.protobuf.IDuration|null); + + /** TaskSpec maxRetryCount. */ + public maxRetryCount: number; + + /** TaskSpec lifecyclePolicies. */ + public lifecyclePolicies: google.cloud.batch.v1.ILifecyclePolicy[]; + + /** TaskSpec environments. */ + public environments: { [k: string]: string }; + + /** TaskSpec volumes. */ + public volumes: google.cloud.batch.v1.IVolume[]; + + /** TaskSpec environment. */ + public environment?: (google.cloud.batch.v1.IEnvironment|null); + + /** + * Creates a new TaskSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns TaskSpec instance + */ + public static create(properties?: google.cloud.batch.v1.ITaskSpec): google.cloud.batch.v1.TaskSpec; + + /** + * Encodes the specified TaskSpec message. Does not implicitly {@link google.cloud.batch.v1.TaskSpec.verify|verify} messages. + * @param message TaskSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.ITaskSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TaskSpec message, length delimited. Does not implicitly {@link google.cloud.batch.v1.TaskSpec.verify|verify} messages. + * @param message TaskSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.ITaskSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TaskSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TaskSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.TaskSpec; + + /** + * Decodes a TaskSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TaskSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.TaskSpec; + + /** + * Verifies a TaskSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TaskSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TaskSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.TaskSpec; + + /** + * Creates a plain object from a TaskSpec message. Also converts values to other types if specified. + * @param message TaskSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.TaskSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TaskSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TaskSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LifecyclePolicy. */ + interface ILifecyclePolicy { + + /** LifecyclePolicy action */ + action?: (google.cloud.batch.v1.LifecyclePolicy.Action|keyof typeof google.cloud.batch.v1.LifecyclePolicy.Action|null); + + /** LifecyclePolicy actionCondition */ + actionCondition?: (google.cloud.batch.v1.LifecyclePolicy.IActionCondition|null); + } + + /** Represents a LifecyclePolicy. */ + class LifecyclePolicy implements ILifecyclePolicy { + + /** + * Constructs a new LifecyclePolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.ILifecyclePolicy); + + /** LifecyclePolicy action. */ + public action: (google.cloud.batch.v1.LifecyclePolicy.Action|keyof typeof google.cloud.batch.v1.LifecyclePolicy.Action); + + /** LifecyclePolicy actionCondition. */ + public actionCondition?: (google.cloud.batch.v1.LifecyclePolicy.IActionCondition|null); + + /** + * Creates a new LifecyclePolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns LifecyclePolicy instance + */ + public static create(properties?: google.cloud.batch.v1.ILifecyclePolicy): google.cloud.batch.v1.LifecyclePolicy; + + /** + * Encodes the specified LifecyclePolicy message. Does not implicitly {@link google.cloud.batch.v1.LifecyclePolicy.verify|verify} messages. + * @param message LifecyclePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.ILifecyclePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LifecyclePolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.LifecyclePolicy.verify|verify} messages. + * @param message LifecyclePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.ILifecyclePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LifecyclePolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LifecyclePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.LifecyclePolicy; + + /** + * Decodes a LifecyclePolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LifecyclePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.LifecyclePolicy; + + /** + * Verifies a LifecyclePolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LifecyclePolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LifecyclePolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.LifecyclePolicy; + + /** + * Creates a plain object from a LifecyclePolicy message. Also converts values to other types if specified. + * @param message LifecyclePolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.LifecyclePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LifecyclePolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LifecyclePolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LifecyclePolicy { + + /** Properties of an ActionCondition. */ + interface IActionCondition { + + /** ActionCondition exitCodes */ + exitCodes?: (number[]|null); + } + + /** Represents an ActionCondition. */ + class ActionCondition implements IActionCondition { + + /** + * Constructs a new ActionCondition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.LifecyclePolicy.IActionCondition); + + /** ActionCondition exitCodes. */ + public exitCodes: number[]; + + /** + * Creates a new ActionCondition instance using the specified properties. + * @param [properties] Properties to set + * @returns ActionCondition instance + */ + public static create(properties?: google.cloud.batch.v1.LifecyclePolicy.IActionCondition): google.cloud.batch.v1.LifecyclePolicy.ActionCondition; + + /** + * Encodes the specified ActionCondition message. Does not implicitly {@link google.cloud.batch.v1.LifecyclePolicy.ActionCondition.verify|verify} messages. + * @param message ActionCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.LifecyclePolicy.IActionCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ActionCondition message, length delimited. Does not implicitly {@link google.cloud.batch.v1.LifecyclePolicy.ActionCondition.verify|verify} messages. + * @param message ActionCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.LifecyclePolicy.IActionCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ActionCondition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ActionCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.LifecyclePolicy.ActionCondition; + + /** + * Decodes an ActionCondition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ActionCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.LifecyclePolicy.ActionCondition; + + /** + * Verifies an ActionCondition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ActionCondition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ActionCondition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.LifecyclePolicy.ActionCondition; + + /** + * Creates a plain object from an ActionCondition message. Also converts values to other types if specified. + * @param message ActionCondition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.LifecyclePolicy.ActionCondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ActionCondition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ActionCondition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + RETRY_TASK = 1, + FAIL_TASK = 2 + } + } + + /** Properties of a Task. */ + interface ITask { + + /** Task name */ + name?: (string|null); + + /** Task status */ + status?: (google.cloud.batch.v1.ITaskStatus|null); + } + + /** Represents a Task. */ + class Task implements ITask { + + /** + * Constructs a new Task. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.ITask); + + /** Task name. */ + public name: string; + + /** Task status. */ + public status?: (google.cloud.batch.v1.ITaskStatus|null); + + /** + * Creates a new Task instance using the specified properties. + * @param [properties] Properties to set + * @returns Task instance + */ + public static create(properties?: google.cloud.batch.v1.ITask): google.cloud.batch.v1.Task; + + /** + * Encodes the specified Task message. Does not implicitly {@link google.cloud.batch.v1.Task.verify|verify} messages. + * @param message Task message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.ITask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Task message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Task.verify|verify} messages. + * @param message Task message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.ITask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Task message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Task + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.Task; + + /** + * Decodes a Task message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Task + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.Task; + + /** + * Verifies a Task message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Task message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Task + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.Task; + + /** + * Creates a plain object from a Task message. Also converts values to other types if specified. + * @param message Task + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.Task, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Task to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Task + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Environment. */ + interface IEnvironment { + + /** Environment variables */ + variables?: ({ [k: string]: string }|null); + + /** Environment secretVariables */ + secretVariables?: ({ [k: string]: string }|null); + + /** Environment encryptedVariables */ + encryptedVariables?: (google.cloud.batch.v1.Environment.IKMSEnvMap|null); + } + + /** Represents an Environment. */ + class Environment implements IEnvironment { + + /** + * Constructs a new Environment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IEnvironment); + + /** Environment variables. */ + public variables: { [k: string]: string }; + + /** Environment secretVariables. */ + public secretVariables: { [k: string]: string }; + + /** Environment encryptedVariables. */ + public encryptedVariables?: (google.cloud.batch.v1.Environment.IKMSEnvMap|null); + + /** + * Creates a new Environment instance using the specified properties. + * @param [properties] Properties to set + * @returns Environment instance + */ + public static create(properties?: google.cloud.batch.v1.IEnvironment): google.cloud.batch.v1.Environment; + + /** + * Encodes the specified Environment message. Does not implicitly {@link google.cloud.batch.v1.Environment.verify|verify} messages. + * @param message Environment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Environment.verify|verify} messages. + * @param message Environment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Environment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.Environment; + + /** + * Decodes an Environment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.Environment; + + /** + * Verifies an Environment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Environment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Environment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.Environment; + + /** + * Creates a plain object from an Environment message. Also converts values to other types if specified. + * @param message Environment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.Environment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Environment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Environment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Environment { + + /** Properties of a KMSEnvMap. */ + interface IKMSEnvMap { + + /** KMSEnvMap keyName */ + keyName?: (string|null); + + /** KMSEnvMap cipherText */ + cipherText?: (string|null); + } + + /** Represents a KMSEnvMap. */ + class KMSEnvMap implements IKMSEnvMap { + + /** + * Constructs a new KMSEnvMap. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.Environment.IKMSEnvMap); + + /** KMSEnvMap keyName. */ + public keyName: string; + + /** KMSEnvMap cipherText. */ + public cipherText: string; + + /** + * Creates a new KMSEnvMap instance using the specified properties. + * @param [properties] Properties to set + * @returns KMSEnvMap instance + */ + public static create(properties?: google.cloud.batch.v1.Environment.IKMSEnvMap): google.cloud.batch.v1.Environment.KMSEnvMap; + + /** + * Encodes the specified KMSEnvMap message. Does not implicitly {@link google.cloud.batch.v1.Environment.KMSEnvMap.verify|verify} messages. + * @param message KMSEnvMap message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.Environment.IKMSEnvMap, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KMSEnvMap message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Environment.KMSEnvMap.verify|verify} messages. + * @param message KMSEnvMap message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.Environment.IKMSEnvMap, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KMSEnvMap message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KMSEnvMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.Environment.KMSEnvMap; + + /** + * Decodes a KMSEnvMap message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KMSEnvMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.Environment.KMSEnvMap; + + /** + * Verifies a KMSEnvMap message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a KMSEnvMap message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KMSEnvMap + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.Environment.KMSEnvMap; + + /** + * Creates a plain object from a KMSEnvMap message. Also converts values to other types if specified. + * @param message KMSEnvMap + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.Environment.KMSEnvMap, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KMSEnvMap to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KMSEnvMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Volume. */ + interface IVolume { + + /** Volume nfs */ + nfs?: (google.cloud.batch.v1.INFS|null); + + /** Volume gcs */ + gcs?: (google.cloud.batch.v1.IGCS|null); + + /** Volume deviceName */ + deviceName?: (string|null); + + /** Volume mountPath */ + mountPath?: (string|null); + + /** Volume mountOptions */ + mountOptions?: (string[]|null); + } + + /** Represents a Volume. */ + class Volume implements IVolume { + + /** + * Constructs a new Volume. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IVolume); + + /** Volume nfs. */ + public nfs?: (google.cloud.batch.v1.INFS|null); + + /** Volume gcs. */ + public gcs?: (google.cloud.batch.v1.IGCS|null); + + /** Volume deviceName. */ + public deviceName?: (string|null); + + /** Volume mountPath. */ + public mountPath: string; + + /** Volume mountOptions. */ + public mountOptions: string[]; + + /** Volume source. */ + public source?: ("nfs"|"gcs"|"deviceName"); + + /** + * Creates a new Volume instance using the specified properties. + * @param [properties] Properties to set + * @returns Volume instance + */ + public static create(properties?: google.cloud.batch.v1.IVolume): google.cloud.batch.v1.Volume; + + /** + * Encodes the specified Volume message. Does not implicitly {@link google.cloud.batch.v1.Volume.verify|verify} messages. + * @param message Volume message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IVolume, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Volume message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Volume.verify|verify} messages. + * @param message Volume message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IVolume, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Volume message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Volume + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.Volume; + + /** + * Decodes a Volume message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Volume + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.Volume; + + /** + * Verifies a Volume message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Volume message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Volume + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.Volume; + + /** + * Creates a plain object from a Volume message. Also converts values to other types if specified. + * @param message Volume + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.Volume, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Volume to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Volume + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NFS. */ + interface INFS { + + /** NFS server */ + server?: (string|null); + + /** NFS remotePath */ + remotePath?: (string|null); + } + + /** Represents a NFS. */ + class NFS implements INFS { + + /** + * Constructs a new NFS. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.INFS); + + /** NFS server. */ + public server: string; + + /** NFS remotePath. */ + public remotePath: string; + + /** + * Creates a new NFS instance using the specified properties. + * @param [properties] Properties to set + * @returns NFS instance + */ + public static create(properties?: google.cloud.batch.v1.INFS): google.cloud.batch.v1.NFS; + + /** + * Encodes the specified NFS message. Does not implicitly {@link google.cloud.batch.v1.NFS.verify|verify} messages. + * @param message NFS message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.INFS, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NFS message, length delimited. Does not implicitly {@link google.cloud.batch.v1.NFS.verify|verify} messages. + * @param message NFS message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.INFS, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NFS message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NFS + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.NFS; + + /** + * Decodes a NFS message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NFS + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.NFS; + + /** + * Verifies a NFS message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NFS message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NFS + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.NFS; + + /** + * Creates a plain object from a NFS message. Also converts values to other types if specified. + * @param message NFS + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.NFS, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NFS to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NFS + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GCS. */ + interface IGCS { + + /** GCS remotePath */ + remotePath?: (string|null); + } + + /** Represents a GCS. */ + class GCS implements IGCS { + + /** + * Constructs a new GCS. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.IGCS); + + /** GCS remotePath. */ + public remotePath: string; + + /** + * Creates a new GCS instance using the specified properties. + * @param [properties] Properties to set + * @returns GCS instance + */ + public static create(properties?: google.cloud.batch.v1.IGCS): google.cloud.batch.v1.GCS; + + /** + * Encodes the specified GCS message. Does not implicitly {@link google.cloud.batch.v1.GCS.verify|verify} messages. + * @param message GCS message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.IGCS, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GCS message, length delimited. Does not implicitly {@link google.cloud.batch.v1.GCS.verify|verify} messages. + * @param message GCS message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.IGCS, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GCS message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GCS + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.GCS; + + /** + * Decodes a GCS message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GCS + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.GCS; + + /** + * Verifies a GCS message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GCS message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GCS + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.GCS; + + /** + * Creates a plain object from a GCS message. Also converts values to other types if specified. + * @param message GCS + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.GCS, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GCS to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GCS + * @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); + } + + /** Represents a CommonLanguageSettings. */ + class CommonLanguageSettings implements ICommonLanguageSettings { + + /** + * Constructs a new CommonLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICommonLanguageSettings); + + /** CommonLanguageSettings referenceDocsUri. */ + public referenceDocsUri: string; + + /** CommonLanguageSettings destinations. */ + public destinations: google.api.ClientLibraryDestination[]; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonLanguageSettings instance + */ + public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; + + /** + * Verifies a CommonLanguageSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @param message CommonLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientLibrarySettings. */ + interface IClientLibrarySettings { + + /** ClientLibrarySettings version */ + version?: (string|null); + + /** ClientLibrarySettings launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ClientLibrarySettings restNumericEnums */ + restNumericEnums?: (boolean|null); + + /** ClientLibrarySettings javaSettings */ + javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings */ + cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings */ + phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings */ + pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings */ + nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings */ + dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings */ + rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings */ + goSettings?: (google.api.IGoSettings|null); + } + + /** Represents a ClientLibrarySettings. */ + class ClientLibrarySettings implements IClientLibrarySettings { + + /** + * Constructs a new ClientLibrarySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IClientLibrarySettings); + + /** ClientLibrarySettings version. */ + public version: string; + + /** ClientLibrarySettings launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ClientLibrarySettings restNumericEnums. */ + public restNumericEnums: boolean; + + /** ClientLibrarySettings javaSettings. */ + public javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings. */ + public cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings. */ + public phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings. */ + public pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings. */ + public nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings. */ + public dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings. */ + public rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings. */ + public goSettings?: (google.api.IGoSettings|null); + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientLibrarySettings instance + */ + public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; + + /** + * Verifies a ClientLibrarySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientLibrarySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @param message ClientLibrarySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientLibrarySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Publishing. */ + interface IPublishing { + + /** Publishing methodSettings */ + methodSettings?: (google.api.IMethodSettings[]|null); + + /** Publishing newIssueUri */ + newIssueUri?: (string|null); + + /** Publishing documentationUri */ + documentationUri?: (string|null); + + /** Publishing apiShortName */ + apiShortName?: (string|null); + + /** Publishing githubLabel */ + githubLabel?: (string|null); + + /** Publishing codeownerGithubTeams */ + codeownerGithubTeams?: (string[]|null); + + /** Publishing docTagPrefix */ + docTagPrefix?: (string|null); + + /** Publishing organization */ + organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); + + /** Publishing librarySettings */ + librarySettings?: (google.api.IClientLibrarySettings[]|null); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); + + /** Publishing restReferenceDocumentationUri */ + restReferenceDocumentationUri?: (string|null); + } + + /** Represents a Publishing. */ + class Publishing implements IPublishing { + + /** + * Constructs a new Publishing. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPublishing); + + /** Publishing methodSettings. */ + public methodSettings: google.api.IMethodSettings[]; + + /** Publishing newIssueUri. */ + public newIssueUri: string; + + /** Publishing documentationUri. */ + public documentationUri: string; + + /** Publishing apiShortName. */ + public apiShortName: string; + + /** Publishing githubLabel. */ + public githubLabel: string; + + /** Publishing codeownerGithubTeams. */ + public codeownerGithubTeams: string[]; + + /** Publishing docTagPrefix. */ + public docTagPrefix: string; + + /** Publishing organization. */ + public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; + + /** Publishing restReferenceDocumentationUri. */ + public restReferenceDocumentationUri: string; + + /** + * Creates a new Publishing instance using the specified properties. + * @param [properties] Properties to set + * @returns Publishing instance + */ + public static create(properties?: google.api.IPublishing): google.api.Publishing; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; + + /** + * Verifies a Publishing message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Publishing + */ + public static fromObject(object: { [k: string]: any }): google.api.Publishing; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @param message Publishing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Publishing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Publishing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JavaSettings. */ + interface IJavaSettings { + + /** JavaSettings libraryPackage */ + libraryPackage?: (string|null); + + /** JavaSettings serviceClassNames */ + serviceClassNames?: ({ [k: string]: string }|null); + + /** JavaSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a JavaSettings. */ + class JavaSettings implements IJavaSettings { + + /** + * Constructs a new JavaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IJavaSettings); + + /** JavaSettings libraryPackage. */ + public libraryPackage: string; + + /** JavaSettings serviceClassNames. */ + public serviceClassNames: { [k: string]: string }; + + /** JavaSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new JavaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaSettings instance + */ + public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; + + /** + * Verifies a JavaSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @param message JavaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JavaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CppSettings. */ + interface ICppSettings { + + /** CppSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { + + /** + * Constructs a new CppSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICppSettings); + + /** CppSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance + */ + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; + + /** + * Verifies a CppSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CppSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @param message CppSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CppSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CppSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PhpSettings. */ + interface IPhpSettings { + + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { + + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); + + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PhpSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PhpSettings instance + */ + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; + + /** + * Verifies a PhpSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhpSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @param message PhpSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhpSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhpSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonSettings. */ + interface IPythonSettings { + + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { + + /** + * Constructs a new PythonSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPythonSettings); + + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PythonSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonSettings instance + */ + public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; + + /** + * Verifies a PythonSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeSettings. */ + interface INodeSettings { + + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { + + /** + * Constructs a new NodeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.INodeSettings); + + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance + */ + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; + + /** + * Verifies a NodeSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @param message NodeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DotnetSettings. */ + interface IDotnetSettings { + + /** DotnetSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + + /** DotnetSettings renamedResources */ + renamedResources?: ({ [k: string]: string }|null); + + /** DotnetSettings ignoredResources */ + ignoredResources?: (string[]|null); + + /** DotnetSettings forcedNamespaceAliases */ + forcedNamespaceAliases?: (string[]|null); + + /** DotnetSettings handwrittenSignatures */ + handwrittenSignatures?: (string[]|null); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** DotnetSettings renamedResources. */ + public renamedResources: { [k: string]: string }; + + /** DotnetSettings ignoredResources. */ + public ignoredResources: string[]; + + /** DotnetSettings forcedNamespaceAliases. */ + public forcedNamespaceAliases: string[]; + + /** DotnetSettings handwrittenSignatures. */ + public handwrittenSignatures: string[]; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance + */ + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; + + /** + * Verifies a DotnetSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DotnetSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @param message DotnetSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DotnetSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DotnetSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RubySettings. */ + interface IRubySettings { + + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { + + /** + * Constructs a new RubySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance + */ + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; + + /** + * Verifies a RubySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RubySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @param message RubySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RubySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RubySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoSettings. */ + interface IGoSettings { + + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { + + /** + * Constructs a new GoSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IGoSettings); + + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new GoSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GoSettings instance + */ + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; + + /** + * Verifies a GoSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @param message GoSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); + + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields */ + autoPopulatedFields?: (string[]|null); + } + + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { + + /** + * Constructs a new MethodSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; + + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields. */ + public autoPopulatedFields: string[]; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance + */ + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; + + /** + * Verifies a MethodSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @param message MethodSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodSettings { + + /** Properties of a LongRunning. */ + interface ILongRunning { + + /** LongRunning initialPollDelay */ + initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier */ + pollDelayMultiplier?: (number|null); + + /** LongRunning maxPollDelay */ + maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout */ + totalPollTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a LongRunning. */ + class LongRunning implements ILongRunning { + + /** + * Constructs a new LongRunning. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MethodSettings.ILongRunning); + + /** LongRunning initialPollDelay. */ + public initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier. */ + public pollDelayMultiplier: number; + + /** LongRunning maxPollDelay. */ + public maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout. */ + public totalPollTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new LongRunning instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunning instance + */ + public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; + + /** + * Verifies a LongRunning message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunning + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @param message LongRunning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4, + SHOPPING = 5, + GEO = 6, + GENERATIVE_AI = 7 + } + + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + + /** 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 FieldInfo. */ + interface IFieldInfo { + + /** FieldInfo format */ + format?: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format|null); + } + + /** Represents a FieldInfo. */ + class FieldInfo implements IFieldInfo { + + /** + * Constructs a new FieldInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IFieldInfo); + + /** FieldInfo format. */ + public format: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format); + + /** + * Creates a new FieldInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldInfo instance + */ + public static create(properties?: google.api.IFieldInfo): google.api.FieldInfo; + + /** + * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @param message FieldInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @param message FieldInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldInfo + * @throws {Error} If the payload is not 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.FieldInfo; + + /** + * Decodes a FieldInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldInfo + * @throws {Error} If the payload 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.FieldInfo; + + /** + * Verifies a FieldInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldInfo + */ + public static fromObject(object: { [k: string]: any }): google.api.FieldInfo; + + /** + * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. + * @param message FieldInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.FieldInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldInfo { + + /** Format enum. */ + enum Format { + FORMAT_UNSPECIFIED = 0, + UUID4 = 1, + IPV4 = 2, + IPV6 = 3, + IPV4_OR_IPV6 = 4 + } + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Edition enum. */ + enum Edition { + EDITION_UNKNOWN = 0, + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + EDITION_2023 = 1000, + EDITION_2024 = 1001, + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + EDITION_MAX = 2147483647 + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ExtensionRangeOptions declaration */ + declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); + + /** ExtensionRangeOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification */ + verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** ExtensionRangeOptions declaration. */ + public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; + + /** ExtensionRangeOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification. */ + public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExtensionRangeOptions { + + /** Properties of a Declaration. */ + interface IDeclaration { + + /** Declaration number */ + number?: (number|null); + + /** Declaration fullName */ + fullName?: (string|null); + + /** Declaration type */ + type?: (string|null); + + /** Declaration reserved */ + reserved?: (boolean|null); + + /** Declaration repeated */ + repeated?: (boolean|null); + } + + /** Represents a Declaration. */ + class Declaration implements IDeclaration { + + /** + * Constructs a new Declaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); + + /** Declaration number. */ + public number: number; + + /** Declaration fullName. */ + public fullName: string; + + /** Declaration type. */ + public type: string; + + /** Declaration reserved. */ + public reserved: boolean; + + /** Declaration repeated. */ + public repeated: boolean; + + /** + * Creates a new Declaration instance using the specified properties. + * @param [properties] Properties to set + * @returns Declaration instance + */ + public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Verifies a Declaration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Declaration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @param message Declaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Declaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Declaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VerificationState enum. */ + enum VerificationState { + DECLARATION = 0, + UNVERIFIED = 1 + } + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REPEATED = 3, + LABEL_REQUIRED = 2 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** MessageOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** MessageOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions debugRedact */ + debugRedact?: (boolean|null); + + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + + /** FieldOptions targets */ + targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); + + /** FieldOptions editionDefaults */ + editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); + + /** FieldOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.fieldInfo */ + ".google.api.fieldInfo"?: (google.api.IFieldInfo|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions debugRedact. */ + public debugRedact: boolean; + + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions targets. */ + public targets: google.protobuf.FieldOptions.OptionTargetType[]; + + /** FieldOptions editionDefaults. */ + public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; + + /** FieldOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } + + /** OptionTargetType enum. */ + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9 + } + + /** Properties of an EditionDefault. */ + interface IEditionDefault { + + /** EditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** EditionDefault value */ + value?: (string|null); + } + + /** Represents an EditionDefault. */ + class EditionDefault implements IEditionDefault { + + /** + * Constructs a new EditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); + + /** EditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** EditionDefault value. */ + public value: string; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns EditionDefault instance + */ + public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; + + /** + * Verifies an EditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @param message EditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** EnumOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** EnumOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact. */ + public debugRedact: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|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|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + } + + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { + + /** + * Constructs a new FeatureSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSet); + + /** FeatureSet fieldPresence. */ + public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); + + /** FeatureSet enumType. */ + public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); + + /** FeatureSet repeatedFieldEncoding. */ + public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); + + /** FeatureSet utf8Validation. */ + public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); + + /** FeatureSet messageEncoding. */ + public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); + + /** FeatureSet jsonFormat. */ + public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + + /** + * Creates a new FeatureSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSet instance + */ + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; + + /** + * Verifies a FeatureSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @param message FeatureSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSet { + + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } + + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } + + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } + + /** Utf8Validation enum. */ + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3 + } + + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 + } + + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + } + + /** Properties of a FeatureSetDefaults. */ + interface IFeatureSetDefaults { + + /** FeatureSetDefaults defaults */ + defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); + + /** FeatureSetDefaults minimumEdition */ + minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetDefaults maximumEdition */ + maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSetDefaults. */ + class FeatureSetDefaults implements IFeatureSetDefaults { + + /** + * Constructs a new FeatureSetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSetDefaults); + + /** FeatureSetDefaults defaults. */ + public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; + + /** FeatureSetDefaults minimumEdition. */ + public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetDefaults maximumEdition. */ + public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetDefaults instance + */ + public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; + + /** + * Verifies a FeatureSetDefaults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @param message FeatureSetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSetDefaults { + + /** Properties of a FeatureSetEditionDefault. */ + interface IFeatureSetEditionDefault { + + /** FeatureSetEditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetEditionDefault features */ + features?: (google.protobuf.IFeatureSet|null); + } + + /** Represents a FeatureSetEditionDefault. */ + class FeatureSetEditionDefault implements IFeatureSetEditionDefault { + + /** + * Constructs a new FeatureSetEditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); + + /** FeatureSetEditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetEditionDefault features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetEditionDefault instance + */ + public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Verifies a FeatureSetEditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetEditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @param message FeatureSetEditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of 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 an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|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|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/owl-bot-staging/google-cloud-batch/v1/protos/protos.js b/owl-bot-staging/google-cloud-batch/v1/protos/protos.js new file mode 100644 index 00000000000..6d87f323961 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/protos/protos.js @@ -0,0 +1,35612 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*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_batch_protos || ($protobuf.roots._google_cloud_batch_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.batch = (function() { + + /** + * Namespace batch. + * @memberof google.cloud + * @namespace + */ + var batch = {}; + + batch.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.batch + * @namespace + */ + var v1 = {}; + + v1.BatchService = (function() { + + /** + * Constructs a new BatchService service. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a BatchService + * @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 BatchService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (BatchService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = BatchService; + + /** + * Creates new BatchService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.batch.v1.BatchService + * @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 {BatchService} RPC service. Useful where requests and/or responses are streamed. + */ + BatchService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.batch.v1.BatchService|createJob}. + * @memberof google.cloud.batch.v1.BatchService + * @typedef CreateJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.batch.v1.Job} [response] Job + */ + + /** + * Calls CreateJob. + * @function createJob + * @memberof google.cloud.batch.v1.BatchService + * @instance + * @param {google.cloud.batch.v1.ICreateJobRequest} request CreateJobRequest message or plain object + * @param {google.cloud.batch.v1.BatchService.CreateJobCallback} callback Node-style callback called with the error, if any, and Job + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.createJob = function createJob(request, callback) { + return this.rpcCall(createJob, $root.google.cloud.batch.v1.CreateJobRequest, $root.google.cloud.batch.v1.Job, request, callback); + }, "name", { value: "CreateJob" }); + + /** + * Calls CreateJob. + * @function createJob + * @memberof google.cloud.batch.v1.BatchService + * @instance + * @param {google.cloud.batch.v1.ICreateJobRequest} request CreateJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.batch.v1.BatchService|getJob}. + * @memberof google.cloud.batch.v1.BatchService + * @typedef GetJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.batch.v1.Job} [response] Job + */ + + /** + * Calls GetJob. + * @function getJob + * @memberof google.cloud.batch.v1.BatchService + * @instance + * @param {google.cloud.batch.v1.IGetJobRequest} request GetJobRequest message or plain object + * @param {google.cloud.batch.v1.BatchService.GetJobCallback} callback Node-style callback called with the error, if any, and Job + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.getJob = function getJob(request, callback) { + return this.rpcCall(getJob, $root.google.cloud.batch.v1.GetJobRequest, $root.google.cloud.batch.v1.Job, request, callback); + }, "name", { value: "GetJob" }); + + /** + * Calls GetJob. + * @function getJob + * @memberof google.cloud.batch.v1.BatchService + * @instance + * @param {google.cloud.batch.v1.IGetJobRequest} request GetJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.batch.v1.BatchService|deleteJob}. + * @memberof google.cloud.batch.v1.BatchService + * @typedef DeleteJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteJob. + * @function deleteJob + * @memberof google.cloud.batch.v1.BatchService + * @instance + * @param {google.cloud.batch.v1.IDeleteJobRequest} request DeleteJobRequest message or plain object + * @param {google.cloud.batch.v1.BatchService.DeleteJobCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.deleteJob = function deleteJob(request, callback) { + return this.rpcCall(deleteJob, $root.google.cloud.batch.v1.DeleteJobRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteJob" }); + + /** + * Calls DeleteJob. + * @function deleteJob + * @memberof google.cloud.batch.v1.BatchService + * @instance + * @param {google.cloud.batch.v1.IDeleteJobRequest} request DeleteJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.batch.v1.BatchService|listJobs}. + * @memberof google.cloud.batch.v1.BatchService + * @typedef ListJobsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.batch.v1.ListJobsResponse} [response] ListJobsResponse + */ + + /** + * Calls ListJobs. + * @function listJobs + * @memberof google.cloud.batch.v1.BatchService + * @instance + * @param {google.cloud.batch.v1.IListJobsRequest} request ListJobsRequest message or plain object + * @param {google.cloud.batch.v1.BatchService.ListJobsCallback} callback Node-style callback called with the error, if any, and ListJobsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.listJobs = function listJobs(request, callback) { + return this.rpcCall(listJobs, $root.google.cloud.batch.v1.ListJobsRequest, $root.google.cloud.batch.v1.ListJobsResponse, request, callback); + }, "name", { value: "ListJobs" }); + + /** + * Calls ListJobs. + * @function listJobs + * @memberof google.cloud.batch.v1.BatchService + * @instance + * @param {google.cloud.batch.v1.IListJobsRequest} request ListJobsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.batch.v1.BatchService|getTask}. + * @memberof google.cloud.batch.v1.BatchService + * @typedef GetTaskCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.batch.v1.Task} [response] Task + */ + + /** + * Calls GetTask. + * @function getTask + * @memberof google.cloud.batch.v1.BatchService + * @instance + * @param {google.cloud.batch.v1.IGetTaskRequest} request GetTaskRequest message or plain object + * @param {google.cloud.batch.v1.BatchService.GetTaskCallback} callback Node-style callback called with the error, if any, and Task + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.getTask = function getTask(request, callback) { + return this.rpcCall(getTask, $root.google.cloud.batch.v1.GetTaskRequest, $root.google.cloud.batch.v1.Task, request, callback); + }, "name", { value: "GetTask" }); + + /** + * Calls GetTask. + * @function getTask + * @memberof google.cloud.batch.v1.BatchService + * @instance + * @param {google.cloud.batch.v1.IGetTaskRequest} request GetTaskRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.batch.v1.BatchService|listTasks}. + * @memberof google.cloud.batch.v1.BatchService + * @typedef ListTasksCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.batch.v1.ListTasksResponse} [response] ListTasksResponse + */ + + /** + * Calls ListTasks. + * @function listTasks + * @memberof google.cloud.batch.v1.BatchService + * @instance + * @param {google.cloud.batch.v1.IListTasksRequest} request ListTasksRequest message or plain object + * @param {google.cloud.batch.v1.BatchService.ListTasksCallback} callback Node-style callback called with the error, if any, and ListTasksResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.listTasks = function listTasks(request, callback) { + return this.rpcCall(listTasks, $root.google.cloud.batch.v1.ListTasksRequest, $root.google.cloud.batch.v1.ListTasksResponse, request, callback); + }, "name", { value: "ListTasks" }); + + /** + * Calls ListTasks. + * @function listTasks + * @memberof google.cloud.batch.v1.BatchService + * @instance + * @param {google.cloud.batch.v1.IListTasksRequest} request ListTasksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return BatchService; + })(); + + v1.CreateJobRequest = (function() { + + /** + * Properties of a CreateJobRequest. + * @memberof google.cloud.batch.v1 + * @interface ICreateJobRequest + * @property {string|null} [parent] CreateJobRequest parent + * @property {string|null} [jobId] CreateJobRequest jobId + * @property {google.cloud.batch.v1.IJob|null} [job] CreateJobRequest job + * @property {string|null} [requestId] CreateJobRequest requestId + */ + + /** + * Constructs a new CreateJobRequest. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a CreateJobRequest. + * @implements ICreateJobRequest + * @constructor + * @param {google.cloud.batch.v1.ICreateJobRequest=} [properties] Properties to set + */ + function CreateJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateJobRequest parent. + * @member {string} parent + * @memberof google.cloud.batch.v1.CreateJobRequest + * @instance + */ + CreateJobRequest.prototype.parent = ""; + + /** + * CreateJobRequest jobId. + * @member {string} jobId + * @memberof google.cloud.batch.v1.CreateJobRequest + * @instance + */ + CreateJobRequest.prototype.jobId = ""; + + /** + * CreateJobRequest job. + * @member {google.cloud.batch.v1.IJob|null|undefined} job + * @memberof google.cloud.batch.v1.CreateJobRequest + * @instance + */ + CreateJobRequest.prototype.job = null; + + /** + * CreateJobRequest requestId. + * @member {string} requestId + * @memberof google.cloud.batch.v1.CreateJobRequest + * @instance + */ + CreateJobRequest.prototype.requestId = ""; + + /** + * Creates a new CreateJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.CreateJobRequest + * @static + * @param {google.cloud.batch.v1.ICreateJobRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1.CreateJobRequest} CreateJobRequest instance + */ + CreateJobRequest.create = function create(properties) { + return new CreateJobRequest(properties); + }; + + /** + * Encodes the specified CreateJobRequest message. Does not implicitly {@link google.cloud.batch.v1.CreateJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.CreateJobRequest + * @static + * @param {google.cloud.batch.v1.ICreateJobRequest} message CreateJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.jobId); + if (message.job != null && Object.hasOwnProperty.call(message, "job")) + $root.google.cloud.batch.v1.Job.encode(message.job, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.CreateJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.CreateJobRequest + * @static + * @param {google.cloud.batch.v1.ICreateJobRequest} message CreateJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.CreateJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.CreateJobRequest} CreateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.CreateJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.jobId = reader.string(); + break; + } + case 3: { + message.job = $root.google.cloud.batch.v1.Job.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.CreateJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.CreateJobRequest} CreateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateJobRequest message. + * @function verify + * @memberof google.cloud.batch.v1.CreateJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.jobId != null && message.hasOwnProperty("jobId")) + if (!$util.isString(message.jobId)) + return "jobId: string expected"; + if (message.job != null && message.hasOwnProperty("job")) { + var error = $root.google.cloud.batch.v1.Job.verify(message.job); + if (error) + return "job." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.CreateJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.CreateJobRequest} CreateJobRequest + */ + CreateJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.CreateJobRequest) + return object; + var message = new $root.google.cloud.batch.v1.CreateJobRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.jobId != null) + message.jobId = String(object.jobId); + if (object.job != null) { + if (typeof object.job !== "object") + throw TypeError(".google.cloud.batch.v1.CreateJobRequest.job: object expected"); + message.job = $root.google.cloud.batch.v1.Job.fromObject(object.job); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.CreateJobRequest + * @static + * @param {google.cloud.batch.v1.CreateJobRequest} message CreateJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.jobId = ""; + object.job = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.jobId != null && message.hasOwnProperty("jobId")) + object.jobId = message.jobId; + if (message.job != null && message.hasOwnProperty("job")) + object.job = $root.google.cloud.batch.v1.Job.toObject(message.job, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.CreateJobRequest + * @instance + * @returns {Object.} JSON object + */ + CreateJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateJobRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1.CreateJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.CreateJobRequest"; + }; + + return CreateJobRequest; + })(); + + v1.GetJobRequest = (function() { + + /** + * Properties of a GetJobRequest. + * @memberof google.cloud.batch.v1 + * @interface IGetJobRequest + * @property {string|null} [name] GetJobRequest name + */ + + /** + * Constructs a new GetJobRequest. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a GetJobRequest. + * @implements IGetJobRequest + * @constructor + * @param {google.cloud.batch.v1.IGetJobRequest=} [properties] Properties to set + */ + function GetJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetJobRequest name. + * @member {string} name + * @memberof google.cloud.batch.v1.GetJobRequest + * @instance + */ + GetJobRequest.prototype.name = ""; + + /** + * Creates a new GetJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.GetJobRequest + * @static + * @param {google.cloud.batch.v1.IGetJobRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1.GetJobRequest} GetJobRequest instance + */ + GetJobRequest.create = function create(properties) { + return new GetJobRequest(properties); + }; + + /** + * Encodes the specified GetJobRequest message. Does not implicitly {@link google.cloud.batch.v1.GetJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.GetJobRequest + * @static + * @param {google.cloud.batch.v1.IGetJobRequest} message GetJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetJobRequest.encode = function encode(message, writer) { + 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 GetJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.GetJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.GetJobRequest + * @static + * @param {google.cloud.batch.v1.IGetJobRequest} message GetJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.GetJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.GetJobRequest} GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.GetJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.GetJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.GetJobRequest} GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetJobRequest message. + * @function verify + * @memberof google.cloud.batch.v1.GetJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.GetJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.GetJobRequest} GetJobRequest + */ + GetJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.GetJobRequest) + return object; + var message = new $root.google.cloud.batch.v1.GetJobRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.GetJobRequest + * @static + * @param {google.cloud.batch.v1.GetJobRequest} message GetJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetJobRequest.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 GetJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.GetJobRequest + * @instance + * @returns {Object.} JSON object + */ + GetJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetJobRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1.GetJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.GetJobRequest"; + }; + + return GetJobRequest; + })(); + + v1.DeleteJobRequest = (function() { + + /** + * Properties of a DeleteJobRequest. + * @memberof google.cloud.batch.v1 + * @interface IDeleteJobRequest + * @property {string|null} [name] DeleteJobRequest name + * @property {string|null} [reason] DeleteJobRequest reason + * @property {string|null} [requestId] DeleteJobRequest requestId + */ + + /** + * Constructs a new DeleteJobRequest. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a DeleteJobRequest. + * @implements IDeleteJobRequest + * @constructor + * @param {google.cloud.batch.v1.IDeleteJobRequest=} [properties] Properties to set + */ + function DeleteJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteJobRequest name. + * @member {string} name + * @memberof google.cloud.batch.v1.DeleteJobRequest + * @instance + */ + DeleteJobRequest.prototype.name = ""; + + /** + * DeleteJobRequest reason. + * @member {string} reason + * @memberof google.cloud.batch.v1.DeleteJobRequest + * @instance + */ + DeleteJobRequest.prototype.reason = ""; + + /** + * DeleteJobRequest requestId. + * @member {string} requestId + * @memberof google.cloud.batch.v1.DeleteJobRequest + * @instance + */ + DeleteJobRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.DeleteJobRequest + * @static + * @param {google.cloud.batch.v1.IDeleteJobRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1.DeleteJobRequest} DeleteJobRequest instance + */ + DeleteJobRequest.create = function create(properties) { + return new DeleteJobRequest(properties); + }; + + /** + * Encodes the specified DeleteJobRequest message. Does not implicitly {@link google.cloud.batch.v1.DeleteJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.DeleteJobRequest + * @static + * @param {google.cloud.batch.v1.IDeleteJobRequest} message DeleteJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.reason); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.DeleteJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.DeleteJobRequest + * @static + * @param {google.cloud.batch.v1.IDeleteJobRequest} message DeleteJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.DeleteJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.DeleteJobRequest} DeleteJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.DeleteJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.reason = reader.string(); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.DeleteJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.DeleteJobRequest} DeleteJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteJobRequest message. + * @function verify + * @memberof google.cloud.batch.v1.DeleteJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.reason != null && message.hasOwnProperty("reason")) + if (!$util.isString(message.reason)) + return "reason: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.DeleteJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.DeleteJobRequest} DeleteJobRequest + */ + DeleteJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.DeleteJobRequest) + return object; + var message = new $root.google.cloud.batch.v1.DeleteJobRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.reason != null) + message.reason = String(object.reason); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.DeleteJobRequest + * @static + * @param {google.cloud.batch.v1.DeleteJobRequest} message DeleteJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.reason = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.reason != null && message.hasOwnProperty("reason")) + object.reason = message.reason; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.DeleteJobRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteJobRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1.DeleteJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.DeleteJobRequest"; + }; + + return DeleteJobRequest; + })(); + + v1.ListJobsRequest = (function() { + + /** + * Properties of a ListJobsRequest. + * @memberof google.cloud.batch.v1 + * @interface IListJobsRequest + * @property {string|null} [parent] ListJobsRequest parent + * @property {string|null} [filter] ListJobsRequest filter + * @property {string|null} [orderBy] ListJobsRequest orderBy + * @property {number|null} [pageSize] ListJobsRequest pageSize + * @property {string|null} [pageToken] ListJobsRequest pageToken + */ + + /** + * Constructs a new ListJobsRequest. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a ListJobsRequest. + * @implements IListJobsRequest + * @constructor + * @param {google.cloud.batch.v1.IListJobsRequest=} [properties] Properties to set + */ + function ListJobsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListJobsRequest parent. + * @member {string} parent + * @memberof google.cloud.batch.v1.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.parent = ""; + + /** + * ListJobsRequest filter. + * @member {string} filter + * @memberof google.cloud.batch.v1.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.filter = ""; + + /** + * ListJobsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.batch.v1.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.orderBy = ""; + + /** + * ListJobsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.batch.v1.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.pageSize = 0; + + /** + * ListJobsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.batch.v1.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListJobsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.ListJobsRequest + * @static + * @param {google.cloud.batch.v1.IListJobsRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1.ListJobsRequest} ListJobsRequest instance + */ + ListJobsRequest.create = function create(properties) { + return new ListJobsRequest(properties); + }; + + /** + * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.cloud.batch.v1.ListJobsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.ListJobsRequest + * @static + * @param {google.cloud.batch.v1.IListJobsRequest} message ListJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListJobsRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ListJobsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.ListJobsRequest + * @static + * @param {google.cloud.batch.v1.IListJobsRequest} message ListJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.ListJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.ListJobsRequest} ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.ListJobsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.ListJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.ListJobsRequest} ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListJobsRequest message. + * @function verify + * @memberof google.cloud.batch.v1.ListJobsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListJobsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListJobsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.ListJobsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.ListJobsRequest} ListJobsRequest + */ + ListJobsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.ListJobsRequest) + return object; + var message = new $root.google.cloud.batch.v1.ListJobsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListJobsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.ListJobsRequest + * @static + * @param {google.cloud.batch.v1.ListJobsRequest} message ListJobsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListJobsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListJobsRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.ListJobsRequest + * @instance + * @returns {Object.} JSON object + */ + ListJobsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListJobsRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1.ListJobsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListJobsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.ListJobsRequest"; + }; + + return ListJobsRequest; + })(); + + v1.ListJobsResponse = (function() { + + /** + * Properties of a ListJobsResponse. + * @memberof google.cloud.batch.v1 + * @interface IListJobsResponse + * @property {Array.|null} [jobs] ListJobsResponse jobs + * @property {string|null} [nextPageToken] ListJobsResponse nextPageToken + * @property {Array.|null} [unreachable] ListJobsResponse unreachable + */ + + /** + * Constructs a new ListJobsResponse. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a ListJobsResponse. + * @implements IListJobsResponse + * @constructor + * @param {google.cloud.batch.v1.IListJobsResponse=} [properties] Properties to set + */ + function ListJobsResponse(properties) { + this.jobs = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListJobsResponse jobs. + * @member {Array.} jobs + * @memberof google.cloud.batch.v1.ListJobsResponse + * @instance + */ + ListJobsResponse.prototype.jobs = $util.emptyArray; + + /** + * ListJobsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.batch.v1.ListJobsResponse + * @instance + */ + ListJobsResponse.prototype.nextPageToken = ""; + + /** + * ListJobsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.batch.v1.ListJobsResponse + * @instance + */ + ListJobsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListJobsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.ListJobsResponse + * @static + * @param {google.cloud.batch.v1.IListJobsResponse=} [properties] Properties to set + * @returns {google.cloud.batch.v1.ListJobsResponse} ListJobsResponse instance + */ + ListJobsResponse.create = function create(properties) { + return new ListJobsResponse(properties); + }; + + /** + * Encodes the specified ListJobsResponse message. Does not implicitly {@link google.cloud.batch.v1.ListJobsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.ListJobsResponse + * @static + * @param {google.cloud.batch.v1.IListJobsResponse} message ListJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.jobs != null && message.jobs.length) + for (var i = 0; i < message.jobs.length; ++i) + $root.google.cloud.batch.v1.Job.encode(message.jobs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListJobsResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ListJobsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.ListJobsResponse + * @static + * @param {google.cloud.batch.v1.IListJobsResponse} message ListJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.ListJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.ListJobsResponse} ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.ListJobsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.jobs && message.jobs.length)) + message.jobs = []; + message.jobs.push($root.google.cloud.batch.v1.Job.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.ListJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.ListJobsResponse} ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListJobsResponse message. + * @function verify + * @memberof google.cloud.batch.v1.ListJobsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListJobsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.jobs != null && message.hasOwnProperty("jobs")) { + if (!Array.isArray(message.jobs)) + return "jobs: array expected"; + for (var i = 0; i < message.jobs.length; ++i) { + var error = $root.google.cloud.batch.v1.Job.verify(message.jobs[i]); + if (error) + return "jobs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListJobsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.ListJobsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.ListJobsResponse} ListJobsResponse + */ + ListJobsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.ListJobsResponse) + return object; + var message = new $root.google.cloud.batch.v1.ListJobsResponse(); + if (object.jobs) { + if (!Array.isArray(object.jobs)) + throw TypeError(".google.cloud.batch.v1.ListJobsResponse.jobs: array expected"); + message.jobs = []; + for (var i = 0; i < object.jobs.length; ++i) { + if (typeof object.jobs[i] !== "object") + throw TypeError(".google.cloud.batch.v1.ListJobsResponse.jobs: object expected"); + message.jobs[i] = $root.google.cloud.batch.v1.Job.fromObject(object.jobs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.batch.v1.ListJobsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListJobsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.ListJobsResponse + * @static + * @param {google.cloud.batch.v1.ListJobsResponse} message ListJobsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListJobsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.jobs = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.jobs && message.jobs.length) { + object.jobs = []; + for (var j = 0; j < message.jobs.length; ++j) + object.jobs[j] = $root.google.cloud.batch.v1.Job.toObject(message.jobs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListJobsResponse to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.ListJobsResponse + * @instance + * @returns {Object.} JSON object + */ + ListJobsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListJobsResponse + * @function getTypeUrl + * @memberof google.cloud.batch.v1.ListJobsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListJobsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.ListJobsResponse"; + }; + + return ListJobsResponse; + })(); + + v1.ListTasksRequest = (function() { + + /** + * Properties of a ListTasksRequest. + * @memberof google.cloud.batch.v1 + * @interface IListTasksRequest + * @property {string|null} [parent] ListTasksRequest parent + * @property {string|null} [filter] ListTasksRequest filter + * @property {number|null} [pageSize] ListTasksRequest pageSize + * @property {string|null} [pageToken] ListTasksRequest pageToken + */ + + /** + * Constructs a new ListTasksRequest. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a ListTasksRequest. + * @implements IListTasksRequest + * @constructor + * @param {google.cloud.batch.v1.IListTasksRequest=} [properties] Properties to set + */ + function ListTasksRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTasksRequest parent. + * @member {string} parent + * @memberof google.cloud.batch.v1.ListTasksRequest + * @instance + */ + ListTasksRequest.prototype.parent = ""; + + /** + * ListTasksRequest filter. + * @member {string} filter + * @memberof google.cloud.batch.v1.ListTasksRequest + * @instance + */ + ListTasksRequest.prototype.filter = ""; + + /** + * ListTasksRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.batch.v1.ListTasksRequest + * @instance + */ + ListTasksRequest.prototype.pageSize = 0; + + /** + * ListTasksRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.batch.v1.ListTasksRequest + * @instance + */ + ListTasksRequest.prototype.pageToken = ""; + + /** + * Creates a new ListTasksRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.ListTasksRequest + * @static + * @param {google.cloud.batch.v1.IListTasksRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1.ListTasksRequest} ListTasksRequest instance + */ + ListTasksRequest.create = function create(properties) { + return new ListTasksRequest(properties); + }; + + /** + * Encodes the specified ListTasksRequest message. Does not implicitly {@link google.cloud.batch.v1.ListTasksRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.ListTasksRequest + * @static + * @param {google.cloud.batch.v1.IListTasksRequest} message ListTasksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTasksRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListTasksRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ListTasksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.ListTasksRequest + * @static + * @param {google.cloud.batch.v1.IListTasksRequest} message ListTasksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTasksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTasksRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.ListTasksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.ListTasksRequest} ListTasksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTasksRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.ListTasksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTasksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.ListTasksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.ListTasksRequest} ListTasksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTasksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTasksRequest message. + * @function verify + * @memberof google.cloud.batch.v1.ListTasksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTasksRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListTasksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.ListTasksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.ListTasksRequest} ListTasksRequest + */ + ListTasksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.ListTasksRequest) + return object; + var message = new $root.google.cloud.batch.v1.ListTasksRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListTasksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.ListTasksRequest + * @static + * @param {google.cloud.batch.v1.ListTasksRequest} message ListTasksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTasksRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListTasksRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.ListTasksRequest + * @instance + * @returns {Object.} JSON object + */ + ListTasksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTasksRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1.ListTasksRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTasksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.ListTasksRequest"; + }; + + return ListTasksRequest; + })(); + + v1.ListTasksResponse = (function() { + + /** + * Properties of a ListTasksResponse. + * @memberof google.cloud.batch.v1 + * @interface IListTasksResponse + * @property {Array.|null} [tasks] ListTasksResponse tasks + * @property {string|null} [nextPageToken] ListTasksResponse nextPageToken + * @property {Array.|null} [unreachable] ListTasksResponse unreachable + */ + + /** + * Constructs a new ListTasksResponse. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a ListTasksResponse. + * @implements IListTasksResponse + * @constructor + * @param {google.cloud.batch.v1.IListTasksResponse=} [properties] Properties to set + */ + function ListTasksResponse(properties) { + this.tasks = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTasksResponse tasks. + * @member {Array.} tasks + * @memberof google.cloud.batch.v1.ListTasksResponse + * @instance + */ + ListTasksResponse.prototype.tasks = $util.emptyArray; + + /** + * ListTasksResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.batch.v1.ListTasksResponse + * @instance + */ + ListTasksResponse.prototype.nextPageToken = ""; + + /** + * ListTasksResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.batch.v1.ListTasksResponse + * @instance + */ + ListTasksResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListTasksResponse instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.ListTasksResponse + * @static + * @param {google.cloud.batch.v1.IListTasksResponse=} [properties] Properties to set + * @returns {google.cloud.batch.v1.ListTasksResponse} ListTasksResponse instance + */ + ListTasksResponse.create = function create(properties) { + return new ListTasksResponse(properties); + }; + + /** + * Encodes the specified ListTasksResponse message. Does not implicitly {@link google.cloud.batch.v1.ListTasksResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.ListTasksResponse + * @static + * @param {google.cloud.batch.v1.IListTasksResponse} message ListTasksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTasksResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tasks != null && message.tasks.length) + for (var i = 0; i < message.tasks.length; ++i) + $root.google.cloud.batch.v1.Task.encode(message.tasks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListTasksResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ListTasksResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.ListTasksResponse + * @static + * @param {google.cloud.batch.v1.IListTasksResponse} message ListTasksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTasksResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTasksResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.ListTasksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.ListTasksResponse} ListTasksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTasksResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.ListTasksResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.tasks && message.tasks.length)) + message.tasks = []; + message.tasks.push($root.google.cloud.batch.v1.Task.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTasksResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.ListTasksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.ListTasksResponse} ListTasksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTasksResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTasksResponse message. + * @function verify + * @memberof google.cloud.batch.v1.ListTasksResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTasksResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tasks != null && message.hasOwnProperty("tasks")) { + if (!Array.isArray(message.tasks)) + return "tasks: array expected"; + for (var i = 0; i < message.tasks.length; ++i) { + var error = $root.google.cloud.batch.v1.Task.verify(message.tasks[i]); + if (error) + return "tasks." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListTasksResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.ListTasksResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.ListTasksResponse} ListTasksResponse + */ + ListTasksResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.ListTasksResponse) + return object; + var message = new $root.google.cloud.batch.v1.ListTasksResponse(); + if (object.tasks) { + if (!Array.isArray(object.tasks)) + throw TypeError(".google.cloud.batch.v1.ListTasksResponse.tasks: array expected"); + message.tasks = []; + for (var i = 0; i < object.tasks.length; ++i) { + if (typeof object.tasks[i] !== "object") + throw TypeError(".google.cloud.batch.v1.ListTasksResponse.tasks: object expected"); + message.tasks[i] = $root.google.cloud.batch.v1.Task.fromObject(object.tasks[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.batch.v1.ListTasksResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListTasksResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.ListTasksResponse + * @static + * @param {google.cloud.batch.v1.ListTasksResponse} message ListTasksResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTasksResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.tasks = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.tasks && message.tasks.length) { + object.tasks = []; + for (var j = 0; j < message.tasks.length; ++j) + object.tasks[j] = $root.google.cloud.batch.v1.Task.toObject(message.tasks[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListTasksResponse to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.ListTasksResponse + * @instance + * @returns {Object.} JSON object + */ + ListTasksResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTasksResponse + * @function getTypeUrl + * @memberof google.cloud.batch.v1.ListTasksResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTasksResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.ListTasksResponse"; + }; + + return ListTasksResponse; + })(); + + v1.GetTaskRequest = (function() { + + /** + * Properties of a GetTaskRequest. + * @memberof google.cloud.batch.v1 + * @interface IGetTaskRequest + * @property {string|null} [name] GetTaskRequest name + */ + + /** + * Constructs a new GetTaskRequest. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a GetTaskRequest. + * @implements IGetTaskRequest + * @constructor + * @param {google.cloud.batch.v1.IGetTaskRequest=} [properties] Properties to set + */ + function GetTaskRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTaskRequest name. + * @member {string} name + * @memberof google.cloud.batch.v1.GetTaskRequest + * @instance + */ + GetTaskRequest.prototype.name = ""; + + /** + * Creates a new GetTaskRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.GetTaskRequest + * @static + * @param {google.cloud.batch.v1.IGetTaskRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1.GetTaskRequest} GetTaskRequest instance + */ + GetTaskRequest.create = function create(properties) { + return new GetTaskRequest(properties); + }; + + /** + * Encodes the specified GetTaskRequest message. Does not implicitly {@link google.cloud.batch.v1.GetTaskRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.GetTaskRequest + * @static + * @param {google.cloud.batch.v1.IGetTaskRequest} message GetTaskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTaskRequest.encode = function encode(message, writer) { + 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 GetTaskRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.GetTaskRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.GetTaskRequest + * @static + * @param {google.cloud.batch.v1.IGetTaskRequest} message GetTaskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTaskRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTaskRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.GetTaskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.GetTaskRequest} GetTaskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTaskRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.GetTaskRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTaskRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.GetTaskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.GetTaskRequest} GetTaskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTaskRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTaskRequest message. + * @function verify + * @memberof google.cloud.batch.v1.GetTaskRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTaskRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetTaskRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.GetTaskRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.GetTaskRequest} GetTaskRequest + */ + GetTaskRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.GetTaskRequest) + return object; + var message = new $root.google.cloud.batch.v1.GetTaskRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetTaskRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.GetTaskRequest + * @static + * @param {google.cloud.batch.v1.GetTaskRequest} message GetTaskRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTaskRequest.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 GetTaskRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.GetTaskRequest + * @instance + * @returns {Object.} JSON object + */ + GetTaskRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTaskRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1.GetTaskRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTaskRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.GetTaskRequest"; + }; + + return GetTaskRequest; + })(); + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.batch.v1 + * @interface IOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {string|null} [statusMessage] OperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + * @property {string|null} [apiVersion] OperationMetadata apiVersion + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.batch.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.batch.v1.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.batch.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.batch.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.batch.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.batch.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.batch.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.batch.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.batch.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.OperationMetadata + * @static + * @param {google.cloud.batch.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.batch.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.batch.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.OperationMetadata + * @static + * @param {google.cloud.batch.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, 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.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.batch.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.OperationMetadata + * @static + * @param {google.cloud.batch.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.target = reader.string(); + break; + } + case 4: { + message.verb = reader.string(); + break; + } + case 5: { + message.statusMessage = reader.string(); + break; + } + case 6: { + message.requestedCancellation = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationMetadata message. + * @function verify + * @memberof google.cloud.batch.v1.OperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (typeof message.requestedCancellation !== "boolean") + return "requestedCancellation: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.batch.v1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.batch.v1.OperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.batch.v1.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.OperationMetadata + * @static + * @param {google.cloud.batch.v1.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.target = ""; + object.verb = ""; + object.statusMessage = ""; + object.requestedCancellation = false; + object.apiVersion = ""; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationMetadata + * @function getTypeUrl + * @memberof google.cloud.batch.v1.OperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1.Job = (function() { + + /** + * Properties of a Job. + * @memberof google.cloud.batch.v1 + * @interface IJob + * @property {string|null} [name] Job name + * @property {string|null} [uid] Job uid + * @property {number|Long|null} [priority] Job priority + * @property {Array.|null} [taskGroups] Job taskGroups + * @property {google.cloud.batch.v1.IAllocationPolicy|null} [allocationPolicy] Job allocationPolicy + * @property {Object.|null} [labels] Job labels + * @property {google.cloud.batch.v1.IJobStatus|null} [status] Job status + * @property {google.protobuf.ITimestamp|null} [createTime] Job createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Job updateTime + * @property {google.cloud.batch.v1.ILogsPolicy|null} [logsPolicy] Job logsPolicy + * @property {Array.|null} [notifications] Job notifications + */ + + /** + * Constructs a new Job. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a Job. + * @implements IJob + * @constructor + * @param {google.cloud.batch.v1.IJob=} [properties] Properties to set + */ + function Job(properties) { + this.taskGroups = []; + this.labels = {}; + this.notifications = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Job name. + * @member {string} name + * @memberof google.cloud.batch.v1.Job + * @instance + */ + Job.prototype.name = ""; + + /** + * Job uid. + * @member {string} uid + * @memberof google.cloud.batch.v1.Job + * @instance + */ + Job.prototype.uid = ""; + + /** + * Job priority. + * @member {number|Long} priority + * @memberof google.cloud.batch.v1.Job + * @instance + */ + Job.prototype.priority = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Job taskGroups. + * @member {Array.} taskGroups + * @memberof google.cloud.batch.v1.Job + * @instance + */ + Job.prototype.taskGroups = $util.emptyArray; + + /** + * Job allocationPolicy. + * @member {google.cloud.batch.v1.IAllocationPolicy|null|undefined} allocationPolicy + * @memberof google.cloud.batch.v1.Job + * @instance + */ + Job.prototype.allocationPolicy = null; + + /** + * Job labels. + * @member {Object.} labels + * @memberof google.cloud.batch.v1.Job + * @instance + */ + Job.prototype.labels = $util.emptyObject; + + /** + * Job status. + * @member {google.cloud.batch.v1.IJobStatus|null|undefined} status + * @memberof google.cloud.batch.v1.Job + * @instance + */ + Job.prototype.status = null; + + /** + * Job createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.batch.v1.Job + * @instance + */ + Job.prototype.createTime = null; + + /** + * Job updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.batch.v1.Job + * @instance + */ + Job.prototype.updateTime = null; + + /** + * Job logsPolicy. + * @member {google.cloud.batch.v1.ILogsPolicy|null|undefined} logsPolicy + * @memberof google.cloud.batch.v1.Job + * @instance + */ + Job.prototype.logsPolicy = null; + + /** + * Job notifications. + * @member {Array.} notifications + * @memberof google.cloud.batch.v1.Job + * @instance + */ + Job.prototype.notifications = $util.emptyArray; + + /** + * Creates a new Job instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.Job + * @static + * @param {google.cloud.batch.v1.IJob=} [properties] Properties to set + * @returns {google.cloud.batch.v1.Job} Job instance + */ + Job.create = function create(properties) { + return new Job(properties); + }; + + /** + * Encodes the specified Job message. Does not implicitly {@link google.cloud.batch.v1.Job.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.Job + * @static + * @param {google.cloud.batch.v1.IJob} message Job message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Job.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.priority); + if (message.taskGroups != null && message.taskGroups.length) + for (var i = 0; i < message.taskGroups.length; ++i) + $root.google.cloud.batch.v1.TaskGroup.encode(message.taskGroups[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.allocationPolicy != null && Object.hasOwnProperty.call(message, "allocationPolicy")) + $root.google.cloud.batch.v1.AllocationPolicy.encode(message.allocationPolicy, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.cloud.batch.v1.JobStatus.encode(message.status, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.logsPolicy != null && Object.hasOwnProperty.call(message, "logsPolicy")) + $root.google.cloud.batch.v1.LogsPolicy.encode(message.logsPolicy, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.notifications != null && message.notifications.length) + for (var i = 0; i < message.notifications.length; ++i) + $root.google.cloud.batch.v1.JobNotification.encode(message.notifications[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Job.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.Job + * @static + * @param {google.cloud.batch.v1.IJob} message Job message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Job.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Job message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.Job + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.Job} Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Job.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Job(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.uid = reader.string(); + break; + } + case 3: { + message.priority = reader.int64(); + break; + } + case 4: { + if (!(message.taskGroups && message.taskGroups.length)) + message.taskGroups = []; + message.taskGroups.push($root.google.cloud.batch.v1.TaskGroup.decode(reader, reader.uint32())); + break; + } + case 7: { + message.allocationPolicy = $root.google.cloud.batch.v1.AllocationPolicy.decode(reader, reader.uint32()); + break; + } + case 8: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 9: { + message.status = $root.google.cloud.batch.v1.JobStatus.decode(reader, reader.uint32()); + break; + } + case 11: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 12: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 13: { + message.logsPolicy = $root.google.cloud.batch.v1.LogsPolicy.decode(reader, reader.uint32()); + break; + } + case 14: { + if (!(message.notifications && message.notifications.length)) + message.notifications = []; + message.notifications.push($root.google.cloud.batch.v1.JobNotification.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Job message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.Job + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.Job} Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Job.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Job message. + * @function verify + * @memberof google.cloud.batch.v1.Job + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Job.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.priority != null && message.hasOwnProperty("priority")) + if (!$util.isInteger(message.priority) && !(message.priority && $util.isInteger(message.priority.low) && $util.isInteger(message.priority.high))) + return "priority: integer|Long expected"; + if (message.taskGroups != null && message.hasOwnProperty("taskGroups")) { + if (!Array.isArray(message.taskGroups)) + return "taskGroups: array expected"; + for (var i = 0; i < message.taskGroups.length; ++i) { + var error = $root.google.cloud.batch.v1.TaskGroup.verify(message.taskGroups[i]); + if (error) + return "taskGroups." + error; + } + } + if (message.allocationPolicy != null && message.hasOwnProperty("allocationPolicy")) { + var error = $root.google.cloud.batch.v1.AllocationPolicy.verify(message.allocationPolicy); + if (error) + return "allocationPolicy." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.cloud.batch.v1.JobStatus.verify(message.status); + if (error) + return "status." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.logsPolicy != null && message.hasOwnProperty("logsPolicy")) { + var error = $root.google.cloud.batch.v1.LogsPolicy.verify(message.logsPolicy); + if (error) + return "logsPolicy." + error; + } + if (message.notifications != null && message.hasOwnProperty("notifications")) { + if (!Array.isArray(message.notifications)) + return "notifications: array expected"; + for (var i = 0; i < message.notifications.length; ++i) { + var error = $root.google.cloud.batch.v1.JobNotification.verify(message.notifications[i]); + if (error) + return "notifications." + error; + } + } + return null; + }; + + /** + * Creates a Job message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.Job + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.Job} Job + */ + Job.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.Job) + return object; + var message = new $root.google.cloud.batch.v1.Job(); + if (object.name != null) + message.name = String(object.name); + if (object.uid != null) + message.uid = String(object.uid); + if (object.priority != null) + if ($util.Long) + (message.priority = $util.Long.fromValue(object.priority)).unsigned = false; + else if (typeof object.priority === "string") + message.priority = parseInt(object.priority, 10); + else if (typeof object.priority === "number") + message.priority = object.priority; + else if (typeof object.priority === "object") + message.priority = new $util.LongBits(object.priority.low >>> 0, object.priority.high >>> 0).toNumber(); + if (object.taskGroups) { + if (!Array.isArray(object.taskGroups)) + throw TypeError(".google.cloud.batch.v1.Job.taskGroups: array expected"); + message.taskGroups = []; + for (var i = 0; i < object.taskGroups.length; ++i) { + if (typeof object.taskGroups[i] !== "object") + throw TypeError(".google.cloud.batch.v1.Job.taskGroups: object expected"); + message.taskGroups[i] = $root.google.cloud.batch.v1.TaskGroup.fromObject(object.taskGroups[i]); + } + } + if (object.allocationPolicy != null) { + if (typeof object.allocationPolicy !== "object") + throw TypeError(".google.cloud.batch.v1.Job.allocationPolicy: object expected"); + message.allocationPolicy = $root.google.cloud.batch.v1.AllocationPolicy.fromObject(object.allocationPolicy); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.batch.v1.Job.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.batch.v1.Job.status: object expected"); + message.status = $root.google.cloud.batch.v1.JobStatus.fromObject(object.status); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.batch.v1.Job.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.batch.v1.Job.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.logsPolicy != null) { + if (typeof object.logsPolicy !== "object") + throw TypeError(".google.cloud.batch.v1.Job.logsPolicy: object expected"); + message.logsPolicy = $root.google.cloud.batch.v1.LogsPolicy.fromObject(object.logsPolicy); + } + if (object.notifications) { + if (!Array.isArray(object.notifications)) + throw TypeError(".google.cloud.batch.v1.Job.notifications: array expected"); + message.notifications = []; + for (var i = 0; i < object.notifications.length; ++i) { + if (typeof object.notifications[i] !== "object") + throw TypeError(".google.cloud.batch.v1.Job.notifications: object expected"); + message.notifications[i] = $root.google.cloud.batch.v1.JobNotification.fromObject(object.notifications[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Job message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.Job + * @static + * @param {google.cloud.batch.v1.Job} message Job + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Job.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.taskGroups = []; + object.notifications = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.uid = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.priority = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.priority = options.longs === String ? "0" : 0; + object.allocationPolicy = null; + object.status = null; + object.createTime = null; + object.updateTime = null; + object.logsPolicy = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.priority != null && message.hasOwnProperty("priority")) + if (typeof message.priority === "number") + object.priority = options.longs === String ? String(message.priority) : message.priority; + else + object.priority = options.longs === String ? $util.Long.prototype.toString.call(message.priority) : options.longs === Number ? new $util.LongBits(message.priority.low >>> 0, message.priority.high >>> 0).toNumber() : message.priority; + if (message.taskGroups && message.taskGroups.length) { + object.taskGroups = []; + for (var j = 0; j < message.taskGroups.length; ++j) + object.taskGroups[j] = $root.google.cloud.batch.v1.TaskGroup.toObject(message.taskGroups[j], options); + } + if (message.allocationPolicy != null && message.hasOwnProperty("allocationPolicy")) + object.allocationPolicy = $root.google.cloud.batch.v1.AllocationPolicy.toObject(message.allocationPolicy, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.cloud.batch.v1.JobStatus.toObject(message.status, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.logsPolicy != null && message.hasOwnProperty("logsPolicy")) + object.logsPolicy = $root.google.cloud.batch.v1.LogsPolicy.toObject(message.logsPolicy, options); + if (message.notifications && message.notifications.length) { + object.notifications = []; + for (var j = 0; j < message.notifications.length; ++j) + object.notifications[j] = $root.google.cloud.batch.v1.JobNotification.toObject(message.notifications[j], options); + } + return object; + }; + + /** + * Converts this Job to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.Job + * @instance + * @returns {Object.} JSON object + */ + Job.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Job + * @function getTypeUrl + * @memberof google.cloud.batch.v1.Job + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Job.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.Job"; + }; + + return Job; + })(); + + v1.LogsPolicy = (function() { + + /** + * Properties of a LogsPolicy. + * @memberof google.cloud.batch.v1 + * @interface ILogsPolicy + * @property {google.cloud.batch.v1.LogsPolicy.Destination|null} [destination] LogsPolicy destination + * @property {string|null} [logsPath] LogsPolicy logsPath + * @property {google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption|null} [cloudLoggingOption] LogsPolicy cloudLoggingOption + */ + + /** + * Constructs a new LogsPolicy. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a LogsPolicy. + * @implements ILogsPolicy + * @constructor + * @param {google.cloud.batch.v1.ILogsPolicy=} [properties] Properties to set + */ + function LogsPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LogsPolicy destination. + * @member {google.cloud.batch.v1.LogsPolicy.Destination} destination + * @memberof google.cloud.batch.v1.LogsPolicy + * @instance + */ + LogsPolicy.prototype.destination = 0; + + /** + * LogsPolicy logsPath. + * @member {string} logsPath + * @memberof google.cloud.batch.v1.LogsPolicy + * @instance + */ + LogsPolicy.prototype.logsPath = ""; + + /** + * LogsPolicy cloudLoggingOption. + * @member {google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption|null|undefined} cloudLoggingOption + * @memberof google.cloud.batch.v1.LogsPolicy + * @instance + */ + LogsPolicy.prototype.cloudLoggingOption = null; + + /** + * Creates a new LogsPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.LogsPolicy + * @static + * @param {google.cloud.batch.v1.ILogsPolicy=} [properties] Properties to set + * @returns {google.cloud.batch.v1.LogsPolicy} LogsPolicy instance + */ + LogsPolicy.create = function create(properties) { + return new LogsPolicy(properties); + }; + + /** + * Encodes the specified LogsPolicy message. Does not implicitly {@link google.cloud.batch.v1.LogsPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.LogsPolicy + * @static + * @param {google.cloud.batch.v1.ILogsPolicy} message LogsPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogsPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.destination); + if (message.logsPath != null && Object.hasOwnProperty.call(message, "logsPath")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.logsPath); + if (message.cloudLoggingOption != null && Object.hasOwnProperty.call(message, "cloudLoggingOption")) + $root.google.cloud.batch.v1.LogsPolicy.CloudLoggingOption.encode(message.cloudLoggingOption, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LogsPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.LogsPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.LogsPolicy + * @static + * @param {google.cloud.batch.v1.ILogsPolicy} message LogsPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogsPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LogsPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.LogsPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.LogsPolicy} LogsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogsPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.LogsPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.destination = reader.int32(); + break; + } + case 2: { + message.logsPath = reader.string(); + break; + } + case 3: { + message.cloudLoggingOption = $root.google.cloud.batch.v1.LogsPolicy.CloudLoggingOption.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LogsPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.LogsPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.LogsPolicy} LogsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogsPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LogsPolicy message. + * @function verify + * @memberof google.cloud.batch.v1.LogsPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LogsPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.destination != null && message.hasOwnProperty("destination")) + switch (message.destination) { + default: + return "destination: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.logsPath != null && message.hasOwnProperty("logsPath")) + if (!$util.isString(message.logsPath)) + return "logsPath: string expected"; + if (message.cloudLoggingOption != null && message.hasOwnProperty("cloudLoggingOption")) { + var error = $root.google.cloud.batch.v1.LogsPolicy.CloudLoggingOption.verify(message.cloudLoggingOption); + if (error) + return "cloudLoggingOption." + error; + } + return null; + }; + + /** + * Creates a LogsPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.LogsPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.LogsPolicy} LogsPolicy + */ + LogsPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.LogsPolicy) + return object; + var message = new $root.google.cloud.batch.v1.LogsPolicy(); + switch (object.destination) { + default: + if (typeof object.destination === "number") { + message.destination = object.destination; + break; + } + break; + case "DESTINATION_UNSPECIFIED": + case 0: + message.destination = 0; + break; + case "CLOUD_LOGGING": + case 1: + message.destination = 1; + break; + case "PATH": + case 2: + message.destination = 2; + break; + } + if (object.logsPath != null) + message.logsPath = String(object.logsPath); + if (object.cloudLoggingOption != null) { + if (typeof object.cloudLoggingOption !== "object") + throw TypeError(".google.cloud.batch.v1.LogsPolicy.cloudLoggingOption: object expected"); + message.cloudLoggingOption = $root.google.cloud.batch.v1.LogsPolicy.CloudLoggingOption.fromObject(object.cloudLoggingOption); + } + return message; + }; + + /** + * Creates a plain object from a LogsPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.LogsPolicy + * @static + * @param {google.cloud.batch.v1.LogsPolicy} message LogsPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LogsPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.destination = options.enums === String ? "DESTINATION_UNSPECIFIED" : 0; + object.logsPath = ""; + object.cloudLoggingOption = null; + } + if (message.destination != null && message.hasOwnProperty("destination")) + object.destination = options.enums === String ? $root.google.cloud.batch.v1.LogsPolicy.Destination[message.destination] === undefined ? message.destination : $root.google.cloud.batch.v1.LogsPolicy.Destination[message.destination] : message.destination; + if (message.logsPath != null && message.hasOwnProperty("logsPath")) + object.logsPath = message.logsPath; + if (message.cloudLoggingOption != null && message.hasOwnProperty("cloudLoggingOption")) + object.cloudLoggingOption = $root.google.cloud.batch.v1.LogsPolicy.CloudLoggingOption.toObject(message.cloudLoggingOption, options); + return object; + }; + + /** + * Converts this LogsPolicy to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.LogsPolicy + * @instance + * @returns {Object.} JSON object + */ + LogsPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LogsPolicy + * @function getTypeUrl + * @memberof google.cloud.batch.v1.LogsPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LogsPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.LogsPolicy"; + }; + + LogsPolicy.CloudLoggingOption = (function() { + + /** + * Properties of a CloudLoggingOption. + * @memberof google.cloud.batch.v1.LogsPolicy + * @interface ICloudLoggingOption + * @property {boolean|null} [useGenericTaskMonitoredResource] CloudLoggingOption useGenericTaskMonitoredResource + */ + + /** + * Constructs a new CloudLoggingOption. + * @memberof google.cloud.batch.v1.LogsPolicy + * @classdesc Represents a CloudLoggingOption. + * @implements ICloudLoggingOption + * @constructor + * @param {google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption=} [properties] Properties to set + */ + function CloudLoggingOption(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudLoggingOption useGenericTaskMonitoredResource. + * @member {boolean} useGenericTaskMonitoredResource + * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption + * @instance + */ + CloudLoggingOption.prototype.useGenericTaskMonitoredResource = false; + + /** + * Creates a new CloudLoggingOption instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption + * @static + * @param {google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption=} [properties] Properties to set + * @returns {google.cloud.batch.v1.LogsPolicy.CloudLoggingOption} CloudLoggingOption instance + */ + CloudLoggingOption.create = function create(properties) { + return new CloudLoggingOption(properties); + }; + + /** + * Encodes the specified CloudLoggingOption message. Does not implicitly {@link google.cloud.batch.v1.LogsPolicy.CloudLoggingOption.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption + * @static + * @param {google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption} message CloudLoggingOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudLoggingOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.useGenericTaskMonitoredResource != null && Object.hasOwnProperty.call(message, "useGenericTaskMonitoredResource")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.useGenericTaskMonitoredResource); + return writer; + }; + + /** + * Encodes the specified CloudLoggingOption message, length delimited. Does not implicitly {@link google.cloud.batch.v1.LogsPolicy.CloudLoggingOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption + * @static + * @param {google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption} message CloudLoggingOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudLoggingOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudLoggingOption message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.LogsPolicy.CloudLoggingOption} CloudLoggingOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudLoggingOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.LogsPolicy.CloudLoggingOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.useGenericTaskMonitoredResource = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudLoggingOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.LogsPolicy.CloudLoggingOption} CloudLoggingOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudLoggingOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudLoggingOption message. + * @function verify + * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudLoggingOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.useGenericTaskMonitoredResource != null && message.hasOwnProperty("useGenericTaskMonitoredResource")) + if (typeof message.useGenericTaskMonitoredResource !== "boolean") + return "useGenericTaskMonitoredResource: boolean expected"; + return null; + }; + + /** + * Creates a CloudLoggingOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.LogsPolicy.CloudLoggingOption} CloudLoggingOption + */ + CloudLoggingOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.LogsPolicy.CloudLoggingOption) + return object; + var message = new $root.google.cloud.batch.v1.LogsPolicy.CloudLoggingOption(); + if (object.useGenericTaskMonitoredResource != null) + message.useGenericTaskMonitoredResource = Boolean(object.useGenericTaskMonitoredResource); + return message; + }; + + /** + * Creates a plain object from a CloudLoggingOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption + * @static + * @param {google.cloud.batch.v1.LogsPolicy.CloudLoggingOption} message CloudLoggingOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudLoggingOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.useGenericTaskMonitoredResource = false; + if (message.useGenericTaskMonitoredResource != null && message.hasOwnProperty("useGenericTaskMonitoredResource")) + object.useGenericTaskMonitoredResource = message.useGenericTaskMonitoredResource; + return object; + }; + + /** + * Converts this CloudLoggingOption to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption + * @instance + * @returns {Object.} JSON object + */ + CloudLoggingOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudLoggingOption + * @function getTypeUrl + * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudLoggingOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.LogsPolicy.CloudLoggingOption"; + }; + + return CloudLoggingOption; + })(); + + /** + * Destination enum. + * @name google.cloud.batch.v1.LogsPolicy.Destination + * @enum {number} + * @property {number} DESTINATION_UNSPECIFIED=0 DESTINATION_UNSPECIFIED value + * @property {number} CLOUD_LOGGING=1 CLOUD_LOGGING value + * @property {number} PATH=2 PATH value + */ + LogsPolicy.Destination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD_LOGGING"] = 1; + values[valuesById[2] = "PATH"] = 2; + return values; + })(); + + return LogsPolicy; + })(); + + v1.JobStatus = (function() { + + /** + * Properties of a JobStatus. + * @memberof google.cloud.batch.v1 + * @interface IJobStatus + * @property {google.cloud.batch.v1.JobStatus.State|null} [state] JobStatus state + * @property {Array.|null} [statusEvents] JobStatus statusEvents + * @property {Object.|null} [taskGroups] JobStatus taskGroups + * @property {google.protobuf.IDuration|null} [runDuration] JobStatus runDuration + */ + + /** + * Constructs a new JobStatus. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a JobStatus. + * @implements IJobStatus + * @constructor + * @param {google.cloud.batch.v1.IJobStatus=} [properties] Properties to set + */ + function JobStatus(properties) { + this.statusEvents = []; + this.taskGroups = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobStatus state. + * @member {google.cloud.batch.v1.JobStatus.State} state + * @memberof google.cloud.batch.v1.JobStatus + * @instance + */ + JobStatus.prototype.state = 0; + + /** + * JobStatus statusEvents. + * @member {Array.} statusEvents + * @memberof google.cloud.batch.v1.JobStatus + * @instance + */ + JobStatus.prototype.statusEvents = $util.emptyArray; + + /** + * JobStatus taskGroups. + * @member {Object.} taskGroups + * @memberof google.cloud.batch.v1.JobStatus + * @instance + */ + JobStatus.prototype.taskGroups = $util.emptyObject; + + /** + * JobStatus runDuration. + * @member {google.protobuf.IDuration|null|undefined} runDuration + * @memberof google.cloud.batch.v1.JobStatus + * @instance + */ + JobStatus.prototype.runDuration = null; + + /** + * Creates a new JobStatus instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.JobStatus + * @static + * @param {google.cloud.batch.v1.IJobStatus=} [properties] Properties to set + * @returns {google.cloud.batch.v1.JobStatus} JobStatus instance + */ + JobStatus.create = function create(properties) { + return new JobStatus(properties); + }; + + /** + * Encodes the specified JobStatus message. Does not implicitly {@link google.cloud.batch.v1.JobStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.JobStatus + * @static + * @param {google.cloud.batch.v1.IJobStatus} message JobStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobStatus.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); + if (message.statusEvents != null && message.statusEvents.length) + for (var i = 0; i < message.statusEvents.length; ++i) + $root.google.cloud.batch.v1.StatusEvent.encode(message.statusEvents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.taskGroups != null && Object.hasOwnProperty.call(message, "taskGroups")) + for (var keys = Object.keys(message.taskGroups), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.batch.v1.JobStatus.TaskGroupStatus.encode(message.taskGroups[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.runDuration != null && Object.hasOwnProperty.call(message, "runDuration")) + $root.google.protobuf.Duration.encode(message.runDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JobStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.JobStatus + * @static + * @param {google.cloud.batch.v1.IJobStatus} message JobStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JobStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.JobStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.JobStatus} JobStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.JobStatus(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + if (!(message.statusEvents && message.statusEvents.length)) + message.statusEvents = []; + message.statusEvents.push($root.google.cloud.batch.v1.StatusEvent.decode(reader, reader.uint32())); + break; + } + case 4: { + if (message.taskGroups === $util.emptyObject) + message.taskGroups = {}; + 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.cloud.batch.v1.JobStatus.TaskGroupStatus.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.taskGroups[key] = value; + break; + } + case 5: { + message.runDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JobStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.JobStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.JobStatus} JobStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobStatus message. + * @function verify + * @memberof google.cloud.batch.v1.JobStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.statusEvents != null && message.hasOwnProperty("statusEvents")) { + if (!Array.isArray(message.statusEvents)) + return "statusEvents: array expected"; + for (var i = 0; i < message.statusEvents.length; ++i) { + var error = $root.google.cloud.batch.v1.StatusEvent.verify(message.statusEvents[i]); + if (error) + return "statusEvents." + error; + } + } + if (message.taskGroups != null && message.hasOwnProperty("taskGroups")) { + if (!$util.isObject(message.taskGroups)) + return "taskGroups: object expected"; + var key = Object.keys(message.taskGroups); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.batch.v1.JobStatus.TaskGroupStatus.verify(message.taskGroups[key[i]]); + if (error) + return "taskGroups." + error; + } + } + if (message.runDuration != null && message.hasOwnProperty("runDuration")) { + var error = $root.google.protobuf.Duration.verify(message.runDuration); + if (error) + return "runDuration." + error; + } + return null; + }; + + /** + * Creates a JobStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.JobStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.JobStatus} JobStatus + */ + JobStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.JobStatus) + return object; + var message = new $root.google.cloud.batch.v1.JobStatus(); + 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 "QUEUED": + case 1: + message.state = 1; + break; + case "SCHEDULED": + case 2: + message.state = 2; + break; + case "RUNNING": + case 3: + message.state = 3; + break; + case "SUCCEEDED": + case 4: + message.state = 4; + break; + case "FAILED": + case 5: + message.state = 5; + break; + case "DELETION_IN_PROGRESS": + case 6: + message.state = 6; + break; + } + if (object.statusEvents) { + if (!Array.isArray(object.statusEvents)) + throw TypeError(".google.cloud.batch.v1.JobStatus.statusEvents: array expected"); + message.statusEvents = []; + for (var i = 0; i < object.statusEvents.length; ++i) { + if (typeof object.statusEvents[i] !== "object") + throw TypeError(".google.cloud.batch.v1.JobStatus.statusEvents: object expected"); + message.statusEvents[i] = $root.google.cloud.batch.v1.StatusEvent.fromObject(object.statusEvents[i]); + } + } + if (object.taskGroups) { + if (typeof object.taskGroups !== "object") + throw TypeError(".google.cloud.batch.v1.JobStatus.taskGroups: object expected"); + message.taskGroups = {}; + for (var keys = Object.keys(object.taskGroups), i = 0; i < keys.length; ++i) { + if (typeof object.taskGroups[keys[i]] !== "object") + throw TypeError(".google.cloud.batch.v1.JobStatus.taskGroups: object expected"); + message.taskGroups[keys[i]] = $root.google.cloud.batch.v1.JobStatus.TaskGroupStatus.fromObject(object.taskGroups[keys[i]]); + } + } + if (object.runDuration != null) { + if (typeof object.runDuration !== "object") + throw TypeError(".google.cloud.batch.v1.JobStatus.runDuration: object expected"); + message.runDuration = $root.google.protobuf.Duration.fromObject(object.runDuration); + } + return message; + }; + + /** + * Creates a plain object from a JobStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.JobStatus + * @static + * @param {google.cloud.batch.v1.JobStatus} message JobStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.statusEvents = []; + if (options.objects || options.defaults) + object.taskGroups = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.runDuration = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.batch.v1.JobStatus.State[message.state] === undefined ? message.state : $root.google.cloud.batch.v1.JobStatus.State[message.state] : message.state; + if (message.statusEvents && message.statusEvents.length) { + object.statusEvents = []; + for (var j = 0; j < message.statusEvents.length; ++j) + object.statusEvents[j] = $root.google.cloud.batch.v1.StatusEvent.toObject(message.statusEvents[j], options); + } + var keys2; + if (message.taskGroups && (keys2 = Object.keys(message.taskGroups)).length) { + object.taskGroups = {}; + for (var j = 0; j < keys2.length; ++j) + object.taskGroups[keys2[j]] = $root.google.cloud.batch.v1.JobStatus.TaskGroupStatus.toObject(message.taskGroups[keys2[j]], options); + } + if (message.runDuration != null && message.hasOwnProperty("runDuration")) + object.runDuration = $root.google.protobuf.Duration.toObject(message.runDuration, options); + return object; + }; + + /** + * Converts this JobStatus to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.JobStatus + * @instance + * @returns {Object.} JSON object + */ + JobStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobStatus + * @function getTypeUrl + * @memberof google.cloud.batch.v1.JobStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.JobStatus"; + }; + + JobStatus.InstanceStatus = (function() { + + /** + * Properties of an InstanceStatus. + * @memberof google.cloud.batch.v1.JobStatus + * @interface IInstanceStatus + * @property {string|null} [machineType] InstanceStatus machineType + * @property {google.cloud.batch.v1.AllocationPolicy.ProvisioningModel|null} [provisioningModel] InstanceStatus provisioningModel + * @property {number|Long|null} [taskPack] InstanceStatus taskPack + * @property {google.cloud.batch.v1.AllocationPolicy.IDisk|null} [bootDisk] InstanceStatus bootDisk + */ + + /** + * Constructs a new InstanceStatus. + * @memberof google.cloud.batch.v1.JobStatus + * @classdesc Represents an InstanceStatus. + * @implements IInstanceStatus + * @constructor + * @param {google.cloud.batch.v1.JobStatus.IInstanceStatus=} [properties] Properties to set + */ + function InstanceStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceStatus machineType. + * @member {string} machineType + * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus + * @instance + */ + InstanceStatus.prototype.machineType = ""; + + /** + * InstanceStatus provisioningModel. + * @member {google.cloud.batch.v1.AllocationPolicy.ProvisioningModel} provisioningModel + * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus + * @instance + */ + InstanceStatus.prototype.provisioningModel = 0; + + /** + * InstanceStatus taskPack. + * @member {number|Long} taskPack + * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus + * @instance + */ + InstanceStatus.prototype.taskPack = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * InstanceStatus bootDisk. + * @member {google.cloud.batch.v1.AllocationPolicy.IDisk|null|undefined} bootDisk + * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus + * @instance + */ + InstanceStatus.prototype.bootDisk = null; + + /** + * Creates a new InstanceStatus instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus + * @static + * @param {google.cloud.batch.v1.JobStatus.IInstanceStatus=} [properties] Properties to set + * @returns {google.cloud.batch.v1.JobStatus.InstanceStatus} InstanceStatus instance + */ + InstanceStatus.create = function create(properties) { + return new InstanceStatus(properties); + }; + + /** + * Encodes the specified InstanceStatus message. Does not implicitly {@link google.cloud.batch.v1.JobStatus.InstanceStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus + * @static + * @param {google.cloud.batch.v1.JobStatus.IInstanceStatus} message InstanceStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.machineType); + if (message.provisioningModel != null && Object.hasOwnProperty.call(message, "provisioningModel")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.provisioningModel); + if (message.taskPack != null && Object.hasOwnProperty.call(message, "taskPack")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.taskPack); + if (message.bootDisk != null && Object.hasOwnProperty.call(message, "bootDisk")) + $root.google.cloud.batch.v1.AllocationPolicy.Disk.encode(message.bootDisk, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstanceStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobStatus.InstanceStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus + * @static + * @param {google.cloud.batch.v1.JobStatus.IInstanceStatus} message InstanceStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.JobStatus.InstanceStatus} InstanceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.JobStatus.InstanceStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.machineType = reader.string(); + break; + } + case 2: { + message.provisioningModel = reader.int32(); + break; + } + case 3: { + message.taskPack = reader.int64(); + break; + } + case 4: { + message.bootDisk = $root.google.cloud.batch.v1.AllocationPolicy.Disk.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.JobStatus.InstanceStatus} InstanceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceStatus message. + * @function verify + * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.machineType != null && message.hasOwnProperty("machineType")) + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) + switch (message.provisioningModel) { + default: + return "provisioningModel: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.taskPack != null && message.hasOwnProperty("taskPack")) + if (!$util.isInteger(message.taskPack) && !(message.taskPack && $util.isInteger(message.taskPack.low) && $util.isInteger(message.taskPack.high))) + return "taskPack: integer|Long expected"; + if (message.bootDisk != null && message.hasOwnProperty("bootDisk")) { + var error = $root.google.cloud.batch.v1.AllocationPolicy.Disk.verify(message.bootDisk); + if (error) + return "bootDisk." + error; + } + return null; + }; + + /** + * Creates an InstanceStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.JobStatus.InstanceStatus} InstanceStatus + */ + InstanceStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.JobStatus.InstanceStatus) + return object; + var message = new $root.google.cloud.batch.v1.JobStatus.InstanceStatus(); + if (object.machineType != null) + message.machineType = String(object.machineType); + switch (object.provisioningModel) { + default: + if (typeof object.provisioningModel === "number") { + message.provisioningModel = object.provisioningModel; + break; + } + break; + case "PROVISIONING_MODEL_UNSPECIFIED": + case 0: + message.provisioningModel = 0; + break; + case "STANDARD": + case 1: + message.provisioningModel = 1; + break; + case "SPOT": + case 2: + message.provisioningModel = 2; + break; + case "PREEMPTIBLE": + case 3: + message.provisioningModel = 3; + break; + } + if (object.taskPack != null) + if ($util.Long) + (message.taskPack = $util.Long.fromValue(object.taskPack)).unsigned = false; + else if (typeof object.taskPack === "string") + message.taskPack = parseInt(object.taskPack, 10); + else if (typeof object.taskPack === "number") + message.taskPack = object.taskPack; + else if (typeof object.taskPack === "object") + message.taskPack = new $util.LongBits(object.taskPack.low >>> 0, object.taskPack.high >>> 0).toNumber(); + if (object.bootDisk != null) { + if (typeof object.bootDisk !== "object") + throw TypeError(".google.cloud.batch.v1.JobStatus.InstanceStatus.bootDisk: object expected"); + message.bootDisk = $root.google.cloud.batch.v1.AllocationPolicy.Disk.fromObject(object.bootDisk); + } + return message; + }; + + /** + * Creates a plain object from an InstanceStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus + * @static + * @param {google.cloud.batch.v1.JobStatus.InstanceStatus} message InstanceStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.machineType = ""; + object.provisioningModel = options.enums === String ? "PROVISIONING_MODEL_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.taskPack = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.taskPack = options.longs === String ? "0" : 0; + object.bootDisk = null; + } + if (message.machineType != null && message.hasOwnProperty("machineType")) + object.machineType = message.machineType; + if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) + object.provisioningModel = options.enums === String ? $root.google.cloud.batch.v1.AllocationPolicy.ProvisioningModel[message.provisioningModel] === undefined ? message.provisioningModel : $root.google.cloud.batch.v1.AllocationPolicy.ProvisioningModel[message.provisioningModel] : message.provisioningModel; + if (message.taskPack != null && message.hasOwnProperty("taskPack")) + if (typeof message.taskPack === "number") + object.taskPack = options.longs === String ? String(message.taskPack) : message.taskPack; + else + object.taskPack = options.longs === String ? $util.Long.prototype.toString.call(message.taskPack) : options.longs === Number ? new $util.LongBits(message.taskPack.low >>> 0, message.taskPack.high >>> 0).toNumber() : message.taskPack; + if (message.bootDisk != null && message.hasOwnProperty("bootDisk")) + object.bootDisk = $root.google.cloud.batch.v1.AllocationPolicy.Disk.toObject(message.bootDisk, options); + return object; + }; + + /** + * Converts this InstanceStatus to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus + * @instance + * @returns {Object.} JSON object + */ + InstanceStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstanceStatus + * @function getTypeUrl + * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstanceStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.JobStatus.InstanceStatus"; + }; + + return InstanceStatus; + })(); + + JobStatus.TaskGroupStatus = (function() { + + /** + * Properties of a TaskGroupStatus. + * @memberof google.cloud.batch.v1.JobStatus + * @interface ITaskGroupStatus + * @property {Object.|null} [counts] TaskGroupStatus counts + * @property {Array.|null} [instances] TaskGroupStatus instances + */ + + /** + * Constructs a new TaskGroupStatus. + * @memberof google.cloud.batch.v1.JobStatus + * @classdesc Represents a TaskGroupStatus. + * @implements ITaskGroupStatus + * @constructor + * @param {google.cloud.batch.v1.JobStatus.ITaskGroupStatus=} [properties] Properties to set + */ + function TaskGroupStatus(properties) { + this.counts = {}; + this.instances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TaskGroupStatus counts. + * @member {Object.} counts + * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus + * @instance + */ + TaskGroupStatus.prototype.counts = $util.emptyObject; + + /** + * TaskGroupStatus instances. + * @member {Array.} instances + * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus + * @instance + */ + TaskGroupStatus.prototype.instances = $util.emptyArray; + + /** + * Creates a new TaskGroupStatus instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus + * @static + * @param {google.cloud.batch.v1.JobStatus.ITaskGroupStatus=} [properties] Properties to set + * @returns {google.cloud.batch.v1.JobStatus.TaskGroupStatus} TaskGroupStatus instance + */ + TaskGroupStatus.create = function create(properties) { + return new TaskGroupStatus(properties); + }; + + /** + * Encodes the specified TaskGroupStatus message. Does not implicitly {@link google.cloud.batch.v1.JobStatus.TaskGroupStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus + * @static + * @param {google.cloud.batch.v1.JobStatus.ITaskGroupStatus} message TaskGroupStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskGroupStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.counts != null && Object.hasOwnProperty.call(message, "counts")) + for (var keys = Object.keys(message.counts), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int64(message.counts[keys[i]]).ldelim(); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + $root.google.cloud.batch.v1.JobStatus.InstanceStatus.encode(message.instances[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TaskGroupStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobStatus.TaskGroupStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus + * @static + * @param {google.cloud.batch.v1.JobStatus.ITaskGroupStatus} message TaskGroupStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskGroupStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TaskGroupStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.JobStatus.TaskGroupStatus} TaskGroupStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskGroupStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.JobStatus.TaskGroupStatus(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.counts === $util.emptyObject) + message.counts = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = 0; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.int64(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.counts[key] = value; + break; + } + case 2: { + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.batch.v1.JobStatus.InstanceStatus.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TaskGroupStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.JobStatus.TaskGroupStatus} TaskGroupStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskGroupStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TaskGroupStatus message. + * @function verify + * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TaskGroupStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.counts != null && message.hasOwnProperty("counts")) { + if (!$util.isObject(message.counts)) + return "counts: object expected"; + var key = Object.keys(message.counts); + for (var i = 0; i < key.length; ++i) + if (!$util.isInteger(message.counts[key[i]]) && !(message.counts[key[i]] && $util.isInteger(message.counts[key[i]].low) && $util.isInteger(message.counts[key[i]].high))) + return "counts: integer|Long{k:string} expected"; + } + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) { + var error = $root.google.cloud.batch.v1.JobStatus.InstanceStatus.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } + return null; + }; + + /** + * Creates a TaskGroupStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.JobStatus.TaskGroupStatus} TaskGroupStatus + */ + TaskGroupStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.JobStatus.TaskGroupStatus) + return object; + var message = new $root.google.cloud.batch.v1.JobStatus.TaskGroupStatus(); + if (object.counts) { + if (typeof object.counts !== "object") + throw TypeError(".google.cloud.batch.v1.JobStatus.TaskGroupStatus.counts: object expected"); + message.counts = {}; + for (var keys = Object.keys(object.counts), i = 0; i < keys.length; ++i) + if ($util.Long) + (message.counts[keys[i]] = $util.Long.fromValue(object.counts[keys[i]])).unsigned = false; + else if (typeof object.counts[keys[i]] === "string") + message.counts[keys[i]] = parseInt(object.counts[keys[i]], 10); + else if (typeof object.counts[keys[i]] === "number") + message.counts[keys[i]] = object.counts[keys[i]]; + else if (typeof object.counts[keys[i]] === "object") + message.counts[keys[i]] = new $util.LongBits(object.counts[keys[i]].low >>> 0, object.counts[keys[i]].high >>> 0).toNumber(); + } + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.batch.v1.JobStatus.TaskGroupStatus.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.cloud.batch.v1.JobStatus.TaskGroupStatus.instances: object expected"); + message.instances[i] = $root.google.cloud.batch.v1.JobStatus.InstanceStatus.fromObject(object.instances[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TaskGroupStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus + * @static + * @param {google.cloud.batch.v1.JobStatus.TaskGroupStatus} message TaskGroupStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TaskGroupStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instances = []; + if (options.objects || options.defaults) + object.counts = {}; + var keys2; + if (message.counts && (keys2 = Object.keys(message.counts)).length) { + object.counts = {}; + for (var j = 0; j < keys2.length; ++j) + if (typeof message.counts[keys2[j]] === "number") + object.counts[keys2[j]] = options.longs === String ? String(message.counts[keys2[j]]) : message.counts[keys2[j]]; + else + object.counts[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.counts[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.counts[keys2[j]].low >>> 0, message.counts[keys2[j]].high >>> 0).toNumber() : message.counts[keys2[j]]; + } + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.batch.v1.JobStatus.InstanceStatus.toObject(message.instances[j], options); + } + return object; + }; + + /** + * Converts this TaskGroupStatus to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus + * @instance + * @returns {Object.} JSON object + */ + TaskGroupStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TaskGroupStatus + * @function getTypeUrl + * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TaskGroupStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.JobStatus.TaskGroupStatus"; + }; + + return TaskGroupStatus; + })(); + + /** + * State enum. + * @name google.cloud.batch.v1.JobStatus.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} QUEUED=1 QUEUED value + * @property {number} SCHEDULED=2 SCHEDULED value + * @property {number} RUNNING=3 RUNNING value + * @property {number} SUCCEEDED=4 SUCCEEDED value + * @property {number} FAILED=5 FAILED value + * @property {number} DELETION_IN_PROGRESS=6 DELETION_IN_PROGRESS value + */ + JobStatus.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "QUEUED"] = 1; + values[valuesById[2] = "SCHEDULED"] = 2; + values[valuesById[3] = "RUNNING"] = 3; + values[valuesById[4] = "SUCCEEDED"] = 4; + values[valuesById[5] = "FAILED"] = 5; + values[valuesById[6] = "DELETION_IN_PROGRESS"] = 6; + return values; + })(); + + return JobStatus; + })(); + + v1.JobNotification = (function() { + + /** + * Properties of a JobNotification. + * @memberof google.cloud.batch.v1 + * @interface IJobNotification + * @property {string|null} [pubsubTopic] JobNotification pubsubTopic + * @property {google.cloud.batch.v1.JobNotification.IMessage|null} [message] JobNotification message + */ + + /** + * Constructs a new JobNotification. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a JobNotification. + * @implements IJobNotification + * @constructor + * @param {google.cloud.batch.v1.IJobNotification=} [properties] Properties to set + */ + function JobNotification(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobNotification pubsubTopic. + * @member {string} pubsubTopic + * @memberof google.cloud.batch.v1.JobNotification + * @instance + */ + JobNotification.prototype.pubsubTopic = ""; + + /** + * JobNotification message. + * @member {google.cloud.batch.v1.JobNotification.IMessage|null|undefined} message + * @memberof google.cloud.batch.v1.JobNotification + * @instance + */ + JobNotification.prototype.message = null; + + /** + * Creates a new JobNotification instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.JobNotification + * @static + * @param {google.cloud.batch.v1.IJobNotification=} [properties] Properties to set + * @returns {google.cloud.batch.v1.JobNotification} JobNotification instance + */ + JobNotification.create = function create(properties) { + return new JobNotification(properties); + }; + + /** + * Encodes the specified JobNotification message. Does not implicitly {@link google.cloud.batch.v1.JobNotification.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.JobNotification + * @static + * @param {google.cloud.batch.v1.IJobNotification} message JobNotification message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobNotification.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pubsubTopic != null && Object.hasOwnProperty.call(message, "pubsubTopic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pubsubTopic); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + $root.google.cloud.batch.v1.JobNotification.Message.encode(message.message, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JobNotification message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobNotification.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.JobNotification + * @static + * @param {google.cloud.batch.v1.IJobNotification} message JobNotification message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobNotification.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JobNotification message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.JobNotification + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.JobNotification} JobNotification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobNotification.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.JobNotification(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.pubsubTopic = reader.string(); + break; + } + case 2: { + message.message = $root.google.cloud.batch.v1.JobNotification.Message.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JobNotification message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.JobNotification + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.JobNotification} JobNotification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobNotification.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobNotification message. + * @function verify + * @memberof google.cloud.batch.v1.JobNotification + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobNotification.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) + if (!$util.isString(message.pubsubTopic)) + return "pubsubTopic: string expected"; + if (message.message != null && message.hasOwnProperty("message")) { + var error = $root.google.cloud.batch.v1.JobNotification.Message.verify(message.message); + if (error) + return "message." + error; + } + return null; + }; + + /** + * Creates a JobNotification message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.JobNotification + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.JobNotification} JobNotification + */ + JobNotification.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.JobNotification) + return object; + var message = new $root.google.cloud.batch.v1.JobNotification(); + if (object.pubsubTopic != null) + message.pubsubTopic = String(object.pubsubTopic); + if (object.message != null) { + if (typeof object.message !== "object") + throw TypeError(".google.cloud.batch.v1.JobNotification.message: object expected"); + message.message = $root.google.cloud.batch.v1.JobNotification.Message.fromObject(object.message); + } + return message; + }; + + /** + * Creates a plain object from a JobNotification message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.JobNotification + * @static + * @param {google.cloud.batch.v1.JobNotification} message JobNotification + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobNotification.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.pubsubTopic = ""; + object.message = null; + } + if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) + object.pubsubTopic = message.pubsubTopic; + if (message.message != null && message.hasOwnProperty("message")) + object.message = $root.google.cloud.batch.v1.JobNotification.Message.toObject(message.message, options); + return object; + }; + + /** + * Converts this JobNotification to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.JobNotification + * @instance + * @returns {Object.} JSON object + */ + JobNotification.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobNotification + * @function getTypeUrl + * @memberof google.cloud.batch.v1.JobNotification + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobNotification.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.JobNotification"; + }; + + JobNotification.Message = (function() { + + /** + * Properties of a Message. + * @memberof google.cloud.batch.v1.JobNotification + * @interface IMessage + * @property {google.cloud.batch.v1.JobNotification.Type|null} [type] Message type + * @property {google.cloud.batch.v1.JobStatus.State|null} [newJobState] Message newJobState + * @property {google.cloud.batch.v1.TaskStatus.State|null} [newTaskState] Message newTaskState + */ + + /** + * Constructs a new Message. + * @memberof google.cloud.batch.v1.JobNotification + * @classdesc Represents a Message. + * @implements IMessage + * @constructor + * @param {google.cloud.batch.v1.JobNotification.IMessage=} [properties] Properties to set + */ + function Message(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Message type. + * @member {google.cloud.batch.v1.JobNotification.Type} type + * @memberof google.cloud.batch.v1.JobNotification.Message + * @instance + */ + Message.prototype.type = 0; + + /** + * Message newJobState. + * @member {google.cloud.batch.v1.JobStatus.State} newJobState + * @memberof google.cloud.batch.v1.JobNotification.Message + * @instance + */ + Message.prototype.newJobState = 0; + + /** + * Message newTaskState. + * @member {google.cloud.batch.v1.TaskStatus.State} newTaskState + * @memberof google.cloud.batch.v1.JobNotification.Message + * @instance + */ + Message.prototype.newTaskState = 0; + + /** + * Creates a new Message instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.JobNotification.Message + * @static + * @param {google.cloud.batch.v1.JobNotification.IMessage=} [properties] Properties to set + * @returns {google.cloud.batch.v1.JobNotification.Message} Message instance + */ + Message.create = function create(properties) { + return new Message(properties); + }; + + /** + * Encodes the specified Message message. Does not implicitly {@link google.cloud.batch.v1.JobNotification.Message.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.JobNotification.Message + * @static + * @param {google.cloud.batch.v1.JobNotification.IMessage} message Message message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Message.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.newJobState != null && Object.hasOwnProperty.call(message, "newJobState")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.newJobState); + if (message.newTaskState != null && Object.hasOwnProperty.call(message, "newTaskState")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.newTaskState); + return writer; + }; + + /** + * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobNotification.Message.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.JobNotification.Message + * @static + * @param {google.cloud.batch.v1.JobNotification.IMessage} message Message message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Message.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Message message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.JobNotification.Message + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.JobNotification.Message} Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Message.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.JobNotification.Message(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.newJobState = reader.int32(); + break; + } + case 3: { + message.newTaskState = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Message message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.JobNotification.Message + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.JobNotification.Message} Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Message.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Message message. + * @function verify + * @memberof google.cloud.batch.v1.JobNotification.Message + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Message.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.newJobState != null && message.hasOwnProperty("newJobState")) + switch (message.newJobState) { + default: + return "newJobState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.newTaskState != null && message.hasOwnProperty("newTaskState")) + switch (message.newTaskState) { + default: + return "newTaskState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + return null; + }; + + /** + * Creates a Message message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.JobNotification.Message + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.JobNotification.Message} Message + */ + Message.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.JobNotification.Message) + return object; + var message = new $root.google.cloud.batch.v1.JobNotification.Message(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "JOB_STATE_CHANGED": + case 1: + message.type = 1; + break; + case "TASK_STATE_CHANGED": + case 2: + message.type = 2; + break; + } + switch (object.newJobState) { + default: + if (typeof object.newJobState === "number") { + message.newJobState = object.newJobState; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.newJobState = 0; + break; + case "QUEUED": + case 1: + message.newJobState = 1; + break; + case "SCHEDULED": + case 2: + message.newJobState = 2; + break; + case "RUNNING": + case 3: + message.newJobState = 3; + break; + case "SUCCEEDED": + case 4: + message.newJobState = 4; + break; + case "FAILED": + case 5: + message.newJobState = 5; + break; + case "DELETION_IN_PROGRESS": + case 6: + message.newJobState = 6; + break; + } + switch (object.newTaskState) { + default: + if (typeof object.newTaskState === "number") { + message.newTaskState = object.newTaskState; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.newTaskState = 0; + break; + case "PENDING": + case 1: + message.newTaskState = 1; + break; + case "ASSIGNED": + case 2: + message.newTaskState = 2; + break; + case "RUNNING": + case 3: + message.newTaskState = 3; + break; + case "FAILED": + case 4: + message.newTaskState = 4; + break; + case "SUCCEEDED": + case 5: + message.newTaskState = 5; + break; + case "UNEXECUTED": + case 6: + message.newTaskState = 6; + break; + } + return message; + }; + + /** + * Creates a plain object from a Message message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.JobNotification.Message + * @static + * @param {google.cloud.batch.v1.JobNotification.Message} message Message + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Message.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.newJobState = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.newTaskState = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.batch.v1.JobNotification.Type[message.type] === undefined ? message.type : $root.google.cloud.batch.v1.JobNotification.Type[message.type] : message.type; + if (message.newJobState != null && message.hasOwnProperty("newJobState")) + object.newJobState = options.enums === String ? $root.google.cloud.batch.v1.JobStatus.State[message.newJobState] === undefined ? message.newJobState : $root.google.cloud.batch.v1.JobStatus.State[message.newJobState] : message.newJobState; + if (message.newTaskState != null && message.hasOwnProperty("newTaskState")) + object.newTaskState = options.enums === String ? $root.google.cloud.batch.v1.TaskStatus.State[message.newTaskState] === undefined ? message.newTaskState : $root.google.cloud.batch.v1.TaskStatus.State[message.newTaskState] : message.newTaskState; + return object; + }; + + /** + * Converts this Message to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.JobNotification.Message + * @instance + * @returns {Object.} JSON object + */ + Message.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Message + * @function getTypeUrl + * @memberof google.cloud.batch.v1.JobNotification.Message + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Message.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.JobNotification.Message"; + }; + + return Message; + })(); + + /** + * Type enum. + * @name google.cloud.batch.v1.JobNotification.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} JOB_STATE_CHANGED=1 JOB_STATE_CHANGED value + * @property {number} TASK_STATE_CHANGED=2 TASK_STATE_CHANGED value + */ + JobNotification.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "JOB_STATE_CHANGED"] = 1; + values[valuesById[2] = "TASK_STATE_CHANGED"] = 2; + return values; + })(); + + return JobNotification; + })(); + + v1.AllocationPolicy = (function() { + + /** + * Properties of an AllocationPolicy. + * @memberof google.cloud.batch.v1 + * @interface IAllocationPolicy + * @property {google.cloud.batch.v1.AllocationPolicy.ILocationPolicy|null} [location] AllocationPolicy location + * @property {Array.|null} [instances] AllocationPolicy instances + * @property {google.cloud.batch.v1.IServiceAccount|null} [serviceAccount] AllocationPolicy serviceAccount + * @property {Object.|null} [labels] AllocationPolicy labels + * @property {google.cloud.batch.v1.AllocationPolicy.INetworkPolicy|null} [network] AllocationPolicy network + * @property {google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy|null} [placement] AllocationPolicy placement + * @property {Array.|null} [tags] AllocationPolicy tags + */ + + /** + * Constructs a new AllocationPolicy. + * @memberof google.cloud.batch.v1 + * @classdesc Represents an AllocationPolicy. + * @implements IAllocationPolicy + * @constructor + * @param {google.cloud.batch.v1.IAllocationPolicy=} [properties] Properties to set + */ + function AllocationPolicy(properties) { + this.instances = []; + this.labels = {}; + this.tags = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AllocationPolicy location. + * @member {google.cloud.batch.v1.AllocationPolicy.ILocationPolicy|null|undefined} location + * @memberof google.cloud.batch.v1.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.location = null; + + /** + * AllocationPolicy instances. + * @member {Array.} instances + * @memberof google.cloud.batch.v1.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.instances = $util.emptyArray; + + /** + * AllocationPolicy serviceAccount. + * @member {google.cloud.batch.v1.IServiceAccount|null|undefined} serviceAccount + * @memberof google.cloud.batch.v1.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.serviceAccount = null; + + /** + * AllocationPolicy labels. + * @member {Object.} labels + * @memberof google.cloud.batch.v1.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.labels = $util.emptyObject; + + /** + * AllocationPolicy network. + * @member {google.cloud.batch.v1.AllocationPolicy.INetworkPolicy|null|undefined} network + * @memberof google.cloud.batch.v1.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.network = null; + + /** + * AllocationPolicy placement. + * @member {google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy|null|undefined} placement + * @memberof google.cloud.batch.v1.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.placement = null; + + /** + * AllocationPolicy tags. + * @member {Array.} tags + * @memberof google.cloud.batch.v1.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.tags = $util.emptyArray; + + /** + * Creates a new AllocationPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.AllocationPolicy + * @static + * @param {google.cloud.batch.v1.IAllocationPolicy=} [properties] Properties to set + * @returns {google.cloud.batch.v1.AllocationPolicy} AllocationPolicy instance + */ + AllocationPolicy.create = function create(properties) { + return new AllocationPolicy(properties); + }; + + /** + * Encodes the specified AllocationPolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.AllocationPolicy + * @static + * @param {google.cloud.batch.v1.IAllocationPolicy} message AllocationPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllocationPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + $root.google.cloud.batch.v1.AllocationPolicy.LocationPolicy.encode(message.location, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + $root.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.encode(message.network, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.encode(message.instances[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + $root.google.cloud.batch.v1.ServiceAccount.encode(message.serviceAccount, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.placement != null && Object.hasOwnProperty.call(message, "placement")) + $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.encode(message.placement, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.tags != null && message.tags.length) + for (var i = 0; i < message.tags.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.tags[i]); + return writer; + }; + + /** + * Encodes the specified AllocationPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy + * @static + * @param {google.cloud.batch.v1.IAllocationPolicy} message AllocationPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllocationPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AllocationPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.AllocationPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.AllocationPolicy} AllocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllocationPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.location = $root.google.cloud.batch.v1.AllocationPolicy.LocationPolicy.decode(reader, reader.uint32()); + break; + } + case 8: { + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.decode(reader, reader.uint32())); + break; + } + case 9: { + message.serviceAccount = $root.google.cloud.batch.v1.ServiceAccount.decode(reader, reader.uint32()); + break; + } + case 6: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 7: { + message.network = $root.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.decode(reader, reader.uint32()); + break; + } + case 10: { + message.placement = $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.decode(reader, reader.uint32()); + break; + } + case 11: { + if (!(message.tags && message.tags.length)) + message.tags = []; + message.tags.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AllocationPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.AllocationPolicy} AllocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllocationPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AllocationPolicy message. + * @function verify + * @memberof google.cloud.batch.v1.AllocationPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AllocationPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + var error = $root.google.cloud.batch.v1.AllocationPolicy.LocationPolicy.verify(message.location); + if (error) + return "location." + error; + } + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) { + var error = $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) { + var error = $root.google.cloud.batch.v1.ServiceAccount.verify(message.serviceAccount); + if (error) + return "serviceAccount." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.network != null && message.hasOwnProperty("network")) { + var error = $root.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.verify(message.network); + if (error) + return "network." + error; + } + if (message.placement != null && message.hasOwnProperty("placement")) { + var error = $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.verify(message.placement); + if (error) + return "placement." + error; + } + if (message.tags != null && message.hasOwnProperty("tags")) { + if (!Array.isArray(message.tags)) + return "tags: array expected"; + for (var i = 0; i < message.tags.length; ++i) + if (!$util.isString(message.tags[i])) + return "tags: string[] expected"; + } + return null; + }; + + /** + * Creates an AllocationPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.AllocationPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.AllocationPolicy} AllocationPolicy + */ + AllocationPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy) + return object; + var message = new $root.google.cloud.batch.v1.AllocationPolicy(); + if (object.location != null) { + if (typeof object.location !== "object") + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.location: object expected"); + message.location = $root.google.cloud.batch.v1.AllocationPolicy.LocationPolicy.fromObject(object.location); + } + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.instances: object expected"); + message.instances[i] = $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.fromObject(object.instances[i]); + } + } + if (object.serviceAccount != null) { + if (typeof object.serviceAccount !== "object") + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.serviceAccount: object expected"); + message.serviceAccount = $root.google.cloud.batch.v1.ServiceAccount.fromObject(object.serviceAccount); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.network != null) { + if (typeof object.network !== "object") + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.network: object expected"); + message.network = $root.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.fromObject(object.network); + } + if (object.placement != null) { + if (typeof object.placement !== "object") + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.placement: object expected"); + message.placement = $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.fromObject(object.placement); + } + if (object.tags) { + if (!Array.isArray(object.tags)) + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.tags: array expected"); + message.tags = []; + for (var i = 0; i < object.tags.length; ++i) + message.tags[i] = String(object.tags[i]); + } + return message; + }; + + /** + * Creates a plain object from an AllocationPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.AllocationPolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy} message AllocationPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AllocationPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.instances = []; + object.tags = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.location = null; + object.network = null; + object.serviceAccount = null; + object.placement = null; + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = $root.google.cloud.batch.v1.AllocationPolicy.LocationPolicy.toObject(message.location, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.network != null && message.hasOwnProperty("network")) + object.network = $root.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.toObject(message.network, options); + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.toObject(message.instances[j], options); + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = $root.google.cloud.batch.v1.ServiceAccount.toObject(message.serviceAccount, options); + if (message.placement != null && message.hasOwnProperty("placement")) + object.placement = $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.toObject(message.placement, options); + if (message.tags && message.tags.length) { + object.tags = []; + for (var j = 0; j < message.tags.length; ++j) + object.tags[j] = message.tags[j]; + } + return object; + }; + + /** + * Converts this AllocationPolicy to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.AllocationPolicy + * @instance + * @returns {Object.} JSON object + */ + AllocationPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AllocationPolicy + * @function getTypeUrl + * @memberof google.cloud.batch.v1.AllocationPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AllocationPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy"; + }; + + AllocationPolicy.LocationPolicy = (function() { + + /** + * Properties of a LocationPolicy. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @interface ILocationPolicy + * @property {Array.|null} [allowedLocations] LocationPolicy allowedLocations + */ + + /** + * Constructs a new LocationPolicy. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @classdesc Represents a LocationPolicy. + * @implements ILocationPolicy + * @constructor + * @param {google.cloud.batch.v1.AllocationPolicy.ILocationPolicy=} [properties] Properties to set + */ + function LocationPolicy(properties) { + this.allowedLocations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LocationPolicy allowedLocations. + * @member {Array.} allowedLocations + * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy + * @instance + */ + LocationPolicy.prototype.allowedLocations = $util.emptyArray; + + /** + * Creates a new LocationPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.ILocationPolicy=} [properties] Properties to set + * @returns {google.cloud.batch.v1.AllocationPolicy.LocationPolicy} LocationPolicy instance + */ + LocationPolicy.create = function create(properties) { + return new LocationPolicy(properties); + }; + + /** + * Encodes the specified LocationPolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.LocationPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.ILocationPolicy} message LocationPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedLocations != null && message.allowedLocations.length) + for (var i = 0; i < message.allowedLocations.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedLocations[i]); + return writer; + }; + + /** + * Encodes the specified LocationPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.LocationPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.ILocationPolicy} message LocationPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocationPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.AllocationPolicy.LocationPolicy} LocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy.LocationPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.allowedLocations && message.allowedLocations.length)) + message.allowedLocations = []; + message.allowedLocations.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocationPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.AllocationPolicy.LocationPolicy} LocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocationPolicy message. + * @function verify + * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocationPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowedLocations != null && message.hasOwnProperty("allowedLocations")) { + if (!Array.isArray(message.allowedLocations)) + return "allowedLocations: array expected"; + for (var i = 0; i < message.allowedLocations.length; ++i) + if (!$util.isString(message.allowedLocations[i])) + return "allowedLocations: string[] expected"; + } + return null; + }; + + /** + * Creates a LocationPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.AllocationPolicy.LocationPolicy} LocationPolicy + */ + LocationPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy.LocationPolicy) + return object; + var message = new $root.google.cloud.batch.v1.AllocationPolicy.LocationPolicy(); + if (object.allowedLocations) { + if (!Array.isArray(object.allowedLocations)) + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.LocationPolicy.allowedLocations: array expected"); + message.allowedLocations = []; + for (var i = 0; i < object.allowedLocations.length; ++i) + message.allowedLocations[i] = String(object.allowedLocations[i]); + } + return message; + }; + + /** + * Creates a plain object from a LocationPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.LocationPolicy} message LocationPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocationPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedLocations = []; + if (message.allowedLocations && message.allowedLocations.length) { + object.allowedLocations = []; + for (var j = 0; j < message.allowedLocations.length; ++j) + object.allowedLocations[j] = message.allowedLocations[j]; + } + return object; + }; + + /** + * Converts this LocationPolicy to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy + * @instance + * @returns {Object.} JSON object + */ + LocationPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LocationPolicy + * @function getTypeUrl + * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LocationPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy.LocationPolicy"; + }; + + return LocationPolicy; + })(); + + AllocationPolicy.Disk = (function() { + + /** + * Properties of a Disk. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @interface IDisk + * @property {string|null} [image] Disk image + * @property {string|null} [snapshot] Disk snapshot + * @property {string|null} [type] Disk type + * @property {number|Long|null} [sizeGb] Disk sizeGb + * @property {string|null} [diskInterface] Disk diskInterface + */ + + /** + * Constructs a new Disk. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @classdesc Represents a Disk. + * @implements IDisk + * @constructor + * @param {google.cloud.batch.v1.AllocationPolicy.IDisk=} [properties] Properties to set + */ + function Disk(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Disk image. + * @member {string|null|undefined} image + * @memberof google.cloud.batch.v1.AllocationPolicy.Disk + * @instance + */ + Disk.prototype.image = null; + + /** + * Disk snapshot. + * @member {string|null|undefined} snapshot + * @memberof google.cloud.batch.v1.AllocationPolicy.Disk + * @instance + */ + Disk.prototype.snapshot = null; + + /** + * Disk type. + * @member {string} type + * @memberof google.cloud.batch.v1.AllocationPolicy.Disk + * @instance + */ + Disk.prototype.type = ""; + + /** + * Disk sizeGb. + * @member {number|Long} sizeGb + * @memberof google.cloud.batch.v1.AllocationPolicy.Disk + * @instance + */ + Disk.prototype.sizeGb = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk diskInterface. + * @member {string} diskInterface + * @memberof google.cloud.batch.v1.AllocationPolicy.Disk + * @instance + */ + Disk.prototype.diskInterface = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Disk dataSource. + * @member {"image"|"snapshot"|undefined} dataSource + * @memberof google.cloud.batch.v1.AllocationPolicy.Disk + * @instance + */ + Object.defineProperty(Disk.prototype, "dataSource", { + get: $util.oneOfGetter($oneOfFields = ["image", "snapshot"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Disk instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.AllocationPolicy.Disk + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IDisk=} [properties] Properties to set + * @returns {google.cloud.batch.v1.AllocationPolicy.Disk} Disk instance + */ + Disk.create = function create(properties) { + return new Disk(properties); + }; + + /** + * Encodes the specified Disk message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.Disk.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.AllocationPolicy.Disk + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IDisk} message Disk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Disk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.sizeGb != null && Object.hasOwnProperty.call(message, "sizeGb")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.sizeGb); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.image); + if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.snapshot); + if (message.diskInterface != null && Object.hasOwnProperty.call(message, "diskInterface")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.diskInterface); + return writer; + }; + + /** + * Encodes the specified Disk message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.Disk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.Disk + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IDisk} message Disk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Disk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Disk message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.AllocationPolicy.Disk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.AllocationPolicy.Disk} Disk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Disk.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy.Disk(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.image = reader.string(); + break; + } + case 5: { + message.snapshot = reader.string(); + break; + } + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.sizeGb = reader.int64(); + break; + } + case 6: { + message.diskInterface = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Disk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.Disk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.AllocationPolicy.Disk} Disk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Disk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Disk message. + * @function verify + * @memberof google.cloud.batch.v1.AllocationPolicy.Disk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Disk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.image != null && message.hasOwnProperty("image")) { + properties.dataSource = 1; + if (!$util.isString(message.image)) + return "image: string expected"; + } + if (message.snapshot != null && message.hasOwnProperty("snapshot")) { + if (properties.dataSource === 1) + return "dataSource: multiple values"; + properties.dataSource = 1; + if (!$util.isString(message.snapshot)) + return "snapshot: string expected"; + } + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) + if (!$util.isInteger(message.sizeGb) && !(message.sizeGb && $util.isInteger(message.sizeGb.low) && $util.isInteger(message.sizeGb.high))) + return "sizeGb: integer|Long expected"; + if (message.diskInterface != null && message.hasOwnProperty("diskInterface")) + if (!$util.isString(message.diskInterface)) + return "diskInterface: string expected"; + return null; + }; + + /** + * Creates a Disk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.AllocationPolicy.Disk + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.AllocationPolicy.Disk} Disk + */ + Disk.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy.Disk) + return object; + var message = new $root.google.cloud.batch.v1.AllocationPolicy.Disk(); + if (object.image != null) + message.image = String(object.image); + if (object.snapshot != null) + message.snapshot = String(object.snapshot); + if (object.type != null) + message.type = String(object.type); + if (object.sizeGb != null) + if ($util.Long) + (message.sizeGb = $util.Long.fromValue(object.sizeGb)).unsigned = false; + else if (typeof object.sizeGb === "string") + message.sizeGb = parseInt(object.sizeGb, 10); + else if (typeof object.sizeGb === "number") + message.sizeGb = object.sizeGb; + else if (typeof object.sizeGb === "object") + message.sizeGb = new $util.LongBits(object.sizeGb.low >>> 0, object.sizeGb.high >>> 0).toNumber(); + if (object.diskInterface != null) + message.diskInterface = String(object.diskInterface); + return message; + }; + + /** + * Creates a plain object from a Disk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.AllocationPolicy.Disk + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.Disk} message Disk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Disk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.sizeGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sizeGb = options.longs === String ? "0" : 0; + object.diskInterface = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) + if (typeof message.sizeGb === "number") + object.sizeGb = options.longs === String ? String(message.sizeGb) : message.sizeGb; + else + object.sizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.sizeGb) : options.longs === Number ? new $util.LongBits(message.sizeGb.low >>> 0, message.sizeGb.high >>> 0).toNumber() : message.sizeGb; + if (message.image != null && message.hasOwnProperty("image")) { + object.image = message.image; + if (options.oneofs) + object.dataSource = "image"; + } + if (message.snapshot != null && message.hasOwnProperty("snapshot")) { + object.snapshot = message.snapshot; + if (options.oneofs) + object.dataSource = "snapshot"; + } + if (message.diskInterface != null && message.hasOwnProperty("diskInterface")) + object.diskInterface = message.diskInterface; + return object; + }; + + /** + * Converts this Disk to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.AllocationPolicy.Disk + * @instance + * @returns {Object.} JSON object + */ + Disk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Disk + * @function getTypeUrl + * @memberof google.cloud.batch.v1.AllocationPolicy.Disk + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Disk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy.Disk"; + }; + + return Disk; + })(); + + AllocationPolicy.AttachedDisk = (function() { + + /** + * Properties of an AttachedDisk. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @interface IAttachedDisk + * @property {google.cloud.batch.v1.AllocationPolicy.IDisk|null} [newDisk] AttachedDisk newDisk + * @property {string|null} [existingDisk] AttachedDisk existingDisk + * @property {string|null} [deviceName] AttachedDisk deviceName + */ + + /** + * Constructs a new AttachedDisk. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @classdesc Represents an AttachedDisk. + * @implements IAttachedDisk + * @constructor + * @param {google.cloud.batch.v1.AllocationPolicy.IAttachedDisk=} [properties] Properties to set + */ + function AttachedDisk(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AttachedDisk newDisk. + * @member {google.cloud.batch.v1.AllocationPolicy.IDisk|null|undefined} newDisk + * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk + * @instance + */ + AttachedDisk.prototype.newDisk = null; + + /** + * AttachedDisk existingDisk. + * @member {string|null|undefined} existingDisk + * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk + * @instance + */ + AttachedDisk.prototype.existingDisk = null; + + /** + * AttachedDisk deviceName. + * @member {string} deviceName + * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk + * @instance + */ + AttachedDisk.prototype.deviceName = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AttachedDisk attached. + * @member {"newDisk"|"existingDisk"|undefined} attached + * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "attached", { + get: $util.oneOfGetter($oneOfFields = ["newDisk", "existingDisk"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AttachedDisk instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IAttachedDisk=} [properties] Properties to set + * @returns {google.cloud.batch.v1.AllocationPolicy.AttachedDisk} AttachedDisk instance + */ + AttachedDisk.create = function create(properties) { + return new AttachedDisk(properties); + }; + + /** + * Encodes the specified AttachedDisk message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.AttachedDisk.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IAttachedDisk} message AttachedDisk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttachedDisk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.newDisk != null && Object.hasOwnProperty.call(message, "newDisk")) + $root.google.cloud.batch.v1.AllocationPolicy.Disk.encode(message.newDisk, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.existingDisk != null && Object.hasOwnProperty.call(message, "existingDisk")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.existingDisk); + if (message.deviceName != null && Object.hasOwnProperty.call(message, "deviceName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.deviceName); + return writer; + }; + + /** + * Encodes the specified AttachedDisk message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.AttachedDisk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IAttachedDisk} message AttachedDisk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttachedDisk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttachedDisk message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.AllocationPolicy.AttachedDisk} AttachedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttachedDisk.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy.AttachedDisk(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.newDisk = $root.google.cloud.batch.v1.AllocationPolicy.Disk.decode(reader, reader.uint32()); + break; + } + case 2: { + message.existingDisk = reader.string(); + break; + } + case 3: { + message.deviceName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttachedDisk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.AllocationPolicy.AttachedDisk} AttachedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttachedDisk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttachedDisk message. + * @function verify + * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttachedDisk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.newDisk != null && message.hasOwnProperty("newDisk")) { + properties.attached = 1; + { + var error = $root.google.cloud.batch.v1.AllocationPolicy.Disk.verify(message.newDisk); + if (error) + return "newDisk." + error; + } + } + if (message.existingDisk != null && message.hasOwnProperty("existingDisk")) { + if (properties.attached === 1) + return "attached: multiple values"; + properties.attached = 1; + if (!$util.isString(message.existingDisk)) + return "existingDisk: string expected"; + } + if (message.deviceName != null && message.hasOwnProperty("deviceName")) + if (!$util.isString(message.deviceName)) + return "deviceName: string expected"; + return null; + }; + + /** + * Creates an AttachedDisk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.AllocationPolicy.AttachedDisk} AttachedDisk + */ + AttachedDisk.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy.AttachedDisk) + return object; + var message = new $root.google.cloud.batch.v1.AllocationPolicy.AttachedDisk(); + if (object.newDisk != null) { + if (typeof object.newDisk !== "object") + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.AttachedDisk.newDisk: object expected"); + message.newDisk = $root.google.cloud.batch.v1.AllocationPolicy.Disk.fromObject(object.newDisk); + } + if (object.existingDisk != null) + message.existingDisk = String(object.existingDisk); + if (object.deviceName != null) + message.deviceName = String(object.deviceName); + return message; + }; + + /** + * Creates a plain object from an AttachedDisk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.AttachedDisk} message AttachedDisk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttachedDisk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.deviceName = ""; + if (message.newDisk != null && message.hasOwnProperty("newDisk")) { + object.newDisk = $root.google.cloud.batch.v1.AllocationPolicy.Disk.toObject(message.newDisk, options); + if (options.oneofs) + object.attached = "newDisk"; + } + if (message.existingDisk != null && message.hasOwnProperty("existingDisk")) { + object.existingDisk = message.existingDisk; + if (options.oneofs) + object.attached = "existingDisk"; + } + if (message.deviceName != null && message.hasOwnProperty("deviceName")) + object.deviceName = message.deviceName; + return object; + }; + + /** + * Converts this AttachedDisk to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk + * @instance + * @returns {Object.} JSON object + */ + AttachedDisk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AttachedDisk + * @function getTypeUrl + * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AttachedDisk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy.AttachedDisk"; + }; + + return AttachedDisk; + })(); + + AllocationPolicy.Accelerator = (function() { + + /** + * Properties of an Accelerator. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @interface IAccelerator + * @property {string|null} [type] Accelerator type + * @property {number|Long|null} [count] Accelerator count + * @property {boolean|null} [installGpuDrivers] Accelerator installGpuDrivers + * @property {string|null} [driverVersion] Accelerator driverVersion + */ + + /** + * Constructs a new Accelerator. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @classdesc Represents an Accelerator. + * @implements IAccelerator + * @constructor + * @param {google.cloud.batch.v1.AllocationPolicy.IAccelerator=} [properties] Properties to set + */ + function Accelerator(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Accelerator type. + * @member {string} type + * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator + * @instance + */ + Accelerator.prototype.type = ""; + + /** + * Accelerator count. + * @member {number|Long} count + * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator + * @instance + */ + Accelerator.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Accelerator installGpuDrivers. + * @member {boolean} installGpuDrivers + * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator + * @instance + */ + Accelerator.prototype.installGpuDrivers = false; + + /** + * Accelerator driverVersion. + * @member {string} driverVersion + * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator + * @instance + */ + Accelerator.prototype.driverVersion = ""; + + /** + * Creates a new Accelerator instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IAccelerator=} [properties] Properties to set + * @returns {google.cloud.batch.v1.AllocationPolicy.Accelerator} Accelerator instance + */ + Accelerator.create = function create(properties) { + return new Accelerator(properties); + }; + + /** + * Encodes the specified Accelerator message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.Accelerator.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IAccelerator} message Accelerator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Accelerator.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); + if (message.installGpuDrivers != null && Object.hasOwnProperty.call(message, "installGpuDrivers")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.installGpuDrivers); + if (message.driverVersion != null && Object.hasOwnProperty.call(message, "driverVersion")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.driverVersion); + return writer; + }; + + /** + * Encodes the specified Accelerator message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.Accelerator.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IAccelerator} message Accelerator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Accelerator.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Accelerator message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.AllocationPolicy.Accelerator} Accelerator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Accelerator.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy.Accelerator(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.count = reader.int64(); + break; + } + case 3: { + message.installGpuDrivers = reader.bool(); + break; + } + case 4: { + message.driverVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Accelerator message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.AllocationPolicy.Accelerator} Accelerator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Accelerator.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Accelerator message. + * @function verify + * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Accelerator.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + if (message.installGpuDrivers != null && message.hasOwnProperty("installGpuDrivers")) + if (typeof message.installGpuDrivers !== "boolean") + return "installGpuDrivers: boolean expected"; + if (message.driverVersion != null && message.hasOwnProperty("driverVersion")) + if (!$util.isString(message.driverVersion)) + return "driverVersion: string expected"; + return null; + }; + + /** + * Creates an Accelerator message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.AllocationPolicy.Accelerator} Accelerator + */ + Accelerator.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy.Accelerator) + return object; + var message = new $root.google.cloud.batch.v1.AllocationPolicy.Accelerator(); + if (object.type != null) + message.type = String(object.type); + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + if (object.installGpuDrivers != null) + message.installGpuDrivers = Boolean(object.installGpuDrivers); + if (object.driverVersion != null) + message.driverVersion = String(object.driverVersion); + return message; + }; + + /** + * Creates a plain object from an Accelerator message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.Accelerator} message Accelerator + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Accelerator.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + object.installGpuDrivers = false; + object.driverVersion = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + if (message.installGpuDrivers != null && message.hasOwnProperty("installGpuDrivers")) + object.installGpuDrivers = message.installGpuDrivers; + if (message.driverVersion != null && message.hasOwnProperty("driverVersion")) + object.driverVersion = message.driverVersion; + return object; + }; + + /** + * Converts this Accelerator to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator + * @instance + * @returns {Object.} JSON object + */ + Accelerator.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Accelerator + * @function getTypeUrl + * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Accelerator.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy.Accelerator"; + }; + + return Accelerator; + })(); + + AllocationPolicy.InstancePolicy = (function() { + + /** + * Properties of an InstancePolicy. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @interface IInstancePolicy + * @property {string|null} [machineType] InstancePolicy machineType + * @property {string|null} [minCpuPlatform] InstancePolicy minCpuPlatform + * @property {google.cloud.batch.v1.AllocationPolicy.ProvisioningModel|null} [provisioningModel] InstancePolicy provisioningModel + * @property {Array.|null} [accelerators] InstancePolicy accelerators + * @property {google.cloud.batch.v1.AllocationPolicy.IDisk|null} [bootDisk] InstancePolicy bootDisk + * @property {Array.|null} [disks] InstancePolicy disks + * @property {string|null} [reservation] InstancePolicy reservation + */ + + /** + * Constructs a new InstancePolicy. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @classdesc Represents an InstancePolicy. + * @implements IInstancePolicy + * @constructor + * @param {google.cloud.batch.v1.AllocationPolicy.IInstancePolicy=} [properties] Properties to set + */ + function InstancePolicy(properties) { + this.accelerators = []; + this.disks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstancePolicy machineType. + * @member {string} machineType + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy + * @instance + */ + InstancePolicy.prototype.machineType = ""; + + /** + * InstancePolicy minCpuPlatform. + * @member {string} minCpuPlatform + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy + * @instance + */ + InstancePolicy.prototype.minCpuPlatform = ""; + + /** + * InstancePolicy provisioningModel. + * @member {google.cloud.batch.v1.AllocationPolicy.ProvisioningModel} provisioningModel + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy + * @instance + */ + InstancePolicy.prototype.provisioningModel = 0; + + /** + * InstancePolicy accelerators. + * @member {Array.} accelerators + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy + * @instance + */ + InstancePolicy.prototype.accelerators = $util.emptyArray; + + /** + * InstancePolicy bootDisk. + * @member {google.cloud.batch.v1.AllocationPolicy.IDisk|null|undefined} bootDisk + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy + * @instance + */ + InstancePolicy.prototype.bootDisk = null; + + /** + * InstancePolicy disks. + * @member {Array.} disks + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy + * @instance + */ + InstancePolicy.prototype.disks = $util.emptyArray; + + /** + * InstancePolicy reservation. + * @member {string} reservation + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy + * @instance + */ + InstancePolicy.prototype.reservation = ""; + + /** + * Creates a new InstancePolicy instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IInstancePolicy=} [properties] Properties to set + * @returns {google.cloud.batch.v1.AllocationPolicy.InstancePolicy} InstancePolicy instance + */ + InstancePolicy.create = function create(properties) { + return new InstancePolicy(properties); + }; + + /** + * Encodes the specified InstancePolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.InstancePolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IInstancePolicy} message InstancePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancePolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.machineType); + if (message.minCpuPlatform != null && Object.hasOwnProperty.call(message, "minCpuPlatform")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.minCpuPlatform); + if (message.provisioningModel != null && Object.hasOwnProperty.call(message, "provisioningModel")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.provisioningModel); + if (message.accelerators != null && message.accelerators.length) + for (var i = 0; i < message.accelerators.length; ++i) + $root.google.cloud.batch.v1.AllocationPolicy.Accelerator.encode(message.accelerators[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.disks != null && message.disks.length) + for (var i = 0; i < message.disks.length; ++i) + $root.google.cloud.batch.v1.AllocationPolicy.AttachedDisk.encode(message.disks[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.reservation != null && Object.hasOwnProperty.call(message, "reservation")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.reservation); + if (message.bootDisk != null && Object.hasOwnProperty.call(message, "bootDisk")) + $root.google.cloud.batch.v1.AllocationPolicy.Disk.encode(message.bootDisk, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstancePolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.InstancePolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IInstancePolicy} message InstancePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancePolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstancePolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.AllocationPolicy.InstancePolicy} InstancePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancePolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.machineType = reader.string(); + break; + } + case 3: { + message.minCpuPlatform = reader.string(); + break; + } + case 4: { + message.provisioningModel = reader.int32(); + break; + } + case 5: { + if (!(message.accelerators && message.accelerators.length)) + message.accelerators = []; + message.accelerators.push($root.google.cloud.batch.v1.AllocationPolicy.Accelerator.decode(reader, reader.uint32())); + break; + } + case 8: { + message.bootDisk = $root.google.cloud.batch.v1.AllocationPolicy.Disk.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.disks && message.disks.length)) + message.disks = []; + message.disks.push($root.google.cloud.batch.v1.AllocationPolicy.AttachedDisk.decode(reader, reader.uint32())); + break; + } + case 7: { + message.reservation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstancePolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.AllocationPolicy.InstancePolicy} InstancePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancePolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstancePolicy message. + * @function verify + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstancePolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.machineType != null && message.hasOwnProperty("machineType")) + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) + if (!$util.isString(message.minCpuPlatform)) + return "minCpuPlatform: string expected"; + if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) + switch (message.provisioningModel) { + default: + return "provisioningModel: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.accelerators != null && message.hasOwnProperty("accelerators")) { + if (!Array.isArray(message.accelerators)) + return "accelerators: array expected"; + for (var i = 0; i < message.accelerators.length; ++i) { + var error = $root.google.cloud.batch.v1.AllocationPolicy.Accelerator.verify(message.accelerators[i]); + if (error) + return "accelerators." + error; + } + } + if (message.bootDisk != null && message.hasOwnProperty("bootDisk")) { + var error = $root.google.cloud.batch.v1.AllocationPolicy.Disk.verify(message.bootDisk); + if (error) + return "bootDisk." + error; + } + if (message.disks != null && message.hasOwnProperty("disks")) { + if (!Array.isArray(message.disks)) + return "disks: array expected"; + for (var i = 0; i < message.disks.length; ++i) { + var error = $root.google.cloud.batch.v1.AllocationPolicy.AttachedDisk.verify(message.disks[i]); + if (error) + return "disks." + error; + } + } + if (message.reservation != null && message.hasOwnProperty("reservation")) + if (!$util.isString(message.reservation)) + return "reservation: string expected"; + return null; + }; + + /** + * Creates an InstancePolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.AllocationPolicy.InstancePolicy} InstancePolicy + */ + InstancePolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicy) + return object; + var message = new $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicy(); + if (object.machineType != null) + message.machineType = String(object.machineType); + if (object.minCpuPlatform != null) + message.minCpuPlatform = String(object.minCpuPlatform); + switch (object.provisioningModel) { + default: + if (typeof object.provisioningModel === "number") { + message.provisioningModel = object.provisioningModel; + break; + } + break; + case "PROVISIONING_MODEL_UNSPECIFIED": + case 0: + message.provisioningModel = 0; + break; + case "STANDARD": + case 1: + message.provisioningModel = 1; + break; + case "SPOT": + case 2: + message.provisioningModel = 2; + break; + case "PREEMPTIBLE": + case 3: + message.provisioningModel = 3; + break; + } + if (object.accelerators) { + if (!Array.isArray(object.accelerators)) + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.InstancePolicy.accelerators: array expected"); + message.accelerators = []; + for (var i = 0; i < object.accelerators.length; ++i) { + if (typeof object.accelerators[i] !== "object") + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.InstancePolicy.accelerators: object expected"); + message.accelerators[i] = $root.google.cloud.batch.v1.AllocationPolicy.Accelerator.fromObject(object.accelerators[i]); + } + } + if (object.bootDisk != null) { + if (typeof object.bootDisk !== "object") + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.InstancePolicy.bootDisk: object expected"); + message.bootDisk = $root.google.cloud.batch.v1.AllocationPolicy.Disk.fromObject(object.bootDisk); + } + if (object.disks) { + if (!Array.isArray(object.disks)) + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.InstancePolicy.disks: array expected"); + message.disks = []; + for (var i = 0; i < object.disks.length; ++i) { + if (typeof object.disks[i] !== "object") + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.InstancePolicy.disks: object expected"); + message.disks[i] = $root.google.cloud.batch.v1.AllocationPolicy.AttachedDisk.fromObject(object.disks[i]); + } + } + if (object.reservation != null) + message.reservation = String(object.reservation); + return message; + }; + + /** + * Creates a plain object from an InstancePolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.InstancePolicy} message InstancePolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstancePolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.accelerators = []; + object.disks = []; + } + if (options.defaults) { + object.machineType = ""; + object.minCpuPlatform = ""; + object.provisioningModel = options.enums === String ? "PROVISIONING_MODEL_UNSPECIFIED" : 0; + object.reservation = ""; + object.bootDisk = null; + } + if (message.machineType != null && message.hasOwnProperty("machineType")) + object.machineType = message.machineType; + if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) + object.minCpuPlatform = message.minCpuPlatform; + if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) + object.provisioningModel = options.enums === String ? $root.google.cloud.batch.v1.AllocationPolicy.ProvisioningModel[message.provisioningModel] === undefined ? message.provisioningModel : $root.google.cloud.batch.v1.AllocationPolicy.ProvisioningModel[message.provisioningModel] : message.provisioningModel; + if (message.accelerators && message.accelerators.length) { + object.accelerators = []; + for (var j = 0; j < message.accelerators.length; ++j) + object.accelerators[j] = $root.google.cloud.batch.v1.AllocationPolicy.Accelerator.toObject(message.accelerators[j], options); + } + if (message.disks && message.disks.length) { + object.disks = []; + for (var j = 0; j < message.disks.length; ++j) + object.disks[j] = $root.google.cloud.batch.v1.AllocationPolicy.AttachedDisk.toObject(message.disks[j], options); + } + if (message.reservation != null && message.hasOwnProperty("reservation")) + object.reservation = message.reservation; + if (message.bootDisk != null && message.hasOwnProperty("bootDisk")) + object.bootDisk = $root.google.cloud.batch.v1.AllocationPolicy.Disk.toObject(message.bootDisk, options); + return object; + }; + + /** + * Converts this InstancePolicy to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy + * @instance + * @returns {Object.} JSON object + */ + InstancePolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstancePolicy + * @function getTypeUrl + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstancePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy.InstancePolicy"; + }; + + return InstancePolicy; + })(); + + AllocationPolicy.InstancePolicyOrTemplate = (function() { + + /** + * Properties of an InstancePolicyOrTemplate. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @interface IInstancePolicyOrTemplate + * @property {google.cloud.batch.v1.AllocationPolicy.IInstancePolicy|null} [policy] InstancePolicyOrTemplate policy + * @property {string|null} [instanceTemplate] InstancePolicyOrTemplate instanceTemplate + * @property {boolean|null} [installGpuDrivers] InstancePolicyOrTemplate installGpuDrivers + * @property {boolean|null} [installOpsAgent] InstancePolicyOrTemplate installOpsAgent + * @property {boolean|null} [blockProjectSshKeys] InstancePolicyOrTemplate blockProjectSshKeys + */ + + /** + * Constructs a new InstancePolicyOrTemplate. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @classdesc Represents an InstancePolicyOrTemplate. + * @implements IInstancePolicyOrTemplate + * @constructor + * @param {google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate=} [properties] Properties to set + */ + function InstancePolicyOrTemplate(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstancePolicyOrTemplate policy. + * @member {google.cloud.batch.v1.AllocationPolicy.IInstancePolicy|null|undefined} policy + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + * @instance + */ + InstancePolicyOrTemplate.prototype.policy = null; + + /** + * InstancePolicyOrTemplate instanceTemplate. + * @member {string|null|undefined} instanceTemplate + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + * @instance + */ + InstancePolicyOrTemplate.prototype.instanceTemplate = null; + + /** + * InstancePolicyOrTemplate installGpuDrivers. + * @member {boolean} installGpuDrivers + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + * @instance + */ + InstancePolicyOrTemplate.prototype.installGpuDrivers = false; + + /** + * InstancePolicyOrTemplate installOpsAgent. + * @member {boolean} installOpsAgent + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + * @instance + */ + InstancePolicyOrTemplate.prototype.installOpsAgent = false; + + /** + * InstancePolicyOrTemplate blockProjectSshKeys. + * @member {boolean} blockProjectSshKeys + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + * @instance + */ + InstancePolicyOrTemplate.prototype.blockProjectSshKeys = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstancePolicyOrTemplate policyTemplate. + * @member {"policy"|"instanceTemplate"|undefined} policyTemplate + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + * @instance + */ + Object.defineProperty(InstancePolicyOrTemplate.prototype, "policyTemplate", { + get: $util.oneOfGetter($oneOfFields = ["policy", "instanceTemplate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstancePolicyOrTemplate instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate=} [properties] Properties to set + * @returns {google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate} InstancePolicyOrTemplate instance + */ + InstancePolicyOrTemplate.create = function create(properties) { + return new InstancePolicyOrTemplate(properties); + }; + + /** + * Encodes the specified InstancePolicyOrTemplate message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate} message InstancePolicyOrTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancePolicyOrTemplate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicy.encode(message.policy, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.instanceTemplate != null && Object.hasOwnProperty.call(message, "instanceTemplate")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceTemplate); + if (message.installGpuDrivers != null && Object.hasOwnProperty.call(message, "installGpuDrivers")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.installGpuDrivers); + if (message.installOpsAgent != null && Object.hasOwnProperty.call(message, "installOpsAgent")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.installOpsAgent); + if (message.blockProjectSshKeys != null && Object.hasOwnProperty.call(message, "blockProjectSshKeys")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.blockProjectSshKeys); + return writer; + }; + + /** + * Encodes the specified InstancePolicyOrTemplate message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate} message InstancePolicyOrTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancePolicyOrTemplate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstancePolicyOrTemplate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate} InstancePolicyOrTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancePolicyOrTemplate.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.policy = $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicy.decode(reader, reader.uint32()); + break; + } + case 2: { + message.instanceTemplate = reader.string(); + break; + } + case 3: { + message.installGpuDrivers = reader.bool(); + break; + } + case 4: { + message.installOpsAgent = reader.bool(); + break; + } + case 5: { + message.blockProjectSshKeys = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstancePolicyOrTemplate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate} InstancePolicyOrTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancePolicyOrTemplate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstancePolicyOrTemplate message. + * @function verify + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstancePolicyOrTemplate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.policy != null && message.hasOwnProperty("policy")) { + properties.policyTemplate = 1; + { + var error = $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicy.verify(message.policy); + if (error) + return "policy." + error; + } + } + if (message.instanceTemplate != null && message.hasOwnProperty("instanceTemplate")) { + if (properties.policyTemplate === 1) + return "policyTemplate: multiple values"; + properties.policyTemplate = 1; + if (!$util.isString(message.instanceTemplate)) + return "instanceTemplate: string expected"; + } + if (message.installGpuDrivers != null && message.hasOwnProperty("installGpuDrivers")) + if (typeof message.installGpuDrivers !== "boolean") + return "installGpuDrivers: boolean expected"; + if (message.installOpsAgent != null && message.hasOwnProperty("installOpsAgent")) + if (typeof message.installOpsAgent !== "boolean") + return "installOpsAgent: boolean expected"; + if (message.blockProjectSshKeys != null && message.hasOwnProperty("blockProjectSshKeys")) + if (typeof message.blockProjectSshKeys !== "boolean") + return "blockProjectSshKeys: boolean expected"; + return null; + }; + + /** + * Creates an InstancePolicyOrTemplate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate} InstancePolicyOrTemplate + */ + InstancePolicyOrTemplate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate) + return object; + var message = new $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate(); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.policy: object expected"); + message.policy = $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicy.fromObject(object.policy); + } + if (object.instanceTemplate != null) + message.instanceTemplate = String(object.instanceTemplate); + if (object.installGpuDrivers != null) + message.installGpuDrivers = Boolean(object.installGpuDrivers); + if (object.installOpsAgent != null) + message.installOpsAgent = Boolean(object.installOpsAgent); + if (object.blockProjectSshKeys != null) + message.blockProjectSshKeys = Boolean(object.blockProjectSshKeys); + return message; + }; + + /** + * Creates a plain object from an InstancePolicyOrTemplate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate} message InstancePolicyOrTemplate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstancePolicyOrTemplate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.installGpuDrivers = false; + object.installOpsAgent = false; + object.blockProjectSshKeys = false; + } + if (message.policy != null && message.hasOwnProperty("policy")) { + object.policy = $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicy.toObject(message.policy, options); + if (options.oneofs) + object.policyTemplate = "policy"; + } + if (message.instanceTemplate != null && message.hasOwnProperty("instanceTemplate")) { + object.instanceTemplate = message.instanceTemplate; + if (options.oneofs) + object.policyTemplate = "instanceTemplate"; + } + if (message.installGpuDrivers != null && message.hasOwnProperty("installGpuDrivers")) + object.installGpuDrivers = message.installGpuDrivers; + if (message.installOpsAgent != null && message.hasOwnProperty("installOpsAgent")) + object.installOpsAgent = message.installOpsAgent; + if (message.blockProjectSshKeys != null && message.hasOwnProperty("blockProjectSshKeys")) + object.blockProjectSshKeys = message.blockProjectSshKeys; + return object; + }; + + /** + * Converts this InstancePolicyOrTemplate to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + * @instance + * @returns {Object.} JSON object + */ + InstancePolicyOrTemplate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstancePolicyOrTemplate + * @function getTypeUrl + * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstancePolicyOrTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate"; + }; + + return InstancePolicyOrTemplate; + })(); + + AllocationPolicy.NetworkInterface = (function() { + + /** + * Properties of a NetworkInterface. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @interface INetworkInterface + * @property {string|null} [network] NetworkInterface network + * @property {string|null} [subnetwork] NetworkInterface subnetwork + * @property {boolean|null} [noExternalIpAddress] NetworkInterface noExternalIpAddress + */ + + /** + * Constructs a new NetworkInterface. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @classdesc Represents a NetworkInterface. + * @implements INetworkInterface + * @constructor + * @param {google.cloud.batch.v1.AllocationPolicy.INetworkInterface=} [properties] Properties to set + */ + function NetworkInterface(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkInterface network. + * @member {string} network + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface + * @instance + */ + NetworkInterface.prototype.network = ""; + + /** + * NetworkInterface subnetwork. + * @member {string} subnetwork + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface + * @instance + */ + NetworkInterface.prototype.subnetwork = ""; + + /** + * NetworkInterface noExternalIpAddress. + * @member {boolean} noExternalIpAddress + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface + * @instance + */ + NetworkInterface.prototype.noExternalIpAddress = false; + + /** + * Creates a new NetworkInterface instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.INetworkInterface=} [properties] Properties to set + * @returns {google.cloud.batch.v1.AllocationPolicy.NetworkInterface} NetworkInterface instance + */ + NetworkInterface.create = function create(properties) { + return new NetworkInterface(properties); + }; + + /** + * Encodes the specified NetworkInterface message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.NetworkInterface.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.INetworkInterface} message NetworkInterface message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkInterface.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.network); + if (message.subnetwork != null && Object.hasOwnProperty.call(message, "subnetwork")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subnetwork); + if (message.noExternalIpAddress != null && Object.hasOwnProperty.call(message, "noExternalIpAddress")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.noExternalIpAddress); + return writer; + }; + + /** + * Encodes the specified NetworkInterface message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.NetworkInterface.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.INetworkInterface} message NetworkInterface message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkInterface.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.AllocationPolicy.NetworkInterface} NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkInterface.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy.NetworkInterface(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.network = reader.string(); + break; + } + case 2: { + message.subnetwork = reader.string(); + break; + } + case 3: { + message.noExternalIpAddress = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.AllocationPolicy.NetworkInterface} NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkInterface.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkInterface message. + * @function verify + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkInterface.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) + if (!$util.isString(message.subnetwork)) + return "subnetwork: string expected"; + if (message.noExternalIpAddress != null && message.hasOwnProperty("noExternalIpAddress")) + if (typeof message.noExternalIpAddress !== "boolean") + return "noExternalIpAddress: boolean expected"; + return null; + }; + + /** + * Creates a NetworkInterface message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.AllocationPolicy.NetworkInterface} NetworkInterface + */ + NetworkInterface.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy.NetworkInterface) + return object; + var message = new $root.google.cloud.batch.v1.AllocationPolicy.NetworkInterface(); + if (object.network != null) + message.network = String(object.network); + if (object.subnetwork != null) + message.subnetwork = String(object.subnetwork); + if (object.noExternalIpAddress != null) + message.noExternalIpAddress = Boolean(object.noExternalIpAddress); + return message; + }; + + /** + * Creates a plain object from a NetworkInterface message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.NetworkInterface} message NetworkInterface + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkInterface.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.network = ""; + object.subnetwork = ""; + object.noExternalIpAddress = false; + } + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) + object.subnetwork = message.subnetwork; + if (message.noExternalIpAddress != null && message.hasOwnProperty("noExternalIpAddress")) + object.noExternalIpAddress = message.noExternalIpAddress; + return object; + }; + + /** + * Converts this NetworkInterface to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface + * @instance + * @returns {Object.} JSON object + */ + NetworkInterface.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NetworkInterface + * @function getTypeUrl + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NetworkInterface.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy.NetworkInterface"; + }; + + return NetworkInterface; + })(); + + AllocationPolicy.NetworkPolicy = (function() { + + /** + * Properties of a NetworkPolicy. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @interface INetworkPolicy + * @property {Array.|null} [networkInterfaces] NetworkPolicy networkInterfaces + */ + + /** + * Constructs a new NetworkPolicy. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @classdesc Represents a NetworkPolicy. + * @implements INetworkPolicy + * @constructor + * @param {google.cloud.batch.v1.AllocationPolicy.INetworkPolicy=} [properties] Properties to set + */ + function NetworkPolicy(properties) { + this.networkInterfaces = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkPolicy networkInterfaces. + * @member {Array.} networkInterfaces + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy + * @instance + */ + NetworkPolicy.prototype.networkInterfaces = $util.emptyArray; + + /** + * Creates a new NetworkPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.INetworkPolicy=} [properties] Properties to set + * @returns {google.cloud.batch.v1.AllocationPolicy.NetworkPolicy} NetworkPolicy instance + */ + NetworkPolicy.create = function create(properties) { + return new NetworkPolicy(properties); + }; + + /** + * Encodes the specified NetworkPolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.INetworkPolicy} message NetworkPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.networkInterfaces != null && message.networkInterfaces.length) + for (var i = 0; i < message.networkInterfaces.length; ++i) + $root.google.cloud.batch.v1.AllocationPolicy.NetworkInterface.encode(message.networkInterfaces[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NetworkPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.INetworkPolicy} message NetworkPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.AllocationPolicy.NetworkPolicy} NetworkPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.networkInterfaces && message.networkInterfaces.length)) + message.networkInterfaces = []; + message.networkInterfaces.push($root.google.cloud.batch.v1.AllocationPolicy.NetworkInterface.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.AllocationPolicy.NetworkPolicy} NetworkPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkPolicy message. + * @function verify + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.networkInterfaces != null && message.hasOwnProperty("networkInterfaces")) { + if (!Array.isArray(message.networkInterfaces)) + return "networkInterfaces: array expected"; + for (var i = 0; i < message.networkInterfaces.length; ++i) { + var error = $root.google.cloud.batch.v1.AllocationPolicy.NetworkInterface.verify(message.networkInterfaces[i]); + if (error) + return "networkInterfaces." + error; + } + } + return null; + }; + + /** + * Creates a NetworkPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.AllocationPolicy.NetworkPolicy} NetworkPolicy + */ + NetworkPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy) + return object; + var message = new $root.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy(); + if (object.networkInterfaces) { + if (!Array.isArray(object.networkInterfaces)) + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.networkInterfaces: array expected"); + message.networkInterfaces = []; + for (var i = 0; i < object.networkInterfaces.length; ++i) { + if (typeof object.networkInterfaces[i] !== "object") + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.networkInterfaces: object expected"); + message.networkInterfaces[i] = $root.google.cloud.batch.v1.AllocationPolicy.NetworkInterface.fromObject(object.networkInterfaces[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a NetworkPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.NetworkPolicy} message NetworkPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.networkInterfaces = []; + if (message.networkInterfaces && message.networkInterfaces.length) { + object.networkInterfaces = []; + for (var j = 0; j < message.networkInterfaces.length; ++j) + object.networkInterfaces[j] = $root.google.cloud.batch.v1.AllocationPolicy.NetworkInterface.toObject(message.networkInterfaces[j], options); + } + return object; + }; + + /** + * Converts this NetworkPolicy to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy + * @instance + * @returns {Object.} JSON object + */ + NetworkPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NetworkPolicy + * @function getTypeUrl + * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NetworkPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy.NetworkPolicy"; + }; + + return NetworkPolicy; + })(); + + AllocationPolicy.PlacementPolicy = (function() { + + /** + * Properties of a PlacementPolicy. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @interface IPlacementPolicy + * @property {string|null} [collocation] PlacementPolicy collocation + * @property {number|Long|null} [maxDistance] PlacementPolicy maxDistance + */ + + /** + * Constructs a new PlacementPolicy. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @classdesc Represents a PlacementPolicy. + * @implements IPlacementPolicy + * @constructor + * @param {google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy=} [properties] Properties to set + */ + function PlacementPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PlacementPolicy collocation. + * @member {string} collocation + * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy + * @instance + */ + PlacementPolicy.prototype.collocation = ""; + + /** + * PlacementPolicy maxDistance. + * @member {number|Long} maxDistance + * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy + * @instance + */ + PlacementPolicy.prototype.maxDistance = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new PlacementPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy=} [properties] Properties to set + * @returns {google.cloud.batch.v1.AllocationPolicy.PlacementPolicy} PlacementPolicy instance + */ + PlacementPolicy.create = function create(properties) { + return new PlacementPolicy(properties); + }; + + /** + * Encodes the specified PlacementPolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy} message PlacementPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlacementPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.collocation != null && Object.hasOwnProperty.call(message, "collocation")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.collocation); + if (message.maxDistance != null && Object.hasOwnProperty.call(message, "maxDistance")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.maxDistance); + return writer; + }; + + /** + * Encodes the specified PlacementPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy} message PlacementPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlacementPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PlacementPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.AllocationPolicy.PlacementPolicy} PlacementPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlacementPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.collocation = reader.string(); + break; + } + case 2: { + message.maxDistance = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PlacementPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.AllocationPolicy.PlacementPolicy} PlacementPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlacementPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PlacementPolicy message. + * @function verify + * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PlacementPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.collocation != null && message.hasOwnProperty("collocation")) + if (!$util.isString(message.collocation)) + return "collocation: string expected"; + if (message.maxDistance != null && message.hasOwnProperty("maxDistance")) + if (!$util.isInteger(message.maxDistance) && !(message.maxDistance && $util.isInteger(message.maxDistance.low) && $util.isInteger(message.maxDistance.high))) + return "maxDistance: integer|Long expected"; + return null; + }; + + /** + * Creates a PlacementPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.AllocationPolicy.PlacementPolicy} PlacementPolicy + */ + PlacementPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy) + return object; + var message = new $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy(); + if (object.collocation != null) + message.collocation = String(object.collocation); + if (object.maxDistance != null) + if ($util.Long) + (message.maxDistance = $util.Long.fromValue(object.maxDistance)).unsigned = false; + else if (typeof object.maxDistance === "string") + message.maxDistance = parseInt(object.maxDistance, 10); + else if (typeof object.maxDistance === "number") + message.maxDistance = object.maxDistance; + else if (typeof object.maxDistance === "object") + message.maxDistance = new $util.LongBits(object.maxDistance.low >>> 0, object.maxDistance.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a PlacementPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.PlacementPolicy} message PlacementPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PlacementPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.collocation = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxDistance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxDistance = options.longs === String ? "0" : 0; + } + if (message.collocation != null && message.hasOwnProperty("collocation")) + object.collocation = message.collocation; + if (message.maxDistance != null && message.hasOwnProperty("maxDistance")) + if (typeof message.maxDistance === "number") + object.maxDistance = options.longs === String ? String(message.maxDistance) : message.maxDistance; + else + object.maxDistance = options.longs === String ? $util.Long.prototype.toString.call(message.maxDistance) : options.longs === Number ? new $util.LongBits(message.maxDistance.low >>> 0, message.maxDistance.high >>> 0).toNumber() : message.maxDistance; + return object; + }; + + /** + * Converts this PlacementPolicy to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy + * @instance + * @returns {Object.} JSON object + */ + PlacementPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PlacementPolicy + * @function getTypeUrl + * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PlacementPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy.PlacementPolicy"; + }; + + return PlacementPolicy; + })(); + + /** + * ProvisioningModel enum. + * @name google.cloud.batch.v1.AllocationPolicy.ProvisioningModel + * @enum {number} + * @property {number} PROVISIONING_MODEL_UNSPECIFIED=0 PROVISIONING_MODEL_UNSPECIFIED value + * @property {number} STANDARD=1 STANDARD value + * @property {number} SPOT=2 SPOT value + * @property {number} PREEMPTIBLE=3 PREEMPTIBLE value + */ + AllocationPolicy.ProvisioningModel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PROVISIONING_MODEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "STANDARD"] = 1; + values[valuesById[2] = "SPOT"] = 2; + values[valuesById[3] = "PREEMPTIBLE"] = 3; + return values; + })(); + + return AllocationPolicy; + })(); + + v1.TaskGroup = (function() { + + /** + * Properties of a TaskGroup. + * @memberof google.cloud.batch.v1 + * @interface ITaskGroup + * @property {string|null} [name] TaskGroup name + * @property {google.cloud.batch.v1.ITaskSpec|null} [taskSpec] TaskGroup taskSpec + * @property {number|Long|null} [taskCount] TaskGroup taskCount + * @property {number|Long|null} [parallelism] TaskGroup parallelism + * @property {google.cloud.batch.v1.TaskGroup.SchedulingPolicy|null} [schedulingPolicy] TaskGroup schedulingPolicy + * @property {Array.|null} [taskEnvironments] TaskGroup taskEnvironments + * @property {number|Long|null} [taskCountPerNode] TaskGroup taskCountPerNode + * @property {boolean|null} [requireHostsFile] TaskGroup requireHostsFile + * @property {boolean|null} [permissiveSsh] TaskGroup permissiveSsh + * @property {boolean|null} [runAsNonRoot] TaskGroup runAsNonRoot + */ + + /** + * Constructs a new TaskGroup. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a TaskGroup. + * @implements ITaskGroup + * @constructor + * @param {google.cloud.batch.v1.ITaskGroup=} [properties] Properties to set + */ + function TaskGroup(properties) { + this.taskEnvironments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TaskGroup name. + * @member {string} name + * @memberof google.cloud.batch.v1.TaskGroup + * @instance + */ + TaskGroup.prototype.name = ""; + + /** + * TaskGroup taskSpec. + * @member {google.cloud.batch.v1.ITaskSpec|null|undefined} taskSpec + * @memberof google.cloud.batch.v1.TaskGroup + * @instance + */ + TaskGroup.prototype.taskSpec = null; + + /** + * TaskGroup taskCount. + * @member {number|Long} taskCount + * @memberof google.cloud.batch.v1.TaskGroup + * @instance + */ + TaskGroup.prototype.taskCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TaskGroup parallelism. + * @member {number|Long} parallelism + * @memberof google.cloud.batch.v1.TaskGroup + * @instance + */ + TaskGroup.prototype.parallelism = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TaskGroup schedulingPolicy. + * @member {google.cloud.batch.v1.TaskGroup.SchedulingPolicy} schedulingPolicy + * @memberof google.cloud.batch.v1.TaskGroup + * @instance + */ + TaskGroup.prototype.schedulingPolicy = 0; + + /** + * TaskGroup taskEnvironments. + * @member {Array.} taskEnvironments + * @memberof google.cloud.batch.v1.TaskGroup + * @instance + */ + TaskGroup.prototype.taskEnvironments = $util.emptyArray; + + /** + * TaskGroup taskCountPerNode. + * @member {number|Long} taskCountPerNode + * @memberof google.cloud.batch.v1.TaskGroup + * @instance + */ + TaskGroup.prototype.taskCountPerNode = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TaskGroup requireHostsFile. + * @member {boolean} requireHostsFile + * @memberof google.cloud.batch.v1.TaskGroup + * @instance + */ + TaskGroup.prototype.requireHostsFile = false; + + /** + * TaskGroup permissiveSsh. + * @member {boolean} permissiveSsh + * @memberof google.cloud.batch.v1.TaskGroup + * @instance + */ + TaskGroup.prototype.permissiveSsh = false; + + /** + * TaskGroup runAsNonRoot. + * @member {boolean} runAsNonRoot + * @memberof google.cloud.batch.v1.TaskGroup + * @instance + */ + TaskGroup.prototype.runAsNonRoot = false; + + /** + * Creates a new TaskGroup instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.TaskGroup + * @static + * @param {google.cloud.batch.v1.ITaskGroup=} [properties] Properties to set + * @returns {google.cloud.batch.v1.TaskGroup} TaskGroup instance + */ + TaskGroup.create = function create(properties) { + return new TaskGroup(properties); + }; + + /** + * Encodes the specified TaskGroup message. Does not implicitly {@link google.cloud.batch.v1.TaskGroup.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.TaskGroup + * @static + * @param {google.cloud.batch.v1.ITaskGroup} message TaskGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskGroup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.taskSpec != null && Object.hasOwnProperty.call(message, "taskSpec")) + $root.google.cloud.batch.v1.TaskSpec.encode(message.taskSpec, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.taskCount != null && Object.hasOwnProperty.call(message, "taskCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.taskCount); + if (message.parallelism != null && Object.hasOwnProperty.call(message, "parallelism")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.parallelism); + if (message.schedulingPolicy != null && Object.hasOwnProperty.call(message, "schedulingPolicy")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.schedulingPolicy); + if (message.taskEnvironments != null && message.taskEnvironments.length) + for (var i = 0; i < message.taskEnvironments.length; ++i) + $root.google.cloud.batch.v1.Environment.encode(message.taskEnvironments[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.taskCountPerNode != null && Object.hasOwnProperty.call(message, "taskCountPerNode")) + writer.uint32(/* id 10, wireType 0 =*/80).int64(message.taskCountPerNode); + if (message.requireHostsFile != null && Object.hasOwnProperty.call(message, "requireHostsFile")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.requireHostsFile); + if (message.permissiveSsh != null && Object.hasOwnProperty.call(message, "permissiveSsh")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.permissiveSsh); + if (message.runAsNonRoot != null && Object.hasOwnProperty.call(message, "runAsNonRoot")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.runAsNonRoot); + return writer; + }; + + /** + * Encodes the specified TaskGroup message, length delimited. Does not implicitly {@link google.cloud.batch.v1.TaskGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.TaskGroup + * @static + * @param {google.cloud.batch.v1.ITaskGroup} message TaskGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TaskGroup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.TaskGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.TaskGroup} TaskGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskGroup.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.TaskGroup(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.taskSpec = $root.google.cloud.batch.v1.TaskSpec.decode(reader, reader.uint32()); + break; + } + case 4: { + message.taskCount = reader.int64(); + break; + } + case 5: { + message.parallelism = reader.int64(); + break; + } + case 6: { + message.schedulingPolicy = reader.int32(); + break; + } + case 9: { + if (!(message.taskEnvironments && message.taskEnvironments.length)) + message.taskEnvironments = []; + message.taskEnvironments.push($root.google.cloud.batch.v1.Environment.decode(reader, reader.uint32())); + break; + } + case 10: { + message.taskCountPerNode = reader.int64(); + break; + } + case 11: { + message.requireHostsFile = reader.bool(); + break; + } + case 12: { + message.permissiveSsh = reader.bool(); + break; + } + case 14: { + message.runAsNonRoot = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TaskGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.TaskGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.TaskGroup} TaskGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TaskGroup message. + * @function verify + * @memberof google.cloud.batch.v1.TaskGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TaskGroup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.taskSpec != null && message.hasOwnProperty("taskSpec")) { + var error = $root.google.cloud.batch.v1.TaskSpec.verify(message.taskSpec); + if (error) + return "taskSpec." + error; + } + if (message.taskCount != null && message.hasOwnProperty("taskCount")) + if (!$util.isInteger(message.taskCount) && !(message.taskCount && $util.isInteger(message.taskCount.low) && $util.isInteger(message.taskCount.high))) + return "taskCount: integer|Long expected"; + if (message.parallelism != null && message.hasOwnProperty("parallelism")) + if (!$util.isInteger(message.parallelism) && !(message.parallelism && $util.isInteger(message.parallelism.low) && $util.isInteger(message.parallelism.high))) + return "parallelism: integer|Long expected"; + if (message.schedulingPolicy != null && message.hasOwnProperty("schedulingPolicy")) + switch (message.schedulingPolicy) { + default: + return "schedulingPolicy: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.taskEnvironments != null && message.hasOwnProperty("taskEnvironments")) { + if (!Array.isArray(message.taskEnvironments)) + return "taskEnvironments: array expected"; + for (var i = 0; i < message.taskEnvironments.length; ++i) { + var error = $root.google.cloud.batch.v1.Environment.verify(message.taskEnvironments[i]); + if (error) + return "taskEnvironments." + error; + } + } + if (message.taskCountPerNode != null && message.hasOwnProperty("taskCountPerNode")) + if (!$util.isInteger(message.taskCountPerNode) && !(message.taskCountPerNode && $util.isInteger(message.taskCountPerNode.low) && $util.isInteger(message.taskCountPerNode.high))) + return "taskCountPerNode: integer|Long expected"; + if (message.requireHostsFile != null && message.hasOwnProperty("requireHostsFile")) + if (typeof message.requireHostsFile !== "boolean") + return "requireHostsFile: boolean expected"; + if (message.permissiveSsh != null && message.hasOwnProperty("permissiveSsh")) + if (typeof message.permissiveSsh !== "boolean") + return "permissiveSsh: boolean expected"; + if (message.runAsNonRoot != null && message.hasOwnProperty("runAsNonRoot")) + if (typeof message.runAsNonRoot !== "boolean") + return "runAsNonRoot: boolean expected"; + return null; + }; + + /** + * Creates a TaskGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.TaskGroup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.TaskGroup} TaskGroup + */ + TaskGroup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.TaskGroup) + return object; + var message = new $root.google.cloud.batch.v1.TaskGroup(); + if (object.name != null) + message.name = String(object.name); + if (object.taskSpec != null) { + if (typeof object.taskSpec !== "object") + throw TypeError(".google.cloud.batch.v1.TaskGroup.taskSpec: object expected"); + message.taskSpec = $root.google.cloud.batch.v1.TaskSpec.fromObject(object.taskSpec); + } + if (object.taskCount != null) + if ($util.Long) + (message.taskCount = $util.Long.fromValue(object.taskCount)).unsigned = false; + else if (typeof object.taskCount === "string") + message.taskCount = parseInt(object.taskCount, 10); + else if (typeof object.taskCount === "number") + message.taskCount = object.taskCount; + else if (typeof object.taskCount === "object") + message.taskCount = new $util.LongBits(object.taskCount.low >>> 0, object.taskCount.high >>> 0).toNumber(); + if (object.parallelism != null) + if ($util.Long) + (message.parallelism = $util.Long.fromValue(object.parallelism)).unsigned = false; + else if (typeof object.parallelism === "string") + message.parallelism = parseInt(object.parallelism, 10); + else if (typeof object.parallelism === "number") + message.parallelism = object.parallelism; + else if (typeof object.parallelism === "object") + message.parallelism = new $util.LongBits(object.parallelism.low >>> 0, object.parallelism.high >>> 0).toNumber(); + switch (object.schedulingPolicy) { + default: + if (typeof object.schedulingPolicy === "number") { + message.schedulingPolicy = object.schedulingPolicy; + break; + } + break; + case "SCHEDULING_POLICY_UNSPECIFIED": + case 0: + message.schedulingPolicy = 0; + break; + case "AS_SOON_AS_POSSIBLE": + case 1: + message.schedulingPolicy = 1; + break; + case "IN_ORDER": + case 2: + message.schedulingPolicy = 2; + break; + } + if (object.taskEnvironments) { + if (!Array.isArray(object.taskEnvironments)) + throw TypeError(".google.cloud.batch.v1.TaskGroup.taskEnvironments: array expected"); + message.taskEnvironments = []; + for (var i = 0; i < object.taskEnvironments.length; ++i) { + if (typeof object.taskEnvironments[i] !== "object") + throw TypeError(".google.cloud.batch.v1.TaskGroup.taskEnvironments: object expected"); + message.taskEnvironments[i] = $root.google.cloud.batch.v1.Environment.fromObject(object.taskEnvironments[i]); + } + } + if (object.taskCountPerNode != null) + if ($util.Long) + (message.taskCountPerNode = $util.Long.fromValue(object.taskCountPerNode)).unsigned = false; + else if (typeof object.taskCountPerNode === "string") + message.taskCountPerNode = parseInt(object.taskCountPerNode, 10); + else if (typeof object.taskCountPerNode === "number") + message.taskCountPerNode = object.taskCountPerNode; + else if (typeof object.taskCountPerNode === "object") + message.taskCountPerNode = new $util.LongBits(object.taskCountPerNode.low >>> 0, object.taskCountPerNode.high >>> 0).toNumber(); + if (object.requireHostsFile != null) + message.requireHostsFile = Boolean(object.requireHostsFile); + if (object.permissiveSsh != null) + message.permissiveSsh = Boolean(object.permissiveSsh); + if (object.runAsNonRoot != null) + message.runAsNonRoot = Boolean(object.runAsNonRoot); + return message; + }; + + /** + * Creates a plain object from a TaskGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.TaskGroup + * @static + * @param {google.cloud.batch.v1.TaskGroup} message TaskGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TaskGroup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.taskEnvironments = []; + if (options.defaults) { + object.name = ""; + object.taskSpec = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.taskCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.taskCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.parallelism = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.parallelism = options.longs === String ? "0" : 0; + object.schedulingPolicy = options.enums === String ? "SCHEDULING_POLICY_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.taskCountPerNode = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.taskCountPerNode = options.longs === String ? "0" : 0; + object.requireHostsFile = false; + object.permissiveSsh = false; + object.runAsNonRoot = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.taskSpec != null && message.hasOwnProperty("taskSpec")) + object.taskSpec = $root.google.cloud.batch.v1.TaskSpec.toObject(message.taskSpec, options); + if (message.taskCount != null && message.hasOwnProperty("taskCount")) + if (typeof message.taskCount === "number") + object.taskCount = options.longs === String ? String(message.taskCount) : message.taskCount; + else + object.taskCount = options.longs === String ? $util.Long.prototype.toString.call(message.taskCount) : options.longs === Number ? new $util.LongBits(message.taskCount.low >>> 0, message.taskCount.high >>> 0).toNumber() : message.taskCount; + if (message.parallelism != null && message.hasOwnProperty("parallelism")) + if (typeof message.parallelism === "number") + object.parallelism = options.longs === String ? String(message.parallelism) : message.parallelism; + else + object.parallelism = options.longs === String ? $util.Long.prototype.toString.call(message.parallelism) : options.longs === Number ? new $util.LongBits(message.parallelism.low >>> 0, message.parallelism.high >>> 0).toNumber() : message.parallelism; + if (message.schedulingPolicy != null && message.hasOwnProperty("schedulingPolicy")) + object.schedulingPolicy = options.enums === String ? $root.google.cloud.batch.v1.TaskGroup.SchedulingPolicy[message.schedulingPolicy] === undefined ? message.schedulingPolicy : $root.google.cloud.batch.v1.TaskGroup.SchedulingPolicy[message.schedulingPolicy] : message.schedulingPolicy; + if (message.taskEnvironments && message.taskEnvironments.length) { + object.taskEnvironments = []; + for (var j = 0; j < message.taskEnvironments.length; ++j) + object.taskEnvironments[j] = $root.google.cloud.batch.v1.Environment.toObject(message.taskEnvironments[j], options); + } + if (message.taskCountPerNode != null && message.hasOwnProperty("taskCountPerNode")) + if (typeof message.taskCountPerNode === "number") + object.taskCountPerNode = options.longs === String ? String(message.taskCountPerNode) : message.taskCountPerNode; + else + object.taskCountPerNode = options.longs === String ? $util.Long.prototype.toString.call(message.taskCountPerNode) : options.longs === Number ? new $util.LongBits(message.taskCountPerNode.low >>> 0, message.taskCountPerNode.high >>> 0).toNumber() : message.taskCountPerNode; + if (message.requireHostsFile != null && message.hasOwnProperty("requireHostsFile")) + object.requireHostsFile = message.requireHostsFile; + if (message.permissiveSsh != null && message.hasOwnProperty("permissiveSsh")) + object.permissiveSsh = message.permissiveSsh; + if (message.runAsNonRoot != null && message.hasOwnProperty("runAsNonRoot")) + object.runAsNonRoot = message.runAsNonRoot; + return object; + }; + + /** + * Converts this TaskGroup to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.TaskGroup + * @instance + * @returns {Object.} JSON object + */ + TaskGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TaskGroup + * @function getTypeUrl + * @memberof google.cloud.batch.v1.TaskGroup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TaskGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.TaskGroup"; + }; + + /** + * SchedulingPolicy enum. + * @name google.cloud.batch.v1.TaskGroup.SchedulingPolicy + * @enum {number} + * @property {number} SCHEDULING_POLICY_UNSPECIFIED=0 SCHEDULING_POLICY_UNSPECIFIED value + * @property {number} AS_SOON_AS_POSSIBLE=1 AS_SOON_AS_POSSIBLE value + * @property {number} IN_ORDER=2 IN_ORDER value + */ + TaskGroup.SchedulingPolicy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SCHEDULING_POLICY_UNSPECIFIED"] = 0; + values[valuesById[1] = "AS_SOON_AS_POSSIBLE"] = 1; + values[valuesById[2] = "IN_ORDER"] = 2; + return values; + })(); + + return TaskGroup; + })(); + + v1.ServiceAccount = (function() { + + /** + * Properties of a ServiceAccount. + * @memberof google.cloud.batch.v1 + * @interface IServiceAccount + * @property {string|null} [email] ServiceAccount email + * @property {Array.|null} [scopes] ServiceAccount scopes + */ + + /** + * Constructs a new ServiceAccount. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a ServiceAccount. + * @implements IServiceAccount + * @constructor + * @param {google.cloud.batch.v1.IServiceAccount=} [properties] Properties to set + */ + function ServiceAccount(properties) { + this.scopes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceAccount email. + * @member {string} email + * @memberof google.cloud.batch.v1.ServiceAccount + * @instance + */ + ServiceAccount.prototype.email = ""; + + /** + * ServiceAccount scopes. + * @member {Array.} scopes + * @memberof google.cloud.batch.v1.ServiceAccount + * @instance + */ + ServiceAccount.prototype.scopes = $util.emptyArray; + + /** + * Creates a new ServiceAccount instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.ServiceAccount + * @static + * @param {google.cloud.batch.v1.IServiceAccount=} [properties] Properties to set + * @returns {google.cloud.batch.v1.ServiceAccount} ServiceAccount instance + */ + ServiceAccount.create = function create(properties) { + return new ServiceAccount(properties); + }; + + /** + * Encodes the specified ServiceAccount message. Does not implicitly {@link google.cloud.batch.v1.ServiceAccount.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.ServiceAccount + * @static + * @param {google.cloud.batch.v1.IServiceAccount} message ServiceAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAccount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.email != null && Object.hasOwnProperty.call(message, "email")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.email); + if (message.scopes != null && message.scopes.length) + for (var i = 0; i < message.scopes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.scopes[i]); + return writer; + }; + + /** + * Encodes the specified ServiceAccount message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ServiceAccount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.ServiceAccount + * @static + * @param {google.cloud.batch.v1.IServiceAccount} message ServiceAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAccount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceAccount message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.ServiceAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.ServiceAccount} ServiceAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAccount.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.ServiceAccount(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.email = reader.string(); + break; + } + case 2: { + if (!(message.scopes && message.scopes.length)) + message.scopes = []; + message.scopes.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceAccount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.ServiceAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.ServiceAccount} ServiceAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAccount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceAccount message. + * @function verify + * @memberof google.cloud.batch.v1.ServiceAccount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceAccount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.email != null && message.hasOwnProperty("email")) + if (!$util.isString(message.email)) + return "email: string expected"; + if (message.scopes != null && message.hasOwnProperty("scopes")) { + if (!Array.isArray(message.scopes)) + return "scopes: array expected"; + for (var i = 0; i < message.scopes.length; ++i) + if (!$util.isString(message.scopes[i])) + return "scopes: string[] expected"; + } + return null; + }; + + /** + * Creates a ServiceAccount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.ServiceAccount + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.ServiceAccount} ServiceAccount + */ + ServiceAccount.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.ServiceAccount) + return object; + var message = new $root.google.cloud.batch.v1.ServiceAccount(); + if (object.email != null) + message.email = String(object.email); + if (object.scopes) { + if (!Array.isArray(object.scopes)) + throw TypeError(".google.cloud.batch.v1.ServiceAccount.scopes: array expected"); + message.scopes = []; + for (var i = 0; i < object.scopes.length; ++i) + message.scopes[i] = String(object.scopes[i]); + } + return message; + }; + + /** + * Creates a plain object from a ServiceAccount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.ServiceAccount + * @static + * @param {google.cloud.batch.v1.ServiceAccount} message ServiceAccount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceAccount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.scopes = []; + if (options.defaults) + object.email = ""; + if (message.email != null && message.hasOwnProperty("email")) + object.email = message.email; + if (message.scopes && message.scopes.length) { + object.scopes = []; + for (var j = 0; j < message.scopes.length; ++j) + object.scopes[j] = message.scopes[j]; + } + return object; + }; + + /** + * Converts this ServiceAccount to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.ServiceAccount + * @instance + * @returns {Object.} JSON object + */ + ServiceAccount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceAccount + * @function getTypeUrl + * @memberof google.cloud.batch.v1.ServiceAccount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceAccount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.ServiceAccount"; + }; + + return ServiceAccount; + })(); + + v1.ComputeResource = (function() { + + /** + * Properties of a ComputeResource. + * @memberof google.cloud.batch.v1 + * @interface IComputeResource + * @property {number|Long|null} [cpuMilli] ComputeResource cpuMilli + * @property {number|Long|null} [memoryMib] ComputeResource memoryMib + * @property {number|Long|null} [bootDiskMib] ComputeResource bootDiskMib + */ + + /** + * Constructs a new ComputeResource. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a ComputeResource. + * @implements IComputeResource + * @constructor + * @param {google.cloud.batch.v1.IComputeResource=} [properties] Properties to set + */ + function ComputeResource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ComputeResource cpuMilli. + * @member {number|Long} cpuMilli + * @memberof google.cloud.batch.v1.ComputeResource + * @instance + */ + ComputeResource.prototype.cpuMilli = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ComputeResource memoryMib. + * @member {number|Long} memoryMib + * @memberof google.cloud.batch.v1.ComputeResource + * @instance + */ + ComputeResource.prototype.memoryMib = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ComputeResource bootDiskMib. + * @member {number|Long} bootDiskMib + * @memberof google.cloud.batch.v1.ComputeResource + * @instance + */ + ComputeResource.prototype.bootDiskMib = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ComputeResource instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.ComputeResource + * @static + * @param {google.cloud.batch.v1.IComputeResource=} [properties] Properties to set + * @returns {google.cloud.batch.v1.ComputeResource} ComputeResource instance + */ + ComputeResource.create = function create(properties) { + return new ComputeResource(properties); + }; + + /** + * Encodes the specified ComputeResource message. Does not implicitly {@link google.cloud.batch.v1.ComputeResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.ComputeResource + * @static + * @param {google.cloud.batch.v1.IComputeResource} message ComputeResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cpuMilli != null && Object.hasOwnProperty.call(message, "cpuMilli")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.cpuMilli); + if (message.memoryMib != null && Object.hasOwnProperty.call(message, "memoryMib")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.memoryMib); + if (message.bootDiskMib != null && Object.hasOwnProperty.call(message, "bootDiskMib")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.bootDiskMib); + return writer; + }; + + /** + * Encodes the specified ComputeResource message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ComputeResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.ComputeResource + * @static + * @param {google.cloud.batch.v1.IComputeResource} message ComputeResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ComputeResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.ComputeResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.ComputeResource} ComputeResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeResource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.ComputeResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cpuMilli = reader.int64(); + break; + } + case 2: { + message.memoryMib = reader.int64(); + break; + } + case 4: { + message.bootDiskMib = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ComputeResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.ComputeResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.ComputeResource} ComputeResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ComputeResource message. + * @function verify + * @memberof google.cloud.batch.v1.ComputeResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ComputeResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cpuMilli != null && message.hasOwnProperty("cpuMilli")) + if (!$util.isInteger(message.cpuMilli) && !(message.cpuMilli && $util.isInteger(message.cpuMilli.low) && $util.isInteger(message.cpuMilli.high))) + return "cpuMilli: integer|Long expected"; + if (message.memoryMib != null && message.hasOwnProperty("memoryMib")) + if (!$util.isInteger(message.memoryMib) && !(message.memoryMib && $util.isInteger(message.memoryMib.low) && $util.isInteger(message.memoryMib.high))) + return "memoryMib: integer|Long expected"; + if (message.bootDiskMib != null && message.hasOwnProperty("bootDiskMib")) + if (!$util.isInteger(message.bootDiskMib) && !(message.bootDiskMib && $util.isInteger(message.bootDiskMib.low) && $util.isInteger(message.bootDiskMib.high))) + return "bootDiskMib: integer|Long expected"; + return null; + }; + + /** + * Creates a ComputeResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.ComputeResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.ComputeResource} ComputeResource + */ + ComputeResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.ComputeResource) + return object; + var message = new $root.google.cloud.batch.v1.ComputeResource(); + if (object.cpuMilli != null) + if ($util.Long) + (message.cpuMilli = $util.Long.fromValue(object.cpuMilli)).unsigned = false; + else if (typeof object.cpuMilli === "string") + message.cpuMilli = parseInt(object.cpuMilli, 10); + else if (typeof object.cpuMilli === "number") + message.cpuMilli = object.cpuMilli; + else if (typeof object.cpuMilli === "object") + message.cpuMilli = new $util.LongBits(object.cpuMilli.low >>> 0, object.cpuMilli.high >>> 0).toNumber(); + if (object.memoryMib != null) + if ($util.Long) + (message.memoryMib = $util.Long.fromValue(object.memoryMib)).unsigned = false; + else if (typeof object.memoryMib === "string") + message.memoryMib = parseInt(object.memoryMib, 10); + else if (typeof object.memoryMib === "number") + message.memoryMib = object.memoryMib; + else if (typeof object.memoryMib === "object") + message.memoryMib = new $util.LongBits(object.memoryMib.low >>> 0, object.memoryMib.high >>> 0).toNumber(); + if (object.bootDiskMib != null) + if ($util.Long) + (message.bootDiskMib = $util.Long.fromValue(object.bootDiskMib)).unsigned = false; + else if (typeof object.bootDiskMib === "string") + message.bootDiskMib = parseInt(object.bootDiskMib, 10); + else if (typeof object.bootDiskMib === "number") + message.bootDiskMib = object.bootDiskMib; + else if (typeof object.bootDiskMib === "object") + message.bootDiskMib = new $util.LongBits(object.bootDiskMib.low >>> 0, object.bootDiskMib.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ComputeResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.ComputeResource + * @static + * @param {google.cloud.batch.v1.ComputeResource} message ComputeResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ComputeResource.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.cpuMilli = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.cpuMilli = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.memoryMib = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.memoryMib = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bootDiskMib = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bootDiskMib = options.longs === String ? "0" : 0; + } + if (message.cpuMilli != null && message.hasOwnProperty("cpuMilli")) + if (typeof message.cpuMilli === "number") + object.cpuMilli = options.longs === String ? String(message.cpuMilli) : message.cpuMilli; + else + object.cpuMilli = options.longs === String ? $util.Long.prototype.toString.call(message.cpuMilli) : options.longs === Number ? new $util.LongBits(message.cpuMilli.low >>> 0, message.cpuMilli.high >>> 0).toNumber() : message.cpuMilli; + if (message.memoryMib != null && message.hasOwnProperty("memoryMib")) + if (typeof message.memoryMib === "number") + object.memoryMib = options.longs === String ? String(message.memoryMib) : message.memoryMib; + else + object.memoryMib = options.longs === String ? $util.Long.prototype.toString.call(message.memoryMib) : options.longs === Number ? new $util.LongBits(message.memoryMib.low >>> 0, message.memoryMib.high >>> 0).toNumber() : message.memoryMib; + if (message.bootDiskMib != null && message.hasOwnProperty("bootDiskMib")) + if (typeof message.bootDiskMib === "number") + object.bootDiskMib = options.longs === String ? String(message.bootDiskMib) : message.bootDiskMib; + else + object.bootDiskMib = options.longs === String ? $util.Long.prototype.toString.call(message.bootDiskMib) : options.longs === Number ? new $util.LongBits(message.bootDiskMib.low >>> 0, message.bootDiskMib.high >>> 0).toNumber() : message.bootDiskMib; + return object; + }; + + /** + * Converts this ComputeResource to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.ComputeResource + * @instance + * @returns {Object.} JSON object + */ + ComputeResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ComputeResource + * @function getTypeUrl + * @memberof google.cloud.batch.v1.ComputeResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ComputeResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.ComputeResource"; + }; + + return ComputeResource; + })(); + + v1.StatusEvent = (function() { + + /** + * Properties of a StatusEvent. + * @memberof google.cloud.batch.v1 + * @interface IStatusEvent + * @property {string|null} [type] StatusEvent type + * @property {string|null} [description] StatusEvent description + * @property {google.protobuf.ITimestamp|null} [eventTime] StatusEvent eventTime + * @property {google.cloud.batch.v1.ITaskExecution|null} [taskExecution] StatusEvent taskExecution + * @property {google.cloud.batch.v1.TaskStatus.State|null} [taskState] StatusEvent taskState + */ + + /** + * Constructs a new StatusEvent. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a StatusEvent. + * @implements IStatusEvent + * @constructor + * @param {google.cloud.batch.v1.IStatusEvent=} [properties] Properties to set + */ + function StatusEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StatusEvent type. + * @member {string} type + * @memberof google.cloud.batch.v1.StatusEvent + * @instance + */ + StatusEvent.prototype.type = ""; + + /** + * StatusEvent description. + * @member {string} description + * @memberof google.cloud.batch.v1.StatusEvent + * @instance + */ + StatusEvent.prototype.description = ""; + + /** + * StatusEvent eventTime. + * @member {google.protobuf.ITimestamp|null|undefined} eventTime + * @memberof google.cloud.batch.v1.StatusEvent + * @instance + */ + StatusEvent.prototype.eventTime = null; + + /** + * StatusEvent taskExecution. + * @member {google.cloud.batch.v1.ITaskExecution|null|undefined} taskExecution + * @memberof google.cloud.batch.v1.StatusEvent + * @instance + */ + StatusEvent.prototype.taskExecution = null; + + /** + * StatusEvent taskState. + * @member {google.cloud.batch.v1.TaskStatus.State} taskState + * @memberof google.cloud.batch.v1.StatusEvent + * @instance + */ + StatusEvent.prototype.taskState = 0; + + /** + * Creates a new StatusEvent instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.StatusEvent + * @static + * @param {google.cloud.batch.v1.IStatusEvent=} [properties] Properties to set + * @returns {google.cloud.batch.v1.StatusEvent} StatusEvent instance + */ + StatusEvent.create = function create(properties) { + return new StatusEvent(properties); + }; + + /** + * Encodes the specified StatusEvent message. Does not implicitly {@link google.cloud.batch.v1.StatusEvent.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.StatusEvent + * @static + * @param {google.cloud.batch.v1.IStatusEvent} message StatusEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StatusEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); + if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) + $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.taskExecution != null && Object.hasOwnProperty.call(message, "taskExecution")) + $root.google.cloud.batch.v1.TaskExecution.encode(message.taskExecution, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.taskState != null && Object.hasOwnProperty.call(message, "taskState")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.taskState); + return writer; + }; + + /** + * Encodes the specified StatusEvent message, length delimited. Does not implicitly {@link google.cloud.batch.v1.StatusEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.StatusEvent + * @static + * @param {google.cloud.batch.v1.IStatusEvent} message StatusEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StatusEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StatusEvent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.StatusEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.StatusEvent} StatusEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StatusEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.StatusEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.type = reader.string(); + break; + } + case 1: { + message.description = reader.string(); + break; + } + case 2: { + message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.taskExecution = $root.google.cloud.batch.v1.TaskExecution.decode(reader, reader.uint32()); + break; + } + case 5: { + message.taskState = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StatusEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.StatusEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.StatusEvent} StatusEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StatusEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StatusEvent message. + * @function verify + * @memberof google.cloud.batch.v1.StatusEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StatusEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.eventTime != null && message.hasOwnProperty("eventTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.eventTime); + if (error) + return "eventTime." + error; + } + if (message.taskExecution != null && message.hasOwnProperty("taskExecution")) { + var error = $root.google.cloud.batch.v1.TaskExecution.verify(message.taskExecution); + if (error) + return "taskExecution." + error; + } + if (message.taskState != null && message.hasOwnProperty("taskState")) + switch (message.taskState) { + default: + return "taskState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + return null; + }; + + /** + * Creates a StatusEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.StatusEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.StatusEvent} StatusEvent + */ + StatusEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.StatusEvent) + return object; + var message = new $root.google.cloud.batch.v1.StatusEvent(); + if (object.type != null) + message.type = String(object.type); + if (object.description != null) + message.description = String(object.description); + if (object.eventTime != null) { + if (typeof object.eventTime !== "object") + throw TypeError(".google.cloud.batch.v1.StatusEvent.eventTime: object expected"); + message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); + } + if (object.taskExecution != null) { + if (typeof object.taskExecution !== "object") + throw TypeError(".google.cloud.batch.v1.StatusEvent.taskExecution: object expected"); + message.taskExecution = $root.google.cloud.batch.v1.TaskExecution.fromObject(object.taskExecution); + } + switch (object.taskState) { + default: + if (typeof object.taskState === "number") { + message.taskState = object.taskState; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.taskState = 0; + break; + case "PENDING": + case 1: + message.taskState = 1; + break; + case "ASSIGNED": + case 2: + message.taskState = 2; + break; + case "RUNNING": + case 3: + message.taskState = 3; + break; + case "FAILED": + case 4: + message.taskState = 4; + break; + case "SUCCEEDED": + case 5: + message.taskState = 5; + break; + case "UNEXECUTED": + case 6: + message.taskState = 6; + break; + } + return message; + }; + + /** + * Creates a plain object from a StatusEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.StatusEvent + * @static + * @param {google.cloud.batch.v1.StatusEvent} message StatusEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StatusEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.description = ""; + object.eventTime = null; + object.type = ""; + object.taskExecution = null; + object.taskState = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.eventTime != null && message.hasOwnProperty("eventTime")) + object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.taskExecution != null && message.hasOwnProperty("taskExecution")) + object.taskExecution = $root.google.cloud.batch.v1.TaskExecution.toObject(message.taskExecution, options); + if (message.taskState != null && message.hasOwnProperty("taskState")) + object.taskState = options.enums === String ? $root.google.cloud.batch.v1.TaskStatus.State[message.taskState] === undefined ? message.taskState : $root.google.cloud.batch.v1.TaskStatus.State[message.taskState] : message.taskState; + return object; + }; + + /** + * Converts this StatusEvent to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.StatusEvent + * @instance + * @returns {Object.} JSON object + */ + StatusEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StatusEvent + * @function getTypeUrl + * @memberof google.cloud.batch.v1.StatusEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StatusEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.StatusEvent"; + }; + + return StatusEvent; + })(); + + v1.TaskExecution = (function() { + + /** + * Properties of a TaskExecution. + * @memberof google.cloud.batch.v1 + * @interface ITaskExecution + * @property {number|null} [exitCode] TaskExecution exitCode + */ + + /** + * Constructs a new TaskExecution. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a TaskExecution. + * @implements ITaskExecution + * @constructor + * @param {google.cloud.batch.v1.ITaskExecution=} [properties] Properties to set + */ + function TaskExecution(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TaskExecution exitCode. + * @member {number} exitCode + * @memberof google.cloud.batch.v1.TaskExecution + * @instance + */ + TaskExecution.prototype.exitCode = 0; + + /** + * Creates a new TaskExecution instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.TaskExecution + * @static + * @param {google.cloud.batch.v1.ITaskExecution=} [properties] Properties to set + * @returns {google.cloud.batch.v1.TaskExecution} TaskExecution instance + */ + TaskExecution.create = function create(properties) { + return new TaskExecution(properties); + }; + + /** + * Encodes the specified TaskExecution message. Does not implicitly {@link google.cloud.batch.v1.TaskExecution.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.TaskExecution + * @static + * @param {google.cloud.batch.v1.ITaskExecution} message TaskExecution message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskExecution.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.exitCode != null && Object.hasOwnProperty.call(message, "exitCode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.exitCode); + return writer; + }; + + /** + * Encodes the specified TaskExecution message, length delimited. Does not implicitly {@link google.cloud.batch.v1.TaskExecution.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.TaskExecution + * @static + * @param {google.cloud.batch.v1.ITaskExecution} message TaskExecution message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskExecution.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TaskExecution message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.TaskExecution + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.TaskExecution} TaskExecution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskExecution.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.TaskExecution(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.exitCode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TaskExecution message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.TaskExecution + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.TaskExecution} TaskExecution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskExecution.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TaskExecution message. + * @function verify + * @memberof google.cloud.batch.v1.TaskExecution + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TaskExecution.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.exitCode != null && message.hasOwnProperty("exitCode")) + if (!$util.isInteger(message.exitCode)) + return "exitCode: integer expected"; + return null; + }; + + /** + * Creates a TaskExecution message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.TaskExecution + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.TaskExecution} TaskExecution + */ + TaskExecution.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.TaskExecution) + return object; + var message = new $root.google.cloud.batch.v1.TaskExecution(); + if (object.exitCode != null) + message.exitCode = object.exitCode | 0; + return message; + }; + + /** + * Creates a plain object from a TaskExecution message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.TaskExecution + * @static + * @param {google.cloud.batch.v1.TaskExecution} message TaskExecution + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TaskExecution.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.exitCode = 0; + if (message.exitCode != null && message.hasOwnProperty("exitCode")) + object.exitCode = message.exitCode; + return object; + }; + + /** + * Converts this TaskExecution to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.TaskExecution + * @instance + * @returns {Object.} JSON object + */ + TaskExecution.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TaskExecution + * @function getTypeUrl + * @memberof google.cloud.batch.v1.TaskExecution + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TaskExecution.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.TaskExecution"; + }; + + return TaskExecution; + })(); + + v1.TaskStatus = (function() { + + /** + * Properties of a TaskStatus. + * @memberof google.cloud.batch.v1 + * @interface ITaskStatus + * @property {google.cloud.batch.v1.TaskStatus.State|null} [state] TaskStatus state + * @property {Array.|null} [statusEvents] TaskStatus statusEvents + */ + + /** + * Constructs a new TaskStatus. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a TaskStatus. + * @implements ITaskStatus + * @constructor + * @param {google.cloud.batch.v1.ITaskStatus=} [properties] Properties to set + */ + function TaskStatus(properties) { + this.statusEvents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TaskStatus state. + * @member {google.cloud.batch.v1.TaskStatus.State} state + * @memberof google.cloud.batch.v1.TaskStatus + * @instance + */ + TaskStatus.prototype.state = 0; + + /** + * TaskStatus statusEvents. + * @member {Array.} statusEvents + * @memberof google.cloud.batch.v1.TaskStatus + * @instance + */ + TaskStatus.prototype.statusEvents = $util.emptyArray; + + /** + * Creates a new TaskStatus instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.TaskStatus + * @static + * @param {google.cloud.batch.v1.ITaskStatus=} [properties] Properties to set + * @returns {google.cloud.batch.v1.TaskStatus} TaskStatus instance + */ + TaskStatus.create = function create(properties) { + return new TaskStatus(properties); + }; + + /** + * Encodes the specified TaskStatus message. Does not implicitly {@link google.cloud.batch.v1.TaskStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.TaskStatus + * @static + * @param {google.cloud.batch.v1.ITaskStatus} message TaskStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskStatus.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); + if (message.statusEvents != null && message.statusEvents.length) + for (var i = 0; i < message.statusEvents.length; ++i) + $root.google.cloud.batch.v1.StatusEvent.encode(message.statusEvents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TaskStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1.TaskStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.TaskStatus + * @static + * @param {google.cloud.batch.v1.ITaskStatus} message TaskStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TaskStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.TaskStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.TaskStatus} TaskStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.TaskStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + if (!(message.statusEvents && message.statusEvents.length)) + message.statusEvents = []; + message.statusEvents.push($root.google.cloud.batch.v1.StatusEvent.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TaskStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.TaskStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.TaskStatus} TaskStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TaskStatus message. + * @function verify + * @memberof google.cloud.batch.v1.TaskStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TaskStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.statusEvents != null && message.hasOwnProperty("statusEvents")) { + if (!Array.isArray(message.statusEvents)) + return "statusEvents: array expected"; + for (var i = 0; i < message.statusEvents.length; ++i) { + var error = $root.google.cloud.batch.v1.StatusEvent.verify(message.statusEvents[i]); + if (error) + return "statusEvents." + error; + } + } + return null; + }; + + /** + * Creates a TaskStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.TaskStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.TaskStatus} TaskStatus + */ + TaskStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.TaskStatus) + return object; + var message = new $root.google.cloud.batch.v1.TaskStatus(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING": + case 1: + message.state = 1; + break; + case "ASSIGNED": + case 2: + message.state = 2; + break; + case "RUNNING": + case 3: + message.state = 3; + break; + case "FAILED": + case 4: + message.state = 4; + break; + case "SUCCEEDED": + case 5: + message.state = 5; + break; + case "UNEXECUTED": + case 6: + message.state = 6; + break; + } + if (object.statusEvents) { + if (!Array.isArray(object.statusEvents)) + throw TypeError(".google.cloud.batch.v1.TaskStatus.statusEvents: array expected"); + message.statusEvents = []; + for (var i = 0; i < object.statusEvents.length; ++i) { + if (typeof object.statusEvents[i] !== "object") + throw TypeError(".google.cloud.batch.v1.TaskStatus.statusEvents: object expected"); + message.statusEvents[i] = $root.google.cloud.batch.v1.StatusEvent.fromObject(object.statusEvents[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TaskStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.TaskStatus + * @static + * @param {google.cloud.batch.v1.TaskStatus} message TaskStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TaskStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.statusEvents = []; + if (options.defaults) + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.batch.v1.TaskStatus.State[message.state] === undefined ? message.state : $root.google.cloud.batch.v1.TaskStatus.State[message.state] : message.state; + if (message.statusEvents && message.statusEvents.length) { + object.statusEvents = []; + for (var j = 0; j < message.statusEvents.length; ++j) + object.statusEvents[j] = $root.google.cloud.batch.v1.StatusEvent.toObject(message.statusEvents[j], options); + } + return object; + }; + + /** + * Converts this TaskStatus to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.TaskStatus + * @instance + * @returns {Object.} JSON object + */ + TaskStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TaskStatus + * @function getTypeUrl + * @memberof google.cloud.batch.v1.TaskStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TaskStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.TaskStatus"; + }; + + /** + * State enum. + * @name google.cloud.batch.v1.TaskStatus.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PENDING=1 PENDING value + * @property {number} ASSIGNED=2 ASSIGNED value + * @property {number} RUNNING=3 RUNNING value + * @property {number} FAILED=4 FAILED value + * @property {number} SUCCEEDED=5 SUCCEEDED value + * @property {number} UNEXECUTED=6 UNEXECUTED value + */ + TaskStatus.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "ASSIGNED"] = 2; + values[valuesById[3] = "RUNNING"] = 3; + values[valuesById[4] = "FAILED"] = 4; + values[valuesById[5] = "SUCCEEDED"] = 5; + values[valuesById[6] = "UNEXECUTED"] = 6; + return values; + })(); + + return TaskStatus; + })(); + + v1.Runnable = (function() { + + /** + * Properties of a Runnable. + * @memberof google.cloud.batch.v1 + * @interface IRunnable + * @property {google.cloud.batch.v1.Runnable.IContainer|null} [container] Runnable container + * @property {google.cloud.batch.v1.Runnable.IScript|null} [script] Runnable script + * @property {google.cloud.batch.v1.Runnable.IBarrier|null} [barrier] Runnable barrier + * @property {string|null} [displayName] Runnable displayName + * @property {boolean|null} [ignoreExitStatus] Runnable ignoreExitStatus + * @property {boolean|null} [background] Runnable background + * @property {boolean|null} [alwaysRun] Runnable alwaysRun + * @property {google.cloud.batch.v1.IEnvironment|null} [environment] Runnable environment + * @property {google.protobuf.IDuration|null} [timeout] Runnable timeout + * @property {Object.|null} [labels] Runnable labels + */ + + /** + * Constructs a new Runnable. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a Runnable. + * @implements IRunnable + * @constructor + * @param {google.cloud.batch.v1.IRunnable=} [properties] Properties to set + */ + function Runnable(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Runnable container. + * @member {google.cloud.batch.v1.Runnable.IContainer|null|undefined} container + * @memberof google.cloud.batch.v1.Runnable + * @instance + */ + Runnable.prototype.container = null; + + /** + * Runnable script. + * @member {google.cloud.batch.v1.Runnable.IScript|null|undefined} script + * @memberof google.cloud.batch.v1.Runnable + * @instance + */ + Runnable.prototype.script = null; + + /** + * Runnable barrier. + * @member {google.cloud.batch.v1.Runnable.IBarrier|null|undefined} barrier + * @memberof google.cloud.batch.v1.Runnable + * @instance + */ + Runnable.prototype.barrier = null; + + /** + * Runnable displayName. + * @member {string} displayName + * @memberof google.cloud.batch.v1.Runnable + * @instance + */ + Runnable.prototype.displayName = ""; + + /** + * Runnable ignoreExitStatus. + * @member {boolean} ignoreExitStatus + * @memberof google.cloud.batch.v1.Runnable + * @instance + */ + Runnable.prototype.ignoreExitStatus = false; + + /** + * Runnable background. + * @member {boolean} background + * @memberof google.cloud.batch.v1.Runnable + * @instance + */ + Runnable.prototype.background = false; + + /** + * Runnable alwaysRun. + * @member {boolean} alwaysRun + * @memberof google.cloud.batch.v1.Runnable + * @instance + */ + Runnable.prototype.alwaysRun = false; + + /** + * Runnable environment. + * @member {google.cloud.batch.v1.IEnvironment|null|undefined} environment + * @memberof google.cloud.batch.v1.Runnable + * @instance + */ + Runnable.prototype.environment = null; + + /** + * Runnable timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.cloud.batch.v1.Runnable + * @instance + */ + Runnable.prototype.timeout = null; + + /** + * Runnable labels. + * @member {Object.} labels + * @memberof google.cloud.batch.v1.Runnable + * @instance + */ + Runnable.prototype.labels = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Runnable executable. + * @member {"container"|"script"|"barrier"|undefined} executable + * @memberof google.cloud.batch.v1.Runnable + * @instance + */ + Object.defineProperty(Runnable.prototype, "executable", { + get: $util.oneOfGetter($oneOfFields = ["container", "script", "barrier"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Runnable instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.Runnable + * @static + * @param {google.cloud.batch.v1.IRunnable=} [properties] Properties to set + * @returns {google.cloud.batch.v1.Runnable} Runnable instance + */ + Runnable.create = function create(properties) { + return new Runnable(properties); + }; + + /** + * Encodes the specified Runnable message. Does not implicitly {@link google.cloud.batch.v1.Runnable.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.Runnable + * @static + * @param {google.cloud.batch.v1.IRunnable} message Runnable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Runnable.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.container != null && Object.hasOwnProperty.call(message, "container")) + $root.google.cloud.batch.v1.Runnable.Container.encode(message.container, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.script != null && Object.hasOwnProperty.call(message, "script")) + $root.google.cloud.batch.v1.Runnable.Script.encode(message.script, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.ignoreExitStatus != null && Object.hasOwnProperty.call(message, "ignoreExitStatus")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.ignoreExitStatus); + if (message.background != null && Object.hasOwnProperty.call(message, "background")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.background); + if (message.alwaysRun != null && Object.hasOwnProperty.call(message, "alwaysRun")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.alwaysRun); + if (message.barrier != null && Object.hasOwnProperty.call(message, "barrier")) + $root.google.cloud.batch.v1.Runnable.Barrier.encode(message.barrier, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + $root.google.cloud.batch.v1.Environment.encode(message.environment, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + 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 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified Runnable message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Runnable.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.Runnable + * @static + * @param {google.cloud.batch.v1.IRunnable} message Runnable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Runnable.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Runnable message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.Runnable + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.Runnable} Runnable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Runnable.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Runnable(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.container = $root.google.cloud.batch.v1.Runnable.Container.decode(reader, reader.uint32()); + break; + } + case 2: { + message.script = $root.google.cloud.batch.v1.Runnable.Script.decode(reader, reader.uint32()); + break; + } + case 6: { + message.barrier = $root.google.cloud.batch.v1.Runnable.Barrier.decode(reader, reader.uint32()); + break; + } + case 10: { + message.displayName = reader.string(); + break; + } + case 3: { + message.ignoreExitStatus = reader.bool(); + break; + } + case 4: { + message.background = reader.bool(); + break; + } + case 5: { + message.alwaysRun = reader.bool(); + break; + } + case 7: { + message.environment = $root.google.cloud.batch.v1.Environment.decode(reader, reader.uint32()); + break; + } + case 8: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 9: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Runnable message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.Runnable + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.Runnable} Runnable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Runnable.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Runnable message. + * @function verify + * @memberof google.cloud.batch.v1.Runnable + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Runnable.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.container != null && message.hasOwnProperty("container")) { + properties.executable = 1; + { + var error = $root.google.cloud.batch.v1.Runnable.Container.verify(message.container); + if (error) + return "container." + error; + } + } + if (message.script != null && message.hasOwnProperty("script")) { + if (properties.executable === 1) + return "executable: multiple values"; + properties.executable = 1; + { + var error = $root.google.cloud.batch.v1.Runnable.Script.verify(message.script); + if (error) + return "script." + error; + } + } + if (message.barrier != null && message.hasOwnProperty("barrier")) { + if (properties.executable === 1) + return "executable: multiple values"; + properties.executable = 1; + { + var error = $root.google.cloud.batch.v1.Runnable.Barrier.verify(message.barrier); + if (error) + return "barrier." + error; + } + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.ignoreExitStatus != null && message.hasOwnProperty("ignoreExitStatus")) + if (typeof message.ignoreExitStatus !== "boolean") + return "ignoreExitStatus: boolean expected"; + if (message.background != null && message.hasOwnProperty("background")) + if (typeof message.background !== "boolean") + return "background: boolean expected"; + if (message.alwaysRun != null && message.hasOwnProperty("alwaysRun")) + if (typeof message.alwaysRun !== "boolean") + return "alwaysRun: boolean expected"; + if (message.environment != null && message.hasOwnProperty("environment")) { + var error = $root.google.cloud.batch.v1.Environment.verify(message.environment); + if (error) + return "environment." + error; + } + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a Runnable message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.Runnable + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.Runnable} Runnable + */ + Runnable.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.Runnable) + return object; + var message = new $root.google.cloud.batch.v1.Runnable(); + if (object.container != null) { + if (typeof object.container !== "object") + throw TypeError(".google.cloud.batch.v1.Runnable.container: object expected"); + message.container = $root.google.cloud.batch.v1.Runnable.Container.fromObject(object.container); + } + if (object.script != null) { + if (typeof object.script !== "object") + throw TypeError(".google.cloud.batch.v1.Runnable.script: object expected"); + message.script = $root.google.cloud.batch.v1.Runnable.Script.fromObject(object.script); + } + if (object.barrier != null) { + if (typeof object.barrier !== "object") + throw TypeError(".google.cloud.batch.v1.Runnable.barrier: object expected"); + message.barrier = $root.google.cloud.batch.v1.Runnable.Barrier.fromObject(object.barrier); + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.ignoreExitStatus != null) + message.ignoreExitStatus = Boolean(object.ignoreExitStatus); + if (object.background != null) + message.background = Boolean(object.background); + if (object.alwaysRun != null) + message.alwaysRun = Boolean(object.alwaysRun); + if (object.environment != null) { + if (typeof object.environment !== "object") + throw TypeError(".google.cloud.batch.v1.Runnable.environment: object expected"); + message.environment = $root.google.cloud.batch.v1.Environment.fromObject(object.environment); + } + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.cloud.batch.v1.Runnable.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.batch.v1.Runnable.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a Runnable message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.Runnable + * @static + * @param {google.cloud.batch.v1.Runnable} message Runnable + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Runnable.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.ignoreExitStatus = false; + object.background = false; + object.alwaysRun = false; + object.environment = null; + object.timeout = null; + object.displayName = ""; + } + if (message.container != null && message.hasOwnProperty("container")) { + object.container = $root.google.cloud.batch.v1.Runnable.Container.toObject(message.container, options); + if (options.oneofs) + object.executable = "container"; + } + if (message.script != null && message.hasOwnProperty("script")) { + object.script = $root.google.cloud.batch.v1.Runnable.Script.toObject(message.script, options); + if (options.oneofs) + object.executable = "script"; + } + if (message.ignoreExitStatus != null && message.hasOwnProperty("ignoreExitStatus")) + object.ignoreExitStatus = message.ignoreExitStatus; + if (message.background != null && message.hasOwnProperty("background")) + object.background = message.background; + if (message.alwaysRun != null && message.hasOwnProperty("alwaysRun")) + object.alwaysRun = message.alwaysRun; + if (message.barrier != null && message.hasOwnProperty("barrier")) { + object.barrier = $root.google.cloud.batch.v1.Runnable.Barrier.toObject(message.barrier, options); + if (options.oneofs) + object.executable = "barrier"; + } + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = $root.google.cloud.batch.v1.Environment.toObject(message.environment, options); + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this Runnable to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.Runnable + * @instance + * @returns {Object.} JSON object + */ + Runnable.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Runnable + * @function getTypeUrl + * @memberof google.cloud.batch.v1.Runnable + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Runnable.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.Runnable"; + }; + + Runnable.Container = (function() { + + /** + * Properties of a Container. + * @memberof google.cloud.batch.v1.Runnable + * @interface IContainer + * @property {string|null} [imageUri] Container imageUri + * @property {Array.|null} [commands] Container commands + * @property {string|null} [entrypoint] Container entrypoint + * @property {Array.|null} [volumes] Container volumes + * @property {string|null} [options] Container options + * @property {boolean|null} [blockExternalNetwork] Container blockExternalNetwork + * @property {string|null} [username] Container username + * @property {string|null} [password] Container password + * @property {boolean|null} [enableImageStreaming] Container enableImageStreaming + */ + + /** + * Constructs a new Container. + * @memberof google.cloud.batch.v1.Runnable + * @classdesc Represents a Container. + * @implements IContainer + * @constructor + * @param {google.cloud.batch.v1.Runnable.IContainer=} [properties] Properties to set + */ + function Container(properties) { + this.commands = []; + this.volumes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Container imageUri. + * @member {string} imageUri + * @memberof google.cloud.batch.v1.Runnable.Container + * @instance + */ + Container.prototype.imageUri = ""; + + /** + * Container commands. + * @member {Array.} commands + * @memberof google.cloud.batch.v1.Runnable.Container + * @instance + */ + Container.prototype.commands = $util.emptyArray; + + /** + * Container entrypoint. + * @member {string} entrypoint + * @memberof google.cloud.batch.v1.Runnable.Container + * @instance + */ + Container.prototype.entrypoint = ""; + + /** + * Container volumes. + * @member {Array.} volumes + * @memberof google.cloud.batch.v1.Runnable.Container + * @instance + */ + Container.prototype.volumes = $util.emptyArray; + + /** + * Container options. + * @member {string} options + * @memberof google.cloud.batch.v1.Runnable.Container + * @instance + */ + Container.prototype.options = ""; + + /** + * Container blockExternalNetwork. + * @member {boolean} blockExternalNetwork + * @memberof google.cloud.batch.v1.Runnable.Container + * @instance + */ + Container.prototype.blockExternalNetwork = false; + + /** + * Container username. + * @member {string} username + * @memberof google.cloud.batch.v1.Runnable.Container + * @instance + */ + Container.prototype.username = ""; + + /** + * Container password. + * @member {string} password + * @memberof google.cloud.batch.v1.Runnable.Container + * @instance + */ + Container.prototype.password = ""; + + /** + * Container enableImageStreaming. + * @member {boolean} enableImageStreaming + * @memberof google.cloud.batch.v1.Runnable.Container + * @instance + */ + Container.prototype.enableImageStreaming = false; + + /** + * Creates a new Container instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.Runnable.Container + * @static + * @param {google.cloud.batch.v1.Runnable.IContainer=} [properties] Properties to set + * @returns {google.cloud.batch.v1.Runnable.Container} Container instance + */ + Container.create = function create(properties) { + return new Container(properties); + }; + + /** + * Encodes the specified Container message. Does not implicitly {@link google.cloud.batch.v1.Runnable.Container.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.Runnable.Container + * @static + * @param {google.cloud.batch.v1.Runnable.IContainer} message Container message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Container.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.imageUri != null && Object.hasOwnProperty.call(message, "imageUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.imageUri); + if (message.commands != null && message.commands.length) + for (var i = 0; i < message.commands.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.commands[i]); + if (message.entrypoint != null && Object.hasOwnProperty.call(message, "entrypoint")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.entrypoint); + if (message.volumes != null && message.volumes.length) + for (var i = 0; i < message.volumes.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.volumes[i]); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.options); + if (message.blockExternalNetwork != null && Object.hasOwnProperty.call(message, "blockExternalNetwork")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.blockExternalNetwork); + if (message.username != null && Object.hasOwnProperty.call(message, "username")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.username); + if (message.password != null && Object.hasOwnProperty.call(message, "password")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.password); + if (message.enableImageStreaming != null && Object.hasOwnProperty.call(message, "enableImageStreaming")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.enableImageStreaming); + return writer; + }; + + /** + * Encodes the specified Container message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Runnable.Container.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.Runnable.Container + * @static + * @param {google.cloud.batch.v1.Runnable.IContainer} message Container message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Container.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Container message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.Runnable.Container + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.Runnable.Container} Container + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Container.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Runnable.Container(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.imageUri = reader.string(); + break; + } + case 2: { + if (!(message.commands && message.commands.length)) + message.commands = []; + message.commands.push(reader.string()); + break; + } + case 3: { + message.entrypoint = reader.string(); + break; + } + case 7: { + if (!(message.volumes && message.volumes.length)) + message.volumes = []; + message.volumes.push(reader.string()); + break; + } + case 8: { + message.options = reader.string(); + break; + } + case 9: { + message.blockExternalNetwork = reader.bool(); + break; + } + case 10: { + message.username = reader.string(); + break; + } + case 11: { + message.password = reader.string(); + break; + } + case 12: { + message.enableImageStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Container message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.Runnable.Container + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.Runnable.Container} Container + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Container.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Container message. + * @function verify + * @memberof google.cloud.batch.v1.Runnable.Container + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Container.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + if (!$util.isString(message.imageUri)) + return "imageUri: string expected"; + if (message.commands != null && message.hasOwnProperty("commands")) { + if (!Array.isArray(message.commands)) + return "commands: array expected"; + for (var i = 0; i < message.commands.length; ++i) + if (!$util.isString(message.commands[i])) + return "commands: string[] expected"; + } + if (message.entrypoint != null && message.hasOwnProperty("entrypoint")) + if (!$util.isString(message.entrypoint)) + return "entrypoint: string expected"; + if (message.volumes != null && message.hasOwnProperty("volumes")) { + if (!Array.isArray(message.volumes)) + return "volumes: array expected"; + for (var i = 0; i < message.volumes.length; ++i) + if (!$util.isString(message.volumes[i])) + return "volumes: string[] expected"; + } + if (message.options != null && message.hasOwnProperty("options")) + if (!$util.isString(message.options)) + return "options: string expected"; + if (message.blockExternalNetwork != null && message.hasOwnProperty("blockExternalNetwork")) + if (typeof message.blockExternalNetwork !== "boolean") + return "blockExternalNetwork: boolean expected"; + if (message.username != null && message.hasOwnProperty("username")) + if (!$util.isString(message.username)) + return "username: string expected"; + if (message.password != null && message.hasOwnProperty("password")) + if (!$util.isString(message.password)) + return "password: string expected"; + if (message.enableImageStreaming != null && message.hasOwnProperty("enableImageStreaming")) + if (typeof message.enableImageStreaming !== "boolean") + return "enableImageStreaming: boolean expected"; + return null; + }; + + /** + * Creates a Container message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.Runnable.Container + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.Runnable.Container} Container + */ + Container.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.Runnable.Container) + return object; + var message = new $root.google.cloud.batch.v1.Runnable.Container(); + if (object.imageUri != null) + message.imageUri = String(object.imageUri); + if (object.commands) { + if (!Array.isArray(object.commands)) + throw TypeError(".google.cloud.batch.v1.Runnable.Container.commands: array expected"); + message.commands = []; + for (var i = 0; i < object.commands.length; ++i) + message.commands[i] = String(object.commands[i]); + } + if (object.entrypoint != null) + message.entrypoint = String(object.entrypoint); + if (object.volumes) { + if (!Array.isArray(object.volumes)) + throw TypeError(".google.cloud.batch.v1.Runnable.Container.volumes: array expected"); + message.volumes = []; + for (var i = 0; i < object.volumes.length; ++i) + message.volumes[i] = String(object.volumes[i]); + } + if (object.options != null) + message.options = String(object.options); + if (object.blockExternalNetwork != null) + message.blockExternalNetwork = Boolean(object.blockExternalNetwork); + if (object.username != null) + message.username = String(object.username); + if (object.password != null) + message.password = String(object.password); + if (object.enableImageStreaming != null) + message.enableImageStreaming = Boolean(object.enableImageStreaming); + return message; + }; + + /** + * Creates a plain object from a Container message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.Runnable.Container + * @static + * @param {google.cloud.batch.v1.Runnable.Container} message Container + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Container.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.commands = []; + object.volumes = []; + } + if (options.defaults) { + object.imageUri = ""; + object.entrypoint = ""; + object.options = ""; + object.blockExternalNetwork = false; + object.username = ""; + object.password = ""; + object.enableImageStreaming = false; + } + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + object.imageUri = message.imageUri; + if (message.commands && message.commands.length) { + object.commands = []; + for (var j = 0; j < message.commands.length; ++j) + object.commands[j] = message.commands[j]; + } + if (message.entrypoint != null && message.hasOwnProperty("entrypoint")) + object.entrypoint = message.entrypoint; + if (message.volumes && message.volumes.length) { + object.volumes = []; + for (var j = 0; j < message.volumes.length; ++j) + object.volumes[j] = message.volumes[j]; + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = message.options; + if (message.blockExternalNetwork != null && message.hasOwnProperty("blockExternalNetwork")) + object.blockExternalNetwork = message.blockExternalNetwork; + if (message.username != null && message.hasOwnProperty("username")) + object.username = message.username; + if (message.password != null && message.hasOwnProperty("password")) + object.password = message.password; + if (message.enableImageStreaming != null && message.hasOwnProperty("enableImageStreaming")) + object.enableImageStreaming = message.enableImageStreaming; + return object; + }; + + /** + * Converts this Container to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.Runnable.Container + * @instance + * @returns {Object.} JSON object + */ + Container.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Container + * @function getTypeUrl + * @memberof google.cloud.batch.v1.Runnable.Container + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Container.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.Runnable.Container"; + }; + + return Container; + })(); + + Runnable.Script = (function() { + + /** + * Properties of a Script. + * @memberof google.cloud.batch.v1.Runnable + * @interface IScript + * @property {string|null} [path] Script path + * @property {string|null} [text] Script text + */ + + /** + * Constructs a new Script. + * @memberof google.cloud.batch.v1.Runnable + * @classdesc Represents a Script. + * @implements IScript + * @constructor + * @param {google.cloud.batch.v1.Runnable.IScript=} [properties] Properties to set + */ + function Script(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Script path. + * @member {string|null|undefined} path + * @memberof google.cloud.batch.v1.Runnable.Script + * @instance + */ + Script.prototype.path = null; + + /** + * Script text. + * @member {string|null|undefined} text + * @memberof google.cloud.batch.v1.Runnable.Script + * @instance + */ + Script.prototype.text = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Script command. + * @member {"path"|"text"|undefined} command + * @memberof google.cloud.batch.v1.Runnable.Script + * @instance + */ + Object.defineProperty(Script.prototype, "command", { + get: $util.oneOfGetter($oneOfFields = ["path", "text"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Script instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.Runnable.Script + * @static + * @param {google.cloud.batch.v1.Runnable.IScript=} [properties] Properties to set + * @returns {google.cloud.batch.v1.Runnable.Script} Script instance + */ + Script.create = function create(properties) { + return new Script(properties); + }; + + /** + * Encodes the specified Script message. Does not implicitly {@link google.cloud.batch.v1.Runnable.Script.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.Runnable.Script + * @static + * @param {google.cloud.batch.v1.Runnable.IScript} message Script message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Script.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.path); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.text); + return writer; + }; + + /** + * Encodes the specified Script message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Runnable.Script.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.Runnable.Script + * @static + * @param {google.cloud.batch.v1.Runnable.IScript} message Script message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Script.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Script message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.Runnable.Script + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.Runnable.Script} Script + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Script.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Runnable.Script(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.path = reader.string(); + break; + } + case 2: { + message.text = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Script message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.Runnable.Script + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.Runnable.Script} Script + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Script.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Script message. + * @function verify + * @memberof google.cloud.batch.v1.Runnable.Script + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Script.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.path != null && message.hasOwnProperty("path")) { + properties.command = 1; + if (!$util.isString(message.path)) + return "path: string expected"; + } + if (message.text != null && message.hasOwnProperty("text")) { + if (properties.command === 1) + return "command: multiple values"; + properties.command = 1; + if (!$util.isString(message.text)) + return "text: string expected"; + } + return null; + }; + + /** + * Creates a Script message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.Runnable.Script + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.Runnable.Script} Script + */ + Script.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.Runnable.Script) + return object; + var message = new $root.google.cloud.batch.v1.Runnable.Script(); + if (object.path != null) + message.path = String(object.path); + if (object.text != null) + message.text = String(object.text); + return message; + }; + + /** + * Creates a plain object from a Script message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.Runnable.Script + * @static + * @param {google.cloud.batch.v1.Runnable.Script} message Script + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Script.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.path != null && message.hasOwnProperty("path")) { + object.path = message.path; + if (options.oneofs) + object.command = "path"; + } + if (message.text != null && message.hasOwnProperty("text")) { + object.text = message.text; + if (options.oneofs) + object.command = "text"; + } + return object; + }; + + /** + * Converts this Script to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.Runnable.Script + * @instance + * @returns {Object.} JSON object + */ + Script.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Script + * @function getTypeUrl + * @memberof google.cloud.batch.v1.Runnable.Script + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Script.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.Runnable.Script"; + }; + + return Script; + })(); + + Runnable.Barrier = (function() { + + /** + * Properties of a Barrier. + * @memberof google.cloud.batch.v1.Runnable + * @interface IBarrier + * @property {string|null} [name] Barrier name + */ + + /** + * Constructs a new Barrier. + * @memberof google.cloud.batch.v1.Runnable + * @classdesc Represents a Barrier. + * @implements IBarrier + * @constructor + * @param {google.cloud.batch.v1.Runnable.IBarrier=} [properties] Properties to set + */ + function Barrier(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Barrier name. + * @member {string} name + * @memberof google.cloud.batch.v1.Runnable.Barrier + * @instance + */ + Barrier.prototype.name = ""; + + /** + * Creates a new Barrier instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.Runnable.Barrier + * @static + * @param {google.cloud.batch.v1.Runnable.IBarrier=} [properties] Properties to set + * @returns {google.cloud.batch.v1.Runnable.Barrier} Barrier instance + */ + Barrier.create = function create(properties) { + return new Barrier(properties); + }; + + /** + * Encodes the specified Barrier message. Does not implicitly {@link google.cloud.batch.v1.Runnable.Barrier.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.Runnable.Barrier + * @static + * @param {google.cloud.batch.v1.Runnable.IBarrier} message Barrier message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Barrier.encode = function encode(message, writer) { + 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 Barrier message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Runnable.Barrier.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.Runnable.Barrier + * @static + * @param {google.cloud.batch.v1.Runnable.IBarrier} message Barrier message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Barrier.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Barrier message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.Runnable.Barrier + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.Runnable.Barrier} Barrier + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Barrier.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Runnable.Barrier(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Barrier message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.Runnable.Barrier + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.Runnable.Barrier} Barrier + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Barrier.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Barrier message. + * @function verify + * @memberof google.cloud.batch.v1.Runnable.Barrier + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Barrier.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a Barrier message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.Runnable.Barrier + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.Runnable.Barrier} Barrier + */ + Barrier.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.Runnable.Barrier) + return object; + var message = new $root.google.cloud.batch.v1.Runnable.Barrier(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a Barrier message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.Runnable.Barrier + * @static + * @param {google.cloud.batch.v1.Runnable.Barrier} message Barrier + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Barrier.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 Barrier to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.Runnable.Barrier + * @instance + * @returns {Object.} JSON object + */ + Barrier.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Barrier + * @function getTypeUrl + * @memberof google.cloud.batch.v1.Runnable.Barrier + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Barrier.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.Runnable.Barrier"; + }; + + return Barrier; + })(); + + return Runnable; + })(); + + v1.TaskSpec = (function() { + + /** + * Properties of a TaskSpec. + * @memberof google.cloud.batch.v1 + * @interface ITaskSpec + * @property {Array.|null} [runnables] TaskSpec runnables + * @property {google.cloud.batch.v1.IComputeResource|null} [computeResource] TaskSpec computeResource + * @property {google.protobuf.IDuration|null} [maxRunDuration] TaskSpec maxRunDuration + * @property {number|null} [maxRetryCount] TaskSpec maxRetryCount + * @property {Array.|null} [lifecyclePolicies] TaskSpec lifecyclePolicies + * @property {Object.|null} [environments] TaskSpec environments + * @property {Array.|null} [volumes] TaskSpec volumes + * @property {google.cloud.batch.v1.IEnvironment|null} [environment] TaskSpec environment + */ + + /** + * Constructs a new TaskSpec. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a TaskSpec. + * @implements ITaskSpec + * @constructor + * @param {google.cloud.batch.v1.ITaskSpec=} [properties] Properties to set + */ + function TaskSpec(properties) { + this.runnables = []; + this.lifecyclePolicies = []; + this.environments = {}; + this.volumes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TaskSpec runnables. + * @member {Array.} runnables + * @memberof google.cloud.batch.v1.TaskSpec + * @instance + */ + TaskSpec.prototype.runnables = $util.emptyArray; + + /** + * TaskSpec computeResource. + * @member {google.cloud.batch.v1.IComputeResource|null|undefined} computeResource + * @memberof google.cloud.batch.v1.TaskSpec + * @instance + */ + TaskSpec.prototype.computeResource = null; + + /** + * TaskSpec maxRunDuration. + * @member {google.protobuf.IDuration|null|undefined} maxRunDuration + * @memberof google.cloud.batch.v1.TaskSpec + * @instance + */ + TaskSpec.prototype.maxRunDuration = null; + + /** + * TaskSpec maxRetryCount. + * @member {number} maxRetryCount + * @memberof google.cloud.batch.v1.TaskSpec + * @instance + */ + TaskSpec.prototype.maxRetryCount = 0; + + /** + * TaskSpec lifecyclePolicies. + * @member {Array.} lifecyclePolicies + * @memberof google.cloud.batch.v1.TaskSpec + * @instance + */ + TaskSpec.prototype.lifecyclePolicies = $util.emptyArray; + + /** + * TaskSpec environments. + * @member {Object.} environments + * @memberof google.cloud.batch.v1.TaskSpec + * @instance + */ + TaskSpec.prototype.environments = $util.emptyObject; + + /** + * TaskSpec volumes. + * @member {Array.} volumes + * @memberof google.cloud.batch.v1.TaskSpec + * @instance + */ + TaskSpec.prototype.volumes = $util.emptyArray; + + /** + * TaskSpec environment. + * @member {google.cloud.batch.v1.IEnvironment|null|undefined} environment + * @memberof google.cloud.batch.v1.TaskSpec + * @instance + */ + TaskSpec.prototype.environment = null; + + /** + * Creates a new TaskSpec instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.TaskSpec + * @static + * @param {google.cloud.batch.v1.ITaskSpec=} [properties] Properties to set + * @returns {google.cloud.batch.v1.TaskSpec} TaskSpec instance + */ + TaskSpec.create = function create(properties) { + return new TaskSpec(properties); + }; + + /** + * Encodes the specified TaskSpec message. Does not implicitly {@link google.cloud.batch.v1.TaskSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.TaskSpec + * @static + * @param {google.cloud.batch.v1.ITaskSpec} message TaskSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.computeResource != null && Object.hasOwnProperty.call(message, "computeResource")) + $root.google.cloud.batch.v1.ComputeResource.encode(message.computeResource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.maxRunDuration != null && Object.hasOwnProperty.call(message, "maxRunDuration")) + $root.google.protobuf.Duration.encode(message.maxRunDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.maxRetryCount != null && Object.hasOwnProperty.call(message, "maxRetryCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxRetryCount); + if (message.environments != null && Object.hasOwnProperty.call(message, "environments")) + for (var keys = Object.keys(message.environments), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.environments[keys[i]]).ldelim(); + if (message.volumes != null && message.volumes.length) + for (var i = 0; i < message.volumes.length; ++i) + $root.google.cloud.batch.v1.Volume.encode(message.volumes[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.runnables != null && message.runnables.length) + for (var i = 0; i < message.runnables.length; ++i) + $root.google.cloud.batch.v1.Runnable.encode(message.runnables[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.lifecyclePolicies != null && message.lifecyclePolicies.length) + for (var i = 0; i < message.lifecyclePolicies.length; ++i) + $root.google.cloud.batch.v1.LifecyclePolicy.encode(message.lifecyclePolicies[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + $root.google.cloud.batch.v1.Environment.encode(message.environment, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TaskSpec message, length delimited. Does not implicitly {@link google.cloud.batch.v1.TaskSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.TaskSpec + * @static + * @param {google.cloud.batch.v1.ITaskSpec} message TaskSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TaskSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.TaskSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.TaskSpec} TaskSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.TaskSpec(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 8: { + if (!(message.runnables && message.runnables.length)) + message.runnables = []; + message.runnables.push($root.google.cloud.batch.v1.Runnable.decode(reader, reader.uint32())); + break; + } + case 3: { + message.computeResource = $root.google.cloud.batch.v1.ComputeResource.decode(reader, reader.uint32()); + break; + } + case 4: { + message.maxRunDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.maxRetryCount = reader.int32(); + break; + } + case 9: { + if (!(message.lifecyclePolicies && message.lifecyclePolicies.length)) + message.lifecyclePolicies = []; + message.lifecyclePolicies.push($root.google.cloud.batch.v1.LifecyclePolicy.decode(reader, reader.uint32())); + break; + } + case 6: { + if (message.environments === $util.emptyObject) + message.environments = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.environments[key] = value; + break; + } + case 7: { + if (!(message.volumes && message.volumes.length)) + message.volumes = []; + message.volumes.push($root.google.cloud.batch.v1.Volume.decode(reader, reader.uint32())); + break; + } + case 10: { + message.environment = $root.google.cloud.batch.v1.Environment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TaskSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.TaskSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.TaskSpec} TaskSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TaskSpec message. + * @function verify + * @memberof google.cloud.batch.v1.TaskSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TaskSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.runnables != null && message.hasOwnProperty("runnables")) { + if (!Array.isArray(message.runnables)) + return "runnables: array expected"; + for (var i = 0; i < message.runnables.length; ++i) { + var error = $root.google.cloud.batch.v1.Runnable.verify(message.runnables[i]); + if (error) + return "runnables." + error; + } + } + if (message.computeResource != null && message.hasOwnProperty("computeResource")) { + var error = $root.google.cloud.batch.v1.ComputeResource.verify(message.computeResource); + if (error) + return "computeResource." + error; + } + if (message.maxRunDuration != null && message.hasOwnProperty("maxRunDuration")) { + var error = $root.google.protobuf.Duration.verify(message.maxRunDuration); + if (error) + return "maxRunDuration." + error; + } + if (message.maxRetryCount != null && message.hasOwnProperty("maxRetryCount")) + if (!$util.isInteger(message.maxRetryCount)) + return "maxRetryCount: integer expected"; + if (message.lifecyclePolicies != null && message.hasOwnProperty("lifecyclePolicies")) { + if (!Array.isArray(message.lifecyclePolicies)) + return "lifecyclePolicies: array expected"; + for (var i = 0; i < message.lifecyclePolicies.length; ++i) { + var error = $root.google.cloud.batch.v1.LifecyclePolicy.verify(message.lifecyclePolicies[i]); + if (error) + return "lifecyclePolicies." + error; + } + } + if (message.environments != null && message.hasOwnProperty("environments")) { + if (!$util.isObject(message.environments)) + return "environments: object expected"; + var key = Object.keys(message.environments); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.environments[key[i]])) + return "environments: string{k:string} expected"; + } + if (message.volumes != null && message.hasOwnProperty("volumes")) { + if (!Array.isArray(message.volumes)) + return "volumes: array expected"; + for (var i = 0; i < message.volumes.length; ++i) { + var error = $root.google.cloud.batch.v1.Volume.verify(message.volumes[i]); + if (error) + return "volumes." + error; + } + } + if (message.environment != null && message.hasOwnProperty("environment")) { + var error = $root.google.cloud.batch.v1.Environment.verify(message.environment); + if (error) + return "environment." + error; + } + return null; + }; + + /** + * Creates a TaskSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.TaskSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.TaskSpec} TaskSpec + */ + TaskSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.TaskSpec) + return object; + var message = new $root.google.cloud.batch.v1.TaskSpec(); + if (object.runnables) { + if (!Array.isArray(object.runnables)) + throw TypeError(".google.cloud.batch.v1.TaskSpec.runnables: array expected"); + message.runnables = []; + for (var i = 0; i < object.runnables.length; ++i) { + if (typeof object.runnables[i] !== "object") + throw TypeError(".google.cloud.batch.v1.TaskSpec.runnables: object expected"); + message.runnables[i] = $root.google.cloud.batch.v1.Runnable.fromObject(object.runnables[i]); + } + } + if (object.computeResource != null) { + if (typeof object.computeResource !== "object") + throw TypeError(".google.cloud.batch.v1.TaskSpec.computeResource: object expected"); + message.computeResource = $root.google.cloud.batch.v1.ComputeResource.fromObject(object.computeResource); + } + if (object.maxRunDuration != null) { + if (typeof object.maxRunDuration !== "object") + throw TypeError(".google.cloud.batch.v1.TaskSpec.maxRunDuration: object expected"); + message.maxRunDuration = $root.google.protobuf.Duration.fromObject(object.maxRunDuration); + } + if (object.maxRetryCount != null) + message.maxRetryCount = object.maxRetryCount | 0; + if (object.lifecyclePolicies) { + if (!Array.isArray(object.lifecyclePolicies)) + throw TypeError(".google.cloud.batch.v1.TaskSpec.lifecyclePolicies: array expected"); + message.lifecyclePolicies = []; + for (var i = 0; i < object.lifecyclePolicies.length; ++i) { + if (typeof object.lifecyclePolicies[i] !== "object") + throw TypeError(".google.cloud.batch.v1.TaskSpec.lifecyclePolicies: object expected"); + message.lifecyclePolicies[i] = $root.google.cloud.batch.v1.LifecyclePolicy.fromObject(object.lifecyclePolicies[i]); + } + } + if (object.environments) { + if (typeof object.environments !== "object") + throw TypeError(".google.cloud.batch.v1.TaskSpec.environments: object expected"); + message.environments = {}; + for (var keys = Object.keys(object.environments), i = 0; i < keys.length; ++i) + message.environments[keys[i]] = String(object.environments[keys[i]]); + } + if (object.volumes) { + if (!Array.isArray(object.volumes)) + throw TypeError(".google.cloud.batch.v1.TaskSpec.volumes: array expected"); + message.volumes = []; + for (var i = 0; i < object.volumes.length; ++i) { + if (typeof object.volumes[i] !== "object") + throw TypeError(".google.cloud.batch.v1.TaskSpec.volumes: object expected"); + message.volumes[i] = $root.google.cloud.batch.v1.Volume.fromObject(object.volumes[i]); + } + } + if (object.environment != null) { + if (typeof object.environment !== "object") + throw TypeError(".google.cloud.batch.v1.TaskSpec.environment: object expected"); + message.environment = $root.google.cloud.batch.v1.Environment.fromObject(object.environment); + } + return message; + }; + + /** + * Creates a plain object from a TaskSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.TaskSpec + * @static + * @param {google.cloud.batch.v1.TaskSpec} message TaskSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TaskSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.volumes = []; + object.runnables = []; + object.lifecyclePolicies = []; + } + if (options.objects || options.defaults) + object.environments = {}; + if (options.defaults) { + object.computeResource = null; + object.maxRunDuration = null; + object.maxRetryCount = 0; + object.environment = null; + } + if (message.computeResource != null && message.hasOwnProperty("computeResource")) + object.computeResource = $root.google.cloud.batch.v1.ComputeResource.toObject(message.computeResource, options); + if (message.maxRunDuration != null && message.hasOwnProperty("maxRunDuration")) + object.maxRunDuration = $root.google.protobuf.Duration.toObject(message.maxRunDuration, options); + if (message.maxRetryCount != null && message.hasOwnProperty("maxRetryCount")) + object.maxRetryCount = message.maxRetryCount; + var keys2; + if (message.environments && (keys2 = Object.keys(message.environments)).length) { + object.environments = {}; + for (var j = 0; j < keys2.length; ++j) + object.environments[keys2[j]] = message.environments[keys2[j]]; + } + if (message.volumes && message.volumes.length) { + object.volumes = []; + for (var j = 0; j < message.volumes.length; ++j) + object.volumes[j] = $root.google.cloud.batch.v1.Volume.toObject(message.volumes[j], options); + } + if (message.runnables && message.runnables.length) { + object.runnables = []; + for (var j = 0; j < message.runnables.length; ++j) + object.runnables[j] = $root.google.cloud.batch.v1.Runnable.toObject(message.runnables[j], options); + } + if (message.lifecyclePolicies && message.lifecyclePolicies.length) { + object.lifecyclePolicies = []; + for (var j = 0; j < message.lifecyclePolicies.length; ++j) + object.lifecyclePolicies[j] = $root.google.cloud.batch.v1.LifecyclePolicy.toObject(message.lifecyclePolicies[j], options); + } + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = $root.google.cloud.batch.v1.Environment.toObject(message.environment, options); + return object; + }; + + /** + * Converts this TaskSpec to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.TaskSpec + * @instance + * @returns {Object.} JSON object + */ + TaskSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TaskSpec + * @function getTypeUrl + * @memberof google.cloud.batch.v1.TaskSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TaskSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.TaskSpec"; + }; + + return TaskSpec; + })(); + + v1.LifecyclePolicy = (function() { + + /** + * Properties of a LifecyclePolicy. + * @memberof google.cloud.batch.v1 + * @interface ILifecyclePolicy + * @property {google.cloud.batch.v1.LifecyclePolicy.Action|null} [action] LifecyclePolicy action + * @property {google.cloud.batch.v1.LifecyclePolicy.IActionCondition|null} [actionCondition] LifecyclePolicy actionCondition + */ + + /** + * Constructs a new LifecyclePolicy. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a LifecyclePolicy. + * @implements ILifecyclePolicy + * @constructor + * @param {google.cloud.batch.v1.ILifecyclePolicy=} [properties] Properties to set + */ + function LifecyclePolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LifecyclePolicy action. + * @member {google.cloud.batch.v1.LifecyclePolicy.Action} action + * @memberof google.cloud.batch.v1.LifecyclePolicy + * @instance + */ + LifecyclePolicy.prototype.action = 0; + + /** + * LifecyclePolicy actionCondition. + * @member {google.cloud.batch.v1.LifecyclePolicy.IActionCondition|null|undefined} actionCondition + * @memberof google.cloud.batch.v1.LifecyclePolicy + * @instance + */ + LifecyclePolicy.prototype.actionCondition = null; + + /** + * Creates a new LifecyclePolicy instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.LifecyclePolicy + * @static + * @param {google.cloud.batch.v1.ILifecyclePolicy=} [properties] Properties to set + * @returns {google.cloud.batch.v1.LifecyclePolicy} LifecyclePolicy instance + */ + LifecyclePolicy.create = function create(properties) { + return new LifecyclePolicy(properties); + }; + + /** + * Encodes the specified LifecyclePolicy message. Does not implicitly {@link google.cloud.batch.v1.LifecyclePolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.LifecyclePolicy + * @static + * @param {google.cloud.batch.v1.ILifecyclePolicy} message LifecyclePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LifecyclePolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.actionCondition != null && Object.hasOwnProperty.call(message, "actionCondition")) + $root.google.cloud.batch.v1.LifecyclePolicy.ActionCondition.encode(message.actionCondition, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LifecyclePolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.LifecyclePolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.LifecyclePolicy + * @static + * @param {google.cloud.batch.v1.ILifecyclePolicy} message LifecyclePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LifecyclePolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LifecyclePolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.LifecyclePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.LifecyclePolicy} LifecyclePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LifecyclePolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.LifecyclePolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.actionCondition = $root.google.cloud.batch.v1.LifecyclePolicy.ActionCondition.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LifecyclePolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.LifecyclePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.LifecyclePolicy} LifecyclePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LifecyclePolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LifecyclePolicy message. + * @function verify + * @memberof google.cloud.batch.v1.LifecyclePolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LifecyclePolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.actionCondition != null && message.hasOwnProperty("actionCondition")) { + var error = $root.google.cloud.batch.v1.LifecyclePolicy.ActionCondition.verify(message.actionCondition); + if (error) + return "actionCondition." + error; + } + return null; + }; + + /** + * Creates a LifecyclePolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.LifecyclePolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.LifecyclePolicy} LifecyclePolicy + */ + LifecyclePolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.LifecyclePolicy) + return object; + var message = new $root.google.cloud.batch.v1.LifecyclePolicy(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "RETRY_TASK": + case 1: + message.action = 1; + break; + case "FAIL_TASK": + case 2: + message.action = 2; + break; + } + if (object.actionCondition != null) { + if (typeof object.actionCondition !== "object") + throw TypeError(".google.cloud.batch.v1.LifecyclePolicy.actionCondition: object expected"); + message.actionCondition = $root.google.cloud.batch.v1.LifecyclePolicy.ActionCondition.fromObject(object.actionCondition); + } + return message; + }; + + /** + * Creates a plain object from a LifecyclePolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.LifecyclePolicy + * @static + * @param {google.cloud.batch.v1.LifecyclePolicy} message LifecyclePolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LifecyclePolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.actionCondition = null; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.cloud.batch.v1.LifecyclePolicy.Action[message.action] === undefined ? message.action : $root.google.cloud.batch.v1.LifecyclePolicy.Action[message.action] : message.action; + if (message.actionCondition != null && message.hasOwnProperty("actionCondition")) + object.actionCondition = $root.google.cloud.batch.v1.LifecyclePolicy.ActionCondition.toObject(message.actionCondition, options); + return object; + }; + + /** + * Converts this LifecyclePolicy to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.LifecyclePolicy + * @instance + * @returns {Object.} JSON object + */ + LifecyclePolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LifecyclePolicy + * @function getTypeUrl + * @memberof google.cloud.batch.v1.LifecyclePolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LifecyclePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.LifecyclePolicy"; + }; + + LifecyclePolicy.ActionCondition = (function() { + + /** + * Properties of an ActionCondition. + * @memberof google.cloud.batch.v1.LifecyclePolicy + * @interface IActionCondition + * @property {Array.|null} [exitCodes] ActionCondition exitCodes + */ + + /** + * Constructs a new ActionCondition. + * @memberof google.cloud.batch.v1.LifecyclePolicy + * @classdesc Represents an ActionCondition. + * @implements IActionCondition + * @constructor + * @param {google.cloud.batch.v1.LifecyclePolicy.IActionCondition=} [properties] Properties to set + */ + function ActionCondition(properties) { + this.exitCodes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ActionCondition exitCodes. + * @member {Array.} exitCodes + * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition + * @instance + */ + ActionCondition.prototype.exitCodes = $util.emptyArray; + + /** + * Creates a new ActionCondition instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition + * @static + * @param {google.cloud.batch.v1.LifecyclePolicy.IActionCondition=} [properties] Properties to set + * @returns {google.cloud.batch.v1.LifecyclePolicy.ActionCondition} ActionCondition instance + */ + ActionCondition.create = function create(properties) { + return new ActionCondition(properties); + }; + + /** + * Encodes the specified ActionCondition message. Does not implicitly {@link google.cloud.batch.v1.LifecyclePolicy.ActionCondition.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition + * @static + * @param {google.cloud.batch.v1.LifecyclePolicy.IActionCondition} message ActionCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActionCondition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.exitCodes != null && message.exitCodes.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.exitCodes.length; ++i) + writer.int32(message.exitCodes[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ActionCondition message, length delimited. Does not implicitly {@link google.cloud.batch.v1.LifecyclePolicy.ActionCondition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition + * @static + * @param {google.cloud.batch.v1.LifecyclePolicy.IActionCondition} message ActionCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActionCondition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ActionCondition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.LifecyclePolicy.ActionCondition} ActionCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActionCondition.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.LifecyclePolicy.ActionCondition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.exitCodes && message.exitCodes.length)) + message.exitCodes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.exitCodes.push(reader.int32()); + } else + message.exitCodes.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ActionCondition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.LifecyclePolicy.ActionCondition} ActionCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActionCondition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ActionCondition message. + * @function verify + * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ActionCondition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.exitCodes != null && message.hasOwnProperty("exitCodes")) { + if (!Array.isArray(message.exitCodes)) + return "exitCodes: array expected"; + for (var i = 0; i < message.exitCodes.length; ++i) + if (!$util.isInteger(message.exitCodes[i])) + return "exitCodes: integer[] expected"; + } + return null; + }; + + /** + * Creates an ActionCondition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.LifecyclePolicy.ActionCondition} ActionCondition + */ + ActionCondition.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.LifecyclePolicy.ActionCondition) + return object; + var message = new $root.google.cloud.batch.v1.LifecyclePolicy.ActionCondition(); + if (object.exitCodes) { + if (!Array.isArray(object.exitCodes)) + throw TypeError(".google.cloud.batch.v1.LifecyclePolicy.ActionCondition.exitCodes: array expected"); + message.exitCodes = []; + for (var i = 0; i < object.exitCodes.length; ++i) + message.exitCodes[i] = object.exitCodes[i] | 0; + } + return message; + }; + + /** + * Creates a plain object from an ActionCondition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition + * @static + * @param {google.cloud.batch.v1.LifecyclePolicy.ActionCondition} message ActionCondition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ActionCondition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.exitCodes = []; + if (message.exitCodes && message.exitCodes.length) { + object.exitCodes = []; + for (var j = 0; j < message.exitCodes.length; ++j) + object.exitCodes[j] = message.exitCodes[j]; + } + return object; + }; + + /** + * Converts this ActionCondition to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition + * @instance + * @returns {Object.} JSON object + */ + ActionCondition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ActionCondition + * @function getTypeUrl + * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ActionCondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.LifecyclePolicy.ActionCondition"; + }; + + return ActionCondition; + })(); + + /** + * Action enum. + * @name google.cloud.batch.v1.LifecyclePolicy.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} RETRY_TASK=1 RETRY_TASK value + * @property {number} FAIL_TASK=2 FAIL_TASK value + */ + LifecyclePolicy.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "RETRY_TASK"] = 1; + values[valuesById[2] = "FAIL_TASK"] = 2; + return values; + })(); + + return LifecyclePolicy; + })(); + + v1.Task = (function() { + + /** + * Properties of a Task. + * @memberof google.cloud.batch.v1 + * @interface ITask + * @property {string|null} [name] Task name + * @property {google.cloud.batch.v1.ITaskStatus|null} [status] Task status + */ + + /** + * Constructs a new Task. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a Task. + * @implements ITask + * @constructor + * @param {google.cloud.batch.v1.ITask=} [properties] Properties to set + */ + function Task(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Task name. + * @member {string} name + * @memberof google.cloud.batch.v1.Task + * @instance + */ + Task.prototype.name = ""; + + /** + * Task status. + * @member {google.cloud.batch.v1.ITaskStatus|null|undefined} status + * @memberof google.cloud.batch.v1.Task + * @instance + */ + Task.prototype.status = null; + + /** + * Creates a new Task instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.Task + * @static + * @param {google.cloud.batch.v1.ITask=} [properties] Properties to set + * @returns {google.cloud.batch.v1.Task} Task instance + */ + Task.create = function create(properties) { + return new Task(properties); + }; + + /** + * Encodes the specified Task message. Does not implicitly {@link google.cloud.batch.v1.Task.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.Task + * @static + * @param {google.cloud.batch.v1.ITask} message Task message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Task.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.cloud.batch.v1.TaskStatus.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Task message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Task.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.Task + * @static + * @param {google.cloud.batch.v1.ITask} message Task message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Task.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Task message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.Task + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.Task} Task + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Task.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Task(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.status = $root.google.cloud.batch.v1.TaskStatus.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Task message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.Task + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.Task} Task + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Task.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Task message. + * @function verify + * @memberof google.cloud.batch.v1.Task + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Task.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.cloud.batch.v1.TaskStatus.verify(message.status); + if (error) + return "status." + error; + } + return null; + }; + + /** + * Creates a Task message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.Task + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.Task} Task + */ + Task.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.Task) + return object; + var message = new $root.google.cloud.batch.v1.Task(); + if (object.name != null) + message.name = String(object.name); + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.batch.v1.Task.status: object expected"); + message.status = $root.google.cloud.batch.v1.TaskStatus.fromObject(object.status); + } + return message; + }; + + /** + * Creates a plain object from a Task message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.Task + * @static + * @param {google.cloud.batch.v1.Task} message Task + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Task.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.status = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.cloud.batch.v1.TaskStatus.toObject(message.status, options); + return object; + }; + + /** + * Converts this Task to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.Task + * @instance + * @returns {Object.} JSON object + */ + Task.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Task + * @function getTypeUrl + * @memberof google.cloud.batch.v1.Task + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Task.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.Task"; + }; + + return Task; + })(); + + v1.Environment = (function() { + + /** + * Properties of an Environment. + * @memberof google.cloud.batch.v1 + * @interface IEnvironment + * @property {Object.|null} [variables] Environment variables + * @property {Object.|null} [secretVariables] Environment secretVariables + * @property {google.cloud.batch.v1.Environment.IKMSEnvMap|null} [encryptedVariables] Environment encryptedVariables + */ + + /** + * Constructs a new Environment. + * @memberof google.cloud.batch.v1 + * @classdesc Represents an Environment. + * @implements IEnvironment + * @constructor + * @param {google.cloud.batch.v1.IEnvironment=} [properties] Properties to set + */ + function Environment(properties) { + this.variables = {}; + this.secretVariables = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Environment variables. + * @member {Object.} variables + * @memberof google.cloud.batch.v1.Environment + * @instance + */ + Environment.prototype.variables = $util.emptyObject; + + /** + * Environment secretVariables. + * @member {Object.} secretVariables + * @memberof google.cloud.batch.v1.Environment + * @instance + */ + Environment.prototype.secretVariables = $util.emptyObject; + + /** + * Environment encryptedVariables. + * @member {google.cloud.batch.v1.Environment.IKMSEnvMap|null|undefined} encryptedVariables + * @memberof google.cloud.batch.v1.Environment + * @instance + */ + Environment.prototype.encryptedVariables = null; + + /** + * Creates a new Environment instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.Environment + * @static + * @param {google.cloud.batch.v1.IEnvironment=} [properties] Properties to set + * @returns {google.cloud.batch.v1.Environment} Environment instance + */ + Environment.create = function create(properties) { + return new Environment(properties); + }; + + /** + * Encodes the specified Environment message. Does not implicitly {@link google.cloud.batch.v1.Environment.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.Environment + * @static + * @param {google.cloud.batch.v1.IEnvironment} message Environment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Environment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.variables != null && Object.hasOwnProperty.call(message, "variables")) + for (var keys = Object.keys(message.variables), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.variables[keys[i]]).ldelim(); + if (message.secretVariables != null && Object.hasOwnProperty.call(message, "secretVariables")) + for (var keys = Object.keys(message.secretVariables), 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.secretVariables[keys[i]]).ldelim(); + if (message.encryptedVariables != null && Object.hasOwnProperty.call(message, "encryptedVariables")) + $root.google.cloud.batch.v1.Environment.KMSEnvMap.encode(message.encryptedVariables, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Environment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.Environment + * @static + * @param {google.cloud.batch.v1.IEnvironment} message Environment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Environment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Environment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.Environment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.Environment} Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Environment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Environment(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.variables === $util.emptyObject) + message.variables = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.variables[key] = value; + break; + } + case 2: { + if (message.secretVariables === $util.emptyObject) + message.secretVariables = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.secretVariables[key] = value; + break; + } + case 3: { + message.encryptedVariables = $root.google.cloud.batch.v1.Environment.KMSEnvMap.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Environment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.Environment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.Environment} Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Environment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Environment message. + * @function verify + * @memberof google.cloud.batch.v1.Environment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Environment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.variables != null && message.hasOwnProperty("variables")) { + if (!$util.isObject(message.variables)) + return "variables: object expected"; + var key = Object.keys(message.variables); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.variables[key[i]])) + return "variables: string{k:string} expected"; + } + if (message.secretVariables != null && message.hasOwnProperty("secretVariables")) { + if (!$util.isObject(message.secretVariables)) + return "secretVariables: object expected"; + var key = Object.keys(message.secretVariables); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.secretVariables[key[i]])) + return "secretVariables: string{k:string} expected"; + } + if (message.encryptedVariables != null && message.hasOwnProperty("encryptedVariables")) { + var error = $root.google.cloud.batch.v1.Environment.KMSEnvMap.verify(message.encryptedVariables); + if (error) + return "encryptedVariables." + error; + } + return null; + }; + + /** + * Creates an Environment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.Environment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.Environment} Environment + */ + Environment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.Environment) + return object; + var message = new $root.google.cloud.batch.v1.Environment(); + if (object.variables) { + if (typeof object.variables !== "object") + throw TypeError(".google.cloud.batch.v1.Environment.variables: object expected"); + message.variables = {}; + for (var keys = Object.keys(object.variables), i = 0; i < keys.length; ++i) + message.variables[keys[i]] = String(object.variables[keys[i]]); + } + if (object.secretVariables) { + if (typeof object.secretVariables !== "object") + throw TypeError(".google.cloud.batch.v1.Environment.secretVariables: object expected"); + message.secretVariables = {}; + for (var keys = Object.keys(object.secretVariables), i = 0; i < keys.length; ++i) + message.secretVariables[keys[i]] = String(object.secretVariables[keys[i]]); + } + if (object.encryptedVariables != null) { + if (typeof object.encryptedVariables !== "object") + throw TypeError(".google.cloud.batch.v1.Environment.encryptedVariables: object expected"); + message.encryptedVariables = $root.google.cloud.batch.v1.Environment.KMSEnvMap.fromObject(object.encryptedVariables); + } + return message; + }; + + /** + * Creates a plain object from an Environment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.Environment + * @static + * @param {google.cloud.batch.v1.Environment} message Environment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Environment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.variables = {}; + object.secretVariables = {}; + } + if (options.defaults) + object.encryptedVariables = null; + var keys2; + if (message.variables && (keys2 = Object.keys(message.variables)).length) { + object.variables = {}; + for (var j = 0; j < keys2.length; ++j) + object.variables[keys2[j]] = message.variables[keys2[j]]; + } + if (message.secretVariables && (keys2 = Object.keys(message.secretVariables)).length) { + object.secretVariables = {}; + for (var j = 0; j < keys2.length; ++j) + object.secretVariables[keys2[j]] = message.secretVariables[keys2[j]]; + } + if (message.encryptedVariables != null && message.hasOwnProperty("encryptedVariables")) + object.encryptedVariables = $root.google.cloud.batch.v1.Environment.KMSEnvMap.toObject(message.encryptedVariables, options); + return object; + }; + + /** + * Converts this Environment to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.Environment + * @instance + * @returns {Object.} JSON object + */ + Environment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Environment + * @function getTypeUrl + * @memberof google.cloud.batch.v1.Environment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Environment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.Environment"; + }; + + Environment.KMSEnvMap = (function() { + + /** + * Properties of a KMSEnvMap. + * @memberof google.cloud.batch.v1.Environment + * @interface IKMSEnvMap + * @property {string|null} [keyName] KMSEnvMap keyName + * @property {string|null} [cipherText] KMSEnvMap cipherText + */ + + /** + * Constructs a new KMSEnvMap. + * @memberof google.cloud.batch.v1.Environment + * @classdesc Represents a KMSEnvMap. + * @implements IKMSEnvMap + * @constructor + * @param {google.cloud.batch.v1.Environment.IKMSEnvMap=} [properties] Properties to set + */ + function KMSEnvMap(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KMSEnvMap keyName. + * @member {string} keyName + * @memberof google.cloud.batch.v1.Environment.KMSEnvMap + * @instance + */ + KMSEnvMap.prototype.keyName = ""; + + /** + * KMSEnvMap cipherText. + * @member {string} cipherText + * @memberof google.cloud.batch.v1.Environment.KMSEnvMap + * @instance + */ + KMSEnvMap.prototype.cipherText = ""; + + /** + * Creates a new KMSEnvMap instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.Environment.KMSEnvMap + * @static + * @param {google.cloud.batch.v1.Environment.IKMSEnvMap=} [properties] Properties to set + * @returns {google.cloud.batch.v1.Environment.KMSEnvMap} KMSEnvMap instance + */ + KMSEnvMap.create = function create(properties) { + return new KMSEnvMap(properties); + }; + + /** + * Encodes the specified KMSEnvMap message. Does not implicitly {@link google.cloud.batch.v1.Environment.KMSEnvMap.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.Environment.KMSEnvMap + * @static + * @param {google.cloud.batch.v1.Environment.IKMSEnvMap} message KMSEnvMap message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KMSEnvMap.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keyName != null && Object.hasOwnProperty.call(message, "keyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.keyName); + if (message.cipherText != null && Object.hasOwnProperty.call(message, "cipherText")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.cipherText); + return writer; + }; + + /** + * Encodes the specified KMSEnvMap message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Environment.KMSEnvMap.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.Environment.KMSEnvMap + * @static + * @param {google.cloud.batch.v1.Environment.IKMSEnvMap} message KMSEnvMap message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KMSEnvMap.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KMSEnvMap message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.Environment.KMSEnvMap + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.Environment.KMSEnvMap} KMSEnvMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KMSEnvMap.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Environment.KMSEnvMap(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.keyName = reader.string(); + break; + } + case 2: { + message.cipherText = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KMSEnvMap message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.Environment.KMSEnvMap + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.Environment.KMSEnvMap} KMSEnvMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KMSEnvMap.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KMSEnvMap message. + * @function verify + * @memberof google.cloud.batch.v1.Environment.KMSEnvMap + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KMSEnvMap.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keyName != null && message.hasOwnProperty("keyName")) + if (!$util.isString(message.keyName)) + return "keyName: string expected"; + if (message.cipherText != null && message.hasOwnProperty("cipherText")) + if (!$util.isString(message.cipherText)) + return "cipherText: string expected"; + return null; + }; + + /** + * Creates a KMSEnvMap message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.Environment.KMSEnvMap + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.Environment.KMSEnvMap} KMSEnvMap + */ + KMSEnvMap.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.Environment.KMSEnvMap) + return object; + var message = new $root.google.cloud.batch.v1.Environment.KMSEnvMap(); + if (object.keyName != null) + message.keyName = String(object.keyName); + if (object.cipherText != null) + message.cipherText = String(object.cipherText); + return message; + }; + + /** + * Creates a plain object from a KMSEnvMap message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.Environment.KMSEnvMap + * @static + * @param {google.cloud.batch.v1.Environment.KMSEnvMap} message KMSEnvMap + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KMSEnvMap.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.keyName = ""; + object.cipherText = ""; + } + if (message.keyName != null && message.hasOwnProperty("keyName")) + object.keyName = message.keyName; + if (message.cipherText != null && message.hasOwnProperty("cipherText")) + object.cipherText = message.cipherText; + return object; + }; + + /** + * Converts this KMSEnvMap to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.Environment.KMSEnvMap + * @instance + * @returns {Object.} JSON object + */ + KMSEnvMap.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KMSEnvMap + * @function getTypeUrl + * @memberof google.cloud.batch.v1.Environment.KMSEnvMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KMSEnvMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.Environment.KMSEnvMap"; + }; + + return KMSEnvMap; + })(); + + return Environment; + })(); + + v1.Volume = (function() { + + /** + * Properties of a Volume. + * @memberof google.cloud.batch.v1 + * @interface IVolume + * @property {google.cloud.batch.v1.INFS|null} [nfs] Volume nfs + * @property {google.cloud.batch.v1.IGCS|null} [gcs] Volume gcs + * @property {string|null} [deviceName] Volume deviceName + * @property {string|null} [mountPath] Volume mountPath + * @property {Array.|null} [mountOptions] Volume mountOptions + */ + + /** + * Constructs a new Volume. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a Volume. + * @implements IVolume + * @constructor + * @param {google.cloud.batch.v1.IVolume=} [properties] Properties to set + */ + function Volume(properties) { + this.mountOptions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Volume nfs. + * @member {google.cloud.batch.v1.INFS|null|undefined} nfs + * @memberof google.cloud.batch.v1.Volume + * @instance + */ + Volume.prototype.nfs = null; + + /** + * Volume gcs. + * @member {google.cloud.batch.v1.IGCS|null|undefined} gcs + * @memberof google.cloud.batch.v1.Volume + * @instance + */ + Volume.prototype.gcs = null; + + /** + * Volume deviceName. + * @member {string|null|undefined} deviceName + * @memberof google.cloud.batch.v1.Volume + * @instance + */ + Volume.prototype.deviceName = null; + + /** + * Volume mountPath. + * @member {string} mountPath + * @memberof google.cloud.batch.v1.Volume + * @instance + */ + Volume.prototype.mountPath = ""; + + /** + * Volume mountOptions. + * @member {Array.} mountOptions + * @memberof google.cloud.batch.v1.Volume + * @instance + */ + Volume.prototype.mountOptions = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Volume source. + * @member {"nfs"|"gcs"|"deviceName"|undefined} source + * @memberof google.cloud.batch.v1.Volume + * @instance + */ + Object.defineProperty(Volume.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["nfs", "gcs", "deviceName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Volume instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.Volume + * @static + * @param {google.cloud.batch.v1.IVolume=} [properties] Properties to set + * @returns {google.cloud.batch.v1.Volume} Volume instance + */ + Volume.create = function create(properties) { + return new Volume(properties); + }; + + /** + * Encodes the specified Volume message. Does not implicitly {@link google.cloud.batch.v1.Volume.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.Volume + * @static + * @param {google.cloud.batch.v1.IVolume} message Volume message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Volume.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nfs != null && Object.hasOwnProperty.call(message, "nfs")) + $root.google.cloud.batch.v1.NFS.encode(message.nfs, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.gcs != null && Object.hasOwnProperty.call(message, "gcs")) + $root.google.cloud.batch.v1.GCS.encode(message.gcs, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.mountPath != null && Object.hasOwnProperty.call(message, "mountPath")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.mountPath); + if (message.mountOptions != null && message.mountOptions.length) + for (var i = 0; i < message.mountOptions.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.mountOptions[i]); + if (message.deviceName != null && Object.hasOwnProperty.call(message, "deviceName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.deviceName); + return writer; + }; + + /** + * Encodes the specified Volume message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Volume.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.Volume + * @static + * @param {google.cloud.batch.v1.IVolume} message Volume message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Volume.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Volume message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.Volume + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.Volume} Volume + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Volume.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Volume(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nfs = $root.google.cloud.batch.v1.NFS.decode(reader, reader.uint32()); + break; + } + case 3: { + message.gcs = $root.google.cloud.batch.v1.GCS.decode(reader, reader.uint32()); + break; + } + case 6: { + message.deviceName = reader.string(); + break; + } + case 4: { + message.mountPath = reader.string(); + break; + } + case 5: { + if (!(message.mountOptions && message.mountOptions.length)) + message.mountOptions = []; + message.mountOptions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Volume message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.Volume + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.Volume} Volume + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Volume.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Volume message. + * @function verify + * @memberof google.cloud.batch.v1.Volume + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Volume.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nfs != null && message.hasOwnProperty("nfs")) { + properties.source = 1; + { + var error = $root.google.cloud.batch.v1.NFS.verify(message.nfs); + if (error) + return "nfs." + error; + } + } + if (message.gcs != null && message.hasOwnProperty("gcs")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.batch.v1.GCS.verify(message.gcs); + if (error) + return "gcs." + error; + } + } + if (message.deviceName != null && message.hasOwnProperty("deviceName")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!$util.isString(message.deviceName)) + return "deviceName: string expected"; + } + if (message.mountPath != null && message.hasOwnProperty("mountPath")) + if (!$util.isString(message.mountPath)) + return "mountPath: string expected"; + if (message.mountOptions != null && message.hasOwnProperty("mountOptions")) { + if (!Array.isArray(message.mountOptions)) + return "mountOptions: array expected"; + for (var i = 0; i < message.mountOptions.length; ++i) + if (!$util.isString(message.mountOptions[i])) + return "mountOptions: string[] expected"; + } + return null; + }; + + /** + * Creates a Volume message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.Volume + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.Volume} Volume + */ + Volume.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.Volume) + return object; + var message = new $root.google.cloud.batch.v1.Volume(); + if (object.nfs != null) { + if (typeof object.nfs !== "object") + throw TypeError(".google.cloud.batch.v1.Volume.nfs: object expected"); + message.nfs = $root.google.cloud.batch.v1.NFS.fromObject(object.nfs); + } + if (object.gcs != null) { + if (typeof object.gcs !== "object") + throw TypeError(".google.cloud.batch.v1.Volume.gcs: object expected"); + message.gcs = $root.google.cloud.batch.v1.GCS.fromObject(object.gcs); + } + if (object.deviceName != null) + message.deviceName = String(object.deviceName); + if (object.mountPath != null) + message.mountPath = String(object.mountPath); + if (object.mountOptions) { + if (!Array.isArray(object.mountOptions)) + throw TypeError(".google.cloud.batch.v1.Volume.mountOptions: array expected"); + message.mountOptions = []; + for (var i = 0; i < object.mountOptions.length; ++i) + message.mountOptions[i] = String(object.mountOptions[i]); + } + return message; + }; + + /** + * Creates a plain object from a Volume message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.Volume + * @static + * @param {google.cloud.batch.v1.Volume} message Volume + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Volume.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.mountOptions = []; + if (options.defaults) + object.mountPath = ""; + if (message.nfs != null && message.hasOwnProperty("nfs")) { + object.nfs = $root.google.cloud.batch.v1.NFS.toObject(message.nfs, options); + if (options.oneofs) + object.source = "nfs"; + } + if (message.gcs != null && message.hasOwnProperty("gcs")) { + object.gcs = $root.google.cloud.batch.v1.GCS.toObject(message.gcs, options); + if (options.oneofs) + object.source = "gcs"; + } + if (message.mountPath != null && message.hasOwnProperty("mountPath")) + object.mountPath = message.mountPath; + if (message.mountOptions && message.mountOptions.length) { + object.mountOptions = []; + for (var j = 0; j < message.mountOptions.length; ++j) + object.mountOptions[j] = message.mountOptions[j]; + } + if (message.deviceName != null && message.hasOwnProperty("deviceName")) { + object.deviceName = message.deviceName; + if (options.oneofs) + object.source = "deviceName"; + } + return object; + }; + + /** + * Converts this Volume to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.Volume + * @instance + * @returns {Object.} JSON object + */ + Volume.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Volume + * @function getTypeUrl + * @memberof google.cloud.batch.v1.Volume + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Volume.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.Volume"; + }; + + return Volume; + })(); + + v1.NFS = (function() { + + /** + * Properties of a NFS. + * @memberof google.cloud.batch.v1 + * @interface INFS + * @property {string|null} [server] NFS server + * @property {string|null} [remotePath] NFS remotePath + */ + + /** + * Constructs a new NFS. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a NFS. + * @implements INFS + * @constructor + * @param {google.cloud.batch.v1.INFS=} [properties] Properties to set + */ + function NFS(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NFS server. + * @member {string} server + * @memberof google.cloud.batch.v1.NFS + * @instance + */ + NFS.prototype.server = ""; + + /** + * NFS remotePath. + * @member {string} remotePath + * @memberof google.cloud.batch.v1.NFS + * @instance + */ + NFS.prototype.remotePath = ""; + + /** + * Creates a new NFS instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.NFS + * @static + * @param {google.cloud.batch.v1.INFS=} [properties] Properties to set + * @returns {google.cloud.batch.v1.NFS} NFS instance + */ + NFS.create = function create(properties) { + return new NFS(properties); + }; + + /** + * Encodes the specified NFS message. Does not implicitly {@link google.cloud.batch.v1.NFS.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.NFS + * @static + * @param {google.cloud.batch.v1.INFS} message NFS message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NFS.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.server != null && Object.hasOwnProperty.call(message, "server")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.server); + if (message.remotePath != null && Object.hasOwnProperty.call(message, "remotePath")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.remotePath); + return writer; + }; + + /** + * Encodes the specified NFS message, length delimited. Does not implicitly {@link google.cloud.batch.v1.NFS.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.NFS + * @static + * @param {google.cloud.batch.v1.INFS} message NFS message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NFS.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NFS message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.NFS + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.NFS} NFS + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NFS.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.NFS(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.server = reader.string(); + break; + } + case 2: { + message.remotePath = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NFS message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.NFS + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.NFS} NFS + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NFS.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NFS message. + * @function verify + * @memberof google.cloud.batch.v1.NFS + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NFS.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.server != null && message.hasOwnProperty("server")) + if (!$util.isString(message.server)) + return "server: string expected"; + if (message.remotePath != null && message.hasOwnProperty("remotePath")) + if (!$util.isString(message.remotePath)) + return "remotePath: string expected"; + return null; + }; + + /** + * Creates a NFS message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.NFS + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.NFS} NFS + */ + NFS.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.NFS) + return object; + var message = new $root.google.cloud.batch.v1.NFS(); + if (object.server != null) + message.server = String(object.server); + if (object.remotePath != null) + message.remotePath = String(object.remotePath); + return message; + }; + + /** + * Creates a plain object from a NFS message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.NFS + * @static + * @param {google.cloud.batch.v1.NFS} message NFS + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NFS.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.server = ""; + object.remotePath = ""; + } + if (message.server != null && message.hasOwnProperty("server")) + object.server = message.server; + if (message.remotePath != null && message.hasOwnProperty("remotePath")) + object.remotePath = message.remotePath; + return object; + }; + + /** + * Converts this NFS to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.NFS + * @instance + * @returns {Object.} JSON object + */ + NFS.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NFS + * @function getTypeUrl + * @memberof google.cloud.batch.v1.NFS + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NFS.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.NFS"; + }; + + return NFS; + })(); + + v1.GCS = (function() { + + /** + * Properties of a GCS. + * @memberof google.cloud.batch.v1 + * @interface IGCS + * @property {string|null} [remotePath] GCS remotePath + */ + + /** + * Constructs a new GCS. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a GCS. + * @implements IGCS + * @constructor + * @param {google.cloud.batch.v1.IGCS=} [properties] Properties to set + */ + function GCS(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GCS remotePath. + * @member {string} remotePath + * @memberof google.cloud.batch.v1.GCS + * @instance + */ + GCS.prototype.remotePath = ""; + + /** + * Creates a new GCS instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.GCS + * @static + * @param {google.cloud.batch.v1.IGCS=} [properties] Properties to set + * @returns {google.cloud.batch.v1.GCS} GCS instance + */ + GCS.create = function create(properties) { + return new GCS(properties); + }; + + /** + * Encodes the specified GCS message. Does not implicitly {@link google.cloud.batch.v1.GCS.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.GCS + * @static + * @param {google.cloud.batch.v1.IGCS} message GCS message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GCS.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.remotePath != null && Object.hasOwnProperty.call(message, "remotePath")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.remotePath); + return writer; + }; + + /** + * Encodes the specified GCS message, length delimited. Does not implicitly {@link google.cloud.batch.v1.GCS.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.GCS + * @static + * @param {google.cloud.batch.v1.IGCS} message GCS message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GCS.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GCS message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.GCS + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.GCS} GCS + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GCS.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.GCS(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.remotePath = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GCS message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.GCS + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.GCS} GCS + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GCS.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GCS message. + * @function verify + * @memberof google.cloud.batch.v1.GCS + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GCS.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.remotePath != null && message.hasOwnProperty("remotePath")) + if (!$util.isString(message.remotePath)) + return "remotePath: string expected"; + return null; + }; + + /** + * Creates a GCS message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.GCS + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.GCS} GCS + */ + GCS.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.GCS) + return object; + var message = new $root.google.cloud.batch.v1.GCS(); + if (object.remotePath != null) + message.remotePath = String(object.remotePath); + return message; + }; + + /** + * Creates a plain object from a GCS message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.GCS + * @static + * @param {google.cloud.batch.v1.GCS} message GCS + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GCS.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.remotePath = ""; + if (message.remotePath != null && message.hasOwnProperty("remotePath")) + object.remotePath = message.remotePath; + return object; + }; + + /** + * Converts this GCS to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.GCS + * @instance + * @returns {Object.} JSON object + */ + GCS.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GCS + * @function getTypeUrl + * @memberof google.cloud.batch.v1.GCS + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GCS.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.GCS"; + }; + + return GCS; + })(); + + return v1; + })(); + + return batch; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + */ + + /** + * Constructs a new CommonLanguageSettings. + * @memberof google.api + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings + * @constructor + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + */ + function CommonLanguageSettings(properties) { + this.destinations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.referenceDocsUri = ""; + + /** + * CommonLanguageSettings destinations. + * @member {Array.} destinations + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.destinations = $util.emptyArray; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @function create + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance + */ + CommonLanguageSettings.create = function create(properties) { + return new CommonLanguageSettings(properties); + }; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); + if (message.destinations != null && message.destinations.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.destinations.length; ++i) + writer.int32(message.destinations[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLanguageSettings message. + * @function verify + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLanguageSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + if (!$util.isString(message.referenceDocsUri)) + return "referenceDocsUri: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + switch (message.destinations[i]) { + default: + return "destinations: enum value[] expected"; + case 0: + case 10: + case 20: + break; + } + } + return null; + }; + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + */ + CommonLanguageSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CommonLanguageSettings) + return object; + var message = new $root.google.api.CommonLanguageSettings(); + if (object.referenceDocsUri != null) + message.referenceDocsUri = String(object.referenceDocsUri); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + switch (object.destinations[i]) { + default: + if (typeof object.destinations[i] === "number") { + message.destinations[i] = object.destinations[i]; + break; + } + case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": + case 0: + message.destinations[i] = 0; + break; + case "GITHUB": + case 10: + message.destinations[i] = 10; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) + object.referenceDocsUri = ""; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + object.referenceDocsUri = message.referenceDocsUri; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + } + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + api.ClientLibrarySettings = (function() { + + /** + * Properties of a ClientLibrarySettings. + * @memberof google.api + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings + */ + + /** + * Constructs a new ClientLibrarySettings. + * @memberof google.api + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings + * @constructor + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + */ + function ClientLibrarySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && message.hasOwnProperty("goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (typeof object.javaSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); + } + if (object.cppSettings != null) { + if (typeof object.cppSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); + } + if (object.phpSettings != null) { + if (typeof object.phpSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); + } + if (object.pythonSettings != null) { + if (typeof object.pythonSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); + } + if (object.nodeSettings != null) { + if (typeof object.nodeSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); + } + if (object.dotnetSettings != null) { + if (typeof object.dotnetSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); + } + if (object.rubySettings != null) { + if (typeof object.rubySettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); + } + if (object.goSettings != null) { + if (typeof object.goSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); + } + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); + if (message.goSettings != null && message.hasOwnProperty("goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); + return object; + }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @memberof google.api + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + + /** + * Publishing restReferenceDocumentationUri. + * @member {string} restReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.restReferenceDocumentationUri = ""; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); + break; + } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } + case 111: { + message.restReferenceDocumentationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); + if (error) + return "librarySettings." + error; + } + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + if (!$util.isString(message.restReferenceDocumentationUri)) + return "restReferenceDocumentationUri: string expected"; + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Publishing) + return object; + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (typeof object.methodSettings[i] !== "object") + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + case "SHOPPING": + case 5: + message.organization = 5; + break; + case "GEO": + case 6: + message.organization = 6; + break; + case "GENERATIVE_AI": + case 7: + message.organization = 7; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (typeof object.librarySettings[i] !== "object") + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); + } + } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); + if (object.restReferenceDocumentationUri != null) + message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + object.protoReferenceDocumentationUri = ""; + object.restReferenceDocumentationUri = ""; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.JavaSettings) + return object; + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (typeof object.serviceClassNames !== "object") + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CppSettings) + return object; + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PhpSettings) + return object; + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + */ + + /** + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings + * @constructor + * @param {google.api.IPythonSettings=} [properties] Properties to set + */ + function PythonSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings) + return object; + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.NodeSettings) + return object; + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + * @property {Object.|null} [renamedServices] DotnetSettings renamedServices + * @property {Object.|null} [renamedResources] DotnetSettings renamedResources + * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources + * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases + * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(properties) { + this.renamedServices = {}; + this.renamedResources = {}; + this.ignoredResources = []; + this.forcedNamespaceAliases = []; + this.handwrittenSignatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * DotnetSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedServices = $util.emptyObject; + + /** + * DotnetSettings renamedResources. + * @member {Object.} renamedResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedResources = $util.emptyObject; + + /** + * DotnetSettings ignoredResources. + * @member {Array.} ignoredResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + + /** + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + + /** + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) + for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); + if (message.ignoredResources != null && message.ignoredResources.length) + for (var i = 0; i < message.ignoredResources.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); + if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); + if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } + case 3: { + if (message.renamedResources === $util.emptyObject) + message.renamedResources = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedResources[key] = value; + break; + } + case 4: { + if (!(message.ignoredResources && message.ignoredResources.length)) + message.ignoredResources = []; + message.ignoredResources.push(reader.string()); + break; + } + case 5: { + if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) + message.forcedNamespaceAliases = []; + message.forcedNamespaceAliases.push(reader.string()); + break; + } + case 6: { + if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) + message.handwrittenSignatures = []; + message.handwrittenSignatures.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { + if (!$util.isObject(message.renamedResources)) + return "renamedResources: object expected"; + var key = Object.keys(message.renamedResources); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedResources[key[i]])) + return "renamedResources: string{k:string} expected"; + } + if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { + if (!Array.isArray(message.ignoredResources)) + return "ignoredResources: array expected"; + for (var i = 0; i < message.ignoredResources.length; ++i) + if (!$util.isString(message.ignoredResources[i])) + return "ignoredResources: string[] expected"; + } + if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { + if (!Array.isArray(message.forcedNamespaceAliases)) + return "forcedNamespaceAliases: array expected"; + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + if (!$util.isString(message.forcedNamespaceAliases[i])) + return "forcedNamespaceAliases: string[] expected"; + } + if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { + if (!Array.isArray(message.handwrittenSignatures)) + return "handwrittenSignatures: array expected"; + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + if (!$util.isString(message.handwrittenSignatures[i])) + return "handwrittenSignatures: string[] expected"; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + if (object.renamedResources) { + if (typeof object.renamedResources !== "object") + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) + message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); + } + if (object.ignoredResources) { + if (!Array.isArray(object.ignoredResources)) + throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); + message.ignoredResources = []; + for (var i = 0; i < object.ignoredResources.length; ++i) + message.ignoredResources[i] = String(object.ignoredResources[i]); + } + if (object.forcedNamespaceAliases) { + if (!Array.isArray(object.forcedNamespaceAliases)) + throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); + message.forcedNamespaceAliases = []; + for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) + message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); + } + if (object.handwrittenSignatures) { + if (!Array.isArray(object.handwrittenSignatures)) + throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); + message.handwrittenSignatures = []; + for (var i = 0; i < object.handwrittenSignatures.length; ++i) + message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; + } + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; + } + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { + object.renamedResources = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + } + if (message.ignoredResources && message.ignoredResources.length) { + object.ignoredResources = []; + for (var j = 0; j < message.ignoredResources.length; ++j) + object.ignoredResources[j] = message.ignoredResources[j]; + } + if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { + object.forcedNamespaceAliases = []; + for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) + object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + } + if (message.handwrittenSignatures && message.handwrittenSignatures.length) { + object.handwrittenSignatures = []; + for (var j = 0; j < message.handwrittenSignatures.length; ++j) + object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; + } + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RubySettings) + return object; + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings + * @constructor + * @param {google.api.IGoSettings=} [properties] Properties to set + */ + function GoSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.common = null; + + /** + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.GoSettings) + return object; + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(properties) { + this.autoPopulatedFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) + message.autoPopulatedFields = []; + message.autoPopulatedFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); + if (error) + return "longRunning." + error; + } + if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { + if (!Array.isArray(message.autoPopulatedFields)) + return "autoPopulatedFields: array expected"; + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + if (!$util.isString(message.autoPopulatedFields[i])) + return "autoPopulatedFields: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings) + return object; + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (typeof object.longRunning !== "object") + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); + } + if (object.autoPopulatedFields) { + if (!Array.isArray(object.autoPopulatedFields)) + throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); + message.autoPopulatedFields = []; + for (var i = 0; i < object.autoPopulatedFields.length; ++i) + message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.autoPopulatedFields = []; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); + if (message.autoPopulatedFields && message.autoPopulatedFields.length) { + object.autoPopulatedFields = []; + for (var j = 0; j < message.autoPopulatedFields.length; ++j) + object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; + } + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (typeof object.initialPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (typeof object.maxPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); + } + if (object.totalPollTimeout != null) { + if (typeof object.totalPollTimeout !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + * @property {number} SHOPPING=5 SHOPPING value + * @property {number} GEO=6 GEO value + * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + values[valuesById[5] = "SHOPPING"] = 5; + values[valuesById[6] = "GEO"] = 6; + values[valuesById[7] = "GENERATIVE_AI"] = 7; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + + /** + * 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.FieldInfo = (function() { + + /** + * Properties of a FieldInfo. + * @memberof google.api + * @interface IFieldInfo + * @property {google.api.FieldInfo.Format|null} [format] FieldInfo format + */ + + /** + * Constructs a new FieldInfo. + * @memberof google.api + * @classdesc Represents a FieldInfo. + * @implements IFieldInfo + * @constructor + * @param {google.api.IFieldInfo=} [properties] Properties to set + */ + function FieldInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldInfo format. + * @member {google.api.FieldInfo.Format} format + * @memberof google.api.FieldInfo + * @instance + */ + FieldInfo.prototype.format = 0; + + /** + * Creates a new FieldInfo instance using the specified properties. + * @function create + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo=} [properties] Properties to set + * @returns {google.api.FieldInfo} FieldInfo instance + */ + FieldInfo.create = function create(properties) { + return new FieldInfo(properties); + }; + + /** + * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @function encode + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.format); + return writer; + }; + + /** + * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldInfo message from the specified reader or buffer. + * @function decode + * @memberof google.api.FieldInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.FieldInfo} FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.FieldInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.format = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.FieldInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.FieldInfo} FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldInfo message. + * @function verify + * @memberof google.api.FieldInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.format != null && message.hasOwnProperty("format")) + switch (message.format) { + default: + return "format: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.FieldInfo + * @static + * @param {Object.} object Plain object + * @returns {google.api.FieldInfo} FieldInfo + */ + FieldInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.FieldInfo) + return object; + var message = new $root.google.api.FieldInfo(); + switch (object.format) { + default: + if (typeof object.format === "number") { + message.format = object.format; + break; + } + break; + case "FORMAT_UNSPECIFIED": + case 0: + message.format = 0; + break; + case "UUID4": + case 1: + message.format = 1; + break; + case "IPV4": + case 2: + message.format = 2; + break; + case "IPV6": + case 3: + message.format = 3; + break; + case "IPV4_OR_IPV6": + case 4: + message.format = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.FieldInfo + * @static + * @param {google.api.FieldInfo} message FieldInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.format = options.enums === String ? "FORMAT_UNSPECIFIED" : 0; + if (message.format != null && message.hasOwnProperty("format")) + object.format = options.enums === String ? $root.google.api.FieldInfo.Format[message.format] === undefined ? message.format : $root.google.api.FieldInfo.Format[message.format] : message.format; + return object; + }; + + /** + * Converts this FieldInfo to JSON. + * @function toJSON + * @memberof google.api.FieldInfo + * @instance + * @returns {Object.} JSON object + */ + FieldInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldInfo + * @function getTypeUrl + * @memberof google.api.FieldInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.FieldInfo"; + }; + + /** + * Format enum. + * @name google.api.FieldInfo.Format + * @enum {number} + * @property {number} FORMAT_UNSPECIFIED=0 FORMAT_UNSPECIFIED value + * @property {number} UUID4=1 UUID4 value + * @property {number} IPV4=2 IPV4 value + * @property {number} IPV6=3 IPV6 value + * @property {number} IPV4_OR_IPV6=4 IPV4_OR_IPV6 value + */ + FieldInfo.Format = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "UUID4"] = 1; + values[valuesById[2] = "IPV4"] = 2; + values[valuesById[3] = "IPV6"] = 3; + values[valuesById[4] = "IPV4_OR_IPV6"] = 4; + return values; + })(); + + return FieldInfo; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value + * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value + * @property {number} EDITION_2023=1000 EDITION_2023 value + * @property {number} EDITION_2024=1001 EDITION_2024 value + * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value + * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value + * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value + * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value + * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value + * @property {number} EDITION_MAX=2147483647 EDITION_MAX value + */ + protobuf.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[998] = "EDITION_PROTO2"] = 998; + values[valuesById[999] = "EDITION_PROTO3"] = 999; + values[valuesById[1000] = "EDITION_2023"] = 1000; + values[valuesById[1001] = "EDITION_2024"] = 1001; + values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; + values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; + values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; + values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; + values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; + values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; + return values; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = 0; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 14: { + message.edition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + this.declaration = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.verification = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message.declaration != null && message.hasOwnProperty("declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); + if (error) + return "declaration." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.verification != null && message.hasOwnProperty("verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (typeof object.declaration[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); + } + if (message.verification != null && message.hasOwnProperty("verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.fullName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 5: { + message.reserved = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Declaration message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Declaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && message.hasOwnProperty("reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + return null; + }; + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + */ + Declaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + if (object.number != null) + message.number = object.number | 0; + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.type != null) + message.type = String(object.type); + if (object.reserved != null) + message.reserved = Boolean(object.reserved); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + return message; + }; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Declaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.reserved != null && message.hasOwnProperty("reserved")) + object.reserved = message.reserved; + if (message.repeated != null && message.hasOwnProperty("repeated")) + object.repeated = message.repeated; + return object; + }; + + /** + * Converts this Declaration to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + * @returns {Object.} JSON object + */ + Declaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Declaration + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; + }; + + return Declaration; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 3: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.features = null; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FileOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + object.features = null; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * MessageOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.features = null; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 12: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {Array.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IFieldInfo|null} [".google.api.fieldInfo"] FieldOptions .google.api.fieldInfo + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.targets = []; + this.editionDefaults = []; + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions targets. + * @member {Array.} targets + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.targets = $util.emptyArray; + + /** + * FieldOptions editionDefaults. + * @member {Array.} editionDefaults + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.editionDefaults = $util.emptyArray; + + /** + * FieldOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.features = null; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldInfo. + * @member {google.api.IFieldInfo|null|undefined} .google.api.fieldInfo + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldInfo"] = null; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); + if (message.editionDefaults != null && message.editionDefaults.length) + for (var i = 0; i < message.editionDefaults.length; ++i) + $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + if (message[".google.api.fieldInfo"] != null && Object.hasOwnProperty.call(message, ".google.api.fieldInfo")) + $root.google.api.FieldInfo.encode(message[".google.api.fieldInfo"], writer.uint32(/* id 291403980, wireType 2 =*/2331231842).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 19: { + if (!(message.targets && message.targets.length)) + message.targets = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targets.push(reader.int32()); + } else + message.targets.push(reader.int32()); + break; + } + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 291403980: { + message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.decode(reader, reader.uint32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && message.hasOwnProperty("retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.targets != null && message.hasOwnProperty("targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) + switch (message.targets[i]) { + default: + return "targets: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + } + if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { + if (!Array.isArray(message.editionDefaults)) + return "editionDefaults: array expected"; + for (var i = 0; i < message.editionDefaults.length; ++i) { + var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); + if (error) + return "editionDefaults." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) { + var error = $root.google.api.FieldInfo.verify(message[".google.api.fieldInfo"]); + if (error) + return ".google.api.fieldInfo." + error; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) + switch (object.targets[i]) { + default: + if (typeof object.targets[i] === "number") { + message.targets[i] = object.targets[i]; + break; + } + case "TARGET_TYPE_UNKNOWN": + case 0: + message.targets[i] = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.targets[i] = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.targets[i] = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.targets[i] = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.targets[i] = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.targets[i] = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.targets[i] = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.targets[i] = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.targets[i] = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.targets[i] = 9; + break; + } + } + if (object.editionDefaults) { + if (!Array.isArray(object.editionDefaults)) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); + message.editionDefaults = []; + for (var i = 0; i < object.editionDefaults.length; ++i) { + if (typeof object.editionDefaults[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); + message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FieldOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + break; + } + } + if (object[".google.api.fieldInfo"] != null) { + if (typeof object[".google.api.fieldInfo"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldInfo: object expected"); + message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.fromObject(object[".google.api.fieldInfo"]); + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targets = []; + object.editionDefaults = []; + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object.debugRedact = false; + object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; + object.features = null; + object[".google.api.resourceReference"] = null; + object[".google.api.fieldInfo"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.retention != null && message.hasOwnProperty("retention")) + object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; + if (message.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; + } + if (message.editionDefaults && message.editionDefaults.length) { + object.editionDefaults = []; + for (var j = 0; j < message.editionDefaults.length; ++j) + object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) + object[".google.api.fieldInfo"] = $root.google.api.FieldInfo.toObject(message[".google.api.fieldInfo"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.features = null; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.features = null; + + /** + * EnumValueOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.debugRedact = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.debugRedact = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object.debugRedact = false; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + case 525000001: { + message[".google.api.apiVersion"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.features = null; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 35: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MethodOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object.features = null; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + */ + + /** + * Constructs a new FeatureSet. + * @memberof google.protobuf + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet + * @constructor + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + */ + function FeatureSet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.fieldPresence = 0; + + /** + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enumType = 0; + + /** + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.repeatedFieldEncoding = 0; + + /** + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.utf8Validation = 0; + + /** + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.messageEncoding = 0; + + /** + * FeatureSet jsonFormat. + * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.jsonFormat = 0; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance + */ + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); + }; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fieldPresence = reader.int32(); + break; + } + case 2: { + message.enumType = reader.int32(); + break; + } + case 3: { + message.repeatedFieldEncoding = reader.int32(); + break; + } + case 4: { + message.utf8Validation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + switch (message.fieldPresence) { + default: + return "fieldPresence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) + switch (message.enumType) { + default: + return "enumType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + switch (message.repeatedFieldEncoding) { + default: + return "repeatedFieldEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + switch (message.utf8Validation) { + default: + return "utf8Validation: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + switch (message.messageEncoding) { + default: + return "messageEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + switch (message.jsonFormat) { + default: + return "jsonFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet} FeatureSet + */ + FeatureSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { + default: + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; + break; + } + break; + case "FIELD_PRESENCE_UNKNOWN": + case 0: + message.fieldPresence = 0; + break; + case "EXPLICIT": + case 1: + message.fieldPresence = 1; + break; + case "IMPLICIT": + case 2: + message.fieldPresence = 2; + break; + case "LEGACY_REQUIRED": + case 3: + message.fieldPresence = 3; + break; + } + switch (object.enumType) { + default: + if (typeof object.enumType === "number") { + message.enumType = object.enumType; + break; + } + break; + case "ENUM_TYPE_UNKNOWN": + case 0: + message.enumType = 0; + break; + case "OPEN": + case 1: + message.enumType = 1; + break; + case "CLOSED": + case 2: + message.enumType = 2; + break; + } + switch (object.repeatedFieldEncoding) { + default: + if (typeof object.repeatedFieldEncoding === "number") { + message.repeatedFieldEncoding = object.repeatedFieldEncoding; + break; + } + break; + case "REPEATED_FIELD_ENCODING_UNKNOWN": + case 0: + message.repeatedFieldEncoding = 0; + break; + case "PACKED": + case 1: + message.repeatedFieldEncoding = 1; + break; + case "EXPANDED": + case 2: + message.repeatedFieldEncoding = 2; + break; + } + switch (object.utf8Validation) { + default: + if (typeof object.utf8Validation === "number") { + message.utf8Validation = object.utf8Validation; + break; + } + break; + case "UTF8_VALIDATION_UNKNOWN": + case 0: + message.utf8Validation = 0; + break; + case "VERIFY": + case 2: + message.utf8Validation = 2; + break; + case "NONE": + case 3: + message.utf8Validation = 3; + break; + } + switch (object.messageEncoding) { + default: + if (typeof object.messageEncoding === "number") { + message.messageEncoding = object.messageEncoding; + break; + } + break; + case "MESSAGE_ENCODING_UNKNOWN": + case 0: + message.messageEncoding = 0; + break; + case "LENGTH_PREFIXED": + case 1: + message.messageEncoding = 1; + break; + case "DELIMITED": + case 2: + message.messageEncoding = 2; + break; + } + switch (object.jsonFormat) { + default: + if (typeof object.jsonFormat === "number") { + message.jsonFormat = object.jsonFormat; + break; + } + break; + case "JSON_FORMAT_UNKNOWN": + case 0: + message.jsonFormat = 0; + break; + case "ALLOW": + case 1: + message.jsonFormat = 1; + break; + case "LEGACY_BEST_EFFORT": + case 2: + message.jsonFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.FeatureSet} message FeatureSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; + object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; + object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; + object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + } + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; + if (message.enumType != null && message.hasOwnProperty("enumType")) + object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + return object; + }; + + /** + * Converts this FeatureSet to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet + * @instance + * @returns {Object.} JSON object + */ + FeatureSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSet + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet"; + }; + + /** + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence + * @enum {number} + * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value + * @property {number} EXPLICIT=1 EXPLICIT value + * @property {number} IMPLICIT=2 IMPLICIT value + * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value + */ + FeatureSet.FieldPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; + values[valuesById[1] = "EXPLICIT"] = 1; + values[valuesById[2] = "IMPLICIT"] = 2; + values[valuesById[3] = "LEGACY_REQUIRED"] = 3; + return values; + })(); + + /** + * EnumType enum. + * @name google.protobuf.FeatureSet.EnumType + * @enum {number} + * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + FeatureSet.EnumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * RepeatedFieldEncoding enum. + * @name google.protobuf.FeatureSet.RepeatedFieldEncoding + * @enum {number} + * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value + * @property {number} PACKED=1 PACKED value + * @property {number} EXPANDED=2 EXPANDED value + */ + FeatureSet.RepeatedFieldEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "PACKED"] = 1; + values[valuesById[2] = "EXPANDED"] = 2; + return values; + })(); + + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition + */ + + /** + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.defaults && message.defaults.length)) + message.defaults = []; + message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); + break; + } + case 4: { + message.minimumEdition = reader.int32(); + break; + } + case 5: { + message.maximumEdition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetDefaults message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetDefaults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaults != null && message.hasOwnProperty("defaults")) { + if (!Array.isArray(message.defaults)) + return "defaults: array expected"; + for (var i = 0; i < message.defaults.length; ++i) { + var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); + if (error) + return "defaults." + error; + } + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + switch (message.minimumEdition) { + default: + return "minimumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + switch (message.maximumEdition) { + default: + return "maximumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + */ + FeatureSetDefaults.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults(); + if (object.defaults) { + if (!Array.isArray(object.defaults)) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); + message.defaults = []; + for (var i = 0; i < object.defaults.length; ++i) { + if (typeof object.defaults[i] !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); + message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); + } + } + switch (object.minimumEdition) { + default: + if (typeof object.minimumEdition === "number") { + message.minimumEdition = object.minimumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.minimumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.minimumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.minimumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.minimumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.minimumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.minimumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.minimumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.minimumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.minimumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.minimumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.minimumEdition = 2147483647; + break; + } + switch (object.maximumEdition) { + default: + if (typeof object.maximumEdition === "number") { + message.maximumEdition = object.maximumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.maximumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.maximumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.maximumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.maximumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.maximumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.maximumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.maximumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.maximumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.maximumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.maximumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.maximumEdition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetDefaults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; + if (options.defaults) { + object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.defaults && message.defaults.length) { + object.defaults = []; + for (var j = 0; j < message.defaults.length; ++j) + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; + return object; + }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults + * @instance + * @returns {Object.} JSON object + */ + FeatureSetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetDefaults + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; + }; + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + + /** + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + */ + + /** + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault + * @constructor + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + */ + function FeatureSetEditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.edition = 0; + + /** + * FeatureSetEditionDefault features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.features = null; + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance + */ + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); + }; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetEditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + return null; + }; + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + */ + FeatureSetEditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetEditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.features = null; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + return protobuf; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/owl-bot-staging/google-cloud-batch/v1/protos/protos.json b/owl-bot-staging/google-cloud-batch/v1/protos/protos.json new file mode 100644 index 00000000000..f6488c2185f --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/protos/protos.json @@ -0,0 +1,3401 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "batch": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.Batch.V1", + "go_package": "cloud.google.com/go/batch/apiv1/batchpb;batchpb", + "java_multiple_files": true, + "java_outer_classname": "VolumeProto", + "java_package": "com.google.cloud.batch.v1", + "objc_class_prefix": "GCB", + "php_namespace": "Google\\Cloud\\Batch\\V1", + "ruby_package": "Google::Cloud::Batch::V1" + }, + "nested": { + "BatchService": { + "options": { + "(google.api.default_host)": "batch.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateJob": { + "requestType": "CreateJobRequest", + "responseType": "Job", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/jobs", + "(google.api.http).body": "job", + "(google.api.method_signature)": "parent,job,job_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/jobs", + "body": "job" + } + }, + { + "(google.api.method_signature)": "parent,job,job_id" + } + ] + }, + "GetJob": { + "requestType": "GetJobRequest", + "responseType": "Job", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/jobs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/jobs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteJob": { + "requestType": "DeleteJobRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/jobs/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.batch.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/jobs/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.batch.v1.OperationMetadata" + } + } + ] + }, + "ListJobs": { + "requestType": "ListJobsRequest", + "responseType": "ListJobsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/jobs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/jobs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetTask": { + "requestType": "GetTaskRequest", + "responseType": "Task", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/jobs/*/taskGroups/*/tasks/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/jobs/*/taskGroups/*/tasks/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListTasks": { + "requestType": "ListTasksRequest", + "responseType": "ListTasksResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/jobs/*/taskGroups/*}/tasks", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/jobs/*/taskGroups/*}/tasks" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "CreateJobRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "batch.googleapis.com/Job" + } + }, + "jobId": { + "type": "string", + "id": 2 + }, + "job": { + "type": "Job", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "batch.googleapis.com/Job" + } + } + } + }, + "DeleteJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "reason": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListJobsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListJobsResponse": { + "fields": { + "jobs": { + "rule": "repeated", + "type": "Job", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "ListTasksRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "batch.googleapis.com/TaskGroup" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListTasksResponse": { + "fields": { + "tasks": { + "rule": "repeated", + "type": "Task", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetTaskRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "batch.googleapis.com/Task" + } + } + } + }, + "OperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "target": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusMessage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiVersion": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Job": { + "options": { + "(google.api.resource).type": "batch.googleapis.com/Job", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/jobs/{job}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "uid": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "priority": { + "type": "int64", + "id": 3 + }, + "taskGroups": { + "rule": "repeated", + "type": "TaskGroup", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "allocationPolicy": { + "type": "AllocationPolicy", + "id": 7 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 8 + }, + "status": { + "type": "JobStatus", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "logsPolicy": { + "type": "LogsPolicy", + "id": 13 + }, + "notifications": { + "rule": "repeated", + "type": "JobNotification", + "id": 14 + } + } + }, + "LogsPolicy": { + "fields": { + "destination": { + "type": "Destination", + "id": 1 + }, + "logsPath": { + "type": "string", + "id": 2 + }, + "cloudLoggingOption": { + "type": "CloudLoggingOption", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "CloudLoggingOption": { + "fields": { + "useGenericTaskMonitoredResource": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Destination": { + "values": { + "DESTINATION_UNSPECIFIED": 0, + "CLOUD_LOGGING": 1, + "PATH": 2 + } + } + } + }, + "JobStatus": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "statusEvents": { + "rule": "repeated", + "type": "StatusEvent", + "id": 2 + }, + "taskGroups": { + "keyType": "string", + "type": "TaskGroupStatus", + "id": 4 + }, + "runDuration": { + "type": "google.protobuf.Duration", + "id": 5 + } + }, + "nested": { + "InstanceStatus": { + "fields": { + "machineType": { + "type": "string", + "id": 1 + }, + "provisioningModel": { + "type": "AllocationPolicy.ProvisioningModel", + "id": 2 + }, + "taskPack": { + "type": "int64", + "id": 3 + }, + "bootDisk": { + "type": "AllocationPolicy.Disk", + "id": 4 + } + } + }, + "TaskGroupStatus": { + "fields": { + "counts": { + "keyType": "string", + "type": "int64", + "id": 1 + }, + "instances": { + "rule": "repeated", + "type": "InstanceStatus", + "id": 2 + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "QUEUED": 1, + "SCHEDULED": 2, + "RUNNING": 3, + "SUCCEEDED": 4, + "FAILED": 5, + "DELETION_IN_PROGRESS": 6 + } + } + } + }, + "JobNotification": { + "fields": { + "pubsubTopic": { + "type": "string", + "id": 1 + }, + "message": { + "type": "Message", + "id": 2 + } + }, + "nested": { + "Message": { + "fields": { + "type": { + "type": "Type", + "id": 1 + }, + "newJobState": { + "type": "JobStatus.State", + "id": 2 + }, + "newTaskState": { + "type": "TaskStatus.State", + "id": 3 + } + } + }, + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "JOB_STATE_CHANGED": 1, + "TASK_STATE_CHANGED": 2 + } + } + } + }, + "AllocationPolicy": { + "fields": { + "location": { + "type": "LocationPolicy", + "id": 1 + }, + "instances": { + "rule": "repeated", + "type": "InstancePolicyOrTemplate", + "id": 8 + }, + "serviceAccount": { + "type": "ServiceAccount", + "id": 9 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 6 + }, + "network": { + "type": "NetworkPolicy", + "id": 7 + }, + "placement": { + "type": "PlacementPolicy", + "id": 10 + }, + "tags": { + "rule": "repeated", + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "LocationPolicy": { + "fields": { + "allowedLocations": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Disk": { + "oneofs": { + "dataSource": { + "oneof": [ + "image", + "snapshot" + ] + } + }, + "fields": { + "image": { + "type": "string", + "id": 4 + }, + "snapshot": { + "type": "string", + "id": 5 + }, + "type": { + "type": "string", + "id": 1 + }, + "sizeGb": { + "type": "int64", + "id": 2 + }, + "diskInterface": { + "type": "string", + "id": 6 + } + } + }, + "AttachedDisk": { + "oneofs": { + "attached": { + "oneof": [ + "newDisk", + "existingDisk" + ] + } + }, + "fields": { + "newDisk": { + "type": "Disk", + "id": 1 + }, + "existingDisk": { + "type": "string", + "id": 2 + }, + "deviceName": { + "type": "string", + "id": 3 + } + } + }, + "Accelerator": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "count": { + "type": "int64", + "id": 2 + }, + "installGpuDrivers": { + "type": "bool", + "id": 3, + "options": { + "deprecated": true + } + }, + "driverVersion": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "InstancePolicy": { + "fields": { + "machineType": { + "type": "string", + "id": 2 + }, + "minCpuPlatform": { + "type": "string", + "id": 3 + }, + "provisioningModel": { + "type": "ProvisioningModel", + "id": 4 + }, + "accelerators": { + "rule": "repeated", + "type": "Accelerator", + "id": 5 + }, + "bootDisk": { + "type": "Disk", + "id": 8 + }, + "disks": { + "rule": "repeated", + "type": "AttachedDisk", + "id": 6 + }, + "reservation": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "InstancePolicyOrTemplate": { + "oneofs": { + "policyTemplate": { + "oneof": [ + "policy", + "instanceTemplate" + ] + } + }, + "fields": { + "policy": { + "type": "InstancePolicy", + "id": 1 + }, + "instanceTemplate": { + "type": "string", + "id": 2 + }, + "installGpuDrivers": { + "type": "bool", + "id": 3 + }, + "installOpsAgent": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "blockProjectSshKeys": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "NetworkInterface": { + "fields": { + "network": { + "type": "string", + "id": 1 + }, + "subnetwork": { + "type": "string", + "id": 2 + }, + "noExternalIpAddress": { + "type": "bool", + "id": 3 + } + } + }, + "NetworkPolicy": { + "fields": { + "networkInterfaces": { + "rule": "repeated", + "type": "NetworkInterface", + "id": 1 + } + } + }, + "PlacementPolicy": { + "fields": { + "collocation": { + "type": "string", + "id": 1 + }, + "maxDistance": { + "type": "int64", + "id": 2 + } + } + }, + "ProvisioningModel": { + "values": { + "PROVISIONING_MODEL_UNSPECIFIED": 0, + "STANDARD": 1, + "SPOT": 2, + "PREEMPTIBLE": 3 + } + } + } + }, + "TaskGroup": { + "options": { + "(google.api.resource).type": "batch.googleapis.com/TaskGroup", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "taskSpec": { + "type": "TaskSpec", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "taskCount": { + "type": "int64", + "id": 4 + }, + "parallelism": { + "type": "int64", + "id": 5 + }, + "schedulingPolicy": { + "type": "SchedulingPolicy", + "id": 6 + }, + "taskEnvironments": { + "rule": "repeated", + "type": "Environment", + "id": 9 + }, + "taskCountPerNode": { + "type": "int64", + "id": 10 + }, + "requireHostsFile": { + "type": "bool", + "id": 11 + }, + "permissiveSsh": { + "type": "bool", + "id": 12 + }, + "runAsNonRoot": { + "type": "bool", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "SchedulingPolicy": { + "values": { + "SCHEDULING_POLICY_UNSPECIFIED": 0, + "AS_SOON_AS_POSSIBLE": 1, + "IN_ORDER": 2 + } + } + } + }, + "ServiceAccount": { + "fields": { + "email": { + "type": "string", + "id": 1 + }, + "scopes": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "ComputeResource": { + "fields": { + "cpuMilli": { + "type": "int64", + "id": 1 + }, + "memoryMib": { + "type": "int64", + "id": 2 + }, + "bootDiskMib": { + "type": "int64", + "id": 4 + } + } + }, + "StatusEvent": { + "fields": { + "type": { + "type": "string", + "id": 3 + }, + "description": { + "type": "string", + "id": 1 + }, + "eventTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "taskExecution": { + "type": "TaskExecution", + "id": 4 + }, + "taskState": { + "type": "TaskStatus.State", + "id": 5 + } + } + }, + "TaskExecution": { + "fields": { + "exitCode": { + "type": "int32", + "id": 1 + } + } + }, + "TaskStatus": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "statusEvents": { + "rule": "repeated", + "type": "StatusEvent", + "id": 2 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PENDING": 1, + "ASSIGNED": 2, + "RUNNING": 3, + "FAILED": 4, + "SUCCEEDED": 5, + "UNEXECUTED": 6 + } + } + } + }, + "Runnable": { + "oneofs": { + "executable": { + "oneof": [ + "container", + "script", + "barrier" + ] + } + }, + "fields": { + "container": { + "type": "Container", + "id": 1 + }, + "script": { + "type": "Script", + "id": 2 + }, + "barrier": { + "type": "Barrier", + "id": 6 + }, + "displayName": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ignoreExitStatus": { + "type": "bool", + "id": 3 + }, + "background": { + "type": "bool", + "id": 4 + }, + "alwaysRun": { + "type": "bool", + "id": 5 + }, + "environment": { + "type": "Environment", + "id": 7 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 8 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 9 + } + }, + "nested": { + "Container": { + "fields": { + "imageUri": { + "type": "string", + "id": 1 + }, + "commands": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "entrypoint": { + "type": "string", + "id": 3 + }, + "volumes": { + "rule": "repeated", + "type": "string", + "id": 7 + }, + "options": { + "type": "string", + "id": 8 + }, + "blockExternalNetwork": { + "type": "bool", + "id": 9 + }, + "username": { + "type": "string", + "id": 10 + }, + "password": { + "type": "string", + "id": 11 + }, + "enableImageStreaming": { + "type": "bool", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Script": { + "oneofs": { + "command": { + "oneof": [ + "path", + "text" + ] + } + }, + "fields": { + "path": { + "type": "string", + "id": 1 + }, + "text": { + "type": "string", + "id": 2 + } + } + }, + "Barrier": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + } + } + }, + "TaskSpec": { + "fields": { + "runnables": { + "rule": "repeated", + "type": "Runnable", + "id": 8 + }, + "computeResource": { + "type": "ComputeResource", + "id": 3 + }, + "maxRunDuration": { + "type": "google.protobuf.Duration", + "id": 4 + }, + "maxRetryCount": { + "type": "int32", + "id": 5 + }, + "lifecyclePolicies": { + "rule": "repeated", + "type": "LifecyclePolicy", + "id": 9 + }, + "environments": { + "keyType": "string", + "type": "string", + "id": 6, + "options": { + "deprecated": true + } + }, + "volumes": { + "rule": "repeated", + "type": "Volume", + "id": 7 + }, + "environment": { + "type": "Environment", + "id": 10 + } + } + }, + "LifecyclePolicy": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "actionCondition": { + "type": "ActionCondition", + "id": 2 + } + }, + "nested": { + "ActionCondition": { + "fields": { + "exitCodes": { + "rule": "repeated", + "type": "int32", + "id": 1 + } + } + }, + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "RETRY_TASK": 1, + "FAIL_TASK": 2 + } + } + } + }, + "Task": { + "options": { + "(google.api.resource).type": "batch.googleapis.com/Task", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}/tasks/{task}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "status": { + "type": "TaskStatus", + "id": 2 + } + } + }, + "Environment": { + "fields": { + "variables": { + "keyType": "string", + "type": "string", + "id": 1 + }, + "secretVariables": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "encryptedVariables": { + "type": "KMSEnvMap", + "id": 3 + } + }, + "nested": { + "KMSEnvMap": { + "fields": { + "keyName": { + "type": "string", + "id": 1 + }, + "cipherText": { + "type": "string", + "id": 2 + } + } + } + } + }, + "Volume": { + "oneofs": { + "source": { + "oneof": [ + "nfs", + "gcs", + "deviceName" + ] + } + }, + "fields": { + "nfs": { + "type": "NFS", + "id": 1 + }, + "gcs": { + "type": "GCS", + "id": 3 + }, + "deviceName": { + "type": "string", + "id": 6 + }, + "mountPath": { + "type": "string", + "id": 4 + }, + "mountOptions": { + "rule": "repeated", + "type": "string", + "id": 5 + } + } + }, + "NFS": { + "fields": { + "server": { + "type": "string", + "id": 1 + }, + "remotePath": { + "type": "string", + "id": 2 + } + } + }, + "GCS": { + "fields": { + "remotePath": { + "type": "string", + "id": 1 + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ResourceProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "apiVersion": { + "type": "string", + "id": 525000001, + "extend": "google.protobuf.ServiceOptions" + }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 + }, + "restReferenceDocumentationUri": { + "type": "string", + "id": 111 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "renamedResources": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "ignoredResources": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "forcedNamespaceAliases": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "handwrittenSignatures": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + }, + "autoPopulatedFields": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "PACKAGE_MANAGER": 20 + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + }, + "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 + } + }, + "fieldInfo": { + "type": "google.api.FieldInfo", + "id": 291403980, + "extend": "google.protobuf.FieldOptions" + }, + "FieldInfo": { + "fields": { + "format": { + "type": "Format", + "id": 1 + } + }, + "nested": { + "Format": { + "values": { + "FORMAT_UNSPECIFIED": 0, + "UUID4": 1, + "IPV4": 2, + "IPV6": 3, + "IPV4_OR_IPV6": 4 + } + } + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "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": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "Edition": { + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, + "FileDescriptorProto": { + "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, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "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": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "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": { + "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": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "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": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "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": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19, + "options": { + "packed": false + } + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 18, + 18 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "value": { + "type": "string", + "id": 2 + } + } + } + } + }, + "OneofOptions": { + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "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": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "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": { + "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": { + "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": { + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO2", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + } + }, + "extensions": [ + [ + 1000, + 1000 + ], + [ + 1001, + 1001 + ], + [ + 1002, + 1002 + ], + [ + 9990, + 9990 + ], + [ + 9995, + 9999 + ], + [ + 10000, + 10000 + ] + ], + "reserved": [ + [ + 999, + 999 + ] + ], + "nested": { + "FieldPresence": { + "values": { + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3 + } + }, + "EnumType": { + "values": { + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "RepeatedFieldEncoding": { + "values": { + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2 + } + }, + "Utf8Validation": { + "values": { + "UTF8_VALIDATION_UNKNOWN": 0, + "VERIFY": 2, + "NONE": 3 + } + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + } + } + }, + "FeatureSetDefaults": { + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "features": { + "type": "FeatureSet", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Timestamp": { + "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": {} + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.create_job.js b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.create_job.js new file mode 100644 index 00000000000..ceffce87c28 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.create_job.js @@ -0,0 +1,92 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, job) { + // [START batch_v1_generated_BatchService_CreateJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name where the Job will be created. + * Pattern: "projects/{project}/locations/{location}" + */ + // const parent = 'abc123' + /** + * ID used to uniquely identify the Job within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and '-' are accepted. + * The '-' character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The job.name field in the request will be ignored and the created resource + * name of the Job will be "{parent}/jobs/{job_id}". + */ + // const jobId = 'abc123' + /** + * Required. The Job to create. + */ + // const job = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callCreateJob() { + // Construct request + const request = { + parent, + job, + }; + + // Run request + const response = await batchClient.createJob(request); + console.log(response); + } + + callCreateJob(); + // [END batch_v1_generated_BatchService_CreateJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.delete_job.js b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.delete_job.js new file mode 100644 index 00000000000..056a8d9bce4 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.delete_job.js @@ -0,0 +1,79 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START batch_v1_generated_BatchService_DeleteJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Job name. + */ + // const name = 'abc123' + /** + * Optional. Reason for this deletion. + */ + // const reason = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callDeleteJob() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await batchClient.deleteJob(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteJob(); + // [END batch_v1_generated_BatchService_DeleteJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.get_job.js b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.get_job.js new file mode 100644 index 00000000000..0e68cdffae5 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.get_job.js @@ -0,0 +1,61 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START batch_v1_generated_BatchService_GetJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Job name. + */ + // const name = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callGetJob() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await batchClient.getJob(request); + console.log(response); + } + + callGetJob(); + // [END batch_v1_generated_BatchService_GetJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.get_task.js b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.get_task.js new file mode 100644 index 00000000000..3b6d00367e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.get_task.js @@ -0,0 +1,61 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START batch_v1_generated_BatchService_GetTask_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Task name. + */ + // const name = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callGetTask() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await batchClient.getTask(request); + console.log(response); + } + + callGetTask(); + // [END batch_v1_generated_BatchService_GetTask_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.list_jobs.js b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.list_jobs.js new file mode 100644 index 00000000000..cfd8edc4cf8 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.list_jobs.js @@ -0,0 +1,79 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START batch_v1_generated_BatchService_ListJobs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Parent path. + */ + // const parent = 'abc123' + /** + * List filter. + */ + // const filter = 'abc123' + /** + * Optional. Sort results. Supported are "name", "name desc", "create_time", + * and "create_time desc". + */ + // const orderBy = 'abc123' + /** + * Page size. + */ + // const pageSize = 1234 + /** + * Page token. + */ + // const pageToken = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callListJobs() { + // Construct request + const request = { + }; + + // Run request + const iterable = batchClient.listJobsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListJobs(); + // [END batch_v1_generated_BatchService_ListJobs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.list_tasks.js b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.list_tasks.js new file mode 100644 index 00000000000..d0546798f89 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.list_tasks.js @@ -0,0 +1,79 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START batch_v1_generated_BatchService_ListTasks_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of a TaskGroup from which Tasks are being requested. + * Pattern: + * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + */ + // const parent = 'abc123' + /** + * Task filter, null filter matches all Tasks. + * Filter string should be of the format State=TaskStatus.State e.g. + * State=RUNNING + */ + // const filter = 'abc123' + /** + * Page size. + */ + // const pageSize = 1234 + /** + * Page token. + */ + // const pageToken = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callListTasks() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = batchClient.listTasksAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTasks(); + // [END batch_v1_generated_BatchService_ListTasks_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/snippet_metadata_google.cloud.batch.v1.json b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/snippet_metadata_google.cloud.batch.v1.json new file mode 100644 index 00000000000..fd2ad4716e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/snippet_metadata_google.cloud.batch.v1.json @@ -0,0 +1,303 @@ +{ + "clientLibrary": { + "name": "nodejs-batch", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.batch.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "batch_v1_generated_BatchService_CreateJob_async", + "title": "BatchService createJob Sample", + "origin": "API_DEFINITION", + "description": " Create a Job.", + "canonical": true, + "file": "batch_service.create_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 84, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateJob", + "fullName": "google.cloud.batch.v1.BatchService.CreateJob", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "job_id", + "type": "TYPE_STRING" + }, + { + "name": "job", + "type": ".google.cloud.batch.v1.Job" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.batch.v1.Job", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1.BatchServiceClient" + }, + "method": { + "shortName": "CreateJob", + "fullName": "google.cloud.batch.v1.BatchService.CreateJob", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1.BatchService" + } + } + } + }, + { + "regionTag": "batch_v1_generated_BatchService_GetJob_async", + "title": "BatchService getJob Sample", + "origin": "API_DEFINITION", + "description": " Get a Job specified by its resource name.", + "canonical": true, + "file": "batch_service.get_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetJob", + "fullName": "google.cloud.batch.v1.BatchService.GetJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.batch.v1.Job", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1.BatchServiceClient" + }, + "method": { + "shortName": "GetJob", + "fullName": "google.cloud.batch.v1.BatchService.GetJob", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1.BatchService" + } + } + } + }, + { + "regionTag": "batch_v1_generated_BatchService_DeleteJob_async", + "title": "BatchService deleteJob Sample", + "origin": "API_DEFINITION", + "description": " Delete a Job.", + "canonical": true, + "file": "batch_service.delete_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteJob", + "fullName": "google.cloud.batch.v1.BatchService.DeleteJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "reason", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1.BatchServiceClient" + }, + "method": { + "shortName": "DeleteJob", + "fullName": "google.cloud.batch.v1.BatchService.DeleteJob", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1.BatchService" + } + } + } + }, + { + "regionTag": "batch_v1_generated_BatchService_ListJobs_async", + "title": "BatchService listJobs Sample", + "origin": "API_DEFINITION", + "description": " List all Jobs for a project within a region.", + "canonical": true, + "file": "batch_service.list_jobs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListJobs", + "fullName": "google.cloud.batch.v1.BatchService.ListJobs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.batch.v1.ListJobsResponse", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1.BatchServiceClient" + }, + "method": { + "shortName": "ListJobs", + "fullName": "google.cloud.batch.v1.BatchService.ListJobs", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1.BatchService" + } + } + } + }, + { + "regionTag": "batch_v1_generated_BatchService_GetTask_async", + "title": "BatchService getTask Sample", + "origin": "API_DEFINITION", + "description": " Return a single Task.", + "canonical": true, + "file": "batch_service.get_task.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetTask", + "fullName": "google.cloud.batch.v1.BatchService.GetTask", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.batch.v1.Task", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1.BatchServiceClient" + }, + "method": { + "shortName": "GetTask", + "fullName": "google.cloud.batch.v1.BatchService.GetTask", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1.BatchService" + } + } + } + }, + { + "regionTag": "batch_v1_generated_BatchService_ListTasks_async", + "title": "BatchService listTasks Sample", + "origin": "API_DEFINITION", + "description": " List Tasks associated with a job.", + "canonical": true, + "file": "batch_service.list_tasks.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListTasks", + "fullName": "google.cloud.batch.v1.BatchService.ListTasks", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.batch.v1.ListTasksResponse", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1.BatchServiceClient" + }, + "method": { + "shortName": "ListTasks", + "fullName": "google.cloud.batch.v1.BatchService.ListTasks", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1.BatchService" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-cloud-batch/v1/src/index.ts b/owl-bot-staging/google-cloud-batch/v1/src/index.ts new file mode 100644 index 00000000000..5a38d7beb99 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; +const BatchServiceClient = v1.BatchServiceClient; +type BatchServiceClient = v1.BatchServiceClient; +export {v1, BatchServiceClient}; +export default {v1, BatchServiceClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_client.ts b/owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_client.ts new file mode 100644 index 00000000000..d858efc2bf3 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_client.ts @@ -0,0 +1,1620 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v1/batch_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './batch_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Google Batch Service. + * The service manages user submitted batch jobs and allocates Google Compute + * Engine VM instances to run the jobs. + * @class + * @memberof v1 + */ +export class BatchServiceClient { + 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; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + batchServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of BatchServiceClient. + * + * @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://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @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 BatchServiceClient({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 BatchServiceClient; + 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 = 'batch.' + 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; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + jobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/jobs/{job}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + taskPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}/tasks/{task}' + ), + taskGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}' + ), + }; + + // 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 = { + listJobs: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'jobs'), + listTasks: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'tasks') + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v1/{name=projects/*/locations/*}',},{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1/{name=projects/*}/locations',},{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',body: '*',},{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/locations/*}/operations',}]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const deleteJobResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteJobMetadata = protoFilesRoot.lookup( + '.google.cloud.batch.v1.OperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + deleteJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteJobResponse.decode.bind(deleteJobResponse), + deleteJobMetadata.decode.bind(deleteJobMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.batch.v1.BatchService', 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.batchServiceStub) { + return this.batchServiceStub; + } + + // Put together the "service stub" for + // google.cloud.batch.v1.BatchService. + this.batchServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.batch.v1.BatchService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.batch.v1.BatchService, + 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 batchServiceStubMethods = + ['createJob', 'getJob', 'deleteJob', 'listJobs', 'getTask', 'listTasks']; + for (const methodName of batchServiceStubMethods) { + const callPromise = this.batchServiceStub.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.batchServiceStub; + } + + /** + * 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 'batch.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 'batch.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' + ]; + } + + 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 -- + // ------------------- +/** + * Create a Job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name where the Job will be created. + * Pattern: "projects/{project}/locations/{location}" + * @param {string} request.jobId + * ID used to uniquely identify the Job within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and '-' are accepted. + * The '-' character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * + * The job.name field in the request will be ignored and the created resource + * name of the Job will be "{parent}/jobs/{job_id}". + * @param {google.cloud.batch.v1.Job} request.job + * Required. The Job to create. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1.Job|Job}. + * 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/batch_service.create_job.js + * region_tag:batch_v1_generated_BatchService_CreateJob_async + */ + createJob( + request?: protos.google.cloud.batch.v1.ICreateJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.batch.v1.IJob, + protos.google.cloud.batch.v1.ICreateJobRequest|undefined, {}|undefined + ]>; + createJob( + request: protos.google.cloud.batch.v1.ICreateJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.batch.v1.IJob, + protos.google.cloud.batch.v1.ICreateJobRequest|null|undefined, + {}|null|undefined>): void; + createJob( + request: protos.google.cloud.batch.v1.ICreateJobRequest, + callback: Callback< + protos.google.cloud.batch.v1.IJob, + protos.google.cloud.batch.v1.ICreateJobRequest|null|undefined, + {}|null|undefined>): void; + createJob( + request?: protos.google.cloud.batch.v1.ICreateJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.batch.v1.IJob, + protos.google.cloud.batch.v1.ICreateJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.batch.v1.IJob, + protos.google.cloud.batch.v1.ICreateJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.batch.v1.IJob, + protos.google.cloud.batch.v1.ICreateJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createJob(request, options, callback); + } +/** + * Get a Job specified by its resource name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Job name. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1.Job|Job}. + * 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/batch_service.get_job.js + * region_tag:batch_v1_generated_BatchService_GetJob_async + */ + getJob( + request?: protos.google.cloud.batch.v1.IGetJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.batch.v1.IJob, + protos.google.cloud.batch.v1.IGetJobRequest|undefined, {}|undefined + ]>; + getJob( + request: protos.google.cloud.batch.v1.IGetJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.batch.v1.IJob, + protos.google.cloud.batch.v1.IGetJobRequest|null|undefined, + {}|null|undefined>): void; + getJob( + request: protos.google.cloud.batch.v1.IGetJobRequest, + callback: Callback< + protos.google.cloud.batch.v1.IJob, + protos.google.cloud.batch.v1.IGetJobRequest|null|undefined, + {}|null|undefined>): void; + getJob( + request?: protos.google.cloud.batch.v1.IGetJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.batch.v1.IJob, + protos.google.cloud.batch.v1.IGetJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.batch.v1.IJob, + protos.google.cloud.batch.v1.IGetJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.batch.v1.IJob, + protos.google.cloud.batch.v1.IGetJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getJob(request, options, callback); + } +/** + * Return a single Task. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Task name. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1.Task|Task}. + * 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/batch_service.get_task.js + * region_tag:batch_v1_generated_BatchService_GetTask_async + */ + getTask( + request?: protos.google.cloud.batch.v1.IGetTaskRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.batch.v1.ITask, + protos.google.cloud.batch.v1.IGetTaskRequest|undefined, {}|undefined + ]>; + getTask( + request: protos.google.cloud.batch.v1.IGetTaskRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.batch.v1.ITask, + protos.google.cloud.batch.v1.IGetTaskRequest|null|undefined, + {}|null|undefined>): void; + getTask( + request: protos.google.cloud.batch.v1.IGetTaskRequest, + callback: Callback< + protos.google.cloud.batch.v1.ITask, + protos.google.cloud.batch.v1.IGetTaskRequest|null|undefined, + {}|null|undefined>): void; + getTask( + request?: protos.google.cloud.batch.v1.IGetTaskRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.batch.v1.ITask, + protos.google.cloud.batch.v1.IGetTaskRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.batch.v1.ITask, + protos.google.cloud.batch.v1.IGetTaskRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.batch.v1.ITask, + protos.google.cloud.batch.v1.IGetTaskRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getTask(request, options, callback); + } + +/** + * Delete a Job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Job name. + * @param {string} [request.reason] + * Optional. Reason for this deletion. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/batch_service.delete_job.js + * region_tag:batch_v1_generated_BatchService_DeleteJob_async + */ + deleteJob( + request?: protos.google.cloud.batch.v1.IDeleteJobRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteJob( + request: protos.google.cloud.batch.v1.IDeleteJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteJob( + request: protos.google.cloud.batch.v1.IDeleteJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteJob( + request?: protos.google.cloud.batch.v1.IDeleteJobRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteJob(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteJob()`. + * @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/batch_service.delete_job.js + * region_tag:batch_v1_generated_BatchService_DeleteJob_async + */ + async checkDeleteJobProgress(name: string): Promise>{ + 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.deleteJob, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * List all Jobs for a project within a region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Parent path. + * @param {string} request.filter + * List filter. + * @param {string} [request.orderBy] + * Optional. Sort results. Supported are "name", "name desc", "create_time", + * and "create_time desc". + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.batch.v1.Job|Job}. + * 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 `listJobsAsync()` + * 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. + */ + listJobs( + request?: protos.google.cloud.batch.v1.IListJobsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.batch.v1.IJob[], + protos.google.cloud.batch.v1.IListJobsRequest|null, + protos.google.cloud.batch.v1.IListJobsResponse + ]>; + listJobs( + request: protos.google.cloud.batch.v1.IListJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.batch.v1.IListJobsRequest, + protos.google.cloud.batch.v1.IListJobsResponse|null|undefined, + protos.google.cloud.batch.v1.IJob>): void; + listJobs( + request: protos.google.cloud.batch.v1.IListJobsRequest, + callback: PaginationCallback< + protos.google.cloud.batch.v1.IListJobsRequest, + protos.google.cloud.batch.v1.IListJobsResponse|null|undefined, + protos.google.cloud.batch.v1.IJob>): void; + listJobs( + request?: protos.google.cloud.batch.v1.IListJobsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.batch.v1.IListJobsRequest, + protos.google.cloud.batch.v1.IListJobsResponse|null|undefined, + protos.google.cloud.batch.v1.IJob>, + callback?: PaginationCallback< + protos.google.cloud.batch.v1.IListJobsRequest, + protos.google.cloud.batch.v1.IListJobsResponse|null|undefined, + protos.google.cloud.batch.v1.IJob>): + Promise<[ + protos.google.cloud.batch.v1.IJob[], + protos.google.cloud.batch.v1.IListJobsRequest|null, + protos.google.cloud.batch.v1.IListJobsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listJobs(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Parent path. + * @param {string} request.filter + * List filter. + * @param {string} [request.orderBy] + * Optional. Sort results. Supported are "name", "name desc", "create_time", + * and "create_time desc". + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.batch.v1.Job|Job} 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 `listJobsAsync()` + * 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. + */ + listJobsStream( + request?: protos.google.cloud.batch.v1.IListJobsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listJobs.createStream( + this.innerApiCalls.listJobs as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listJobs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Parent path. + * @param {string} request.filter + * List filter. + * @param {string} [request.orderBy] + * Optional. Sort results. Supported are "name", "name desc", "create_time", + * and "create_time desc". + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.batch.v1.Job|Job}. 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/batch_service.list_jobs.js + * region_tag:batch_v1_generated_BatchService_ListJobs_async + */ + listJobsAsync( + request?: protos.google.cloud.batch.v1.IListJobsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listJobs.asyncIterate( + this.innerApiCalls['listJobs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List Tasks associated with a job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of a TaskGroup from which Tasks are being requested. + * Pattern: + * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + * @param {string} request.filter + * Task filter, null filter matches all Tasks. + * Filter string should be of the format State=TaskStatus.State e.g. + * State=RUNNING + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.batch.v1.Task|Task}. + * 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 `listTasksAsync()` + * 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. + */ + listTasks( + request?: protos.google.cloud.batch.v1.IListTasksRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.batch.v1.ITask[], + protos.google.cloud.batch.v1.IListTasksRequest|null, + protos.google.cloud.batch.v1.IListTasksResponse + ]>; + listTasks( + request: protos.google.cloud.batch.v1.IListTasksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.batch.v1.IListTasksRequest, + protos.google.cloud.batch.v1.IListTasksResponse|null|undefined, + protos.google.cloud.batch.v1.ITask>): void; + listTasks( + request: protos.google.cloud.batch.v1.IListTasksRequest, + callback: PaginationCallback< + protos.google.cloud.batch.v1.IListTasksRequest, + protos.google.cloud.batch.v1.IListTasksResponse|null|undefined, + protos.google.cloud.batch.v1.ITask>): void; + listTasks( + request?: protos.google.cloud.batch.v1.IListTasksRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.batch.v1.IListTasksRequest, + protos.google.cloud.batch.v1.IListTasksResponse|null|undefined, + protos.google.cloud.batch.v1.ITask>, + callback?: PaginationCallback< + protos.google.cloud.batch.v1.IListTasksRequest, + protos.google.cloud.batch.v1.IListTasksResponse|null|undefined, + protos.google.cloud.batch.v1.ITask>): + Promise<[ + protos.google.cloud.batch.v1.ITask[], + protos.google.cloud.batch.v1.IListTasksRequest|null, + protos.google.cloud.batch.v1.IListTasksResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listTasks(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of a TaskGroup from which Tasks are being requested. + * Pattern: + * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + * @param {string} request.filter + * Task filter, null filter matches all Tasks. + * Filter string should be of the format State=TaskStatus.State e.g. + * State=RUNNING + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.batch.v1.Task|Task} 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 `listTasksAsync()` + * 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. + */ + listTasksStream( + request?: protos.google.cloud.batch.v1.IListTasksRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listTasks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTasks.createStream( + this.innerApiCalls.listTasks as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listTasks`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of a TaskGroup from which Tasks are being requested. + * Pattern: + * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + * @param {string} request.filter + * Task filter, null filter matches all Tasks. + * Filter string should be of the format State=TaskStatus.State e.g. + * State=RUNNING + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.batch.v1.Task|Task}. 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/batch_service.list_tasks.js + * region_tag:batch_v1_generated_BatchService_ListTasks_async + */ + listTasksAsync( + request?: protos.google.cloud.batch.v1.IListTasksRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listTasks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTasks.asyncIterate( + this.innerApiCalls['listTasks'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * 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, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@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 { + 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, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@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, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified job resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} job + * @returns {string} Resource name string. + */ + jobPath(project:string,location:string,job:string) { + return this.pathTemplates.jobPathTemplate.render({ + project: project, + location: location, + job: job, + }); + } + + /** + * Parse the project from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the project. + */ + matchProjectFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).project; + } + + /** + * Parse the location from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the location. + */ + matchLocationFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).location; + } + + /** + * Parse the job from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the job. + */ + matchJobFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).job; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified task resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} job + * @param {string} task_group + * @param {string} task + * @returns {string} Resource name string. + */ + taskPath(project:string,location:string,job:string,taskGroup:string,task:string) { + return this.pathTemplates.taskPathTemplate.render({ + project: project, + location: location, + job: job, + task_group: taskGroup, + task: task, + }); + } + + /** + * Parse the project from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).project; + } + + /** + * Parse the location from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).location; + } + + /** + * Parse the job from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the job. + */ + matchJobFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).job; + } + + /** + * Parse the task_group from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the task_group. + */ + matchTaskGroupFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).task_group; + } + + /** + * Parse the task from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the task. + */ + matchTaskFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).task; + } + + /** + * Return a fully-qualified taskGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} job + * @param {string} task_group + * @returns {string} Resource name string. + */ + taskGroupPath(project:string,location:string,job:string,taskGroup:string) { + return this.pathTemplates.taskGroupPathTemplate.render({ + project: project, + location: location, + job: job, + task_group: taskGroup, + }); + } + + /** + * Parse the project from TaskGroup resource. + * + * @param {string} taskGroupName + * A fully-qualified path representing TaskGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTaskGroupName(taskGroupName: string) { + return this.pathTemplates.taskGroupPathTemplate.match(taskGroupName).project; + } + + /** + * Parse the location from TaskGroup resource. + * + * @param {string} taskGroupName + * A fully-qualified path representing TaskGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTaskGroupName(taskGroupName: string) { + return this.pathTemplates.taskGroupPathTemplate.match(taskGroupName).location; + } + + /** + * Parse the job from TaskGroup resource. + * + * @param {string} taskGroupName + * A fully-qualified path representing TaskGroup resource. + * @returns {string} A string representing the job. + */ + matchJobFromTaskGroupName(taskGroupName: string) { + return this.pathTemplates.taskGroupPathTemplate.match(taskGroupName).job; + } + + /** + * Parse the task_group from TaskGroup resource. + * + * @param {string} taskGroupName + * A fully-qualified path representing TaskGroup resource. + * @returns {string} A string representing the task_group. + */ + matchTaskGroupFromTaskGroupName(taskGroupName: string) { + return this.pathTemplates.taskGroupPathTemplate.match(taskGroupName).task_group; + } + + /** + * 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.batchServiceStub && !this._terminated) { + return this.batchServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.locationsClient.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_client_config.json b/owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_client_config.json new file mode 100644 index 00000000000..be602f6e2eb --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_client_config.json @@ -0,0 +1,68 @@ +{ + "interfaces": { + "google.cloud.batch.v1.BatchService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "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 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetJob": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListJobs": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetTask": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListTasks": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_proto_list.json b/owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_proto_list.json new file mode 100644 index 00000000000..d9013a506a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_proto_list.json @@ -0,0 +1,6 @@ +[ + "../../protos/google/cloud/batch/v1/batch.proto", + "../../protos/google/cloud/batch/v1/job.proto", + "../../protos/google/cloud/batch/v1/task.proto", + "../../protos/google/cloud/batch/v1/volume.proto" +] diff --git a/owl-bot-staging/google-cloud-batch/v1/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-batch/v1/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..914e910ca19 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/src/v1/gapic_metadata.json @@ -0,0 +1,91 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.batch.v1", + "libraryPackage": "@google-cloud/batch", + "services": { + "BatchService": { + "clients": { + "grpc": { + "libraryClient": "BatchServiceClient", + "rpcs": { + "CreateJob": { + "methods": [ + "createJob" + ] + }, + "GetJob": { + "methods": [ + "getJob" + ] + }, + "GetTask": { + "methods": [ + "getTask" + ] + }, + "DeleteJob": { + "methods": [ + "deleteJob" + ] + }, + "ListJobs": { + "methods": [ + "listJobs", + "listJobsStream", + "listJobsAsync" + ] + }, + "ListTasks": { + "methods": [ + "listTasks", + "listTasksStream", + "listTasksAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "BatchServiceClient", + "rpcs": { + "CreateJob": { + "methods": [ + "createJob" + ] + }, + "GetJob": { + "methods": [ + "getJob" + ] + }, + "GetTask": { + "methods": [ + "getTask" + ] + }, + "DeleteJob": { + "methods": [ + "deleteJob" + ] + }, + "ListJobs": { + "methods": [ + "listJobs", + "listJobsStream", + "listJobsAsync" + ] + }, + "ListTasks": { + "methods": [ + "listTasks", + "listTasksStream", + "listTasksAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-batch/v1/src/v1/index.ts b/owl-bot-staging/google-cloud-batch/v1/src/v1/index.ts new file mode 100644 index 00000000000..fb53b495001 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {BatchServiceClient} from './batch_service_client'; diff --git a/owl-bot-staging/google-cloud-batch/v1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-batch/v1/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..b9ac0eb683e --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const batch = require('@google-cloud/batch'); + +function main() { + const batchServiceClient = new batch.BatchServiceClient(); +} + +main(); diff --git a/owl-bot-staging/google-cloud-batch/v1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-batch/v1/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..c43e51952e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 {BatchServiceClient} from '@google-cloud/batch'; + +// check that the client class type name can be used +function doStuffWithBatchServiceClient(client: BatchServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const batchServiceClient = new BatchServiceClient(); + doStuffWithBatchServiceClient(batchServiceClient); +} + +main(); diff --git a/owl-bot-staging/google-cloud-batch/v1/system-test/install.ts b/owl-bot-staging/google-cloud-batch/v1/system-test/install.ts new file mode 100644 index 00000000000..fd5bfdc71d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/owl-bot-staging/google-cloud-batch/v1/test/gapic_batch_service_v1.ts b/owl-bot-staging/google-cloud-batch/v1/test/gapic_batch_service_v1.ts new file mode 100644 index 00000000000..6ad80d6c51e --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/test/gapic_batch_service_v1.ts @@ -0,0 +1,1899 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 batchserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos, LocationProtos} 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.BatchServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new batchserviceModule.v1.BatchServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'batch.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new batchserviceModule.v1.BatchServiceClient(); + 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 = batchserviceModule.v1.BatchServiceClient.servicePath; + assert.strictEqual(servicePath, 'batch.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = batchserviceModule.v1.BatchServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'batch.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new batchserviceModule.v1.BatchServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'batch.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new batchserviceModule.v1.BatchServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'batch.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 batchserviceModule.v1.BatchServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'batch.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 batchserviceModule.v1.BatchServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'batch.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 batchserviceModule.v1.BatchServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = batchserviceModule.v1.BatchServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new batchserviceModule.v1.BatchServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.batchServiceStub, undefined); + await client.initialize(); + assert(client.batchServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.batchServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.batchServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new batchserviceModule.v1.BatchServiceClient({ + 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 batchserviceModule.v1.BatchServiceClient({ + 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('createJob', () => { + it('invokes createJob without error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.CreateJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.CreateJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1.Job() + ); + client.innerApiCalls.createJob = stubSimpleCall(expectedResponse); + const [response] = await client.createJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createJob without error using callback', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.CreateJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.CreateJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1.Job() + ); + client.innerApiCalls.createJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createJob( + request, + (err?: Error|null, result?: protos.google.cloud.batch.v1.IJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createJob with error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.CreateJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.CreateJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createJob(request), expectedError); + const actualRequest = (client.innerApiCalls.createJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createJob with closed client', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.CreateJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.CreateJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createJob(request), expectedError); + }); + }); + + describe('getJob', () => { + it('invokes getJob without error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.GetJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.GetJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1.Job() + ); + client.innerApiCalls.getJob = stubSimpleCall(expectedResponse); + const [response] = await client.getJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJob without error using callback', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.GetJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.GetJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1.Job() + ); + client.innerApiCalls.getJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getJob( + request, + (err?: Error|null, result?: protos.google.cloud.batch.v1.IJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJob with error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.GetJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.GetJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getJob(request), expectedError); + const actualRequest = (client.innerApiCalls.getJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJob with closed client', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.GetJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.GetJobRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getJob(request), expectedError); + }); + }); + + describe('getTask', () => { + it('invokes getTask without error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.GetTaskRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.GetTaskRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1.Task() + ); + client.innerApiCalls.getTask = stubSimpleCall(expectedResponse); + const [response] = await client.getTask(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getTask as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTask as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTask without error using callback', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.GetTaskRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.GetTaskRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1.Task() + ); + client.innerApiCalls.getTask = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTask( + request, + (err?: Error|null, result?: protos.google.cloud.batch.v1.ITask|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getTask as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTask as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTask with error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.GetTaskRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.GetTaskRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTask = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTask(request), expectedError); + const actualRequest = (client.innerApiCalls.getTask as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTask as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTask with closed client', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.GetTaskRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.GetTaskRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTask(request), expectedError); + }); + }); + + describe('deleteJob', () => { + it('invokes deleteJob without error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.DeleteJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.DeleteJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteJob = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteJob without error using callback', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.DeleteJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.DeleteJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteJob = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteJob( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteJob with call error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.DeleteJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.DeleteJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteJob(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteJob with LRO error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.DeleteJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.DeleteJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteJobProgress without error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkDeleteJobProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteJobProgress with error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteJobProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listJobs', () => { + it('invokes listJobs without error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.ListJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.ListJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1.Job()), + generateSampleMessage(new protos.google.cloud.batch.v1.Job()), + generateSampleMessage(new protos.google.cloud.batch.v1.Job()), + ]; + client.innerApiCalls.listJobs = stubSimpleCall(expectedResponse); + const [response] = await client.listJobs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobs without error using callback', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.ListJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.ListJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1.Job()), + generateSampleMessage(new protos.google.cloud.batch.v1.Job()), + generateSampleMessage(new protos.google.cloud.batch.v1.Job()), + ]; + client.innerApiCalls.listJobs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listJobs( + request, + (err?: Error|null, result?: protos.google.cloud.batch.v1.IJob[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobs with error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.ListJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.ListJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listJobs(request), expectedError); + const actualRequest = (client.innerApiCalls.listJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobsStream without error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.ListJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.ListJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1.Job()), + generateSampleMessage(new protos.google.cloud.batch.v1.Job()), + generateSampleMessage(new protos.google.cloud.batch.v1.Job()), + ]; + client.descriptors.page.listJobs.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.batch.v1.Job[] = []; + stream.on('data', (response: protos.google.cloud.batch.v1.Job) => { + 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.listJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listJobs, request)); + assert( + (client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listJobsStream with error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.ListJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.ListJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listJobs.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.batch.v1.Job[] = []; + stream.on('data', (response: protos.google.cloud.batch.v1.Job) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listJobs, request)); + assert( + (client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listJobs without error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.ListJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.ListJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1.Job()), + generateSampleMessage(new protos.google.cloud.batch.v1.Job()), + generateSampleMessage(new protos.google.cloud.batch.v1.Job()), + ]; + client.descriptors.page.listJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.batch.v1.IJob[] = []; + const iterable = client.listJobsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listJobs with error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.ListJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.ListJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listJobsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.batch.v1.IJob[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listTasks', () => { + it('invokes listTasks without error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.ListTasksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.ListTasksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1.Task()), + generateSampleMessage(new protos.google.cloud.batch.v1.Task()), + generateSampleMessage(new protos.google.cloud.batch.v1.Task()), + ]; + client.innerApiCalls.listTasks = stubSimpleCall(expectedResponse); + const [response] = await client.listTasks(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listTasks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTasks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTasks without error using callback', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.ListTasksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.ListTasksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1.Task()), + generateSampleMessage(new protos.google.cloud.batch.v1.Task()), + generateSampleMessage(new protos.google.cloud.batch.v1.Task()), + ]; + client.innerApiCalls.listTasks = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTasks( + request, + (err?: Error|null, result?: protos.google.cloud.batch.v1.ITask[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listTasks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTasks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTasks with error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.ListTasksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.ListTasksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTasks = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTasks(request), expectedError); + const actualRequest = (client.innerApiCalls.listTasks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTasks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTasksStream without error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.ListTasksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.ListTasksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1.Task()), + generateSampleMessage(new protos.google.cloud.batch.v1.Task()), + generateSampleMessage(new protos.google.cloud.batch.v1.Task()), + ]; + client.descriptors.page.listTasks.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listTasksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.batch.v1.Task[] = []; + stream.on('data', (response: protos.google.cloud.batch.v1.Task) => { + 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.listTasks.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTasks, request)); + assert( + (client.descriptors.page.listTasks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listTasksStream with error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.ListTasksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.ListTasksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTasks.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listTasksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.batch.v1.Task[] = []; + stream.on('data', (response: protos.google.cloud.batch.v1.Task) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listTasks.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTasks, request)); + assert( + (client.descriptors.page.listTasks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTasks without error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.ListTasksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.ListTasksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1.Task()), + generateSampleMessage(new protos.google.cloud.batch.v1.Task()), + generateSampleMessage(new protos.google.cloud.batch.v1.Task()), + ]; + client.descriptors.page.listTasks.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.batch.v1.ITask[] = []; + const iterable = client.listTasksAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTasks.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listTasks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTasks with error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.ListTasksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1.ListTasksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTasks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTasksAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.batch.v1.ITask[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTasks.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listTasks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation without error using callback', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.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 batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + 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 batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + 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 batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + 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 batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('job', () => { + const fakePath = "/rendered/path/job"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + job: "jobValue", + }; + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.jobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.jobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('jobPath', () => { + const result = client.jobPath("projectValue", "locationValue", "jobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.jobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromJobName', () => { + const result = client.matchProjectFromJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromJobName', () => { + const result = client.matchLocationFromJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchJobFromJobName', () => { + const result = client.matchJobFromJobName(fakePath); + assert.strictEqual(result, "jobValue"); + assert((client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('task', () => { + const fakePath = "/rendered/path/task"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + job: "jobValue", + task_group: "taskGroupValue", + task: "taskValue", + }; + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.taskPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.taskPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('taskPath', () => { + const result = client.taskPath("projectValue", "locationValue", "jobValue", "taskGroupValue", "taskValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.taskPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTaskName', () => { + const result = client.matchProjectFromTaskName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.taskPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTaskName', () => { + const result = client.matchLocationFromTaskName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.taskPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchJobFromTaskName', () => { + const result = client.matchJobFromTaskName(fakePath); + assert.strictEqual(result, "jobValue"); + assert((client.pathTemplates.taskPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTaskGroupFromTaskName', () => { + const result = client.matchTaskGroupFromTaskName(fakePath); + assert.strictEqual(result, "taskGroupValue"); + assert((client.pathTemplates.taskPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTaskFromTaskName', () => { + const result = client.matchTaskFromTaskName(fakePath); + assert.strictEqual(result, "taskValue"); + assert((client.pathTemplates.taskPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('taskGroup', () => { + const fakePath = "/rendered/path/taskGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + job: "jobValue", + task_group: "taskGroupValue", + }; + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.taskGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.taskGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('taskGroupPath', () => { + const result = client.taskGroupPath("projectValue", "locationValue", "jobValue", "taskGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.taskGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTaskGroupName', () => { + const result = client.matchProjectFromTaskGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.taskGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTaskGroupName', () => { + const result = client.matchLocationFromTaskGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.taskGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchJobFromTaskGroupName', () => { + const result = client.matchJobFromTaskGroupName(fakePath); + assert.strictEqual(result, "jobValue"); + assert((client.pathTemplates.taskGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTaskGroupFromTaskGroupName', () => { + const result = client.matchTaskGroupFromTaskGroupName(fakePath); + assert.strictEqual(result, "taskGroupValue"); + assert((client.pathTemplates.taskGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-batch/v1/tsconfig.json b/owl-bot-staging/google-cloud-batch/v1/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/owl-bot-staging/google-cloud-batch/v1/webpack.config.js b/owl-bot-staging/google-cloud-batch/v1/webpack.config.js new file mode 100644 index 00000000000..04a4c53960a --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'BatchService', + filename: './batch-service.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/.eslintignore b/owl-bot-staging/google-cloud-batch/v1alpha/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/.eslintrc.json b/owl-bot-staging/google-cloud-batch/v1alpha/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/.gitignore b/owl-bot-staging/google-cloud-batch/v1alpha/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +/.coverage +/coverage +/.nyc_output +/docs/ +/out/ +/build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/.jsdoc.js b/owl-bot-staging/google-cloud-batch/v1alpha/.jsdoc.js new file mode 100644 index 00000000000..f3c1e45a4fc --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2024 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/batch', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/.mocharc.js b/owl-bot-staging/google-cloud-batch/v1alpha/.mocharc.js new file mode 100644 index 00000000000..13b67c34edc --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/.prettierrc.js b/owl-bot-staging/google-cloud-batch/v1alpha/.prettierrc.js new file mode 100644 index 00000000000..9a8fd690982 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/README.md b/owl-bot-staging/google-cloud-batch/v1alpha/README.md new file mode 100644 index 00000000000..15b2fa3f3e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/README.md @@ -0,0 +1 @@ +Batch: Nodejs Client diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/package.json b/owl-bot-staging/google-cloud-batch/v1alpha/package.json new file mode 100644 index 00000000000..d27d57773ff --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/package.json @@ -0,0 +1,58 @@ +{ + "name": "@google-cloud/batch", + "version": "0.1.0", + "description": "Batch client for Node.js", + "repository": "googleapis/nodejs-batch", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google batch", + "batch", + "batch service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^4.3.4" + }, + "devDependencies": { + "@types/mocha": "^10.0.6", + "@types/node": "^20.12.12", + "@types/sinon": "^10.0.20", + "c8": "^9.1.0", + "gapic-tools": "^0.4.2", + "gts": "5.3.0", + "jsdoc": "^4.0.3", + "jsdoc-fresh": "^3.0.0", + "jsdoc-region-tag": "^3.0.0", + "mocha": "^10.4.0", + "pack-n-play": "^2.0.3", + "sinon": "^15.2.0", + "typescript": "5.1.6" + }, + "engines": { + "node": ">=v14" + } +} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/batch.proto b/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/batch.proto new file mode 100644 index 00000000000..7591e92c08e --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/batch.proto @@ -0,0 +1,587 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.batch.v1alpha; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/cloud/batch/v1alpha/job.proto"; +import "google/cloud/batch/v1alpha/resource_allowance.proto"; +import "google/cloud/batch/v1alpha/task.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Batch.V1Alpha"; +option go_package = "cloud.google.com/go/batch/apiv1alpha/batchpb;batchpb"; +option java_multiple_files = true; +option java_outer_classname = "BatchProto"; +option java_package = "com.google.cloud.batch.v1alpha"; +option objc_class_prefix = "GCB"; +option php_namespace = "Google\\Cloud\\Batch\\V1alpha"; +option ruby_package = "Google::Cloud::Batch::V1alpha"; + +// Google Batch Service. +// The service manages user submitted batch jobs and allocates Google Compute +// Engine VM instances to run the jobs. +service BatchService { + option (google.api.default_host) = "batch.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Create a Job. + rpc CreateJob(CreateJobRequest) returns (Job) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*}/jobs" + body: "job" + }; + option (google.api.method_signature) = "parent,job,job_id"; + } + + // Get a Job specified by its resource name. + rpc GetJob(GetJobRequest) returns (Job) { + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/locations/*/jobs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Delete a Job. + rpc DeleteJob(DeleteJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1alpha/{name=projects/*/locations/*/jobs/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.batch.v1alpha.OperationMetadata" + }; + } + + // Cancel a Job. + rpc CancelJob(CancelJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/{name=projects/*/locations/*/jobs/*}:cancel" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.batch.v1alpha.CancelJobResponse" + metadata_type: "google.cloud.batch.v1alpha.OperationMetadata" + }; + } + + // Update a Job. + rpc UpdateJob(UpdateJobRequest) returns (Job) { + option (google.api.http) = { + patch: "/v1alpha/{job.name=projects/*/locations/*/jobs/*}" + body: "job" + }; + option (google.api.method_signature) = "job,update_mask"; + } + + // List all Jobs for a project within a region. + rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*/locations/*}/jobs" + }; + option (google.api.method_signature) = "parent"; + } + + // Return a single Task. + rpc GetTask(GetTaskRequest) returns (Task) { + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/locations/*/jobs/*/taskGroups/*/tasks/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List Tasks associated with a job. + rpc ListTasks(ListTasksRequest) returns (ListTasksResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*/locations/*/jobs/*/taskGroups/*}/tasks" + }; + option (google.api.method_signature) = "parent"; + } + + // Create a Resource Allowance. + rpc CreateResourceAllowance(CreateResourceAllowanceRequest) + returns (ResourceAllowance) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*/locations/*}/resourceAllowances" + body: "resource_allowance" + }; + option (google.api.method_signature) = + "parent,resource_allowance,resource_allowance_id"; + } + + // Get a ResourceAllowance specified by its resource name. + rpc GetResourceAllowance(GetResourceAllowanceRequest) + returns (ResourceAllowance) { + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/locations/*/resourceAllowances/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Delete a ResourceAllowance. + rpc DeleteResourceAllowance(DeleteResourceAllowanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1alpha/{name=projects/*/locations/*/resourceAllowances/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.batch.v1alpha.OperationMetadata" + }; + } + + // List all ResourceAllowances for a project within a region. + rpc ListResourceAllowances(ListResourceAllowancesRequest) + returns (ListResourceAllowancesResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*/locations/*}/resourceAllowances" + }; + option (google.api.method_signature) = "parent"; + } + + // Update a Resource Allowance. + rpc UpdateResourceAllowance(UpdateResourceAllowanceRequest) + returns (ResourceAllowance) { + option (google.api.http) = { + patch: "/v1alpha/{resource_allowance.name=projects/*/locations/*/resourceAllowances/*}" + body: "resource_allowance" + }; + option (google.api.method_signature) = "resource_allowance,update_mask"; + } +} + +// CreateJob Request. +message CreateJobRequest { + // Required. The parent resource name where the Job will be created. + // Pattern: "projects/{project}/locations/{location}" + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { child_type: "batch.googleapis.com/Job" } + ]; + + // ID used to uniquely identify the Job within its parent scope. + // This field should contain at most 63 characters and must start with + // lowercase characters. + // Only lowercase characters, numbers and '-' are accepted. + // The '-' character cannot be the first or the last one. + // A system generated ID will be used if the field is not set. + // + // The job.name field in the request will be ignored and the created resource + // name of the Job will be "{parent}/jobs/{job_id}". + string job_id = 2; + + // Required. The Job to create. + Job job = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// GetJob Request. +message GetJobRequest { + // Required. Job name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "batch.googleapis.com/Job" } + ]; +} + +// DeleteJob Request. +message DeleteJobRequest { + // Job name. + string name = 1; + + // Optional. Reason for this deletion. + string reason = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// CancelJob Request. +message CancelJobRequest { + // Required. Job name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "batch.googleapis.com/Job" } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Response to the CancelJob request. +message CancelJobResponse {} + +// UpdateJob Request. +message UpdateJobRequest { + // Required. The Job to update. + // Only fields specified in `updateMask` are updated. + Job job = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Mask of fields to update. + // + // The `jobs.patch` method can only be used while a job is in the `QUEUED`, + // `SCHEDULED`, or `RUNNING` state and currently only supports increasing the + // value of the first `taskCount` field in the job's `taskGroups` field. + // Therefore, you must set the value of `updateMask` to `taskGroups`. Any + // other job fields in the update request will be ignored. + // + // For example, to update a job's `taskCount` to `2`, set `updateMask` to + // `taskGroups` and use the following request body: + // ``` + // { + // "taskGroups":[{ + // "taskCount": 2 + // }] + // } + // ``` + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// ListJob Request. +message ListJobsRequest { + // Parent path. + string parent = 1; + + // List filter. + string filter = 4; + + // Optional. Sort results. Supported are "name", "name desc", "create_time", + // and "create_time desc". + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Page size. + int32 page_size = 2; + + // Page token. + string page_token = 3; +} + +// ListJob Response. +message ListJobsResponse { + // Jobs. + repeated Job jobs = 1; + + // Next page token. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// ListTasks Request. +message ListTasksRequest { + // Required. Name of a TaskGroup from which Tasks are being requested. + // Pattern: + // "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "batch.googleapis.com/TaskGroup" } + ]; + + // Task filter, null filter matches all Tasks. + // Filter string should be of the format State=TaskStatus.State e.g. + // State=RUNNING + string filter = 2; + + // Not implemented. + string order_by = 5; + + // Page size. + int32 page_size = 3; + + // Page token. + string page_token = 4; +} + +// ListTasks Response. +message ListTasksResponse { + // Tasks. + repeated Task tasks = 1; + + // Next page token. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request for a single Task by name. +message GetTaskRequest { + // Required. Task name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "batch.googleapis.com/Task" } + ]; +} + +// CreateResourceAllowance Request. +message CreateResourceAllowanceRequest { + // Required. The parent resource name where the ResourceAllowance will be + // created. Pattern: "projects/{project}/locations/{location}" + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "batch.googleapis.com/ResourceAllowance" + } + ]; + + // ID used to uniquely identify the ResourceAllowance within its parent scope. + // This field should contain at most 63 characters and must start with + // lowercase characters. + // Only lowercase characters, numbers and '-' are accepted. + // The '-' character cannot be the first or the last one. + // A system generated ID will be used if the field is not set. + // + // The resource_allowance.name field in the request will be ignored and the + // created resource name of the ResourceAllowance will be + // "{parent}/resourceAllowances/{resource_allowance_id}". + string resource_allowance_id = 2; + + // Required. The ResourceAllowance to create. + ResourceAllowance resource_allowance = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// GetResourceAllowance Request. +message GetResourceAllowanceRequest { + // Required. ResourceAllowance name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "batch.googleapis.com/ResourceAllowance" + } + ]; +} + +// DeleteResourceAllowance Request. +message DeleteResourceAllowanceRequest { + // Required. ResourceAllowance name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "batch.googleapis.com/ResourceAllowance" + } + ]; + + // Optional. Reason for this deletion. + string reason = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// ListResourceAllowances Request. +message ListResourceAllowancesRequest { + // Required. Parent path. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "batch.googleapis.com/ResourceAllowance" + } + ]; + + // Optional. Page size. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// ListResourceAllowances Response. +message ListResourceAllowancesResponse { + // ResourceAllowances. + repeated ResourceAllowance resource_allowances = 1; + + // Next page token. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// UpdateResourceAllowance Request. +message UpdateResourceAllowanceRequest { + // Required. The ResourceAllowance to update. + // Update description. + // Only fields specified in `update_mask` are updated. + ResourceAllowance resource_allowance = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Mask of fields to update. + // + // Field mask is used to specify the fields to be overwritten in the + // ResourceAllowance resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + // + // UpdateResourceAllowance request now only supports update on `limit` field. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have + // [google.longrunning.Operation.error][google.longrunning.Operation.error] + // value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/job.proto b/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/job.proto new file mode 100644 index 00000000000..8ab62c01f9a --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/job.proto @@ -0,0 +1,802 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.batch.v1alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/batch/v1alpha/task.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Batch.V1Alpha"; +option go_package = "cloud.google.com/go/batch/apiv1alpha/batchpb;batchpb"; +option java_multiple_files = true; +option java_outer_classname = "JobProto"; +option java_package = "com.google.cloud.batch.v1alpha"; +option objc_class_prefix = "GCB"; +option php_namespace = "Google\\Cloud\\Batch\\V1alpha"; +option ruby_package = "Google::Cloud::Batch::V1alpha"; + +// The Cloud Batch Job description. +message Job { + option (google.api.resource) = { + type: "batch.googleapis.com/Job" + pattern: "projects/{project}/locations/{location}/jobs/{job}" + }; + + // The order that TaskGroups are scheduled relative to each other. + // + // Not yet implemented. + enum SchedulingPolicy { + // Unspecified. + SCHEDULING_POLICY_UNSPECIFIED = 0; + + // Run all TaskGroups as soon as possible. + AS_SOON_AS_POSSIBLE = 1; + } + + // Output only. Job name. + // For example: "projects/123456/locations/us-central1/jobs/job01". + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A system generated unique ID for the Job. + string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Priority of the Job. + // The valid value range is [0, 100). Default value is 0. + // Higher value indicates higher priority. + // A job with higher priority value is more likely to run earlier if all other + // requirements are satisfied. + int64 priority = 3; + + // Required. TaskGroups in the Job. Only one TaskGroup is supported now. + repeated TaskGroup task_groups = 4 [(google.api.field_behavior) = REQUIRED]; + + // Scheduling policy for TaskGroups in the job. + SchedulingPolicy scheduling_policy = 5; + + // At least one of the dependencies must be satisfied before the Job is + // scheduled to run. + // Only one JobDependency is supported now. + // Not yet implemented. + repeated JobDependency dependencies = 6; + + // Compute resource allocation for all TaskGroups in the Job. + AllocationPolicy allocation_policy = 7; + + // Custom labels to apply to the job and any Cloud Logging + // [LogEntry](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry) + // that it generates. + // + // Use labels to group and describe the resources they are applied to. Batch + // automatically applies predefined labels and supports multiple `labels` + // fields for each job, which each let you apply custom labels to various + // resources. Label names that start with "goog-" or "google-" are + // reserved for predefined labels. For more information about labels with + // Batch, see + // [Organize resources using + // labels](https://cloud.google.com/batch/docs/organize-resources-using-labels). + map labels = 8; + + // Output only. Job status. It is read only for users. + JobStatus status = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Deprecated: please use notifications instead. + JobNotification notification = 10 [deprecated = true]; + + // Output only. When the Job was created. + google.protobuf.Timestamp create_time = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last time the Job was updated. + google.protobuf.Timestamp update_time = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Log preservation policy for the Job. + LogsPolicy logs_policy = 13; + + // Notification configurations. + repeated JobNotification notifications = 14; +} + +// LogsPolicy describes if and how a job's logs are preserved. Logs include +// information that is automatically written by the Batch service agent and any +// information that you configured the job's runnables to write to the `stdout` +// or `stderr` streams. +message LogsPolicy { + // `CloudLoggingOption` contains additional settings for Cloud Logging logs + // generated by Batch job. + message CloudLoggingOption { + // Optional. Set this field to `true` to change the [monitored resource + // type](https://cloud.google.com/monitoring/api/resources) for + // Cloud Logging logs generated by this Batch job from + // the + // [`batch.googleapis.com/Job`](https://cloud.google.com/monitoring/api/resources#tag_batch.googleapis.com/Job) + // type to the formerly used + // [`generic_task`](https://cloud.google.com/monitoring/api/resources#tag_generic_task) + // type. + bool use_generic_task_monitored_resource = 1 + [(google.api.field_behavior) = OPTIONAL]; + } + + // The destination (if any) for logs. + enum Destination { + // (Default) Logs are not preserved. + DESTINATION_UNSPECIFIED = 0; + + // Logs are streamed to Cloud Logging. Optionally, you can configure + // additional settings in the `cloudLoggingOption` field. + CLOUD_LOGGING = 1; + + // Logs are saved to the file path specified in the `logsPath` field. + PATH = 2; + } + + // If and where logs should be saved. + Destination destination = 1; + + // When `destination` is set to `PATH`, you must set this field to the path + // where you want logs to be saved. This path can point to a local directory + // on the VM or (if congifured) a directory under the mount path of any + // Cloud Storage bucket, network file system (NFS), or writable persistent + // disk that is mounted to the job. For example, if the job has a bucket with + // `mountPath` set to `/mnt/disks/my-bucket`, you can write logs to the + // root directory of the `remotePath` of that bucket by setting this field to + // `/mnt/disks/my-bucket/`. + string logs_path = 2; + + // Optional. When `destination` is set to `CLOUD_LOGGING`, you can optionally + // set this field to configure additional settings for Cloud Logging. + CloudLoggingOption cloud_logging_option = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// JobDependency describes the state of other Jobs that the start of this Job +// depends on. +// All dependent Jobs must have been submitted in the same region. +message JobDependency { + // Dependency type. + enum Type { + // Unspecified. + TYPE_UNSPECIFIED = 0; + + // The dependent Job has succeeded. + SUCCEEDED = 1; + + // The dependent Job has failed. + FAILED = 2; + + // SUCCEEDED or FAILED. + FINISHED = 3; + } + + // Each item maps a Job name to a Type. + // All items must be satisfied for the JobDependency to be satisfied (the AND + // operation). + // Once a condition for one item becomes true, it won't go back to false + // even the dependent Job state changes again. + map items = 1; +} + +// Job status. +message JobStatus { + // VM instance status. + message InstanceStatus { + // The Compute Engine machine type. + string machine_type = 1; + + // The VM instance provisioning model. + AllocationPolicy.ProvisioningModel provisioning_model = 2; + + // The max number of tasks can be assigned to this instance type. + int64 task_pack = 3; + + // The VM boot disk. + AllocationPolicy.Disk boot_disk = 4; + } + + // Aggregated task status for a TaskGroup. + message TaskGroupStatus { + // Count of task in each state in the TaskGroup. + // The map key is task state name. + map counts = 1; + + // Status of instances allocated for the TaskGroup. + repeated InstanceStatus instances = 2; + } + + // Valid Job states. + enum State { + // Job state unspecified. + STATE_UNSPECIFIED = 0; + + // Job is admitted (validated and persisted) and waiting for resources. + QUEUED = 1; + + // Job is scheduled to run as soon as resource allocation is ready. + // The resource allocation may happen at a later time but with a high + // chance to succeed. + SCHEDULED = 2; + + // Resource allocation has been successful. At least one Task in the Job is + // RUNNING. + RUNNING = 3; + + // All Tasks in the Job have finished successfully. + SUCCEEDED = 4; + + // At least one Task in the Job has failed. + FAILED = 5; + + // The Job will be deleted, but has not been deleted yet. Typically this is + // because resources used by the Job are still being cleaned up. + DELETION_IN_PROGRESS = 6; + + // The Job cancellation is in progress, this is because the resources used + // by the Job are still being cleaned up. + CANCELLATION_IN_PROGRESS = 7; + + // The Job has been cancelled, the task executions were stopped and the + // resources were cleaned up. + CANCELLED = 8; + } + + // Job state + State state = 1; + + // Job status events + repeated StatusEvent status_events = 2; + + // Aggregated task status for each TaskGroup in the Job. + // The map key is TaskGroup ID. + map task_groups = 4; + + // The duration of time that the Job spent in status RUNNING. + google.protobuf.Duration run_duration = 5; + + // The resource usage of the job. + ResourceUsage resource_usage = 6; +} + +// ResourceUsage describes the resource usage of the job. +message ResourceUsage { + // The CPU core hours that the job consumes. + double core_hours = 1; +} + +// Notification configurations. +message JobNotification { + // Message details. + // Describe the conditions under which messages will be sent. + // If no attribute is defined, no message will be sent by default. + // One message should specify either the job or the task level attributes, + // but not both. For example, + // job level: JOB_STATE_CHANGED and/or a specified new_job_state; + // task level: TASK_STATE_CHANGED and/or a specified new_task_state. + message Message { + // The message type. + Type type = 1; + + // The new job state. + JobStatus.State new_job_state = 2; + + // The new task state. + TaskStatus.State new_task_state = 3; + } + + // The message type. + enum Type { + // Unspecified. + TYPE_UNSPECIFIED = 0; + + // Notify users that the job state has changed. + JOB_STATE_CHANGED = 1; + + // Notify users that the task state has changed. + TASK_STATE_CHANGED = 2; + } + + // The Pub/Sub topic where notifications for the job, like state + // changes, will be published. If undefined, no Pub/Sub notifications + // are sent for this job. + // + // Specify the topic using the following format: + // `projects/{project}/topics/{topic}`. + // Notably, if you want to specify a Pub/Sub topic that is in a + // different project than the job, your administrator must grant your + // project's Batch service agent permission to publish to that topic. + // + // For more information about configuring Pub/Sub notifications for + // a job, see + // https://cloud.google.com/batch/docs/enable-notifications. + string pubsub_topic = 1; + + // The attribute requirements of messages to be sent to this Pub/Sub topic. + // Without this field, no message will be sent. + Message message = 2; +} + +// A Job's resource allocation policy describes when, where, and how compute +// resources should be allocated for the Job. +message AllocationPolicy { + message LocationPolicy { + // A list of allowed location names represented by internal URLs. + // + // Each location can be a region or a zone. + // Only one region or multiple zones in one region is supported now. + // For example, + // ["regions/us-central1"] allow VMs in any zones in region us-central1. + // ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs + // in zones us-central1-a and us-central1-c. + // + // Mixing locations from different regions would cause errors. + // For example, + // ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b", + // "zones/us-west1-a"] contains locations from two distinct regions: + // us-central1 and us-west1. This combination will trigger an error. + repeated string allowed_locations = 1; + + // A list of denied location names. + // + // Not yet implemented. + repeated string denied_locations = 2; + } + + // A new persistent disk or a local ssd. + // A VM can only have one local SSD setting but multiple local SSD partitions. + // See https://cloud.google.com/compute/docs/disks#pdspecs and + // https://cloud.google.com/compute/docs/disks#localssds. + message Disk { + // A data source from which a PD will be created. + oneof data_source { + // URL for a VM image to use as the data source for this disk. + // For example, the following are all valid URLs: + // + // * Specify the image by its family name: + // projects/{project}/global/images/family/{image_family} + // * Specify the image version: + // projects/{project}/global/images/{image_version} + // + // You can also use Batch customized image in short names. + // The following image values are supported for a boot disk: + // + // * `batch-debian`: use Batch Debian images. + // * `batch-cos`: use Batch Container-Optimized images. + // * `batch-hpc-rocky`: use Batch HPC Rocky Linux images. + string image = 4; + + // Name of a snapshot used as the data source. + // Snapshot is not supported as boot disk now. + string snapshot = 5; + } + + // Disk type as shown in `gcloud compute disk-types list`. + // For example, local SSD uses type "local-ssd". + // Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd" + // or "pd-standard". If not specified, "pd-standard" will be used as the + // default type for non-boot disks, "pd-balanced" will be used as the + // default type for boot disks. + string type = 1; + + // Disk size in GB. + // + // **Non-Boot Disk**: + // If the `type` specifies a persistent disk, this field + // is ignored if `data_source` is set as `image` or `snapshot`. + // If the `type` specifies a local SSD, this field should be a multiple of + // 375 GB, otherwise, the final size will be the next greater multiple of + // 375 GB. + // + // **Boot Disk**: + // Batch will calculate the boot disk size based on source + // image and task requirements if you do not speicify the size. + // If both this field and the `boot_disk_mib` field in task spec's + // `compute_resource` are defined, Batch will only honor this field. + // Also, this field should be no smaller than the source disk's + // size when the `data_source` is set as `snapshot` or `image`. + // For example, if you set an image as the `data_source` field and the + // image's default disk size 30 GB, you can only use this field to make the + // disk larger or equal to 30 GB. + int64 size_gb = 2; + + // Local SSDs are available through both "SCSI" and "NVMe" interfaces. + // If not indicated, "NVMe" will be the default one for local ssds. + // This field is ignored for persistent disks as the interface is chosen + // automatically. See + // https://cloud.google.com/compute/docs/disks/persistent-disks#choose_an_interface. + string disk_interface = 6; + } + + // A new or an existing persistent disk (PD) or a local ssd attached to a VM + // instance. + message AttachedDisk { + oneof attached { + Disk new_disk = 1; + + // Name of an existing PD. + string existing_disk = 2; + } + + // Device name that the guest operating system will see. + // It is used by Runnable.volumes field to mount disks. So please specify + // the device_name if you want Batch to help mount the disk, and it should + // match the device_name field in volumes. + string device_name = 3; + } + + // Accelerator describes Compute Engine accelerators to be attached to the VM. + message Accelerator { + // The accelerator type. For example, "nvidia-tesla-t4". + // See `gcloud compute accelerator-types list`. + string type = 1; + + // The number of accelerators of this type. + int64 count = 2; + + // Deprecated: please use instances[0].install_gpu_drivers instead. + bool install_gpu_drivers = 3 [deprecated = true]; + + // Optional. The NVIDIA GPU driver version that should be installed for this + // type. + // + // You can define the specific driver version such as "470.103.01", + // following the driver version requirements in + // https://cloud.google.com/compute/docs/gpus/install-drivers-gpu#minimum-driver. + // Batch will install the specific accelerator driver if qualified. + string driver_version = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // InstancePolicy describes an instance type and resources attached to each VM + // created by this InstancePolicy. + message InstancePolicy { + // Deprecated: please use machine_type instead. + repeated string allowed_machine_types = 1 [deprecated = true]; + + // The Compute Engine machine type. + string machine_type = 2; + + // The minimum CPU platform. + // See + // https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. + string min_cpu_platform = 3; + + // The provisioning model. + ProvisioningModel provisioning_model = 4; + + // The accelerators attached to each VM instance. + repeated Accelerator accelerators = 5; + + // Boot disk to be created and attached to each VM by this InstancePolicy. + // Boot disk will be deleted when the VM is deleted. + // Batch API now only supports booting from image. + Disk boot_disk = 8; + + // Non-boot disks to be attached for each VM created by this InstancePolicy. + // New disks will be deleted when the VM is deleted. + // A non-boot disk is a disk that can be of a device with a + // file system or a raw storage drive that is not ready for data + // storage and accessing. + repeated AttachedDisk disks = 6; + + // Optional. If not specified (default), VMs will consume any applicable + // reservation. If "NO_RESERVATION" is specified, VMs will not consume any + // reservation. Otherwise, if specified, VMs will consume only the specified + // reservation. + string reservation = 7 [(google.api.field_behavior) = OPTIONAL]; + } + + // InstancePolicyOrTemplate lets you define the type of resources to use for + // this job either with an InstancePolicy or an instance template. + // If undefined, Batch picks the type of VM to use and doesn't include + // optional VM resources such as GPUs and extra disks. + message InstancePolicyOrTemplate { + oneof policy_template { + // InstancePolicy. + InstancePolicy policy = 1; + + // Name of an instance template used to create VMs. + // Named the field as 'instance_template' instead of 'template' to avoid + // C++ keyword conflict. + // + // Batch only supports global instance templates from the same project as + // the job. + // You can specify the global instance template as a full or partial URL. + string instance_template = 2; + } + + // Set this field true if you want Batch to help fetch drivers from a third + // party location and install them for GPUs specified in + // `policy.accelerators` or `instance_template` on your behalf. Default is + // false. + // + // For Container-Optimized Image cases, Batch will install the + // accelerator driver following milestones of + // https://cloud.google.com/container-optimized-os/docs/release-notes. For + // non Container-Optimized Image cases, following + // https://github.com/GoogleCloudPlatform/compute-gpu-installation/blob/main/linux/install_gpu_driver.py. + bool install_gpu_drivers = 3; + + // Optional. Set this field true if you want Batch to install Ops Agent on + // your behalf. Default is false. + bool install_ops_agent = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Set this field to `true` if you want Batch to block + // project-level SSH keys from accessing this job's VMs. Alternatively, you + // can configure the job to specify a VM instance template that blocks + // project-level SSH keys. In either case, Batch blocks project-level SSH + // keys while creating the VMs for this job. + // + // Batch allows project-level SSH keys for a job's VMs only if all + // the following are true: + // + // + This field is undefined or set to `false`. + // + The job's VM instance template (if any) doesn't block project-level + // SSH keys. + // + // Notably, you can override this behavior by manually updating a VM to + // block or allow project-level SSH keys. For more information about + // blocking project-level SSH keys, see the Compute Engine documentation: + // https://cloud.google.com/compute/docs/connect/restrict-ssh-keys#block-keys + bool block_project_ssh_keys = 5 [(google.api.field_behavior) = OPTIONAL]; + } + + // A network interface. + message NetworkInterface { + // The URL of an existing network resource. + // You can specify the network as a full or partial URL. + // + // For example, the following are all valid URLs: + // + // * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network} + // * projects/{project}/global/networks/{network} + // * global/networks/{network} + string network = 1; + + // The URL of an existing subnetwork resource in the network. + // You can specify the subnetwork as a full or partial URL. + // + // For example, the following are all valid URLs: + // + // * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork} + // * projects/{project}/regions/{region}/subnetworks/{subnetwork} + // * regions/{region}/subnetworks/{subnetwork} + string subnetwork = 2; + + // Default is false (with an external IP address). Required if + // no external public IP address is attached to the VM. If no external + // public IP address, additional configuration is required to allow the VM + // to access Google Services. See + // https://cloud.google.com/vpc/docs/configure-private-google-access and + // https://cloud.google.com/nat/docs/gce-example#create-nat for more + // information. + bool no_external_ip_address = 3; + } + + // NetworkPolicy describes VM instance network configurations. + message NetworkPolicy { + // Network configurations. + repeated NetworkInterface network_interfaces = 1; + } + + // PlacementPolicy describes a group placement policy for the VMs controlled + // by this AllocationPolicy. + message PlacementPolicy { + // UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you + // want VMs to be located close to each other for low network latency + // between the VMs. No placement policy will be generated when collocation + // is UNSPECIFIED. + string collocation = 1; + + // When specified, causes the job to fail if more than max_distance logical + // switches are required between VMs. Batch uses the most compact possible + // placement of VMs even when max_distance is not specified. An explicit + // max_distance makes that level of compactness a strict requirement. + // Not yet implemented + int64 max_distance = 2; + } + + // Compute Engine VM instance provisioning model. + enum ProvisioningModel { + // Unspecified. + PROVISIONING_MODEL_UNSPECIFIED = 0; + + // Standard VM. + STANDARD = 1; + + // SPOT VM. + SPOT = 2; + + // Preemptible VM (PVM). + // + // Above SPOT VM is the preferable model for preemptible VM instances: the + // old preemptible VM model (indicated by this field) is the older model, + // and has been migrated to use the SPOT model as the underlying technology. + // This old model will still be supported. + PREEMPTIBLE = 3; + } + + // Location where compute resources should be allocated for the Job. + LocationPolicy location = 1; + + // Deprecated: please use instances[0].policy instead. + InstancePolicy instance = 2 [deprecated = true]; + + // Describe instances that can be created by this AllocationPolicy. + // Only instances[0] is supported now. + repeated InstancePolicyOrTemplate instances = 8; + + // Deprecated: please use instances[0].template instead. + repeated string instance_templates = 3 [deprecated = true]; + + // Deprecated: please use instances[0].policy.provisioning_model instead. + repeated ProvisioningModel provisioning_models = 4 [deprecated = true]; + + // Deprecated: please use service_account instead. + string service_account_email = 5 [deprecated = true]; + + // Defines the service account for Batch-created VMs. If omitted, the [default + // Compute Engine service + // account](https://cloud.google.com/compute/docs/access/service-accounts#default_service_account) + // is used. Must match the service account specified in any used instance + // template configured in the Batch job. + // + // Includes the following fields: + // * email: The service account's email address. If not set, the default + // Compute Engine service account is used. + // * scopes: Additional OAuth scopes to grant the service account, beyond the + // default cloud-platform scope. (list of strings) + ServiceAccount service_account = 9; + + // Custom labels to apply to the job and all the Compute Engine resources + // that both are created by this allocation policy and support labels. + // + // Use labels to group and describe the resources they are applied to. Batch + // automatically applies predefined labels and supports multiple `labels` + // fields for each job, which each let you apply custom labels to various + // resources. Label names that start with "goog-" or "google-" are + // reserved for predefined labels. For more information about labels with + // Batch, see + // [Organize resources using + // labels](https://cloud.google.com/batch/docs/organize-resources-using-labels). + map labels = 6; + + // The network policy. + // + // If you define an instance template in the `InstancePolicyOrTemplate` field, + // Batch will use the network settings in the instance template instead of + // this field. + NetworkPolicy network = 7; + + // The placement policy. + PlacementPolicy placement = 10; + + // Optional. Tags applied to the VM instances. + // + // The tags identify valid sources or targets for network firewalls. + // Each tag must be 1-63 characters long, and comply with + // [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). + repeated string tags = 11 [(google.api.field_behavior) = OPTIONAL]; +} + +// A TaskGroup defines one or more Tasks that all share the same TaskSpec. +message TaskGroup { + option (google.api.resource) = { + type: "batch.googleapis.com/TaskGroup" + pattern: "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + }; + + // How Tasks in the TaskGroup should be scheduled relative to each other. + enum SchedulingPolicy { + // Unspecified. + SCHEDULING_POLICY_UNSPECIFIED = 0; + + // Run Tasks as soon as resources are available. + // + // Tasks might be executed in parallel depending on parallelism and + // task_count values. + AS_SOON_AS_POSSIBLE = 1; + + // Run Tasks sequentially with increased task index. + IN_ORDER = 2; + } + + // Output only. TaskGroup name. + // The system generates this field based on parent Job name. + // For example: + // "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01". + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Tasks in the group share the same task spec. + TaskSpec task_spec = 3 [(google.api.field_behavior) = REQUIRED]; + + // Number of Tasks in the TaskGroup. + // Default is 1. + int64 task_count = 4; + + // Max number of tasks that can run in parallel. + // Default to min(task_count, parallel tasks per job limit). + // See: [Job Limits](https://cloud.google.com/batch/quotas#job_limits). + // Field parallelism must be 1 if the scheduling_policy is IN_ORDER. + int64 parallelism = 5; + + // Scheduling policy for Tasks in the TaskGroup. + // The default value is AS_SOON_AS_POSSIBLE. + SchedulingPolicy scheduling_policy = 6; + + // Compute resource allocation for the TaskGroup. + // If specified, it overrides resources in Job. + AllocationPolicy allocation_policy = 7; + + // Labels for the TaskGroup. + // Labels could be user provided or system generated. + // You can assign up to 64 labels. [Google Compute Engine label + // restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions) + // apply. + // Label names that start with "goog-" or "google-" are reserved. + map labels = 8; + + // An array of environment variable mappings, which are passed to Tasks with + // matching indices. If task_environments is used then task_count should + // not be specified in the request (and will be ignored). Task count will be + // the length of task_environments. + // + // Tasks get a BATCH_TASK_INDEX and BATCH_TASK_COUNT environment variable, in + // addition to any environment variables set in task_environments, specifying + // the number of Tasks in the Task's parent TaskGroup, and the specific Task's + // index in the TaskGroup (0 through BATCH_TASK_COUNT - 1). + repeated Environment task_environments = 9; + + // Max number of tasks that can be run on a VM at the same time. + // If not specified, the system will decide a value based on available + // compute resources on a VM and task requirements. + int64 task_count_per_node = 10; + + // When true, Batch will populate a file with a list of all VMs assigned to + // the TaskGroup and set the BATCH_HOSTS_FILE environment variable to the path + // of that file. Defaults to false. The host file supports up to 1000 VMs. + bool require_hosts_file = 11; + + // When true, Batch will configure SSH to allow passwordless login between + // VMs running the Batch tasks in the same TaskGroup. + bool permissive_ssh = 12; + + // Optional. If not set or set to false, Batch uses the root user to execute + // runnables. If set to true, Batch runs the runnables using a non-root user. + // Currently, the non-root user Batch used is generated by OS Login. For more + // information, see [About OS + // Login](https://cloud.google.com/compute/docs/oslogin). + bool run_as_non_root = 14 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. ServiceAccount used by tasks within the task group for the access + // to other Cloud resources. This allows tasks to operate with permissions + // distinct from the service account for the VM set at `AllocationPolicy`. Use + // this field when tasks require different access rights than those of the VM. + // + // Specify the service account's `email` field. Ensure `scopes` + // include any necessary permissions for tasks, in addition to the default + // 'cloud-platform' scope. + ServiceAccount service_account = 15 [(google.api.field_behavior) = OPTIONAL]; +} + +// Carries information about a Google Cloud service account. +message ServiceAccount { + // Email address of the service account. + string email = 1; + + // List of scopes to be enabled for this service account. + repeated string scopes = 2; +} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/notification.proto b/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/notification.proto new file mode 100644 index 00000000000..6eedfc615c5 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/notification.proto @@ -0,0 +1,38 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.batch.v1alpha; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.Batch.V1Alpha"; +option go_package = "cloud.google.com/go/batch/apiv1alpha/batchpb;batchpb"; +option java_multiple_files = true; +option java_outer_classname = "NotificationProto"; +option java_package = "com.google.cloud.batch.v1alpha"; +option objc_class_prefix = "GCB"; +option php_namespace = "Google\\Cloud\\Batch\\V1alpha"; +option ruby_package = "Google::Cloud::Batch::V1alpha"; + +// Notification on resource state change. +message Notification { + // Required. The Pub/Sub topic where notifications like the resource allowance + // state changes will be published. The topic must exist in the same project + // as the job and billings will be charged to this project. If not specified, + // no Pub/Sub messages will be sent. Topic format: + // `projects/{project}/topics/{topic}`. + string pubsub_topic = 1 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/resource_allowance.proto b/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/resource_allowance.proto new file mode 100644 index 00000000000..988271f5802 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/resource_allowance.proto @@ -0,0 +1,208 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.batch.v1alpha; + +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/cloud/batch/v1alpha/notification.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/interval.proto"; + +option csharp_namespace = "Google.Cloud.Batch.V1Alpha"; +option go_package = "cloud.google.com/go/batch/apiv1alpha/batchpb;batchpb"; +option java_multiple_files = true; +option java_outer_classname = "ResourceAllowanceProto"; +option java_package = "com.google.cloud.batch.v1alpha"; +option objc_class_prefix = "GCB"; +option php_namespace = "Google\\Cloud\\Batch\\V1alpha"; +option ruby_package = "Google::Cloud::Batch::V1alpha"; + +// A `CalendarPeriod` represents the abstract concept of a time period that +// has a canonical start. All calendar times begin at 12 AM US and Canadian +// Pacific Time (UTC-8). +enum CalendarPeriod { + // Unspecified. + CALENDAR_PERIOD_UNSPECIFIED = 0; + + // The month starts on the first date of the month and resets at the beginning + // of each month. + MONTH = 1; + + // The quarter starts on dates January 1, April 1, July 1, and October 1 of + // each year and resets at the beginning of the next quarter. + QUARTER = 2; + + // The year starts on January 1 and resets at the beginning of the next year. + YEAR = 3; + + // The week period starts and resets every Monday. + WEEK = 4; + + // The day starts at 12:00am. + DAY = 5; +} + +// ResourceAllowance valid state. +enum ResourceAllowanceState { + // Unspecified. + RESOURCE_ALLOWANCE_STATE_UNSPECIFIED = 0; + + // ResourceAllowance is active and in use. + RESOURCE_ALLOWANCE_ACTIVE = 1; + + // ResourceAllowance limit is reached. + RESOURCE_ALLOWANCE_DEPLETED = 2; +} + +// The Resource Allowance description for Cloud Batch. +// Only one Resource Allowance is supported now under a specific location and +// project. +message ResourceAllowance { + option (google.api.resource) = { + type: "batch.googleapis.com/ResourceAllowance" + pattern: "projects/{project}/locations/{location}/resourceAllowances/{resource_allowance}" + plural: "resourceAllowances" + singular: "resourceAllowance" + }; + + // ResourceAllowance detail. + oneof resource_allowance { + // The detail of usage resource allowance. + UsageResourceAllowance usage_resource_allowance = 4; + } + + // Identifier. ResourceAllowance name. + // For example: + // "projects/123456/locations/us-central1/resourceAllowances/resource-allowance-1". + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. A system generated unique ID (in UUID4 format) for the + // ResourceAllowance. + string uid = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Output only. Time when the ResourceAllowance was created. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Labels are attributes that can be set and used by both the + // user and by Batch. Labels must meet the following constraints: + // + // * Keys and values can contain only lowercase letters, numeric characters, + // underscores, and dashes. + // * All characters must use UTF-8 encoding, and international characters are + // allowed. + // * Keys must start with a lowercase letter or international character. + // * Each resource is limited to a maximum of 64 labels. + // + // Both keys and values are additionally constrained to be <= 128 bytes. + map labels = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Notification configurations. + repeated Notification notifications = 6 + [(google.api.field_behavior) = OPTIONAL]; +} + +// UsageResourceAllowance describes the detail of usage resource allowance. +message UsageResourceAllowance { + // Required. Spec of a usage ResourceAllowance. + UsageResourceAllowanceSpec spec = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Status of a usage ResourceAllowance. + UsageResourceAllowanceStatus status = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Spec of a usage ResourceAllowance. +message UsageResourceAllowanceSpec { + // UsageResourceAllowance limitation. + message Limit { + oneof duration { + // Optional. A CalendarPeriod represents the abstract concept of a time + // period that has a canonical start. + CalendarPeriod calendar_period = 1 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. Limit value of a UsageResourceAllowance within its one + // duration. + // + // Limit cannot be a negative value. Default is 0. + // For example, you can set `limit` as 10000.0 with duration of the current + // month by setting `calendar_period` field as monthly. That means in your + // current month, 10000.0 is the core hour limitation that your resources + // are allowed to consume. + optional double limit = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. Spec type is unique for each usage ResourceAllowance. + // Batch now only supports type as "cpu-core-hours" for CPU usage consumption + // tracking. + string type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Threshold of a UsageResourceAllowance limiting how many resources + // can be consumed for each type. + Limit limit = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Status of a usage ResourceAllowance. +message UsageResourceAllowanceStatus { + // UsageResourceAllowanceStatus detail about usage consumption. + message LimitStatus { + // Output only. The consumption interval. + google.type.Interval consumption_interval = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Limit value of a UsageResourceAllowance within its one + // duration. + optional double limit = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Accumulated consumption during `consumption_interval`. + optional double consumed = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + message PeriodConsumption { + // Output only. The consumption interval. + google.type.Interval consumption_interval = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Accumulated consumption during `consumption_interval`. + optional double consumed = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // ConsumptionReport is the report of ResourceAllowance consumptions in a time + // period. + message ConsumptionReport { + // Output only. ResourceAllowance consumptions in the latest calendar + // period. Key is the calendar period in string format. Batch currently + // supports HOUR, DAY, MONTH and YEAR. + map latest_period_consumptions = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. ResourceAllowance state. + ResourceAllowanceState state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. ResourceAllowance consumption status for usage resources. + LimitStatus limit_status = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The report of ResourceAllowance consumptions in a time period. + ConsumptionReport report = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/task.proto b/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/task.proto new file mode 100644 index 00000000000..08a20f499dd --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/task.proto @@ -0,0 +1,494 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.batch.v1alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/batch/v1alpha/volume.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Batch.V1Alpha"; +option go_package = "cloud.google.com/go/batch/apiv1alpha/batchpb;batchpb"; +option java_multiple_files = true; +option java_outer_classname = "TaskProto"; +option java_package = "com.google.cloud.batch.v1alpha"; +option objc_class_prefix = "GCB"; +option php_namespace = "Google\\Cloud\\Batch\\V1alpha"; +option ruby_package = "Google::Cloud::Batch::V1alpha"; + +// Compute resource requirements. +// +// ComputeResource defines the amount of resources required for each task. +// Make sure your tasks have enough resources to successfully run. +// If you also define the types of resources for a job to use with the +// [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) +// field, make sure both fields are compatible with each other. +message ComputeResource { + // The milliCPU count. + // + // `cpuMilli` defines the amount of CPU resources per task in milliCPU units. + // For example, `1000` corresponds to 1 vCPU per task. If undefined, the + // default value is `2000`. + // + // If you also define the VM's machine type using the `machineType` in + // [InstancePolicy](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicy) + // field or inside the `instanceTemplate` in the + // [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) + // field, make sure the CPU resources for both fields are compatible with each + // other and with how many tasks you want to allow to run on the same VM at + // the same time. + // + // For example, if you specify the `n2-standard-2` machine type, which has 2 + // vCPUs each, you are recommended to set `cpuMilli` no more than `2000`, or + // you are recommended to run two tasks on the same VM if you set `cpuMilli` + // to `1000` or less. + int64 cpu_milli = 1; + + // Memory in MiB. + // + // `memoryMib` defines the amount of memory per task in MiB units. + // If undefined, the default value is `2000`. + // If you also define the VM's machine type using the `machineType` in + // [InstancePolicy](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicy) + // field or inside the `instanceTemplate` in the + // [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) + // field, make sure the memory resources for both fields are compatible with + // each other and with how many tasks you want to allow to run on the same VM + // at the same time. + // + // For example, if you specify the `n2-standard-2` machine type, which has 8 + // GiB each, you are recommended to set `memoryMib` to no more than `8192`, + // or you are recommended to run two tasks on the same VM if you set + // `memoryMib` to `4096` or less. + int64 memory_mib = 2; + + // The GPU count. + // + // Not yet implemented. + int64 gpu_count = 3; + + // Extra boot disk size in MiB for each task. + int64 boot_disk_mib = 4; +} + +// Status event. +message StatusEvent { + // Type of the event. + string type = 3; + + // Description of the event. + string description = 1; + + // The time this event occurred. + google.protobuf.Timestamp event_time = 2; + + // Task Execution. + // This field is only defined for task-level status events where the task + // fails. + TaskExecution task_execution = 4; + + // Task State. + // This field is only defined for task-level status events. + TaskStatus.State task_state = 5; +} + +// This Task Execution field includes detail information for +// task execution procedures, based on StatusEvent types. +message TaskExecution { + // The exit code of a finished task. + // + // If the task succeeded, the exit code will be 0. If the task failed but not + // due to the following reasons, the exit code will be 50000. + // + // Otherwise, it can be from different sources: + // * Batch known failures: + // https://cloud.google.com/batch/docs/troubleshooting#reserved-exit-codes. + // * Batch runnable execution failures; you can rely on Batch logs to further + // diagnose: https://cloud.google.com/batch/docs/analyze-job-using-logs. If + // there are multiple runnables failures, Batch only exposes the first error. + int32 exit_code = 1; + + // Optional. The tail end of any content written to standard error by the task + // execution. This field will be populated only when the execution failed. + string stderr_snippet = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Status of a task. +message TaskStatus { + // Task states. + enum State { + // Unknown state. + STATE_UNSPECIFIED = 0; + + // The Task is created and waiting for resources. + PENDING = 1; + + // The Task is assigned to at least one VM. + ASSIGNED = 2; + + // The Task is running. + RUNNING = 3; + + // The Task has failed. + FAILED = 4; + + // The Task has succeeded. + SUCCEEDED = 5; + + // The Task has not been executed when the Job finishes. + UNEXECUTED = 6; + } + + // Task state. + State state = 1; + + // Detailed info about why the state is reached. + repeated StatusEvent status_events = 2; + + // The resource usage of the task. + TaskResourceUsage resource_usage = 3; +} + +// TaskResourceUsage describes the resource usage of the task. +message TaskResourceUsage { + // The CPU core hours the task consumes based on task requirement and run + // time. + double core_hours = 1; +} + +// Runnable describes instructions for executing a specific script or container +// as part of a Task. +message Runnable { + // Container runnable. + message Container { + // Required. The URI to pull the container image from. + string image_uri = 1; + + // Required for some container images. Overrides the `CMD` specified in the + // container. If there is an `ENTRYPOINT` (either in the container image or + // with the `entrypoint` field below) then these commands are appended as + // arguments to the `ENTRYPOINT`. + repeated string commands = 2; + + // Required for some container images. Overrides the `ENTRYPOINT` specified + // in the container. + string entrypoint = 3; + + // Volumes to mount (bind mount) from the host machine files or directories + // into the container, formatted to match `--volume` option for the + // `docker run` command—for example, `/foo:/bar` or `/foo:/bar:ro`. + // + // If the `TaskSpec.Volumes` field is specified but this field is not, Batch + // will mount each volume from the host machine to the container with the + // same mount path by default. In this case, the default mount option for + // containers will be read-only (`ro`) for existing persistent disks and + // read-write (`rw`) for other volume types, regardless of the original + // mount options specified in `TaskSpec.Volumes`. If you need different + // mount settings, you can explicitly configure them in this field. + repeated string volumes = 7; + + // Required for some container images. Arbitrary additional options to + // include in the `docker run` command when running this container—for + // example, `--network host`. For the `--volume` option, use the `volumes` + // field for the container. + string options = 8; + + // If set to true, external network access to and from container will be + // blocked, containers that are with block_external_network as true can + // still communicate with each other, network cannot be specified in the + // `container.options` field. + bool block_external_network = 9; + + // Required if the container image is from a private Docker registry. The + // username to login to the Docker registry that contains the image. + // + // You can either specify the username directly by using plain text or + // specify an encrypted username by using a Secret Manager secret: + // `projects/*/secrets/*/versions/*`. However, using a secret is + // recommended for enhanced security. + // + // Caution: If you specify the username using plain text, you risk the + // username being exposed to any users who can view the job or its logs. + // To avoid this risk, specify a secret that contains the username instead. + // + // Learn more about [Secret + // Manager](https://cloud.google.com/secret-manager/docs/) and [using + // Secret Manager with + // Batch](https://cloud.google.com/batch/docs/create-run-job-secret-manager). + string username = 10; + + // Required if the container image is from a private Docker registry. The + // password to login to the Docker registry that contains the image. + // + // For security, it is strongly recommended to specify an + // encrypted password by using a Secret Manager secret: + // `projects/*/secrets/*/versions/*`. + // + // Warning: If you specify the password using plain text, you risk the + // password being exposed to any users who can view the job or its logs. + // To avoid this risk, specify a secret that contains the password instead. + // + // Learn more about [Secret + // Manager](https://cloud.google.com/secret-manager/docs/) and [using + // Secret Manager with + // Batch](https://cloud.google.com/batch/docs/create-run-job-secret-manager). + string password = 11; + + // Optional. If set to true, this container runnable uses Image streaming. + // + // Use Image streaming to allow the runnable to initialize without + // waiting for the entire container image to download, which can + // significantly reduce startup time for large container images. + // + // When `enableImageStreaming` is set to true, the container + // runtime is [containerd](https://containerd.io/) instead of Docker. + // Additionally, this container runnable only supports the following + // `container` subfields: `imageUri`, + // `commands[]`, `entrypoint`, and + // `volumes[]`; any other `container` subfields are ignored. + // + // For more information about the requirements and limitations for using + // Image streaming with Batch, see the [`image-streaming` + // sample on + // GitHub](https://github.com/GoogleCloudPlatform/batch-samples/tree/main/api-samples/image-streaming). + bool enable_image_streaming = 12 [(google.api.field_behavior) = OPTIONAL]; + } + + // Script runnable. + message Script { + // Required. The source code for this script runnable. + oneof command { + // The path to a script file that is accessible from the host VM(s). + // + // Unless the script file supports the default `#!/bin/sh` shell + // interpreter, you must specify an interpreter by including a + // [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix) as the + // first line of the file. For example, to execute the script using bash, + // include `#!/bin/bash` as the first line of the file. Alternatively, + // to execute the script using Python3, include `#!/usr/bin/env python3` + // as the first line of the file. + string path = 1; + + // The text for a script. + // + // Unless the script text supports the default `#!/bin/sh` shell + // interpreter, you must specify an interpreter by including a + // [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix) at the + // beginning of the text. For example, to execute the script using bash, + // include `#!/bin/bash\n` at the beginning of the text. Alternatively, + // to execute the script using Python3, include `#!/usr/bin/env python3\n` + // at the beginning of the text. + string text = 2; + } + } + + // A barrier runnable automatically blocks the execution of subsequent + // runnables until all the tasks in the task group reach the barrier. + message Barrier { + // Barriers are identified by their index in runnable list. + // Names are not required, but if present should be an identifier. + string name = 1; + } + + // Required. The script, container, or barrier for this runnable to execute. + oneof executable { + // Container runnable. + Container container = 1; + + // Script runnable. + Script script = 2; + + // Barrier runnable. + Barrier barrier = 6; + } + + // Optional. DisplayName is an optional field that can be provided by the + // caller. If provided, it will be used in logs and other outputs to identify + // the script, making it easier for users to understand the logs. If not + // provided the index of the runnable will be used for outputs. + string display_name = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Normally, a runnable that returns a non-zero exit status fails and causes + // the task to fail. However, you can set this field to `true` to allow the + // task to continue executing its other runnables even if this runnable + // fails. + bool ignore_exit_status = 3; + + // Normally, a runnable that doesn't exit causes its task to fail. However, + // you can set this field to `true` to configure a background runnable. + // Background runnables are allowed continue running in the background while + // the task executes subsequent runnables. For example, background runnables + // are useful for providing services to other runnables or providing + // debugging-support tools like SSH servers. + // + // Specifically, background runnables are killed automatically (if they have + // not already exited) a short time after all foreground runnables have + // completed. Even though this is likely to result in a non-zero exit status + // for the background runnable, these automatic kills are not treated as task + // failures. + bool background = 4; + + // By default, after a Runnable fails, no further Runnable are executed. This + // flag indicates that this Runnable must be run even if the Task has already + // failed. This is useful for Runnables that copy output files off of the VM + // or for debugging. + // + // The always_run flag does not override the Task's overall max_run_duration. + // If the max_run_duration has expired then no further Runnables will execute, + // not even always_run Runnables. + bool always_run = 5; + + // Environment variables for this Runnable (overrides variables set for the + // whole Task or TaskGroup). + Environment environment = 7; + + // Timeout for this Runnable. + google.protobuf.Duration timeout = 8; + + // Labels for this Runnable. + map labels = 9; +} + +// Spec of a task +message TaskSpec { + // Required. The sequence of one or more runnables (executable scripts, + // executable containers, and/or barriers) for each task in this task group to + // run. Each task runs this list of runnables in order. For a task to succeed, + // all of its script and container runnables each must meet at least one of + // the following conditions: + // + // + The runnable exited with a zero status. + // + The runnable didn't finish, but you enabled its `background` subfield. + // + The runnable exited with a non-zero status, but you enabled its + // `ignore_exit_status` subfield. + repeated Runnable runnables = 8; + + // ComputeResource requirements. + ComputeResource compute_resource = 3; + + // Maximum duration the task should run before being automatically retried + // (if enabled) or automatically failed. Format the value of this field + // as a time limit in seconds followed by `s`—for example, `3600s` + // for 1 hour. The field accepts any value between 0 and the maximum listed + // for the `Duration` field type at + // https://protobuf.dev/reference/protobuf/google.protobuf/#duration; however, + // the actual maximum run time for a job will be limited to the maximum run + // time for a job listed at + // https://cloud.google.com/batch/quotas#max-job-duration. + google.protobuf.Duration max_run_duration = 4; + + // Maximum number of retries on failures. + // The default, 0, which means never retry. + // The valid value range is [0, 10]. + int32 max_retry_count = 5; + + // Lifecycle management schema when any task in a task group is failed. + // Currently we only support one lifecycle policy. + // When the lifecycle policy condition is met, + // the action in the policy will execute. + // If task execution result does not meet with the defined lifecycle + // policy, we consider it as the default policy. + // Default policy means if the exit code is 0, exit task. + // If task ends with non-zero exit code, retry the task with max_retry_count. + repeated LifecyclePolicy lifecycle_policies = 9; + + // Deprecated: please use environment(non-plural) instead. + map environments = 6 [deprecated = true]; + + // Volumes to mount before running Tasks using this TaskSpec. + repeated Volume volumes = 7; + + // Environment variables to set before running the Task. + Environment environment = 10; +} + +// LifecyclePolicy describes how to deal with task failures +// based on different conditions. +message LifecyclePolicy { + // Conditions for actions to deal with task failures. + message ActionCondition { + // Exit codes of a task execution. + // If there are more than 1 exit codes, + // when task executes with any of the exit code in the list, + // the condition is met and the action will be executed. + repeated int32 exit_codes = 1; + } + + // Action on task failures based on different conditions. + enum Action { + // Action unspecified. + ACTION_UNSPECIFIED = 0; + + // Action that tasks in the group will be scheduled to re-execute. + RETRY_TASK = 1; + + // Action that tasks in the group will be stopped immediately. + FAIL_TASK = 2; + } + + // Action to execute when ActionCondition is true. + // When RETRY_TASK is specified, we will retry failed tasks + // if we notice any exit code match and fail tasks if no match is found. + // Likewise, when FAIL_TASK is specified, we will fail tasks + // if we notice any exit code match and retry tasks if no match is found. + Action action = 1; + + // Conditions that decide why a task failure is dealt with a specific action. + ActionCondition action_condition = 2; +} + +// A Cloud Batch task. +message Task { + option (google.api.resource) = { + type: "batch.googleapis.com/Task" + pattern: "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}/tasks/{task}" + }; + + // Task name. + // The name is generated from the parent TaskGroup name and 'id' field. + // For example: + // "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01/tasks/task01". + string name = 1; + + // Task Status. + TaskStatus status = 2; +} + +// An Environment describes a collection of environment variables to set when +// executing Tasks. +message Environment { + message KMSEnvMap { + // The name of the KMS key that will be used to decrypt the cipher text. + string key_name = 1; + + // The value of the cipherText response from the `encrypt` method. + string cipher_text = 2; + } + + // A map of environment variable names to values. + map variables = 1; + + // A map of environment variable names to Secret Manager secret names. + // The VM will access the named secrets to set the value of each environment + // variable. + map secret_variables = 2; + + // An encrypted JSON dictionary where the key/value pairs correspond to + // environment variable names and their values. + KMSEnvMap encrypted_variables = 3; +} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/volume.proto b/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/volume.proto new file mode 100644 index 00000000000..9256ef6faa4 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/volume.proto @@ -0,0 +1,98 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.cloud.batch.v1alpha; + +option csharp_namespace = "Google.Cloud.Batch.V1Alpha"; +option go_package = "cloud.google.com/go/batch/apiv1alpha/batchpb;batchpb"; +option java_multiple_files = true; +option java_outer_classname = "VolumeProto"; +option java_package = "com.google.cloud.batch.v1alpha"; +option objc_class_prefix = "GCB"; +option php_namespace = "Google\\Cloud\\Batch\\V1alpha"; +option ruby_package = "Google::Cloud::Batch::V1alpha"; + +// Volume describes a volume and parameters for it to be mounted to a VM. +message Volume { + // The source for the volume. + oneof source { + // A Network File System (NFS) volume. For example, a + // Filestore file share. + NFS nfs = 1; + + // Deprecated: please use device_name instead. + PD pd = 2 [deprecated = true]; + + // A Google Cloud Storage (GCS) volume. + GCS gcs = 3; + + // Device name of an attached disk volume, which should align with a + // device_name specified by + // job.allocation_policy.instances[0].policy.disks[i].device_name or + // defined by the given instance template in + // job.allocation_policy.instances[0].instance_template. + string device_name = 6; + } + + // The mount path for the volume, e.g. /mnt/disks/share. + string mount_path = 4; + + // Mount options vary based on the type of storage volume: + // + // * For a Cloud Storage bucket, all the mount options provided + // by + // the [`gcsfuse` tool](https://cloud.google.com/storage/docs/gcsfuse-cli) + // are supported. + // * For an existing persistent disk, all mount options provided by the + // [`mount` command](https://man7.org/linux/man-pages/man8/mount.8.html) + // except writing are supported. This is due to restrictions of + // [multi-writer + // mode](https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms). + // * For any other disk or a Network File System (NFS), all the + // mount options provided by the `mount` command are supported. + repeated string mount_options = 5; +} + +// Represents an NFS volume. +message NFS { + // The IP address of the NFS. + string server = 1; + + // Remote source path exported from the NFS, e.g., "/share". + string remote_path = 2; +} + +// Deprecated: please use device_name instead. +message PD { + // PD disk name, e.g. pd-1. + string disk = 1; + + // PD device name, e.g. persistent-disk-1. + string device = 2; + + // Whether this is an existing PD. Default is false. If false, i.e., new + // PD, we will format it into ext4 and mount to the given path. If true, i.e., + // existing PD, it should be in ext4 format and we will mount it to the given + // path. + bool existing = 3 [deprecated = true]; +} + +// Represents a Google Cloud Storage volume. +message GCS { + // Remote path, either a bucket name or a subdirectory of a bucket, e.g.: + // bucket_name, bucket_name/subdirectory/ + string remote_path = 1; +} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.d.ts b/owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.d.ts new file mode 100644 index 00000000000..b3108d65ff9 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.d.ts @@ -0,0 +1,16145 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace batch. */ + namespace batch { + + /** Namespace v1alpha. */ + namespace v1alpha { + + /** Represents a BatchService */ + class BatchService extends $protobuf.rpc.Service { + + /** + * Constructs a new BatchService 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 BatchService 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): BatchService; + + /** + * Calls CreateJob. + * @param request CreateJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Job + */ + public createJob(request: google.cloud.batch.v1alpha.ICreateJobRequest, callback: google.cloud.batch.v1alpha.BatchService.CreateJobCallback): void; + + /** + * Calls CreateJob. + * @param request CreateJobRequest message or plain object + * @returns Promise + */ + public createJob(request: google.cloud.batch.v1alpha.ICreateJobRequest): Promise; + + /** + * Calls GetJob. + * @param request GetJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Job + */ + public getJob(request: google.cloud.batch.v1alpha.IGetJobRequest, callback: google.cloud.batch.v1alpha.BatchService.GetJobCallback): void; + + /** + * Calls GetJob. + * @param request GetJobRequest message or plain object + * @returns Promise + */ + public getJob(request: google.cloud.batch.v1alpha.IGetJobRequest): Promise; + + /** + * Calls DeleteJob. + * @param request DeleteJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteJob(request: google.cloud.batch.v1alpha.IDeleteJobRequest, callback: google.cloud.batch.v1alpha.BatchService.DeleteJobCallback): void; + + /** + * Calls DeleteJob. + * @param request DeleteJobRequest message or plain object + * @returns Promise + */ + public deleteJob(request: google.cloud.batch.v1alpha.IDeleteJobRequest): Promise; + + /** + * Calls CancelJob. + * @param request CancelJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public cancelJob(request: google.cloud.batch.v1alpha.ICancelJobRequest, callback: google.cloud.batch.v1alpha.BatchService.CancelJobCallback): void; + + /** + * Calls CancelJob. + * @param request CancelJobRequest message or plain object + * @returns Promise + */ + public cancelJob(request: google.cloud.batch.v1alpha.ICancelJobRequest): Promise; + + /** + * Calls UpdateJob. + * @param request UpdateJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Job + */ + public updateJob(request: google.cloud.batch.v1alpha.IUpdateJobRequest, callback: google.cloud.batch.v1alpha.BatchService.UpdateJobCallback): void; + + /** + * Calls UpdateJob. + * @param request UpdateJobRequest message or plain object + * @returns Promise + */ + public updateJob(request: google.cloud.batch.v1alpha.IUpdateJobRequest): Promise; + + /** + * Calls ListJobs. + * @param request ListJobsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListJobsResponse + */ + public listJobs(request: google.cloud.batch.v1alpha.IListJobsRequest, callback: google.cloud.batch.v1alpha.BatchService.ListJobsCallback): void; + + /** + * Calls ListJobs. + * @param request ListJobsRequest message or plain object + * @returns Promise + */ + public listJobs(request: google.cloud.batch.v1alpha.IListJobsRequest): Promise; + + /** + * Calls GetTask. + * @param request GetTaskRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Task + */ + public getTask(request: google.cloud.batch.v1alpha.IGetTaskRequest, callback: google.cloud.batch.v1alpha.BatchService.GetTaskCallback): void; + + /** + * Calls GetTask. + * @param request GetTaskRequest message or plain object + * @returns Promise + */ + public getTask(request: google.cloud.batch.v1alpha.IGetTaskRequest): Promise; + + /** + * Calls ListTasks. + * @param request ListTasksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTasksResponse + */ + public listTasks(request: google.cloud.batch.v1alpha.IListTasksRequest, callback: google.cloud.batch.v1alpha.BatchService.ListTasksCallback): void; + + /** + * Calls ListTasks. + * @param request ListTasksRequest message or plain object + * @returns Promise + */ + public listTasks(request: google.cloud.batch.v1alpha.IListTasksRequest): Promise; + + /** + * Calls CreateResourceAllowance. + * @param request CreateResourceAllowanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ResourceAllowance + */ + public createResourceAllowance(request: google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest, callback: google.cloud.batch.v1alpha.BatchService.CreateResourceAllowanceCallback): void; + + /** + * Calls CreateResourceAllowance. + * @param request CreateResourceAllowanceRequest message or plain object + * @returns Promise + */ + public createResourceAllowance(request: google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest): Promise; + + /** + * Calls GetResourceAllowance. + * @param request GetResourceAllowanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ResourceAllowance + */ + public getResourceAllowance(request: google.cloud.batch.v1alpha.IGetResourceAllowanceRequest, callback: google.cloud.batch.v1alpha.BatchService.GetResourceAllowanceCallback): void; + + /** + * Calls GetResourceAllowance. + * @param request GetResourceAllowanceRequest message or plain object + * @returns Promise + */ + public getResourceAllowance(request: google.cloud.batch.v1alpha.IGetResourceAllowanceRequest): Promise; + + /** + * Calls DeleteResourceAllowance. + * @param request DeleteResourceAllowanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteResourceAllowance(request: google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest, callback: google.cloud.batch.v1alpha.BatchService.DeleteResourceAllowanceCallback): void; + + /** + * Calls DeleteResourceAllowance. + * @param request DeleteResourceAllowanceRequest message or plain object + * @returns Promise + */ + public deleteResourceAllowance(request: google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest): Promise; + + /** + * Calls ListResourceAllowances. + * @param request ListResourceAllowancesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListResourceAllowancesResponse + */ + public listResourceAllowances(request: google.cloud.batch.v1alpha.IListResourceAllowancesRequest, callback: google.cloud.batch.v1alpha.BatchService.ListResourceAllowancesCallback): void; + + /** + * Calls ListResourceAllowances. + * @param request ListResourceAllowancesRequest message or plain object + * @returns Promise + */ + public listResourceAllowances(request: google.cloud.batch.v1alpha.IListResourceAllowancesRequest): Promise; + + /** + * Calls UpdateResourceAllowance. + * @param request UpdateResourceAllowanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ResourceAllowance + */ + public updateResourceAllowance(request: google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest, callback: google.cloud.batch.v1alpha.BatchService.UpdateResourceAllowanceCallback): void; + + /** + * Calls UpdateResourceAllowance. + * @param request UpdateResourceAllowanceRequest message or plain object + * @returns Promise + */ + public updateResourceAllowance(request: google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest): Promise; + } + + namespace BatchService { + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|createJob}. + * @param error Error, if any + * @param [response] Job + */ + type CreateJobCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.Job) => void; + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|getJob}. + * @param error Error, if any + * @param [response] Job + */ + type GetJobCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.Job) => void; + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|deleteJob}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|cancelJob}. + * @param error Error, if any + * @param [response] Operation + */ + type CancelJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|updateJob}. + * @param error Error, if any + * @param [response] Job + */ + type UpdateJobCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.Job) => void; + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|listJobs}. + * @param error Error, if any + * @param [response] ListJobsResponse + */ + type ListJobsCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.ListJobsResponse) => void; + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|getTask}. + * @param error Error, if any + * @param [response] Task + */ + type GetTaskCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.Task) => void; + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|listTasks}. + * @param error Error, if any + * @param [response] ListTasksResponse + */ + type ListTasksCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.ListTasksResponse) => void; + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|createResourceAllowance}. + * @param error Error, if any + * @param [response] ResourceAllowance + */ + type CreateResourceAllowanceCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.ResourceAllowance) => void; + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|getResourceAllowance}. + * @param error Error, if any + * @param [response] ResourceAllowance + */ + type GetResourceAllowanceCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.ResourceAllowance) => void; + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|deleteResourceAllowance}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteResourceAllowanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|listResourceAllowances}. + * @param error Error, if any + * @param [response] ListResourceAllowancesResponse + */ + type ListResourceAllowancesCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.ListResourceAllowancesResponse) => void; + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|updateResourceAllowance}. + * @param error Error, if any + * @param [response] ResourceAllowance + */ + type UpdateResourceAllowanceCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.ResourceAllowance) => void; + } + + /** Properties of a CreateJobRequest. */ + interface ICreateJobRequest { + + /** CreateJobRequest parent */ + parent?: (string|null); + + /** CreateJobRequest jobId */ + jobId?: (string|null); + + /** CreateJobRequest job */ + job?: (google.cloud.batch.v1alpha.IJob|null); + + /** CreateJobRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateJobRequest. */ + class CreateJobRequest implements ICreateJobRequest { + + /** + * Constructs a new CreateJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.ICreateJobRequest); + + /** CreateJobRequest parent. */ + public parent: string; + + /** CreateJobRequest jobId. */ + public jobId: string; + + /** CreateJobRequest job. */ + public job?: (google.cloud.batch.v1alpha.IJob|null); + + /** CreateJobRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateJobRequest instance + */ + public static create(properties?: google.cloud.batch.v1alpha.ICreateJobRequest): google.cloud.batch.v1alpha.CreateJobRequest; + + /** + * Encodes the specified CreateJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.CreateJobRequest.verify|verify} messages. + * @param message CreateJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.ICreateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.CreateJobRequest.verify|verify} messages. + * @param message CreateJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.ICreateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.CreateJobRequest; + + /** + * Decodes a CreateJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.CreateJobRequest; + + /** + * Verifies a CreateJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.CreateJobRequest; + + /** + * Creates a plain object from a CreateJobRequest message. Also converts values to other types if specified. + * @param message CreateJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.CreateJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetJobRequest. */ + interface IGetJobRequest { + + /** GetJobRequest name */ + name?: (string|null); + } + + /** Represents a GetJobRequest. */ + class GetJobRequest implements IGetJobRequest { + + /** + * Constructs a new GetJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IGetJobRequest); + + /** GetJobRequest name. */ + public name: string; + + /** + * Creates a new GetJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetJobRequest instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IGetJobRequest): google.cloud.batch.v1alpha.GetJobRequest; + + /** + * Encodes the specified GetJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.GetJobRequest.verify|verify} messages. + * @param message GetJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IGetJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.GetJobRequest.verify|verify} messages. + * @param message GetJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IGetJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.GetJobRequest; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.GetJobRequest; + + /** + * Verifies a GetJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.GetJobRequest; + + /** + * Creates a plain object from a GetJobRequest message. Also converts values to other types if specified. + * @param message GetJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.GetJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteJobRequest. */ + interface IDeleteJobRequest { + + /** DeleteJobRequest name */ + name?: (string|null); + + /** DeleteJobRequest reason */ + reason?: (string|null); + + /** DeleteJobRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteJobRequest. */ + class DeleteJobRequest implements IDeleteJobRequest { + + /** + * Constructs a new DeleteJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IDeleteJobRequest); + + /** DeleteJobRequest name. */ + public name: string; + + /** DeleteJobRequest reason. */ + public reason: string; + + /** DeleteJobRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteJobRequest instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IDeleteJobRequest): google.cloud.batch.v1alpha.DeleteJobRequest; + + /** + * Encodes the specified DeleteJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.DeleteJobRequest.verify|verify} messages. + * @param message DeleteJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IDeleteJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.DeleteJobRequest.verify|verify} messages. + * @param message DeleteJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IDeleteJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.DeleteJobRequest; + + /** + * Decodes a DeleteJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.DeleteJobRequest; + + /** + * Verifies a DeleteJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.DeleteJobRequest; + + /** + * Creates a plain object from a DeleteJobRequest message. Also converts values to other types if specified. + * @param message DeleteJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.DeleteJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelJobRequest. */ + interface ICancelJobRequest { + + /** CancelJobRequest name */ + name?: (string|null); + + /** CancelJobRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CancelJobRequest. */ + class CancelJobRequest implements ICancelJobRequest { + + /** + * Constructs a new CancelJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.ICancelJobRequest); + + /** CancelJobRequest name. */ + public name: string; + + /** CancelJobRequest requestId. */ + public requestId: string; + + /** + * Creates a new CancelJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelJobRequest instance + */ + public static create(properties?: google.cloud.batch.v1alpha.ICancelJobRequest): google.cloud.batch.v1alpha.CancelJobRequest; + + /** + * Encodes the specified CancelJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.CancelJobRequest.verify|verify} messages. + * @param message CancelJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.ICancelJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.CancelJobRequest.verify|verify} messages. + * @param message CancelJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.ICancelJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.CancelJobRequest; + + /** + * Decodes a CancelJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.CancelJobRequest; + + /** + * Verifies a CancelJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.CancelJobRequest; + + /** + * Creates a plain object from a CancelJobRequest message. Also converts values to other types if specified. + * @param message CancelJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.CancelJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelJobResponse. */ + interface ICancelJobResponse { + } + + /** Represents a CancelJobResponse. */ + class CancelJobResponse implements ICancelJobResponse { + + /** + * Constructs a new CancelJobResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.ICancelJobResponse); + + /** + * Creates a new CancelJobResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelJobResponse instance + */ + public static create(properties?: google.cloud.batch.v1alpha.ICancelJobResponse): google.cloud.batch.v1alpha.CancelJobResponse; + + /** + * Encodes the specified CancelJobResponse message. Does not implicitly {@link google.cloud.batch.v1alpha.CancelJobResponse.verify|verify} messages. + * @param message CancelJobResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.ICancelJobResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelJobResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.CancelJobResponse.verify|verify} messages. + * @param message CancelJobResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.ICancelJobResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelJobResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelJobResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.CancelJobResponse; + + /** + * Decodes a CancelJobResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelJobResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.CancelJobResponse; + + /** + * Verifies a CancelJobResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelJobResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelJobResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.CancelJobResponse; + + /** + * Creates a plain object from a CancelJobResponse message. Also converts values to other types if specified. + * @param message CancelJobResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.CancelJobResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelJobResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelJobResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateJobRequest. */ + interface IUpdateJobRequest { + + /** UpdateJobRequest job */ + job?: (google.cloud.batch.v1alpha.IJob|null); + + /** UpdateJobRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateJobRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateJobRequest. */ + class UpdateJobRequest implements IUpdateJobRequest { + + /** + * Constructs a new UpdateJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IUpdateJobRequest); + + /** UpdateJobRequest job. */ + public job?: (google.cloud.batch.v1alpha.IJob|null); + + /** UpdateJobRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateJobRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateJobRequest instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IUpdateJobRequest): google.cloud.batch.v1alpha.UpdateJobRequest; + + /** + * Encodes the specified UpdateJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.UpdateJobRequest.verify|verify} messages. + * @param message UpdateJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IUpdateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UpdateJobRequest.verify|verify} messages. + * @param message UpdateJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IUpdateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.UpdateJobRequest; + + /** + * Decodes an UpdateJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.UpdateJobRequest; + + /** + * Verifies an UpdateJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.UpdateJobRequest; + + /** + * Creates a plain object from an UpdateJobRequest message. Also converts values to other types if specified. + * @param message UpdateJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.UpdateJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListJobsRequest. */ + interface IListJobsRequest { + + /** ListJobsRequest parent */ + parent?: (string|null); + + /** ListJobsRequest filter */ + filter?: (string|null); + + /** ListJobsRequest orderBy */ + orderBy?: (string|null); + + /** ListJobsRequest pageSize */ + pageSize?: (number|null); + + /** ListJobsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListJobsRequest. */ + class ListJobsRequest implements IListJobsRequest { + + /** + * Constructs a new ListJobsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IListJobsRequest); + + /** ListJobsRequest parent. */ + public parent: string; + + /** ListJobsRequest filter. */ + public filter: string; + + /** ListJobsRequest orderBy. */ + public orderBy: string; + + /** ListJobsRequest pageSize. */ + public pageSize: number; + + /** ListJobsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListJobsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListJobsRequest instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IListJobsRequest): google.cloud.batch.v1alpha.ListJobsRequest; + + /** + * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.ListJobsRequest.verify|verify} messages. + * @param message ListJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IListJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListJobsRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListJobsRequest.verify|verify} messages. + * @param message ListJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IListJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ListJobsRequest; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ListJobsRequest; + + /** + * Verifies a ListJobsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListJobsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListJobsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ListJobsRequest; + + /** + * Creates a plain object from a ListJobsRequest message. Also converts values to other types if specified. + * @param message ListJobsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.ListJobsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListJobsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListJobsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListJobsResponse. */ + interface IListJobsResponse { + + /** ListJobsResponse jobs */ + jobs?: (google.cloud.batch.v1alpha.IJob[]|null); + + /** ListJobsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListJobsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListJobsResponse. */ + class ListJobsResponse implements IListJobsResponse { + + /** + * Constructs a new ListJobsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IListJobsResponse); + + /** ListJobsResponse jobs. */ + public jobs: google.cloud.batch.v1alpha.IJob[]; + + /** ListJobsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListJobsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListJobsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListJobsResponse instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IListJobsResponse): google.cloud.batch.v1alpha.ListJobsResponse; + + /** + * Encodes the specified ListJobsResponse message. Does not implicitly {@link google.cloud.batch.v1alpha.ListJobsResponse.verify|verify} messages. + * @param message ListJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IListJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListJobsResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListJobsResponse.verify|verify} messages. + * @param message ListJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IListJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ListJobsResponse; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ListJobsResponse; + + /** + * Verifies a ListJobsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListJobsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListJobsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ListJobsResponse; + + /** + * Creates a plain object from a ListJobsResponse message. Also converts values to other types if specified. + * @param message ListJobsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.ListJobsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListJobsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListJobsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTasksRequest. */ + interface IListTasksRequest { + + /** ListTasksRequest parent */ + parent?: (string|null); + + /** ListTasksRequest filter */ + filter?: (string|null); + + /** ListTasksRequest orderBy */ + orderBy?: (string|null); + + /** ListTasksRequest pageSize */ + pageSize?: (number|null); + + /** ListTasksRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListTasksRequest. */ + class ListTasksRequest implements IListTasksRequest { + + /** + * Constructs a new ListTasksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IListTasksRequest); + + /** ListTasksRequest parent. */ + public parent: string; + + /** ListTasksRequest filter. */ + public filter: string; + + /** ListTasksRequest orderBy. */ + public orderBy: string; + + /** ListTasksRequest pageSize. */ + public pageSize: number; + + /** ListTasksRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListTasksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTasksRequest instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IListTasksRequest): google.cloud.batch.v1alpha.ListTasksRequest; + + /** + * Encodes the specified ListTasksRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.ListTasksRequest.verify|verify} messages. + * @param message ListTasksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IListTasksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTasksRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListTasksRequest.verify|verify} messages. + * @param message ListTasksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IListTasksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTasksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTasksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ListTasksRequest; + + /** + * Decodes a ListTasksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTasksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ListTasksRequest; + + /** + * Verifies a ListTasksRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTasksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTasksRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ListTasksRequest; + + /** + * Creates a plain object from a ListTasksRequest message. Also converts values to other types if specified. + * @param message ListTasksRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.ListTasksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTasksRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTasksRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTasksResponse. */ + interface IListTasksResponse { + + /** ListTasksResponse tasks */ + tasks?: (google.cloud.batch.v1alpha.ITask[]|null); + + /** ListTasksResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListTasksResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListTasksResponse. */ + class ListTasksResponse implements IListTasksResponse { + + /** + * Constructs a new ListTasksResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IListTasksResponse); + + /** ListTasksResponse tasks. */ + public tasks: google.cloud.batch.v1alpha.ITask[]; + + /** ListTasksResponse nextPageToken. */ + public nextPageToken: string; + + /** ListTasksResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListTasksResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTasksResponse instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IListTasksResponse): google.cloud.batch.v1alpha.ListTasksResponse; + + /** + * Encodes the specified ListTasksResponse message. Does not implicitly {@link google.cloud.batch.v1alpha.ListTasksResponse.verify|verify} messages. + * @param message ListTasksResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IListTasksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTasksResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListTasksResponse.verify|verify} messages. + * @param message ListTasksResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IListTasksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTasksResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTasksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ListTasksResponse; + + /** + * Decodes a ListTasksResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTasksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ListTasksResponse; + + /** + * Verifies a ListTasksResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTasksResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTasksResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ListTasksResponse; + + /** + * Creates a plain object from a ListTasksResponse message. Also converts values to other types if specified. + * @param message ListTasksResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.ListTasksResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTasksResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTasksResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTaskRequest. */ + interface IGetTaskRequest { + + /** GetTaskRequest name */ + name?: (string|null); + } + + /** Represents a GetTaskRequest. */ + class GetTaskRequest implements IGetTaskRequest { + + /** + * Constructs a new GetTaskRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IGetTaskRequest); + + /** GetTaskRequest name. */ + public name: string; + + /** + * Creates a new GetTaskRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTaskRequest instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IGetTaskRequest): google.cloud.batch.v1alpha.GetTaskRequest; + + /** + * Encodes the specified GetTaskRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.GetTaskRequest.verify|verify} messages. + * @param message GetTaskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IGetTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTaskRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.GetTaskRequest.verify|verify} messages. + * @param message GetTaskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IGetTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTaskRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTaskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.GetTaskRequest; + + /** + * Decodes a GetTaskRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTaskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.GetTaskRequest; + + /** + * Verifies a GetTaskRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTaskRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTaskRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.GetTaskRequest; + + /** + * Creates a plain object from a GetTaskRequest message. Also converts values to other types if specified. + * @param message GetTaskRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.GetTaskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTaskRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTaskRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateResourceAllowanceRequest. */ + interface ICreateResourceAllowanceRequest { + + /** CreateResourceAllowanceRequest parent */ + parent?: (string|null); + + /** CreateResourceAllowanceRequest resourceAllowanceId */ + resourceAllowanceId?: (string|null); + + /** CreateResourceAllowanceRequest resourceAllowance */ + resourceAllowance?: (google.cloud.batch.v1alpha.IResourceAllowance|null); + + /** CreateResourceAllowanceRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateResourceAllowanceRequest. */ + class CreateResourceAllowanceRequest implements ICreateResourceAllowanceRequest { + + /** + * Constructs a new CreateResourceAllowanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest); + + /** CreateResourceAllowanceRequest parent. */ + public parent: string; + + /** CreateResourceAllowanceRequest resourceAllowanceId. */ + public resourceAllowanceId: string; + + /** CreateResourceAllowanceRequest resourceAllowance. */ + public resourceAllowance?: (google.cloud.batch.v1alpha.IResourceAllowance|null); + + /** CreateResourceAllowanceRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateResourceAllowanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateResourceAllowanceRequest instance + */ + public static create(properties?: google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest): google.cloud.batch.v1alpha.CreateResourceAllowanceRequest; + + /** + * Encodes the specified CreateResourceAllowanceRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.CreateResourceAllowanceRequest.verify|verify} messages. + * @param message CreateResourceAllowanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateResourceAllowanceRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.CreateResourceAllowanceRequest.verify|verify} messages. + * @param message CreateResourceAllowanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateResourceAllowanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateResourceAllowanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.CreateResourceAllowanceRequest; + + /** + * Decodes a CreateResourceAllowanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateResourceAllowanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.CreateResourceAllowanceRequest; + + /** + * Verifies a CreateResourceAllowanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateResourceAllowanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateResourceAllowanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.CreateResourceAllowanceRequest; + + /** + * Creates a plain object from a CreateResourceAllowanceRequest message. Also converts values to other types if specified. + * @param message CreateResourceAllowanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.CreateResourceAllowanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateResourceAllowanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateResourceAllowanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetResourceAllowanceRequest. */ + interface IGetResourceAllowanceRequest { + + /** GetResourceAllowanceRequest name */ + name?: (string|null); + } + + /** Represents a GetResourceAllowanceRequest. */ + class GetResourceAllowanceRequest implements IGetResourceAllowanceRequest { + + /** + * Constructs a new GetResourceAllowanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IGetResourceAllowanceRequest); + + /** GetResourceAllowanceRequest name. */ + public name: string; + + /** + * Creates a new GetResourceAllowanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetResourceAllowanceRequest instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IGetResourceAllowanceRequest): google.cloud.batch.v1alpha.GetResourceAllowanceRequest; + + /** + * Encodes the specified GetResourceAllowanceRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.GetResourceAllowanceRequest.verify|verify} messages. + * @param message GetResourceAllowanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IGetResourceAllowanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetResourceAllowanceRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.GetResourceAllowanceRequest.verify|verify} messages. + * @param message GetResourceAllowanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IGetResourceAllowanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetResourceAllowanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetResourceAllowanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.GetResourceAllowanceRequest; + + /** + * Decodes a GetResourceAllowanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetResourceAllowanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.GetResourceAllowanceRequest; + + /** + * Verifies a GetResourceAllowanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetResourceAllowanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetResourceAllowanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.GetResourceAllowanceRequest; + + /** + * Creates a plain object from a GetResourceAllowanceRequest message. Also converts values to other types if specified. + * @param message GetResourceAllowanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.GetResourceAllowanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetResourceAllowanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetResourceAllowanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteResourceAllowanceRequest. */ + interface IDeleteResourceAllowanceRequest { + + /** DeleteResourceAllowanceRequest name */ + name?: (string|null); + + /** DeleteResourceAllowanceRequest reason */ + reason?: (string|null); + + /** DeleteResourceAllowanceRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteResourceAllowanceRequest. */ + class DeleteResourceAllowanceRequest implements IDeleteResourceAllowanceRequest { + + /** + * Constructs a new DeleteResourceAllowanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest); + + /** DeleteResourceAllowanceRequest name. */ + public name: string; + + /** DeleteResourceAllowanceRequest reason. */ + public reason: string; + + /** DeleteResourceAllowanceRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteResourceAllowanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteResourceAllowanceRequest instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest): google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest; + + /** + * Encodes the specified DeleteResourceAllowanceRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest.verify|verify} messages. + * @param message DeleteResourceAllowanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteResourceAllowanceRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest.verify|verify} messages. + * @param message DeleteResourceAllowanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteResourceAllowanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteResourceAllowanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest; + + /** + * Decodes a DeleteResourceAllowanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteResourceAllowanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest; + + /** + * Verifies a DeleteResourceAllowanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteResourceAllowanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteResourceAllowanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest; + + /** + * Creates a plain object from a DeleteResourceAllowanceRequest message. Also converts values to other types if specified. + * @param message DeleteResourceAllowanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteResourceAllowanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteResourceAllowanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListResourceAllowancesRequest. */ + interface IListResourceAllowancesRequest { + + /** ListResourceAllowancesRequest parent */ + parent?: (string|null); + + /** ListResourceAllowancesRequest pageSize */ + pageSize?: (number|null); + + /** ListResourceAllowancesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListResourceAllowancesRequest. */ + class ListResourceAllowancesRequest implements IListResourceAllowancesRequest { + + /** + * Constructs a new ListResourceAllowancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IListResourceAllowancesRequest); + + /** ListResourceAllowancesRequest parent. */ + public parent: string; + + /** ListResourceAllowancesRequest pageSize. */ + public pageSize: number; + + /** ListResourceAllowancesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListResourceAllowancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListResourceAllowancesRequest instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IListResourceAllowancesRequest): google.cloud.batch.v1alpha.ListResourceAllowancesRequest; + + /** + * Encodes the specified ListResourceAllowancesRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.ListResourceAllowancesRequest.verify|verify} messages. + * @param message ListResourceAllowancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IListResourceAllowancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListResourceAllowancesRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListResourceAllowancesRequest.verify|verify} messages. + * @param message ListResourceAllowancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IListResourceAllowancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListResourceAllowancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListResourceAllowancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ListResourceAllowancesRequest; + + /** + * Decodes a ListResourceAllowancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListResourceAllowancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ListResourceAllowancesRequest; + + /** + * Verifies a ListResourceAllowancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListResourceAllowancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListResourceAllowancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ListResourceAllowancesRequest; + + /** + * Creates a plain object from a ListResourceAllowancesRequest message. Also converts values to other types if specified. + * @param message ListResourceAllowancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.ListResourceAllowancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListResourceAllowancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListResourceAllowancesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListResourceAllowancesResponse. */ + interface IListResourceAllowancesResponse { + + /** ListResourceAllowancesResponse resourceAllowances */ + resourceAllowances?: (google.cloud.batch.v1alpha.IResourceAllowance[]|null); + + /** ListResourceAllowancesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListResourceAllowancesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListResourceAllowancesResponse. */ + class ListResourceAllowancesResponse implements IListResourceAllowancesResponse { + + /** + * Constructs a new ListResourceAllowancesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IListResourceAllowancesResponse); + + /** ListResourceAllowancesResponse resourceAllowances. */ + public resourceAllowances: google.cloud.batch.v1alpha.IResourceAllowance[]; + + /** ListResourceAllowancesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListResourceAllowancesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListResourceAllowancesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListResourceAllowancesResponse instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IListResourceAllowancesResponse): google.cloud.batch.v1alpha.ListResourceAllowancesResponse; + + /** + * Encodes the specified ListResourceAllowancesResponse message. Does not implicitly {@link google.cloud.batch.v1alpha.ListResourceAllowancesResponse.verify|verify} messages. + * @param message ListResourceAllowancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IListResourceAllowancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListResourceAllowancesResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListResourceAllowancesResponse.verify|verify} messages. + * @param message ListResourceAllowancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IListResourceAllowancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListResourceAllowancesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListResourceAllowancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ListResourceAllowancesResponse; + + /** + * Decodes a ListResourceAllowancesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListResourceAllowancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ListResourceAllowancesResponse; + + /** + * Verifies a ListResourceAllowancesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListResourceAllowancesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListResourceAllowancesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ListResourceAllowancesResponse; + + /** + * Creates a plain object from a ListResourceAllowancesResponse message. Also converts values to other types if specified. + * @param message ListResourceAllowancesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.ListResourceAllowancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListResourceAllowancesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListResourceAllowancesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateResourceAllowanceRequest. */ + interface IUpdateResourceAllowanceRequest { + + /** UpdateResourceAllowanceRequest resourceAllowance */ + resourceAllowance?: (google.cloud.batch.v1alpha.IResourceAllowance|null); + + /** UpdateResourceAllowanceRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateResourceAllowanceRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateResourceAllowanceRequest. */ + class UpdateResourceAllowanceRequest implements IUpdateResourceAllowanceRequest { + + /** + * Constructs a new UpdateResourceAllowanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest); + + /** UpdateResourceAllowanceRequest resourceAllowance. */ + public resourceAllowance?: (google.cloud.batch.v1alpha.IResourceAllowance|null); + + /** UpdateResourceAllowanceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateResourceAllowanceRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateResourceAllowanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateResourceAllowanceRequest instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest): google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest; + + /** + * Encodes the specified UpdateResourceAllowanceRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest.verify|verify} messages. + * @param message UpdateResourceAllowanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateResourceAllowanceRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest.verify|verify} messages. + * @param message UpdateResourceAllowanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateResourceAllowanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateResourceAllowanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest; + + /** + * Decodes an UpdateResourceAllowanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateResourceAllowanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest; + + /** + * Verifies an UpdateResourceAllowanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateResourceAllowanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateResourceAllowanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest; + + /** + * Creates a plain object from an UpdateResourceAllowanceRequest message. Also converts values to other types if specified. + * @param message UpdateResourceAllowanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateResourceAllowanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateResourceAllowanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IOperationMetadata); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target. */ + public target: string; + + /** OperationMetadata verb. */ + public verb: string; + + /** OperationMetadata statusMessage. */ + public statusMessage: string; + + /** OperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IOperationMetadata): google.cloud.batch.v1alpha.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.batch.v1alpha.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.OperationMetadata; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.OperationMetadata; + + /** + * Verifies an OperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.OperationMetadata; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @param message OperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Job. */ + interface IJob { + + /** Job name */ + name?: (string|null); + + /** Job uid */ + uid?: (string|null); + + /** Job priority */ + priority?: (number|Long|string|null); + + /** Job taskGroups */ + taskGroups?: (google.cloud.batch.v1alpha.ITaskGroup[]|null); + + /** Job schedulingPolicy */ + schedulingPolicy?: (google.cloud.batch.v1alpha.Job.SchedulingPolicy|keyof typeof google.cloud.batch.v1alpha.Job.SchedulingPolicy|null); + + /** Job dependencies */ + dependencies?: (google.cloud.batch.v1alpha.IJobDependency[]|null); + + /** Job allocationPolicy */ + allocationPolicy?: (google.cloud.batch.v1alpha.IAllocationPolicy|null); + + /** Job labels */ + labels?: ({ [k: string]: string }|null); + + /** Job status */ + status?: (google.cloud.batch.v1alpha.IJobStatus|null); + + /** Job notification */ + notification?: (google.cloud.batch.v1alpha.IJobNotification|null); + + /** Job createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Job updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Job logsPolicy */ + logsPolicy?: (google.cloud.batch.v1alpha.ILogsPolicy|null); + + /** Job notifications */ + notifications?: (google.cloud.batch.v1alpha.IJobNotification[]|null); + } + + /** Represents a Job. */ + class Job implements IJob { + + /** + * Constructs a new Job. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IJob); + + /** Job name. */ + public name: string; + + /** Job uid. */ + public uid: string; + + /** Job priority. */ + public priority: (number|Long|string); + + /** Job taskGroups. */ + public taskGroups: google.cloud.batch.v1alpha.ITaskGroup[]; + + /** Job schedulingPolicy. */ + public schedulingPolicy: (google.cloud.batch.v1alpha.Job.SchedulingPolicy|keyof typeof google.cloud.batch.v1alpha.Job.SchedulingPolicy); + + /** Job dependencies. */ + public dependencies: google.cloud.batch.v1alpha.IJobDependency[]; + + /** Job allocationPolicy. */ + public allocationPolicy?: (google.cloud.batch.v1alpha.IAllocationPolicy|null); + + /** Job labels. */ + public labels: { [k: string]: string }; + + /** Job status. */ + public status?: (google.cloud.batch.v1alpha.IJobStatus|null); + + /** Job notification. */ + public notification?: (google.cloud.batch.v1alpha.IJobNotification|null); + + /** Job createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Job updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Job logsPolicy. */ + public logsPolicy?: (google.cloud.batch.v1alpha.ILogsPolicy|null); + + /** Job notifications. */ + public notifications: google.cloud.batch.v1alpha.IJobNotification[]; + + /** + * Creates a new Job instance using the specified properties. + * @param [properties] Properties to set + * @returns Job instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IJob): google.cloud.batch.v1alpha.Job; + + /** + * Encodes the specified Job message. Does not implicitly {@link google.cloud.batch.v1alpha.Job.verify|verify} messages. + * @param message Job message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Job.verify|verify} messages. + * @param message Job message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Job message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Job; + + /** + * Decodes a Job message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Job; + + /** + * Verifies a Job message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Job message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Job + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Job; + + /** + * Creates a plain object from a Job message. Also converts values to other types if specified. + * @param message Job + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.Job, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Job to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Job + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Job { + + /** SchedulingPolicy enum. */ + enum SchedulingPolicy { + SCHEDULING_POLICY_UNSPECIFIED = 0, + AS_SOON_AS_POSSIBLE = 1 + } + } + + /** Properties of a LogsPolicy. */ + interface ILogsPolicy { + + /** LogsPolicy destination */ + destination?: (google.cloud.batch.v1alpha.LogsPolicy.Destination|keyof typeof google.cloud.batch.v1alpha.LogsPolicy.Destination|null); + + /** LogsPolicy logsPath */ + logsPath?: (string|null); + + /** LogsPolicy cloudLoggingOption */ + cloudLoggingOption?: (google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption|null); + } + + /** Represents a LogsPolicy. */ + class LogsPolicy implements ILogsPolicy { + + /** + * Constructs a new LogsPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.ILogsPolicy); + + /** LogsPolicy destination. */ + public destination: (google.cloud.batch.v1alpha.LogsPolicy.Destination|keyof typeof google.cloud.batch.v1alpha.LogsPolicy.Destination); + + /** LogsPolicy logsPath. */ + public logsPath: string; + + /** LogsPolicy cloudLoggingOption. */ + public cloudLoggingOption?: (google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption|null); + + /** + * Creates a new LogsPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns LogsPolicy instance + */ + public static create(properties?: google.cloud.batch.v1alpha.ILogsPolicy): google.cloud.batch.v1alpha.LogsPolicy; + + /** + * Encodes the specified LogsPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.LogsPolicy.verify|verify} messages. + * @param message LogsPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.ILogsPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LogsPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.LogsPolicy.verify|verify} messages. + * @param message LogsPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.ILogsPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LogsPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LogsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.LogsPolicy; + + /** + * Decodes a LogsPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LogsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.LogsPolicy; + + /** + * Verifies a LogsPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LogsPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LogsPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.LogsPolicy; + + /** + * Creates a plain object from a LogsPolicy message. Also converts values to other types if specified. + * @param message LogsPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.LogsPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LogsPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LogsPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LogsPolicy { + + /** Properties of a CloudLoggingOption. */ + interface ICloudLoggingOption { + + /** CloudLoggingOption useGenericTaskMonitoredResource */ + useGenericTaskMonitoredResource?: (boolean|null); + } + + /** Represents a CloudLoggingOption. */ + class CloudLoggingOption implements ICloudLoggingOption { + + /** + * Constructs a new CloudLoggingOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption); + + /** CloudLoggingOption useGenericTaskMonitoredResource. */ + public useGenericTaskMonitoredResource: boolean; + + /** + * Creates a new CloudLoggingOption instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudLoggingOption instance + */ + public static create(properties?: google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption): google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption; + + /** + * Encodes the specified CloudLoggingOption message. Does not implicitly {@link google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption.verify|verify} messages. + * @param message CloudLoggingOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudLoggingOption message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption.verify|verify} messages. + * @param message CloudLoggingOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudLoggingOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudLoggingOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption; + + /** + * Decodes a CloudLoggingOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudLoggingOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption; + + /** + * Verifies a CloudLoggingOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudLoggingOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudLoggingOption + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption; + + /** + * Creates a plain object from a CloudLoggingOption message. Also converts values to other types if specified. + * @param message CloudLoggingOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudLoggingOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudLoggingOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Destination enum. */ + enum Destination { + DESTINATION_UNSPECIFIED = 0, + CLOUD_LOGGING = 1, + PATH = 2 + } + } + + /** Properties of a JobDependency. */ + interface IJobDependency { + + /** JobDependency items */ + items?: ({ [k: string]: google.cloud.batch.v1alpha.JobDependency.Type }|null); + } + + /** Represents a JobDependency. */ + class JobDependency implements IJobDependency { + + /** + * Constructs a new JobDependency. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IJobDependency); + + /** JobDependency items. */ + public items: { [k: string]: google.cloud.batch.v1alpha.JobDependency.Type }; + + /** + * Creates a new JobDependency instance using the specified properties. + * @param [properties] Properties to set + * @returns JobDependency instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IJobDependency): google.cloud.batch.v1alpha.JobDependency; + + /** + * Encodes the specified JobDependency message. Does not implicitly {@link google.cloud.batch.v1alpha.JobDependency.verify|verify} messages. + * @param message JobDependency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IJobDependency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobDependency message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobDependency.verify|verify} messages. + * @param message JobDependency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IJobDependency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobDependency message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobDependency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.JobDependency; + + /** + * Decodes a JobDependency message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobDependency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.JobDependency; + + /** + * Verifies a JobDependency message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobDependency message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobDependency + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.JobDependency; + + /** + * Creates a plain object from a JobDependency message. Also converts values to other types if specified. + * @param message JobDependency + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.JobDependency, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobDependency to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobDependency + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace JobDependency { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + SUCCEEDED = 1, + FAILED = 2, + FINISHED = 3 + } + } + + /** Properties of a JobStatus. */ + interface IJobStatus { + + /** JobStatus state */ + state?: (google.cloud.batch.v1alpha.JobStatus.State|keyof typeof google.cloud.batch.v1alpha.JobStatus.State|null); + + /** JobStatus statusEvents */ + statusEvents?: (google.cloud.batch.v1alpha.IStatusEvent[]|null); + + /** JobStatus taskGroups */ + taskGroups?: ({ [k: string]: google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus }|null); + + /** JobStatus runDuration */ + runDuration?: (google.protobuf.IDuration|null); + + /** JobStatus resourceUsage */ + resourceUsage?: (google.cloud.batch.v1alpha.IResourceUsage|null); + } + + /** Represents a JobStatus. */ + class JobStatus implements IJobStatus { + + /** + * Constructs a new JobStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IJobStatus); + + /** JobStatus state. */ + public state: (google.cloud.batch.v1alpha.JobStatus.State|keyof typeof google.cloud.batch.v1alpha.JobStatus.State); + + /** JobStatus statusEvents. */ + public statusEvents: google.cloud.batch.v1alpha.IStatusEvent[]; + + /** JobStatus taskGroups. */ + public taskGroups: { [k: string]: google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus }; + + /** JobStatus runDuration. */ + public runDuration?: (google.protobuf.IDuration|null); + + /** JobStatus resourceUsage. */ + public resourceUsage?: (google.cloud.batch.v1alpha.IResourceUsage|null); + + /** + * Creates a new JobStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns JobStatus instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IJobStatus): google.cloud.batch.v1alpha.JobStatus; + + /** + * Encodes the specified JobStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.verify|verify} messages. + * @param message JobStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IJobStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.verify|verify} messages. + * @param message JobStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IJobStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.JobStatus; + + /** + * Decodes a JobStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.JobStatus; + + /** + * Verifies a JobStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.JobStatus; + + /** + * Creates a plain object from a JobStatus message. Also converts values to other types if specified. + * @param message JobStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.JobStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace JobStatus { + + /** Properties of an InstanceStatus. */ + interface IInstanceStatus { + + /** InstanceStatus machineType */ + machineType?: (string|null); + + /** InstanceStatus provisioningModel */ + provisioningModel?: (google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel|keyof typeof google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel|null); + + /** InstanceStatus taskPack */ + taskPack?: (number|Long|string|null); + + /** InstanceStatus bootDisk */ + bootDisk?: (google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null); + } + + /** Represents an InstanceStatus. */ + class InstanceStatus implements IInstanceStatus { + + /** + * Constructs a new InstanceStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.JobStatus.IInstanceStatus); + + /** InstanceStatus machineType. */ + public machineType: string; + + /** InstanceStatus provisioningModel. */ + public provisioningModel: (google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel|keyof typeof google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel); + + /** InstanceStatus taskPack. */ + public taskPack: (number|Long|string); + + /** InstanceStatus bootDisk. */ + public bootDisk?: (google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null); + + /** + * Creates a new InstanceStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceStatus instance + */ + public static create(properties?: google.cloud.batch.v1alpha.JobStatus.IInstanceStatus): google.cloud.batch.v1alpha.JobStatus.InstanceStatus; + + /** + * Encodes the specified InstanceStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.InstanceStatus.verify|verify} messages. + * @param message InstanceStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.JobStatus.IInstanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.InstanceStatus.verify|verify} messages. + * @param message InstanceStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.JobStatus.IInstanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.JobStatus.InstanceStatus; + + /** + * Decodes an InstanceStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.JobStatus.InstanceStatus; + + /** + * Verifies an InstanceStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.JobStatus.InstanceStatus; + + /** + * Creates a plain object from an InstanceStatus message. Also converts values to other types if specified. + * @param message InstanceStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.JobStatus.InstanceStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstanceStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TaskGroupStatus. */ + interface ITaskGroupStatus { + + /** TaskGroupStatus counts */ + counts?: ({ [k: string]: (number|Long|string) }|null); + + /** TaskGroupStatus instances */ + instances?: (google.cloud.batch.v1alpha.JobStatus.IInstanceStatus[]|null); + } + + /** Represents a TaskGroupStatus. */ + class TaskGroupStatus implements ITaskGroupStatus { + + /** + * Constructs a new TaskGroupStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus); + + /** TaskGroupStatus counts. */ + public counts: { [k: string]: (number|Long|string) }; + + /** TaskGroupStatus instances. */ + public instances: google.cloud.batch.v1alpha.JobStatus.IInstanceStatus[]; + + /** + * Creates a new TaskGroupStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns TaskGroupStatus instance + */ + public static create(properties?: google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus): google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus; + + /** + * Encodes the specified TaskGroupStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.verify|verify} messages. + * @param message TaskGroupStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TaskGroupStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.verify|verify} messages. + * @param message TaskGroupStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TaskGroupStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TaskGroupStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus; + + /** + * Decodes a TaskGroupStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TaskGroupStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus; + + /** + * Verifies a TaskGroupStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TaskGroupStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TaskGroupStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus; + + /** + * Creates a plain object from a TaskGroupStatus message. Also converts values to other types if specified. + * @param message TaskGroupStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TaskGroupStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TaskGroupStatus + * @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, + QUEUED = 1, + SCHEDULED = 2, + RUNNING = 3, + SUCCEEDED = 4, + FAILED = 5, + DELETION_IN_PROGRESS = 6, + CANCELLATION_IN_PROGRESS = 7, + CANCELLED = 8 + } + } + + /** Properties of a ResourceUsage. */ + interface IResourceUsage { + + /** ResourceUsage coreHours */ + coreHours?: (number|null); + } + + /** Represents a ResourceUsage. */ + class ResourceUsage implements IResourceUsage { + + /** + * Constructs a new ResourceUsage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IResourceUsage); + + /** ResourceUsage coreHours. */ + public coreHours: number; + + /** + * Creates a new ResourceUsage instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceUsage instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IResourceUsage): google.cloud.batch.v1alpha.ResourceUsage; + + /** + * Encodes the specified ResourceUsage message. Does not implicitly {@link google.cloud.batch.v1alpha.ResourceUsage.verify|verify} messages. + * @param message ResourceUsage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IResourceUsage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceUsage message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ResourceUsage.verify|verify} messages. + * @param message ResourceUsage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IResourceUsage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceUsage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceUsage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ResourceUsage; + + /** + * Decodes a ResourceUsage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceUsage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ResourceUsage; + + /** + * Verifies a ResourceUsage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceUsage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceUsage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ResourceUsage; + + /** + * Creates a plain object from a ResourceUsage message. Also converts values to other types if specified. + * @param message ResourceUsage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.ResourceUsage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceUsage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceUsage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JobNotification. */ + interface IJobNotification { + + /** JobNotification pubsubTopic */ + pubsubTopic?: (string|null); + + /** JobNotification message */ + message?: (google.cloud.batch.v1alpha.JobNotification.IMessage|null); + } + + /** Represents a JobNotification. */ + class JobNotification implements IJobNotification { + + /** + * Constructs a new JobNotification. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IJobNotification); + + /** JobNotification pubsubTopic. */ + public pubsubTopic: string; + + /** JobNotification message. */ + public message?: (google.cloud.batch.v1alpha.JobNotification.IMessage|null); + + /** + * Creates a new JobNotification instance using the specified properties. + * @param [properties] Properties to set + * @returns JobNotification instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IJobNotification): google.cloud.batch.v1alpha.JobNotification; + + /** + * Encodes the specified JobNotification message. Does not implicitly {@link google.cloud.batch.v1alpha.JobNotification.verify|verify} messages. + * @param message JobNotification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IJobNotification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobNotification message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobNotification.verify|verify} messages. + * @param message JobNotification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IJobNotification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobNotification message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobNotification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.JobNotification; + + /** + * Decodes a JobNotification message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobNotification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.JobNotification; + + /** + * Verifies a JobNotification message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobNotification message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobNotification + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.JobNotification; + + /** + * Creates a plain object from a JobNotification message. Also converts values to other types if specified. + * @param message JobNotification + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.JobNotification, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobNotification to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobNotification + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace JobNotification { + + /** Properties of a Message. */ + interface IMessage { + + /** Message type */ + type?: (google.cloud.batch.v1alpha.JobNotification.Type|keyof typeof google.cloud.batch.v1alpha.JobNotification.Type|null); + + /** Message newJobState */ + newJobState?: (google.cloud.batch.v1alpha.JobStatus.State|keyof typeof google.cloud.batch.v1alpha.JobStatus.State|null); + + /** Message newTaskState */ + newTaskState?: (google.cloud.batch.v1alpha.TaskStatus.State|keyof typeof google.cloud.batch.v1alpha.TaskStatus.State|null); + } + + /** Represents a Message. */ + class Message implements IMessage { + + /** + * Constructs a new Message. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.JobNotification.IMessage); + + /** Message type. */ + public type: (google.cloud.batch.v1alpha.JobNotification.Type|keyof typeof google.cloud.batch.v1alpha.JobNotification.Type); + + /** Message newJobState. */ + public newJobState: (google.cloud.batch.v1alpha.JobStatus.State|keyof typeof google.cloud.batch.v1alpha.JobStatus.State); + + /** Message newTaskState. */ + public newTaskState: (google.cloud.batch.v1alpha.TaskStatus.State|keyof typeof google.cloud.batch.v1alpha.TaskStatus.State); + + /** + * Creates a new Message instance using the specified properties. + * @param [properties] Properties to set + * @returns Message instance + */ + public static create(properties?: google.cloud.batch.v1alpha.JobNotification.IMessage): google.cloud.batch.v1alpha.JobNotification.Message; + + /** + * Encodes the specified Message message. Does not implicitly {@link google.cloud.batch.v1alpha.JobNotification.Message.verify|verify} messages. + * @param message Message message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.JobNotification.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobNotification.Message.verify|verify} messages. + * @param message Message message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.JobNotification.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Message message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.JobNotification.Message; + + /** + * Decodes a Message message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.JobNotification.Message; + + /** + * Verifies a Message message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Message message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Message + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.JobNotification.Message; + + /** + * Creates a plain object from a Message message. Also converts values to other types if specified. + * @param message Message + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.JobNotification.Message, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Message to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Message + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + JOB_STATE_CHANGED = 1, + TASK_STATE_CHANGED = 2 + } + } + + /** Properties of an AllocationPolicy. */ + interface IAllocationPolicy { + + /** AllocationPolicy location */ + location?: (google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy|null); + + /** AllocationPolicy instance */ + instance?: (google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy|null); + + /** AllocationPolicy instances */ + instances?: (google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate[]|null); + + /** AllocationPolicy instanceTemplates */ + instanceTemplates?: (string[]|null); + + /** AllocationPolicy provisioningModels */ + provisioningModels?: (google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel[]|null); + + /** AllocationPolicy serviceAccountEmail */ + serviceAccountEmail?: (string|null); + + /** AllocationPolicy serviceAccount */ + serviceAccount?: (google.cloud.batch.v1alpha.IServiceAccount|null); + + /** AllocationPolicy labels */ + labels?: ({ [k: string]: string }|null); + + /** AllocationPolicy network */ + network?: (google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy|null); + + /** AllocationPolicy placement */ + placement?: (google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy|null); + + /** AllocationPolicy tags */ + tags?: (string[]|null); + } + + /** Represents an AllocationPolicy. */ + class AllocationPolicy implements IAllocationPolicy { + + /** + * Constructs a new AllocationPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IAllocationPolicy); + + /** AllocationPolicy location. */ + public location?: (google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy|null); + + /** AllocationPolicy instance. */ + public instance?: (google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy|null); + + /** AllocationPolicy instances. */ + public instances: google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate[]; + + /** AllocationPolicy instanceTemplates. */ + public instanceTemplates: string[]; + + /** AllocationPolicy provisioningModels. */ + public provisioningModels: google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel[]; + + /** AllocationPolicy serviceAccountEmail. */ + public serviceAccountEmail: string; + + /** AllocationPolicy serviceAccount. */ + public serviceAccount?: (google.cloud.batch.v1alpha.IServiceAccount|null); + + /** AllocationPolicy labels. */ + public labels: { [k: string]: string }; + + /** AllocationPolicy network. */ + public network?: (google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy|null); + + /** AllocationPolicy placement. */ + public placement?: (google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy|null); + + /** AllocationPolicy tags. */ + public tags: string[]; + + /** + * Creates a new AllocationPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns AllocationPolicy instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IAllocationPolicy): google.cloud.batch.v1alpha.AllocationPolicy; + + /** + * Encodes the specified AllocationPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.verify|verify} messages. + * @param message AllocationPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IAllocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AllocationPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.verify|verify} messages. + * @param message AllocationPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IAllocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AllocationPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AllocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy; + + /** + * Decodes an AllocationPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AllocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy; + + /** + * Verifies an AllocationPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AllocationPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AllocationPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy; + + /** + * Creates a plain object from an AllocationPolicy message. Also converts values to other types if specified. + * @param message AllocationPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AllocationPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AllocationPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AllocationPolicy { + + /** Properties of a LocationPolicy. */ + interface ILocationPolicy { + + /** LocationPolicy allowedLocations */ + allowedLocations?: (string[]|null); + + /** LocationPolicy deniedLocations */ + deniedLocations?: (string[]|null); + } + + /** Represents a LocationPolicy. */ + class LocationPolicy implements ILocationPolicy { + + /** + * Constructs a new LocationPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy); + + /** LocationPolicy allowedLocations. */ + public allowedLocations: string[]; + + /** LocationPolicy deniedLocations. */ + public deniedLocations: string[]; + + /** + * Creates a new LocationPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns LocationPolicy instance + */ + public static create(properties?: google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy): google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy; + + /** + * Encodes the specified LocationPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.verify|verify} messages. + * @param message LocationPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocationPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.verify|verify} messages. + * @param message LocationPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocationPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy; + + /** + * Decodes a LocationPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy; + + /** + * Verifies a LocationPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LocationPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocationPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy; + + /** + * Creates a plain object from a LocationPolicy message. Also converts values to other types if specified. + * @param message LocationPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocationPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LocationPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Disk. */ + interface IDisk { + + /** Disk image */ + image?: (string|null); + + /** Disk snapshot */ + snapshot?: (string|null); + + /** Disk type */ + type?: (string|null); + + /** Disk sizeGb */ + sizeGb?: (number|Long|string|null); + + /** Disk diskInterface */ + diskInterface?: (string|null); + } + + /** Represents a Disk. */ + class Disk implements IDisk { + + /** + * Constructs a new Disk. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IDisk); + + /** Disk image. */ + public image?: (string|null); + + /** Disk snapshot. */ + public snapshot?: (string|null); + + /** Disk type. */ + public type: string; + + /** Disk sizeGb. */ + public sizeGb: (number|Long|string); + + /** Disk diskInterface. */ + public diskInterface: string; + + /** Disk dataSource. */ + public dataSource?: ("image"|"snapshot"); + + /** + * Creates a new Disk instance using the specified properties. + * @param [properties] Properties to set + * @returns Disk instance + */ + public static create(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IDisk): google.cloud.batch.v1alpha.AllocationPolicy.Disk; + + /** + * Encodes the specified Disk message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.Disk.verify|verify} messages. + * @param message Disk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.AllocationPolicy.IDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Disk message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.Disk.verify|verify} messages. + * @param message Disk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.AllocationPolicy.IDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Disk message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Disk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy.Disk; + + /** + * Decodes a Disk message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Disk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy.Disk; + + /** + * Verifies a Disk message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Disk message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Disk + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy.Disk; + + /** + * Creates a plain object from a Disk message. Also converts values to other types if specified. + * @param message Disk + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy.Disk, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Disk to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Disk + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AttachedDisk. */ + interface IAttachedDisk { + + /** AttachedDisk newDisk */ + newDisk?: (google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null); + + /** AttachedDisk existingDisk */ + existingDisk?: (string|null); + + /** AttachedDisk deviceName */ + deviceName?: (string|null); + } + + /** Represents an AttachedDisk. */ + class AttachedDisk implements IAttachedDisk { + + /** + * Constructs a new AttachedDisk. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk); + + /** AttachedDisk newDisk. */ + public newDisk?: (google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null); + + /** AttachedDisk existingDisk. */ + public existingDisk?: (string|null); + + /** AttachedDisk deviceName. */ + public deviceName: string; + + /** AttachedDisk attached. */ + public attached?: ("newDisk"|"existingDisk"); + + /** + * Creates a new AttachedDisk instance using the specified properties. + * @param [properties] Properties to set + * @returns AttachedDisk instance + */ + public static create(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk): google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk; + + /** + * Encodes the specified AttachedDisk message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.verify|verify} messages. + * @param message AttachedDisk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttachedDisk message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.verify|verify} messages. + * @param message AttachedDisk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttachedDisk message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttachedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk; + + /** + * Decodes an AttachedDisk message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttachedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk; + + /** + * Verifies an AttachedDisk message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AttachedDisk message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttachedDisk + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk; + + /** + * Creates a plain object from an AttachedDisk message. Also converts values to other types if specified. + * @param message AttachedDisk + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttachedDisk to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AttachedDisk + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Accelerator. */ + interface IAccelerator { + + /** Accelerator type */ + type?: (string|null); + + /** Accelerator count */ + count?: (number|Long|string|null); + + /** Accelerator installGpuDrivers */ + installGpuDrivers?: (boolean|null); + + /** Accelerator driverVersion */ + driverVersion?: (string|null); + } + + /** Represents an Accelerator. */ + class Accelerator implements IAccelerator { + + /** + * Constructs a new Accelerator. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator); + + /** Accelerator type. */ + public type: string; + + /** Accelerator count. */ + public count: (number|Long|string); + + /** Accelerator installGpuDrivers. */ + public installGpuDrivers: boolean; + + /** Accelerator driverVersion. */ + public driverVersion: string; + + /** + * Creates a new Accelerator instance using the specified properties. + * @param [properties] Properties to set + * @returns Accelerator instance + */ + public static create(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator): google.cloud.batch.v1alpha.AllocationPolicy.Accelerator; + + /** + * Encodes the specified Accelerator message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.verify|verify} messages. + * @param message Accelerator message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Accelerator message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.verify|verify} messages. + * @param message Accelerator message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Accelerator message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Accelerator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy.Accelerator; + + /** + * Decodes an Accelerator message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Accelerator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy.Accelerator; + + /** + * Verifies an Accelerator message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Accelerator message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Accelerator + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy.Accelerator; + + /** + * Creates a plain object from an Accelerator message. Also converts values to other types if specified. + * @param message Accelerator + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy.Accelerator, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Accelerator to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Accelerator + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InstancePolicy. */ + interface IInstancePolicy { + + /** InstancePolicy allowedMachineTypes */ + allowedMachineTypes?: (string[]|null); + + /** InstancePolicy machineType */ + machineType?: (string|null); + + /** InstancePolicy minCpuPlatform */ + minCpuPlatform?: (string|null); + + /** InstancePolicy provisioningModel */ + provisioningModel?: (google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel|keyof typeof google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel|null); + + /** InstancePolicy accelerators */ + accelerators?: (google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator[]|null); + + /** InstancePolicy bootDisk */ + bootDisk?: (google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null); + + /** InstancePolicy disks */ + disks?: (google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk[]|null); + + /** InstancePolicy reservation */ + reservation?: (string|null); + } + + /** Represents an InstancePolicy. */ + class InstancePolicy implements IInstancePolicy { + + /** + * Constructs a new InstancePolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy); + + /** InstancePolicy allowedMachineTypes. */ + public allowedMachineTypes: string[]; + + /** InstancePolicy machineType. */ + public machineType: string; + + /** InstancePolicy minCpuPlatform. */ + public minCpuPlatform: string; + + /** InstancePolicy provisioningModel. */ + public provisioningModel: (google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel|keyof typeof google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel); + + /** InstancePolicy accelerators. */ + public accelerators: google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator[]; + + /** InstancePolicy bootDisk. */ + public bootDisk?: (google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null); + + /** InstancePolicy disks. */ + public disks: google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk[]; + + /** InstancePolicy reservation. */ + public reservation: string; + + /** + * Creates a new InstancePolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns InstancePolicy instance + */ + public static create(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy): google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy; + + /** + * Encodes the specified InstancePolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.verify|verify} messages. + * @param message InstancePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstancePolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.verify|verify} messages. + * @param message InstancePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstancePolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstancePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy; + + /** + * Decodes an InstancePolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstancePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy; + + /** + * Verifies an InstancePolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstancePolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstancePolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy; + + /** + * Creates a plain object from an InstancePolicy message. Also converts values to other types if specified. + * @param message InstancePolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstancePolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstancePolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InstancePolicyOrTemplate. */ + interface IInstancePolicyOrTemplate { + + /** InstancePolicyOrTemplate policy */ + policy?: (google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy|null); + + /** InstancePolicyOrTemplate instanceTemplate */ + instanceTemplate?: (string|null); + + /** InstancePolicyOrTemplate installGpuDrivers */ + installGpuDrivers?: (boolean|null); + + /** InstancePolicyOrTemplate installOpsAgent */ + installOpsAgent?: (boolean|null); + + /** InstancePolicyOrTemplate blockProjectSshKeys */ + blockProjectSshKeys?: (boolean|null); + } + + /** Represents an InstancePolicyOrTemplate. */ + class InstancePolicyOrTemplate implements IInstancePolicyOrTemplate { + + /** + * Constructs a new InstancePolicyOrTemplate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate); + + /** InstancePolicyOrTemplate policy. */ + public policy?: (google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy|null); + + /** InstancePolicyOrTemplate instanceTemplate. */ + public instanceTemplate?: (string|null); + + /** InstancePolicyOrTemplate installGpuDrivers. */ + public installGpuDrivers: boolean; + + /** InstancePolicyOrTemplate installOpsAgent. */ + public installOpsAgent: boolean; + + /** InstancePolicyOrTemplate blockProjectSshKeys. */ + public blockProjectSshKeys: boolean; + + /** InstancePolicyOrTemplate policyTemplate. */ + public policyTemplate?: ("policy"|"instanceTemplate"); + + /** + * Creates a new InstancePolicyOrTemplate instance using the specified properties. + * @param [properties] Properties to set + * @returns InstancePolicyOrTemplate instance + */ + public static create(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate): google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate; + + /** + * Encodes the specified InstancePolicyOrTemplate message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.verify|verify} messages. + * @param message InstancePolicyOrTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstancePolicyOrTemplate message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.verify|verify} messages. + * @param message InstancePolicyOrTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstancePolicyOrTemplate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstancePolicyOrTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate; + + /** + * Decodes an InstancePolicyOrTemplate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstancePolicyOrTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate; + + /** + * Verifies an InstancePolicyOrTemplate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstancePolicyOrTemplate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstancePolicyOrTemplate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate; + + /** + * Creates a plain object from an InstancePolicyOrTemplate message. Also converts values to other types if specified. + * @param message InstancePolicyOrTemplate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstancePolicyOrTemplate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstancePolicyOrTemplate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NetworkInterface. */ + interface INetworkInterface { + + /** NetworkInterface network */ + network?: (string|null); + + /** NetworkInterface subnetwork */ + subnetwork?: (string|null); + + /** NetworkInterface noExternalIpAddress */ + noExternalIpAddress?: (boolean|null); + } + + /** Represents a NetworkInterface. */ + class NetworkInterface implements INetworkInterface { + + /** + * Constructs a new NetworkInterface. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface); + + /** NetworkInterface network. */ + public network: string; + + /** NetworkInterface subnetwork. */ + public subnetwork: string; + + /** NetworkInterface noExternalIpAddress. */ + public noExternalIpAddress: boolean; + + /** + * Creates a new NetworkInterface instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkInterface instance + */ + public static create(properties?: google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface): google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface; + + /** + * Encodes the specified NetworkInterface message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.verify|verify} messages. + * @param message NetworkInterface message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkInterface message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.verify|verify} messages. + * @param message NetworkInterface message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface; + + /** + * Verifies a NetworkInterface message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkInterface message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkInterface + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface; + + /** + * Creates a plain object from a NetworkInterface message. Also converts values to other types if specified. + * @param message NetworkInterface + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkInterface to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NetworkInterface + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NetworkPolicy. */ + interface INetworkPolicy { + + /** NetworkPolicy networkInterfaces */ + networkInterfaces?: (google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface[]|null); + } + + /** Represents a NetworkPolicy. */ + class NetworkPolicy implements INetworkPolicy { + + /** + * Constructs a new NetworkPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy); + + /** NetworkPolicy networkInterfaces. */ + public networkInterfaces: google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface[]; + + /** + * Creates a new NetworkPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkPolicy instance + */ + public static create(properties?: google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy): google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy; + + /** + * Encodes the specified NetworkPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.verify|verify} messages. + * @param message NetworkPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.verify|verify} messages. + * @param message NetworkPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy; + + /** + * Decodes a NetworkPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy; + + /** + * Verifies a NetworkPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy; + + /** + * Creates a plain object from a NetworkPolicy message. Also converts values to other types if specified. + * @param message NetworkPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NetworkPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PlacementPolicy. */ + interface IPlacementPolicy { + + /** PlacementPolicy collocation */ + collocation?: (string|null); + + /** PlacementPolicy maxDistance */ + maxDistance?: (number|Long|string|null); + } + + /** Represents a PlacementPolicy. */ + class PlacementPolicy implements IPlacementPolicy { + + /** + * Constructs a new PlacementPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy); + + /** PlacementPolicy collocation. */ + public collocation: string; + + /** PlacementPolicy maxDistance. */ + public maxDistance: (number|Long|string); + + /** + * Creates a new PlacementPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns PlacementPolicy instance + */ + public static create(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy): google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy; + + /** + * Encodes the specified PlacementPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.verify|verify} messages. + * @param message PlacementPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PlacementPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.verify|verify} messages. + * @param message PlacementPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PlacementPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PlacementPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy; + + /** + * Decodes a PlacementPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PlacementPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy; + + /** + * Verifies a PlacementPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PlacementPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PlacementPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy; + + /** + * Creates a plain object from a PlacementPolicy message. Also converts values to other types if specified. + * @param message PlacementPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PlacementPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PlacementPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ProvisioningModel enum. */ + enum ProvisioningModel { + PROVISIONING_MODEL_UNSPECIFIED = 0, + STANDARD = 1, + SPOT = 2, + PREEMPTIBLE = 3 + } + } + + /** Properties of a TaskGroup. */ + interface ITaskGroup { + + /** TaskGroup name */ + name?: (string|null); + + /** TaskGroup taskSpec */ + taskSpec?: (google.cloud.batch.v1alpha.ITaskSpec|null); + + /** TaskGroup taskCount */ + taskCount?: (number|Long|string|null); + + /** TaskGroup parallelism */ + parallelism?: (number|Long|string|null); + + /** TaskGroup schedulingPolicy */ + schedulingPolicy?: (google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy|keyof typeof google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy|null); + + /** TaskGroup allocationPolicy */ + allocationPolicy?: (google.cloud.batch.v1alpha.IAllocationPolicy|null); + + /** TaskGroup labels */ + labels?: ({ [k: string]: string }|null); + + /** TaskGroup taskEnvironments */ + taskEnvironments?: (google.cloud.batch.v1alpha.IEnvironment[]|null); + + /** TaskGroup taskCountPerNode */ + taskCountPerNode?: (number|Long|string|null); + + /** TaskGroup requireHostsFile */ + requireHostsFile?: (boolean|null); + + /** TaskGroup permissiveSsh */ + permissiveSsh?: (boolean|null); + + /** TaskGroup runAsNonRoot */ + runAsNonRoot?: (boolean|null); + + /** TaskGroup serviceAccount */ + serviceAccount?: (google.cloud.batch.v1alpha.IServiceAccount|null); + } + + /** Represents a TaskGroup. */ + class TaskGroup implements ITaskGroup { + + /** + * Constructs a new TaskGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.ITaskGroup); + + /** TaskGroup name. */ + public name: string; + + /** TaskGroup taskSpec. */ + public taskSpec?: (google.cloud.batch.v1alpha.ITaskSpec|null); + + /** TaskGroup taskCount. */ + public taskCount: (number|Long|string); + + /** TaskGroup parallelism. */ + public parallelism: (number|Long|string); + + /** TaskGroup schedulingPolicy. */ + public schedulingPolicy: (google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy|keyof typeof google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy); + + /** TaskGroup allocationPolicy. */ + public allocationPolicy?: (google.cloud.batch.v1alpha.IAllocationPolicy|null); + + /** TaskGroup labels. */ + public labels: { [k: string]: string }; + + /** TaskGroup taskEnvironments. */ + public taskEnvironments: google.cloud.batch.v1alpha.IEnvironment[]; + + /** TaskGroup taskCountPerNode. */ + public taskCountPerNode: (number|Long|string); + + /** TaskGroup requireHostsFile. */ + public requireHostsFile: boolean; + + /** TaskGroup permissiveSsh. */ + public permissiveSsh: boolean; + + /** TaskGroup runAsNonRoot. */ + public runAsNonRoot: boolean; + + /** TaskGroup serviceAccount. */ + public serviceAccount?: (google.cloud.batch.v1alpha.IServiceAccount|null); + + /** + * Creates a new TaskGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns TaskGroup instance + */ + public static create(properties?: google.cloud.batch.v1alpha.ITaskGroup): google.cloud.batch.v1alpha.TaskGroup; + + /** + * Encodes the specified TaskGroup message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskGroup.verify|verify} messages. + * @param message TaskGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.ITaskGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TaskGroup message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskGroup.verify|verify} messages. + * @param message TaskGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.ITaskGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TaskGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TaskGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.TaskGroup; + + /** + * Decodes a TaskGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TaskGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.TaskGroup; + + /** + * Verifies a TaskGroup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TaskGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TaskGroup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.TaskGroup; + + /** + * Creates a plain object from a TaskGroup message. Also converts values to other types if specified. + * @param message TaskGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.TaskGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TaskGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TaskGroup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TaskGroup { + + /** SchedulingPolicy enum. */ + enum SchedulingPolicy { + SCHEDULING_POLICY_UNSPECIFIED = 0, + AS_SOON_AS_POSSIBLE = 1, + IN_ORDER = 2 + } + } + + /** Properties of a ServiceAccount. */ + interface IServiceAccount { + + /** ServiceAccount email */ + email?: (string|null); + + /** ServiceAccount scopes */ + scopes?: (string[]|null); + } + + /** Represents a ServiceAccount. */ + class ServiceAccount implements IServiceAccount { + + /** + * Constructs a new ServiceAccount. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IServiceAccount); + + /** ServiceAccount email. */ + public email: string; + + /** ServiceAccount scopes. */ + public scopes: string[]; + + /** + * Creates a new ServiceAccount instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceAccount instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IServiceAccount): google.cloud.batch.v1alpha.ServiceAccount; + + /** + * Encodes the specified ServiceAccount message. Does not implicitly {@link google.cloud.batch.v1alpha.ServiceAccount.verify|verify} messages. + * @param message ServiceAccount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IServiceAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceAccount message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ServiceAccount.verify|verify} messages. + * @param message ServiceAccount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IServiceAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceAccount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ServiceAccount; + + /** + * Decodes a ServiceAccount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ServiceAccount; + + /** + * Verifies a ServiceAccount message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceAccount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceAccount + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ServiceAccount; + + /** + * Creates a plain object from a ServiceAccount message. Also converts values to other types if specified. + * @param message ServiceAccount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.ServiceAccount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceAccount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceAccount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ComputeResource. */ + interface IComputeResource { + + /** ComputeResource cpuMilli */ + cpuMilli?: (number|Long|string|null); + + /** ComputeResource memoryMib */ + memoryMib?: (number|Long|string|null); + + /** ComputeResource gpuCount */ + gpuCount?: (number|Long|string|null); + + /** ComputeResource bootDiskMib */ + bootDiskMib?: (number|Long|string|null); + } + + /** Represents a ComputeResource. */ + class ComputeResource implements IComputeResource { + + /** + * Constructs a new ComputeResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IComputeResource); + + /** ComputeResource cpuMilli. */ + public cpuMilli: (number|Long|string); + + /** ComputeResource memoryMib. */ + public memoryMib: (number|Long|string); + + /** ComputeResource gpuCount. */ + public gpuCount: (number|Long|string); + + /** ComputeResource bootDiskMib. */ + public bootDiskMib: (number|Long|string); + + /** + * Creates a new ComputeResource instance using the specified properties. + * @param [properties] Properties to set + * @returns ComputeResource instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IComputeResource): google.cloud.batch.v1alpha.ComputeResource; + + /** + * Encodes the specified ComputeResource message. Does not implicitly {@link google.cloud.batch.v1alpha.ComputeResource.verify|verify} messages. + * @param message ComputeResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IComputeResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ComputeResource message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ComputeResource.verify|verify} messages. + * @param message ComputeResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IComputeResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ComputeResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ComputeResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ComputeResource; + + /** + * Decodes a ComputeResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ComputeResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ComputeResource; + + /** + * Verifies a ComputeResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ComputeResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ComputeResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ComputeResource; + + /** + * Creates a plain object from a ComputeResource message. Also converts values to other types if specified. + * @param message ComputeResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.ComputeResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ComputeResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ComputeResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StatusEvent. */ + interface IStatusEvent { + + /** StatusEvent type */ + type?: (string|null); + + /** StatusEvent description */ + description?: (string|null); + + /** StatusEvent eventTime */ + eventTime?: (google.protobuf.ITimestamp|null); + + /** StatusEvent taskExecution */ + taskExecution?: (google.cloud.batch.v1alpha.ITaskExecution|null); + + /** StatusEvent taskState */ + taskState?: (google.cloud.batch.v1alpha.TaskStatus.State|keyof typeof google.cloud.batch.v1alpha.TaskStatus.State|null); + } + + /** Represents a StatusEvent. */ + class StatusEvent implements IStatusEvent { + + /** + * Constructs a new StatusEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IStatusEvent); + + /** StatusEvent type. */ + public type: string; + + /** StatusEvent description. */ + public description: string; + + /** StatusEvent eventTime. */ + public eventTime?: (google.protobuf.ITimestamp|null); + + /** StatusEvent taskExecution. */ + public taskExecution?: (google.cloud.batch.v1alpha.ITaskExecution|null); + + /** StatusEvent taskState. */ + public taskState: (google.cloud.batch.v1alpha.TaskStatus.State|keyof typeof google.cloud.batch.v1alpha.TaskStatus.State); + + /** + * Creates a new StatusEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns StatusEvent instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IStatusEvent): google.cloud.batch.v1alpha.StatusEvent; + + /** + * Encodes the specified StatusEvent message. Does not implicitly {@link google.cloud.batch.v1alpha.StatusEvent.verify|verify} messages. + * @param message StatusEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IStatusEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StatusEvent message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.StatusEvent.verify|verify} messages. + * @param message StatusEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IStatusEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StatusEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StatusEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.StatusEvent; + + /** + * Decodes a StatusEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StatusEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.StatusEvent; + + /** + * Verifies a StatusEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StatusEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StatusEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.StatusEvent; + + /** + * Creates a plain object from a StatusEvent message. Also converts values to other types if specified. + * @param message StatusEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.StatusEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StatusEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StatusEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TaskExecution. */ + interface ITaskExecution { + + /** TaskExecution exitCode */ + exitCode?: (number|null); + + /** TaskExecution stderrSnippet */ + stderrSnippet?: (string|null); + } + + /** Represents a TaskExecution. */ + class TaskExecution implements ITaskExecution { + + /** + * Constructs a new TaskExecution. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.ITaskExecution); + + /** TaskExecution exitCode. */ + public exitCode: number; + + /** TaskExecution stderrSnippet. */ + public stderrSnippet: string; + + /** + * Creates a new TaskExecution instance using the specified properties. + * @param [properties] Properties to set + * @returns TaskExecution instance + */ + public static create(properties?: google.cloud.batch.v1alpha.ITaskExecution): google.cloud.batch.v1alpha.TaskExecution; + + /** + * Encodes the specified TaskExecution message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskExecution.verify|verify} messages. + * @param message TaskExecution message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.ITaskExecution, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TaskExecution message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskExecution.verify|verify} messages. + * @param message TaskExecution message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.ITaskExecution, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TaskExecution message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TaskExecution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.TaskExecution; + + /** + * Decodes a TaskExecution message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TaskExecution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.TaskExecution; + + /** + * Verifies a TaskExecution message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TaskExecution message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TaskExecution + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.TaskExecution; + + /** + * Creates a plain object from a TaskExecution message. Also converts values to other types if specified. + * @param message TaskExecution + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.TaskExecution, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TaskExecution to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TaskExecution + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TaskStatus. */ + interface ITaskStatus { + + /** TaskStatus state */ + state?: (google.cloud.batch.v1alpha.TaskStatus.State|keyof typeof google.cloud.batch.v1alpha.TaskStatus.State|null); + + /** TaskStatus statusEvents */ + statusEvents?: (google.cloud.batch.v1alpha.IStatusEvent[]|null); + + /** TaskStatus resourceUsage */ + resourceUsage?: (google.cloud.batch.v1alpha.ITaskResourceUsage|null); + } + + /** Represents a TaskStatus. */ + class TaskStatus implements ITaskStatus { + + /** + * Constructs a new TaskStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.ITaskStatus); + + /** TaskStatus state. */ + public state: (google.cloud.batch.v1alpha.TaskStatus.State|keyof typeof google.cloud.batch.v1alpha.TaskStatus.State); + + /** TaskStatus statusEvents. */ + public statusEvents: google.cloud.batch.v1alpha.IStatusEvent[]; + + /** TaskStatus resourceUsage. */ + public resourceUsage?: (google.cloud.batch.v1alpha.ITaskResourceUsage|null); + + /** + * Creates a new TaskStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns TaskStatus instance + */ + public static create(properties?: google.cloud.batch.v1alpha.ITaskStatus): google.cloud.batch.v1alpha.TaskStatus; + + /** + * Encodes the specified TaskStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskStatus.verify|verify} messages. + * @param message TaskStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.ITaskStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TaskStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskStatus.verify|verify} messages. + * @param message TaskStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.ITaskStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TaskStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TaskStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.TaskStatus; + + /** + * Decodes a TaskStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TaskStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.TaskStatus; + + /** + * Verifies a TaskStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TaskStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TaskStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.TaskStatus; + + /** + * Creates a plain object from a TaskStatus message. Also converts values to other types if specified. + * @param message TaskStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.TaskStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TaskStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TaskStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TaskStatus { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PENDING = 1, + ASSIGNED = 2, + RUNNING = 3, + FAILED = 4, + SUCCEEDED = 5, + UNEXECUTED = 6 + } + } + + /** Properties of a TaskResourceUsage. */ + interface ITaskResourceUsage { + + /** TaskResourceUsage coreHours */ + coreHours?: (number|null); + } + + /** Represents a TaskResourceUsage. */ + class TaskResourceUsage implements ITaskResourceUsage { + + /** + * Constructs a new TaskResourceUsage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.ITaskResourceUsage); + + /** TaskResourceUsage coreHours. */ + public coreHours: number; + + /** + * Creates a new TaskResourceUsage instance using the specified properties. + * @param [properties] Properties to set + * @returns TaskResourceUsage instance + */ + public static create(properties?: google.cloud.batch.v1alpha.ITaskResourceUsage): google.cloud.batch.v1alpha.TaskResourceUsage; + + /** + * Encodes the specified TaskResourceUsage message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskResourceUsage.verify|verify} messages. + * @param message TaskResourceUsage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.ITaskResourceUsage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TaskResourceUsage message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskResourceUsage.verify|verify} messages. + * @param message TaskResourceUsage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.ITaskResourceUsage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TaskResourceUsage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TaskResourceUsage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.TaskResourceUsage; + + /** + * Decodes a TaskResourceUsage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TaskResourceUsage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.TaskResourceUsage; + + /** + * Verifies a TaskResourceUsage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TaskResourceUsage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TaskResourceUsage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.TaskResourceUsage; + + /** + * Creates a plain object from a TaskResourceUsage message. Also converts values to other types if specified. + * @param message TaskResourceUsage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.TaskResourceUsage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TaskResourceUsage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TaskResourceUsage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Runnable. */ + interface IRunnable { + + /** Runnable container */ + container?: (google.cloud.batch.v1alpha.Runnable.IContainer|null); + + /** Runnable script */ + script?: (google.cloud.batch.v1alpha.Runnable.IScript|null); + + /** Runnable barrier */ + barrier?: (google.cloud.batch.v1alpha.Runnable.IBarrier|null); + + /** Runnable displayName */ + displayName?: (string|null); + + /** Runnable ignoreExitStatus */ + ignoreExitStatus?: (boolean|null); + + /** Runnable background */ + background?: (boolean|null); + + /** Runnable alwaysRun */ + alwaysRun?: (boolean|null); + + /** Runnable environment */ + environment?: (google.cloud.batch.v1alpha.IEnvironment|null); + + /** Runnable timeout */ + timeout?: (google.protobuf.IDuration|null); + + /** Runnable labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a Runnable. */ + class Runnable implements IRunnable { + + /** + * Constructs a new Runnable. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IRunnable); + + /** Runnable container. */ + public container?: (google.cloud.batch.v1alpha.Runnable.IContainer|null); + + /** Runnable script. */ + public script?: (google.cloud.batch.v1alpha.Runnable.IScript|null); + + /** Runnable barrier. */ + public barrier?: (google.cloud.batch.v1alpha.Runnable.IBarrier|null); + + /** Runnable displayName. */ + public displayName: string; + + /** Runnable ignoreExitStatus. */ + public ignoreExitStatus: boolean; + + /** Runnable background. */ + public background: boolean; + + /** Runnable alwaysRun. */ + public alwaysRun: boolean; + + /** Runnable environment. */ + public environment?: (google.cloud.batch.v1alpha.IEnvironment|null); + + /** Runnable timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** Runnable labels. */ + public labels: { [k: string]: string }; + + /** Runnable executable. */ + public executable?: ("container"|"script"|"barrier"); + + /** + * Creates a new Runnable instance using the specified properties. + * @param [properties] Properties to set + * @returns Runnable instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IRunnable): google.cloud.batch.v1alpha.Runnable; + + /** + * Encodes the specified Runnable message. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.verify|verify} messages. + * @param message Runnable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IRunnable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Runnable message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.verify|verify} messages. + * @param message Runnable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IRunnable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Runnable message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Runnable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Runnable; + + /** + * Decodes a Runnable message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Runnable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Runnable; + + /** + * Verifies a Runnable message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Runnable message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Runnable + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Runnable; + + /** + * Creates a plain object from a Runnable message. Also converts values to other types if specified. + * @param message Runnable + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.Runnable, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Runnable to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Runnable + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Runnable { + + /** Properties of a Container. */ + interface IContainer { + + /** Container imageUri */ + imageUri?: (string|null); + + /** Container commands */ + commands?: (string[]|null); + + /** Container entrypoint */ + entrypoint?: (string|null); + + /** Container volumes */ + volumes?: (string[]|null); + + /** Container options */ + options?: (string|null); + + /** Container blockExternalNetwork */ + blockExternalNetwork?: (boolean|null); + + /** Container username */ + username?: (string|null); + + /** Container password */ + password?: (string|null); + + /** Container enableImageStreaming */ + enableImageStreaming?: (boolean|null); + } + + /** Represents a Container. */ + class Container implements IContainer { + + /** + * Constructs a new Container. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.Runnable.IContainer); + + /** Container imageUri. */ + public imageUri: string; + + /** Container commands. */ + public commands: string[]; + + /** Container entrypoint. */ + public entrypoint: string; + + /** Container volumes. */ + public volumes: string[]; + + /** Container options. */ + public options: string; + + /** Container blockExternalNetwork. */ + public blockExternalNetwork: boolean; + + /** Container username. */ + public username: string; + + /** Container password. */ + public password: string; + + /** Container enableImageStreaming. */ + public enableImageStreaming: boolean; + + /** + * Creates a new Container instance using the specified properties. + * @param [properties] Properties to set + * @returns Container instance + */ + public static create(properties?: google.cloud.batch.v1alpha.Runnable.IContainer): google.cloud.batch.v1alpha.Runnable.Container; + + /** + * Encodes the specified Container message. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Container.verify|verify} messages. + * @param message Container message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.Runnable.IContainer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Container message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Container.verify|verify} messages. + * @param message Container message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.Runnable.IContainer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Container message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Container + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Runnable.Container; + + /** + * Decodes a Container message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Container + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Runnable.Container; + + /** + * Verifies a Container message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Container message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Container + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Runnable.Container; + + /** + * Creates a plain object from a Container message. Also converts values to other types if specified. + * @param message Container + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.Runnable.Container, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Container to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Container + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Script. */ + interface IScript { + + /** Script path */ + path?: (string|null); + + /** Script text */ + text?: (string|null); + } + + /** Represents a Script. */ + class Script implements IScript { + + /** + * Constructs a new Script. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.Runnable.IScript); + + /** Script path. */ + public path?: (string|null); + + /** Script text. */ + public text?: (string|null); + + /** Script command. */ + public command?: ("path"|"text"); + + /** + * Creates a new Script instance using the specified properties. + * @param [properties] Properties to set + * @returns Script instance + */ + public static create(properties?: google.cloud.batch.v1alpha.Runnable.IScript): google.cloud.batch.v1alpha.Runnable.Script; + + /** + * Encodes the specified Script message. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Script.verify|verify} messages. + * @param message Script message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.Runnable.IScript, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Script message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Script.verify|verify} messages. + * @param message Script message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.Runnable.IScript, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Script message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Script + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Runnable.Script; + + /** + * Decodes a Script message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Script + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Runnable.Script; + + /** + * Verifies a Script message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Script message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Script + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Runnable.Script; + + /** + * Creates a plain object from a Script message. Also converts values to other types if specified. + * @param message Script + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.Runnable.Script, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Script to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Script + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Barrier. */ + interface IBarrier { + + /** Barrier name */ + name?: (string|null); + } + + /** Represents a Barrier. */ + class Barrier implements IBarrier { + + /** + * Constructs a new Barrier. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.Runnable.IBarrier); + + /** Barrier name. */ + public name: string; + + /** + * Creates a new Barrier instance using the specified properties. + * @param [properties] Properties to set + * @returns Barrier instance + */ + public static create(properties?: google.cloud.batch.v1alpha.Runnable.IBarrier): google.cloud.batch.v1alpha.Runnable.Barrier; + + /** + * Encodes the specified Barrier message. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Barrier.verify|verify} messages. + * @param message Barrier message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.Runnable.IBarrier, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Barrier message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Barrier.verify|verify} messages. + * @param message Barrier message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.Runnable.IBarrier, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Barrier message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Barrier + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Runnable.Barrier; + + /** + * Decodes a Barrier message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Barrier + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Runnable.Barrier; + + /** + * Verifies a Barrier message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Barrier message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Barrier + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Runnable.Barrier; + + /** + * Creates a plain object from a Barrier message. Also converts values to other types if specified. + * @param message Barrier + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.Runnable.Barrier, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Barrier to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Barrier + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TaskSpec. */ + interface ITaskSpec { + + /** TaskSpec runnables */ + runnables?: (google.cloud.batch.v1alpha.IRunnable[]|null); + + /** TaskSpec computeResource */ + computeResource?: (google.cloud.batch.v1alpha.IComputeResource|null); + + /** TaskSpec maxRunDuration */ + maxRunDuration?: (google.protobuf.IDuration|null); + + /** TaskSpec maxRetryCount */ + maxRetryCount?: (number|null); + + /** TaskSpec lifecyclePolicies */ + lifecyclePolicies?: (google.cloud.batch.v1alpha.ILifecyclePolicy[]|null); + + /** TaskSpec environments */ + environments?: ({ [k: string]: string }|null); + + /** TaskSpec volumes */ + volumes?: (google.cloud.batch.v1alpha.IVolume[]|null); + + /** TaskSpec environment */ + environment?: (google.cloud.batch.v1alpha.IEnvironment|null); + } + + /** Represents a TaskSpec. */ + class TaskSpec implements ITaskSpec { + + /** + * Constructs a new TaskSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.ITaskSpec); + + /** TaskSpec runnables. */ + public runnables: google.cloud.batch.v1alpha.IRunnable[]; + + /** TaskSpec computeResource. */ + public computeResource?: (google.cloud.batch.v1alpha.IComputeResource|null); + + /** TaskSpec maxRunDuration. */ + public maxRunDuration?: (google.protobuf.IDuration|null); + + /** TaskSpec maxRetryCount. */ + public maxRetryCount: number; + + /** TaskSpec lifecyclePolicies. */ + public lifecyclePolicies: google.cloud.batch.v1alpha.ILifecyclePolicy[]; + + /** TaskSpec environments. */ + public environments: { [k: string]: string }; + + /** TaskSpec volumes. */ + public volumes: google.cloud.batch.v1alpha.IVolume[]; + + /** TaskSpec environment. */ + public environment?: (google.cloud.batch.v1alpha.IEnvironment|null); + + /** + * Creates a new TaskSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns TaskSpec instance + */ + public static create(properties?: google.cloud.batch.v1alpha.ITaskSpec): google.cloud.batch.v1alpha.TaskSpec; + + /** + * Encodes the specified TaskSpec message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskSpec.verify|verify} messages. + * @param message TaskSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.ITaskSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TaskSpec message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskSpec.verify|verify} messages. + * @param message TaskSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.ITaskSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TaskSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TaskSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.TaskSpec; + + /** + * Decodes a TaskSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TaskSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.TaskSpec; + + /** + * Verifies a TaskSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TaskSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TaskSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.TaskSpec; + + /** + * Creates a plain object from a TaskSpec message. Also converts values to other types if specified. + * @param message TaskSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.TaskSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TaskSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TaskSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LifecyclePolicy. */ + interface ILifecyclePolicy { + + /** LifecyclePolicy action */ + action?: (google.cloud.batch.v1alpha.LifecyclePolicy.Action|keyof typeof google.cloud.batch.v1alpha.LifecyclePolicy.Action|null); + + /** LifecyclePolicy actionCondition */ + actionCondition?: (google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition|null); + } + + /** Represents a LifecyclePolicy. */ + class LifecyclePolicy implements ILifecyclePolicy { + + /** + * Constructs a new LifecyclePolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.ILifecyclePolicy); + + /** LifecyclePolicy action. */ + public action: (google.cloud.batch.v1alpha.LifecyclePolicy.Action|keyof typeof google.cloud.batch.v1alpha.LifecyclePolicy.Action); + + /** LifecyclePolicy actionCondition. */ + public actionCondition?: (google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition|null); + + /** + * Creates a new LifecyclePolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns LifecyclePolicy instance + */ + public static create(properties?: google.cloud.batch.v1alpha.ILifecyclePolicy): google.cloud.batch.v1alpha.LifecyclePolicy; + + /** + * Encodes the specified LifecyclePolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.LifecyclePolicy.verify|verify} messages. + * @param message LifecyclePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.ILifecyclePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LifecyclePolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.LifecyclePolicy.verify|verify} messages. + * @param message LifecyclePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.ILifecyclePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LifecyclePolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LifecyclePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.LifecyclePolicy; + + /** + * Decodes a LifecyclePolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LifecyclePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.LifecyclePolicy; + + /** + * Verifies a LifecyclePolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LifecyclePolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LifecyclePolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.LifecyclePolicy; + + /** + * Creates a plain object from a LifecyclePolicy message. Also converts values to other types if specified. + * @param message LifecyclePolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.LifecyclePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LifecyclePolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LifecyclePolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LifecyclePolicy { + + /** Properties of an ActionCondition. */ + interface IActionCondition { + + /** ActionCondition exitCodes */ + exitCodes?: (number[]|null); + } + + /** Represents an ActionCondition. */ + class ActionCondition implements IActionCondition { + + /** + * Constructs a new ActionCondition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition); + + /** ActionCondition exitCodes. */ + public exitCodes: number[]; + + /** + * Creates a new ActionCondition instance using the specified properties. + * @param [properties] Properties to set + * @returns ActionCondition instance + */ + public static create(properties?: google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition): google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition; + + /** + * Encodes the specified ActionCondition message. Does not implicitly {@link google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.verify|verify} messages. + * @param message ActionCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ActionCondition message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.verify|verify} messages. + * @param message ActionCondition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ActionCondition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ActionCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition; + + /** + * Decodes an ActionCondition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ActionCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition; + + /** + * Verifies an ActionCondition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ActionCondition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ActionCondition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition; + + /** + * Creates a plain object from an ActionCondition message. Also converts values to other types if specified. + * @param message ActionCondition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ActionCondition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ActionCondition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + RETRY_TASK = 1, + FAIL_TASK = 2 + } + } + + /** Properties of a Task. */ + interface ITask { + + /** Task name */ + name?: (string|null); + + /** Task status */ + status?: (google.cloud.batch.v1alpha.ITaskStatus|null); + } + + /** Represents a Task. */ + class Task implements ITask { + + /** + * Constructs a new Task. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.ITask); + + /** Task name. */ + public name: string; + + /** Task status. */ + public status?: (google.cloud.batch.v1alpha.ITaskStatus|null); + + /** + * Creates a new Task instance using the specified properties. + * @param [properties] Properties to set + * @returns Task instance + */ + public static create(properties?: google.cloud.batch.v1alpha.ITask): google.cloud.batch.v1alpha.Task; + + /** + * Encodes the specified Task message. Does not implicitly {@link google.cloud.batch.v1alpha.Task.verify|verify} messages. + * @param message Task message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.ITask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Task message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Task.verify|verify} messages. + * @param message Task message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.ITask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Task message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Task + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Task; + + /** + * Decodes a Task message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Task + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Task; + + /** + * Verifies a Task message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Task message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Task + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Task; + + /** + * Creates a plain object from a Task message. Also converts values to other types if specified. + * @param message Task + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.Task, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Task to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Task + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Environment. */ + interface IEnvironment { + + /** Environment variables */ + variables?: ({ [k: string]: string }|null); + + /** Environment secretVariables */ + secretVariables?: ({ [k: string]: string }|null); + + /** Environment encryptedVariables */ + encryptedVariables?: (google.cloud.batch.v1alpha.Environment.IKMSEnvMap|null); + } + + /** Represents an Environment. */ + class Environment implements IEnvironment { + + /** + * Constructs a new Environment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IEnvironment); + + /** Environment variables. */ + public variables: { [k: string]: string }; + + /** Environment secretVariables. */ + public secretVariables: { [k: string]: string }; + + /** Environment encryptedVariables. */ + public encryptedVariables?: (google.cloud.batch.v1alpha.Environment.IKMSEnvMap|null); + + /** + * Creates a new Environment instance using the specified properties. + * @param [properties] Properties to set + * @returns Environment instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IEnvironment): google.cloud.batch.v1alpha.Environment; + + /** + * Encodes the specified Environment message. Does not implicitly {@link google.cloud.batch.v1alpha.Environment.verify|verify} messages. + * @param message Environment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Environment.verify|verify} messages. + * @param message Environment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Environment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Environment; + + /** + * Decodes an Environment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Environment; + + /** + * Verifies an Environment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Environment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Environment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Environment; + + /** + * Creates a plain object from an Environment message. Also converts values to other types if specified. + * @param message Environment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.Environment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Environment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Environment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Environment { + + /** Properties of a KMSEnvMap. */ + interface IKMSEnvMap { + + /** KMSEnvMap keyName */ + keyName?: (string|null); + + /** KMSEnvMap cipherText */ + cipherText?: (string|null); + } + + /** Represents a KMSEnvMap. */ + class KMSEnvMap implements IKMSEnvMap { + + /** + * Constructs a new KMSEnvMap. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.Environment.IKMSEnvMap); + + /** KMSEnvMap keyName. */ + public keyName: string; + + /** KMSEnvMap cipherText. */ + public cipherText: string; + + /** + * Creates a new KMSEnvMap instance using the specified properties. + * @param [properties] Properties to set + * @returns KMSEnvMap instance + */ + public static create(properties?: google.cloud.batch.v1alpha.Environment.IKMSEnvMap): google.cloud.batch.v1alpha.Environment.KMSEnvMap; + + /** + * Encodes the specified KMSEnvMap message. Does not implicitly {@link google.cloud.batch.v1alpha.Environment.KMSEnvMap.verify|verify} messages. + * @param message KMSEnvMap message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.Environment.IKMSEnvMap, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KMSEnvMap message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Environment.KMSEnvMap.verify|verify} messages. + * @param message KMSEnvMap message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.Environment.IKMSEnvMap, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KMSEnvMap message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KMSEnvMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Environment.KMSEnvMap; + + /** + * Decodes a KMSEnvMap message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KMSEnvMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Environment.KMSEnvMap; + + /** + * Verifies a KMSEnvMap message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a KMSEnvMap message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KMSEnvMap + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Environment.KMSEnvMap; + + /** + * Creates a plain object from a KMSEnvMap message. Also converts values to other types if specified. + * @param message KMSEnvMap + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.Environment.KMSEnvMap, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KMSEnvMap to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KMSEnvMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Volume. */ + interface IVolume { + + /** Volume nfs */ + nfs?: (google.cloud.batch.v1alpha.INFS|null); + + /** Volume pd */ + pd?: (google.cloud.batch.v1alpha.IPD|null); + + /** Volume gcs */ + gcs?: (google.cloud.batch.v1alpha.IGCS|null); + + /** Volume deviceName */ + deviceName?: (string|null); + + /** Volume mountPath */ + mountPath?: (string|null); + + /** Volume mountOptions */ + mountOptions?: (string[]|null); + } + + /** Represents a Volume. */ + class Volume implements IVolume { + + /** + * Constructs a new Volume. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IVolume); + + /** Volume nfs. */ + public nfs?: (google.cloud.batch.v1alpha.INFS|null); + + /** Volume pd. */ + public pd?: (google.cloud.batch.v1alpha.IPD|null); + + /** Volume gcs. */ + public gcs?: (google.cloud.batch.v1alpha.IGCS|null); + + /** Volume deviceName. */ + public deviceName?: (string|null); + + /** Volume mountPath. */ + public mountPath: string; + + /** Volume mountOptions. */ + public mountOptions: string[]; + + /** Volume source. */ + public source?: ("nfs"|"pd"|"gcs"|"deviceName"); + + /** + * Creates a new Volume instance using the specified properties. + * @param [properties] Properties to set + * @returns Volume instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IVolume): google.cloud.batch.v1alpha.Volume; + + /** + * Encodes the specified Volume message. Does not implicitly {@link google.cloud.batch.v1alpha.Volume.verify|verify} messages. + * @param message Volume message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IVolume, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Volume message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Volume.verify|verify} messages. + * @param message Volume message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IVolume, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Volume message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Volume + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Volume; + + /** + * Decodes a Volume message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Volume + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Volume; + + /** + * Verifies a Volume message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Volume message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Volume + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Volume; + + /** + * Creates a plain object from a Volume message. Also converts values to other types if specified. + * @param message Volume + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.Volume, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Volume to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Volume + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NFS. */ + interface INFS { + + /** NFS server */ + server?: (string|null); + + /** NFS remotePath */ + remotePath?: (string|null); + } + + /** Represents a NFS. */ + class NFS implements INFS { + + /** + * Constructs a new NFS. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.INFS); + + /** NFS server. */ + public server: string; + + /** NFS remotePath. */ + public remotePath: string; + + /** + * Creates a new NFS instance using the specified properties. + * @param [properties] Properties to set + * @returns NFS instance + */ + public static create(properties?: google.cloud.batch.v1alpha.INFS): google.cloud.batch.v1alpha.NFS; + + /** + * Encodes the specified NFS message. Does not implicitly {@link google.cloud.batch.v1alpha.NFS.verify|verify} messages. + * @param message NFS message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.INFS, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NFS message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.NFS.verify|verify} messages. + * @param message NFS message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.INFS, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NFS message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NFS + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.NFS; + + /** + * Decodes a NFS message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NFS + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.NFS; + + /** + * Verifies a NFS message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NFS message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NFS + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.NFS; + + /** + * Creates a plain object from a NFS message. Also converts values to other types if specified. + * @param message NFS + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.NFS, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NFS to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NFS + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PD. */ + interface IPD { + + /** PD disk */ + disk?: (string|null); + + /** PD device */ + device?: (string|null); + + /** PD existing */ + existing?: (boolean|null); + } + + /** Represents a PD. */ + class PD implements IPD { + + /** + * Constructs a new PD. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IPD); + + /** PD disk. */ + public disk: string; + + /** PD device. */ + public device: string; + + /** PD existing. */ + public existing: boolean; + + /** + * Creates a new PD instance using the specified properties. + * @param [properties] Properties to set + * @returns PD instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IPD): google.cloud.batch.v1alpha.PD; + + /** + * Encodes the specified PD message. Does not implicitly {@link google.cloud.batch.v1alpha.PD.verify|verify} messages. + * @param message PD message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IPD, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PD message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.PD.verify|verify} messages. + * @param message PD message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IPD, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PD message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PD + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.PD; + + /** + * Decodes a PD message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PD + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.PD; + + /** + * Verifies a PD message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PD message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PD + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.PD; + + /** + * Creates a plain object from a PD message. Also converts values to other types if specified. + * @param message PD + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.PD, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PD to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PD + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GCS. */ + interface IGCS { + + /** GCS remotePath */ + remotePath?: (string|null); + } + + /** Represents a GCS. */ + class GCS implements IGCS { + + /** + * Constructs a new GCS. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IGCS); + + /** GCS remotePath. */ + public remotePath: string; + + /** + * Creates a new GCS instance using the specified properties. + * @param [properties] Properties to set + * @returns GCS instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IGCS): google.cloud.batch.v1alpha.GCS; + + /** + * Encodes the specified GCS message. Does not implicitly {@link google.cloud.batch.v1alpha.GCS.verify|verify} messages. + * @param message GCS message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IGCS, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GCS message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.GCS.verify|verify} messages. + * @param message GCS message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IGCS, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GCS message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GCS + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.GCS; + + /** + * Decodes a GCS message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GCS + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.GCS; + + /** + * Verifies a GCS message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GCS message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GCS + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.GCS; + + /** + * Creates a plain object from a GCS message. Also converts values to other types if specified. + * @param message GCS + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.GCS, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GCS to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GCS + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** CalendarPeriod enum. */ + enum CalendarPeriod { + CALENDAR_PERIOD_UNSPECIFIED = 0, + MONTH = 1, + QUARTER = 2, + YEAR = 3, + WEEK = 4, + DAY = 5 + } + + /** ResourceAllowanceState enum. */ + enum ResourceAllowanceState { + RESOURCE_ALLOWANCE_STATE_UNSPECIFIED = 0, + RESOURCE_ALLOWANCE_ACTIVE = 1, + RESOURCE_ALLOWANCE_DEPLETED = 2 + } + + /** Properties of a ResourceAllowance. */ + interface IResourceAllowance { + + /** ResourceAllowance usageResourceAllowance */ + usageResourceAllowance?: (google.cloud.batch.v1alpha.IUsageResourceAllowance|null); + + /** ResourceAllowance name */ + name?: (string|null); + + /** ResourceAllowance uid */ + uid?: (string|null); + + /** ResourceAllowance createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ResourceAllowance labels */ + labels?: ({ [k: string]: string }|null); + + /** ResourceAllowance notifications */ + notifications?: (google.cloud.batch.v1alpha.INotification[]|null); + } + + /** Represents a ResourceAllowance. */ + class ResourceAllowance implements IResourceAllowance { + + /** + * Constructs a new ResourceAllowance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IResourceAllowance); + + /** ResourceAllowance usageResourceAllowance. */ + public usageResourceAllowance?: (google.cloud.batch.v1alpha.IUsageResourceAllowance|null); + + /** ResourceAllowance name. */ + public name: string; + + /** ResourceAllowance uid. */ + public uid: string; + + /** ResourceAllowance createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ResourceAllowance labels. */ + public labels: { [k: string]: string }; + + /** ResourceAllowance notifications. */ + public notifications: google.cloud.batch.v1alpha.INotification[]; + + /** ResourceAllowance resourceAllowance. */ + public resourceAllowance?: "usageResourceAllowance"; + + /** + * Creates a new ResourceAllowance instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceAllowance instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IResourceAllowance): google.cloud.batch.v1alpha.ResourceAllowance; + + /** + * Encodes the specified ResourceAllowance message. Does not implicitly {@link google.cloud.batch.v1alpha.ResourceAllowance.verify|verify} messages. + * @param message ResourceAllowance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IResourceAllowance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceAllowance message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ResourceAllowance.verify|verify} messages. + * @param message ResourceAllowance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IResourceAllowance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceAllowance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceAllowance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ResourceAllowance; + + /** + * Decodes a ResourceAllowance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceAllowance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ResourceAllowance; + + /** + * Verifies a ResourceAllowance message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceAllowance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceAllowance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ResourceAllowance; + + /** + * Creates a plain object from a ResourceAllowance message. Also converts values to other types if specified. + * @param message ResourceAllowance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.ResourceAllowance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceAllowance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceAllowance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UsageResourceAllowance. */ + interface IUsageResourceAllowance { + + /** UsageResourceAllowance spec */ + spec?: (google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec|null); + + /** UsageResourceAllowance status */ + status?: (google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus|null); + } + + /** Represents a UsageResourceAllowance. */ + class UsageResourceAllowance implements IUsageResourceAllowance { + + /** + * Constructs a new UsageResourceAllowance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IUsageResourceAllowance); + + /** UsageResourceAllowance spec. */ + public spec?: (google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec|null); + + /** UsageResourceAllowance status. */ + public status?: (google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus|null); + + /** + * Creates a new UsageResourceAllowance instance using the specified properties. + * @param [properties] Properties to set + * @returns UsageResourceAllowance instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IUsageResourceAllowance): google.cloud.batch.v1alpha.UsageResourceAllowance; + + /** + * Encodes the specified UsageResourceAllowance message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowance.verify|verify} messages. + * @param message UsageResourceAllowance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IUsageResourceAllowance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UsageResourceAllowance message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowance.verify|verify} messages. + * @param message UsageResourceAllowance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IUsageResourceAllowance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UsageResourceAllowance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UsageResourceAllowance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.UsageResourceAllowance; + + /** + * Decodes a UsageResourceAllowance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UsageResourceAllowance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.UsageResourceAllowance; + + /** + * Verifies a UsageResourceAllowance message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UsageResourceAllowance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UsageResourceAllowance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.UsageResourceAllowance; + + /** + * Creates a plain object from a UsageResourceAllowance message. Also converts values to other types if specified. + * @param message UsageResourceAllowance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.UsageResourceAllowance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UsageResourceAllowance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UsageResourceAllowance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UsageResourceAllowanceSpec. */ + interface IUsageResourceAllowanceSpec { + + /** UsageResourceAllowanceSpec type */ + type?: (string|null); + + /** UsageResourceAllowanceSpec limit */ + limit?: (google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit|null); + } + + /** Represents a UsageResourceAllowanceSpec. */ + class UsageResourceAllowanceSpec implements IUsageResourceAllowanceSpec { + + /** + * Constructs a new UsageResourceAllowanceSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec); + + /** UsageResourceAllowanceSpec type. */ + public type: string; + + /** UsageResourceAllowanceSpec limit. */ + public limit?: (google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit|null); + + /** + * Creates a new UsageResourceAllowanceSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns UsageResourceAllowanceSpec instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec): google.cloud.batch.v1alpha.UsageResourceAllowanceSpec; + + /** + * Encodes the specified UsageResourceAllowanceSpec message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.verify|verify} messages. + * @param message UsageResourceAllowanceSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UsageResourceAllowanceSpec message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.verify|verify} messages. + * @param message UsageResourceAllowanceSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UsageResourceAllowanceSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UsageResourceAllowanceSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.UsageResourceAllowanceSpec; + + /** + * Decodes a UsageResourceAllowanceSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UsageResourceAllowanceSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.UsageResourceAllowanceSpec; + + /** + * Verifies a UsageResourceAllowanceSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UsageResourceAllowanceSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UsageResourceAllowanceSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.UsageResourceAllowanceSpec; + + /** + * Creates a plain object from a UsageResourceAllowanceSpec message. Also converts values to other types if specified. + * @param message UsageResourceAllowanceSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.UsageResourceAllowanceSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UsageResourceAllowanceSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UsageResourceAllowanceSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UsageResourceAllowanceSpec { + + /** Properties of a Limit. */ + interface ILimit { + + /** Limit calendarPeriod */ + calendarPeriod?: (google.cloud.batch.v1alpha.CalendarPeriod|keyof typeof google.cloud.batch.v1alpha.CalendarPeriod|null); + + /** Limit limit */ + limit?: (number|null); + } + + /** Represents a Limit. */ + class Limit implements ILimit { + + /** + * Constructs a new Limit. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit); + + /** Limit calendarPeriod. */ + public calendarPeriod?: (google.cloud.batch.v1alpha.CalendarPeriod|keyof typeof google.cloud.batch.v1alpha.CalendarPeriod|null); + + /** Limit limit. */ + public limit?: (number|null); + + /** Limit duration. */ + public duration?: "calendarPeriod"; + + /** Limit _limit. */ + public _limit?: "limit"; + + /** + * Creates a new Limit instance using the specified properties. + * @param [properties] Properties to set + * @returns Limit instance + */ + public static create(properties?: google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit): google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit; + + /** + * Encodes the specified Limit message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit.verify|verify} messages. + * @param message Limit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Limit message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit.verify|verify} messages. + * @param message Limit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Limit message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Limit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit; + + /** + * Decodes a Limit message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Limit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit; + + /** + * Verifies a Limit message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Limit message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Limit + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit; + + /** + * Creates a plain object from a Limit message. Also converts values to other types if specified. + * @param message Limit + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Limit to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Limit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a UsageResourceAllowanceStatus. */ + interface IUsageResourceAllowanceStatus { + + /** UsageResourceAllowanceStatus state */ + state?: (google.cloud.batch.v1alpha.ResourceAllowanceState|keyof typeof google.cloud.batch.v1alpha.ResourceAllowanceState|null); + + /** UsageResourceAllowanceStatus limitStatus */ + limitStatus?: (google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus|null); + + /** UsageResourceAllowanceStatus report */ + report?: (google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport|null); + } + + /** Represents a UsageResourceAllowanceStatus. */ + class UsageResourceAllowanceStatus implements IUsageResourceAllowanceStatus { + + /** + * Constructs a new UsageResourceAllowanceStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus); + + /** UsageResourceAllowanceStatus state. */ + public state: (google.cloud.batch.v1alpha.ResourceAllowanceState|keyof typeof google.cloud.batch.v1alpha.ResourceAllowanceState); + + /** UsageResourceAllowanceStatus limitStatus. */ + public limitStatus?: (google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus|null); + + /** UsageResourceAllowanceStatus report. */ + public report?: (google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport|null); + + /** + * Creates a new UsageResourceAllowanceStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns UsageResourceAllowanceStatus instance + */ + public static create(properties?: google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus; + + /** + * Encodes the specified UsageResourceAllowanceStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.verify|verify} messages. + * @param message UsageResourceAllowanceStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UsageResourceAllowanceStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.verify|verify} messages. + * @param message UsageResourceAllowanceStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UsageResourceAllowanceStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UsageResourceAllowanceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus; + + /** + * Decodes a UsageResourceAllowanceStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UsageResourceAllowanceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus; + + /** + * Verifies a UsageResourceAllowanceStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UsageResourceAllowanceStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UsageResourceAllowanceStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus; + + /** + * Creates a plain object from a UsageResourceAllowanceStatus message. Also converts values to other types if specified. + * @param message UsageResourceAllowanceStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UsageResourceAllowanceStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UsageResourceAllowanceStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UsageResourceAllowanceStatus { + + /** Properties of a LimitStatus. */ + interface ILimitStatus { + + /** LimitStatus consumptionInterval */ + consumptionInterval?: (google.type.IInterval|null); + + /** LimitStatus limit */ + limit?: (number|null); + + /** LimitStatus consumed */ + consumed?: (number|null); + } + + /** Represents a LimitStatus. */ + class LimitStatus implements ILimitStatus { + + /** + * Constructs a new LimitStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus); + + /** LimitStatus consumptionInterval. */ + public consumptionInterval?: (google.type.IInterval|null); + + /** LimitStatus limit. */ + public limit?: (number|null); + + /** LimitStatus consumed. */ + public consumed?: (number|null); + + /** LimitStatus _limit. */ + public _limit?: "limit"; + + /** LimitStatus _consumed. */ + public _consumed?: "consumed"; + + /** + * Creates a new LimitStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns LimitStatus instance + */ + public static create(properties?: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus; + + /** + * Encodes the specified LimitStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.verify|verify} messages. + * @param message LimitStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LimitStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.verify|verify} messages. + * @param message LimitStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LimitStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LimitStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus; + + /** + * Decodes a LimitStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LimitStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus; + + /** + * Verifies a LimitStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LimitStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LimitStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus; + + /** + * Creates a plain object from a LimitStatus message. Also converts values to other types if specified. + * @param message LimitStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LimitStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LimitStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PeriodConsumption. */ + interface IPeriodConsumption { + + /** PeriodConsumption consumptionInterval */ + consumptionInterval?: (google.type.IInterval|null); + + /** PeriodConsumption consumed */ + consumed?: (number|null); + } + + /** Represents a PeriodConsumption. */ + class PeriodConsumption implements IPeriodConsumption { + + /** + * Constructs a new PeriodConsumption. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption); + + /** PeriodConsumption consumptionInterval. */ + public consumptionInterval?: (google.type.IInterval|null); + + /** PeriodConsumption consumed. */ + public consumed?: (number|null); + + /** PeriodConsumption _consumed. */ + public _consumed?: "consumed"; + + /** + * Creates a new PeriodConsumption instance using the specified properties. + * @param [properties] Properties to set + * @returns PeriodConsumption instance + */ + public static create(properties?: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption; + + /** + * Encodes the specified PeriodConsumption message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.verify|verify} messages. + * @param message PeriodConsumption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PeriodConsumption message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.verify|verify} messages. + * @param message PeriodConsumption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PeriodConsumption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PeriodConsumption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption; + + /** + * Decodes a PeriodConsumption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PeriodConsumption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption; + + /** + * Verifies a PeriodConsumption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PeriodConsumption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PeriodConsumption + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption; + + /** + * Creates a plain object from a PeriodConsumption message. Also converts values to other types if specified. + * @param message PeriodConsumption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PeriodConsumption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PeriodConsumption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConsumptionReport. */ + interface IConsumptionReport { + + /** ConsumptionReport latestPeriodConsumptions */ + latestPeriodConsumptions?: ({ [k: string]: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption }|null); + } + + /** Represents a ConsumptionReport. */ + class ConsumptionReport implements IConsumptionReport { + + /** + * Constructs a new ConsumptionReport. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport); + + /** ConsumptionReport latestPeriodConsumptions. */ + public latestPeriodConsumptions: { [k: string]: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption }; + + /** + * Creates a new ConsumptionReport instance using the specified properties. + * @param [properties] Properties to set + * @returns ConsumptionReport instance + */ + public static create(properties?: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport; + + /** + * Encodes the specified ConsumptionReport message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.verify|verify} messages. + * @param message ConsumptionReport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConsumptionReport message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.verify|verify} messages. + * @param message ConsumptionReport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConsumptionReport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConsumptionReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport; + + /** + * Decodes a ConsumptionReport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConsumptionReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport; + + /** + * Verifies a ConsumptionReport message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConsumptionReport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConsumptionReport + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport; + + /** + * Creates a plain object from a ConsumptionReport message. Also converts values to other types if specified. + * @param message ConsumptionReport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConsumptionReport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConsumptionReport + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Notification. */ + interface INotification { + + /** Notification pubsubTopic */ + pubsubTopic?: (string|null); + } + + /** Represents a Notification. */ + class Notification implements INotification { + + /** + * Constructs a new Notification. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.INotification); + + /** Notification pubsubTopic. */ + public pubsubTopic: string; + + /** + * Creates a new Notification instance using the specified properties. + * @param [properties] Properties to set + * @returns Notification instance + */ + public static create(properties?: google.cloud.batch.v1alpha.INotification): google.cloud.batch.v1alpha.Notification; + + /** + * Encodes the specified Notification message. Does not implicitly {@link google.cloud.batch.v1alpha.Notification.verify|verify} messages. + * @param message Notification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.INotification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Notification message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Notification.verify|verify} messages. + * @param message Notification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.INotification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Notification message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Notification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Notification; + + /** + * Decodes a Notification message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Notification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Notification; + + /** + * Verifies a Notification message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Notification message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Notification + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Notification; + + /** + * Creates a plain object from a Notification message. Also converts values to other types if specified. + * @param message Notification + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.Notification, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Notification to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Notification + * @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); + } + + /** Represents a CommonLanguageSettings. */ + class CommonLanguageSettings implements ICommonLanguageSettings { + + /** + * Constructs a new CommonLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICommonLanguageSettings); + + /** CommonLanguageSettings referenceDocsUri. */ + public referenceDocsUri: string; + + /** CommonLanguageSettings destinations. */ + public destinations: google.api.ClientLibraryDestination[]; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonLanguageSettings instance + */ + public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; + + /** + * Verifies a CommonLanguageSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @param message CommonLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientLibrarySettings. */ + interface IClientLibrarySettings { + + /** ClientLibrarySettings version */ + version?: (string|null); + + /** ClientLibrarySettings launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ClientLibrarySettings restNumericEnums */ + restNumericEnums?: (boolean|null); + + /** ClientLibrarySettings javaSettings */ + javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings */ + cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings */ + phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings */ + pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings */ + nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings */ + dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings */ + rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings */ + goSettings?: (google.api.IGoSettings|null); + } + + /** Represents a ClientLibrarySettings. */ + class ClientLibrarySettings implements IClientLibrarySettings { + + /** + * Constructs a new ClientLibrarySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IClientLibrarySettings); + + /** ClientLibrarySettings version. */ + public version: string; + + /** ClientLibrarySettings launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ClientLibrarySettings restNumericEnums. */ + public restNumericEnums: boolean; + + /** ClientLibrarySettings javaSettings. */ + public javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings. */ + public cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings. */ + public phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings. */ + public pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings. */ + public nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings. */ + public dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings. */ + public rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings. */ + public goSettings?: (google.api.IGoSettings|null); + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientLibrarySettings instance + */ + public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; + + /** + * Verifies a ClientLibrarySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientLibrarySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @param message ClientLibrarySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientLibrarySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Publishing. */ + interface IPublishing { + + /** Publishing methodSettings */ + methodSettings?: (google.api.IMethodSettings[]|null); + + /** Publishing newIssueUri */ + newIssueUri?: (string|null); + + /** Publishing documentationUri */ + documentationUri?: (string|null); + + /** Publishing apiShortName */ + apiShortName?: (string|null); + + /** Publishing githubLabel */ + githubLabel?: (string|null); + + /** Publishing codeownerGithubTeams */ + codeownerGithubTeams?: (string[]|null); + + /** Publishing docTagPrefix */ + docTagPrefix?: (string|null); + + /** Publishing organization */ + organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); + + /** Publishing librarySettings */ + librarySettings?: (google.api.IClientLibrarySettings[]|null); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); + + /** Publishing restReferenceDocumentationUri */ + restReferenceDocumentationUri?: (string|null); + } + + /** Represents a Publishing. */ + class Publishing implements IPublishing { + + /** + * Constructs a new Publishing. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPublishing); + + /** Publishing methodSettings. */ + public methodSettings: google.api.IMethodSettings[]; + + /** Publishing newIssueUri. */ + public newIssueUri: string; + + /** Publishing documentationUri. */ + public documentationUri: string; + + /** Publishing apiShortName. */ + public apiShortName: string; + + /** Publishing githubLabel. */ + public githubLabel: string; + + /** Publishing codeownerGithubTeams. */ + public codeownerGithubTeams: string[]; + + /** Publishing docTagPrefix. */ + public docTagPrefix: string; + + /** Publishing organization. */ + public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; + + /** Publishing restReferenceDocumentationUri. */ + public restReferenceDocumentationUri: string; + + /** + * Creates a new Publishing instance using the specified properties. + * @param [properties] Properties to set + * @returns Publishing instance + */ + public static create(properties?: google.api.IPublishing): google.api.Publishing; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; + + /** + * Verifies a Publishing message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Publishing + */ + public static fromObject(object: { [k: string]: any }): google.api.Publishing; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @param message Publishing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Publishing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Publishing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JavaSettings. */ + interface IJavaSettings { + + /** JavaSettings libraryPackage */ + libraryPackage?: (string|null); + + /** JavaSettings serviceClassNames */ + serviceClassNames?: ({ [k: string]: string }|null); + + /** JavaSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a JavaSettings. */ + class JavaSettings implements IJavaSettings { + + /** + * Constructs a new JavaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IJavaSettings); + + /** JavaSettings libraryPackage. */ + public libraryPackage: string; + + /** JavaSettings serviceClassNames. */ + public serviceClassNames: { [k: string]: string }; + + /** JavaSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new JavaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaSettings instance + */ + public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; + + /** + * Verifies a JavaSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @param message JavaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JavaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CppSettings. */ + interface ICppSettings { + + /** CppSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { + + /** + * Constructs a new CppSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICppSettings); + + /** CppSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance + */ + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; + + /** + * Verifies a CppSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CppSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @param message CppSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CppSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CppSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PhpSettings. */ + interface IPhpSettings { + + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { + + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); + + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PhpSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PhpSettings instance + */ + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; + + /** + * Verifies a PhpSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhpSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @param message PhpSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhpSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhpSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonSettings. */ + interface IPythonSettings { + + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { + + /** + * Constructs a new PythonSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPythonSettings); + + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PythonSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonSettings instance + */ + public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; + + /** + * Verifies a PythonSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeSettings. */ + interface INodeSettings { + + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { + + /** + * Constructs a new NodeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.INodeSettings); + + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance + */ + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; + + /** + * Verifies a NodeSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @param message NodeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DotnetSettings. */ + interface IDotnetSettings { + + /** DotnetSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + + /** DotnetSettings renamedResources */ + renamedResources?: ({ [k: string]: string }|null); + + /** DotnetSettings ignoredResources */ + ignoredResources?: (string[]|null); + + /** DotnetSettings forcedNamespaceAliases */ + forcedNamespaceAliases?: (string[]|null); + + /** DotnetSettings handwrittenSignatures */ + handwrittenSignatures?: (string[]|null); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** DotnetSettings renamedResources. */ + public renamedResources: { [k: string]: string }; + + /** DotnetSettings ignoredResources. */ + public ignoredResources: string[]; + + /** DotnetSettings forcedNamespaceAliases. */ + public forcedNamespaceAliases: string[]; + + /** DotnetSettings handwrittenSignatures. */ + public handwrittenSignatures: string[]; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance + */ + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; + + /** + * Verifies a DotnetSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DotnetSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @param message DotnetSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DotnetSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DotnetSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RubySettings. */ + interface IRubySettings { + + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { + + /** + * Constructs a new RubySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance + */ + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; + + /** + * Verifies a RubySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RubySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @param message RubySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RubySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RubySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoSettings. */ + interface IGoSettings { + + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { + + /** + * Constructs a new GoSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IGoSettings); + + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new GoSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GoSettings instance + */ + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; + + /** + * Verifies a GoSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @param message GoSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); + + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields */ + autoPopulatedFields?: (string[]|null); + } + + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { + + /** + * Constructs a new MethodSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; + + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields. */ + public autoPopulatedFields: string[]; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance + */ + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; + + /** + * Verifies a MethodSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @param message MethodSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodSettings { + + /** Properties of a LongRunning. */ + interface ILongRunning { + + /** LongRunning initialPollDelay */ + initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier */ + pollDelayMultiplier?: (number|null); + + /** LongRunning maxPollDelay */ + maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout */ + totalPollTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a LongRunning. */ + class LongRunning implements ILongRunning { + + /** + * Constructs a new LongRunning. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MethodSettings.ILongRunning); + + /** LongRunning initialPollDelay. */ + public initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier. */ + public pollDelayMultiplier: number; + + /** LongRunning maxPollDelay. */ + public maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout. */ + public totalPollTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new LongRunning instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunning instance + */ + public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; + + /** + * Verifies a LongRunning message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunning + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @param message LongRunning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4, + SHOPPING = 5, + GEO = 6, + GENERATIVE_AI = 7 + } + + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + + /** 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 FieldInfo. */ + interface IFieldInfo { + + /** FieldInfo format */ + format?: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format|null); + } + + /** Represents a FieldInfo. */ + class FieldInfo implements IFieldInfo { + + /** + * Constructs a new FieldInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IFieldInfo); + + /** FieldInfo format. */ + public format: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format); + + /** + * Creates a new FieldInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldInfo instance + */ + public static create(properties?: google.api.IFieldInfo): google.api.FieldInfo; + + /** + * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @param message FieldInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @param message FieldInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldInfo + * @throws {Error} If the payload is not 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.FieldInfo; + + /** + * Decodes a FieldInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldInfo + * @throws {Error} If the payload 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.FieldInfo; + + /** + * Verifies a FieldInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldInfo + */ + public static fromObject(object: { [k: string]: any }): google.api.FieldInfo; + + /** + * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. + * @param message FieldInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.FieldInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldInfo { + + /** Format enum. */ + enum Format { + FORMAT_UNSPECIFIED = 0, + UUID4 = 1, + IPV4 = 2, + IPV6 = 3, + IPV4_OR_IPV6 = 4 + } + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Edition enum. */ + enum Edition { + EDITION_UNKNOWN = 0, + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + EDITION_2023 = 1000, + EDITION_2024 = 1001, + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + EDITION_MAX = 2147483647 + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ExtensionRangeOptions declaration */ + declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); + + /** ExtensionRangeOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification */ + verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** ExtensionRangeOptions declaration. */ + public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; + + /** ExtensionRangeOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification. */ + public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExtensionRangeOptions { + + /** Properties of a Declaration. */ + interface IDeclaration { + + /** Declaration number */ + number?: (number|null); + + /** Declaration fullName */ + fullName?: (string|null); + + /** Declaration type */ + type?: (string|null); + + /** Declaration reserved */ + reserved?: (boolean|null); + + /** Declaration repeated */ + repeated?: (boolean|null); + } + + /** Represents a Declaration. */ + class Declaration implements IDeclaration { + + /** + * Constructs a new Declaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); + + /** Declaration number. */ + public number: number; + + /** Declaration fullName. */ + public fullName: string; + + /** Declaration type. */ + public type: string; + + /** Declaration reserved. */ + public reserved: boolean; + + /** Declaration repeated. */ + public repeated: boolean; + + /** + * Creates a new Declaration instance using the specified properties. + * @param [properties] Properties to set + * @returns Declaration instance + */ + public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Verifies a Declaration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Declaration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @param message Declaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Declaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Declaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VerificationState enum. */ + enum VerificationState { + DECLARATION = 0, + UNVERIFIED = 1 + } + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REPEATED = 3, + LABEL_REQUIRED = 2 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** MessageOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** MessageOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions debugRedact */ + debugRedact?: (boolean|null); + + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + + /** FieldOptions targets */ + targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); + + /** FieldOptions editionDefaults */ + editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); + + /** FieldOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.fieldInfo */ + ".google.api.fieldInfo"?: (google.api.IFieldInfo|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions debugRedact. */ + public debugRedact: boolean; + + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions targets. */ + public targets: google.protobuf.FieldOptions.OptionTargetType[]; + + /** FieldOptions editionDefaults. */ + public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; + + /** FieldOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } + + /** OptionTargetType enum. */ + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9 + } + + /** Properties of an EditionDefault. */ + interface IEditionDefault { + + /** EditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** EditionDefault value */ + value?: (string|null); + } + + /** Represents an EditionDefault. */ + class EditionDefault implements IEditionDefault { + + /** + * Constructs a new EditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); + + /** EditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** EditionDefault value. */ + public value: string; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns EditionDefault instance + */ + public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; + + /** + * Verifies an EditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @param message EditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** EnumOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** EnumOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact. */ + public debugRedact: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|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|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + } + + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { + + /** + * Constructs a new FeatureSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSet); + + /** FeatureSet fieldPresence. */ + public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); + + /** FeatureSet enumType. */ + public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); + + /** FeatureSet repeatedFieldEncoding. */ + public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); + + /** FeatureSet utf8Validation. */ + public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); + + /** FeatureSet messageEncoding. */ + public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); + + /** FeatureSet jsonFormat. */ + public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + + /** + * Creates a new FeatureSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSet instance + */ + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; + + /** + * Verifies a FeatureSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @param message FeatureSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSet { + + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } + + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } + + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } + + /** Utf8Validation enum. */ + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3 + } + + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 + } + + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + } + + /** Properties of a FeatureSetDefaults. */ + interface IFeatureSetDefaults { + + /** FeatureSetDefaults defaults */ + defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); + + /** FeatureSetDefaults minimumEdition */ + minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetDefaults maximumEdition */ + maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSetDefaults. */ + class FeatureSetDefaults implements IFeatureSetDefaults { + + /** + * Constructs a new FeatureSetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSetDefaults); + + /** FeatureSetDefaults defaults. */ + public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; + + /** FeatureSetDefaults minimumEdition. */ + public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetDefaults maximumEdition. */ + public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetDefaults instance + */ + public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; + + /** + * Verifies a FeatureSetDefaults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @param message FeatureSetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSetDefaults { + + /** Properties of a FeatureSetEditionDefault. */ + interface IFeatureSetEditionDefault { + + /** FeatureSetEditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetEditionDefault features */ + features?: (google.protobuf.IFeatureSet|null); + } + + /** Represents a FeatureSetEditionDefault. */ + class FeatureSetEditionDefault implements IFeatureSetEditionDefault { + + /** + * Constructs a new FeatureSetEditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); + + /** FeatureSetEditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetEditionDefault features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetEditionDefault instance + */ + public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Verifies a FeatureSetEditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetEditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @param message FeatureSetEditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of 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 an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|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|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of an Interval. */ + interface IInterval { + + /** Interval startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Interval endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an Interval. */ + class Interval implements IInterval { + + /** + * Constructs a new Interval. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IInterval); + + /** Interval startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Interval endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Interval instance using the specified properties. + * @param [properties] Properties to set + * @returns Interval instance + */ + public static create(properties?: google.type.IInterval): google.type.Interval; + + /** + * Encodes the specified Interval message. Does not implicitly {@link google.type.Interval.verify|verify} messages. + * @param message Interval message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IInterval, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Interval message, length delimited. Does not implicitly {@link google.type.Interval.verify|verify} messages. + * @param message Interval message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IInterval, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Interval message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Interval + * @throws {Error} If the payload is not 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.Interval; + + /** + * Decodes an Interval message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Interval + * @throws {Error} If the payload 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.Interval; + + /** + * Verifies an Interval message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Interval message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Interval + */ + public static fromObject(object: { [k: string]: any }): google.type.Interval; + + /** + * Creates a plain object from an Interval message. Also converts values to other types if specified. + * @param message Interval + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Interval, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Interval to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Interval + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.js b/owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.js new file mode 100644 index 00000000000..a1f625acff8 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.js @@ -0,0 +1,42614 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*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_batch_protos || ($protobuf.roots._google_cloud_batch_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.batch = (function() { + + /** + * Namespace batch. + * @memberof google.cloud + * @namespace + */ + var batch = {}; + + batch.v1alpha = (function() { + + /** + * Namespace v1alpha. + * @memberof google.cloud.batch + * @namespace + */ + var v1alpha = {}; + + v1alpha.BatchService = (function() { + + /** + * Constructs a new BatchService service. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a BatchService + * @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 BatchService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (BatchService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = BatchService; + + /** + * Creates new BatchService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.batch.v1alpha.BatchService + * @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 {BatchService} RPC service. Useful where requests and/or responses are streamed. + */ + BatchService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|createJob}. + * @memberof google.cloud.batch.v1alpha.BatchService + * @typedef CreateJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.batch.v1alpha.Job} [response] Job + */ + + /** + * Calls CreateJob. + * @function createJob + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.ICreateJobRequest} request CreateJobRequest message or plain object + * @param {google.cloud.batch.v1alpha.BatchService.CreateJobCallback} callback Node-style callback called with the error, if any, and Job + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.createJob = function createJob(request, callback) { + return this.rpcCall(createJob, $root.google.cloud.batch.v1alpha.CreateJobRequest, $root.google.cloud.batch.v1alpha.Job, request, callback); + }, "name", { value: "CreateJob" }); + + /** + * Calls CreateJob. + * @function createJob + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.ICreateJobRequest} request CreateJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|getJob}. + * @memberof google.cloud.batch.v1alpha.BatchService + * @typedef GetJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.batch.v1alpha.Job} [response] Job + */ + + /** + * Calls GetJob. + * @function getJob + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IGetJobRequest} request GetJobRequest message or plain object + * @param {google.cloud.batch.v1alpha.BatchService.GetJobCallback} callback Node-style callback called with the error, if any, and Job + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.getJob = function getJob(request, callback) { + return this.rpcCall(getJob, $root.google.cloud.batch.v1alpha.GetJobRequest, $root.google.cloud.batch.v1alpha.Job, request, callback); + }, "name", { value: "GetJob" }); + + /** + * Calls GetJob. + * @function getJob + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IGetJobRequest} request GetJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|deleteJob}. + * @memberof google.cloud.batch.v1alpha.BatchService + * @typedef DeleteJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteJob. + * @function deleteJob + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IDeleteJobRequest} request DeleteJobRequest message or plain object + * @param {google.cloud.batch.v1alpha.BatchService.DeleteJobCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.deleteJob = function deleteJob(request, callback) { + return this.rpcCall(deleteJob, $root.google.cloud.batch.v1alpha.DeleteJobRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteJob" }); + + /** + * Calls DeleteJob. + * @function deleteJob + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IDeleteJobRequest} request DeleteJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|cancelJob}. + * @memberof google.cloud.batch.v1alpha.BatchService + * @typedef CancelJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CancelJob. + * @function cancelJob + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.ICancelJobRequest} request CancelJobRequest message or plain object + * @param {google.cloud.batch.v1alpha.BatchService.CancelJobCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.cancelJob = function cancelJob(request, callback) { + return this.rpcCall(cancelJob, $root.google.cloud.batch.v1alpha.CancelJobRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CancelJob" }); + + /** + * Calls CancelJob. + * @function cancelJob + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.ICancelJobRequest} request CancelJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|updateJob}. + * @memberof google.cloud.batch.v1alpha.BatchService + * @typedef UpdateJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.batch.v1alpha.Job} [response] Job + */ + + /** + * Calls UpdateJob. + * @function updateJob + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IUpdateJobRequest} request UpdateJobRequest message or plain object + * @param {google.cloud.batch.v1alpha.BatchService.UpdateJobCallback} callback Node-style callback called with the error, if any, and Job + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.updateJob = function updateJob(request, callback) { + return this.rpcCall(updateJob, $root.google.cloud.batch.v1alpha.UpdateJobRequest, $root.google.cloud.batch.v1alpha.Job, request, callback); + }, "name", { value: "UpdateJob" }); + + /** + * Calls UpdateJob. + * @function updateJob + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IUpdateJobRequest} request UpdateJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|listJobs}. + * @memberof google.cloud.batch.v1alpha.BatchService + * @typedef ListJobsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.batch.v1alpha.ListJobsResponse} [response] ListJobsResponse + */ + + /** + * Calls ListJobs. + * @function listJobs + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IListJobsRequest} request ListJobsRequest message or plain object + * @param {google.cloud.batch.v1alpha.BatchService.ListJobsCallback} callback Node-style callback called with the error, if any, and ListJobsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.listJobs = function listJobs(request, callback) { + return this.rpcCall(listJobs, $root.google.cloud.batch.v1alpha.ListJobsRequest, $root.google.cloud.batch.v1alpha.ListJobsResponse, request, callback); + }, "name", { value: "ListJobs" }); + + /** + * Calls ListJobs. + * @function listJobs + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IListJobsRequest} request ListJobsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|getTask}. + * @memberof google.cloud.batch.v1alpha.BatchService + * @typedef GetTaskCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.batch.v1alpha.Task} [response] Task + */ + + /** + * Calls GetTask. + * @function getTask + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IGetTaskRequest} request GetTaskRequest message or plain object + * @param {google.cloud.batch.v1alpha.BatchService.GetTaskCallback} callback Node-style callback called with the error, if any, and Task + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.getTask = function getTask(request, callback) { + return this.rpcCall(getTask, $root.google.cloud.batch.v1alpha.GetTaskRequest, $root.google.cloud.batch.v1alpha.Task, request, callback); + }, "name", { value: "GetTask" }); + + /** + * Calls GetTask. + * @function getTask + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IGetTaskRequest} request GetTaskRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|listTasks}. + * @memberof google.cloud.batch.v1alpha.BatchService + * @typedef ListTasksCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.batch.v1alpha.ListTasksResponse} [response] ListTasksResponse + */ + + /** + * Calls ListTasks. + * @function listTasks + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IListTasksRequest} request ListTasksRequest message or plain object + * @param {google.cloud.batch.v1alpha.BatchService.ListTasksCallback} callback Node-style callback called with the error, if any, and ListTasksResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.listTasks = function listTasks(request, callback) { + return this.rpcCall(listTasks, $root.google.cloud.batch.v1alpha.ListTasksRequest, $root.google.cloud.batch.v1alpha.ListTasksResponse, request, callback); + }, "name", { value: "ListTasks" }); + + /** + * Calls ListTasks. + * @function listTasks + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IListTasksRequest} request ListTasksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|createResourceAllowance}. + * @memberof google.cloud.batch.v1alpha.BatchService + * @typedef CreateResourceAllowanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.batch.v1alpha.ResourceAllowance} [response] ResourceAllowance + */ + + /** + * Calls CreateResourceAllowance. + * @function createResourceAllowance + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest} request CreateResourceAllowanceRequest message or plain object + * @param {google.cloud.batch.v1alpha.BatchService.CreateResourceAllowanceCallback} callback Node-style callback called with the error, if any, and ResourceAllowance + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.createResourceAllowance = function createResourceAllowance(request, callback) { + return this.rpcCall(createResourceAllowance, $root.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest, $root.google.cloud.batch.v1alpha.ResourceAllowance, request, callback); + }, "name", { value: "CreateResourceAllowance" }); + + /** + * Calls CreateResourceAllowance. + * @function createResourceAllowance + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest} request CreateResourceAllowanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|getResourceAllowance}. + * @memberof google.cloud.batch.v1alpha.BatchService + * @typedef GetResourceAllowanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.batch.v1alpha.ResourceAllowance} [response] ResourceAllowance + */ + + /** + * Calls GetResourceAllowance. + * @function getResourceAllowance + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IGetResourceAllowanceRequest} request GetResourceAllowanceRequest message or plain object + * @param {google.cloud.batch.v1alpha.BatchService.GetResourceAllowanceCallback} callback Node-style callback called with the error, if any, and ResourceAllowance + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.getResourceAllowance = function getResourceAllowance(request, callback) { + return this.rpcCall(getResourceAllowance, $root.google.cloud.batch.v1alpha.GetResourceAllowanceRequest, $root.google.cloud.batch.v1alpha.ResourceAllowance, request, callback); + }, "name", { value: "GetResourceAllowance" }); + + /** + * Calls GetResourceAllowance. + * @function getResourceAllowance + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IGetResourceAllowanceRequest} request GetResourceAllowanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|deleteResourceAllowance}. + * @memberof google.cloud.batch.v1alpha.BatchService + * @typedef DeleteResourceAllowanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteResourceAllowance. + * @function deleteResourceAllowance + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest} request DeleteResourceAllowanceRequest message or plain object + * @param {google.cloud.batch.v1alpha.BatchService.DeleteResourceAllowanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.deleteResourceAllowance = function deleteResourceAllowance(request, callback) { + return this.rpcCall(deleteResourceAllowance, $root.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteResourceAllowance" }); + + /** + * Calls DeleteResourceAllowance. + * @function deleteResourceAllowance + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest} request DeleteResourceAllowanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|listResourceAllowances}. + * @memberof google.cloud.batch.v1alpha.BatchService + * @typedef ListResourceAllowancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.batch.v1alpha.ListResourceAllowancesResponse} [response] ListResourceAllowancesResponse + */ + + /** + * Calls ListResourceAllowances. + * @function listResourceAllowances + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IListResourceAllowancesRequest} request ListResourceAllowancesRequest message or plain object + * @param {google.cloud.batch.v1alpha.BatchService.ListResourceAllowancesCallback} callback Node-style callback called with the error, if any, and ListResourceAllowancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.listResourceAllowances = function listResourceAllowances(request, callback) { + return this.rpcCall(listResourceAllowances, $root.google.cloud.batch.v1alpha.ListResourceAllowancesRequest, $root.google.cloud.batch.v1alpha.ListResourceAllowancesResponse, request, callback); + }, "name", { value: "ListResourceAllowances" }); + + /** + * Calls ListResourceAllowances. + * @function listResourceAllowances + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IListResourceAllowancesRequest} request ListResourceAllowancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|updateResourceAllowance}. + * @memberof google.cloud.batch.v1alpha.BatchService + * @typedef UpdateResourceAllowanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.batch.v1alpha.ResourceAllowance} [response] ResourceAllowance + */ + + /** + * Calls UpdateResourceAllowance. + * @function updateResourceAllowance + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest} request UpdateResourceAllowanceRequest message or plain object + * @param {google.cloud.batch.v1alpha.BatchService.UpdateResourceAllowanceCallback} callback Node-style callback called with the error, if any, and ResourceAllowance + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.updateResourceAllowance = function updateResourceAllowance(request, callback) { + return this.rpcCall(updateResourceAllowance, $root.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest, $root.google.cloud.batch.v1alpha.ResourceAllowance, request, callback); + }, "name", { value: "UpdateResourceAllowance" }); + + /** + * Calls UpdateResourceAllowance. + * @function updateResourceAllowance + * @memberof google.cloud.batch.v1alpha.BatchService + * @instance + * @param {google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest} request UpdateResourceAllowanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return BatchService; + })(); + + v1alpha.CreateJobRequest = (function() { + + /** + * Properties of a CreateJobRequest. + * @memberof google.cloud.batch.v1alpha + * @interface ICreateJobRequest + * @property {string|null} [parent] CreateJobRequest parent + * @property {string|null} [jobId] CreateJobRequest jobId + * @property {google.cloud.batch.v1alpha.IJob|null} [job] CreateJobRequest job + * @property {string|null} [requestId] CreateJobRequest requestId + */ + + /** + * Constructs a new CreateJobRequest. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a CreateJobRequest. + * @implements ICreateJobRequest + * @constructor + * @param {google.cloud.batch.v1alpha.ICreateJobRequest=} [properties] Properties to set + */ + function CreateJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateJobRequest parent. + * @member {string} parent + * @memberof google.cloud.batch.v1alpha.CreateJobRequest + * @instance + */ + CreateJobRequest.prototype.parent = ""; + + /** + * CreateJobRequest jobId. + * @member {string} jobId + * @memberof google.cloud.batch.v1alpha.CreateJobRequest + * @instance + */ + CreateJobRequest.prototype.jobId = ""; + + /** + * CreateJobRequest job. + * @member {google.cloud.batch.v1alpha.IJob|null|undefined} job + * @memberof google.cloud.batch.v1alpha.CreateJobRequest + * @instance + */ + CreateJobRequest.prototype.job = null; + + /** + * CreateJobRequest requestId. + * @member {string} requestId + * @memberof google.cloud.batch.v1alpha.CreateJobRequest + * @instance + */ + CreateJobRequest.prototype.requestId = ""; + + /** + * Creates a new CreateJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.CreateJobRequest + * @static + * @param {google.cloud.batch.v1alpha.ICreateJobRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.CreateJobRequest} CreateJobRequest instance + */ + CreateJobRequest.create = function create(properties) { + return new CreateJobRequest(properties); + }; + + /** + * Encodes the specified CreateJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.CreateJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.CreateJobRequest + * @static + * @param {google.cloud.batch.v1alpha.ICreateJobRequest} message CreateJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.jobId); + if (message.job != null && Object.hasOwnProperty.call(message, "job")) + $root.google.cloud.batch.v1alpha.Job.encode(message.job, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.CreateJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.CreateJobRequest + * @static + * @param {google.cloud.batch.v1alpha.ICreateJobRequest} message CreateJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.CreateJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.CreateJobRequest} CreateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.CreateJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.jobId = reader.string(); + break; + } + case 3: { + message.job = $root.google.cloud.batch.v1alpha.Job.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.CreateJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.CreateJobRequest} CreateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateJobRequest message. + * @function verify + * @memberof google.cloud.batch.v1alpha.CreateJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.jobId != null && message.hasOwnProperty("jobId")) + if (!$util.isString(message.jobId)) + return "jobId: string expected"; + if (message.job != null && message.hasOwnProperty("job")) { + var error = $root.google.cloud.batch.v1alpha.Job.verify(message.job); + if (error) + return "job." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.CreateJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.CreateJobRequest} CreateJobRequest + */ + CreateJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.CreateJobRequest) + return object; + var message = new $root.google.cloud.batch.v1alpha.CreateJobRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.jobId != null) + message.jobId = String(object.jobId); + if (object.job != null) { + if (typeof object.job !== "object") + throw TypeError(".google.cloud.batch.v1alpha.CreateJobRequest.job: object expected"); + message.job = $root.google.cloud.batch.v1alpha.Job.fromObject(object.job); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.CreateJobRequest + * @static + * @param {google.cloud.batch.v1alpha.CreateJobRequest} message CreateJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.jobId = ""; + object.job = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.jobId != null && message.hasOwnProperty("jobId")) + object.jobId = message.jobId; + if (message.job != null && message.hasOwnProperty("job")) + object.job = $root.google.cloud.batch.v1alpha.Job.toObject(message.job, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.CreateJobRequest + * @instance + * @returns {Object.} JSON object + */ + CreateJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateJobRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.CreateJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.CreateJobRequest"; + }; + + return CreateJobRequest; + })(); + + v1alpha.GetJobRequest = (function() { + + /** + * Properties of a GetJobRequest. + * @memberof google.cloud.batch.v1alpha + * @interface IGetJobRequest + * @property {string|null} [name] GetJobRequest name + */ + + /** + * Constructs a new GetJobRequest. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a GetJobRequest. + * @implements IGetJobRequest + * @constructor + * @param {google.cloud.batch.v1alpha.IGetJobRequest=} [properties] Properties to set + */ + function GetJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetJobRequest name. + * @member {string} name + * @memberof google.cloud.batch.v1alpha.GetJobRequest + * @instance + */ + GetJobRequest.prototype.name = ""; + + /** + * Creates a new GetJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.GetJobRequest + * @static + * @param {google.cloud.batch.v1alpha.IGetJobRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.GetJobRequest} GetJobRequest instance + */ + GetJobRequest.create = function create(properties) { + return new GetJobRequest(properties); + }; + + /** + * Encodes the specified GetJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.GetJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.GetJobRequest + * @static + * @param {google.cloud.batch.v1alpha.IGetJobRequest} message GetJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetJobRequest.encode = function encode(message, writer) { + 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 GetJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.GetJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.GetJobRequest + * @static + * @param {google.cloud.batch.v1alpha.IGetJobRequest} message GetJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.GetJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.GetJobRequest} GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.GetJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.GetJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.GetJobRequest} GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetJobRequest message. + * @function verify + * @memberof google.cloud.batch.v1alpha.GetJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.GetJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.GetJobRequest} GetJobRequest + */ + GetJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.GetJobRequest) + return object; + var message = new $root.google.cloud.batch.v1alpha.GetJobRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.GetJobRequest + * @static + * @param {google.cloud.batch.v1alpha.GetJobRequest} message GetJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetJobRequest.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 GetJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.GetJobRequest + * @instance + * @returns {Object.} JSON object + */ + GetJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetJobRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.GetJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.GetJobRequest"; + }; + + return GetJobRequest; + })(); + + v1alpha.DeleteJobRequest = (function() { + + /** + * Properties of a DeleteJobRequest. + * @memberof google.cloud.batch.v1alpha + * @interface IDeleteJobRequest + * @property {string|null} [name] DeleteJobRequest name + * @property {string|null} [reason] DeleteJobRequest reason + * @property {string|null} [requestId] DeleteJobRequest requestId + */ + + /** + * Constructs a new DeleteJobRequest. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a DeleteJobRequest. + * @implements IDeleteJobRequest + * @constructor + * @param {google.cloud.batch.v1alpha.IDeleteJobRequest=} [properties] Properties to set + */ + function DeleteJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteJobRequest name. + * @member {string} name + * @memberof google.cloud.batch.v1alpha.DeleteJobRequest + * @instance + */ + DeleteJobRequest.prototype.name = ""; + + /** + * DeleteJobRequest reason. + * @member {string} reason + * @memberof google.cloud.batch.v1alpha.DeleteJobRequest + * @instance + */ + DeleteJobRequest.prototype.reason = ""; + + /** + * DeleteJobRequest requestId. + * @member {string} requestId + * @memberof google.cloud.batch.v1alpha.DeleteJobRequest + * @instance + */ + DeleteJobRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.DeleteJobRequest + * @static + * @param {google.cloud.batch.v1alpha.IDeleteJobRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.DeleteJobRequest} DeleteJobRequest instance + */ + DeleteJobRequest.create = function create(properties) { + return new DeleteJobRequest(properties); + }; + + /** + * Encodes the specified DeleteJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.DeleteJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.DeleteJobRequest + * @static + * @param {google.cloud.batch.v1alpha.IDeleteJobRequest} message DeleteJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.reason); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.DeleteJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.DeleteJobRequest + * @static + * @param {google.cloud.batch.v1alpha.IDeleteJobRequest} message DeleteJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.DeleteJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.DeleteJobRequest} DeleteJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.DeleteJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.reason = reader.string(); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.DeleteJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.DeleteJobRequest} DeleteJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteJobRequest message. + * @function verify + * @memberof google.cloud.batch.v1alpha.DeleteJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.reason != null && message.hasOwnProperty("reason")) + if (!$util.isString(message.reason)) + return "reason: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.DeleteJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.DeleteJobRequest} DeleteJobRequest + */ + DeleteJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.DeleteJobRequest) + return object; + var message = new $root.google.cloud.batch.v1alpha.DeleteJobRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.reason != null) + message.reason = String(object.reason); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.DeleteJobRequest + * @static + * @param {google.cloud.batch.v1alpha.DeleteJobRequest} message DeleteJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.reason = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.reason != null && message.hasOwnProperty("reason")) + object.reason = message.reason; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.DeleteJobRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteJobRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.DeleteJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.DeleteJobRequest"; + }; + + return DeleteJobRequest; + })(); + + v1alpha.CancelJobRequest = (function() { + + /** + * Properties of a CancelJobRequest. + * @memberof google.cloud.batch.v1alpha + * @interface ICancelJobRequest + * @property {string|null} [name] CancelJobRequest name + * @property {string|null} [requestId] CancelJobRequest requestId + */ + + /** + * Constructs a new CancelJobRequest. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a CancelJobRequest. + * @implements ICancelJobRequest + * @constructor + * @param {google.cloud.batch.v1alpha.ICancelJobRequest=} [properties] Properties to set + */ + function CancelJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelJobRequest name. + * @member {string} name + * @memberof google.cloud.batch.v1alpha.CancelJobRequest + * @instance + */ + CancelJobRequest.prototype.name = ""; + + /** + * CancelJobRequest requestId. + * @member {string} requestId + * @memberof google.cloud.batch.v1alpha.CancelJobRequest + * @instance + */ + CancelJobRequest.prototype.requestId = ""; + + /** + * Creates a new CancelJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.CancelJobRequest + * @static + * @param {google.cloud.batch.v1alpha.ICancelJobRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.CancelJobRequest} CancelJobRequest instance + */ + CancelJobRequest.create = function create(properties) { + return new CancelJobRequest(properties); + }; + + /** + * Encodes the specified CancelJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.CancelJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.CancelJobRequest + * @static + * @param {google.cloud.batch.v1alpha.ICancelJobRequest} message CancelJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CancelJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.CancelJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.CancelJobRequest + * @static + * @param {google.cloud.batch.v1alpha.ICancelJobRequest} message CancelJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.CancelJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.CancelJobRequest} CancelJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.CancelJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.CancelJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.CancelJobRequest} CancelJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelJobRequest message. + * @function verify + * @memberof google.cloud.batch.v1alpha.CancelJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CancelJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.CancelJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.CancelJobRequest} CancelJobRequest + */ + CancelJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.CancelJobRequest) + return object; + var message = new $root.google.cloud.batch.v1alpha.CancelJobRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CancelJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.CancelJobRequest + * @static + * @param {google.cloud.batch.v1alpha.CancelJobRequest} message CancelJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CancelJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.CancelJobRequest + * @instance + * @returns {Object.} JSON object + */ + CancelJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelJobRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.CancelJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.CancelJobRequest"; + }; + + return CancelJobRequest; + })(); + + v1alpha.CancelJobResponse = (function() { + + /** + * Properties of a CancelJobResponse. + * @memberof google.cloud.batch.v1alpha + * @interface ICancelJobResponse + */ + + /** + * Constructs a new CancelJobResponse. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a CancelJobResponse. + * @implements ICancelJobResponse + * @constructor + * @param {google.cloud.batch.v1alpha.ICancelJobResponse=} [properties] Properties to set + */ + function CancelJobResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new CancelJobResponse instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.CancelJobResponse + * @static + * @param {google.cloud.batch.v1alpha.ICancelJobResponse=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.CancelJobResponse} CancelJobResponse instance + */ + CancelJobResponse.create = function create(properties) { + return new CancelJobResponse(properties); + }; + + /** + * Encodes the specified CancelJobResponse message. Does not implicitly {@link google.cloud.batch.v1alpha.CancelJobResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.CancelJobResponse + * @static + * @param {google.cloud.batch.v1alpha.ICancelJobResponse} message CancelJobResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelJobResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified CancelJobResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.CancelJobResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.CancelJobResponse + * @static + * @param {google.cloud.batch.v1alpha.ICancelJobResponse} message CancelJobResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelJobResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelJobResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.CancelJobResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.CancelJobResponse} CancelJobResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelJobResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.CancelJobResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelJobResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.CancelJobResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.CancelJobResponse} CancelJobResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelJobResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelJobResponse message. + * @function verify + * @memberof google.cloud.batch.v1alpha.CancelJobResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelJobResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a CancelJobResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.CancelJobResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.CancelJobResponse} CancelJobResponse + */ + CancelJobResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.CancelJobResponse) + return object; + return new $root.google.cloud.batch.v1alpha.CancelJobResponse(); + }; + + /** + * Creates a plain object from a CancelJobResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.CancelJobResponse + * @static + * @param {google.cloud.batch.v1alpha.CancelJobResponse} message CancelJobResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelJobResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this CancelJobResponse to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.CancelJobResponse + * @instance + * @returns {Object.} JSON object + */ + CancelJobResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelJobResponse + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.CancelJobResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelJobResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.CancelJobResponse"; + }; + + return CancelJobResponse; + })(); + + v1alpha.UpdateJobRequest = (function() { + + /** + * Properties of an UpdateJobRequest. + * @memberof google.cloud.batch.v1alpha + * @interface IUpdateJobRequest + * @property {google.cloud.batch.v1alpha.IJob|null} [job] UpdateJobRequest job + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateJobRequest updateMask + * @property {string|null} [requestId] UpdateJobRequest requestId + */ + + /** + * Constructs a new UpdateJobRequest. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents an UpdateJobRequest. + * @implements IUpdateJobRequest + * @constructor + * @param {google.cloud.batch.v1alpha.IUpdateJobRequest=} [properties] Properties to set + */ + function UpdateJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateJobRequest job. + * @member {google.cloud.batch.v1alpha.IJob|null|undefined} job + * @memberof google.cloud.batch.v1alpha.UpdateJobRequest + * @instance + */ + UpdateJobRequest.prototype.job = null; + + /** + * UpdateJobRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.batch.v1alpha.UpdateJobRequest + * @instance + */ + UpdateJobRequest.prototype.updateMask = null; + + /** + * UpdateJobRequest requestId. + * @member {string} requestId + * @memberof google.cloud.batch.v1alpha.UpdateJobRequest + * @instance + */ + UpdateJobRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.UpdateJobRequest + * @static + * @param {google.cloud.batch.v1alpha.IUpdateJobRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.UpdateJobRequest} UpdateJobRequest instance + */ + UpdateJobRequest.create = function create(properties) { + return new UpdateJobRequest(properties); + }; + + /** + * Encodes the specified UpdateJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.UpdateJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.UpdateJobRequest + * @static + * @param {google.cloud.batch.v1alpha.IUpdateJobRequest} message UpdateJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.job != null && Object.hasOwnProperty.call(message, "job")) + $root.google.cloud.batch.v1alpha.Job.encode(message.job, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UpdateJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.UpdateJobRequest + * @static + * @param {google.cloud.batch.v1alpha.IUpdateJobRequest} message UpdateJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.UpdateJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.UpdateJobRequest} UpdateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.UpdateJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.job = $root.google.cloud.batch.v1alpha.Job.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.UpdateJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.UpdateJobRequest} UpdateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateJobRequest message. + * @function verify + * @memberof google.cloud.batch.v1alpha.UpdateJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.job != null && message.hasOwnProperty("job")) { + var error = $root.google.cloud.batch.v1alpha.Job.verify(message.job); + if (error) + return "job." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.UpdateJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.UpdateJobRequest} UpdateJobRequest + */ + UpdateJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.UpdateJobRequest) + return object; + var message = new $root.google.cloud.batch.v1alpha.UpdateJobRequest(); + if (object.job != null) { + if (typeof object.job !== "object") + throw TypeError(".google.cloud.batch.v1alpha.UpdateJobRequest.job: object expected"); + message.job = $root.google.cloud.batch.v1alpha.Job.fromObject(object.job); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.batch.v1alpha.UpdateJobRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.UpdateJobRequest + * @static + * @param {google.cloud.batch.v1alpha.UpdateJobRequest} message UpdateJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.job = null; + object.updateMask = null; + object.requestId = ""; + } + if (message.job != null && message.hasOwnProperty("job")) + object.job = $root.google.cloud.batch.v1alpha.Job.toObject(message.job, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.UpdateJobRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateJobRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.UpdateJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.UpdateJobRequest"; + }; + + return UpdateJobRequest; + })(); + + v1alpha.ListJobsRequest = (function() { + + /** + * Properties of a ListJobsRequest. + * @memberof google.cloud.batch.v1alpha + * @interface IListJobsRequest + * @property {string|null} [parent] ListJobsRequest parent + * @property {string|null} [filter] ListJobsRequest filter + * @property {string|null} [orderBy] ListJobsRequest orderBy + * @property {number|null} [pageSize] ListJobsRequest pageSize + * @property {string|null} [pageToken] ListJobsRequest pageToken + */ + + /** + * Constructs a new ListJobsRequest. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a ListJobsRequest. + * @implements IListJobsRequest + * @constructor + * @param {google.cloud.batch.v1alpha.IListJobsRequest=} [properties] Properties to set + */ + function ListJobsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListJobsRequest parent. + * @member {string} parent + * @memberof google.cloud.batch.v1alpha.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.parent = ""; + + /** + * ListJobsRequest filter. + * @member {string} filter + * @memberof google.cloud.batch.v1alpha.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.filter = ""; + + /** + * ListJobsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.batch.v1alpha.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.orderBy = ""; + + /** + * ListJobsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.batch.v1alpha.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.pageSize = 0; + + /** + * ListJobsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.batch.v1alpha.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListJobsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.ListJobsRequest + * @static + * @param {google.cloud.batch.v1alpha.IListJobsRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.ListJobsRequest} ListJobsRequest instance + */ + ListJobsRequest.create = function create(properties) { + return new ListJobsRequest(properties); + }; + + /** + * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.ListJobsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.ListJobsRequest + * @static + * @param {google.cloud.batch.v1alpha.IListJobsRequest} message ListJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListJobsRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListJobsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.ListJobsRequest + * @static + * @param {google.cloud.batch.v1alpha.IListJobsRequest} message ListJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.ListJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.ListJobsRequest} ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ListJobsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.ListJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.ListJobsRequest} ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListJobsRequest message. + * @function verify + * @memberof google.cloud.batch.v1alpha.ListJobsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListJobsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListJobsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.ListJobsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.ListJobsRequest} ListJobsRequest + */ + ListJobsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.ListJobsRequest) + return object; + var message = new $root.google.cloud.batch.v1alpha.ListJobsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListJobsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.ListJobsRequest + * @static + * @param {google.cloud.batch.v1alpha.ListJobsRequest} message ListJobsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListJobsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListJobsRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.ListJobsRequest + * @instance + * @returns {Object.} JSON object + */ + ListJobsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListJobsRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.ListJobsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListJobsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.ListJobsRequest"; + }; + + return ListJobsRequest; + })(); + + v1alpha.ListJobsResponse = (function() { + + /** + * Properties of a ListJobsResponse. + * @memberof google.cloud.batch.v1alpha + * @interface IListJobsResponse + * @property {Array.|null} [jobs] ListJobsResponse jobs + * @property {string|null} [nextPageToken] ListJobsResponse nextPageToken + * @property {Array.|null} [unreachable] ListJobsResponse unreachable + */ + + /** + * Constructs a new ListJobsResponse. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a ListJobsResponse. + * @implements IListJobsResponse + * @constructor + * @param {google.cloud.batch.v1alpha.IListJobsResponse=} [properties] Properties to set + */ + function ListJobsResponse(properties) { + this.jobs = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListJobsResponse jobs. + * @member {Array.} jobs + * @memberof google.cloud.batch.v1alpha.ListJobsResponse + * @instance + */ + ListJobsResponse.prototype.jobs = $util.emptyArray; + + /** + * ListJobsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.batch.v1alpha.ListJobsResponse + * @instance + */ + ListJobsResponse.prototype.nextPageToken = ""; + + /** + * ListJobsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.batch.v1alpha.ListJobsResponse + * @instance + */ + ListJobsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListJobsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.ListJobsResponse + * @static + * @param {google.cloud.batch.v1alpha.IListJobsResponse=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.ListJobsResponse} ListJobsResponse instance + */ + ListJobsResponse.create = function create(properties) { + return new ListJobsResponse(properties); + }; + + /** + * Encodes the specified ListJobsResponse message. Does not implicitly {@link google.cloud.batch.v1alpha.ListJobsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.ListJobsResponse + * @static + * @param {google.cloud.batch.v1alpha.IListJobsResponse} message ListJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.jobs != null && message.jobs.length) + for (var i = 0; i < message.jobs.length; ++i) + $root.google.cloud.batch.v1alpha.Job.encode(message.jobs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListJobsResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListJobsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.ListJobsResponse + * @static + * @param {google.cloud.batch.v1alpha.IListJobsResponse} message ListJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.ListJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.ListJobsResponse} ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ListJobsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.jobs && message.jobs.length)) + message.jobs = []; + message.jobs.push($root.google.cloud.batch.v1alpha.Job.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.ListJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.ListJobsResponse} ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListJobsResponse message. + * @function verify + * @memberof google.cloud.batch.v1alpha.ListJobsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListJobsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.jobs != null && message.hasOwnProperty("jobs")) { + if (!Array.isArray(message.jobs)) + return "jobs: array expected"; + for (var i = 0; i < message.jobs.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.Job.verify(message.jobs[i]); + if (error) + return "jobs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListJobsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.ListJobsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.ListJobsResponse} ListJobsResponse + */ + ListJobsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.ListJobsResponse) + return object; + var message = new $root.google.cloud.batch.v1alpha.ListJobsResponse(); + if (object.jobs) { + if (!Array.isArray(object.jobs)) + throw TypeError(".google.cloud.batch.v1alpha.ListJobsResponse.jobs: array expected"); + message.jobs = []; + for (var i = 0; i < object.jobs.length; ++i) { + if (typeof object.jobs[i] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.ListJobsResponse.jobs: object expected"); + message.jobs[i] = $root.google.cloud.batch.v1alpha.Job.fromObject(object.jobs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.batch.v1alpha.ListJobsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListJobsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.ListJobsResponse + * @static + * @param {google.cloud.batch.v1alpha.ListJobsResponse} message ListJobsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListJobsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.jobs = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.jobs && message.jobs.length) { + object.jobs = []; + for (var j = 0; j < message.jobs.length; ++j) + object.jobs[j] = $root.google.cloud.batch.v1alpha.Job.toObject(message.jobs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListJobsResponse to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.ListJobsResponse + * @instance + * @returns {Object.} JSON object + */ + ListJobsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListJobsResponse + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.ListJobsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListJobsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.ListJobsResponse"; + }; + + return ListJobsResponse; + })(); + + v1alpha.ListTasksRequest = (function() { + + /** + * Properties of a ListTasksRequest. + * @memberof google.cloud.batch.v1alpha + * @interface IListTasksRequest + * @property {string|null} [parent] ListTasksRequest parent + * @property {string|null} [filter] ListTasksRequest filter + * @property {string|null} [orderBy] ListTasksRequest orderBy + * @property {number|null} [pageSize] ListTasksRequest pageSize + * @property {string|null} [pageToken] ListTasksRequest pageToken + */ + + /** + * Constructs a new ListTasksRequest. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a ListTasksRequest. + * @implements IListTasksRequest + * @constructor + * @param {google.cloud.batch.v1alpha.IListTasksRequest=} [properties] Properties to set + */ + function ListTasksRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTasksRequest parent. + * @member {string} parent + * @memberof google.cloud.batch.v1alpha.ListTasksRequest + * @instance + */ + ListTasksRequest.prototype.parent = ""; + + /** + * ListTasksRequest filter. + * @member {string} filter + * @memberof google.cloud.batch.v1alpha.ListTasksRequest + * @instance + */ + ListTasksRequest.prototype.filter = ""; + + /** + * ListTasksRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.batch.v1alpha.ListTasksRequest + * @instance + */ + ListTasksRequest.prototype.orderBy = ""; + + /** + * ListTasksRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.batch.v1alpha.ListTasksRequest + * @instance + */ + ListTasksRequest.prototype.pageSize = 0; + + /** + * ListTasksRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.batch.v1alpha.ListTasksRequest + * @instance + */ + ListTasksRequest.prototype.pageToken = ""; + + /** + * Creates a new ListTasksRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.ListTasksRequest + * @static + * @param {google.cloud.batch.v1alpha.IListTasksRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.ListTasksRequest} ListTasksRequest instance + */ + ListTasksRequest.create = function create(properties) { + return new ListTasksRequest(properties); + }; + + /** + * Encodes the specified ListTasksRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.ListTasksRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.ListTasksRequest + * @static + * @param {google.cloud.batch.v1alpha.IListTasksRequest} message ListTasksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTasksRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListTasksRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListTasksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.ListTasksRequest + * @static + * @param {google.cloud.batch.v1alpha.IListTasksRequest} message ListTasksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTasksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTasksRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.ListTasksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.ListTasksRequest} ListTasksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTasksRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ListTasksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTasksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.ListTasksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.ListTasksRequest} ListTasksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTasksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTasksRequest message. + * @function verify + * @memberof google.cloud.batch.v1alpha.ListTasksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTasksRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListTasksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.ListTasksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.ListTasksRequest} ListTasksRequest + */ + ListTasksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.ListTasksRequest) + return object; + var message = new $root.google.cloud.batch.v1alpha.ListTasksRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListTasksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.ListTasksRequest + * @static + * @param {google.cloud.batch.v1alpha.ListTasksRequest} message ListTasksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTasksRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListTasksRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.ListTasksRequest + * @instance + * @returns {Object.} JSON object + */ + ListTasksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTasksRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.ListTasksRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTasksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.ListTasksRequest"; + }; + + return ListTasksRequest; + })(); + + v1alpha.ListTasksResponse = (function() { + + /** + * Properties of a ListTasksResponse. + * @memberof google.cloud.batch.v1alpha + * @interface IListTasksResponse + * @property {Array.|null} [tasks] ListTasksResponse tasks + * @property {string|null} [nextPageToken] ListTasksResponse nextPageToken + * @property {Array.|null} [unreachable] ListTasksResponse unreachable + */ + + /** + * Constructs a new ListTasksResponse. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a ListTasksResponse. + * @implements IListTasksResponse + * @constructor + * @param {google.cloud.batch.v1alpha.IListTasksResponse=} [properties] Properties to set + */ + function ListTasksResponse(properties) { + this.tasks = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTasksResponse tasks. + * @member {Array.} tasks + * @memberof google.cloud.batch.v1alpha.ListTasksResponse + * @instance + */ + ListTasksResponse.prototype.tasks = $util.emptyArray; + + /** + * ListTasksResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.batch.v1alpha.ListTasksResponse + * @instance + */ + ListTasksResponse.prototype.nextPageToken = ""; + + /** + * ListTasksResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.batch.v1alpha.ListTasksResponse + * @instance + */ + ListTasksResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListTasksResponse instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.ListTasksResponse + * @static + * @param {google.cloud.batch.v1alpha.IListTasksResponse=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.ListTasksResponse} ListTasksResponse instance + */ + ListTasksResponse.create = function create(properties) { + return new ListTasksResponse(properties); + }; + + /** + * Encodes the specified ListTasksResponse message. Does not implicitly {@link google.cloud.batch.v1alpha.ListTasksResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.ListTasksResponse + * @static + * @param {google.cloud.batch.v1alpha.IListTasksResponse} message ListTasksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTasksResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tasks != null && message.tasks.length) + for (var i = 0; i < message.tasks.length; ++i) + $root.google.cloud.batch.v1alpha.Task.encode(message.tasks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListTasksResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListTasksResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.ListTasksResponse + * @static + * @param {google.cloud.batch.v1alpha.IListTasksResponse} message ListTasksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTasksResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTasksResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.ListTasksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.ListTasksResponse} ListTasksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTasksResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ListTasksResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.tasks && message.tasks.length)) + message.tasks = []; + message.tasks.push($root.google.cloud.batch.v1alpha.Task.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTasksResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.ListTasksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.ListTasksResponse} ListTasksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTasksResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTasksResponse message. + * @function verify + * @memberof google.cloud.batch.v1alpha.ListTasksResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTasksResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tasks != null && message.hasOwnProperty("tasks")) { + if (!Array.isArray(message.tasks)) + return "tasks: array expected"; + for (var i = 0; i < message.tasks.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.Task.verify(message.tasks[i]); + if (error) + return "tasks." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListTasksResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.ListTasksResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.ListTasksResponse} ListTasksResponse + */ + ListTasksResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.ListTasksResponse) + return object; + var message = new $root.google.cloud.batch.v1alpha.ListTasksResponse(); + if (object.tasks) { + if (!Array.isArray(object.tasks)) + throw TypeError(".google.cloud.batch.v1alpha.ListTasksResponse.tasks: array expected"); + message.tasks = []; + for (var i = 0; i < object.tasks.length; ++i) { + if (typeof object.tasks[i] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.ListTasksResponse.tasks: object expected"); + message.tasks[i] = $root.google.cloud.batch.v1alpha.Task.fromObject(object.tasks[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.batch.v1alpha.ListTasksResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListTasksResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.ListTasksResponse + * @static + * @param {google.cloud.batch.v1alpha.ListTasksResponse} message ListTasksResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTasksResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.tasks = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.tasks && message.tasks.length) { + object.tasks = []; + for (var j = 0; j < message.tasks.length; ++j) + object.tasks[j] = $root.google.cloud.batch.v1alpha.Task.toObject(message.tasks[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListTasksResponse to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.ListTasksResponse + * @instance + * @returns {Object.} JSON object + */ + ListTasksResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTasksResponse + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.ListTasksResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTasksResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.ListTasksResponse"; + }; + + return ListTasksResponse; + })(); + + v1alpha.GetTaskRequest = (function() { + + /** + * Properties of a GetTaskRequest. + * @memberof google.cloud.batch.v1alpha + * @interface IGetTaskRequest + * @property {string|null} [name] GetTaskRequest name + */ + + /** + * Constructs a new GetTaskRequest. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a GetTaskRequest. + * @implements IGetTaskRequest + * @constructor + * @param {google.cloud.batch.v1alpha.IGetTaskRequest=} [properties] Properties to set + */ + function GetTaskRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTaskRequest name. + * @member {string} name + * @memberof google.cloud.batch.v1alpha.GetTaskRequest + * @instance + */ + GetTaskRequest.prototype.name = ""; + + /** + * Creates a new GetTaskRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.GetTaskRequest + * @static + * @param {google.cloud.batch.v1alpha.IGetTaskRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.GetTaskRequest} GetTaskRequest instance + */ + GetTaskRequest.create = function create(properties) { + return new GetTaskRequest(properties); + }; + + /** + * Encodes the specified GetTaskRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.GetTaskRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.GetTaskRequest + * @static + * @param {google.cloud.batch.v1alpha.IGetTaskRequest} message GetTaskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTaskRequest.encode = function encode(message, writer) { + 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 GetTaskRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.GetTaskRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.GetTaskRequest + * @static + * @param {google.cloud.batch.v1alpha.IGetTaskRequest} message GetTaskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTaskRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTaskRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.GetTaskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.GetTaskRequest} GetTaskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTaskRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.GetTaskRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTaskRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.GetTaskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.GetTaskRequest} GetTaskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTaskRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTaskRequest message. + * @function verify + * @memberof google.cloud.batch.v1alpha.GetTaskRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTaskRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetTaskRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.GetTaskRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.GetTaskRequest} GetTaskRequest + */ + GetTaskRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.GetTaskRequest) + return object; + var message = new $root.google.cloud.batch.v1alpha.GetTaskRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetTaskRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.GetTaskRequest + * @static + * @param {google.cloud.batch.v1alpha.GetTaskRequest} message GetTaskRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTaskRequest.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 GetTaskRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.GetTaskRequest + * @instance + * @returns {Object.} JSON object + */ + GetTaskRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTaskRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.GetTaskRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTaskRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.GetTaskRequest"; + }; + + return GetTaskRequest; + })(); + + v1alpha.CreateResourceAllowanceRequest = (function() { + + /** + * Properties of a CreateResourceAllowanceRequest. + * @memberof google.cloud.batch.v1alpha + * @interface ICreateResourceAllowanceRequest + * @property {string|null} [parent] CreateResourceAllowanceRequest parent + * @property {string|null} [resourceAllowanceId] CreateResourceAllowanceRequest resourceAllowanceId + * @property {google.cloud.batch.v1alpha.IResourceAllowance|null} [resourceAllowance] CreateResourceAllowanceRequest resourceAllowance + * @property {string|null} [requestId] CreateResourceAllowanceRequest requestId + */ + + /** + * Constructs a new CreateResourceAllowanceRequest. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a CreateResourceAllowanceRequest. + * @implements ICreateResourceAllowanceRequest + * @constructor + * @param {google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest=} [properties] Properties to set + */ + function CreateResourceAllowanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateResourceAllowanceRequest parent. + * @member {string} parent + * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest + * @instance + */ + CreateResourceAllowanceRequest.prototype.parent = ""; + + /** + * CreateResourceAllowanceRequest resourceAllowanceId. + * @member {string} resourceAllowanceId + * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest + * @instance + */ + CreateResourceAllowanceRequest.prototype.resourceAllowanceId = ""; + + /** + * CreateResourceAllowanceRequest resourceAllowance. + * @member {google.cloud.batch.v1alpha.IResourceAllowance|null|undefined} resourceAllowance + * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest + * @instance + */ + CreateResourceAllowanceRequest.prototype.resourceAllowance = null; + + /** + * CreateResourceAllowanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest + * @instance + */ + CreateResourceAllowanceRequest.prototype.requestId = ""; + + /** + * Creates a new CreateResourceAllowanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest + * @static + * @param {google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.CreateResourceAllowanceRequest} CreateResourceAllowanceRequest instance + */ + CreateResourceAllowanceRequest.create = function create(properties) { + return new CreateResourceAllowanceRequest(properties); + }; + + /** + * Encodes the specified CreateResourceAllowanceRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.CreateResourceAllowanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest + * @static + * @param {google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest} message CreateResourceAllowanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateResourceAllowanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.resourceAllowanceId != null && Object.hasOwnProperty.call(message, "resourceAllowanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceAllowanceId); + if (message.resourceAllowance != null && Object.hasOwnProperty.call(message, "resourceAllowance")) + $root.google.cloud.batch.v1alpha.ResourceAllowance.encode(message.resourceAllowance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateResourceAllowanceRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.CreateResourceAllowanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest + * @static + * @param {google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest} message CreateResourceAllowanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateResourceAllowanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateResourceAllowanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.CreateResourceAllowanceRequest} CreateResourceAllowanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateResourceAllowanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.resourceAllowanceId = reader.string(); + break; + } + case 3: { + message.resourceAllowance = $root.google.cloud.batch.v1alpha.ResourceAllowance.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateResourceAllowanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.CreateResourceAllowanceRequest} CreateResourceAllowanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateResourceAllowanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateResourceAllowanceRequest message. + * @function verify + * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateResourceAllowanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.resourceAllowanceId != null && message.hasOwnProperty("resourceAllowanceId")) + if (!$util.isString(message.resourceAllowanceId)) + return "resourceAllowanceId: string expected"; + if (message.resourceAllowance != null && message.hasOwnProperty("resourceAllowance")) { + var error = $root.google.cloud.batch.v1alpha.ResourceAllowance.verify(message.resourceAllowance); + if (error) + return "resourceAllowance." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateResourceAllowanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.CreateResourceAllowanceRequest} CreateResourceAllowanceRequest + */ + CreateResourceAllowanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest) + return object; + var message = new $root.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.resourceAllowanceId != null) + message.resourceAllowanceId = String(object.resourceAllowanceId); + if (object.resourceAllowance != null) { + if (typeof object.resourceAllowance !== "object") + throw TypeError(".google.cloud.batch.v1alpha.CreateResourceAllowanceRequest.resourceAllowance: object expected"); + message.resourceAllowance = $root.google.cloud.batch.v1alpha.ResourceAllowance.fromObject(object.resourceAllowance); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateResourceAllowanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest + * @static + * @param {google.cloud.batch.v1alpha.CreateResourceAllowanceRequest} message CreateResourceAllowanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateResourceAllowanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.resourceAllowanceId = ""; + object.resourceAllowance = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.resourceAllowanceId != null && message.hasOwnProperty("resourceAllowanceId")) + object.resourceAllowanceId = message.resourceAllowanceId; + if (message.resourceAllowance != null && message.hasOwnProperty("resourceAllowance")) + object.resourceAllowance = $root.google.cloud.batch.v1alpha.ResourceAllowance.toObject(message.resourceAllowance, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateResourceAllowanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateResourceAllowanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateResourceAllowanceRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateResourceAllowanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.CreateResourceAllowanceRequest"; + }; + + return CreateResourceAllowanceRequest; + })(); + + v1alpha.GetResourceAllowanceRequest = (function() { + + /** + * Properties of a GetResourceAllowanceRequest. + * @memberof google.cloud.batch.v1alpha + * @interface IGetResourceAllowanceRequest + * @property {string|null} [name] GetResourceAllowanceRequest name + */ + + /** + * Constructs a new GetResourceAllowanceRequest. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a GetResourceAllowanceRequest. + * @implements IGetResourceAllowanceRequest + * @constructor + * @param {google.cloud.batch.v1alpha.IGetResourceAllowanceRequest=} [properties] Properties to set + */ + function GetResourceAllowanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetResourceAllowanceRequest name. + * @member {string} name + * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest + * @instance + */ + GetResourceAllowanceRequest.prototype.name = ""; + + /** + * Creates a new GetResourceAllowanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest + * @static + * @param {google.cloud.batch.v1alpha.IGetResourceAllowanceRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.GetResourceAllowanceRequest} GetResourceAllowanceRequest instance + */ + GetResourceAllowanceRequest.create = function create(properties) { + return new GetResourceAllowanceRequest(properties); + }; + + /** + * Encodes the specified GetResourceAllowanceRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.GetResourceAllowanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest + * @static + * @param {google.cloud.batch.v1alpha.IGetResourceAllowanceRequest} message GetResourceAllowanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetResourceAllowanceRequest.encode = function encode(message, writer) { + 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 GetResourceAllowanceRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.GetResourceAllowanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest + * @static + * @param {google.cloud.batch.v1alpha.IGetResourceAllowanceRequest} message GetResourceAllowanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetResourceAllowanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetResourceAllowanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.GetResourceAllowanceRequest} GetResourceAllowanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetResourceAllowanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.GetResourceAllowanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetResourceAllowanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.GetResourceAllowanceRequest} GetResourceAllowanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetResourceAllowanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetResourceAllowanceRequest message. + * @function verify + * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetResourceAllowanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetResourceAllowanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.GetResourceAllowanceRequest} GetResourceAllowanceRequest + */ + GetResourceAllowanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.GetResourceAllowanceRequest) + return object; + var message = new $root.google.cloud.batch.v1alpha.GetResourceAllowanceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetResourceAllowanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest + * @static + * @param {google.cloud.batch.v1alpha.GetResourceAllowanceRequest} message GetResourceAllowanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetResourceAllowanceRequest.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 GetResourceAllowanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetResourceAllowanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetResourceAllowanceRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetResourceAllowanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.GetResourceAllowanceRequest"; + }; + + return GetResourceAllowanceRequest; + })(); + + v1alpha.DeleteResourceAllowanceRequest = (function() { + + /** + * Properties of a DeleteResourceAllowanceRequest. + * @memberof google.cloud.batch.v1alpha + * @interface IDeleteResourceAllowanceRequest + * @property {string|null} [name] DeleteResourceAllowanceRequest name + * @property {string|null} [reason] DeleteResourceAllowanceRequest reason + * @property {string|null} [requestId] DeleteResourceAllowanceRequest requestId + */ + + /** + * Constructs a new DeleteResourceAllowanceRequest. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a DeleteResourceAllowanceRequest. + * @implements IDeleteResourceAllowanceRequest + * @constructor + * @param {google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest=} [properties] Properties to set + */ + function DeleteResourceAllowanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteResourceAllowanceRequest name. + * @member {string} name + * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest + * @instance + */ + DeleteResourceAllowanceRequest.prototype.name = ""; + + /** + * DeleteResourceAllowanceRequest reason. + * @member {string} reason + * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest + * @instance + */ + DeleteResourceAllowanceRequest.prototype.reason = ""; + + /** + * DeleteResourceAllowanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest + * @instance + */ + DeleteResourceAllowanceRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteResourceAllowanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest + * @static + * @param {google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest} DeleteResourceAllowanceRequest instance + */ + DeleteResourceAllowanceRequest.create = function create(properties) { + return new DeleteResourceAllowanceRequest(properties); + }; + + /** + * Encodes the specified DeleteResourceAllowanceRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest + * @static + * @param {google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest} message DeleteResourceAllowanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteResourceAllowanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.reason); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteResourceAllowanceRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest + * @static + * @param {google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest} message DeleteResourceAllowanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteResourceAllowanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteResourceAllowanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest} DeleteResourceAllowanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteResourceAllowanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.reason = reader.string(); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteResourceAllowanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest} DeleteResourceAllowanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteResourceAllowanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteResourceAllowanceRequest message. + * @function verify + * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteResourceAllowanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.reason != null && message.hasOwnProperty("reason")) + if (!$util.isString(message.reason)) + return "reason: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteResourceAllowanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest} DeleteResourceAllowanceRequest + */ + DeleteResourceAllowanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest) + return object; + var message = new $root.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.reason != null) + message.reason = String(object.reason); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteResourceAllowanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest + * @static + * @param {google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest} message DeleteResourceAllowanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteResourceAllowanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.reason = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.reason != null && message.hasOwnProperty("reason")) + object.reason = message.reason; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteResourceAllowanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteResourceAllowanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteResourceAllowanceRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteResourceAllowanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest"; + }; + + return DeleteResourceAllowanceRequest; + })(); + + v1alpha.ListResourceAllowancesRequest = (function() { + + /** + * Properties of a ListResourceAllowancesRequest. + * @memberof google.cloud.batch.v1alpha + * @interface IListResourceAllowancesRequest + * @property {string|null} [parent] ListResourceAllowancesRequest parent + * @property {number|null} [pageSize] ListResourceAllowancesRequest pageSize + * @property {string|null} [pageToken] ListResourceAllowancesRequest pageToken + */ + + /** + * Constructs a new ListResourceAllowancesRequest. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a ListResourceAllowancesRequest. + * @implements IListResourceAllowancesRequest + * @constructor + * @param {google.cloud.batch.v1alpha.IListResourceAllowancesRequest=} [properties] Properties to set + */ + function ListResourceAllowancesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListResourceAllowancesRequest parent. + * @member {string} parent + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest + * @instance + */ + ListResourceAllowancesRequest.prototype.parent = ""; + + /** + * ListResourceAllowancesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest + * @instance + */ + ListResourceAllowancesRequest.prototype.pageSize = 0; + + /** + * ListResourceAllowancesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest + * @instance + */ + ListResourceAllowancesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListResourceAllowancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest + * @static + * @param {google.cloud.batch.v1alpha.IListResourceAllowancesRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.ListResourceAllowancesRequest} ListResourceAllowancesRequest instance + */ + ListResourceAllowancesRequest.create = function create(properties) { + return new ListResourceAllowancesRequest(properties); + }; + + /** + * Encodes the specified ListResourceAllowancesRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.ListResourceAllowancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest + * @static + * @param {google.cloud.batch.v1alpha.IListResourceAllowancesRequest} message ListResourceAllowancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListResourceAllowancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListResourceAllowancesRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListResourceAllowancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest + * @static + * @param {google.cloud.batch.v1alpha.IListResourceAllowancesRequest} message ListResourceAllowancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListResourceAllowancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListResourceAllowancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.ListResourceAllowancesRequest} ListResourceAllowancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListResourceAllowancesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ListResourceAllowancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListResourceAllowancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.ListResourceAllowancesRequest} ListResourceAllowancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListResourceAllowancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListResourceAllowancesRequest message. + * @function verify + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListResourceAllowancesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListResourceAllowancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.ListResourceAllowancesRequest} ListResourceAllowancesRequest + */ + ListResourceAllowancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.ListResourceAllowancesRequest) + return object; + var message = new $root.google.cloud.batch.v1alpha.ListResourceAllowancesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListResourceAllowancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest + * @static + * @param {google.cloud.batch.v1alpha.ListResourceAllowancesRequest} message ListResourceAllowancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListResourceAllowancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListResourceAllowancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest + * @instance + * @returns {Object.} JSON object + */ + ListResourceAllowancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListResourceAllowancesRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListResourceAllowancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.ListResourceAllowancesRequest"; + }; + + return ListResourceAllowancesRequest; + })(); + + v1alpha.ListResourceAllowancesResponse = (function() { + + /** + * Properties of a ListResourceAllowancesResponse. + * @memberof google.cloud.batch.v1alpha + * @interface IListResourceAllowancesResponse + * @property {Array.|null} [resourceAllowances] ListResourceAllowancesResponse resourceAllowances + * @property {string|null} [nextPageToken] ListResourceAllowancesResponse nextPageToken + * @property {Array.|null} [unreachable] ListResourceAllowancesResponse unreachable + */ + + /** + * Constructs a new ListResourceAllowancesResponse. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a ListResourceAllowancesResponse. + * @implements IListResourceAllowancesResponse + * @constructor + * @param {google.cloud.batch.v1alpha.IListResourceAllowancesResponse=} [properties] Properties to set + */ + function ListResourceAllowancesResponse(properties) { + this.resourceAllowances = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListResourceAllowancesResponse resourceAllowances. + * @member {Array.} resourceAllowances + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse + * @instance + */ + ListResourceAllowancesResponse.prototype.resourceAllowances = $util.emptyArray; + + /** + * ListResourceAllowancesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse + * @instance + */ + ListResourceAllowancesResponse.prototype.nextPageToken = ""; + + /** + * ListResourceAllowancesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse + * @instance + */ + ListResourceAllowancesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListResourceAllowancesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse + * @static + * @param {google.cloud.batch.v1alpha.IListResourceAllowancesResponse=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.ListResourceAllowancesResponse} ListResourceAllowancesResponse instance + */ + ListResourceAllowancesResponse.create = function create(properties) { + return new ListResourceAllowancesResponse(properties); + }; + + /** + * Encodes the specified ListResourceAllowancesResponse message. Does not implicitly {@link google.cloud.batch.v1alpha.ListResourceAllowancesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse + * @static + * @param {google.cloud.batch.v1alpha.IListResourceAllowancesResponse} message ListResourceAllowancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListResourceAllowancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceAllowances != null && message.resourceAllowances.length) + for (var i = 0; i < message.resourceAllowances.length; ++i) + $root.google.cloud.batch.v1alpha.ResourceAllowance.encode(message.resourceAllowances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListResourceAllowancesResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListResourceAllowancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse + * @static + * @param {google.cloud.batch.v1alpha.IListResourceAllowancesResponse} message ListResourceAllowancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListResourceAllowancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListResourceAllowancesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.ListResourceAllowancesResponse} ListResourceAllowancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListResourceAllowancesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ListResourceAllowancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.resourceAllowances && message.resourceAllowances.length)) + message.resourceAllowances = []; + message.resourceAllowances.push($root.google.cloud.batch.v1alpha.ResourceAllowance.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListResourceAllowancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.ListResourceAllowancesResponse} ListResourceAllowancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListResourceAllowancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListResourceAllowancesResponse message. + * @function verify + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListResourceAllowancesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceAllowances != null && message.hasOwnProperty("resourceAllowances")) { + if (!Array.isArray(message.resourceAllowances)) + return "resourceAllowances: array expected"; + for (var i = 0; i < message.resourceAllowances.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.ResourceAllowance.verify(message.resourceAllowances[i]); + if (error) + return "resourceAllowances." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListResourceAllowancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.ListResourceAllowancesResponse} ListResourceAllowancesResponse + */ + ListResourceAllowancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.ListResourceAllowancesResponse) + return object; + var message = new $root.google.cloud.batch.v1alpha.ListResourceAllowancesResponse(); + if (object.resourceAllowances) { + if (!Array.isArray(object.resourceAllowances)) + throw TypeError(".google.cloud.batch.v1alpha.ListResourceAllowancesResponse.resourceAllowances: array expected"); + message.resourceAllowances = []; + for (var i = 0; i < object.resourceAllowances.length; ++i) { + if (typeof object.resourceAllowances[i] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.ListResourceAllowancesResponse.resourceAllowances: object expected"); + message.resourceAllowances[i] = $root.google.cloud.batch.v1alpha.ResourceAllowance.fromObject(object.resourceAllowances[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.batch.v1alpha.ListResourceAllowancesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListResourceAllowancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse + * @static + * @param {google.cloud.batch.v1alpha.ListResourceAllowancesResponse} message ListResourceAllowancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListResourceAllowancesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.resourceAllowances = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.resourceAllowances && message.resourceAllowances.length) { + object.resourceAllowances = []; + for (var j = 0; j < message.resourceAllowances.length; ++j) + object.resourceAllowances[j] = $root.google.cloud.batch.v1alpha.ResourceAllowance.toObject(message.resourceAllowances[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListResourceAllowancesResponse to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse + * @instance + * @returns {Object.} JSON object + */ + ListResourceAllowancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListResourceAllowancesResponse + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListResourceAllowancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.ListResourceAllowancesResponse"; + }; + + return ListResourceAllowancesResponse; + })(); + + v1alpha.UpdateResourceAllowanceRequest = (function() { + + /** + * Properties of an UpdateResourceAllowanceRequest. + * @memberof google.cloud.batch.v1alpha + * @interface IUpdateResourceAllowanceRequest + * @property {google.cloud.batch.v1alpha.IResourceAllowance|null} [resourceAllowance] UpdateResourceAllowanceRequest resourceAllowance + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateResourceAllowanceRequest updateMask + * @property {string|null} [requestId] UpdateResourceAllowanceRequest requestId + */ + + /** + * Constructs a new UpdateResourceAllowanceRequest. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents an UpdateResourceAllowanceRequest. + * @implements IUpdateResourceAllowanceRequest + * @constructor + * @param {google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest=} [properties] Properties to set + */ + function UpdateResourceAllowanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateResourceAllowanceRequest resourceAllowance. + * @member {google.cloud.batch.v1alpha.IResourceAllowance|null|undefined} resourceAllowance + * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest + * @instance + */ + UpdateResourceAllowanceRequest.prototype.resourceAllowance = null; + + /** + * UpdateResourceAllowanceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest + * @instance + */ + UpdateResourceAllowanceRequest.prototype.updateMask = null; + + /** + * UpdateResourceAllowanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest + * @instance + */ + UpdateResourceAllowanceRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateResourceAllowanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest + * @static + * @param {google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest} UpdateResourceAllowanceRequest instance + */ + UpdateResourceAllowanceRequest.create = function create(properties) { + return new UpdateResourceAllowanceRequest(properties); + }; + + /** + * Encodes the specified UpdateResourceAllowanceRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest + * @static + * @param {google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest} message UpdateResourceAllowanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateResourceAllowanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceAllowance != null && Object.hasOwnProperty.call(message, "resourceAllowance")) + $root.google.cloud.batch.v1alpha.ResourceAllowance.encode(message.resourceAllowance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateResourceAllowanceRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest + * @static + * @param {google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest} message UpdateResourceAllowanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateResourceAllowanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateResourceAllowanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest} UpdateResourceAllowanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateResourceAllowanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.resourceAllowance = $root.google.cloud.batch.v1alpha.ResourceAllowance.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateResourceAllowanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest} UpdateResourceAllowanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateResourceAllowanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateResourceAllowanceRequest message. + * @function verify + * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateResourceAllowanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceAllowance != null && message.hasOwnProperty("resourceAllowance")) { + var error = $root.google.cloud.batch.v1alpha.ResourceAllowance.verify(message.resourceAllowance); + if (error) + return "resourceAllowance." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateResourceAllowanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest} UpdateResourceAllowanceRequest + */ + UpdateResourceAllowanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest) + return object; + var message = new $root.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest(); + if (object.resourceAllowance != null) { + if (typeof object.resourceAllowance !== "object") + throw TypeError(".google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest.resourceAllowance: object expected"); + message.resourceAllowance = $root.google.cloud.batch.v1alpha.ResourceAllowance.fromObject(object.resourceAllowance); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateResourceAllowanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest + * @static + * @param {google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest} message UpdateResourceAllowanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateResourceAllowanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resourceAllowance = null; + object.updateMask = null; + object.requestId = ""; + } + if (message.resourceAllowance != null && message.hasOwnProperty("resourceAllowance")) + object.resourceAllowance = $root.google.cloud.batch.v1alpha.ResourceAllowance.toObject(message.resourceAllowance, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateResourceAllowanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateResourceAllowanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateResourceAllowanceRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateResourceAllowanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest"; + }; + + return UpdateResourceAllowanceRequest; + })(); + + v1alpha.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.batch.v1alpha + * @interface IOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {string|null} [statusMessage] OperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + * @property {string|null} [apiVersion] OperationMetadata apiVersion + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.batch.v1alpha.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.batch.v1alpha.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.batch.v1alpha.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.batch.v1alpha.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.batch.v1alpha.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.batch.v1alpha.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.batch.v1alpha.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.batch.v1alpha.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.OperationMetadata + * @static + * @param {google.cloud.batch.v1alpha.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.batch.v1alpha.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.OperationMetadata + * @static + * @param {google.cloud.batch.v1alpha.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, 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.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.OperationMetadata + * @static + * @param {google.cloud.batch.v1alpha.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.target = reader.string(); + break; + } + case 4: { + message.verb = reader.string(); + break; + } + case 5: { + message.statusMessage = reader.string(); + break; + } + case 6: { + message.requestedCancellation = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationMetadata message. + * @function verify + * @memberof google.cloud.batch.v1alpha.OperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (typeof message.requestedCancellation !== "boolean") + return "requestedCancellation: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.OperationMetadata) + return object; + var message = new $root.google.cloud.batch.v1alpha.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.batch.v1alpha.OperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.batch.v1alpha.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.OperationMetadata + * @static + * @param {google.cloud.batch.v1alpha.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.target = ""; + object.verb = ""; + object.statusMessage = ""; + object.requestedCancellation = false; + object.apiVersion = ""; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationMetadata + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.OperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1alpha.Job = (function() { + + /** + * Properties of a Job. + * @memberof google.cloud.batch.v1alpha + * @interface IJob + * @property {string|null} [name] Job name + * @property {string|null} [uid] Job uid + * @property {number|Long|null} [priority] Job priority + * @property {Array.|null} [taskGroups] Job taskGroups + * @property {google.cloud.batch.v1alpha.Job.SchedulingPolicy|null} [schedulingPolicy] Job schedulingPolicy + * @property {Array.|null} [dependencies] Job dependencies + * @property {google.cloud.batch.v1alpha.IAllocationPolicy|null} [allocationPolicy] Job allocationPolicy + * @property {Object.|null} [labels] Job labels + * @property {google.cloud.batch.v1alpha.IJobStatus|null} [status] Job status + * @property {google.cloud.batch.v1alpha.IJobNotification|null} [notification] Job notification + * @property {google.protobuf.ITimestamp|null} [createTime] Job createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Job updateTime + * @property {google.cloud.batch.v1alpha.ILogsPolicy|null} [logsPolicy] Job logsPolicy + * @property {Array.|null} [notifications] Job notifications + */ + + /** + * Constructs a new Job. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a Job. + * @implements IJob + * @constructor + * @param {google.cloud.batch.v1alpha.IJob=} [properties] Properties to set + */ + function Job(properties) { + this.taskGroups = []; + this.dependencies = []; + this.labels = {}; + this.notifications = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Job name. + * @member {string} name + * @memberof google.cloud.batch.v1alpha.Job + * @instance + */ + Job.prototype.name = ""; + + /** + * Job uid. + * @member {string} uid + * @memberof google.cloud.batch.v1alpha.Job + * @instance + */ + Job.prototype.uid = ""; + + /** + * Job priority. + * @member {number|Long} priority + * @memberof google.cloud.batch.v1alpha.Job + * @instance + */ + Job.prototype.priority = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Job taskGroups. + * @member {Array.} taskGroups + * @memberof google.cloud.batch.v1alpha.Job + * @instance + */ + Job.prototype.taskGroups = $util.emptyArray; + + /** + * Job schedulingPolicy. + * @member {google.cloud.batch.v1alpha.Job.SchedulingPolicy} schedulingPolicy + * @memberof google.cloud.batch.v1alpha.Job + * @instance + */ + Job.prototype.schedulingPolicy = 0; + + /** + * Job dependencies. + * @member {Array.} dependencies + * @memberof google.cloud.batch.v1alpha.Job + * @instance + */ + Job.prototype.dependencies = $util.emptyArray; + + /** + * Job allocationPolicy. + * @member {google.cloud.batch.v1alpha.IAllocationPolicy|null|undefined} allocationPolicy + * @memberof google.cloud.batch.v1alpha.Job + * @instance + */ + Job.prototype.allocationPolicy = null; + + /** + * Job labels. + * @member {Object.} labels + * @memberof google.cloud.batch.v1alpha.Job + * @instance + */ + Job.prototype.labels = $util.emptyObject; + + /** + * Job status. + * @member {google.cloud.batch.v1alpha.IJobStatus|null|undefined} status + * @memberof google.cloud.batch.v1alpha.Job + * @instance + */ + Job.prototype.status = null; + + /** + * Job notification. + * @member {google.cloud.batch.v1alpha.IJobNotification|null|undefined} notification + * @memberof google.cloud.batch.v1alpha.Job + * @instance + */ + Job.prototype.notification = null; + + /** + * Job createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.batch.v1alpha.Job + * @instance + */ + Job.prototype.createTime = null; + + /** + * Job updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.batch.v1alpha.Job + * @instance + */ + Job.prototype.updateTime = null; + + /** + * Job logsPolicy. + * @member {google.cloud.batch.v1alpha.ILogsPolicy|null|undefined} logsPolicy + * @memberof google.cloud.batch.v1alpha.Job + * @instance + */ + Job.prototype.logsPolicy = null; + + /** + * Job notifications. + * @member {Array.} notifications + * @memberof google.cloud.batch.v1alpha.Job + * @instance + */ + Job.prototype.notifications = $util.emptyArray; + + /** + * Creates a new Job instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.Job + * @static + * @param {google.cloud.batch.v1alpha.IJob=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.Job} Job instance + */ + Job.create = function create(properties) { + return new Job(properties); + }; + + /** + * Encodes the specified Job message. Does not implicitly {@link google.cloud.batch.v1alpha.Job.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.Job + * @static + * @param {google.cloud.batch.v1alpha.IJob} message Job message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Job.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.priority); + if (message.taskGroups != null && message.taskGroups.length) + for (var i = 0; i < message.taskGroups.length; ++i) + $root.google.cloud.batch.v1alpha.TaskGroup.encode(message.taskGroups[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.schedulingPolicy != null && Object.hasOwnProperty.call(message, "schedulingPolicy")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.schedulingPolicy); + if (message.dependencies != null && message.dependencies.length) + for (var i = 0; i < message.dependencies.length; ++i) + $root.google.cloud.batch.v1alpha.JobDependency.encode(message.dependencies[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.allocationPolicy != null && Object.hasOwnProperty.call(message, "allocationPolicy")) + $root.google.cloud.batch.v1alpha.AllocationPolicy.encode(message.allocationPolicy, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.cloud.batch.v1alpha.JobStatus.encode(message.status, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.notification != null && Object.hasOwnProperty.call(message, "notification")) + $root.google.cloud.batch.v1alpha.JobNotification.encode(message.notification, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.logsPolicy != null && Object.hasOwnProperty.call(message, "logsPolicy")) + $root.google.cloud.batch.v1alpha.LogsPolicy.encode(message.logsPolicy, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.notifications != null && message.notifications.length) + for (var i = 0; i < message.notifications.length; ++i) + $root.google.cloud.batch.v1alpha.JobNotification.encode(message.notifications[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Job.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.Job + * @static + * @param {google.cloud.batch.v1alpha.IJob} message Job message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Job.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Job message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.Job + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.Job} Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Job.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Job(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.uid = reader.string(); + break; + } + case 3: { + message.priority = reader.int64(); + break; + } + case 4: { + if (!(message.taskGroups && message.taskGroups.length)) + message.taskGroups = []; + message.taskGroups.push($root.google.cloud.batch.v1alpha.TaskGroup.decode(reader, reader.uint32())); + break; + } + case 5: { + message.schedulingPolicy = reader.int32(); + break; + } + case 6: { + if (!(message.dependencies && message.dependencies.length)) + message.dependencies = []; + message.dependencies.push($root.google.cloud.batch.v1alpha.JobDependency.decode(reader, reader.uint32())); + break; + } + case 7: { + message.allocationPolicy = $root.google.cloud.batch.v1alpha.AllocationPolicy.decode(reader, reader.uint32()); + break; + } + case 8: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 9: { + message.status = $root.google.cloud.batch.v1alpha.JobStatus.decode(reader, reader.uint32()); + break; + } + case 10: { + message.notification = $root.google.cloud.batch.v1alpha.JobNotification.decode(reader, reader.uint32()); + break; + } + case 11: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 12: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 13: { + message.logsPolicy = $root.google.cloud.batch.v1alpha.LogsPolicy.decode(reader, reader.uint32()); + break; + } + case 14: { + if (!(message.notifications && message.notifications.length)) + message.notifications = []; + message.notifications.push($root.google.cloud.batch.v1alpha.JobNotification.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Job message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.Job + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.Job} Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Job.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Job message. + * @function verify + * @memberof google.cloud.batch.v1alpha.Job + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Job.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.priority != null && message.hasOwnProperty("priority")) + if (!$util.isInteger(message.priority) && !(message.priority && $util.isInteger(message.priority.low) && $util.isInteger(message.priority.high))) + return "priority: integer|Long expected"; + if (message.taskGroups != null && message.hasOwnProperty("taskGroups")) { + if (!Array.isArray(message.taskGroups)) + return "taskGroups: array expected"; + for (var i = 0; i < message.taskGroups.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.TaskGroup.verify(message.taskGroups[i]); + if (error) + return "taskGroups." + error; + } + } + if (message.schedulingPolicy != null && message.hasOwnProperty("schedulingPolicy")) + switch (message.schedulingPolicy) { + default: + return "schedulingPolicy: enum value expected"; + case 0: + case 1: + break; + } + if (message.dependencies != null && message.hasOwnProperty("dependencies")) { + if (!Array.isArray(message.dependencies)) + return "dependencies: array expected"; + for (var i = 0; i < message.dependencies.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.JobDependency.verify(message.dependencies[i]); + if (error) + return "dependencies." + error; + } + } + if (message.allocationPolicy != null && message.hasOwnProperty("allocationPolicy")) { + var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.verify(message.allocationPolicy); + if (error) + return "allocationPolicy." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.cloud.batch.v1alpha.JobStatus.verify(message.status); + if (error) + return "status." + error; + } + if (message.notification != null && message.hasOwnProperty("notification")) { + var error = $root.google.cloud.batch.v1alpha.JobNotification.verify(message.notification); + if (error) + return "notification." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.logsPolicy != null && message.hasOwnProperty("logsPolicy")) { + var error = $root.google.cloud.batch.v1alpha.LogsPolicy.verify(message.logsPolicy); + if (error) + return "logsPolicy." + error; + } + if (message.notifications != null && message.hasOwnProperty("notifications")) { + if (!Array.isArray(message.notifications)) + return "notifications: array expected"; + for (var i = 0; i < message.notifications.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.JobNotification.verify(message.notifications[i]); + if (error) + return "notifications." + error; + } + } + return null; + }; + + /** + * Creates a Job message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.Job + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.Job} Job + */ + Job.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.Job) + return object; + var message = new $root.google.cloud.batch.v1alpha.Job(); + if (object.name != null) + message.name = String(object.name); + if (object.uid != null) + message.uid = String(object.uid); + if (object.priority != null) + if ($util.Long) + (message.priority = $util.Long.fromValue(object.priority)).unsigned = false; + else if (typeof object.priority === "string") + message.priority = parseInt(object.priority, 10); + else if (typeof object.priority === "number") + message.priority = object.priority; + else if (typeof object.priority === "object") + message.priority = new $util.LongBits(object.priority.low >>> 0, object.priority.high >>> 0).toNumber(); + if (object.taskGroups) { + if (!Array.isArray(object.taskGroups)) + throw TypeError(".google.cloud.batch.v1alpha.Job.taskGroups: array expected"); + message.taskGroups = []; + for (var i = 0; i < object.taskGroups.length; ++i) { + if (typeof object.taskGroups[i] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Job.taskGroups: object expected"); + message.taskGroups[i] = $root.google.cloud.batch.v1alpha.TaskGroup.fromObject(object.taskGroups[i]); + } + } + switch (object.schedulingPolicy) { + default: + if (typeof object.schedulingPolicy === "number") { + message.schedulingPolicy = object.schedulingPolicy; + break; + } + break; + case "SCHEDULING_POLICY_UNSPECIFIED": + case 0: + message.schedulingPolicy = 0; + break; + case "AS_SOON_AS_POSSIBLE": + case 1: + message.schedulingPolicy = 1; + break; + } + if (object.dependencies) { + if (!Array.isArray(object.dependencies)) + throw TypeError(".google.cloud.batch.v1alpha.Job.dependencies: array expected"); + message.dependencies = []; + for (var i = 0; i < object.dependencies.length; ++i) { + if (typeof object.dependencies[i] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Job.dependencies: object expected"); + message.dependencies[i] = $root.google.cloud.batch.v1alpha.JobDependency.fromObject(object.dependencies[i]); + } + } + if (object.allocationPolicy != null) { + if (typeof object.allocationPolicy !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Job.allocationPolicy: object expected"); + message.allocationPolicy = $root.google.cloud.batch.v1alpha.AllocationPolicy.fromObject(object.allocationPolicy); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Job.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Job.status: object expected"); + message.status = $root.google.cloud.batch.v1alpha.JobStatus.fromObject(object.status); + } + if (object.notification != null) { + if (typeof object.notification !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Job.notification: object expected"); + message.notification = $root.google.cloud.batch.v1alpha.JobNotification.fromObject(object.notification); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Job.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Job.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.logsPolicy != null) { + if (typeof object.logsPolicy !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Job.logsPolicy: object expected"); + message.logsPolicy = $root.google.cloud.batch.v1alpha.LogsPolicy.fromObject(object.logsPolicy); + } + if (object.notifications) { + if (!Array.isArray(object.notifications)) + throw TypeError(".google.cloud.batch.v1alpha.Job.notifications: array expected"); + message.notifications = []; + for (var i = 0; i < object.notifications.length; ++i) { + if (typeof object.notifications[i] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Job.notifications: object expected"); + message.notifications[i] = $root.google.cloud.batch.v1alpha.JobNotification.fromObject(object.notifications[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Job message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.Job + * @static + * @param {google.cloud.batch.v1alpha.Job} message Job + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Job.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.taskGroups = []; + object.dependencies = []; + object.notifications = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.uid = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.priority = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.priority = options.longs === String ? "0" : 0; + object.schedulingPolicy = options.enums === String ? "SCHEDULING_POLICY_UNSPECIFIED" : 0; + object.allocationPolicy = null; + object.status = null; + object.notification = null; + object.createTime = null; + object.updateTime = null; + object.logsPolicy = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.priority != null && message.hasOwnProperty("priority")) + if (typeof message.priority === "number") + object.priority = options.longs === String ? String(message.priority) : message.priority; + else + object.priority = options.longs === String ? $util.Long.prototype.toString.call(message.priority) : options.longs === Number ? new $util.LongBits(message.priority.low >>> 0, message.priority.high >>> 0).toNumber() : message.priority; + if (message.taskGroups && message.taskGroups.length) { + object.taskGroups = []; + for (var j = 0; j < message.taskGroups.length; ++j) + object.taskGroups[j] = $root.google.cloud.batch.v1alpha.TaskGroup.toObject(message.taskGroups[j], options); + } + if (message.schedulingPolicy != null && message.hasOwnProperty("schedulingPolicy")) + object.schedulingPolicy = options.enums === String ? $root.google.cloud.batch.v1alpha.Job.SchedulingPolicy[message.schedulingPolicy] === undefined ? message.schedulingPolicy : $root.google.cloud.batch.v1alpha.Job.SchedulingPolicy[message.schedulingPolicy] : message.schedulingPolicy; + if (message.dependencies && message.dependencies.length) { + object.dependencies = []; + for (var j = 0; j < message.dependencies.length; ++j) + object.dependencies[j] = $root.google.cloud.batch.v1alpha.JobDependency.toObject(message.dependencies[j], options); + } + if (message.allocationPolicy != null && message.hasOwnProperty("allocationPolicy")) + object.allocationPolicy = $root.google.cloud.batch.v1alpha.AllocationPolicy.toObject(message.allocationPolicy, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.cloud.batch.v1alpha.JobStatus.toObject(message.status, options); + if (message.notification != null && message.hasOwnProperty("notification")) + object.notification = $root.google.cloud.batch.v1alpha.JobNotification.toObject(message.notification, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.logsPolicy != null && message.hasOwnProperty("logsPolicy")) + object.logsPolicy = $root.google.cloud.batch.v1alpha.LogsPolicy.toObject(message.logsPolicy, options); + if (message.notifications && message.notifications.length) { + object.notifications = []; + for (var j = 0; j < message.notifications.length; ++j) + object.notifications[j] = $root.google.cloud.batch.v1alpha.JobNotification.toObject(message.notifications[j], options); + } + return object; + }; + + /** + * Converts this Job to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.Job + * @instance + * @returns {Object.} JSON object + */ + Job.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Job + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.Job + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Job.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.Job"; + }; + + /** + * SchedulingPolicy enum. + * @name google.cloud.batch.v1alpha.Job.SchedulingPolicy + * @enum {number} + * @property {number} SCHEDULING_POLICY_UNSPECIFIED=0 SCHEDULING_POLICY_UNSPECIFIED value + * @property {number} AS_SOON_AS_POSSIBLE=1 AS_SOON_AS_POSSIBLE value + */ + Job.SchedulingPolicy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SCHEDULING_POLICY_UNSPECIFIED"] = 0; + values[valuesById[1] = "AS_SOON_AS_POSSIBLE"] = 1; + return values; + })(); + + return Job; + })(); + + v1alpha.LogsPolicy = (function() { + + /** + * Properties of a LogsPolicy. + * @memberof google.cloud.batch.v1alpha + * @interface ILogsPolicy + * @property {google.cloud.batch.v1alpha.LogsPolicy.Destination|null} [destination] LogsPolicy destination + * @property {string|null} [logsPath] LogsPolicy logsPath + * @property {google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption|null} [cloudLoggingOption] LogsPolicy cloudLoggingOption + */ + + /** + * Constructs a new LogsPolicy. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a LogsPolicy. + * @implements ILogsPolicy + * @constructor + * @param {google.cloud.batch.v1alpha.ILogsPolicy=} [properties] Properties to set + */ + function LogsPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LogsPolicy destination. + * @member {google.cloud.batch.v1alpha.LogsPolicy.Destination} destination + * @memberof google.cloud.batch.v1alpha.LogsPolicy + * @instance + */ + LogsPolicy.prototype.destination = 0; + + /** + * LogsPolicy logsPath. + * @member {string} logsPath + * @memberof google.cloud.batch.v1alpha.LogsPolicy + * @instance + */ + LogsPolicy.prototype.logsPath = ""; + + /** + * LogsPolicy cloudLoggingOption. + * @member {google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption|null|undefined} cloudLoggingOption + * @memberof google.cloud.batch.v1alpha.LogsPolicy + * @instance + */ + LogsPolicy.prototype.cloudLoggingOption = null; + + /** + * Creates a new LogsPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.LogsPolicy + * @static + * @param {google.cloud.batch.v1alpha.ILogsPolicy=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.LogsPolicy} LogsPolicy instance + */ + LogsPolicy.create = function create(properties) { + return new LogsPolicy(properties); + }; + + /** + * Encodes the specified LogsPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.LogsPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.LogsPolicy + * @static + * @param {google.cloud.batch.v1alpha.ILogsPolicy} message LogsPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogsPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.destination); + if (message.logsPath != null && Object.hasOwnProperty.call(message, "logsPath")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.logsPath); + if (message.cloudLoggingOption != null && Object.hasOwnProperty.call(message, "cloudLoggingOption")) + $root.google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption.encode(message.cloudLoggingOption, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LogsPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.LogsPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.LogsPolicy + * @static + * @param {google.cloud.batch.v1alpha.ILogsPolicy} message LogsPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogsPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LogsPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.LogsPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.LogsPolicy} LogsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogsPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.LogsPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.destination = reader.int32(); + break; + } + case 2: { + message.logsPath = reader.string(); + break; + } + case 3: { + message.cloudLoggingOption = $root.google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LogsPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.LogsPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.LogsPolicy} LogsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogsPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LogsPolicy message. + * @function verify + * @memberof google.cloud.batch.v1alpha.LogsPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LogsPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.destination != null && message.hasOwnProperty("destination")) + switch (message.destination) { + default: + return "destination: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.logsPath != null && message.hasOwnProperty("logsPath")) + if (!$util.isString(message.logsPath)) + return "logsPath: string expected"; + if (message.cloudLoggingOption != null && message.hasOwnProperty("cloudLoggingOption")) { + var error = $root.google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption.verify(message.cloudLoggingOption); + if (error) + return "cloudLoggingOption." + error; + } + return null; + }; + + /** + * Creates a LogsPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.LogsPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.LogsPolicy} LogsPolicy + */ + LogsPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.LogsPolicy) + return object; + var message = new $root.google.cloud.batch.v1alpha.LogsPolicy(); + switch (object.destination) { + default: + if (typeof object.destination === "number") { + message.destination = object.destination; + break; + } + break; + case "DESTINATION_UNSPECIFIED": + case 0: + message.destination = 0; + break; + case "CLOUD_LOGGING": + case 1: + message.destination = 1; + break; + case "PATH": + case 2: + message.destination = 2; + break; + } + if (object.logsPath != null) + message.logsPath = String(object.logsPath); + if (object.cloudLoggingOption != null) { + if (typeof object.cloudLoggingOption !== "object") + throw TypeError(".google.cloud.batch.v1alpha.LogsPolicy.cloudLoggingOption: object expected"); + message.cloudLoggingOption = $root.google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption.fromObject(object.cloudLoggingOption); + } + return message; + }; + + /** + * Creates a plain object from a LogsPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.LogsPolicy + * @static + * @param {google.cloud.batch.v1alpha.LogsPolicy} message LogsPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LogsPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.destination = options.enums === String ? "DESTINATION_UNSPECIFIED" : 0; + object.logsPath = ""; + object.cloudLoggingOption = null; + } + if (message.destination != null && message.hasOwnProperty("destination")) + object.destination = options.enums === String ? $root.google.cloud.batch.v1alpha.LogsPolicy.Destination[message.destination] === undefined ? message.destination : $root.google.cloud.batch.v1alpha.LogsPolicy.Destination[message.destination] : message.destination; + if (message.logsPath != null && message.hasOwnProperty("logsPath")) + object.logsPath = message.logsPath; + if (message.cloudLoggingOption != null && message.hasOwnProperty("cloudLoggingOption")) + object.cloudLoggingOption = $root.google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption.toObject(message.cloudLoggingOption, options); + return object; + }; + + /** + * Converts this LogsPolicy to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.LogsPolicy + * @instance + * @returns {Object.} JSON object + */ + LogsPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LogsPolicy + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.LogsPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LogsPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.LogsPolicy"; + }; + + LogsPolicy.CloudLoggingOption = (function() { + + /** + * Properties of a CloudLoggingOption. + * @memberof google.cloud.batch.v1alpha.LogsPolicy + * @interface ICloudLoggingOption + * @property {boolean|null} [useGenericTaskMonitoredResource] CloudLoggingOption useGenericTaskMonitoredResource + */ + + /** + * Constructs a new CloudLoggingOption. + * @memberof google.cloud.batch.v1alpha.LogsPolicy + * @classdesc Represents a CloudLoggingOption. + * @implements ICloudLoggingOption + * @constructor + * @param {google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption=} [properties] Properties to set + */ + function CloudLoggingOption(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudLoggingOption useGenericTaskMonitoredResource. + * @member {boolean} useGenericTaskMonitoredResource + * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption + * @instance + */ + CloudLoggingOption.prototype.useGenericTaskMonitoredResource = false; + + /** + * Creates a new CloudLoggingOption instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption + * @static + * @param {google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption} CloudLoggingOption instance + */ + CloudLoggingOption.create = function create(properties) { + return new CloudLoggingOption(properties); + }; + + /** + * Encodes the specified CloudLoggingOption message. Does not implicitly {@link google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption + * @static + * @param {google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption} message CloudLoggingOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudLoggingOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.useGenericTaskMonitoredResource != null && Object.hasOwnProperty.call(message, "useGenericTaskMonitoredResource")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.useGenericTaskMonitoredResource); + return writer; + }; + + /** + * Encodes the specified CloudLoggingOption message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption + * @static + * @param {google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption} message CloudLoggingOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudLoggingOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudLoggingOption message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption} CloudLoggingOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudLoggingOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.useGenericTaskMonitoredResource = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudLoggingOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption} CloudLoggingOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudLoggingOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudLoggingOption message. + * @function verify + * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudLoggingOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.useGenericTaskMonitoredResource != null && message.hasOwnProperty("useGenericTaskMonitoredResource")) + if (typeof message.useGenericTaskMonitoredResource !== "boolean") + return "useGenericTaskMonitoredResource: boolean expected"; + return null; + }; + + /** + * Creates a CloudLoggingOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption} CloudLoggingOption + */ + CloudLoggingOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption) + return object; + var message = new $root.google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption(); + if (object.useGenericTaskMonitoredResource != null) + message.useGenericTaskMonitoredResource = Boolean(object.useGenericTaskMonitoredResource); + return message; + }; + + /** + * Creates a plain object from a CloudLoggingOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption + * @static + * @param {google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption} message CloudLoggingOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudLoggingOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.useGenericTaskMonitoredResource = false; + if (message.useGenericTaskMonitoredResource != null && message.hasOwnProperty("useGenericTaskMonitoredResource")) + object.useGenericTaskMonitoredResource = message.useGenericTaskMonitoredResource; + return object; + }; + + /** + * Converts this CloudLoggingOption to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption + * @instance + * @returns {Object.} JSON object + */ + CloudLoggingOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudLoggingOption + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudLoggingOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption"; + }; + + return CloudLoggingOption; + })(); + + /** + * Destination enum. + * @name google.cloud.batch.v1alpha.LogsPolicy.Destination + * @enum {number} + * @property {number} DESTINATION_UNSPECIFIED=0 DESTINATION_UNSPECIFIED value + * @property {number} CLOUD_LOGGING=1 CLOUD_LOGGING value + * @property {number} PATH=2 PATH value + */ + LogsPolicy.Destination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD_LOGGING"] = 1; + values[valuesById[2] = "PATH"] = 2; + return values; + })(); + + return LogsPolicy; + })(); + + v1alpha.JobDependency = (function() { + + /** + * Properties of a JobDependency. + * @memberof google.cloud.batch.v1alpha + * @interface IJobDependency + * @property {Object.|null} [items] JobDependency items + */ + + /** + * Constructs a new JobDependency. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a JobDependency. + * @implements IJobDependency + * @constructor + * @param {google.cloud.batch.v1alpha.IJobDependency=} [properties] Properties to set + */ + function JobDependency(properties) { + this.items = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobDependency items. + * @member {Object.} items + * @memberof google.cloud.batch.v1alpha.JobDependency + * @instance + */ + JobDependency.prototype.items = $util.emptyObject; + + /** + * Creates a new JobDependency instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.JobDependency + * @static + * @param {google.cloud.batch.v1alpha.IJobDependency=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.JobDependency} JobDependency instance + */ + JobDependency.create = function create(properties) { + return new JobDependency(properties); + }; + + /** + * Encodes the specified JobDependency message. Does not implicitly {@link google.cloud.batch.v1alpha.JobDependency.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.JobDependency + * @static + * @param {google.cloud.batch.v1alpha.IJobDependency} message JobDependency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobDependency.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.items[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified JobDependency message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobDependency.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.JobDependency + * @static + * @param {google.cloud.batch.v1alpha.IJobDependency} message JobDependency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobDependency.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JobDependency message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.JobDependency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.JobDependency} JobDependency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobDependency.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.JobDependency(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.items === $util.emptyObject) + message.items = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = 0; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.int32(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JobDependency message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.JobDependency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.JobDependency} JobDependency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobDependency.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobDependency message. + * @function verify + * @memberof google.cloud.batch.v1alpha.JobDependency + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobDependency.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) + switch (message.items[key[i]]) { + default: + return "items: enum value{k:string} expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + return null; + }; + + /** + * Creates a JobDependency message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.JobDependency + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.JobDependency} JobDependency + */ + JobDependency.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.JobDependency) + return object; + var message = new $root.google.cloud.batch.v1alpha.JobDependency(); + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.batch.v1alpha.JobDependency.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) + switch (object.items[keys[i]]) { + default: + if (typeof object.items[keys[i]] === "number") { + message.items[keys[i]] = object.items[keys[i]]; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.items[keys[i]] = 0; + break; + case "SUCCEEDED": + case 1: + message.items[keys[i]] = 1; + break; + case "FAILED": + case 2: + message.items[keys[i]] = 2; + break; + case "FINISHED": + case 3: + message.items[keys[i]] = 3; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a JobDependency message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.JobDependency + * @static + * @param {google.cloud.batch.v1alpha.JobDependency} message JobDependency + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobDependency.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.items = {}; + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = options.enums === String ? $root.google.cloud.batch.v1alpha.JobDependency.Type[message.items[keys2[j]]] === undefined ? message.items[keys2[j]] : $root.google.cloud.batch.v1alpha.JobDependency.Type[message.items[keys2[j]]] : message.items[keys2[j]]; + } + return object; + }; + + /** + * Converts this JobDependency to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.JobDependency + * @instance + * @returns {Object.} JSON object + */ + JobDependency.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobDependency + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.JobDependency + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobDependency.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.JobDependency"; + }; + + /** + * Type enum. + * @name google.cloud.batch.v1alpha.JobDependency.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} SUCCEEDED=1 SUCCEEDED value + * @property {number} FAILED=2 FAILED value + * @property {number} FINISHED=3 FINISHED value + */ + JobDependency.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SUCCEEDED"] = 1; + values[valuesById[2] = "FAILED"] = 2; + values[valuesById[3] = "FINISHED"] = 3; + return values; + })(); + + return JobDependency; + })(); + + v1alpha.JobStatus = (function() { + + /** + * Properties of a JobStatus. + * @memberof google.cloud.batch.v1alpha + * @interface IJobStatus + * @property {google.cloud.batch.v1alpha.JobStatus.State|null} [state] JobStatus state + * @property {Array.|null} [statusEvents] JobStatus statusEvents + * @property {Object.|null} [taskGroups] JobStatus taskGroups + * @property {google.protobuf.IDuration|null} [runDuration] JobStatus runDuration + * @property {google.cloud.batch.v1alpha.IResourceUsage|null} [resourceUsage] JobStatus resourceUsage + */ + + /** + * Constructs a new JobStatus. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a JobStatus. + * @implements IJobStatus + * @constructor + * @param {google.cloud.batch.v1alpha.IJobStatus=} [properties] Properties to set + */ + function JobStatus(properties) { + this.statusEvents = []; + this.taskGroups = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobStatus state. + * @member {google.cloud.batch.v1alpha.JobStatus.State} state + * @memberof google.cloud.batch.v1alpha.JobStatus + * @instance + */ + JobStatus.prototype.state = 0; + + /** + * JobStatus statusEvents. + * @member {Array.} statusEvents + * @memberof google.cloud.batch.v1alpha.JobStatus + * @instance + */ + JobStatus.prototype.statusEvents = $util.emptyArray; + + /** + * JobStatus taskGroups. + * @member {Object.} taskGroups + * @memberof google.cloud.batch.v1alpha.JobStatus + * @instance + */ + JobStatus.prototype.taskGroups = $util.emptyObject; + + /** + * JobStatus runDuration. + * @member {google.protobuf.IDuration|null|undefined} runDuration + * @memberof google.cloud.batch.v1alpha.JobStatus + * @instance + */ + JobStatus.prototype.runDuration = null; + + /** + * JobStatus resourceUsage. + * @member {google.cloud.batch.v1alpha.IResourceUsage|null|undefined} resourceUsage + * @memberof google.cloud.batch.v1alpha.JobStatus + * @instance + */ + JobStatus.prototype.resourceUsage = null; + + /** + * Creates a new JobStatus instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.JobStatus + * @static + * @param {google.cloud.batch.v1alpha.IJobStatus=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.JobStatus} JobStatus instance + */ + JobStatus.create = function create(properties) { + return new JobStatus(properties); + }; + + /** + * Encodes the specified JobStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.JobStatus + * @static + * @param {google.cloud.batch.v1alpha.IJobStatus} message JobStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobStatus.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); + if (message.statusEvents != null && message.statusEvents.length) + for (var i = 0; i < message.statusEvents.length; ++i) + $root.google.cloud.batch.v1alpha.StatusEvent.encode(message.statusEvents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.taskGroups != null && Object.hasOwnProperty.call(message, "taskGroups")) + for (var keys = Object.keys(message.taskGroups), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.encode(message.taskGroups[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.runDuration != null && Object.hasOwnProperty.call(message, "runDuration")) + $root.google.protobuf.Duration.encode(message.runDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.resourceUsage != null && Object.hasOwnProperty.call(message, "resourceUsage")) + $root.google.cloud.batch.v1alpha.ResourceUsage.encode(message.resourceUsage, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JobStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.JobStatus + * @static + * @param {google.cloud.batch.v1alpha.IJobStatus} message JobStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JobStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.JobStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.JobStatus} JobStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.JobStatus(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + if (!(message.statusEvents && message.statusEvents.length)) + message.statusEvents = []; + message.statusEvents.push($root.google.cloud.batch.v1alpha.StatusEvent.decode(reader, reader.uint32())); + break; + } + case 4: { + if (message.taskGroups === $util.emptyObject) + message.taskGroups = {}; + 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.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.taskGroups[key] = value; + break; + } + case 5: { + message.runDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 6: { + message.resourceUsage = $root.google.cloud.batch.v1alpha.ResourceUsage.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JobStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.JobStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.JobStatus} JobStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobStatus message. + * @function verify + * @memberof google.cloud.batch.v1alpha.JobStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + if (message.statusEvents != null && message.hasOwnProperty("statusEvents")) { + if (!Array.isArray(message.statusEvents)) + return "statusEvents: array expected"; + for (var i = 0; i < message.statusEvents.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.StatusEvent.verify(message.statusEvents[i]); + if (error) + return "statusEvents." + error; + } + } + if (message.taskGroups != null && message.hasOwnProperty("taskGroups")) { + if (!$util.isObject(message.taskGroups)) + return "taskGroups: object expected"; + var key = Object.keys(message.taskGroups); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.verify(message.taskGroups[key[i]]); + if (error) + return "taskGroups." + error; + } + } + if (message.runDuration != null && message.hasOwnProperty("runDuration")) { + var error = $root.google.protobuf.Duration.verify(message.runDuration); + if (error) + return "runDuration." + error; + } + if (message.resourceUsage != null && message.hasOwnProperty("resourceUsage")) { + var error = $root.google.cloud.batch.v1alpha.ResourceUsage.verify(message.resourceUsage); + if (error) + return "resourceUsage." + error; + } + return null; + }; + + /** + * Creates a JobStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.JobStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.JobStatus} JobStatus + */ + JobStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.JobStatus) + return object; + var message = new $root.google.cloud.batch.v1alpha.JobStatus(); + 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 "QUEUED": + case 1: + message.state = 1; + break; + case "SCHEDULED": + case 2: + message.state = 2; + break; + case "RUNNING": + case 3: + message.state = 3; + break; + case "SUCCEEDED": + case 4: + message.state = 4; + break; + case "FAILED": + case 5: + message.state = 5; + break; + case "DELETION_IN_PROGRESS": + case 6: + message.state = 6; + break; + case "CANCELLATION_IN_PROGRESS": + case 7: + message.state = 7; + break; + case "CANCELLED": + case 8: + message.state = 8; + break; + } + if (object.statusEvents) { + if (!Array.isArray(object.statusEvents)) + throw TypeError(".google.cloud.batch.v1alpha.JobStatus.statusEvents: array expected"); + message.statusEvents = []; + for (var i = 0; i < object.statusEvents.length; ++i) { + if (typeof object.statusEvents[i] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.JobStatus.statusEvents: object expected"); + message.statusEvents[i] = $root.google.cloud.batch.v1alpha.StatusEvent.fromObject(object.statusEvents[i]); + } + } + if (object.taskGroups) { + if (typeof object.taskGroups !== "object") + throw TypeError(".google.cloud.batch.v1alpha.JobStatus.taskGroups: object expected"); + message.taskGroups = {}; + for (var keys = Object.keys(object.taskGroups), i = 0; i < keys.length; ++i) { + if (typeof object.taskGroups[keys[i]] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.JobStatus.taskGroups: object expected"); + message.taskGroups[keys[i]] = $root.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.fromObject(object.taskGroups[keys[i]]); + } + } + if (object.runDuration != null) { + if (typeof object.runDuration !== "object") + throw TypeError(".google.cloud.batch.v1alpha.JobStatus.runDuration: object expected"); + message.runDuration = $root.google.protobuf.Duration.fromObject(object.runDuration); + } + if (object.resourceUsage != null) { + if (typeof object.resourceUsage !== "object") + throw TypeError(".google.cloud.batch.v1alpha.JobStatus.resourceUsage: object expected"); + message.resourceUsage = $root.google.cloud.batch.v1alpha.ResourceUsage.fromObject(object.resourceUsage); + } + return message; + }; + + /** + * Creates a plain object from a JobStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.JobStatus + * @static + * @param {google.cloud.batch.v1alpha.JobStatus} message JobStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.statusEvents = []; + if (options.objects || options.defaults) + object.taskGroups = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.runDuration = null; + object.resourceUsage = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.batch.v1alpha.JobStatus.State[message.state] === undefined ? message.state : $root.google.cloud.batch.v1alpha.JobStatus.State[message.state] : message.state; + if (message.statusEvents && message.statusEvents.length) { + object.statusEvents = []; + for (var j = 0; j < message.statusEvents.length; ++j) + object.statusEvents[j] = $root.google.cloud.batch.v1alpha.StatusEvent.toObject(message.statusEvents[j], options); + } + var keys2; + if (message.taskGroups && (keys2 = Object.keys(message.taskGroups)).length) { + object.taskGroups = {}; + for (var j = 0; j < keys2.length; ++j) + object.taskGroups[keys2[j]] = $root.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.toObject(message.taskGroups[keys2[j]], options); + } + if (message.runDuration != null && message.hasOwnProperty("runDuration")) + object.runDuration = $root.google.protobuf.Duration.toObject(message.runDuration, options); + if (message.resourceUsage != null && message.hasOwnProperty("resourceUsage")) + object.resourceUsage = $root.google.cloud.batch.v1alpha.ResourceUsage.toObject(message.resourceUsage, options); + return object; + }; + + /** + * Converts this JobStatus to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.JobStatus + * @instance + * @returns {Object.} JSON object + */ + JobStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobStatus + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.JobStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.JobStatus"; + }; + + JobStatus.InstanceStatus = (function() { + + /** + * Properties of an InstanceStatus. + * @memberof google.cloud.batch.v1alpha.JobStatus + * @interface IInstanceStatus + * @property {string|null} [machineType] InstanceStatus machineType + * @property {google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel|null} [provisioningModel] InstanceStatus provisioningModel + * @property {number|Long|null} [taskPack] InstanceStatus taskPack + * @property {google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null} [bootDisk] InstanceStatus bootDisk + */ + + /** + * Constructs a new InstanceStatus. + * @memberof google.cloud.batch.v1alpha.JobStatus + * @classdesc Represents an InstanceStatus. + * @implements IInstanceStatus + * @constructor + * @param {google.cloud.batch.v1alpha.JobStatus.IInstanceStatus=} [properties] Properties to set + */ + function InstanceStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceStatus machineType. + * @member {string} machineType + * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus + * @instance + */ + InstanceStatus.prototype.machineType = ""; + + /** + * InstanceStatus provisioningModel. + * @member {google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel} provisioningModel + * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus + * @instance + */ + InstanceStatus.prototype.provisioningModel = 0; + + /** + * InstanceStatus taskPack. + * @member {number|Long} taskPack + * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus + * @instance + */ + InstanceStatus.prototype.taskPack = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * InstanceStatus bootDisk. + * @member {google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null|undefined} bootDisk + * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus + * @instance + */ + InstanceStatus.prototype.bootDisk = null; + + /** + * Creates a new InstanceStatus instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus + * @static + * @param {google.cloud.batch.v1alpha.JobStatus.IInstanceStatus=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.JobStatus.InstanceStatus} InstanceStatus instance + */ + InstanceStatus.create = function create(properties) { + return new InstanceStatus(properties); + }; + + /** + * Encodes the specified InstanceStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.InstanceStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus + * @static + * @param {google.cloud.batch.v1alpha.JobStatus.IInstanceStatus} message InstanceStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.machineType); + if (message.provisioningModel != null && Object.hasOwnProperty.call(message, "provisioningModel")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.provisioningModel); + if (message.taskPack != null && Object.hasOwnProperty.call(message, "taskPack")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.taskPack); + if (message.bootDisk != null && Object.hasOwnProperty.call(message, "bootDisk")) + $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.encode(message.bootDisk, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstanceStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.InstanceStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus + * @static + * @param {google.cloud.batch.v1alpha.JobStatus.IInstanceStatus} message InstanceStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.JobStatus.InstanceStatus} InstanceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.JobStatus.InstanceStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.machineType = reader.string(); + break; + } + case 2: { + message.provisioningModel = reader.int32(); + break; + } + case 3: { + message.taskPack = reader.int64(); + break; + } + case 4: { + message.bootDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.JobStatus.InstanceStatus} InstanceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceStatus message. + * @function verify + * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.machineType != null && message.hasOwnProperty("machineType")) + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) + switch (message.provisioningModel) { + default: + return "provisioningModel: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.taskPack != null && message.hasOwnProperty("taskPack")) + if (!$util.isInteger(message.taskPack) && !(message.taskPack && $util.isInteger(message.taskPack.low) && $util.isInteger(message.taskPack.high))) + return "taskPack: integer|Long expected"; + if (message.bootDisk != null && message.hasOwnProperty("bootDisk")) { + var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.verify(message.bootDisk); + if (error) + return "bootDisk." + error; + } + return null; + }; + + /** + * Creates an InstanceStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.JobStatus.InstanceStatus} InstanceStatus + */ + InstanceStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.JobStatus.InstanceStatus) + return object; + var message = new $root.google.cloud.batch.v1alpha.JobStatus.InstanceStatus(); + if (object.machineType != null) + message.machineType = String(object.machineType); + switch (object.provisioningModel) { + default: + if (typeof object.provisioningModel === "number") { + message.provisioningModel = object.provisioningModel; + break; + } + break; + case "PROVISIONING_MODEL_UNSPECIFIED": + case 0: + message.provisioningModel = 0; + break; + case "STANDARD": + case 1: + message.provisioningModel = 1; + break; + case "SPOT": + case 2: + message.provisioningModel = 2; + break; + case "PREEMPTIBLE": + case 3: + message.provisioningModel = 3; + break; + } + if (object.taskPack != null) + if ($util.Long) + (message.taskPack = $util.Long.fromValue(object.taskPack)).unsigned = false; + else if (typeof object.taskPack === "string") + message.taskPack = parseInt(object.taskPack, 10); + else if (typeof object.taskPack === "number") + message.taskPack = object.taskPack; + else if (typeof object.taskPack === "object") + message.taskPack = new $util.LongBits(object.taskPack.low >>> 0, object.taskPack.high >>> 0).toNumber(); + if (object.bootDisk != null) { + if (typeof object.bootDisk !== "object") + throw TypeError(".google.cloud.batch.v1alpha.JobStatus.InstanceStatus.bootDisk: object expected"); + message.bootDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.fromObject(object.bootDisk); + } + return message; + }; + + /** + * Creates a plain object from an InstanceStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus + * @static + * @param {google.cloud.batch.v1alpha.JobStatus.InstanceStatus} message InstanceStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.machineType = ""; + object.provisioningModel = options.enums === String ? "PROVISIONING_MODEL_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.taskPack = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.taskPack = options.longs === String ? "0" : 0; + object.bootDisk = null; + } + if (message.machineType != null && message.hasOwnProperty("machineType")) + object.machineType = message.machineType; + if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) + object.provisioningModel = options.enums === String ? $root.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel[message.provisioningModel] === undefined ? message.provisioningModel : $root.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel[message.provisioningModel] : message.provisioningModel; + if (message.taskPack != null && message.hasOwnProperty("taskPack")) + if (typeof message.taskPack === "number") + object.taskPack = options.longs === String ? String(message.taskPack) : message.taskPack; + else + object.taskPack = options.longs === String ? $util.Long.prototype.toString.call(message.taskPack) : options.longs === Number ? new $util.LongBits(message.taskPack.low >>> 0, message.taskPack.high >>> 0).toNumber() : message.taskPack; + if (message.bootDisk != null && message.hasOwnProperty("bootDisk")) + object.bootDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.toObject(message.bootDisk, options); + return object; + }; + + /** + * Converts this InstanceStatus to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus + * @instance + * @returns {Object.} JSON object + */ + InstanceStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstanceStatus + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstanceStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.JobStatus.InstanceStatus"; + }; + + return InstanceStatus; + })(); + + JobStatus.TaskGroupStatus = (function() { + + /** + * Properties of a TaskGroupStatus. + * @memberof google.cloud.batch.v1alpha.JobStatus + * @interface ITaskGroupStatus + * @property {Object.|null} [counts] TaskGroupStatus counts + * @property {Array.|null} [instances] TaskGroupStatus instances + */ + + /** + * Constructs a new TaskGroupStatus. + * @memberof google.cloud.batch.v1alpha.JobStatus + * @classdesc Represents a TaskGroupStatus. + * @implements ITaskGroupStatus + * @constructor + * @param {google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus=} [properties] Properties to set + */ + function TaskGroupStatus(properties) { + this.counts = {}; + this.instances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TaskGroupStatus counts. + * @member {Object.} counts + * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus + * @instance + */ + TaskGroupStatus.prototype.counts = $util.emptyObject; + + /** + * TaskGroupStatus instances. + * @member {Array.} instances + * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus + * @instance + */ + TaskGroupStatus.prototype.instances = $util.emptyArray; + + /** + * Creates a new TaskGroupStatus instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus + * @static + * @param {google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus} TaskGroupStatus instance + */ + TaskGroupStatus.create = function create(properties) { + return new TaskGroupStatus(properties); + }; + + /** + * Encodes the specified TaskGroupStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus + * @static + * @param {google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus} message TaskGroupStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskGroupStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.counts != null && Object.hasOwnProperty.call(message, "counts")) + for (var keys = Object.keys(message.counts), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int64(message.counts[keys[i]]).ldelim(); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + $root.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.encode(message.instances[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TaskGroupStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus + * @static + * @param {google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus} message TaskGroupStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskGroupStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TaskGroupStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus} TaskGroupStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskGroupStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.counts === $util.emptyObject) + message.counts = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = 0; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.int64(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.counts[key] = value; + break; + } + case 2: { + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TaskGroupStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus} TaskGroupStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskGroupStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TaskGroupStatus message. + * @function verify + * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TaskGroupStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.counts != null && message.hasOwnProperty("counts")) { + if (!$util.isObject(message.counts)) + return "counts: object expected"; + var key = Object.keys(message.counts); + for (var i = 0; i < key.length; ++i) + if (!$util.isInteger(message.counts[key[i]]) && !(message.counts[key[i]] && $util.isInteger(message.counts[key[i]].low) && $util.isInteger(message.counts[key[i]].high))) + return "counts: integer|Long{k:string} expected"; + } + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } + return null; + }; + + /** + * Creates a TaskGroupStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus} TaskGroupStatus + */ + TaskGroupStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus) + return object; + var message = new $root.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus(); + if (object.counts) { + if (typeof object.counts !== "object") + throw TypeError(".google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.counts: object expected"); + message.counts = {}; + for (var keys = Object.keys(object.counts), i = 0; i < keys.length; ++i) + if ($util.Long) + (message.counts[keys[i]] = $util.Long.fromValue(object.counts[keys[i]])).unsigned = false; + else if (typeof object.counts[keys[i]] === "string") + message.counts[keys[i]] = parseInt(object.counts[keys[i]], 10); + else if (typeof object.counts[keys[i]] === "number") + message.counts[keys[i]] = object.counts[keys[i]]; + else if (typeof object.counts[keys[i]] === "object") + message.counts[keys[i]] = new $util.LongBits(object.counts[keys[i]].low >>> 0, object.counts[keys[i]].high >>> 0).toNumber(); + } + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.instances: object expected"); + message.instances[i] = $root.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.fromObject(object.instances[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TaskGroupStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus + * @static + * @param {google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus} message TaskGroupStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TaskGroupStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instances = []; + if (options.objects || options.defaults) + object.counts = {}; + var keys2; + if (message.counts && (keys2 = Object.keys(message.counts)).length) { + object.counts = {}; + for (var j = 0; j < keys2.length; ++j) + if (typeof message.counts[keys2[j]] === "number") + object.counts[keys2[j]] = options.longs === String ? String(message.counts[keys2[j]]) : message.counts[keys2[j]]; + else + object.counts[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.counts[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.counts[keys2[j]].low >>> 0, message.counts[keys2[j]].high >>> 0).toNumber() : message.counts[keys2[j]]; + } + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.toObject(message.instances[j], options); + } + return object; + }; + + /** + * Converts this TaskGroupStatus to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus + * @instance + * @returns {Object.} JSON object + */ + TaskGroupStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TaskGroupStatus + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TaskGroupStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus"; + }; + + return TaskGroupStatus; + })(); + + /** + * State enum. + * @name google.cloud.batch.v1alpha.JobStatus.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} QUEUED=1 QUEUED value + * @property {number} SCHEDULED=2 SCHEDULED value + * @property {number} RUNNING=3 RUNNING value + * @property {number} SUCCEEDED=4 SUCCEEDED value + * @property {number} FAILED=5 FAILED value + * @property {number} DELETION_IN_PROGRESS=6 DELETION_IN_PROGRESS value + * @property {number} CANCELLATION_IN_PROGRESS=7 CANCELLATION_IN_PROGRESS value + * @property {number} CANCELLED=8 CANCELLED value + */ + JobStatus.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "QUEUED"] = 1; + values[valuesById[2] = "SCHEDULED"] = 2; + values[valuesById[3] = "RUNNING"] = 3; + values[valuesById[4] = "SUCCEEDED"] = 4; + values[valuesById[5] = "FAILED"] = 5; + values[valuesById[6] = "DELETION_IN_PROGRESS"] = 6; + values[valuesById[7] = "CANCELLATION_IN_PROGRESS"] = 7; + values[valuesById[8] = "CANCELLED"] = 8; + return values; + })(); + + return JobStatus; + })(); + + v1alpha.ResourceUsage = (function() { + + /** + * Properties of a ResourceUsage. + * @memberof google.cloud.batch.v1alpha + * @interface IResourceUsage + * @property {number|null} [coreHours] ResourceUsage coreHours + */ + + /** + * Constructs a new ResourceUsage. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a ResourceUsage. + * @implements IResourceUsage + * @constructor + * @param {google.cloud.batch.v1alpha.IResourceUsage=} [properties] Properties to set + */ + function ResourceUsage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceUsage coreHours. + * @member {number} coreHours + * @memberof google.cloud.batch.v1alpha.ResourceUsage + * @instance + */ + ResourceUsage.prototype.coreHours = 0; + + /** + * Creates a new ResourceUsage instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.ResourceUsage + * @static + * @param {google.cloud.batch.v1alpha.IResourceUsage=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.ResourceUsage} ResourceUsage instance + */ + ResourceUsage.create = function create(properties) { + return new ResourceUsage(properties); + }; + + /** + * Encodes the specified ResourceUsage message. Does not implicitly {@link google.cloud.batch.v1alpha.ResourceUsage.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.ResourceUsage + * @static + * @param {google.cloud.batch.v1alpha.IResourceUsage} message ResourceUsage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceUsage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.coreHours != null && Object.hasOwnProperty.call(message, "coreHours")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.coreHours); + return writer; + }; + + /** + * Encodes the specified ResourceUsage message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ResourceUsage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.ResourceUsage + * @static + * @param {google.cloud.batch.v1alpha.IResourceUsage} message ResourceUsage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceUsage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceUsage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.ResourceUsage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.ResourceUsage} ResourceUsage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceUsage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ResourceUsage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.coreHours = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceUsage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.ResourceUsage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.ResourceUsage} ResourceUsage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceUsage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceUsage message. + * @function verify + * @memberof google.cloud.batch.v1alpha.ResourceUsage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceUsage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.coreHours != null && message.hasOwnProperty("coreHours")) + if (typeof message.coreHours !== "number") + return "coreHours: number expected"; + return null; + }; + + /** + * Creates a ResourceUsage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.ResourceUsage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.ResourceUsage} ResourceUsage + */ + ResourceUsage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.ResourceUsage) + return object; + var message = new $root.google.cloud.batch.v1alpha.ResourceUsage(); + if (object.coreHours != null) + message.coreHours = Number(object.coreHours); + return message; + }; + + /** + * Creates a plain object from a ResourceUsage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.ResourceUsage + * @static + * @param {google.cloud.batch.v1alpha.ResourceUsage} message ResourceUsage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceUsage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.coreHours = 0; + if (message.coreHours != null && message.hasOwnProperty("coreHours")) + object.coreHours = options.json && !isFinite(message.coreHours) ? String(message.coreHours) : message.coreHours; + return object; + }; + + /** + * Converts this ResourceUsage to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.ResourceUsage + * @instance + * @returns {Object.} JSON object + */ + ResourceUsage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceUsage + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.ResourceUsage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceUsage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.ResourceUsage"; + }; + + return ResourceUsage; + })(); + + v1alpha.JobNotification = (function() { + + /** + * Properties of a JobNotification. + * @memberof google.cloud.batch.v1alpha + * @interface IJobNotification + * @property {string|null} [pubsubTopic] JobNotification pubsubTopic + * @property {google.cloud.batch.v1alpha.JobNotification.IMessage|null} [message] JobNotification message + */ + + /** + * Constructs a new JobNotification. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a JobNotification. + * @implements IJobNotification + * @constructor + * @param {google.cloud.batch.v1alpha.IJobNotification=} [properties] Properties to set + */ + function JobNotification(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobNotification pubsubTopic. + * @member {string} pubsubTopic + * @memberof google.cloud.batch.v1alpha.JobNotification + * @instance + */ + JobNotification.prototype.pubsubTopic = ""; + + /** + * JobNotification message. + * @member {google.cloud.batch.v1alpha.JobNotification.IMessage|null|undefined} message + * @memberof google.cloud.batch.v1alpha.JobNotification + * @instance + */ + JobNotification.prototype.message = null; + + /** + * Creates a new JobNotification instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.JobNotification + * @static + * @param {google.cloud.batch.v1alpha.IJobNotification=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.JobNotification} JobNotification instance + */ + JobNotification.create = function create(properties) { + return new JobNotification(properties); + }; + + /** + * Encodes the specified JobNotification message. Does not implicitly {@link google.cloud.batch.v1alpha.JobNotification.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.JobNotification + * @static + * @param {google.cloud.batch.v1alpha.IJobNotification} message JobNotification message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobNotification.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pubsubTopic != null && Object.hasOwnProperty.call(message, "pubsubTopic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pubsubTopic); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + $root.google.cloud.batch.v1alpha.JobNotification.Message.encode(message.message, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JobNotification message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobNotification.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.JobNotification + * @static + * @param {google.cloud.batch.v1alpha.IJobNotification} message JobNotification message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobNotification.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JobNotification message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.JobNotification + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.JobNotification} JobNotification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobNotification.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.JobNotification(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.pubsubTopic = reader.string(); + break; + } + case 2: { + message.message = $root.google.cloud.batch.v1alpha.JobNotification.Message.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JobNotification message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.JobNotification + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.JobNotification} JobNotification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobNotification.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobNotification message. + * @function verify + * @memberof google.cloud.batch.v1alpha.JobNotification + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobNotification.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) + if (!$util.isString(message.pubsubTopic)) + return "pubsubTopic: string expected"; + if (message.message != null && message.hasOwnProperty("message")) { + var error = $root.google.cloud.batch.v1alpha.JobNotification.Message.verify(message.message); + if (error) + return "message." + error; + } + return null; + }; + + /** + * Creates a JobNotification message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.JobNotification + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.JobNotification} JobNotification + */ + JobNotification.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.JobNotification) + return object; + var message = new $root.google.cloud.batch.v1alpha.JobNotification(); + if (object.pubsubTopic != null) + message.pubsubTopic = String(object.pubsubTopic); + if (object.message != null) { + if (typeof object.message !== "object") + throw TypeError(".google.cloud.batch.v1alpha.JobNotification.message: object expected"); + message.message = $root.google.cloud.batch.v1alpha.JobNotification.Message.fromObject(object.message); + } + return message; + }; + + /** + * Creates a plain object from a JobNotification message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.JobNotification + * @static + * @param {google.cloud.batch.v1alpha.JobNotification} message JobNotification + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobNotification.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.pubsubTopic = ""; + object.message = null; + } + if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) + object.pubsubTopic = message.pubsubTopic; + if (message.message != null && message.hasOwnProperty("message")) + object.message = $root.google.cloud.batch.v1alpha.JobNotification.Message.toObject(message.message, options); + return object; + }; + + /** + * Converts this JobNotification to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.JobNotification + * @instance + * @returns {Object.} JSON object + */ + JobNotification.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobNotification + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.JobNotification + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobNotification.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.JobNotification"; + }; + + JobNotification.Message = (function() { + + /** + * Properties of a Message. + * @memberof google.cloud.batch.v1alpha.JobNotification + * @interface IMessage + * @property {google.cloud.batch.v1alpha.JobNotification.Type|null} [type] Message type + * @property {google.cloud.batch.v1alpha.JobStatus.State|null} [newJobState] Message newJobState + * @property {google.cloud.batch.v1alpha.TaskStatus.State|null} [newTaskState] Message newTaskState + */ + + /** + * Constructs a new Message. + * @memberof google.cloud.batch.v1alpha.JobNotification + * @classdesc Represents a Message. + * @implements IMessage + * @constructor + * @param {google.cloud.batch.v1alpha.JobNotification.IMessage=} [properties] Properties to set + */ + function Message(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Message type. + * @member {google.cloud.batch.v1alpha.JobNotification.Type} type + * @memberof google.cloud.batch.v1alpha.JobNotification.Message + * @instance + */ + Message.prototype.type = 0; + + /** + * Message newJobState. + * @member {google.cloud.batch.v1alpha.JobStatus.State} newJobState + * @memberof google.cloud.batch.v1alpha.JobNotification.Message + * @instance + */ + Message.prototype.newJobState = 0; + + /** + * Message newTaskState. + * @member {google.cloud.batch.v1alpha.TaskStatus.State} newTaskState + * @memberof google.cloud.batch.v1alpha.JobNotification.Message + * @instance + */ + Message.prototype.newTaskState = 0; + + /** + * Creates a new Message instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.JobNotification.Message + * @static + * @param {google.cloud.batch.v1alpha.JobNotification.IMessage=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.JobNotification.Message} Message instance + */ + Message.create = function create(properties) { + return new Message(properties); + }; + + /** + * Encodes the specified Message message. Does not implicitly {@link google.cloud.batch.v1alpha.JobNotification.Message.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.JobNotification.Message + * @static + * @param {google.cloud.batch.v1alpha.JobNotification.IMessage} message Message message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Message.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.newJobState != null && Object.hasOwnProperty.call(message, "newJobState")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.newJobState); + if (message.newTaskState != null && Object.hasOwnProperty.call(message, "newTaskState")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.newTaskState); + return writer; + }; + + /** + * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobNotification.Message.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.JobNotification.Message + * @static + * @param {google.cloud.batch.v1alpha.JobNotification.IMessage} message Message message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Message.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Message message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.JobNotification.Message + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.JobNotification.Message} Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Message.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.JobNotification.Message(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.newJobState = reader.int32(); + break; + } + case 3: { + message.newTaskState = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Message message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.JobNotification.Message + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.JobNotification.Message} Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Message.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Message message. + * @function verify + * @memberof google.cloud.batch.v1alpha.JobNotification.Message + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Message.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.newJobState != null && message.hasOwnProperty("newJobState")) + switch (message.newJobState) { + default: + return "newJobState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + if (message.newTaskState != null && message.hasOwnProperty("newTaskState")) + switch (message.newTaskState) { + default: + return "newTaskState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + return null; + }; + + /** + * Creates a Message message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.JobNotification.Message + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.JobNotification.Message} Message + */ + Message.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.JobNotification.Message) + return object; + var message = new $root.google.cloud.batch.v1alpha.JobNotification.Message(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "JOB_STATE_CHANGED": + case 1: + message.type = 1; + break; + case "TASK_STATE_CHANGED": + case 2: + message.type = 2; + break; + } + switch (object.newJobState) { + default: + if (typeof object.newJobState === "number") { + message.newJobState = object.newJobState; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.newJobState = 0; + break; + case "QUEUED": + case 1: + message.newJobState = 1; + break; + case "SCHEDULED": + case 2: + message.newJobState = 2; + break; + case "RUNNING": + case 3: + message.newJobState = 3; + break; + case "SUCCEEDED": + case 4: + message.newJobState = 4; + break; + case "FAILED": + case 5: + message.newJobState = 5; + break; + case "DELETION_IN_PROGRESS": + case 6: + message.newJobState = 6; + break; + case "CANCELLATION_IN_PROGRESS": + case 7: + message.newJobState = 7; + break; + case "CANCELLED": + case 8: + message.newJobState = 8; + break; + } + switch (object.newTaskState) { + default: + if (typeof object.newTaskState === "number") { + message.newTaskState = object.newTaskState; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.newTaskState = 0; + break; + case "PENDING": + case 1: + message.newTaskState = 1; + break; + case "ASSIGNED": + case 2: + message.newTaskState = 2; + break; + case "RUNNING": + case 3: + message.newTaskState = 3; + break; + case "FAILED": + case 4: + message.newTaskState = 4; + break; + case "SUCCEEDED": + case 5: + message.newTaskState = 5; + break; + case "UNEXECUTED": + case 6: + message.newTaskState = 6; + break; + } + return message; + }; + + /** + * Creates a plain object from a Message message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.JobNotification.Message + * @static + * @param {google.cloud.batch.v1alpha.JobNotification.Message} message Message + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Message.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.newJobState = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.newTaskState = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.batch.v1alpha.JobNotification.Type[message.type] === undefined ? message.type : $root.google.cloud.batch.v1alpha.JobNotification.Type[message.type] : message.type; + if (message.newJobState != null && message.hasOwnProperty("newJobState")) + object.newJobState = options.enums === String ? $root.google.cloud.batch.v1alpha.JobStatus.State[message.newJobState] === undefined ? message.newJobState : $root.google.cloud.batch.v1alpha.JobStatus.State[message.newJobState] : message.newJobState; + if (message.newTaskState != null && message.hasOwnProperty("newTaskState")) + object.newTaskState = options.enums === String ? $root.google.cloud.batch.v1alpha.TaskStatus.State[message.newTaskState] === undefined ? message.newTaskState : $root.google.cloud.batch.v1alpha.TaskStatus.State[message.newTaskState] : message.newTaskState; + return object; + }; + + /** + * Converts this Message to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.JobNotification.Message + * @instance + * @returns {Object.} JSON object + */ + Message.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Message + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.JobNotification.Message + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Message.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.JobNotification.Message"; + }; + + return Message; + })(); + + /** + * Type enum. + * @name google.cloud.batch.v1alpha.JobNotification.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} JOB_STATE_CHANGED=1 JOB_STATE_CHANGED value + * @property {number} TASK_STATE_CHANGED=2 TASK_STATE_CHANGED value + */ + JobNotification.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "JOB_STATE_CHANGED"] = 1; + values[valuesById[2] = "TASK_STATE_CHANGED"] = 2; + return values; + })(); + + return JobNotification; + })(); + + v1alpha.AllocationPolicy = (function() { + + /** + * Properties of an AllocationPolicy. + * @memberof google.cloud.batch.v1alpha + * @interface IAllocationPolicy + * @property {google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy|null} [location] AllocationPolicy location + * @property {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy|null} [instance] AllocationPolicy instance + * @property {Array.|null} [instances] AllocationPolicy instances + * @property {Array.|null} [instanceTemplates] AllocationPolicy instanceTemplates + * @property {Array.|null} [provisioningModels] AllocationPolicy provisioningModels + * @property {string|null} [serviceAccountEmail] AllocationPolicy serviceAccountEmail + * @property {google.cloud.batch.v1alpha.IServiceAccount|null} [serviceAccount] AllocationPolicy serviceAccount + * @property {Object.|null} [labels] AllocationPolicy labels + * @property {google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy|null} [network] AllocationPolicy network + * @property {google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy|null} [placement] AllocationPolicy placement + * @property {Array.|null} [tags] AllocationPolicy tags + */ + + /** + * Constructs a new AllocationPolicy. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents an AllocationPolicy. + * @implements IAllocationPolicy + * @constructor + * @param {google.cloud.batch.v1alpha.IAllocationPolicy=} [properties] Properties to set + */ + function AllocationPolicy(properties) { + this.instances = []; + this.instanceTemplates = []; + this.provisioningModels = []; + this.labels = {}; + this.tags = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AllocationPolicy location. + * @member {google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy|null|undefined} location + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.location = null; + + /** + * AllocationPolicy instance. + * @member {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy|null|undefined} instance + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.instance = null; + + /** + * AllocationPolicy instances. + * @member {Array.} instances + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.instances = $util.emptyArray; + + /** + * AllocationPolicy instanceTemplates. + * @member {Array.} instanceTemplates + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.instanceTemplates = $util.emptyArray; + + /** + * AllocationPolicy provisioningModels. + * @member {Array.} provisioningModels + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.provisioningModels = $util.emptyArray; + + /** + * AllocationPolicy serviceAccountEmail. + * @member {string} serviceAccountEmail + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.serviceAccountEmail = ""; + + /** + * AllocationPolicy serviceAccount. + * @member {google.cloud.batch.v1alpha.IServiceAccount|null|undefined} serviceAccount + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.serviceAccount = null; + + /** + * AllocationPolicy labels. + * @member {Object.} labels + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.labels = $util.emptyObject; + + /** + * AllocationPolicy network. + * @member {google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy|null|undefined} network + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.network = null; + + /** + * AllocationPolicy placement. + * @member {google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy|null|undefined} placement + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.placement = null; + + /** + * AllocationPolicy tags. + * @member {Array.} tags + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.tags = $util.emptyArray; + + /** + * Creates a new AllocationPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @static + * @param {google.cloud.batch.v1alpha.IAllocationPolicy=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.AllocationPolicy} AllocationPolicy instance + */ + AllocationPolicy.create = function create(properties) { + return new AllocationPolicy(properties); + }; + + /** + * Encodes the specified AllocationPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @static + * @param {google.cloud.batch.v1alpha.IAllocationPolicy} message AllocationPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllocationPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + $root.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.encode(message.location, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.encode(message.instance, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.instanceTemplates != null && message.instanceTemplates.length) + for (var i = 0; i < message.instanceTemplates.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.instanceTemplates[i]); + if (message.provisioningModels != null && message.provisioningModels.length) { + writer.uint32(/* id 4, wireType 2 =*/34).fork(); + for (var i = 0; i < message.provisioningModels.length; ++i) + writer.int32(message.provisioningModels[i]); + writer.ldelim(); + } + if (message.serviceAccountEmail != null && Object.hasOwnProperty.call(message, "serviceAccountEmail")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.serviceAccountEmail); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.encode(message.network, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.encode(message.instances[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + $root.google.cloud.batch.v1alpha.ServiceAccount.encode(message.serviceAccount, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.placement != null && Object.hasOwnProperty.call(message, "placement")) + $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.encode(message.placement, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.tags != null && message.tags.length) + for (var i = 0; i < message.tags.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.tags[i]); + return writer; + }; + + /** + * Encodes the specified AllocationPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @static + * @param {google.cloud.batch.v1alpha.IAllocationPolicy} message AllocationPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllocationPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AllocationPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.AllocationPolicy} AllocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllocationPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.location = $root.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.decode(reader, reader.uint32()); + break; + } + case 2: { + message.instance = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.decode(reader, reader.uint32()); + break; + } + case 8: { + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.instanceTemplates && message.instanceTemplates.length)) + message.instanceTemplates = []; + message.instanceTemplates.push(reader.string()); + break; + } + case 4: { + if (!(message.provisioningModels && message.provisioningModels.length)) + message.provisioningModels = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.provisioningModels.push(reader.int32()); + } else + message.provisioningModels.push(reader.int32()); + break; + } + case 5: { + message.serviceAccountEmail = reader.string(); + break; + } + case 9: { + message.serviceAccount = $root.google.cloud.batch.v1alpha.ServiceAccount.decode(reader, reader.uint32()); + break; + } + case 6: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 7: { + message.network = $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.decode(reader, reader.uint32()); + break; + } + case 10: { + message.placement = $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.decode(reader, reader.uint32()); + break; + } + case 11: { + if (!(message.tags && message.tags.length)) + message.tags = []; + message.tags.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AllocationPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.AllocationPolicy} AllocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllocationPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AllocationPolicy message. + * @function verify + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AllocationPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.verify(message.location); + if (error) + return "location." + error; + } + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.verify(message.instance); + if (error) + return "instance." + error; + } + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } + if (message.instanceTemplates != null && message.hasOwnProperty("instanceTemplates")) { + if (!Array.isArray(message.instanceTemplates)) + return "instanceTemplates: array expected"; + for (var i = 0; i < message.instanceTemplates.length; ++i) + if (!$util.isString(message.instanceTemplates[i])) + return "instanceTemplates: string[] expected"; + } + if (message.provisioningModels != null && message.hasOwnProperty("provisioningModels")) { + if (!Array.isArray(message.provisioningModels)) + return "provisioningModels: array expected"; + for (var i = 0; i < message.provisioningModels.length; ++i) + switch (message.provisioningModels[i]) { + default: + return "provisioningModels: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) + if (!$util.isString(message.serviceAccountEmail)) + return "serviceAccountEmail: string expected"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) { + var error = $root.google.cloud.batch.v1alpha.ServiceAccount.verify(message.serviceAccount); + if (error) + return "serviceAccount." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.network != null && message.hasOwnProperty("network")) { + var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.verify(message.network); + if (error) + return "network." + error; + } + if (message.placement != null && message.hasOwnProperty("placement")) { + var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.verify(message.placement); + if (error) + return "placement." + error; + } + if (message.tags != null && message.hasOwnProperty("tags")) { + if (!Array.isArray(message.tags)) + return "tags: array expected"; + for (var i = 0; i < message.tags.length; ++i) + if (!$util.isString(message.tags[i])) + return "tags: string[] expected"; + } + return null; + }; + + /** + * Creates an AllocationPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.AllocationPolicy} AllocationPolicy + */ + AllocationPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy) + return object; + var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy(); + if (object.location != null) { + if (typeof object.location !== "object") + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.location: object expected"); + message.location = $root.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.fromObject(object.location); + } + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.instance: object expected"); + message.instance = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.fromObject(object.instance); + } + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.instances: object expected"); + message.instances[i] = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.fromObject(object.instances[i]); + } + } + if (object.instanceTemplates) { + if (!Array.isArray(object.instanceTemplates)) + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.instanceTemplates: array expected"); + message.instanceTemplates = []; + for (var i = 0; i < object.instanceTemplates.length; ++i) + message.instanceTemplates[i] = String(object.instanceTemplates[i]); + } + if (object.provisioningModels) { + if (!Array.isArray(object.provisioningModels)) + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.provisioningModels: array expected"); + message.provisioningModels = []; + for (var i = 0; i < object.provisioningModels.length; ++i) + switch (object.provisioningModels[i]) { + default: + if (typeof object.provisioningModels[i] === "number") { + message.provisioningModels[i] = object.provisioningModels[i]; + break; + } + case "PROVISIONING_MODEL_UNSPECIFIED": + case 0: + message.provisioningModels[i] = 0; + break; + case "STANDARD": + case 1: + message.provisioningModels[i] = 1; + break; + case "SPOT": + case 2: + message.provisioningModels[i] = 2; + break; + case "PREEMPTIBLE": + case 3: + message.provisioningModels[i] = 3; + break; + } + } + if (object.serviceAccountEmail != null) + message.serviceAccountEmail = String(object.serviceAccountEmail); + if (object.serviceAccount != null) { + if (typeof object.serviceAccount !== "object") + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.serviceAccount: object expected"); + message.serviceAccount = $root.google.cloud.batch.v1alpha.ServiceAccount.fromObject(object.serviceAccount); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.network != null) { + if (typeof object.network !== "object") + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.network: object expected"); + message.network = $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.fromObject(object.network); + } + if (object.placement != null) { + if (typeof object.placement !== "object") + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.placement: object expected"); + message.placement = $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.fromObject(object.placement); + } + if (object.tags) { + if (!Array.isArray(object.tags)) + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.tags: array expected"); + message.tags = []; + for (var i = 0; i < object.tags.length; ++i) + message.tags[i] = String(object.tags[i]); + } + return message; + }; + + /** + * Creates a plain object from an AllocationPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy} message AllocationPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AllocationPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.instanceTemplates = []; + object.provisioningModels = []; + object.instances = []; + object.tags = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.location = null; + object.instance = null; + object.serviceAccountEmail = ""; + object.network = null; + object.serviceAccount = null; + object.placement = null; + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = $root.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.toObject(message.location, options); + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.toObject(message.instance, options); + if (message.instanceTemplates && message.instanceTemplates.length) { + object.instanceTemplates = []; + for (var j = 0; j < message.instanceTemplates.length; ++j) + object.instanceTemplates[j] = message.instanceTemplates[j]; + } + if (message.provisioningModels && message.provisioningModels.length) { + object.provisioningModels = []; + for (var j = 0; j < message.provisioningModels.length; ++j) + object.provisioningModels[j] = options.enums === String ? $root.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel[message.provisioningModels[j]] === undefined ? message.provisioningModels[j] : $root.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel[message.provisioningModels[j]] : message.provisioningModels[j]; + } + if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) + object.serviceAccountEmail = message.serviceAccountEmail; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.network != null && message.hasOwnProperty("network")) + object.network = $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.toObject(message.network, options); + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.toObject(message.instances[j], options); + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = $root.google.cloud.batch.v1alpha.ServiceAccount.toObject(message.serviceAccount, options); + if (message.placement != null && message.hasOwnProperty("placement")) + object.placement = $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.toObject(message.placement, options); + if (message.tags && message.tags.length) { + object.tags = []; + for (var j = 0; j < message.tags.length; ++j) + object.tags[j] = message.tags[j]; + } + return object; + }; + + /** + * Converts this AllocationPolicy to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @instance + * @returns {Object.} JSON object + */ + AllocationPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AllocationPolicy + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AllocationPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy"; + }; + + AllocationPolicy.LocationPolicy = (function() { + + /** + * Properties of a LocationPolicy. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @interface ILocationPolicy + * @property {Array.|null} [allowedLocations] LocationPolicy allowedLocations + * @property {Array.|null} [deniedLocations] LocationPolicy deniedLocations + */ + + /** + * Constructs a new LocationPolicy. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @classdesc Represents a LocationPolicy. + * @implements ILocationPolicy + * @constructor + * @param {google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy=} [properties] Properties to set + */ + function LocationPolicy(properties) { + this.allowedLocations = []; + this.deniedLocations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LocationPolicy allowedLocations. + * @member {Array.} allowedLocations + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy + * @instance + */ + LocationPolicy.prototype.allowedLocations = $util.emptyArray; + + /** + * LocationPolicy deniedLocations. + * @member {Array.} deniedLocations + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy + * @instance + */ + LocationPolicy.prototype.deniedLocations = $util.emptyArray; + + /** + * Creates a new LocationPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy} LocationPolicy instance + */ + LocationPolicy.create = function create(properties) { + return new LocationPolicy(properties); + }; + + /** + * Encodes the specified LocationPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy} message LocationPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedLocations != null && message.allowedLocations.length) + for (var i = 0; i < message.allowedLocations.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedLocations[i]); + if (message.deniedLocations != null && message.deniedLocations.length) + for (var i = 0; i < message.deniedLocations.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.deniedLocations[i]); + return writer; + }; + + /** + * Encodes the specified LocationPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy} message LocationPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocationPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy} LocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.allowedLocations && message.allowedLocations.length)) + message.allowedLocations = []; + message.allowedLocations.push(reader.string()); + break; + } + case 2: { + if (!(message.deniedLocations && message.deniedLocations.length)) + message.deniedLocations = []; + message.deniedLocations.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocationPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy} LocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocationPolicy message. + * @function verify + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocationPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowedLocations != null && message.hasOwnProperty("allowedLocations")) { + if (!Array.isArray(message.allowedLocations)) + return "allowedLocations: array expected"; + for (var i = 0; i < message.allowedLocations.length; ++i) + if (!$util.isString(message.allowedLocations[i])) + return "allowedLocations: string[] expected"; + } + if (message.deniedLocations != null && message.hasOwnProperty("deniedLocations")) { + if (!Array.isArray(message.deniedLocations)) + return "deniedLocations: array expected"; + for (var i = 0; i < message.deniedLocations.length; ++i) + if (!$util.isString(message.deniedLocations[i])) + return "deniedLocations: string[] expected"; + } + return null; + }; + + /** + * Creates a LocationPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy} LocationPolicy + */ + LocationPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy) + return object; + var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy(); + if (object.allowedLocations) { + if (!Array.isArray(object.allowedLocations)) + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.allowedLocations: array expected"); + message.allowedLocations = []; + for (var i = 0; i < object.allowedLocations.length; ++i) + message.allowedLocations[i] = String(object.allowedLocations[i]); + } + if (object.deniedLocations) { + if (!Array.isArray(object.deniedLocations)) + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.deniedLocations: array expected"); + message.deniedLocations = []; + for (var i = 0; i < object.deniedLocations.length; ++i) + message.deniedLocations[i] = String(object.deniedLocations[i]); + } + return message; + }; + + /** + * Creates a plain object from a LocationPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy} message LocationPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocationPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.allowedLocations = []; + object.deniedLocations = []; + } + if (message.allowedLocations && message.allowedLocations.length) { + object.allowedLocations = []; + for (var j = 0; j < message.allowedLocations.length; ++j) + object.allowedLocations[j] = message.allowedLocations[j]; + } + if (message.deniedLocations && message.deniedLocations.length) { + object.deniedLocations = []; + for (var j = 0; j < message.deniedLocations.length; ++j) + object.deniedLocations[j] = message.deniedLocations[j]; + } + return object; + }; + + /** + * Converts this LocationPolicy to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy + * @instance + * @returns {Object.} JSON object + */ + LocationPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LocationPolicy + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LocationPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy"; + }; + + return LocationPolicy; + })(); + + AllocationPolicy.Disk = (function() { + + /** + * Properties of a Disk. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @interface IDisk + * @property {string|null} [image] Disk image + * @property {string|null} [snapshot] Disk snapshot + * @property {string|null} [type] Disk type + * @property {number|Long|null} [sizeGb] Disk sizeGb + * @property {string|null} [diskInterface] Disk diskInterface + */ + + /** + * Constructs a new Disk. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @classdesc Represents a Disk. + * @implements IDisk + * @constructor + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IDisk=} [properties] Properties to set + */ + function Disk(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Disk image. + * @member {string|null|undefined} image + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk + * @instance + */ + Disk.prototype.image = null; + + /** + * Disk snapshot. + * @member {string|null|undefined} snapshot + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk + * @instance + */ + Disk.prototype.snapshot = null; + + /** + * Disk type. + * @member {string} type + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk + * @instance + */ + Disk.prototype.type = ""; + + /** + * Disk sizeGb. + * @member {number|Long} sizeGb + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk + * @instance + */ + Disk.prototype.sizeGb = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk diskInterface. + * @member {string} diskInterface + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk + * @instance + */ + Disk.prototype.diskInterface = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Disk dataSource. + * @member {"image"|"snapshot"|undefined} dataSource + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk + * @instance + */ + Object.defineProperty(Disk.prototype, "dataSource", { + get: $util.oneOfGetter($oneOfFields = ["image", "snapshot"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Disk instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IDisk=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.Disk} Disk instance + */ + Disk.create = function create(properties) { + return new Disk(properties); + }; + + /** + * Encodes the specified Disk message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.Disk.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IDisk} message Disk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Disk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.sizeGb != null && Object.hasOwnProperty.call(message, "sizeGb")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.sizeGb); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.image); + if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.snapshot); + if (message.diskInterface != null && Object.hasOwnProperty.call(message, "diskInterface")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.diskInterface); + return writer; + }; + + /** + * Encodes the specified Disk message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.Disk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IDisk} message Disk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Disk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Disk message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.Disk} Disk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Disk.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.image = reader.string(); + break; + } + case 5: { + message.snapshot = reader.string(); + break; + } + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.sizeGb = reader.int64(); + break; + } + case 6: { + message.diskInterface = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Disk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.Disk} Disk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Disk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Disk message. + * @function verify + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Disk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.image != null && message.hasOwnProperty("image")) { + properties.dataSource = 1; + if (!$util.isString(message.image)) + return "image: string expected"; + } + if (message.snapshot != null && message.hasOwnProperty("snapshot")) { + if (properties.dataSource === 1) + return "dataSource: multiple values"; + properties.dataSource = 1; + if (!$util.isString(message.snapshot)) + return "snapshot: string expected"; + } + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) + if (!$util.isInteger(message.sizeGb) && !(message.sizeGb && $util.isInteger(message.sizeGb.low) && $util.isInteger(message.sizeGb.high))) + return "sizeGb: integer|Long expected"; + if (message.diskInterface != null && message.hasOwnProperty("diskInterface")) + if (!$util.isString(message.diskInterface)) + return "diskInterface: string expected"; + return null; + }; + + /** + * Creates a Disk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.Disk} Disk + */ + Disk.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk) + return object; + var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk(); + if (object.image != null) + message.image = String(object.image); + if (object.snapshot != null) + message.snapshot = String(object.snapshot); + if (object.type != null) + message.type = String(object.type); + if (object.sizeGb != null) + if ($util.Long) + (message.sizeGb = $util.Long.fromValue(object.sizeGb)).unsigned = false; + else if (typeof object.sizeGb === "string") + message.sizeGb = parseInt(object.sizeGb, 10); + else if (typeof object.sizeGb === "number") + message.sizeGb = object.sizeGb; + else if (typeof object.sizeGb === "object") + message.sizeGb = new $util.LongBits(object.sizeGb.low >>> 0, object.sizeGb.high >>> 0).toNumber(); + if (object.diskInterface != null) + message.diskInterface = String(object.diskInterface); + return message; + }; + + /** + * Creates a plain object from a Disk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.Disk} message Disk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Disk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.sizeGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sizeGb = options.longs === String ? "0" : 0; + object.diskInterface = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) + if (typeof message.sizeGb === "number") + object.sizeGb = options.longs === String ? String(message.sizeGb) : message.sizeGb; + else + object.sizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.sizeGb) : options.longs === Number ? new $util.LongBits(message.sizeGb.low >>> 0, message.sizeGb.high >>> 0).toNumber() : message.sizeGb; + if (message.image != null && message.hasOwnProperty("image")) { + object.image = message.image; + if (options.oneofs) + object.dataSource = "image"; + } + if (message.snapshot != null && message.hasOwnProperty("snapshot")) { + object.snapshot = message.snapshot; + if (options.oneofs) + object.dataSource = "snapshot"; + } + if (message.diskInterface != null && message.hasOwnProperty("diskInterface")) + object.diskInterface = message.diskInterface; + return object; + }; + + /** + * Converts this Disk to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk + * @instance + * @returns {Object.} JSON object + */ + Disk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Disk + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Disk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy.Disk"; + }; + + return Disk; + })(); + + AllocationPolicy.AttachedDisk = (function() { + + /** + * Properties of an AttachedDisk. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @interface IAttachedDisk + * @property {google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null} [newDisk] AttachedDisk newDisk + * @property {string|null} [existingDisk] AttachedDisk existingDisk + * @property {string|null} [deviceName] AttachedDisk deviceName + */ + + /** + * Constructs a new AttachedDisk. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @classdesc Represents an AttachedDisk. + * @implements IAttachedDisk + * @constructor + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk=} [properties] Properties to set + */ + function AttachedDisk(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AttachedDisk newDisk. + * @member {google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null|undefined} newDisk + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk + * @instance + */ + AttachedDisk.prototype.newDisk = null; + + /** + * AttachedDisk existingDisk. + * @member {string|null|undefined} existingDisk + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk + * @instance + */ + AttachedDisk.prototype.existingDisk = null; + + /** + * AttachedDisk deviceName. + * @member {string} deviceName + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk + * @instance + */ + AttachedDisk.prototype.deviceName = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AttachedDisk attached. + * @member {"newDisk"|"existingDisk"|undefined} attached + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "attached", { + get: $util.oneOfGetter($oneOfFields = ["newDisk", "existingDisk"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AttachedDisk instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk} AttachedDisk instance + */ + AttachedDisk.create = function create(properties) { + return new AttachedDisk(properties); + }; + + /** + * Encodes the specified AttachedDisk message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk} message AttachedDisk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttachedDisk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.newDisk != null && Object.hasOwnProperty.call(message, "newDisk")) + $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.encode(message.newDisk, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.existingDisk != null && Object.hasOwnProperty.call(message, "existingDisk")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.existingDisk); + if (message.deviceName != null && Object.hasOwnProperty.call(message, "deviceName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.deviceName); + return writer; + }; + + /** + * Encodes the specified AttachedDisk message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk} message AttachedDisk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttachedDisk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttachedDisk message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk} AttachedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttachedDisk.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.newDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.decode(reader, reader.uint32()); + break; + } + case 2: { + message.existingDisk = reader.string(); + break; + } + case 3: { + message.deviceName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttachedDisk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk} AttachedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttachedDisk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttachedDisk message. + * @function verify + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttachedDisk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.newDisk != null && message.hasOwnProperty("newDisk")) { + properties.attached = 1; + { + var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.verify(message.newDisk); + if (error) + return "newDisk." + error; + } + } + if (message.existingDisk != null && message.hasOwnProperty("existingDisk")) { + if (properties.attached === 1) + return "attached: multiple values"; + properties.attached = 1; + if (!$util.isString(message.existingDisk)) + return "existingDisk: string expected"; + } + if (message.deviceName != null && message.hasOwnProperty("deviceName")) + if (!$util.isString(message.deviceName)) + return "deviceName: string expected"; + return null; + }; + + /** + * Creates an AttachedDisk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk} AttachedDisk + */ + AttachedDisk.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk) + return object; + var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk(); + if (object.newDisk != null) { + if (typeof object.newDisk !== "object") + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.newDisk: object expected"); + message.newDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.fromObject(object.newDisk); + } + if (object.existingDisk != null) + message.existingDisk = String(object.existingDisk); + if (object.deviceName != null) + message.deviceName = String(object.deviceName); + return message; + }; + + /** + * Creates a plain object from an AttachedDisk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk} message AttachedDisk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttachedDisk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.deviceName = ""; + if (message.newDisk != null && message.hasOwnProperty("newDisk")) { + object.newDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.toObject(message.newDisk, options); + if (options.oneofs) + object.attached = "newDisk"; + } + if (message.existingDisk != null && message.hasOwnProperty("existingDisk")) { + object.existingDisk = message.existingDisk; + if (options.oneofs) + object.attached = "existingDisk"; + } + if (message.deviceName != null && message.hasOwnProperty("deviceName")) + object.deviceName = message.deviceName; + return object; + }; + + /** + * Converts this AttachedDisk to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk + * @instance + * @returns {Object.} JSON object + */ + AttachedDisk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AttachedDisk + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AttachedDisk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk"; + }; + + return AttachedDisk; + })(); + + AllocationPolicy.Accelerator = (function() { + + /** + * Properties of an Accelerator. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @interface IAccelerator + * @property {string|null} [type] Accelerator type + * @property {number|Long|null} [count] Accelerator count + * @property {boolean|null} [installGpuDrivers] Accelerator installGpuDrivers + * @property {string|null} [driverVersion] Accelerator driverVersion + */ + + /** + * Constructs a new Accelerator. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @classdesc Represents an Accelerator. + * @implements IAccelerator + * @constructor + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator=} [properties] Properties to set + */ + function Accelerator(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Accelerator type. + * @member {string} type + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator + * @instance + */ + Accelerator.prototype.type = ""; + + /** + * Accelerator count. + * @member {number|Long} count + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator + * @instance + */ + Accelerator.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Accelerator installGpuDrivers. + * @member {boolean} installGpuDrivers + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator + * @instance + */ + Accelerator.prototype.installGpuDrivers = false; + + /** + * Accelerator driverVersion. + * @member {string} driverVersion + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator + * @instance + */ + Accelerator.prototype.driverVersion = ""; + + /** + * Creates a new Accelerator instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.Accelerator} Accelerator instance + */ + Accelerator.create = function create(properties) { + return new Accelerator(properties); + }; + + /** + * Encodes the specified Accelerator message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator} message Accelerator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Accelerator.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); + if (message.installGpuDrivers != null && Object.hasOwnProperty.call(message, "installGpuDrivers")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.installGpuDrivers); + if (message.driverVersion != null && Object.hasOwnProperty.call(message, "driverVersion")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.driverVersion); + return writer; + }; + + /** + * Encodes the specified Accelerator message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator} message Accelerator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Accelerator.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Accelerator message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.Accelerator} Accelerator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Accelerator.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.count = reader.int64(); + break; + } + case 3: { + message.installGpuDrivers = reader.bool(); + break; + } + case 4: { + message.driverVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Accelerator message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.Accelerator} Accelerator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Accelerator.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Accelerator message. + * @function verify + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Accelerator.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + if (message.installGpuDrivers != null && message.hasOwnProperty("installGpuDrivers")) + if (typeof message.installGpuDrivers !== "boolean") + return "installGpuDrivers: boolean expected"; + if (message.driverVersion != null && message.hasOwnProperty("driverVersion")) + if (!$util.isString(message.driverVersion)) + return "driverVersion: string expected"; + return null; + }; + + /** + * Creates an Accelerator message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.Accelerator} Accelerator + */ + Accelerator.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator) + return object; + var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator(); + if (object.type != null) + message.type = String(object.type); + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + if (object.installGpuDrivers != null) + message.installGpuDrivers = Boolean(object.installGpuDrivers); + if (object.driverVersion != null) + message.driverVersion = String(object.driverVersion); + return message; + }; + + /** + * Creates a plain object from an Accelerator message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.Accelerator} message Accelerator + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Accelerator.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + object.installGpuDrivers = false; + object.driverVersion = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + if (message.installGpuDrivers != null && message.hasOwnProperty("installGpuDrivers")) + object.installGpuDrivers = message.installGpuDrivers; + if (message.driverVersion != null && message.hasOwnProperty("driverVersion")) + object.driverVersion = message.driverVersion; + return object; + }; + + /** + * Converts this Accelerator to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator + * @instance + * @returns {Object.} JSON object + */ + Accelerator.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Accelerator + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Accelerator.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy.Accelerator"; + }; + + return Accelerator; + })(); + + AllocationPolicy.InstancePolicy = (function() { + + /** + * Properties of an InstancePolicy. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @interface IInstancePolicy + * @property {Array.|null} [allowedMachineTypes] InstancePolicy allowedMachineTypes + * @property {string|null} [machineType] InstancePolicy machineType + * @property {string|null} [minCpuPlatform] InstancePolicy minCpuPlatform + * @property {google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel|null} [provisioningModel] InstancePolicy provisioningModel + * @property {Array.|null} [accelerators] InstancePolicy accelerators + * @property {google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null} [bootDisk] InstancePolicy bootDisk + * @property {Array.|null} [disks] InstancePolicy disks + * @property {string|null} [reservation] InstancePolicy reservation + */ + + /** + * Constructs a new InstancePolicy. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @classdesc Represents an InstancePolicy. + * @implements IInstancePolicy + * @constructor + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy=} [properties] Properties to set + */ + function InstancePolicy(properties) { + this.allowedMachineTypes = []; + this.accelerators = []; + this.disks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstancePolicy allowedMachineTypes. + * @member {Array.} allowedMachineTypes + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + * @instance + */ + InstancePolicy.prototype.allowedMachineTypes = $util.emptyArray; + + /** + * InstancePolicy machineType. + * @member {string} machineType + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + * @instance + */ + InstancePolicy.prototype.machineType = ""; + + /** + * InstancePolicy minCpuPlatform. + * @member {string} minCpuPlatform + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + * @instance + */ + InstancePolicy.prototype.minCpuPlatform = ""; + + /** + * InstancePolicy provisioningModel. + * @member {google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel} provisioningModel + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + * @instance + */ + InstancePolicy.prototype.provisioningModel = 0; + + /** + * InstancePolicy accelerators. + * @member {Array.} accelerators + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + * @instance + */ + InstancePolicy.prototype.accelerators = $util.emptyArray; + + /** + * InstancePolicy bootDisk. + * @member {google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null|undefined} bootDisk + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + * @instance + */ + InstancePolicy.prototype.bootDisk = null; + + /** + * InstancePolicy disks. + * @member {Array.} disks + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + * @instance + */ + InstancePolicy.prototype.disks = $util.emptyArray; + + /** + * InstancePolicy reservation. + * @member {string} reservation + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + * @instance + */ + InstancePolicy.prototype.reservation = ""; + + /** + * Creates a new InstancePolicy instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy} InstancePolicy instance + */ + InstancePolicy.create = function create(properties) { + return new InstancePolicy(properties); + }; + + /** + * Encodes the specified InstancePolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy} message InstancePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancePolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedMachineTypes != null && message.allowedMachineTypes.length) + for (var i = 0; i < message.allowedMachineTypes.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedMachineTypes[i]); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.machineType); + if (message.minCpuPlatform != null && Object.hasOwnProperty.call(message, "minCpuPlatform")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.minCpuPlatform); + if (message.provisioningModel != null && Object.hasOwnProperty.call(message, "provisioningModel")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.provisioningModel); + if (message.accelerators != null && message.accelerators.length) + for (var i = 0; i < message.accelerators.length; ++i) + $root.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.encode(message.accelerators[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.disks != null && message.disks.length) + for (var i = 0; i < message.disks.length; ++i) + $root.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.encode(message.disks[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.reservation != null && Object.hasOwnProperty.call(message, "reservation")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.reservation); + if (message.bootDisk != null && Object.hasOwnProperty.call(message, "bootDisk")) + $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.encode(message.bootDisk, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstancePolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy} message InstancePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancePolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstancePolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy} InstancePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancePolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.allowedMachineTypes && message.allowedMachineTypes.length)) + message.allowedMachineTypes = []; + message.allowedMachineTypes.push(reader.string()); + break; + } + case 2: { + message.machineType = reader.string(); + break; + } + case 3: { + message.minCpuPlatform = reader.string(); + break; + } + case 4: { + message.provisioningModel = reader.int32(); + break; + } + case 5: { + if (!(message.accelerators && message.accelerators.length)) + message.accelerators = []; + message.accelerators.push($root.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.decode(reader, reader.uint32())); + break; + } + case 8: { + message.bootDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.disks && message.disks.length)) + message.disks = []; + message.disks.push($root.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.decode(reader, reader.uint32())); + break; + } + case 7: { + message.reservation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstancePolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy} InstancePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancePolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstancePolicy message. + * @function verify + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstancePolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowedMachineTypes != null && message.hasOwnProperty("allowedMachineTypes")) { + if (!Array.isArray(message.allowedMachineTypes)) + return "allowedMachineTypes: array expected"; + for (var i = 0; i < message.allowedMachineTypes.length; ++i) + if (!$util.isString(message.allowedMachineTypes[i])) + return "allowedMachineTypes: string[] expected"; + } + if (message.machineType != null && message.hasOwnProperty("machineType")) + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) + if (!$util.isString(message.minCpuPlatform)) + return "minCpuPlatform: string expected"; + if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) + switch (message.provisioningModel) { + default: + return "provisioningModel: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.accelerators != null && message.hasOwnProperty("accelerators")) { + if (!Array.isArray(message.accelerators)) + return "accelerators: array expected"; + for (var i = 0; i < message.accelerators.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.verify(message.accelerators[i]); + if (error) + return "accelerators." + error; + } + } + if (message.bootDisk != null && message.hasOwnProperty("bootDisk")) { + var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.verify(message.bootDisk); + if (error) + return "bootDisk." + error; + } + if (message.disks != null && message.hasOwnProperty("disks")) { + if (!Array.isArray(message.disks)) + return "disks: array expected"; + for (var i = 0; i < message.disks.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.verify(message.disks[i]); + if (error) + return "disks." + error; + } + } + if (message.reservation != null && message.hasOwnProperty("reservation")) + if (!$util.isString(message.reservation)) + return "reservation: string expected"; + return null; + }; + + /** + * Creates an InstancePolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy} InstancePolicy + */ + InstancePolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy) + return object; + var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy(); + if (object.allowedMachineTypes) { + if (!Array.isArray(object.allowedMachineTypes)) + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.allowedMachineTypes: array expected"); + message.allowedMachineTypes = []; + for (var i = 0; i < object.allowedMachineTypes.length; ++i) + message.allowedMachineTypes[i] = String(object.allowedMachineTypes[i]); + } + if (object.machineType != null) + message.machineType = String(object.machineType); + if (object.minCpuPlatform != null) + message.minCpuPlatform = String(object.minCpuPlatform); + switch (object.provisioningModel) { + default: + if (typeof object.provisioningModel === "number") { + message.provisioningModel = object.provisioningModel; + break; + } + break; + case "PROVISIONING_MODEL_UNSPECIFIED": + case 0: + message.provisioningModel = 0; + break; + case "STANDARD": + case 1: + message.provisioningModel = 1; + break; + case "SPOT": + case 2: + message.provisioningModel = 2; + break; + case "PREEMPTIBLE": + case 3: + message.provisioningModel = 3; + break; + } + if (object.accelerators) { + if (!Array.isArray(object.accelerators)) + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.accelerators: array expected"); + message.accelerators = []; + for (var i = 0; i < object.accelerators.length; ++i) { + if (typeof object.accelerators[i] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.accelerators: object expected"); + message.accelerators[i] = $root.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.fromObject(object.accelerators[i]); + } + } + if (object.bootDisk != null) { + if (typeof object.bootDisk !== "object") + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.bootDisk: object expected"); + message.bootDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.fromObject(object.bootDisk); + } + if (object.disks) { + if (!Array.isArray(object.disks)) + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.disks: array expected"); + message.disks = []; + for (var i = 0; i < object.disks.length; ++i) { + if (typeof object.disks[i] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.disks: object expected"); + message.disks[i] = $root.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.fromObject(object.disks[i]); + } + } + if (object.reservation != null) + message.reservation = String(object.reservation); + return message; + }; + + /** + * Creates a plain object from an InstancePolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy} message InstancePolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstancePolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.allowedMachineTypes = []; + object.accelerators = []; + object.disks = []; + } + if (options.defaults) { + object.machineType = ""; + object.minCpuPlatform = ""; + object.provisioningModel = options.enums === String ? "PROVISIONING_MODEL_UNSPECIFIED" : 0; + object.reservation = ""; + object.bootDisk = null; + } + if (message.allowedMachineTypes && message.allowedMachineTypes.length) { + object.allowedMachineTypes = []; + for (var j = 0; j < message.allowedMachineTypes.length; ++j) + object.allowedMachineTypes[j] = message.allowedMachineTypes[j]; + } + if (message.machineType != null && message.hasOwnProperty("machineType")) + object.machineType = message.machineType; + if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) + object.minCpuPlatform = message.minCpuPlatform; + if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) + object.provisioningModel = options.enums === String ? $root.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel[message.provisioningModel] === undefined ? message.provisioningModel : $root.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel[message.provisioningModel] : message.provisioningModel; + if (message.accelerators && message.accelerators.length) { + object.accelerators = []; + for (var j = 0; j < message.accelerators.length; ++j) + object.accelerators[j] = $root.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.toObject(message.accelerators[j], options); + } + if (message.disks && message.disks.length) { + object.disks = []; + for (var j = 0; j < message.disks.length; ++j) + object.disks[j] = $root.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.toObject(message.disks[j], options); + } + if (message.reservation != null && message.hasOwnProperty("reservation")) + object.reservation = message.reservation; + if (message.bootDisk != null && message.hasOwnProperty("bootDisk")) + object.bootDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.toObject(message.bootDisk, options); + return object; + }; + + /** + * Converts this InstancePolicy to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + * @instance + * @returns {Object.} JSON object + */ + InstancePolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstancePolicy + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstancePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy"; + }; + + return InstancePolicy; + })(); + + AllocationPolicy.InstancePolicyOrTemplate = (function() { + + /** + * Properties of an InstancePolicyOrTemplate. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @interface IInstancePolicyOrTemplate + * @property {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy|null} [policy] InstancePolicyOrTemplate policy + * @property {string|null} [instanceTemplate] InstancePolicyOrTemplate instanceTemplate + * @property {boolean|null} [installGpuDrivers] InstancePolicyOrTemplate installGpuDrivers + * @property {boolean|null} [installOpsAgent] InstancePolicyOrTemplate installOpsAgent + * @property {boolean|null} [blockProjectSshKeys] InstancePolicyOrTemplate blockProjectSshKeys + */ + + /** + * Constructs a new InstancePolicyOrTemplate. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @classdesc Represents an InstancePolicyOrTemplate. + * @implements IInstancePolicyOrTemplate + * @constructor + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate=} [properties] Properties to set + */ + function InstancePolicyOrTemplate(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstancePolicyOrTemplate policy. + * @member {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy|null|undefined} policy + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + * @instance + */ + InstancePolicyOrTemplate.prototype.policy = null; + + /** + * InstancePolicyOrTemplate instanceTemplate. + * @member {string|null|undefined} instanceTemplate + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + * @instance + */ + InstancePolicyOrTemplate.prototype.instanceTemplate = null; + + /** + * InstancePolicyOrTemplate installGpuDrivers. + * @member {boolean} installGpuDrivers + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + * @instance + */ + InstancePolicyOrTemplate.prototype.installGpuDrivers = false; + + /** + * InstancePolicyOrTemplate installOpsAgent. + * @member {boolean} installOpsAgent + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + * @instance + */ + InstancePolicyOrTemplate.prototype.installOpsAgent = false; + + /** + * InstancePolicyOrTemplate blockProjectSshKeys. + * @member {boolean} blockProjectSshKeys + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + * @instance + */ + InstancePolicyOrTemplate.prototype.blockProjectSshKeys = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstancePolicyOrTemplate policyTemplate. + * @member {"policy"|"instanceTemplate"|undefined} policyTemplate + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + * @instance + */ + Object.defineProperty(InstancePolicyOrTemplate.prototype, "policyTemplate", { + get: $util.oneOfGetter($oneOfFields = ["policy", "instanceTemplate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstancePolicyOrTemplate instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate} InstancePolicyOrTemplate instance + */ + InstancePolicyOrTemplate.create = function create(properties) { + return new InstancePolicyOrTemplate(properties); + }; + + /** + * Encodes the specified InstancePolicyOrTemplate message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate} message InstancePolicyOrTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancePolicyOrTemplate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.encode(message.policy, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.instanceTemplate != null && Object.hasOwnProperty.call(message, "instanceTemplate")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceTemplate); + if (message.installGpuDrivers != null && Object.hasOwnProperty.call(message, "installGpuDrivers")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.installGpuDrivers); + if (message.installOpsAgent != null && Object.hasOwnProperty.call(message, "installOpsAgent")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.installOpsAgent); + if (message.blockProjectSshKeys != null && Object.hasOwnProperty.call(message, "blockProjectSshKeys")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.blockProjectSshKeys); + return writer; + }; + + /** + * Encodes the specified InstancePolicyOrTemplate message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate} message InstancePolicyOrTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancePolicyOrTemplate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstancePolicyOrTemplate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate} InstancePolicyOrTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancePolicyOrTemplate.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.policy = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.decode(reader, reader.uint32()); + break; + } + case 2: { + message.instanceTemplate = reader.string(); + break; + } + case 3: { + message.installGpuDrivers = reader.bool(); + break; + } + case 4: { + message.installOpsAgent = reader.bool(); + break; + } + case 5: { + message.blockProjectSshKeys = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstancePolicyOrTemplate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate} InstancePolicyOrTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancePolicyOrTemplate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstancePolicyOrTemplate message. + * @function verify + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstancePolicyOrTemplate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.policy != null && message.hasOwnProperty("policy")) { + properties.policyTemplate = 1; + { + var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.verify(message.policy); + if (error) + return "policy." + error; + } + } + if (message.instanceTemplate != null && message.hasOwnProperty("instanceTemplate")) { + if (properties.policyTemplate === 1) + return "policyTemplate: multiple values"; + properties.policyTemplate = 1; + if (!$util.isString(message.instanceTemplate)) + return "instanceTemplate: string expected"; + } + if (message.installGpuDrivers != null && message.hasOwnProperty("installGpuDrivers")) + if (typeof message.installGpuDrivers !== "boolean") + return "installGpuDrivers: boolean expected"; + if (message.installOpsAgent != null && message.hasOwnProperty("installOpsAgent")) + if (typeof message.installOpsAgent !== "boolean") + return "installOpsAgent: boolean expected"; + if (message.blockProjectSshKeys != null && message.hasOwnProperty("blockProjectSshKeys")) + if (typeof message.blockProjectSshKeys !== "boolean") + return "blockProjectSshKeys: boolean expected"; + return null; + }; + + /** + * Creates an InstancePolicyOrTemplate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate} InstancePolicyOrTemplate + */ + InstancePolicyOrTemplate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate) + return object; + var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate(); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.policy: object expected"); + message.policy = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.fromObject(object.policy); + } + if (object.instanceTemplate != null) + message.instanceTemplate = String(object.instanceTemplate); + if (object.installGpuDrivers != null) + message.installGpuDrivers = Boolean(object.installGpuDrivers); + if (object.installOpsAgent != null) + message.installOpsAgent = Boolean(object.installOpsAgent); + if (object.blockProjectSshKeys != null) + message.blockProjectSshKeys = Boolean(object.blockProjectSshKeys); + return message; + }; + + /** + * Creates a plain object from an InstancePolicyOrTemplate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate} message InstancePolicyOrTemplate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstancePolicyOrTemplate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.installGpuDrivers = false; + object.installOpsAgent = false; + object.blockProjectSshKeys = false; + } + if (message.policy != null && message.hasOwnProperty("policy")) { + object.policy = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.toObject(message.policy, options); + if (options.oneofs) + object.policyTemplate = "policy"; + } + if (message.instanceTemplate != null && message.hasOwnProperty("instanceTemplate")) { + object.instanceTemplate = message.instanceTemplate; + if (options.oneofs) + object.policyTemplate = "instanceTemplate"; + } + if (message.installGpuDrivers != null && message.hasOwnProperty("installGpuDrivers")) + object.installGpuDrivers = message.installGpuDrivers; + if (message.installOpsAgent != null && message.hasOwnProperty("installOpsAgent")) + object.installOpsAgent = message.installOpsAgent; + if (message.blockProjectSshKeys != null && message.hasOwnProperty("blockProjectSshKeys")) + object.blockProjectSshKeys = message.blockProjectSshKeys; + return object; + }; + + /** + * Converts this InstancePolicyOrTemplate to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + * @instance + * @returns {Object.} JSON object + */ + InstancePolicyOrTemplate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstancePolicyOrTemplate + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstancePolicyOrTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate"; + }; + + return InstancePolicyOrTemplate; + })(); + + AllocationPolicy.NetworkInterface = (function() { + + /** + * Properties of a NetworkInterface. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @interface INetworkInterface + * @property {string|null} [network] NetworkInterface network + * @property {string|null} [subnetwork] NetworkInterface subnetwork + * @property {boolean|null} [noExternalIpAddress] NetworkInterface noExternalIpAddress + */ + + /** + * Constructs a new NetworkInterface. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @classdesc Represents a NetworkInterface. + * @implements INetworkInterface + * @constructor + * @param {google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface=} [properties] Properties to set + */ + function NetworkInterface(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkInterface network. + * @member {string} network + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface + * @instance + */ + NetworkInterface.prototype.network = ""; + + /** + * NetworkInterface subnetwork. + * @member {string} subnetwork + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface + * @instance + */ + NetworkInterface.prototype.subnetwork = ""; + + /** + * NetworkInterface noExternalIpAddress. + * @member {boolean} noExternalIpAddress + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface + * @instance + */ + NetworkInterface.prototype.noExternalIpAddress = false; + + /** + * Creates a new NetworkInterface instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface} NetworkInterface instance + */ + NetworkInterface.create = function create(properties) { + return new NetworkInterface(properties); + }; + + /** + * Encodes the specified NetworkInterface message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface} message NetworkInterface message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkInterface.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.network); + if (message.subnetwork != null && Object.hasOwnProperty.call(message, "subnetwork")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subnetwork); + if (message.noExternalIpAddress != null && Object.hasOwnProperty.call(message, "noExternalIpAddress")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.noExternalIpAddress); + return writer; + }; + + /** + * Encodes the specified NetworkInterface message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface} message NetworkInterface message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkInterface.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface} NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkInterface.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.network = reader.string(); + break; + } + case 2: { + message.subnetwork = reader.string(); + break; + } + case 3: { + message.noExternalIpAddress = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface} NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkInterface.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkInterface message. + * @function verify + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkInterface.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) + if (!$util.isString(message.subnetwork)) + return "subnetwork: string expected"; + if (message.noExternalIpAddress != null && message.hasOwnProperty("noExternalIpAddress")) + if (typeof message.noExternalIpAddress !== "boolean") + return "noExternalIpAddress: boolean expected"; + return null; + }; + + /** + * Creates a NetworkInterface message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface} NetworkInterface + */ + NetworkInterface.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface) + return object; + var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface(); + if (object.network != null) + message.network = String(object.network); + if (object.subnetwork != null) + message.subnetwork = String(object.subnetwork); + if (object.noExternalIpAddress != null) + message.noExternalIpAddress = Boolean(object.noExternalIpAddress); + return message; + }; + + /** + * Creates a plain object from a NetworkInterface message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface} message NetworkInterface + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkInterface.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.network = ""; + object.subnetwork = ""; + object.noExternalIpAddress = false; + } + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) + object.subnetwork = message.subnetwork; + if (message.noExternalIpAddress != null && message.hasOwnProperty("noExternalIpAddress")) + object.noExternalIpAddress = message.noExternalIpAddress; + return object; + }; + + /** + * Converts this NetworkInterface to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface + * @instance + * @returns {Object.} JSON object + */ + NetworkInterface.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NetworkInterface + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NetworkInterface.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface"; + }; + + return NetworkInterface; + })(); + + AllocationPolicy.NetworkPolicy = (function() { + + /** + * Properties of a NetworkPolicy. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @interface INetworkPolicy + * @property {Array.|null} [networkInterfaces] NetworkPolicy networkInterfaces + */ + + /** + * Constructs a new NetworkPolicy. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @classdesc Represents a NetworkPolicy. + * @implements INetworkPolicy + * @constructor + * @param {google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy=} [properties] Properties to set + */ + function NetworkPolicy(properties) { + this.networkInterfaces = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkPolicy networkInterfaces. + * @member {Array.} networkInterfaces + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy + * @instance + */ + NetworkPolicy.prototype.networkInterfaces = $util.emptyArray; + + /** + * Creates a new NetworkPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy} NetworkPolicy instance + */ + NetworkPolicy.create = function create(properties) { + return new NetworkPolicy(properties); + }; + + /** + * Encodes the specified NetworkPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy} message NetworkPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.networkInterfaces != null && message.networkInterfaces.length) + for (var i = 0; i < message.networkInterfaces.length; ++i) + $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.encode(message.networkInterfaces[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NetworkPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy} message NetworkPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy} NetworkPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.networkInterfaces && message.networkInterfaces.length)) + message.networkInterfaces = []; + message.networkInterfaces.push($root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy} NetworkPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkPolicy message. + * @function verify + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.networkInterfaces != null && message.hasOwnProperty("networkInterfaces")) { + if (!Array.isArray(message.networkInterfaces)) + return "networkInterfaces: array expected"; + for (var i = 0; i < message.networkInterfaces.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.verify(message.networkInterfaces[i]); + if (error) + return "networkInterfaces." + error; + } + } + return null; + }; + + /** + * Creates a NetworkPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy} NetworkPolicy + */ + NetworkPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy) + return object; + var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy(); + if (object.networkInterfaces) { + if (!Array.isArray(object.networkInterfaces)) + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.networkInterfaces: array expected"); + message.networkInterfaces = []; + for (var i = 0; i < object.networkInterfaces.length; ++i) { + if (typeof object.networkInterfaces[i] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.networkInterfaces: object expected"); + message.networkInterfaces[i] = $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.fromObject(object.networkInterfaces[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a NetworkPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy} message NetworkPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.networkInterfaces = []; + if (message.networkInterfaces && message.networkInterfaces.length) { + object.networkInterfaces = []; + for (var j = 0; j < message.networkInterfaces.length; ++j) + object.networkInterfaces[j] = $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.toObject(message.networkInterfaces[j], options); + } + return object; + }; + + /** + * Converts this NetworkPolicy to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy + * @instance + * @returns {Object.} JSON object + */ + NetworkPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NetworkPolicy + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NetworkPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy"; + }; + + return NetworkPolicy; + })(); + + AllocationPolicy.PlacementPolicy = (function() { + + /** + * Properties of a PlacementPolicy. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @interface IPlacementPolicy + * @property {string|null} [collocation] PlacementPolicy collocation + * @property {number|Long|null} [maxDistance] PlacementPolicy maxDistance + */ + + /** + * Constructs a new PlacementPolicy. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @classdesc Represents a PlacementPolicy. + * @implements IPlacementPolicy + * @constructor + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy=} [properties] Properties to set + */ + function PlacementPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PlacementPolicy collocation. + * @member {string} collocation + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy + * @instance + */ + PlacementPolicy.prototype.collocation = ""; + + /** + * PlacementPolicy maxDistance. + * @member {number|Long} maxDistance + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy + * @instance + */ + PlacementPolicy.prototype.maxDistance = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new PlacementPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy} PlacementPolicy instance + */ + PlacementPolicy.create = function create(properties) { + return new PlacementPolicy(properties); + }; + + /** + * Encodes the specified PlacementPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy} message PlacementPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlacementPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.collocation != null && Object.hasOwnProperty.call(message, "collocation")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.collocation); + if (message.maxDistance != null && Object.hasOwnProperty.call(message, "maxDistance")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.maxDistance); + return writer; + }; + + /** + * Encodes the specified PlacementPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy} message PlacementPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlacementPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PlacementPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy} PlacementPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlacementPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.collocation = reader.string(); + break; + } + case 2: { + message.maxDistance = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PlacementPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy} PlacementPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlacementPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PlacementPolicy message. + * @function verify + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PlacementPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.collocation != null && message.hasOwnProperty("collocation")) + if (!$util.isString(message.collocation)) + return "collocation: string expected"; + if (message.maxDistance != null && message.hasOwnProperty("maxDistance")) + if (!$util.isInteger(message.maxDistance) && !(message.maxDistance && $util.isInteger(message.maxDistance.low) && $util.isInteger(message.maxDistance.high))) + return "maxDistance: integer|Long expected"; + return null; + }; + + /** + * Creates a PlacementPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy} PlacementPolicy + */ + PlacementPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy) + return object; + var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy(); + if (object.collocation != null) + message.collocation = String(object.collocation); + if (object.maxDistance != null) + if ($util.Long) + (message.maxDistance = $util.Long.fromValue(object.maxDistance)).unsigned = false; + else if (typeof object.maxDistance === "string") + message.maxDistance = parseInt(object.maxDistance, 10); + else if (typeof object.maxDistance === "number") + message.maxDistance = object.maxDistance; + else if (typeof object.maxDistance === "object") + message.maxDistance = new $util.LongBits(object.maxDistance.low >>> 0, object.maxDistance.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a PlacementPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy} message PlacementPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PlacementPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.collocation = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxDistance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxDistance = options.longs === String ? "0" : 0; + } + if (message.collocation != null && message.hasOwnProperty("collocation")) + object.collocation = message.collocation; + if (message.maxDistance != null && message.hasOwnProperty("maxDistance")) + if (typeof message.maxDistance === "number") + object.maxDistance = options.longs === String ? String(message.maxDistance) : message.maxDistance; + else + object.maxDistance = options.longs === String ? $util.Long.prototype.toString.call(message.maxDistance) : options.longs === Number ? new $util.LongBits(message.maxDistance.low >>> 0, message.maxDistance.high >>> 0).toNumber() : message.maxDistance; + return object; + }; + + /** + * Converts this PlacementPolicy to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy + * @instance + * @returns {Object.} JSON object + */ + PlacementPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PlacementPolicy + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PlacementPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy"; + }; + + return PlacementPolicy; + })(); + + /** + * ProvisioningModel enum. + * @name google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel + * @enum {number} + * @property {number} PROVISIONING_MODEL_UNSPECIFIED=0 PROVISIONING_MODEL_UNSPECIFIED value + * @property {number} STANDARD=1 STANDARD value + * @property {number} SPOT=2 SPOT value + * @property {number} PREEMPTIBLE=3 PREEMPTIBLE value + */ + AllocationPolicy.ProvisioningModel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PROVISIONING_MODEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "STANDARD"] = 1; + values[valuesById[2] = "SPOT"] = 2; + values[valuesById[3] = "PREEMPTIBLE"] = 3; + return values; + })(); + + return AllocationPolicy; + })(); + + v1alpha.TaskGroup = (function() { + + /** + * Properties of a TaskGroup. + * @memberof google.cloud.batch.v1alpha + * @interface ITaskGroup + * @property {string|null} [name] TaskGroup name + * @property {google.cloud.batch.v1alpha.ITaskSpec|null} [taskSpec] TaskGroup taskSpec + * @property {number|Long|null} [taskCount] TaskGroup taskCount + * @property {number|Long|null} [parallelism] TaskGroup parallelism + * @property {google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy|null} [schedulingPolicy] TaskGroup schedulingPolicy + * @property {google.cloud.batch.v1alpha.IAllocationPolicy|null} [allocationPolicy] TaskGroup allocationPolicy + * @property {Object.|null} [labels] TaskGroup labels + * @property {Array.|null} [taskEnvironments] TaskGroup taskEnvironments + * @property {number|Long|null} [taskCountPerNode] TaskGroup taskCountPerNode + * @property {boolean|null} [requireHostsFile] TaskGroup requireHostsFile + * @property {boolean|null} [permissiveSsh] TaskGroup permissiveSsh + * @property {boolean|null} [runAsNonRoot] TaskGroup runAsNonRoot + * @property {google.cloud.batch.v1alpha.IServiceAccount|null} [serviceAccount] TaskGroup serviceAccount + */ + + /** + * Constructs a new TaskGroup. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a TaskGroup. + * @implements ITaskGroup + * @constructor + * @param {google.cloud.batch.v1alpha.ITaskGroup=} [properties] Properties to set + */ + function TaskGroup(properties) { + this.labels = {}; + this.taskEnvironments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TaskGroup name. + * @member {string} name + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @instance + */ + TaskGroup.prototype.name = ""; + + /** + * TaskGroup taskSpec. + * @member {google.cloud.batch.v1alpha.ITaskSpec|null|undefined} taskSpec + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @instance + */ + TaskGroup.prototype.taskSpec = null; + + /** + * TaskGroup taskCount. + * @member {number|Long} taskCount + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @instance + */ + TaskGroup.prototype.taskCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TaskGroup parallelism. + * @member {number|Long} parallelism + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @instance + */ + TaskGroup.prototype.parallelism = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TaskGroup schedulingPolicy. + * @member {google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy} schedulingPolicy + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @instance + */ + TaskGroup.prototype.schedulingPolicy = 0; + + /** + * TaskGroup allocationPolicy. + * @member {google.cloud.batch.v1alpha.IAllocationPolicy|null|undefined} allocationPolicy + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @instance + */ + TaskGroup.prototype.allocationPolicy = null; + + /** + * TaskGroup labels. + * @member {Object.} labels + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @instance + */ + TaskGroup.prototype.labels = $util.emptyObject; + + /** + * TaskGroup taskEnvironments. + * @member {Array.} taskEnvironments + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @instance + */ + TaskGroup.prototype.taskEnvironments = $util.emptyArray; + + /** + * TaskGroup taskCountPerNode. + * @member {number|Long} taskCountPerNode + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @instance + */ + TaskGroup.prototype.taskCountPerNode = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TaskGroup requireHostsFile. + * @member {boolean} requireHostsFile + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @instance + */ + TaskGroup.prototype.requireHostsFile = false; + + /** + * TaskGroup permissiveSsh. + * @member {boolean} permissiveSsh + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @instance + */ + TaskGroup.prototype.permissiveSsh = false; + + /** + * TaskGroup runAsNonRoot. + * @member {boolean} runAsNonRoot + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @instance + */ + TaskGroup.prototype.runAsNonRoot = false; + + /** + * TaskGroup serviceAccount. + * @member {google.cloud.batch.v1alpha.IServiceAccount|null|undefined} serviceAccount + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @instance + */ + TaskGroup.prototype.serviceAccount = null; + + /** + * Creates a new TaskGroup instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @static + * @param {google.cloud.batch.v1alpha.ITaskGroup=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.TaskGroup} TaskGroup instance + */ + TaskGroup.create = function create(properties) { + return new TaskGroup(properties); + }; + + /** + * Encodes the specified TaskGroup message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskGroup.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @static + * @param {google.cloud.batch.v1alpha.ITaskGroup} message TaskGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskGroup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.taskSpec != null && Object.hasOwnProperty.call(message, "taskSpec")) + $root.google.cloud.batch.v1alpha.TaskSpec.encode(message.taskSpec, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.taskCount != null && Object.hasOwnProperty.call(message, "taskCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.taskCount); + if (message.parallelism != null && Object.hasOwnProperty.call(message, "parallelism")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.parallelism); + if (message.schedulingPolicy != null && Object.hasOwnProperty.call(message, "schedulingPolicy")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.schedulingPolicy); + if (message.allocationPolicy != null && Object.hasOwnProperty.call(message, "allocationPolicy")) + $root.google.cloud.batch.v1alpha.AllocationPolicy.encode(message.allocationPolicy, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.taskEnvironments != null && message.taskEnvironments.length) + for (var i = 0; i < message.taskEnvironments.length; ++i) + $root.google.cloud.batch.v1alpha.Environment.encode(message.taskEnvironments[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.taskCountPerNode != null && Object.hasOwnProperty.call(message, "taskCountPerNode")) + writer.uint32(/* id 10, wireType 0 =*/80).int64(message.taskCountPerNode); + if (message.requireHostsFile != null && Object.hasOwnProperty.call(message, "requireHostsFile")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.requireHostsFile); + if (message.permissiveSsh != null && Object.hasOwnProperty.call(message, "permissiveSsh")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.permissiveSsh); + if (message.runAsNonRoot != null && Object.hasOwnProperty.call(message, "runAsNonRoot")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.runAsNonRoot); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + $root.google.cloud.batch.v1alpha.ServiceAccount.encode(message.serviceAccount, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TaskGroup message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @static + * @param {google.cloud.batch.v1alpha.ITaskGroup} message TaskGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TaskGroup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.TaskGroup} TaskGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskGroup.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.TaskGroup(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.taskSpec = $root.google.cloud.batch.v1alpha.TaskSpec.decode(reader, reader.uint32()); + break; + } + case 4: { + message.taskCount = reader.int64(); + break; + } + case 5: { + message.parallelism = reader.int64(); + break; + } + case 6: { + message.schedulingPolicy = reader.int32(); + break; + } + case 7: { + message.allocationPolicy = $root.google.cloud.batch.v1alpha.AllocationPolicy.decode(reader, reader.uint32()); + break; + } + case 8: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 9: { + if (!(message.taskEnvironments && message.taskEnvironments.length)) + message.taskEnvironments = []; + message.taskEnvironments.push($root.google.cloud.batch.v1alpha.Environment.decode(reader, reader.uint32())); + break; + } + case 10: { + message.taskCountPerNode = reader.int64(); + break; + } + case 11: { + message.requireHostsFile = reader.bool(); + break; + } + case 12: { + message.permissiveSsh = reader.bool(); + break; + } + case 14: { + message.runAsNonRoot = reader.bool(); + break; + } + case 15: { + message.serviceAccount = $root.google.cloud.batch.v1alpha.ServiceAccount.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TaskGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.TaskGroup} TaskGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TaskGroup message. + * @function verify + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TaskGroup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.taskSpec != null && message.hasOwnProperty("taskSpec")) { + var error = $root.google.cloud.batch.v1alpha.TaskSpec.verify(message.taskSpec); + if (error) + return "taskSpec." + error; + } + if (message.taskCount != null && message.hasOwnProperty("taskCount")) + if (!$util.isInteger(message.taskCount) && !(message.taskCount && $util.isInteger(message.taskCount.low) && $util.isInteger(message.taskCount.high))) + return "taskCount: integer|Long expected"; + if (message.parallelism != null && message.hasOwnProperty("parallelism")) + if (!$util.isInteger(message.parallelism) && !(message.parallelism && $util.isInteger(message.parallelism.low) && $util.isInteger(message.parallelism.high))) + return "parallelism: integer|Long expected"; + if (message.schedulingPolicy != null && message.hasOwnProperty("schedulingPolicy")) + switch (message.schedulingPolicy) { + default: + return "schedulingPolicy: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.allocationPolicy != null && message.hasOwnProperty("allocationPolicy")) { + var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.verify(message.allocationPolicy); + if (error) + return "allocationPolicy." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.taskEnvironments != null && message.hasOwnProperty("taskEnvironments")) { + if (!Array.isArray(message.taskEnvironments)) + return "taskEnvironments: array expected"; + for (var i = 0; i < message.taskEnvironments.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.Environment.verify(message.taskEnvironments[i]); + if (error) + return "taskEnvironments." + error; + } + } + if (message.taskCountPerNode != null && message.hasOwnProperty("taskCountPerNode")) + if (!$util.isInteger(message.taskCountPerNode) && !(message.taskCountPerNode && $util.isInteger(message.taskCountPerNode.low) && $util.isInteger(message.taskCountPerNode.high))) + return "taskCountPerNode: integer|Long expected"; + if (message.requireHostsFile != null && message.hasOwnProperty("requireHostsFile")) + if (typeof message.requireHostsFile !== "boolean") + return "requireHostsFile: boolean expected"; + if (message.permissiveSsh != null && message.hasOwnProperty("permissiveSsh")) + if (typeof message.permissiveSsh !== "boolean") + return "permissiveSsh: boolean expected"; + if (message.runAsNonRoot != null && message.hasOwnProperty("runAsNonRoot")) + if (typeof message.runAsNonRoot !== "boolean") + return "runAsNonRoot: boolean expected"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) { + var error = $root.google.cloud.batch.v1alpha.ServiceAccount.verify(message.serviceAccount); + if (error) + return "serviceAccount." + error; + } + return null; + }; + + /** + * Creates a TaskGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.TaskGroup} TaskGroup + */ + TaskGroup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.TaskGroup) + return object; + var message = new $root.google.cloud.batch.v1alpha.TaskGroup(); + if (object.name != null) + message.name = String(object.name); + if (object.taskSpec != null) { + if (typeof object.taskSpec !== "object") + throw TypeError(".google.cloud.batch.v1alpha.TaskGroup.taskSpec: object expected"); + message.taskSpec = $root.google.cloud.batch.v1alpha.TaskSpec.fromObject(object.taskSpec); + } + if (object.taskCount != null) + if ($util.Long) + (message.taskCount = $util.Long.fromValue(object.taskCount)).unsigned = false; + else if (typeof object.taskCount === "string") + message.taskCount = parseInt(object.taskCount, 10); + else if (typeof object.taskCount === "number") + message.taskCount = object.taskCount; + else if (typeof object.taskCount === "object") + message.taskCount = new $util.LongBits(object.taskCount.low >>> 0, object.taskCount.high >>> 0).toNumber(); + if (object.parallelism != null) + if ($util.Long) + (message.parallelism = $util.Long.fromValue(object.parallelism)).unsigned = false; + else if (typeof object.parallelism === "string") + message.parallelism = parseInt(object.parallelism, 10); + else if (typeof object.parallelism === "number") + message.parallelism = object.parallelism; + else if (typeof object.parallelism === "object") + message.parallelism = new $util.LongBits(object.parallelism.low >>> 0, object.parallelism.high >>> 0).toNumber(); + switch (object.schedulingPolicy) { + default: + if (typeof object.schedulingPolicy === "number") { + message.schedulingPolicy = object.schedulingPolicy; + break; + } + break; + case "SCHEDULING_POLICY_UNSPECIFIED": + case 0: + message.schedulingPolicy = 0; + break; + case "AS_SOON_AS_POSSIBLE": + case 1: + message.schedulingPolicy = 1; + break; + case "IN_ORDER": + case 2: + message.schedulingPolicy = 2; + break; + } + if (object.allocationPolicy != null) { + if (typeof object.allocationPolicy !== "object") + throw TypeError(".google.cloud.batch.v1alpha.TaskGroup.allocationPolicy: object expected"); + message.allocationPolicy = $root.google.cloud.batch.v1alpha.AllocationPolicy.fromObject(object.allocationPolicy); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.batch.v1alpha.TaskGroup.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.taskEnvironments) { + if (!Array.isArray(object.taskEnvironments)) + throw TypeError(".google.cloud.batch.v1alpha.TaskGroup.taskEnvironments: array expected"); + message.taskEnvironments = []; + for (var i = 0; i < object.taskEnvironments.length; ++i) { + if (typeof object.taskEnvironments[i] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.TaskGroup.taskEnvironments: object expected"); + message.taskEnvironments[i] = $root.google.cloud.batch.v1alpha.Environment.fromObject(object.taskEnvironments[i]); + } + } + if (object.taskCountPerNode != null) + if ($util.Long) + (message.taskCountPerNode = $util.Long.fromValue(object.taskCountPerNode)).unsigned = false; + else if (typeof object.taskCountPerNode === "string") + message.taskCountPerNode = parseInt(object.taskCountPerNode, 10); + else if (typeof object.taskCountPerNode === "number") + message.taskCountPerNode = object.taskCountPerNode; + else if (typeof object.taskCountPerNode === "object") + message.taskCountPerNode = new $util.LongBits(object.taskCountPerNode.low >>> 0, object.taskCountPerNode.high >>> 0).toNumber(); + if (object.requireHostsFile != null) + message.requireHostsFile = Boolean(object.requireHostsFile); + if (object.permissiveSsh != null) + message.permissiveSsh = Boolean(object.permissiveSsh); + if (object.runAsNonRoot != null) + message.runAsNonRoot = Boolean(object.runAsNonRoot); + if (object.serviceAccount != null) { + if (typeof object.serviceAccount !== "object") + throw TypeError(".google.cloud.batch.v1alpha.TaskGroup.serviceAccount: object expected"); + message.serviceAccount = $root.google.cloud.batch.v1alpha.ServiceAccount.fromObject(object.serviceAccount); + } + return message; + }; + + /** + * Creates a plain object from a TaskGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @static + * @param {google.cloud.batch.v1alpha.TaskGroup} message TaskGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TaskGroup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.taskEnvironments = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.taskSpec = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.taskCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.taskCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.parallelism = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.parallelism = options.longs === String ? "0" : 0; + object.schedulingPolicy = options.enums === String ? "SCHEDULING_POLICY_UNSPECIFIED" : 0; + object.allocationPolicy = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.taskCountPerNode = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.taskCountPerNode = options.longs === String ? "0" : 0; + object.requireHostsFile = false; + object.permissiveSsh = false; + object.runAsNonRoot = false; + object.serviceAccount = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.taskSpec != null && message.hasOwnProperty("taskSpec")) + object.taskSpec = $root.google.cloud.batch.v1alpha.TaskSpec.toObject(message.taskSpec, options); + if (message.taskCount != null && message.hasOwnProperty("taskCount")) + if (typeof message.taskCount === "number") + object.taskCount = options.longs === String ? String(message.taskCount) : message.taskCount; + else + object.taskCount = options.longs === String ? $util.Long.prototype.toString.call(message.taskCount) : options.longs === Number ? new $util.LongBits(message.taskCount.low >>> 0, message.taskCount.high >>> 0).toNumber() : message.taskCount; + if (message.parallelism != null && message.hasOwnProperty("parallelism")) + if (typeof message.parallelism === "number") + object.parallelism = options.longs === String ? String(message.parallelism) : message.parallelism; + else + object.parallelism = options.longs === String ? $util.Long.prototype.toString.call(message.parallelism) : options.longs === Number ? new $util.LongBits(message.parallelism.low >>> 0, message.parallelism.high >>> 0).toNumber() : message.parallelism; + if (message.schedulingPolicy != null && message.hasOwnProperty("schedulingPolicy")) + object.schedulingPolicy = options.enums === String ? $root.google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy[message.schedulingPolicy] === undefined ? message.schedulingPolicy : $root.google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy[message.schedulingPolicy] : message.schedulingPolicy; + if (message.allocationPolicy != null && message.hasOwnProperty("allocationPolicy")) + object.allocationPolicy = $root.google.cloud.batch.v1alpha.AllocationPolicy.toObject(message.allocationPolicy, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.taskEnvironments && message.taskEnvironments.length) { + object.taskEnvironments = []; + for (var j = 0; j < message.taskEnvironments.length; ++j) + object.taskEnvironments[j] = $root.google.cloud.batch.v1alpha.Environment.toObject(message.taskEnvironments[j], options); + } + if (message.taskCountPerNode != null && message.hasOwnProperty("taskCountPerNode")) + if (typeof message.taskCountPerNode === "number") + object.taskCountPerNode = options.longs === String ? String(message.taskCountPerNode) : message.taskCountPerNode; + else + object.taskCountPerNode = options.longs === String ? $util.Long.prototype.toString.call(message.taskCountPerNode) : options.longs === Number ? new $util.LongBits(message.taskCountPerNode.low >>> 0, message.taskCountPerNode.high >>> 0).toNumber() : message.taskCountPerNode; + if (message.requireHostsFile != null && message.hasOwnProperty("requireHostsFile")) + object.requireHostsFile = message.requireHostsFile; + if (message.permissiveSsh != null && message.hasOwnProperty("permissiveSsh")) + object.permissiveSsh = message.permissiveSsh; + if (message.runAsNonRoot != null && message.hasOwnProperty("runAsNonRoot")) + object.runAsNonRoot = message.runAsNonRoot; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = $root.google.cloud.batch.v1alpha.ServiceAccount.toObject(message.serviceAccount, options); + return object; + }; + + /** + * Converts this TaskGroup to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @instance + * @returns {Object.} JSON object + */ + TaskGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TaskGroup + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.TaskGroup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TaskGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.TaskGroup"; + }; + + /** + * SchedulingPolicy enum. + * @name google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy + * @enum {number} + * @property {number} SCHEDULING_POLICY_UNSPECIFIED=0 SCHEDULING_POLICY_UNSPECIFIED value + * @property {number} AS_SOON_AS_POSSIBLE=1 AS_SOON_AS_POSSIBLE value + * @property {number} IN_ORDER=2 IN_ORDER value + */ + TaskGroup.SchedulingPolicy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SCHEDULING_POLICY_UNSPECIFIED"] = 0; + values[valuesById[1] = "AS_SOON_AS_POSSIBLE"] = 1; + values[valuesById[2] = "IN_ORDER"] = 2; + return values; + })(); + + return TaskGroup; + })(); + + v1alpha.ServiceAccount = (function() { + + /** + * Properties of a ServiceAccount. + * @memberof google.cloud.batch.v1alpha + * @interface IServiceAccount + * @property {string|null} [email] ServiceAccount email + * @property {Array.|null} [scopes] ServiceAccount scopes + */ + + /** + * Constructs a new ServiceAccount. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a ServiceAccount. + * @implements IServiceAccount + * @constructor + * @param {google.cloud.batch.v1alpha.IServiceAccount=} [properties] Properties to set + */ + function ServiceAccount(properties) { + this.scopes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceAccount email. + * @member {string} email + * @memberof google.cloud.batch.v1alpha.ServiceAccount + * @instance + */ + ServiceAccount.prototype.email = ""; + + /** + * ServiceAccount scopes. + * @member {Array.} scopes + * @memberof google.cloud.batch.v1alpha.ServiceAccount + * @instance + */ + ServiceAccount.prototype.scopes = $util.emptyArray; + + /** + * Creates a new ServiceAccount instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.ServiceAccount + * @static + * @param {google.cloud.batch.v1alpha.IServiceAccount=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.ServiceAccount} ServiceAccount instance + */ + ServiceAccount.create = function create(properties) { + return new ServiceAccount(properties); + }; + + /** + * Encodes the specified ServiceAccount message. Does not implicitly {@link google.cloud.batch.v1alpha.ServiceAccount.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.ServiceAccount + * @static + * @param {google.cloud.batch.v1alpha.IServiceAccount} message ServiceAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAccount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.email != null && Object.hasOwnProperty.call(message, "email")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.email); + if (message.scopes != null && message.scopes.length) + for (var i = 0; i < message.scopes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.scopes[i]); + return writer; + }; + + /** + * Encodes the specified ServiceAccount message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ServiceAccount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.ServiceAccount + * @static + * @param {google.cloud.batch.v1alpha.IServiceAccount} message ServiceAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAccount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceAccount message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.ServiceAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.ServiceAccount} ServiceAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAccount.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ServiceAccount(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.email = reader.string(); + break; + } + case 2: { + if (!(message.scopes && message.scopes.length)) + message.scopes = []; + message.scopes.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceAccount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.ServiceAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.ServiceAccount} ServiceAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAccount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceAccount message. + * @function verify + * @memberof google.cloud.batch.v1alpha.ServiceAccount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceAccount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.email != null && message.hasOwnProperty("email")) + if (!$util.isString(message.email)) + return "email: string expected"; + if (message.scopes != null && message.hasOwnProperty("scopes")) { + if (!Array.isArray(message.scopes)) + return "scopes: array expected"; + for (var i = 0; i < message.scopes.length; ++i) + if (!$util.isString(message.scopes[i])) + return "scopes: string[] expected"; + } + return null; + }; + + /** + * Creates a ServiceAccount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.ServiceAccount + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.ServiceAccount} ServiceAccount + */ + ServiceAccount.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.ServiceAccount) + return object; + var message = new $root.google.cloud.batch.v1alpha.ServiceAccount(); + if (object.email != null) + message.email = String(object.email); + if (object.scopes) { + if (!Array.isArray(object.scopes)) + throw TypeError(".google.cloud.batch.v1alpha.ServiceAccount.scopes: array expected"); + message.scopes = []; + for (var i = 0; i < object.scopes.length; ++i) + message.scopes[i] = String(object.scopes[i]); + } + return message; + }; + + /** + * Creates a plain object from a ServiceAccount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.ServiceAccount + * @static + * @param {google.cloud.batch.v1alpha.ServiceAccount} message ServiceAccount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceAccount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.scopes = []; + if (options.defaults) + object.email = ""; + if (message.email != null && message.hasOwnProperty("email")) + object.email = message.email; + if (message.scopes && message.scopes.length) { + object.scopes = []; + for (var j = 0; j < message.scopes.length; ++j) + object.scopes[j] = message.scopes[j]; + } + return object; + }; + + /** + * Converts this ServiceAccount to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.ServiceAccount + * @instance + * @returns {Object.} JSON object + */ + ServiceAccount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceAccount + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.ServiceAccount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceAccount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.ServiceAccount"; + }; + + return ServiceAccount; + })(); + + v1alpha.ComputeResource = (function() { + + /** + * Properties of a ComputeResource. + * @memberof google.cloud.batch.v1alpha + * @interface IComputeResource + * @property {number|Long|null} [cpuMilli] ComputeResource cpuMilli + * @property {number|Long|null} [memoryMib] ComputeResource memoryMib + * @property {number|Long|null} [gpuCount] ComputeResource gpuCount + * @property {number|Long|null} [bootDiskMib] ComputeResource bootDiskMib + */ + + /** + * Constructs a new ComputeResource. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a ComputeResource. + * @implements IComputeResource + * @constructor + * @param {google.cloud.batch.v1alpha.IComputeResource=} [properties] Properties to set + */ + function ComputeResource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ComputeResource cpuMilli. + * @member {number|Long} cpuMilli + * @memberof google.cloud.batch.v1alpha.ComputeResource + * @instance + */ + ComputeResource.prototype.cpuMilli = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ComputeResource memoryMib. + * @member {number|Long} memoryMib + * @memberof google.cloud.batch.v1alpha.ComputeResource + * @instance + */ + ComputeResource.prototype.memoryMib = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ComputeResource gpuCount. + * @member {number|Long} gpuCount + * @memberof google.cloud.batch.v1alpha.ComputeResource + * @instance + */ + ComputeResource.prototype.gpuCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ComputeResource bootDiskMib. + * @member {number|Long} bootDiskMib + * @memberof google.cloud.batch.v1alpha.ComputeResource + * @instance + */ + ComputeResource.prototype.bootDiskMib = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ComputeResource instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.ComputeResource + * @static + * @param {google.cloud.batch.v1alpha.IComputeResource=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.ComputeResource} ComputeResource instance + */ + ComputeResource.create = function create(properties) { + return new ComputeResource(properties); + }; + + /** + * Encodes the specified ComputeResource message. Does not implicitly {@link google.cloud.batch.v1alpha.ComputeResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.ComputeResource + * @static + * @param {google.cloud.batch.v1alpha.IComputeResource} message ComputeResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cpuMilli != null && Object.hasOwnProperty.call(message, "cpuMilli")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.cpuMilli); + if (message.memoryMib != null && Object.hasOwnProperty.call(message, "memoryMib")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.memoryMib); + if (message.gpuCount != null && Object.hasOwnProperty.call(message, "gpuCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.gpuCount); + if (message.bootDiskMib != null && Object.hasOwnProperty.call(message, "bootDiskMib")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.bootDiskMib); + return writer; + }; + + /** + * Encodes the specified ComputeResource message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ComputeResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.ComputeResource + * @static + * @param {google.cloud.batch.v1alpha.IComputeResource} message ComputeResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ComputeResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.ComputeResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.ComputeResource} ComputeResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeResource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ComputeResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cpuMilli = reader.int64(); + break; + } + case 2: { + message.memoryMib = reader.int64(); + break; + } + case 3: { + message.gpuCount = reader.int64(); + break; + } + case 4: { + message.bootDiskMib = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ComputeResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.ComputeResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.ComputeResource} ComputeResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ComputeResource message. + * @function verify + * @memberof google.cloud.batch.v1alpha.ComputeResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ComputeResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cpuMilli != null && message.hasOwnProperty("cpuMilli")) + if (!$util.isInteger(message.cpuMilli) && !(message.cpuMilli && $util.isInteger(message.cpuMilli.low) && $util.isInteger(message.cpuMilli.high))) + return "cpuMilli: integer|Long expected"; + if (message.memoryMib != null && message.hasOwnProperty("memoryMib")) + if (!$util.isInteger(message.memoryMib) && !(message.memoryMib && $util.isInteger(message.memoryMib.low) && $util.isInteger(message.memoryMib.high))) + return "memoryMib: integer|Long expected"; + if (message.gpuCount != null && message.hasOwnProperty("gpuCount")) + if (!$util.isInteger(message.gpuCount) && !(message.gpuCount && $util.isInteger(message.gpuCount.low) && $util.isInteger(message.gpuCount.high))) + return "gpuCount: integer|Long expected"; + if (message.bootDiskMib != null && message.hasOwnProperty("bootDiskMib")) + if (!$util.isInteger(message.bootDiskMib) && !(message.bootDiskMib && $util.isInteger(message.bootDiskMib.low) && $util.isInteger(message.bootDiskMib.high))) + return "bootDiskMib: integer|Long expected"; + return null; + }; + + /** + * Creates a ComputeResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.ComputeResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.ComputeResource} ComputeResource + */ + ComputeResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.ComputeResource) + return object; + var message = new $root.google.cloud.batch.v1alpha.ComputeResource(); + if (object.cpuMilli != null) + if ($util.Long) + (message.cpuMilli = $util.Long.fromValue(object.cpuMilli)).unsigned = false; + else if (typeof object.cpuMilli === "string") + message.cpuMilli = parseInt(object.cpuMilli, 10); + else if (typeof object.cpuMilli === "number") + message.cpuMilli = object.cpuMilli; + else if (typeof object.cpuMilli === "object") + message.cpuMilli = new $util.LongBits(object.cpuMilli.low >>> 0, object.cpuMilli.high >>> 0).toNumber(); + if (object.memoryMib != null) + if ($util.Long) + (message.memoryMib = $util.Long.fromValue(object.memoryMib)).unsigned = false; + else if (typeof object.memoryMib === "string") + message.memoryMib = parseInt(object.memoryMib, 10); + else if (typeof object.memoryMib === "number") + message.memoryMib = object.memoryMib; + else if (typeof object.memoryMib === "object") + message.memoryMib = new $util.LongBits(object.memoryMib.low >>> 0, object.memoryMib.high >>> 0).toNumber(); + if (object.gpuCount != null) + if ($util.Long) + (message.gpuCount = $util.Long.fromValue(object.gpuCount)).unsigned = false; + else if (typeof object.gpuCount === "string") + message.gpuCount = parseInt(object.gpuCount, 10); + else if (typeof object.gpuCount === "number") + message.gpuCount = object.gpuCount; + else if (typeof object.gpuCount === "object") + message.gpuCount = new $util.LongBits(object.gpuCount.low >>> 0, object.gpuCount.high >>> 0).toNumber(); + if (object.bootDiskMib != null) + if ($util.Long) + (message.bootDiskMib = $util.Long.fromValue(object.bootDiskMib)).unsigned = false; + else if (typeof object.bootDiskMib === "string") + message.bootDiskMib = parseInt(object.bootDiskMib, 10); + else if (typeof object.bootDiskMib === "number") + message.bootDiskMib = object.bootDiskMib; + else if (typeof object.bootDiskMib === "object") + message.bootDiskMib = new $util.LongBits(object.bootDiskMib.low >>> 0, object.bootDiskMib.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ComputeResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.ComputeResource + * @static + * @param {google.cloud.batch.v1alpha.ComputeResource} message ComputeResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ComputeResource.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.cpuMilli = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.cpuMilli = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.memoryMib = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.memoryMib = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.gpuCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.gpuCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bootDiskMib = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bootDiskMib = options.longs === String ? "0" : 0; + } + if (message.cpuMilli != null && message.hasOwnProperty("cpuMilli")) + if (typeof message.cpuMilli === "number") + object.cpuMilli = options.longs === String ? String(message.cpuMilli) : message.cpuMilli; + else + object.cpuMilli = options.longs === String ? $util.Long.prototype.toString.call(message.cpuMilli) : options.longs === Number ? new $util.LongBits(message.cpuMilli.low >>> 0, message.cpuMilli.high >>> 0).toNumber() : message.cpuMilli; + if (message.memoryMib != null && message.hasOwnProperty("memoryMib")) + if (typeof message.memoryMib === "number") + object.memoryMib = options.longs === String ? String(message.memoryMib) : message.memoryMib; + else + object.memoryMib = options.longs === String ? $util.Long.prototype.toString.call(message.memoryMib) : options.longs === Number ? new $util.LongBits(message.memoryMib.low >>> 0, message.memoryMib.high >>> 0).toNumber() : message.memoryMib; + if (message.gpuCount != null && message.hasOwnProperty("gpuCount")) + if (typeof message.gpuCount === "number") + object.gpuCount = options.longs === String ? String(message.gpuCount) : message.gpuCount; + else + object.gpuCount = options.longs === String ? $util.Long.prototype.toString.call(message.gpuCount) : options.longs === Number ? new $util.LongBits(message.gpuCount.low >>> 0, message.gpuCount.high >>> 0).toNumber() : message.gpuCount; + if (message.bootDiskMib != null && message.hasOwnProperty("bootDiskMib")) + if (typeof message.bootDiskMib === "number") + object.bootDiskMib = options.longs === String ? String(message.bootDiskMib) : message.bootDiskMib; + else + object.bootDiskMib = options.longs === String ? $util.Long.prototype.toString.call(message.bootDiskMib) : options.longs === Number ? new $util.LongBits(message.bootDiskMib.low >>> 0, message.bootDiskMib.high >>> 0).toNumber() : message.bootDiskMib; + return object; + }; + + /** + * Converts this ComputeResource to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.ComputeResource + * @instance + * @returns {Object.} JSON object + */ + ComputeResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ComputeResource + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.ComputeResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ComputeResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.ComputeResource"; + }; + + return ComputeResource; + })(); + + v1alpha.StatusEvent = (function() { + + /** + * Properties of a StatusEvent. + * @memberof google.cloud.batch.v1alpha + * @interface IStatusEvent + * @property {string|null} [type] StatusEvent type + * @property {string|null} [description] StatusEvent description + * @property {google.protobuf.ITimestamp|null} [eventTime] StatusEvent eventTime + * @property {google.cloud.batch.v1alpha.ITaskExecution|null} [taskExecution] StatusEvent taskExecution + * @property {google.cloud.batch.v1alpha.TaskStatus.State|null} [taskState] StatusEvent taskState + */ + + /** + * Constructs a new StatusEvent. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a StatusEvent. + * @implements IStatusEvent + * @constructor + * @param {google.cloud.batch.v1alpha.IStatusEvent=} [properties] Properties to set + */ + function StatusEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StatusEvent type. + * @member {string} type + * @memberof google.cloud.batch.v1alpha.StatusEvent + * @instance + */ + StatusEvent.prototype.type = ""; + + /** + * StatusEvent description. + * @member {string} description + * @memberof google.cloud.batch.v1alpha.StatusEvent + * @instance + */ + StatusEvent.prototype.description = ""; + + /** + * StatusEvent eventTime. + * @member {google.protobuf.ITimestamp|null|undefined} eventTime + * @memberof google.cloud.batch.v1alpha.StatusEvent + * @instance + */ + StatusEvent.prototype.eventTime = null; + + /** + * StatusEvent taskExecution. + * @member {google.cloud.batch.v1alpha.ITaskExecution|null|undefined} taskExecution + * @memberof google.cloud.batch.v1alpha.StatusEvent + * @instance + */ + StatusEvent.prototype.taskExecution = null; + + /** + * StatusEvent taskState. + * @member {google.cloud.batch.v1alpha.TaskStatus.State} taskState + * @memberof google.cloud.batch.v1alpha.StatusEvent + * @instance + */ + StatusEvent.prototype.taskState = 0; + + /** + * Creates a new StatusEvent instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.StatusEvent + * @static + * @param {google.cloud.batch.v1alpha.IStatusEvent=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.StatusEvent} StatusEvent instance + */ + StatusEvent.create = function create(properties) { + return new StatusEvent(properties); + }; + + /** + * Encodes the specified StatusEvent message. Does not implicitly {@link google.cloud.batch.v1alpha.StatusEvent.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.StatusEvent + * @static + * @param {google.cloud.batch.v1alpha.IStatusEvent} message StatusEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StatusEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); + if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) + $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.taskExecution != null && Object.hasOwnProperty.call(message, "taskExecution")) + $root.google.cloud.batch.v1alpha.TaskExecution.encode(message.taskExecution, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.taskState != null && Object.hasOwnProperty.call(message, "taskState")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.taskState); + return writer; + }; + + /** + * Encodes the specified StatusEvent message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.StatusEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.StatusEvent + * @static + * @param {google.cloud.batch.v1alpha.IStatusEvent} message StatusEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StatusEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StatusEvent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.StatusEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.StatusEvent} StatusEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StatusEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.StatusEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.type = reader.string(); + break; + } + case 1: { + message.description = reader.string(); + break; + } + case 2: { + message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.taskExecution = $root.google.cloud.batch.v1alpha.TaskExecution.decode(reader, reader.uint32()); + break; + } + case 5: { + message.taskState = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StatusEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.StatusEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.StatusEvent} StatusEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StatusEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StatusEvent message. + * @function verify + * @memberof google.cloud.batch.v1alpha.StatusEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StatusEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.eventTime != null && message.hasOwnProperty("eventTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.eventTime); + if (error) + return "eventTime." + error; + } + if (message.taskExecution != null && message.hasOwnProperty("taskExecution")) { + var error = $root.google.cloud.batch.v1alpha.TaskExecution.verify(message.taskExecution); + if (error) + return "taskExecution." + error; + } + if (message.taskState != null && message.hasOwnProperty("taskState")) + switch (message.taskState) { + default: + return "taskState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + return null; + }; + + /** + * Creates a StatusEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.StatusEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.StatusEvent} StatusEvent + */ + StatusEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.StatusEvent) + return object; + var message = new $root.google.cloud.batch.v1alpha.StatusEvent(); + if (object.type != null) + message.type = String(object.type); + if (object.description != null) + message.description = String(object.description); + if (object.eventTime != null) { + if (typeof object.eventTime !== "object") + throw TypeError(".google.cloud.batch.v1alpha.StatusEvent.eventTime: object expected"); + message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); + } + if (object.taskExecution != null) { + if (typeof object.taskExecution !== "object") + throw TypeError(".google.cloud.batch.v1alpha.StatusEvent.taskExecution: object expected"); + message.taskExecution = $root.google.cloud.batch.v1alpha.TaskExecution.fromObject(object.taskExecution); + } + switch (object.taskState) { + default: + if (typeof object.taskState === "number") { + message.taskState = object.taskState; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.taskState = 0; + break; + case "PENDING": + case 1: + message.taskState = 1; + break; + case "ASSIGNED": + case 2: + message.taskState = 2; + break; + case "RUNNING": + case 3: + message.taskState = 3; + break; + case "FAILED": + case 4: + message.taskState = 4; + break; + case "SUCCEEDED": + case 5: + message.taskState = 5; + break; + case "UNEXECUTED": + case 6: + message.taskState = 6; + break; + } + return message; + }; + + /** + * Creates a plain object from a StatusEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.StatusEvent + * @static + * @param {google.cloud.batch.v1alpha.StatusEvent} message StatusEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StatusEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.description = ""; + object.eventTime = null; + object.type = ""; + object.taskExecution = null; + object.taskState = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.eventTime != null && message.hasOwnProperty("eventTime")) + object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.taskExecution != null && message.hasOwnProperty("taskExecution")) + object.taskExecution = $root.google.cloud.batch.v1alpha.TaskExecution.toObject(message.taskExecution, options); + if (message.taskState != null && message.hasOwnProperty("taskState")) + object.taskState = options.enums === String ? $root.google.cloud.batch.v1alpha.TaskStatus.State[message.taskState] === undefined ? message.taskState : $root.google.cloud.batch.v1alpha.TaskStatus.State[message.taskState] : message.taskState; + return object; + }; + + /** + * Converts this StatusEvent to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.StatusEvent + * @instance + * @returns {Object.} JSON object + */ + StatusEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StatusEvent + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.StatusEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StatusEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.StatusEvent"; + }; + + return StatusEvent; + })(); + + v1alpha.TaskExecution = (function() { + + /** + * Properties of a TaskExecution. + * @memberof google.cloud.batch.v1alpha + * @interface ITaskExecution + * @property {number|null} [exitCode] TaskExecution exitCode + * @property {string|null} [stderrSnippet] TaskExecution stderrSnippet + */ + + /** + * Constructs a new TaskExecution. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a TaskExecution. + * @implements ITaskExecution + * @constructor + * @param {google.cloud.batch.v1alpha.ITaskExecution=} [properties] Properties to set + */ + function TaskExecution(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TaskExecution exitCode. + * @member {number} exitCode + * @memberof google.cloud.batch.v1alpha.TaskExecution + * @instance + */ + TaskExecution.prototype.exitCode = 0; + + /** + * TaskExecution stderrSnippet. + * @member {string} stderrSnippet + * @memberof google.cloud.batch.v1alpha.TaskExecution + * @instance + */ + TaskExecution.prototype.stderrSnippet = ""; + + /** + * Creates a new TaskExecution instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.TaskExecution + * @static + * @param {google.cloud.batch.v1alpha.ITaskExecution=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.TaskExecution} TaskExecution instance + */ + TaskExecution.create = function create(properties) { + return new TaskExecution(properties); + }; + + /** + * Encodes the specified TaskExecution message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskExecution.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.TaskExecution + * @static + * @param {google.cloud.batch.v1alpha.ITaskExecution} message TaskExecution message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskExecution.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.exitCode != null && Object.hasOwnProperty.call(message, "exitCode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.exitCode); + if (message.stderrSnippet != null && Object.hasOwnProperty.call(message, "stderrSnippet")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.stderrSnippet); + return writer; + }; + + /** + * Encodes the specified TaskExecution message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskExecution.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.TaskExecution + * @static + * @param {google.cloud.batch.v1alpha.ITaskExecution} message TaskExecution message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskExecution.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TaskExecution message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.TaskExecution + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.TaskExecution} TaskExecution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskExecution.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.TaskExecution(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.exitCode = reader.int32(); + break; + } + case 2: { + message.stderrSnippet = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TaskExecution message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.TaskExecution + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.TaskExecution} TaskExecution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskExecution.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TaskExecution message. + * @function verify + * @memberof google.cloud.batch.v1alpha.TaskExecution + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TaskExecution.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.exitCode != null && message.hasOwnProperty("exitCode")) + if (!$util.isInteger(message.exitCode)) + return "exitCode: integer expected"; + if (message.stderrSnippet != null && message.hasOwnProperty("stderrSnippet")) + if (!$util.isString(message.stderrSnippet)) + return "stderrSnippet: string expected"; + return null; + }; + + /** + * Creates a TaskExecution message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.TaskExecution + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.TaskExecution} TaskExecution + */ + TaskExecution.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.TaskExecution) + return object; + var message = new $root.google.cloud.batch.v1alpha.TaskExecution(); + if (object.exitCode != null) + message.exitCode = object.exitCode | 0; + if (object.stderrSnippet != null) + message.stderrSnippet = String(object.stderrSnippet); + return message; + }; + + /** + * Creates a plain object from a TaskExecution message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.TaskExecution + * @static + * @param {google.cloud.batch.v1alpha.TaskExecution} message TaskExecution + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TaskExecution.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.exitCode = 0; + object.stderrSnippet = ""; + } + if (message.exitCode != null && message.hasOwnProperty("exitCode")) + object.exitCode = message.exitCode; + if (message.stderrSnippet != null && message.hasOwnProperty("stderrSnippet")) + object.stderrSnippet = message.stderrSnippet; + return object; + }; + + /** + * Converts this TaskExecution to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.TaskExecution + * @instance + * @returns {Object.} JSON object + */ + TaskExecution.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TaskExecution + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.TaskExecution + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TaskExecution.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.TaskExecution"; + }; + + return TaskExecution; + })(); + + v1alpha.TaskStatus = (function() { + + /** + * Properties of a TaskStatus. + * @memberof google.cloud.batch.v1alpha + * @interface ITaskStatus + * @property {google.cloud.batch.v1alpha.TaskStatus.State|null} [state] TaskStatus state + * @property {Array.|null} [statusEvents] TaskStatus statusEvents + * @property {google.cloud.batch.v1alpha.ITaskResourceUsage|null} [resourceUsage] TaskStatus resourceUsage + */ + + /** + * Constructs a new TaskStatus. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a TaskStatus. + * @implements ITaskStatus + * @constructor + * @param {google.cloud.batch.v1alpha.ITaskStatus=} [properties] Properties to set + */ + function TaskStatus(properties) { + this.statusEvents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TaskStatus state. + * @member {google.cloud.batch.v1alpha.TaskStatus.State} state + * @memberof google.cloud.batch.v1alpha.TaskStatus + * @instance + */ + TaskStatus.prototype.state = 0; + + /** + * TaskStatus statusEvents. + * @member {Array.} statusEvents + * @memberof google.cloud.batch.v1alpha.TaskStatus + * @instance + */ + TaskStatus.prototype.statusEvents = $util.emptyArray; + + /** + * TaskStatus resourceUsage. + * @member {google.cloud.batch.v1alpha.ITaskResourceUsage|null|undefined} resourceUsage + * @memberof google.cloud.batch.v1alpha.TaskStatus + * @instance + */ + TaskStatus.prototype.resourceUsage = null; + + /** + * Creates a new TaskStatus instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.TaskStatus + * @static + * @param {google.cloud.batch.v1alpha.ITaskStatus=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.TaskStatus} TaskStatus instance + */ + TaskStatus.create = function create(properties) { + return new TaskStatus(properties); + }; + + /** + * Encodes the specified TaskStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.TaskStatus + * @static + * @param {google.cloud.batch.v1alpha.ITaskStatus} message TaskStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskStatus.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); + if (message.statusEvents != null && message.statusEvents.length) + for (var i = 0; i < message.statusEvents.length; ++i) + $root.google.cloud.batch.v1alpha.StatusEvent.encode(message.statusEvents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resourceUsage != null && Object.hasOwnProperty.call(message, "resourceUsage")) + $root.google.cloud.batch.v1alpha.TaskResourceUsage.encode(message.resourceUsage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TaskStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.TaskStatus + * @static + * @param {google.cloud.batch.v1alpha.ITaskStatus} message TaskStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TaskStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.TaskStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.TaskStatus} TaskStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.TaskStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + if (!(message.statusEvents && message.statusEvents.length)) + message.statusEvents = []; + message.statusEvents.push($root.google.cloud.batch.v1alpha.StatusEvent.decode(reader, reader.uint32())); + break; + } + case 3: { + message.resourceUsage = $root.google.cloud.batch.v1alpha.TaskResourceUsage.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TaskStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.TaskStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.TaskStatus} TaskStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TaskStatus message. + * @function verify + * @memberof google.cloud.batch.v1alpha.TaskStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TaskStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.statusEvents != null && message.hasOwnProperty("statusEvents")) { + if (!Array.isArray(message.statusEvents)) + return "statusEvents: array expected"; + for (var i = 0; i < message.statusEvents.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.StatusEvent.verify(message.statusEvents[i]); + if (error) + return "statusEvents." + error; + } + } + if (message.resourceUsage != null && message.hasOwnProperty("resourceUsage")) { + var error = $root.google.cloud.batch.v1alpha.TaskResourceUsage.verify(message.resourceUsage); + if (error) + return "resourceUsage." + error; + } + return null; + }; + + /** + * Creates a TaskStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.TaskStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.TaskStatus} TaskStatus + */ + TaskStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.TaskStatus) + return object; + var message = new $root.google.cloud.batch.v1alpha.TaskStatus(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING": + case 1: + message.state = 1; + break; + case "ASSIGNED": + case 2: + message.state = 2; + break; + case "RUNNING": + case 3: + message.state = 3; + break; + case "FAILED": + case 4: + message.state = 4; + break; + case "SUCCEEDED": + case 5: + message.state = 5; + break; + case "UNEXECUTED": + case 6: + message.state = 6; + break; + } + if (object.statusEvents) { + if (!Array.isArray(object.statusEvents)) + throw TypeError(".google.cloud.batch.v1alpha.TaskStatus.statusEvents: array expected"); + message.statusEvents = []; + for (var i = 0; i < object.statusEvents.length; ++i) { + if (typeof object.statusEvents[i] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.TaskStatus.statusEvents: object expected"); + message.statusEvents[i] = $root.google.cloud.batch.v1alpha.StatusEvent.fromObject(object.statusEvents[i]); + } + } + if (object.resourceUsage != null) { + if (typeof object.resourceUsage !== "object") + throw TypeError(".google.cloud.batch.v1alpha.TaskStatus.resourceUsage: object expected"); + message.resourceUsage = $root.google.cloud.batch.v1alpha.TaskResourceUsage.fromObject(object.resourceUsage); + } + return message; + }; + + /** + * Creates a plain object from a TaskStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.TaskStatus + * @static + * @param {google.cloud.batch.v1alpha.TaskStatus} message TaskStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TaskStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.statusEvents = []; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.resourceUsage = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.batch.v1alpha.TaskStatus.State[message.state] === undefined ? message.state : $root.google.cloud.batch.v1alpha.TaskStatus.State[message.state] : message.state; + if (message.statusEvents && message.statusEvents.length) { + object.statusEvents = []; + for (var j = 0; j < message.statusEvents.length; ++j) + object.statusEvents[j] = $root.google.cloud.batch.v1alpha.StatusEvent.toObject(message.statusEvents[j], options); + } + if (message.resourceUsage != null && message.hasOwnProperty("resourceUsage")) + object.resourceUsage = $root.google.cloud.batch.v1alpha.TaskResourceUsage.toObject(message.resourceUsage, options); + return object; + }; + + /** + * Converts this TaskStatus to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.TaskStatus + * @instance + * @returns {Object.} JSON object + */ + TaskStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TaskStatus + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.TaskStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TaskStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.TaskStatus"; + }; + + /** + * State enum. + * @name google.cloud.batch.v1alpha.TaskStatus.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PENDING=1 PENDING value + * @property {number} ASSIGNED=2 ASSIGNED value + * @property {number} RUNNING=3 RUNNING value + * @property {number} FAILED=4 FAILED value + * @property {number} SUCCEEDED=5 SUCCEEDED value + * @property {number} UNEXECUTED=6 UNEXECUTED value + */ + TaskStatus.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "ASSIGNED"] = 2; + values[valuesById[3] = "RUNNING"] = 3; + values[valuesById[4] = "FAILED"] = 4; + values[valuesById[5] = "SUCCEEDED"] = 5; + values[valuesById[6] = "UNEXECUTED"] = 6; + return values; + })(); + + return TaskStatus; + })(); + + v1alpha.TaskResourceUsage = (function() { + + /** + * Properties of a TaskResourceUsage. + * @memberof google.cloud.batch.v1alpha + * @interface ITaskResourceUsage + * @property {number|null} [coreHours] TaskResourceUsage coreHours + */ + + /** + * Constructs a new TaskResourceUsage. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a TaskResourceUsage. + * @implements ITaskResourceUsage + * @constructor + * @param {google.cloud.batch.v1alpha.ITaskResourceUsage=} [properties] Properties to set + */ + function TaskResourceUsage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TaskResourceUsage coreHours. + * @member {number} coreHours + * @memberof google.cloud.batch.v1alpha.TaskResourceUsage + * @instance + */ + TaskResourceUsage.prototype.coreHours = 0; + + /** + * Creates a new TaskResourceUsage instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.TaskResourceUsage + * @static + * @param {google.cloud.batch.v1alpha.ITaskResourceUsage=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.TaskResourceUsage} TaskResourceUsage instance + */ + TaskResourceUsage.create = function create(properties) { + return new TaskResourceUsage(properties); + }; + + /** + * Encodes the specified TaskResourceUsage message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskResourceUsage.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.TaskResourceUsage + * @static + * @param {google.cloud.batch.v1alpha.ITaskResourceUsage} message TaskResourceUsage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskResourceUsage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.coreHours != null && Object.hasOwnProperty.call(message, "coreHours")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.coreHours); + return writer; + }; + + /** + * Encodes the specified TaskResourceUsage message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskResourceUsage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.TaskResourceUsage + * @static + * @param {google.cloud.batch.v1alpha.ITaskResourceUsage} message TaskResourceUsage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskResourceUsage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TaskResourceUsage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.TaskResourceUsage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.TaskResourceUsage} TaskResourceUsage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskResourceUsage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.TaskResourceUsage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.coreHours = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TaskResourceUsage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.TaskResourceUsage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.TaskResourceUsage} TaskResourceUsage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskResourceUsage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TaskResourceUsage message. + * @function verify + * @memberof google.cloud.batch.v1alpha.TaskResourceUsage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TaskResourceUsage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.coreHours != null && message.hasOwnProperty("coreHours")) + if (typeof message.coreHours !== "number") + return "coreHours: number expected"; + return null; + }; + + /** + * Creates a TaskResourceUsage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.TaskResourceUsage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.TaskResourceUsage} TaskResourceUsage + */ + TaskResourceUsage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.TaskResourceUsage) + return object; + var message = new $root.google.cloud.batch.v1alpha.TaskResourceUsage(); + if (object.coreHours != null) + message.coreHours = Number(object.coreHours); + return message; + }; + + /** + * Creates a plain object from a TaskResourceUsage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.TaskResourceUsage + * @static + * @param {google.cloud.batch.v1alpha.TaskResourceUsage} message TaskResourceUsage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TaskResourceUsage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.coreHours = 0; + if (message.coreHours != null && message.hasOwnProperty("coreHours")) + object.coreHours = options.json && !isFinite(message.coreHours) ? String(message.coreHours) : message.coreHours; + return object; + }; + + /** + * Converts this TaskResourceUsage to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.TaskResourceUsage + * @instance + * @returns {Object.} JSON object + */ + TaskResourceUsage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TaskResourceUsage + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.TaskResourceUsage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TaskResourceUsage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.TaskResourceUsage"; + }; + + return TaskResourceUsage; + })(); + + v1alpha.Runnable = (function() { + + /** + * Properties of a Runnable. + * @memberof google.cloud.batch.v1alpha + * @interface IRunnable + * @property {google.cloud.batch.v1alpha.Runnable.IContainer|null} [container] Runnable container + * @property {google.cloud.batch.v1alpha.Runnable.IScript|null} [script] Runnable script + * @property {google.cloud.batch.v1alpha.Runnable.IBarrier|null} [barrier] Runnable barrier + * @property {string|null} [displayName] Runnable displayName + * @property {boolean|null} [ignoreExitStatus] Runnable ignoreExitStatus + * @property {boolean|null} [background] Runnable background + * @property {boolean|null} [alwaysRun] Runnable alwaysRun + * @property {google.cloud.batch.v1alpha.IEnvironment|null} [environment] Runnable environment + * @property {google.protobuf.IDuration|null} [timeout] Runnable timeout + * @property {Object.|null} [labels] Runnable labels + */ + + /** + * Constructs a new Runnable. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a Runnable. + * @implements IRunnable + * @constructor + * @param {google.cloud.batch.v1alpha.IRunnable=} [properties] Properties to set + */ + function Runnable(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Runnable container. + * @member {google.cloud.batch.v1alpha.Runnable.IContainer|null|undefined} container + * @memberof google.cloud.batch.v1alpha.Runnable + * @instance + */ + Runnable.prototype.container = null; + + /** + * Runnable script. + * @member {google.cloud.batch.v1alpha.Runnable.IScript|null|undefined} script + * @memberof google.cloud.batch.v1alpha.Runnable + * @instance + */ + Runnable.prototype.script = null; + + /** + * Runnable barrier. + * @member {google.cloud.batch.v1alpha.Runnable.IBarrier|null|undefined} barrier + * @memberof google.cloud.batch.v1alpha.Runnable + * @instance + */ + Runnable.prototype.barrier = null; + + /** + * Runnable displayName. + * @member {string} displayName + * @memberof google.cloud.batch.v1alpha.Runnable + * @instance + */ + Runnable.prototype.displayName = ""; + + /** + * Runnable ignoreExitStatus. + * @member {boolean} ignoreExitStatus + * @memberof google.cloud.batch.v1alpha.Runnable + * @instance + */ + Runnable.prototype.ignoreExitStatus = false; + + /** + * Runnable background. + * @member {boolean} background + * @memberof google.cloud.batch.v1alpha.Runnable + * @instance + */ + Runnable.prototype.background = false; + + /** + * Runnable alwaysRun. + * @member {boolean} alwaysRun + * @memberof google.cloud.batch.v1alpha.Runnable + * @instance + */ + Runnable.prototype.alwaysRun = false; + + /** + * Runnable environment. + * @member {google.cloud.batch.v1alpha.IEnvironment|null|undefined} environment + * @memberof google.cloud.batch.v1alpha.Runnable + * @instance + */ + Runnable.prototype.environment = null; + + /** + * Runnable timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.cloud.batch.v1alpha.Runnable + * @instance + */ + Runnable.prototype.timeout = null; + + /** + * Runnable labels. + * @member {Object.} labels + * @memberof google.cloud.batch.v1alpha.Runnable + * @instance + */ + Runnable.prototype.labels = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Runnable executable. + * @member {"container"|"script"|"barrier"|undefined} executable + * @memberof google.cloud.batch.v1alpha.Runnable + * @instance + */ + Object.defineProperty(Runnable.prototype, "executable", { + get: $util.oneOfGetter($oneOfFields = ["container", "script", "barrier"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Runnable instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.Runnable + * @static + * @param {google.cloud.batch.v1alpha.IRunnable=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.Runnable} Runnable instance + */ + Runnable.create = function create(properties) { + return new Runnable(properties); + }; + + /** + * Encodes the specified Runnable message. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.Runnable + * @static + * @param {google.cloud.batch.v1alpha.IRunnable} message Runnable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Runnable.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.container != null && Object.hasOwnProperty.call(message, "container")) + $root.google.cloud.batch.v1alpha.Runnable.Container.encode(message.container, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.script != null && Object.hasOwnProperty.call(message, "script")) + $root.google.cloud.batch.v1alpha.Runnable.Script.encode(message.script, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.ignoreExitStatus != null && Object.hasOwnProperty.call(message, "ignoreExitStatus")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.ignoreExitStatus); + if (message.background != null && Object.hasOwnProperty.call(message, "background")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.background); + if (message.alwaysRun != null && Object.hasOwnProperty.call(message, "alwaysRun")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.alwaysRun); + if (message.barrier != null && Object.hasOwnProperty.call(message, "barrier")) + $root.google.cloud.batch.v1alpha.Runnable.Barrier.encode(message.barrier, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + $root.google.cloud.batch.v1alpha.Environment.encode(message.environment, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + 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 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified Runnable message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.Runnable + * @static + * @param {google.cloud.batch.v1alpha.IRunnable} message Runnable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Runnable.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Runnable message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.Runnable + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.Runnable} Runnable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Runnable.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Runnable(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.container = $root.google.cloud.batch.v1alpha.Runnable.Container.decode(reader, reader.uint32()); + break; + } + case 2: { + message.script = $root.google.cloud.batch.v1alpha.Runnable.Script.decode(reader, reader.uint32()); + break; + } + case 6: { + message.barrier = $root.google.cloud.batch.v1alpha.Runnable.Barrier.decode(reader, reader.uint32()); + break; + } + case 10: { + message.displayName = reader.string(); + break; + } + case 3: { + message.ignoreExitStatus = reader.bool(); + break; + } + case 4: { + message.background = reader.bool(); + break; + } + case 5: { + message.alwaysRun = reader.bool(); + break; + } + case 7: { + message.environment = $root.google.cloud.batch.v1alpha.Environment.decode(reader, reader.uint32()); + break; + } + case 8: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 9: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Runnable message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.Runnable + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.Runnable} Runnable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Runnable.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Runnable message. + * @function verify + * @memberof google.cloud.batch.v1alpha.Runnable + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Runnable.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.container != null && message.hasOwnProperty("container")) { + properties.executable = 1; + { + var error = $root.google.cloud.batch.v1alpha.Runnable.Container.verify(message.container); + if (error) + return "container." + error; + } + } + if (message.script != null && message.hasOwnProperty("script")) { + if (properties.executable === 1) + return "executable: multiple values"; + properties.executable = 1; + { + var error = $root.google.cloud.batch.v1alpha.Runnable.Script.verify(message.script); + if (error) + return "script." + error; + } + } + if (message.barrier != null && message.hasOwnProperty("barrier")) { + if (properties.executable === 1) + return "executable: multiple values"; + properties.executable = 1; + { + var error = $root.google.cloud.batch.v1alpha.Runnable.Barrier.verify(message.barrier); + if (error) + return "barrier." + error; + } + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.ignoreExitStatus != null && message.hasOwnProperty("ignoreExitStatus")) + if (typeof message.ignoreExitStatus !== "boolean") + return "ignoreExitStatus: boolean expected"; + if (message.background != null && message.hasOwnProperty("background")) + if (typeof message.background !== "boolean") + return "background: boolean expected"; + if (message.alwaysRun != null && message.hasOwnProperty("alwaysRun")) + if (typeof message.alwaysRun !== "boolean") + return "alwaysRun: boolean expected"; + if (message.environment != null && message.hasOwnProperty("environment")) { + var error = $root.google.cloud.batch.v1alpha.Environment.verify(message.environment); + if (error) + return "environment." + error; + } + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a Runnable message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.Runnable + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.Runnable} Runnable + */ + Runnable.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.Runnable) + return object; + var message = new $root.google.cloud.batch.v1alpha.Runnable(); + if (object.container != null) { + if (typeof object.container !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Runnable.container: object expected"); + message.container = $root.google.cloud.batch.v1alpha.Runnable.Container.fromObject(object.container); + } + if (object.script != null) { + if (typeof object.script !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Runnable.script: object expected"); + message.script = $root.google.cloud.batch.v1alpha.Runnable.Script.fromObject(object.script); + } + if (object.barrier != null) { + if (typeof object.barrier !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Runnable.barrier: object expected"); + message.barrier = $root.google.cloud.batch.v1alpha.Runnable.Barrier.fromObject(object.barrier); + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.ignoreExitStatus != null) + message.ignoreExitStatus = Boolean(object.ignoreExitStatus); + if (object.background != null) + message.background = Boolean(object.background); + if (object.alwaysRun != null) + message.alwaysRun = Boolean(object.alwaysRun); + if (object.environment != null) { + if (typeof object.environment !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Runnable.environment: object expected"); + message.environment = $root.google.cloud.batch.v1alpha.Environment.fromObject(object.environment); + } + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Runnable.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Runnable.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a Runnable message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.Runnable + * @static + * @param {google.cloud.batch.v1alpha.Runnable} message Runnable + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Runnable.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.ignoreExitStatus = false; + object.background = false; + object.alwaysRun = false; + object.environment = null; + object.timeout = null; + object.displayName = ""; + } + if (message.container != null && message.hasOwnProperty("container")) { + object.container = $root.google.cloud.batch.v1alpha.Runnable.Container.toObject(message.container, options); + if (options.oneofs) + object.executable = "container"; + } + if (message.script != null && message.hasOwnProperty("script")) { + object.script = $root.google.cloud.batch.v1alpha.Runnable.Script.toObject(message.script, options); + if (options.oneofs) + object.executable = "script"; + } + if (message.ignoreExitStatus != null && message.hasOwnProperty("ignoreExitStatus")) + object.ignoreExitStatus = message.ignoreExitStatus; + if (message.background != null && message.hasOwnProperty("background")) + object.background = message.background; + if (message.alwaysRun != null && message.hasOwnProperty("alwaysRun")) + object.alwaysRun = message.alwaysRun; + if (message.barrier != null && message.hasOwnProperty("barrier")) { + object.barrier = $root.google.cloud.batch.v1alpha.Runnable.Barrier.toObject(message.barrier, options); + if (options.oneofs) + object.executable = "barrier"; + } + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = $root.google.cloud.batch.v1alpha.Environment.toObject(message.environment, options); + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this Runnable to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.Runnable + * @instance + * @returns {Object.} JSON object + */ + Runnable.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Runnable + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.Runnable + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Runnable.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.Runnable"; + }; + + Runnable.Container = (function() { + + /** + * Properties of a Container. + * @memberof google.cloud.batch.v1alpha.Runnable + * @interface IContainer + * @property {string|null} [imageUri] Container imageUri + * @property {Array.|null} [commands] Container commands + * @property {string|null} [entrypoint] Container entrypoint + * @property {Array.|null} [volumes] Container volumes + * @property {string|null} [options] Container options + * @property {boolean|null} [blockExternalNetwork] Container blockExternalNetwork + * @property {string|null} [username] Container username + * @property {string|null} [password] Container password + * @property {boolean|null} [enableImageStreaming] Container enableImageStreaming + */ + + /** + * Constructs a new Container. + * @memberof google.cloud.batch.v1alpha.Runnable + * @classdesc Represents a Container. + * @implements IContainer + * @constructor + * @param {google.cloud.batch.v1alpha.Runnable.IContainer=} [properties] Properties to set + */ + function Container(properties) { + this.commands = []; + this.volumes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Container imageUri. + * @member {string} imageUri + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @instance + */ + Container.prototype.imageUri = ""; + + /** + * Container commands. + * @member {Array.} commands + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @instance + */ + Container.prototype.commands = $util.emptyArray; + + /** + * Container entrypoint. + * @member {string} entrypoint + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @instance + */ + Container.prototype.entrypoint = ""; + + /** + * Container volumes. + * @member {Array.} volumes + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @instance + */ + Container.prototype.volumes = $util.emptyArray; + + /** + * Container options. + * @member {string} options + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @instance + */ + Container.prototype.options = ""; + + /** + * Container blockExternalNetwork. + * @member {boolean} blockExternalNetwork + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @instance + */ + Container.prototype.blockExternalNetwork = false; + + /** + * Container username. + * @member {string} username + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @instance + */ + Container.prototype.username = ""; + + /** + * Container password. + * @member {string} password + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @instance + */ + Container.prototype.password = ""; + + /** + * Container enableImageStreaming. + * @member {boolean} enableImageStreaming + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @instance + */ + Container.prototype.enableImageStreaming = false; + + /** + * Creates a new Container instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @static + * @param {google.cloud.batch.v1alpha.Runnable.IContainer=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.Runnable.Container} Container instance + */ + Container.create = function create(properties) { + return new Container(properties); + }; + + /** + * Encodes the specified Container message. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Container.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @static + * @param {google.cloud.batch.v1alpha.Runnable.IContainer} message Container message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Container.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.imageUri != null && Object.hasOwnProperty.call(message, "imageUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.imageUri); + if (message.commands != null && message.commands.length) + for (var i = 0; i < message.commands.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.commands[i]); + if (message.entrypoint != null && Object.hasOwnProperty.call(message, "entrypoint")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.entrypoint); + if (message.volumes != null && message.volumes.length) + for (var i = 0; i < message.volumes.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.volumes[i]); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.options); + if (message.blockExternalNetwork != null && Object.hasOwnProperty.call(message, "blockExternalNetwork")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.blockExternalNetwork); + if (message.username != null && Object.hasOwnProperty.call(message, "username")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.username); + if (message.password != null && Object.hasOwnProperty.call(message, "password")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.password); + if (message.enableImageStreaming != null && Object.hasOwnProperty.call(message, "enableImageStreaming")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.enableImageStreaming); + return writer; + }; + + /** + * Encodes the specified Container message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Container.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @static + * @param {google.cloud.batch.v1alpha.Runnable.IContainer} message Container message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Container.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Container message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.Runnable.Container} Container + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Container.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Runnable.Container(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.imageUri = reader.string(); + break; + } + case 2: { + if (!(message.commands && message.commands.length)) + message.commands = []; + message.commands.push(reader.string()); + break; + } + case 3: { + message.entrypoint = reader.string(); + break; + } + case 7: { + if (!(message.volumes && message.volumes.length)) + message.volumes = []; + message.volumes.push(reader.string()); + break; + } + case 8: { + message.options = reader.string(); + break; + } + case 9: { + message.blockExternalNetwork = reader.bool(); + break; + } + case 10: { + message.username = reader.string(); + break; + } + case 11: { + message.password = reader.string(); + break; + } + case 12: { + message.enableImageStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Container message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.Runnable.Container} Container + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Container.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Container message. + * @function verify + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Container.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + if (!$util.isString(message.imageUri)) + return "imageUri: string expected"; + if (message.commands != null && message.hasOwnProperty("commands")) { + if (!Array.isArray(message.commands)) + return "commands: array expected"; + for (var i = 0; i < message.commands.length; ++i) + if (!$util.isString(message.commands[i])) + return "commands: string[] expected"; + } + if (message.entrypoint != null && message.hasOwnProperty("entrypoint")) + if (!$util.isString(message.entrypoint)) + return "entrypoint: string expected"; + if (message.volumes != null && message.hasOwnProperty("volumes")) { + if (!Array.isArray(message.volumes)) + return "volumes: array expected"; + for (var i = 0; i < message.volumes.length; ++i) + if (!$util.isString(message.volumes[i])) + return "volumes: string[] expected"; + } + if (message.options != null && message.hasOwnProperty("options")) + if (!$util.isString(message.options)) + return "options: string expected"; + if (message.blockExternalNetwork != null && message.hasOwnProperty("blockExternalNetwork")) + if (typeof message.blockExternalNetwork !== "boolean") + return "blockExternalNetwork: boolean expected"; + if (message.username != null && message.hasOwnProperty("username")) + if (!$util.isString(message.username)) + return "username: string expected"; + if (message.password != null && message.hasOwnProperty("password")) + if (!$util.isString(message.password)) + return "password: string expected"; + if (message.enableImageStreaming != null && message.hasOwnProperty("enableImageStreaming")) + if (typeof message.enableImageStreaming !== "boolean") + return "enableImageStreaming: boolean expected"; + return null; + }; + + /** + * Creates a Container message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.Runnable.Container} Container + */ + Container.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.Runnable.Container) + return object; + var message = new $root.google.cloud.batch.v1alpha.Runnable.Container(); + if (object.imageUri != null) + message.imageUri = String(object.imageUri); + if (object.commands) { + if (!Array.isArray(object.commands)) + throw TypeError(".google.cloud.batch.v1alpha.Runnable.Container.commands: array expected"); + message.commands = []; + for (var i = 0; i < object.commands.length; ++i) + message.commands[i] = String(object.commands[i]); + } + if (object.entrypoint != null) + message.entrypoint = String(object.entrypoint); + if (object.volumes) { + if (!Array.isArray(object.volumes)) + throw TypeError(".google.cloud.batch.v1alpha.Runnable.Container.volumes: array expected"); + message.volumes = []; + for (var i = 0; i < object.volumes.length; ++i) + message.volumes[i] = String(object.volumes[i]); + } + if (object.options != null) + message.options = String(object.options); + if (object.blockExternalNetwork != null) + message.blockExternalNetwork = Boolean(object.blockExternalNetwork); + if (object.username != null) + message.username = String(object.username); + if (object.password != null) + message.password = String(object.password); + if (object.enableImageStreaming != null) + message.enableImageStreaming = Boolean(object.enableImageStreaming); + return message; + }; + + /** + * Creates a plain object from a Container message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @static + * @param {google.cloud.batch.v1alpha.Runnable.Container} message Container + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Container.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.commands = []; + object.volumes = []; + } + if (options.defaults) { + object.imageUri = ""; + object.entrypoint = ""; + object.options = ""; + object.blockExternalNetwork = false; + object.username = ""; + object.password = ""; + object.enableImageStreaming = false; + } + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + object.imageUri = message.imageUri; + if (message.commands && message.commands.length) { + object.commands = []; + for (var j = 0; j < message.commands.length; ++j) + object.commands[j] = message.commands[j]; + } + if (message.entrypoint != null && message.hasOwnProperty("entrypoint")) + object.entrypoint = message.entrypoint; + if (message.volumes && message.volumes.length) { + object.volumes = []; + for (var j = 0; j < message.volumes.length; ++j) + object.volumes[j] = message.volumes[j]; + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = message.options; + if (message.blockExternalNetwork != null && message.hasOwnProperty("blockExternalNetwork")) + object.blockExternalNetwork = message.blockExternalNetwork; + if (message.username != null && message.hasOwnProperty("username")) + object.username = message.username; + if (message.password != null && message.hasOwnProperty("password")) + object.password = message.password; + if (message.enableImageStreaming != null && message.hasOwnProperty("enableImageStreaming")) + object.enableImageStreaming = message.enableImageStreaming; + return object; + }; + + /** + * Converts this Container to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @instance + * @returns {Object.} JSON object + */ + Container.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Container + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.Runnable.Container + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Container.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.Runnable.Container"; + }; + + return Container; + })(); + + Runnable.Script = (function() { + + /** + * Properties of a Script. + * @memberof google.cloud.batch.v1alpha.Runnable + * @interface IScript + * @property {string|null} [path] Script path + * @property {string|null} [text] Script text + */ + + /** + * Constructs a new Script. + * @memberof google.cloud.batch.v1alpha.Runnable + * @classdesc Represents a Script. + * @implements IScript + * @constructor + * @param {google.cloud.batch.v1alpha.Runnable.IScript=} [properties] Properties to set + */ + function Script(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Script path. + * @member {string|null|undefined} path + * @memberof google.cloud.batch.v1alpha.Runnable.Script + * @instance + */ + Script.prototype.path = null; + + /** + * Script text. + * @member {string|null|undefined} text + * @memberof google.cloud.batch.v1alpha.Runnable.Script + * @instance + */ + Script.prototype.text = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Script command. + * @member {"path"|"text"|undefined} command + * @memberof google.cloud.batch.v1alpha.Runnable.Script + * @instance + */ + Object.defineProperty(Script.prototype, "command", { + get: $util.oneOfGetter($oneOfFields = ["path", "text"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Script instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.Runnable.Script + * @static + * @param {google.cloud.batch.v1alpha.Runnable.IScript=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.Runnable.Script} Script instance + */ + Script.create = function create(properties) { + return new Script(properties); + }; + + /** + * Encodes the specified Script message. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Script.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.Runnable.Script + * @static + * @param {google.cloud.batch.v1alpha.Runnable.IScript} message Script message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Script.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.path); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.text); + return writer; + }; + + /** + * Encodes the specified Script message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Script.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.Runnable.Script + * @static + * @param {google.cloud.batch.v1alpha.Runnable.IScript} message Script message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Script.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Script message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.Runnable.Script + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.Runnable.Script} Script + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Script.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Runnable.Script(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.path = reader.string(); + break; + } + case 2: { + message.text = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Script message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.Runnable.Script + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.Runnable.Script} Script + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Script.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Script message. + * @function verify + * @memberof google.cloud.batch.v1alpha.Runnable.Script + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Script.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.path != null && message.hasOwnProperty("path")) { + properties.command = 1; + if (!$util.isString(message.path)) + return "path: string expected"; + } + if (message.text != null && message.hasOwnProperty("text")) { + if (properties.command === 1) + return "command: multiple values"; + properties.command = 1; + if (!$util.isString(message.text)) + return "text: string expected"; + } + return null; + }; + + /** + * Creates a Script message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.Runnable.Script + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.Runnable.Script} Script + */ + Script.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.Runnable.Script) + return object; + var message = new $root.google.cloud.batch.v1alpha.Runnable.Script(); + if (object.path != null) + message.path = String(object.path); + if (object.text != null) + message.text = String(object.text); + return message; + }; + + /** + * Creates a plain object from a Script message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.Runnable.Script + * @static + * @param {google.cloud.batch.v1alpha.Runnable.Script} message Script + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Script.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.path != null && message.hasOwnProperty("path")) { + object.path = message.path; + if (options.oneofs) + object.command = "path"; + } + if (message.text != null && message.hasOwnProperty("text")) { + object.text = message.text; + if (options.oneofs) + object.command = "text"; + } + return object; + }; + + /** + * Converts this Script to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.Runnable.Script + * @instance + * @returns {Object.} JSON object + */ + Script.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Script + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.Runnable.Script + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Script.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.Runnable.Script"; + }; + + return Script; + })(); + + Runnable.Barrier = (function() { + + /** + * Properties of a Barrier. + * @memberof google.cloud.batch.v1alpha.Runnable + * @interface IBarrier + * @property {string|null} [name] Barrier name + */ + + /** + * Constructs a new Barrier. + * @memberof google.cloud.batch.v1alpha.Runnable + * @classdesc Represents a Barrier. + * @implements IBarrier + * @constructor + * @param {google.cloud.batch.v1alpha.Runnable.IBarrier=} [properties] Properties to set + */ + function Barrier(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Barrier name. + * @member {string} name + * @memberof google.cloud.batch.v1alpha.Runnable.Barrier + * @instance + */ + Barrier.prototype.name = ""; + + /** + * Creates a new Barrier instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.Runnable.Barrier + * @static + * @param {google.cloud.batch.v1alpha.Runnable.IBarrier=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.Runnable.Barrier} Barrier instance + */ + Barrier.create = function create(properties) { + return new Barrier(properties); + }; + + /** + * Encodes the specified Barrier message. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Barrier.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.Runnable.Barrier + * @static + * @param {google.cloud.batch.v1alpha.Runnable.IBarrier} message Barrier message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Barrier.encode = function encode(message, writer) { + 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 Barrier message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Barrier.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.Runnable.Barrier + * @static + * @param {google.cloud.batch.v1alpha.Runnable.IBarrier} message Barrier message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Barrier.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Barrier message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.Runnable.Barrier + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.Runnable.Barrier} Barrier + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Barrier.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Runnable.Barrier(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Barrier message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.Runnable.Barrier + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.Runnable.Barrier} Barrier + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Barrier.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Barrier message. + * @function verify + * @memberof google.cloud.batch.v1alpha.Runnable.Barrier + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Barrier.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a Barrier message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.Runnable.Barrier + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.Runnable.Barrier} Barrier + */ + Barrier.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.Runnable.Barrier) + return object; + var message = new $root.google.cloud.batch.v1alpha.Runnable.Barrier(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a Barrier message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.Runnable.Barrier + * @static + * @param {google.cloud.batch.v1alpha.Runnable.Barrier} message Barrier + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Barrier.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 Barrier to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.Runnable.Barrier + * @instance + * @returns {Object.} JSON object + */ + Barrier.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Barrier + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.Runnable.Barrier + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Barrier.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.Runnable.Barrier"; + }; + + return Barrier; + })(); + + return Runnable; + })(); + + v1alpha.TaskSpec = (function() { + + /** + * Properties of a TaskSpec. + * @memberof google.cloud.batch.v1alpha + * @interface ITaskSpec + * @property {Array.|null} [runnables] TaskSpec runnables + * @property {google.cloud.batch.v1alpha.IComputeResource|null} [computeResource] TaskSpec computeResource + * @property {google.protobuf.IDuration|null} [maxRunDuration] TaskSpec maxRunDuration + * @property {number|null} [maxRetryCount] TaskSpec maxRetryCount + * @property {Array.|null} [lifecyclePolicies] TaskSpec lifecyclePolicies + * @property {Object.|null} [environments] TaskSpec environments + * @property {Array.|null} [volumes] TaskSpec volumes + * @property {google.cloud.batch.v1alpha.IEnvironment|null} [environment] TaskSpec environment + */ + + /** + * Constructs a new TaskSpec. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a TaskSpec. + * @implements ITaskSpec + * @constructor + * @param {google.cloud.batch.v1alpha.ITaskSpec=} [properties] Properties to set + */ + function TaskSpec(properties) { + this.runnables = []; + this.lifecyclePolicies = []; + this.environments = {}; + this.volumes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TaskSpec runnables. + * @member {Array.} runnables + * @memberof google.cloud.batch.v1alpha.TaskSpec + * @instance + */ + TaskSpec.prototype.runnables = $util.emptyArray; + + /** + * TaskSpec computeResource. + * @member {google.cloud.batch.v1alpha.IComputeResource|null|undefined} computeResource + * @memberof google.cloud.batch.v1alpha.TaskSpec + * @instance + */ + TaskSpec.prototype.computeResource = null; + + /** + * TaskSpec maxRunDuration. + * @member {google.protobuf.IDuration|null|undefined} maxRunDuration + * @memberof google.cloud.batch.v1alpha.TaskSpec + * @instance + */ + TaskSpec.prototype.maxRunDuration = null; + + /** + * TaskSpec maxRetryCount. + * @member {number} maxRetryCount + * @memberof google.cloud.batch.v1alpha.TaskSpec + * @instance + */ + TaskSpec.prototype.maxRetryCount = 0; + + /** + * TaskSpec lifecyclePolicies. + * @member {Array.} lifecyclePolicies + * @memberof google.cloud.batch.v1alpha.TaskSpec + * @instance + */ + TaskSpec.prototype.lifecyclePolicies = $util.emptyArray; + + /** + * TaskSpec environments. + * @member {Object.} environments + * @memberof google.cloud.batch.v1alpha.TaskSpec + * @instance + */ + TaskSpec.prototype.environments = $util.emptyObject; + + /** + * TaskSpec volumes. + * @member {Array.} volumes + * @memberof google.cloud.batch.v1alpha.TaskSpec + * @instance + */ + TaskSpec.prototype.volumes = $util.emptyArray; + + /** + * TaskSpec environment. + * @member {google.cloud.batch.v1alpha.IEnvironment|null|undefined} environment + * @memberof google.cloud.batch.v1alpha.TaskSpec + * @instance + */ + TaskSpec.prototype.environment = null; + + /** + * Creates a new TaskSpec instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.TaskSpec + * @static + * @param {google.cloud.batch.v1alpha.ITaskSpec=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.TaskSpec} TaskSpec instance + */ + TaskSpec.create = function create(properties) { + return new TaskSpec(properties); + }; + + /** + * Encodes the specified TaskSpec message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.TaskSpec + * @static + * @param {google.cloud.batch.v1alpha.ITaskSpec} message TaskSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.computeResource != null && Object.hasOwnProperty.call(message, "computeResource")) + $root.google.cloud.batch.v1alpha.ComputeResource.encode(message.computeResource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.maxRunDuration != null && Object.hasOwnProperty.call(message, "maxRunDuration")) + $root.google.protobuf.Duration.encode(message.maxRunDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.maxRetryCount != null && Object.hasOwnProperty.call(message, "maxRetryCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxRetryCount); + if (message.environments != null && Object.hasOwnProperty.call(message, "environments")) + for (var keys = Object.keys(message.environments), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.environments[keys[i]]).ldelim(); + if (message.volumes != null && message.volumes.length) + for (var i = 0; i < message.volumes.length; ++i) + $root.google.cloud.batch.v1alpha.Volume.encode(message.volumes[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.runnables != null && message.runnables.length) + for (var i = 0; i < message.runnables.length; ++i) + $root.google.cloud.batch.v1alpha.Runnable.encode(message.runnables[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.lifecyclePolicies != null && message.lifecyclePolicies.length) + for (var i = 0; i < message.lifecyclePolicies.length; ++i) + $root.google.cloud.batch.v1alpha.LifecyclePolicy.encode(message.lifecyclePolicies[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + $root.google.cloud.batch.v1alpha.Environment.encode(message.environment, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TaskSpec message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.TaskSpec + * @static + * @param {google.cloud.batch.v1alpha.ITaskSpec} message TaskSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TaskSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.TaskSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.TaskSpec} TaskSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.TaskSpec(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 8: { + if (!(message.runnables && message.runnables.length)) + message.runnables = []; + message.runnables.push($root.google.cloud.batch.v1alpha.Runnable.decode(reader, reader.uint32())); + break; + } + case 3: { + message.computeResource = $root.google.cloud.batch.v1alpha.ComputeResource.decode(reader, reader.uint32()); + break; + } + case 4: { + message.maxRunDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.maxRetryCount = reader.int32(); + break; + } + case 9: { + if (!(message.lifecyclePolicies && message.lifecyclePolicies.length)) + message.lifecyclePolicies = []; + message.lifecyclePolicies.push($root.google.cloud.batch.v1alpha.LifecyclePolicy.decode(reader, reader.uint32())); + break; + } + case 6: { + if (message.environments === $util.emptyObject) + message.environments = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.environments[key] = value; + break; + } + case 7: { + if (!(message.volumes && message.volumes.length)) + message.volumes = []; + message.volumes.push($root.google.cloud.batch.v1alpha.Volume.decode(reader, reader.uint32())); + break; + } + case 10: { + message.environment = $root.google.cloud.batch.v1alpha.Environment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TaskSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.TaskSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.TaskSpec} TaskSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TaskSpec message. + * @function verify + * @memberof google.cloud.batch.v1alpha.TaskSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TaskSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.runnables != null && message.hasOwnProperty("runnables")) { + if (!Array.isArray(message.runnables)) + return "runnables: array expected"; + for (var i = 0; i < message.runnables.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.Runnable.verify(message.runnables[i]); + if (error) + return "runnables." + error; + } + } + if (message.computeResource != null && message.hasOwnProperty("computeResource")) { + var error = $root.google.cloud.batch.v1alpha.ComputeResource.verify(message.computeResource); + if (error) + return "computeResource." + error; + } + if (message.maxRunDuration != null && message.hasOwnProperty("maxRunDuration")) { + var error = $root.google.protobuf.Duration.verify(message.maxRunDuration); + if (error) + return "maxRunDuration." + error; + } + if (message.maxRetryCount != null && message.hasOwnProperty("maxRetryCount")) + if (!$util.isInteger(message.maxRetryCount)) + return "maxRetryCount: integer expected"; + if (message.lifecyclePolicies != null && message.hasOwnProperty("lifecyclePolicies")) { + if (!Array.isArray(message.lifecyclePolicies)) + return "lifecyclePolicies: array expected"; + for (var i = 0; i < message.lifecyclePolicies.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.LifecyclePolicy.verify(message.lifecyclePolicies[i]); + if (error) + return "lifecyclePolicies." + error; + } + } + if (message.environments != null && message.hasOwnProperty("environments")) { + if (!$util.isObject(message.environments)) + return "environments: object expected"; + var key = Object.keys(message.environments); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.environments[key[i]])) + return "environments: string{k:string} expected"; + } + if (message.volumes != null && message.hasOwnProperty("volumes")) { + if (!Array.isArray(message.volumes)) + return "volumes: array expected"; + for (var i = 0; i < message.volumes.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.Volume.verify(message.volumes[i]); + if (error) + return "volumes." + error; + } + } + if (message.environment != null && message.hasOwnProperty("environment")) { + var error = $root.google.cloud.batch.v1alpha.Environment.verify(message.environment); + if (error) + return "environment." + error; + } + return null; + }; + + /** + * Creates a TaskSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.TaskSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.TaskSpec} TaskSpec + */ + TaskSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.TaskSpec) + return object; + var message = new $root.google.cloud.batch.v1alpha.TaskSpec(); + if (object.runnables) { + if (!Array.isArray(object.runnables)) + throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.runnables: array expected"); + message.runnables = []; + for (var i = 0; i < object.runnables.length; ++i) { + if (typeof object.runnables[i] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.runnables: object expected"); + message.runnables[i] = $root.google.cloud.batch.v1alpha.Runnable.fromObject(object.runnables[i]); + } + } + if (object.computeResource != null) { + if (typeof object.computeResource !== "object") + throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.computeResource: object expected"); + message.computeResource = $root.google.cloud.batch.v1alpha.ComputeResource.fromObject(object.computeResource); + } + if (object.maxRunDuration != null) { + if (typeof object.maxRunDuration !== "object") + throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.maxRunDuration: object expected"); + message.maxRunDuration = $root.google.protobuf.Duration.fromObject(object.maxRunDuration); + } + if (object.maxRetryCount != null) + message.maxRetryCount = object.maxRetryCount | 0; + if (object.lifecyclePolicies) { + if (!Array.isArray(object.lifecyclePolicies)) + throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.lifecyclePolicies: array expected"); + message.lifecyclePolicies = []; + for (var i = 0; i < object.lifecyclePolicies.length; ++i) { + if (typeof object.lifecyclePolicies[i] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.lifecyclePolicies: object expected"); + message.lifecyclePolicies[i] = $root.google.cloud.batch.v1alpha.LifecyclePolicy.fromObject(object.lifecyclePolicies[i]); + } + } + if (object.environments) { + if (typeof object.environments !== "object") + throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.environments: object expected"); + message.environments = {}; + for (var keys = Object.keys(object.environments), i = 0; i < keys.length; ++i) + message.environments[keys[i]] = String(object.environments[keys[i]]); + } + if (object.volumes) { + if (!Array.isArray(object.volumes)) + throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.volumes: array expected"); + message.volumes = []; + for (var i = 0; i < object.volumes.length; ++i) { + if (typeof object.volumes[i] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.volumes: object expected"); + message.volumes[i] = $root.google.cloud.batch.v1alpha.Volume.fromObject(object.volumes[i]); + } + } + if (object.environment != null) { + if (typeof object.environment !== "object") + throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.environment: object expected"); + message.environment = $root.google.cloud.batch.v1alpha.Environment.fromObject(object.environment); + } + return message; + }; + + /** + * Creates a plain object from a TaskSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.TaskSpec + * @static + * @param {google.cloud.batch.v1alpha.TaskSpec} message TaskSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TaskSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.volumes = []; + object.runnables = []; + object.lifecyclePolicies = []; + } + if (options.objects || options.defaults) + object.environments = {}; + if (options.defaults) { + object.computeResource = null; + object.maxRunDuration = null; + object.maxRetryCount = 0; + object.environment = null; + } + if (message.computeResource != null && message.hasOwnProperty("computeResource")) + object.computeResource = $root.google.cloud.batch.v1alpha.ComputeResource.toObject(message.computeResource, options); + if (message.maxRunDuration != null && message.hasOwnProperty("maxRunDuration")) + object.maxRunDuration = $root.google.protobuf.Duration.toObject(message.maxRunDuration, options); + if (message.maxRetryCount != null && message.hasOwnProperty("maxRetryCount")) + object.maxRetryCount = message.maxRetryCount; + var keys2; + if (message.environments && (keys2 = Object.keys(message.environments)).length) { + object.environments = {}; + for (var j = 0; j < keys2.length; ++j) + object.environments[keys2[j]] = message.environments[keys2[j]]; + } + if (message.volumes && message.volumes.length) { + object.volumes = []; + for (var j = 0; j < message.volumes.length; ++j) + object.volumes[j] = $root.google.cloud.batch.v1alpha.Volume.toObject(message.volumes[j], options); + } + if (message.runnables && message.runnables.length) { + object.runnables = []; + for (var j = 0; j < message.runnables.length; ++j) + object.runnables[j] = $root.google.cloud.batch.v1alpha.Runnable.toObject(message.runnables[j], options); + } + if (message.lifecyclePolicies && message.lifecyclePolicies.length) { + object.lifecyclePolicies = []; + for (var j = 0; j < message.lifecyclePolicies.length; ++j) + object.lifecyclePolicies[j] = $root.google.cloud.batch.v1alpha.LifecyclePolicy.toObject(message.lifecyclePolicies[j], options); + } + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = $root.google.cloud.batch.v1alpha.Environment.toObject(message.environment, options); + return object; + }; + + /** + * Converts this TaskSpec to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.TaskSpec + * @instance + * @returns {Object.} JSON object + */ + TaskSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TaskSpec + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.TaskSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TaskSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.TaskSpec"; + }; + + return TaskSpec; + })(); + + v1alpha.LifecyclePolicy = (function() { + + /** + * Properties of a LifecyclePolicy. + * @memberof google.cloud.batch.v1alpha + * @interface ILifecyclePolicy + * @property {google.cloud.batch.v1alpha.LifecyclePolicy.Action|null} [action] LifecyclePolicy action + * @property {google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition|null} [actionCondition] LifecyclePolicy actionCondition + */ + + /** + * Constructs a new LifecyclePolicy. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a LifecyclePolicy. + * @implements ILifecyclePolicy + * @constructor + * @param {google.cloud.batch.v1alpha.ILifecyclePolicy=} [properties] Properties to set + */ + function LifecyclePolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LifecyclePolicy action. + * @member {google.cloud.batch.v1alpha.LifecyclePolicy.Action} action + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy + * @instance + */ + LifecyclePolicy.prototype.action = 0; + + /** + * LifecyclePolicy actionCondition. + * @member {google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition|null|undefined} actionCondition + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy + * @instance + */ + LifecyclePolicy.prototype.actionCondition = null; + + /** + * Creates a new LifecyclePolicy instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy + * @static + * @param {google.cloud.batch.v1alpha.ILifecyclePolicy=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.LifecyclePolicy} LifecyclePolicy instance + */ + LifecyclePolicy.create = function create(properties) { + return new LifecyclePolicy(properties); + }; + + /** + * Encodes the specified LifecyclePolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.LifecyclePolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy + * @static + * @param {google.cloud.batch.v1alpha.ILifecyclePolicy} message LifecyclePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LifecyclePolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.actionCondition != null && Object.hasOwnProperty.call(message, "actionCondition")) + $root.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.encode(message.actionCondition, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LifecyclePolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.LifecyclePolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy + * @static + * @param {google.cloud.batch.v1alpha.ILifecyclePolicy} message LifecyclePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LifecyclePolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LifecyclePolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.LifecyclePolicy} LifecyclePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LifecyclePolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.LifecyclePolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.actionCondition = $root.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LifecyclePolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.LifecyclePolicy} LifecyclePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LifecyclePolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LifecyclePolicy message. + * @function verify + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LifecyclePolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.actionCondition != null && message.hasOwnProperty("actionCondition")) { + var error = $root.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.verify(message.actionCondition); + if (error) + return "actionCondition." + error; + } + return null; + }; + + /** + * Creates a LifecyclePolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.LifecyclePolicy} LifecyclePolicy + */ + LifecyclePolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.LifecyclePolicy) + return object; + var message = new $root.google.cloud.batch.v1alpha.LifecyclePolicy(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "RETRY_TASK": + case 1: + message.action = 1; + break; + case "FAIL_TASK": + case 2: + message.action = 2; + break; + } + if (object.actionCondition != null) { + if (typeof object.actionCondition !== "object") + throw TypeError(".google.cloud.batch.v1alpha.LifecyclePolicy.actionCondition: object expected"); + message.actionCondition = $root.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.fromObject(object.actionCondition); + } + return message; + }; + + /** + * Creates a plain object from a LifecyclePolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy + * @static + * @param {google.cloud.batch.v1alpha.LifecyclePolicy} message LifecyclePolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LifecyclePolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.actionCondition = null; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.cloud.batch.v1alpha.LifecyclePolicy.Action[message.action] === undefined ? message.action : $root.google.cloud.batch.v1alpha.LifecyclePolicy.Action[message.action] : message.action; + if (message.actionCondition != null && message.hasOwnProperty("actionCondition")) + object.actionCondition = $root.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.toObject(message.actionCondition, options); + return object; + }; + + /** + * Converts this LifecyclePolicy to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy + * @instance + * @returns {Object.} JSON object + */ + LifecyclePolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LifecyclePolicy + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LifecyclePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.LifecyclePolicy"; + }; + + LifecyclePolicy.ActionCondition = (function() { + + /** + * Properties of an ActionCondition. + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy + * @interface IActionCondition + * @property {Array.|null} [exitCodes] ActionCondition exitCodes + */ + + /** + * Constructs a new ActionCondition. + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy + * @classdesc Represents an ActionCondition. + * @implements IActionCondition + * @constructor + * @param {google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition=} [properties] Properties to set + */ + function ActionCondition(properties) { + this.exitCodes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ActionCondition exitCodes. + * @member {Array.} exitCodes + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition + * @instance + */ + ActionCondition.prototype.exitCodes = $util.emptyArray; + + /** + * Creates a new ActionCondition instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition + * @static + * @param {google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition} ActionCondition instance + */ + ActionCondition.create = function create(properties) { + return new ActionCondition(properties); + }; + + /** + * Encodes the specified ActionCondition message. Does not implicitly {@link google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition + * @static + * @param {google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition} message ActionCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActionCondition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.exitCodes != null && message.exitCodes.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.exitCodes.length; ++i) + writer.int32(message.exitCodes[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ActionCondition message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition + * @static + * @param {google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition} message ActionCondition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ActionCondition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ActionCondition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition} ActionCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActionCondition.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.exitCodes && message.exitCodes.length)) + message.exitCodes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.exitCodes.push(reader.int32()); + } else + message.exitCodes.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ActionCondition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition} ActionCondition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ActionCondition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ActionCondition message. + * @function verify + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ActionCondition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.exitCodes != null && message.hasOwnProperty("exitCodes")) { + if (!Array.isArray(message.exitCodes)) + return "exitCodes: array expected"; + for (var i = 0; i < message.exitCodes.length; ++i) + if (!$util.isInteger(message.exitCodes[i])) + return "exitCodes: integer[] expected"; + } + return null; + }; + + /** + * Creates an ActionCondition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition} ActionCondition + */ + ActionCondition.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition) + return object; + var message = new $root.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition(); + if (object.exitCodes) { + if (!Array.isArray(object.exitCodes)) + throw TypeError(".google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.exitCodes: array expected"); + message.exitCodes = []; + for (var i = 0; i < object.exitCodes.length; ++i) + message.exitCodes[i] = object.exitCodes[i] | 0; + } + return message; + }; + + /** + * Creates a plain object from an ActionCondition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition + * @static + * @param {google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition} message ActionCondition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ActionCondition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.exitCodes = []; + if (message.exitCodes && message.exitCodes.length) { + object.exitCodes = []; + for (var j = 0; j < message.exitCodes.length; ++j) + object.exitCodes[j] = message.exitCodes[j]; + } + return object; + }; + + /** + * Converts this ActionCondition to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition + * @instance + * @returns {Object.} JSON object + */ + ActionCondition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ActionCondition + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ActionCondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition"; + }; + + return ActionCondition; + })(); + + /** + * Action enum. + * @name google.cloud.batch.v1alpha.LifecyclePolicy.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} RETRY_TASK=1 RETRY_TASK value + * @property {number} FAIL_TASK=2 FAIL_TASK value + */ + LifecyclePolicy.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "RETRY_TASK"] = 1; + values[valuesById[2] = "FAIL_TASK"] = 2; + return values; + })(); + + return LifecyclePolicy; + })(); + + v1alpha.Task = (function() { + + /** + * Properties of a Task. + * @memberof google.cloud.batch.v1alpha + * @interface ITask + * @property {string|null} [name] Task name + * @property {google.cloud.batch.v1alpha.ITaskStatus|null} [status] Task status + */ + + /** + * Constructs a new Task. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a Task. + * @implements ITask + * @constructor + * @param {google.cloud.batch.v1alpha.ITask=} [properties] Properties to set + */ + function Task(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Task name. + * @member {string} name + * @memberof google.cloud.batch.v1alpha.Task + * @instance + */ + Task.prototype.name = ""; + + /** + * Task status. + * @member {google.cloud.batch.v1alpha.ITaskStatus|null|undefined} status + * @memberof google.cloud.batch.v1alpha.Task + * @instance + */ + Task.prototype.status = null; + + /** + * Creates a new Task instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.Task + * @static + * @param {google.cloud.batch.v1alpha.ITask=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.Task} Task instance + */ + Task.create = function create(properties) { + return new Task(properties); + }; + + /** + * Encodes the specified Task message. Does not implicitly {@link google.cloud.batch.v1alpha.Task.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.Task + * @static + * @param {google.cloud.batch.v1alpha.ITask} message Task message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Task.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.cloud.batch.v1alpha.TaskStatus.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Task message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Task.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.Task + * @static + * @param {google.cloud.batch.v1alpha.ITask} message Task message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Task.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Task message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.Task + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.Task} Task + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Task.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Task(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.status = $root.google.cloud.batch.v1alpha.TaskStatus.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Task message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.Task + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.Task} Task + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Task.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Task message. + * @function verify + * @memberof google.cloud.batch.v1alpha.Task + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Task.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.cloud.batch.v1alpha.TaskStatus.verify(message.status); + if (error) + return "status." + error; + } + return null; + }; + + /** + * Creates a Task message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.Task + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.Task} Task + */ + Task.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.Task) + return object; + var message = new $root.google.cloud.batch.v1alpha.Task(); + if (object.name != null) + message.name = String(object.name); + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Task.status: object expected"); + message.status = $root.google.cloud.batch.v1alpha.TaskStatus.fromObject(object.status); + } + return message; + }; + + /** + * Creates a plain object from a Task message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.Task + * @static + * @param {google.cloud.batch.v1alpha.Task} message Task + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Task.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.status = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.cloud.batch.v1alpha.TaskStatus.toObject(message.status, options); + return object; + }; + + /** + * Converts this Task to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.Task + * @instance + * @returns {Object.} JSON object + */ + Task.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Task + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.Task + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Task.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.Task"; + }; + + return Task; + })(); + + v1alpha.Environment = (function() { + + /** + * Properties of an Environment. + * @memberof google.cloud.batch.v1alpha + * @interface IEnvironment + * @property {Object.|null} [variables] Environment variables + * @property {Object.|null} [secretVariables] Environment secretVariables + * @property {google.cloud.batch.v1alpha.Environment.IKMSEnvMap|null} [encryptedVariables] Environment encryptedVariables + */ + + /** + * Constructs a new Environment. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents an Environment. + * @implements IEnvironment + * @constructor + * @param {google.cloud.batch.v1alpha.IEnvironment=} [properties] Properties to set + */ + function Environment(properties) { + this.variables = {}; + this.secretVariables = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Environment variables. + * @member {Object.} variables + * @memberof google.cloud.batch.v1alpha.Environment + * @instance + */ + Environment.prototype.variables = $util.emptyObject; + + /** + * Environment secretVariables. + * @member {Object.} secretVariables + * @memberof google.cloud.batch.v1alpha.Environment + * @instance + */ + Environment.prototype.secretVariables = $util.emptyObject; + + /** + * Environment encryptedVariables. + * @member {google.cloud.batch.v1alpha.Environment.IKMSEnvMap|null|undefined} encryptedVariables + * @memberof google.cloud.batch.v1alpha.Environment + * @instance + */ + Environment.prototype.encryptedVariables = null; + + /** + * Creates a new Environment instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.Environment + * @static + * @param {google.cloud.batch.v1alpha.IEnvironment=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.Environment} Environment instance + */ + Environment.create = function create(properties) { + return new Environment(properties); + }; + + /** + * Encodes the specified Environment message. Does not implicitly {@link google.cloud.batch.v1alpha.Environment.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.Environment + * @static + * @param {google.cloud.batch.v1alpha.IEnvironment} message Environment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Environment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.variables != null && Object.hasOwnProperty.call(message, "variables")) + for (var keys = Object.keys(message.variables), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.variables[keys[i]]).ldelim(); + if (message.secretVariables != null && Object.hasOwnProperty.call(message, "secretVariables")) + for (var keys = Object.keys(message.secretVariables), 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.secretVariables[keys[i]]).ldelim(); + if (message.encryptedVariables != null && Object.hasOwnProperty.call(message, "encryptedVariables")) + $root.google.cloud.batch.v1alpha.Environment.KMSEnvMap.encode(message.encryptedVariables, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Environment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.Environment + * @static + * @param {google.cloud.batch.v1alpha.IEnvironment} message Environment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Environment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Environment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.Environment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.Environment} Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Environment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Environment(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.variables === $util.emptyObject) + message.variables = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.variables[key] = value; + break; + } + case 2: { + if (message.secretVariables === $util.emptyObject) + message.secretVariables = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.secretVariables[key] = value; + break; + } + case 3: { + message.encryptedVariables = $root.google.cloud.batch.v1alpha.Environment.KMSEnvMap.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Environment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.Environment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.Environment} Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Environment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Environment message. + * @function verify + * @memberof google.cloud.batch.v1alpha.Environment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Environment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.variables != null && message.hasOwnProperty("variables")) { + if (!$util.isObject(message.variables)) + return "variables: object expected"; + var key = Object.keys(message.variables); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.variables[key[i]])) + return "variables: string{k:string} expected"; + } + if (message.secretVariables != null && message.hasOwnProperty("secretVariables")) { + if (!$util.isObject(message.secretVariables)) + return "secretVariables: object expected"; + var key = Object.keys(message.secretVariables); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.secretVariables[key[i]])) + return "secretVariables: string{k:string} expected"; + } + if (message.encryptedVariables != null && message.hasOwnProperty("encryptedVariables")) { + var error = $root.google.cloud.batch.v1alpha.Environment.KMSEnvMap.verify(message.encryptedVariables); + if (error) + return "encryptedVariables." + error; + } + return null; + }; + + /** + * Creates an Environment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.Environment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.Environment} Environment + */ + Environment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.Environment) + return object; + var message = new $root.google.cloud.batch.v1alpha.Environment(); + if (object.variables) { + if (typeof object.variables !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Environment.variables: object expected"); + message.variables = {}; + for (var keys = Object.keys(object.variables), i = 0; i < keys.length; ++i) + message.variables[keys[i]] = String(object.variables[keys[i]]); + } + if (object.secretVariables) { + if (typeof object.secretVariables !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Environment.secretVariables: object expected"); + message.secretVariables = {}; + for (var keys = Object.keys(object.secretVariables), i = 0; i < keys.length; ++i) + message.secretVariables[keys[i]] = String(object.secretVariables[keys[i]]); + } + if (object.encryptedVariables != null) { + if (typeof object.encryptedVariables !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Environment.encryptedVariables: object expected"); + message.encryptedVariables = $root.google.cloud.batch.v1alpha.Environment.KMSEnvMap.fromObject(object.encryptedVariables); + } + return message; + }; + + /** + * Creates a plain object from an Environment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.Environment + * @static + * @param {google.cloud.batch.v1alpha.Environment} message Environment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Environment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.variables = {}; + object.secretVariables = {}; + } + if (options.defaults) + object.encryptedVariables = null; + var keys2; + if (message.variables && (keys2 = Object.keys(message.variables)).length) { + object.variables = {}; + for (var j = 0; j < keys2.length; ++j) + object.variables[keys2[j]] = message.variables[keys2[j]]; + } + if (message.secretVariables && (keys2 = Object.keys(message.secretVariables)).length) { + object.secretVariables = {}; + for (var j = 0; j < keys2.length; ++j) + object.secretVariables[keys2[j]] = message.secretVariables[keys2[j]]; + } + if (message.encryptedVariables != null && message.hasOwnProperty("encryptedVariables")) + object.encryptedVariables = $root.google.cloud.batch.v1alpha.Environment.KMSEnvMap.toObject(message.encryptedVariables, options); + return object; + }; + + /** + * Converts this Environment to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.Environment + * @instance + * @returns {Object.} JSON object + */ + Environment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Environment + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.Environment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Environment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.Environment"; + }; + + Environment.KMSEnvMap = (function() { + + /** + * Properties of a KMSEnvMap. + * @memberof google.cloud.batch.v1alpha.Environment + * @interface IKMSEnvMap + * @property {string|null} [keyName] KMSEnvMap keyName + * @property {string|null} [cipherText] KMSEnvMap cipherText + */ + + /** + * Constructs a new KMSEnvMap. + * @memberof google.cloud.batch.v1alpha.Environment + * @classdesc Represents a KMSEnvMap. + * @implements IKMSEnvMap + * @constructor + * @param {google.cloud.batch.v1alpha.Environment.IKMSEnvMap=} [properties] Properties to set + */ + function KMSEnvMap(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KMSEnvMap keyName. + * @member {string} keyName + * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap + * @instance + */ + KMSEnvMap.prototype.keyName = ""; + + /** + * KMSEnvMap cipherText. + * @member {string} cipherText + * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap + * @instance + */ + KMSEnvMap.prototype.cipherText = ""; + + /** + * Creates a new KMSEnvMap instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap + * @static + * @param {google.cloud.batch.v1alpha.Environment.IKMSEnvMap=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.Environment.KMSEnvMap} KMSEnvMap instance + */ + KMSEnvMap.create = function create(properties) { + return new KMSEnvMap(properties); + }; + + /** + * Encodes the specified KMSEnvMap message. Does not implicitly {@link google.cloud.batch.v1alpha.Environment.KMSEnvMap.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap + * @static + * @param {google.cloud.batch.v1alpha.Environment.IKMSEnvMap} message KMSEnvMap message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KMSEnvMap.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keyName != null && Object.hasOwnProperty.call(message, "keyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.keyName); + if (message.cipherText != null && Object.hasOwnProperty.call(message, "cipherText")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.cipherText); + return writer; + }; + + /** + * Encodes the specified KMSEnvMap message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Environment.KMSEnvMap.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap + * @static + * @param {google.cloud.batch.v1alpha.Environment.IKMSEnvMap} message KMSEnvMap message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KMSEnvMap.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KMSEnvMap message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.Environment.KMSEnvMap} KMSEnvMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KMSEnvMap.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Environment.KMSEnvMap(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.keyName = reader.string(); + break; + } + case 2: { + message.cipherText = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KMSEnvMap message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.Environment.KMSEnvMap} KMSEnvMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KMSEnvMap.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KMSEnvMap message. + * @function verify + * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KMSEnvMap.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keyName != null && message.hasOwnProperty("keyName")) + if (!$util.isString(message.keyName)) + return "keyName: string expected"; + if (message.cipherText != null && message.hasOwnProperty("cipherText")) + if (!$util.isString(message.cipherText)) + return "cipherText: string expected"; + return null; + }; + + /** + * Creates a KMSEnvMap message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.Environment.KMSEnvMap} KMSEnvMap + */ + KMSEnvMap.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.Environment.KMSEnvMap) + return object; + var message = new $root.google.cloud.batch.v1alpha.Environment.KMSEnvMap(); + if (object.keyName != null) + message.keyName = String(object.keyName); + if (object.cipherText != null) + message.cipherText = String(object.cipherText); + return message; + }; + + /** + * Creates a plain object from a KMSEnvMap message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap + * @static + * @param {google.cloud.batch.v1alpha.Environment.KMSEnvMap} message KMSEnvMap + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KMSEnvMap.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.keyName = ""; + object.cipherText = ""; + } + if (message.keyName != null && message.hasOwnProperty("keyName")) + object.keyName = message.keyName; + if (message.cipherText != null && message.hasOwnProperty("cipherText")) + object.cipherText = message.cipherText; + return object; + }; + + /** + * Converts this KMSEnvMap to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap + * @instance + * @returns {Object.} JSON object + */ + KMSEnvMap.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KMSEnvMap + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KMSEnvMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.Environment.KMSEnvMap"; + }; + + return KMSEnvMap; + })(); + + return Environment; + })(); + + v1alpha.Volume = (function() { + + /** + * Properties of a Volume. + * @memberof google.cloud.batch.v1alpha + * @interface IVolume + * @property {google.cloud.batch.v1alpha.INFS|null} [nfs] Volume nfs + * @property {google.cloud.batch.v1alpha.IPD|null} [pd] Volume pd + * @property {google.cloud.batch.v1alpha.IGCS|null} [gcs] Volume gcs + * @property {string|null} [deviceName] Volume deviceName + * @property {string|null} [mountPath] Volume mountPath + * @property {Array.|null} [mountOptions] Volume mountOptions + */ + + /** + * Constructs a new Volume. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a Volume. + * @implements IVolume + * @constructor + * @param {google.cloud.batch.v1alpha.IVolume=} [properties] Properties to set + */ + function Volume(properties) { + this.mountOptions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Volume nfs. + * @member {google.cloud.batch.v1alpha.INFS|null|undefined} nfs + * @memberof google.cloud.batch.v1alpha.Volume + * @instance + */ + Volume.prototype.nfs = null; + + /** + * Volume pd. + * @member {google.cloud.batch.v1alpha.IPD|null|undefined} pd + * @memberof google.cloud.batch.v1alpha.Volume + * @instance + */ + Volume.prototype.pd = null; + + /** + * Volume gcs. + * @member {google.cloud.batch.v1alpha.IGCS|null|undefined} gcs + * @memberof google.cloud.batch.v1alpha.Volume + * @instance + */ + Volume.prototype.gcs = null; + + /** + * Volume deviceName. + * @member {string|null|undefined} deviceName + * @memberof google.cloud.batch.v1alpha.Volume + * @instance + */ + Volume.prototype.deviceName = null; + + /** + * Volume mountPath. + * @member {string} mountPath + * @memberof google.cloud.batch.v1alpha.Volume + * @instance + */ + Volume.prototype.mountPath = ""; + + /** + * Volume mountOptions. + * @member {Array.} mountOptions + * @memberof google.cloud.batch.v1alpha.Volume + * @instance + */ + Volume.prototype.mountOptions = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Volume source. + * @member {"nfs"|"pd"|"gcs"|"deviceName"|undefined} source + * @memberof google.cloud.batch.v1alpha.Volume + * @instance + */ + Object.defineProperty(Volume.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["nfs", "pd", "gcs", "deviceName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Volume instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.Volume + * @static + * @param {google.cloud.batch.v1alpha.IVolume=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.Volume} Volume instance + */ + Volume.create = function create(properties) { + return new Volume(properties); + }; + + /** + * Encodes the specified Volume message. Does not implicitly {@link google.cloud.batch.v1alpha.Volume.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.Volume + * @static + * @param {google.cloud.batch.v1alpha.IVolume} message Volume message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Volume.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nfs != null && Object.hasOwnProperty.call(message, "nfs")) + $root.google.cloud.batch.v1alpha.NFS.encode(message.nfs, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pd != null && Object.hasOwnProperty.call(message, "pd")) + $root.google.cloud.batch.v1alpha.PD.encode(message.pd, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.gcs != null && Object.hasOwnProperty.call(message, "gcs")) + $root.google.cloud.batch.v1alpha.GCS.encode(message.gcs, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.mountPath != null && Object.hasOwnProperty.call(message, "mountPath")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.mountPath); + if (message.mountOptions != null && message.mountOptions.length) + for (var i = 0; i < message.mountOptions.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.mountOptions[i]); + if (message.deviceName != null && Object.hasOwnProperty.call(message, "deviceName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.deviceName); + return writer; + }; + + /** + * Encodes the specified Volume message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Volume.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.Volume + * @static + * @param {google.cloud.batch.v1alpha.IVolume} message Volume message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Volume.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Volume message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.Volume + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.Volume} Volume + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Volume.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Volume(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nfs = $root.google.cloud.batch.v1alpha.NFS.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pd = $root.google.cloud.batch.v1alpha.PD.decode(reader, reader.uint32()); + break; + } + case 3: { + message.gcs = $root.google.cloud.batch.v1alpha.GCS.decode(reader, reader.uint32()); + break; + } + case 6: { + message.deviceName = reader.string(); + break; + } + case 4: { + message.mountPath = reader.string(); + break; + } + case 5: { + if (!(message.mountOptions && message.mountOptions.length)) + message.mountOptions = []; + message.mountOptions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Volume message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.Volume + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.Volume} Volume + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Volume.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Volume message. + * @function verify + * @memberof google.cloud.batch.v1alpha.Volume + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Volume.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nfs != null && message.hasOwnProperty("nfs")) { + properties.source = 1; + { + var error = $root.google.cloud.batch.v1alpha.NFS.verify(message.nfs); + if (error) + return "nfs." + error; + } + } + if (message.pd != null && message.hasOwnProperty("pd")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.batch.v1alpha.PD.verify(message.pd); + if (error) + return "pd." + error; + } + } + if (message.gcs != null && message.hasOwnProperty("gcs")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.batch.v1alpha.GCS.verify(message.gcs); + if (error) + return "gcs." + error; + } + } + if (message.deviceName != null && message.hasOwnProperty("deviceName")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!$util.isString(message.deviceName)) + return "deviceName: string expected"; + } + if (message.mountPath != null && message.hasOwnProperty("mountPath")) + if (!$util.isString(message.mountPath)) + return "mountPath: string expected"; + if (message.mountOptions != null && message.hasOwnProperty("mountOptions")) { + if (!Array.isArray(message.mountOptions)) + return "mountOptions: array expected"; + for (var i = 0; i < message.mountOptions.length; ++i) + if (!$util.isString(message.mountOptions[i])) + return "mountOptions: string[] expected"; + } + return null; + }; + + /** + * Creates a Volume message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.Volume + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.Volume} Volume + */ + Volume.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.Volume) + return object; + var message = new $root.google.cloud.batch.v1alpha.Volume(); + if (object.nfs != null) { + if (typeof object.nfs !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Volume.nfs: object expected"); + message.nfs = $root.google.cloud.batch.v1alpha.NFS.fromObject(object.nfs); + } + if (object.pd != null) { + if (typeof object.pd !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Volume.pd: object expected"); + message.pd = $root.google.cloud.batch.v1alpha.PD.fromObject(object.pd); + } + if (object.gcs != null) { + if (typeof object.gcs !== "object") + throw TypeError(".google.cloud.batch.v1alpha.Volume.gcs: object expected"); + message.gcs = $root.google.cloud.batch.v1alpha.GCS.fromObject(object.gcs); + } + if (object.deviceName != null) + message.deviceName = String(object.deviceName); + if (object.mountPath != null) + message.mountPath = String(object.mountPath); + if (object.mountOptions) { + if (!Array.isArray(object.mountOptions)) + throw TypeError(".google.cloud.batch.v1alpha.Volume.mountOptions: array expected"); + message.mountOptions = []; + for (var i = 0; i < object.mountOptions.length; ++i) + message.mountOptions[i] = String(object.mountOptions[i]); + } + return message; + }; + + /** + * Creates a plain object from a Volume message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.Volume + * @static + * @param {google.cloud.batch.v1alpha.Volume} message Volume + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Volume.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.mountOptions = []; + if (options.defaults) + object.mountPath = ""; + if (message.nfs != null && message.hasOwnProperty("nfs")) { + object.nfs = $root.google.cloud.batch.v1alpha.NFS.toObject(message.nfs, options); + if (options.oneofs) + object.source = "nfs"; + } + if (message.pd != null && message.hasOwnProperty("pd")) { + object.pd = $root.google.cloud.batch.v1alpha.PD.toObject(message.pd, options); + if (options.oneofs) + object.source = "pd"; + } + if (message.gcs != null && message.hasOwnProperty("gcs")) { + object.gcs = $root.google.cloud.batch.v1alpha.GCS.toObject(message.gcs, options); + if (options.oneofs) + object.source = "gcs"; + } + if (message.mountPath != null && message.hasOwnProperty("mountPath")) + object.mountPath = message.mountPath; + if (message.mountOptions && message.mountOptions.length) { + object.mountOptions = []; + for (var j = 0; j < message.mountOptions.length; ++j) + object.mountOptions[j] = message.mountOptions[j]; + } + if (message.deviceName != null && message.hasOwnProperty("deviceName")) { + object.deviceName = message.deviceName; + if (options.oneofs) + object.source = "deviceName"; + } + return object; + }; + + /** + * Converts this Volume to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.Volume + * @instance + * @returns {Object.} JSON object + */ + Volume.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Volume + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.Volume + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Volume.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.Volume"; + }; + + return Volume; + })(); + + v1alpha.NFS = (function() { + + /** + * Properties of a NFS. + * @memberof google.cloud.batch.v1alpha + * @interface INFS + * @property {string|null} [server] NFS server + * @property {string|null} [remotePath] NFS remotePath + */ + + /** + * Constructs a new NFS. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a NFS. + * @implements INFS + * @constructor + * @param {google.cloud.batch.v1alpha.INFS=} [properties] Properties to set + */ + function NFS(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NFS server. + * @member {string} server + * @memberof google.cloud.batch.v1alpha.NFS + * @instance + */ + NFS.prototype.server = ""; + + /** + * NFS remotePath. + * @member {string} remotePath + * @memberof google.cloud.batch.v1alpha.NFS + * @instance + */ + NFS.prototype.remotePath = ""; + + /** + * Creates a new NFS instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.NFS + * @static + * @param {google.cloud.batch.v1alpha.INFS=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.NFS} NFS instance + */ + NFS.create = function create(properties) { + return new NFS(properties); + }; + + /** + * Encodes the specified NFS message. Does not implicitly {@link google.cloud.batch.v1alpha.NFS.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.NFS + * @static + * @param {google.cloud.batch.v1alpha.INFS} message NFS message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NFS.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.server != null && Object.hasOwnProperty.call(message, "server")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.server); + if (message.remotePath != null && Object.hasOwnProperty.call(message, "remotePath")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.remotePath); + return writer; + }; + + /** + * Encodes the specified NFS message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.NFS.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.NFS + * @static + * @param {google.cloud.batch.v1alpha.INFS} message NFS message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NFS.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NFS message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.NFS + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.NFS} NFS + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NFS.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.NFS(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.server = reader.string(); + break; + } + case 2: { + message.remotePath = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NFS message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.NFS + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.NFS} NFS + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NFS.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NFS message. + * @function verify + * @memberof google.cloud.batch.v1alpha.NFS + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NFS.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.server != null && message.hasOwnProperty("server")) + if (!$util.isString(message.server)) + return "server: string expected"; + if (message.remotePath != null && message.hasOwnProperty("remotePath")) + if (!$util.isString(message.remotePath)) + return "remotePath: string expected"; + return null; + }; + + /** + * Creates a NFS message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.NFS + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.NFS} NFS + */ + NFS.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.NFS) + return object; + var message = new $root.google.cloud.batch.v1alpha.NFS(); + if (object.server != null) + message.server = String(object.server); + if (object.remotePath != null) + message.remotePath = String(object.remotePath); + return message; + }; + + /** + * Creates a plain object from a NFS message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.NFS + * @static + * @param {google.cloud.batch.v1alpha.NFS} message NFS + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NFS.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.server = ""; + object.remotePath = ""; + } + if (message.server != null && message.hasOwnProperty("server")) + object.server = message.server; + if (message.remotePath != null && message.hasOwnProperty("remotePath")) + object.remotePath = message.remotePath; + return object; + }; + + /** + * Converts this NFS to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.NFS + * @instance + * @returns {Object.} JSON object + */ + NFS.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NFS + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.NFS + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NFS.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.NFS"; + }; + + return NFS; + })(); + + v1alpha.PD = (function() { + + /** + * Properties of a PD. + * @memberof google.cloud.batch.v1alpha + * @interface IPD + * @property {string|null} [disk] PD disk + * @property {string|null} [device] PD device + * @property {boolean|null} [existing] PD existing + */ + + /** + * Constructs a new PD. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a PD. + * @implements IPD + * @constructor + * @param {google.cloud.batch.v1alpha.IPD=} [properties] Properties to set + */ + function PD(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PD disk. + * @member {string} disk + * @memberof google.cloud.batch.v1alpha.PD + * @instance + */ + PD.prototype.disk = ""; + + /** + * PD device. + * @member {string} device + * @memberof google.cloud.batch.v1alpha.PD + * @instance + */ + PD.prototype.device = ""; + + /** + * PD existing. + * @member {boolean} existing + * @memberof google.cloud.batch.v1alpha.PD + * @instance + */ + PD.prototype.existing = false; + + /** + * Creates a new PD instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.PD + * @static + * @param {google.cloud.batch.v1alpha.IPD=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.PD} PD instance + */ + PD.create = function create(properties) { + return new PD(properties); + }; + + /** + * Encodes the specified PD message. Does not implicitly {@link google.cloud.batch.v1alpha.PD.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.PD + * @static + * @param {google.cloud.batch.v1alpha.IPD} message PD message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PD.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.disk != null && Object.hasOwnProperty.call(message, "disk")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.disk); + if (message.device != null && Object.hasOwnProperty.call(message, "device")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.device); + if (message.existing != null && Object.hasOwnProperty.call(message, "existing")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.existing); + return writer; + }; + + /** + * Encodes the specified PD message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.PD.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.PD + * @static + * @param {google.cloud.batch.v1alpha.IPD} message PD message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PD.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PD message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.PD + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.PD} PD + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PD.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.PD(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.disk = reader.string(); + break; + } + case 2: { + message.device = reader.string(); + break; + } + case 3: { + message.existing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PD message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.PD + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.PD} PD + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PD.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PD message. + * @function verify + * @memberof google.cloud.batch.v1alpha.PD + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PD.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.disk != null && message.hasOwnProperty("disk")) + if (!$util.isString(message.disk)) + return "disk: string expected"; + if (message.device != null && message.hasOwnProperty("device")) + if (!$util.isString(message.device)) + return "device: string expected"; + if (message.existing != null && message.hasOwnProperty("existing")) + if (typeof message.existing !== "boolean") + return "existing: boolean expected"; + return null; + }; + + /** + * Creates a PD message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.PD + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.PD} PD + */ + PD.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.PD) + return object; + var message = new $root.google.cloud.batch.v1alpha.PD(); + if (object.disk != null) + message.disk = String(object.disk); + if (object.device != null) + message.device = String(object.device); + if (object.existing != null) + message.existing = Boolean(object.existing); + return message; + }; + + /** + * Creates a plain object from a PD message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.PD + * @static + * @param {google.cloud.batch.v1alpha.PD} message PD + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PD.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.disk = ""; + object.device = ""; + object.existing = false; + } + if (message.disk != null && message.hasOwnProperty("disk")) + object.disk = message.disk; + if (message.device != null && message.hasOwnProperty("device")) + object.device = message.device; + if (message.existing != null && message.hasOwnProperty("existing")) + object.existing = message.existing; + return object; + }; + + /** + * Converts this PD to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.PD + * @instance + * @returns {Object.} JSON object + */ + PD.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PD + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.PD + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PD.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.PD"; + }; + + return PD; + })(); + + v1alpha.GCS = (function() { + + /** + * Properties of a GCS. + * @memberof google.cloud.batch.v1alpha + * @interface IGCS + * @property {string|null} [remotePath] GCS remotePath + */ + + /** + * Constructs a new GCS. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a GCS. + * @implements IGCS + * @constructor + * @param {google.cloud.batch.v1alpha.IGCS=} [properties] Properties to set + */ + function GCS(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GCS remotePath. + * @member {string} remotePath + * @memberof google.cloud.batch.v1alpha.GCS + * @instance + */ + GCS.prototype.remotePath = ""; + + /** + * Creates a new GCS instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.GCS + * @static + * @param {google.cloud.batch.v1alpha.IGCS=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.GCS} GCS instance + */ + GCS.create = function create(properties) { + return new GCS(properties); + }; + + /** + * Encodes the specified GCS message. Does not implicitly {@link google.cloud.batch.v1alpha.GCS.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.GCS + * @static + * @param {google.cloud.batch.v1alpha.IGCS} message GCS message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GCS.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.remotePath != null && Object.hasOwnProperty.call(message, "remotePath")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.remotePath); + return writer; + }; + + /** + * Encodes the specified GCS message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.GCS.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.GCS + * @static + * @param {google.cloud.batch.v1alpha.IGCS} message GCS message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GCS.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GCS message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.GCS + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.GCS} GCS + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GCS.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.GCS(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.remotePath = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GCS message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.GCS + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.GCS} GCS + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GCS.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GCS message. + * @function verify + * @memberof google.cloud.batch.v1alpha.GCS + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GCS.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.remotePath != null && message.hasOwnProperty("remotePath")) + if (!$util.isString(message.remotePath)) + return "remotePath: string expected"; + return null; + }; + + /** + * Creates a GCS message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.GCS + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.GCS} GCS + */ + GCS.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.GCS) + return object; + var message = new $root.google.cloud.batch.v1alpha.GCS(); + if (object.remotePath != null) + message.remotePath = String(object.remotePath); + return message; + }; + + /** + * Creates a plain object from a GCS message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.GCS + * @static + * @param {google.cloud.batch.v1alpha.GCS} message GCS + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GCS.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.remotePath = ""; + if (message.remotePath != null && message.hasOwnProperty("remotePath")) + object.remotePath = message.remotePath; + return object; + }; + + /** + * Converts this GCS to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.GCS + * @instance + * @returns {Object.} JSON object + */ + GCS.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GCS + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.GCS + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GCS.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.GCS"; + }; + + return GCS; + })(); + + /** + * CalendarPeriod enum. + * @name google.cloud.batch.v1alpha.CalendarPeriod + * @enum {number} + * @property {number} CALENDAR_PERIOD_UNSPECIFIED=0 CALENDAR_PERIOD_UNSPECIFIED value + * @property {number} MONTH=1 MONTH value + * @property {number} QUARTER=2 QUARTER value + * @property {number} YEAR=3 YEAR value + * @property {number} WEEK=4 WEEK value + * @property {number} DAY=5 DAY value + */ + v1alpha.CalendarPeriod = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CALENDAR_PERIOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "MONTH"] = 1; + values[valuesById[2] = "QUARTER"] = 2; + values[valuesById[3] = "YEAR"] = 3; + values[valuesById[4] = "WEEK"] = 4; + values[valuesById[5] = "DAY"] = 5; + return values; + })(); + + /** + * ResourceAllowanceState enum. + * @name google.cloud.batch.v1alpha.ResourceAllowanceState + * @enum {number} + * @property {number} RESOURCE_ALLOWANCE_STATE_UNSPECIFIED=0 RESOURCE_ALLOWANCE_STATE_UNSPECIFIED value + * @property {number} RESOURCE_ALLOWANCE_ACTIVE=1 RESOURCE_ALLOWANCE_ACTIVE value + * @property {number} RESOURCE_ALLOWANCE_DEPLETED=2 RESOURCE_ALLOWANCE_DEPLETED value + */ + v1alpha.ResourceAllowanceState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESOURCE_ALLOWANCE_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESOURCE_ALLOWANCE_ACTIVE"] = 1; + values[valuesById[2] = "RESOURCE_ALLOWANCE_DEPLETED"] = 2; + return values; + })(); + + v1alpha.ResourceAllowance = (function() { + + /** + * Properties of a ResourceAllowance. + * @memberof google.cloud.batch.v1alpha + * @interface IResourceAllowance + * @property {google.cloud.batch.v1alpha.IUsageResourceAllowance|null} [usageResourceAllowance] ResourceAllowance usageResourceAllowance + * @property {string|null} [name] ResourceAllowance name + * @property {string|null} [uid] ResourceAllowance uid + * @property {google.protobuf.ITimestamp|null} [createTime] ResourceAllowance createTime + * @property {Object.|null} [labels] ResourceAllowance labels + * @property {Array.|null} [notifications] ResourceAllowance notifications + */ + + /** + * Constructs a new ResourceAllowance. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a ResourceAllowance. + * @implements IResourceAllowance + * @constructor + * @param {google.cloud.batch.v1alpha.IResourceAllowance=} [properties] Properties to set + */ + function ResourceAllowance(properties) { + this.labels = {}; + this.notifications = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceAllowance usageResourceAllowance. + * @member {google.cloud.batch.v1alpha.IUsageResourceAllowance|null|undefined} usageResourceAllowance + * @memberof google.cloud.batch.v1alpha.ResourceAllowance + * @instance + */ + ResourceAllowance.prototype.usageResourceAllowance = null; + + /** + * ResourceAllowance name. + * @member {string} name + * @memberof google.cloud.batch.v1alpha.ResourceAllowance + * @instance + */ + ResourceAllowance.prototype.name = ""; + + /** + * ResourceAllowance uid. + * @member {string} uid + * @memberof google.cloud.batch.v1alpha.ResourceAllowance + * @instance + */ + ResourceAllowance.prototype.uid = ""; + + /** + * ResourceAllowance createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.batch.v1alpha.ResourceAllowance + * @instance + */ + ResourceAllowance.prototype.createTime = null; + + /** + * ResourceAllowance labels. + * @member {Object.} labels + * @memberof google.cloud.batch.v1alpha.ResourceAllowance + * @instance + */ + ResourceAllowance.prototype.labels = $util.emptyObject; + + /** + * ResourceAllowance notifications. + * @member {Array.} notifications + * @memberof google.cloud.batch.v1alpha.ResourceAllowance + * @instance + */ + ResourceAllowance.prototype.notifications = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResourceAllowance resourceAllowance. + * @member {"usageResourceAllowance"|undefined} resourceAllowance + * @memberof google.cloud.batch.v1alpha.ResourceAllowance + * @instance + */ + Object.defineProperty(ResourceAllowance.prototype, "resourceAllowance", { + get: $util.oneOfGetter($oneOfFields = ["usageResourceAllowance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResourceAllowance instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.ResourceAllowance + * @static + * @param {google.cloud.batch.v1alpha.IResourceAllowance=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.ResourceAllowance} ResourceAllowance instance + */ + ResourceAllowance.create = function create(properties) { + return new ResourceAllowance(properties); + }; + + /** + * Encodes the specified ResourceAllowance message. Does not implicitly {@link google.cloud.batch.v1alpha.ResourceAllowance.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.ResourceAllowance + * @static + * @param {google.cloud.batch.v1alpha.IResourceAllowance} message ResourceAllowance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceAllowance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.usageResourceAllowance != null && Object.hasOwnProperty.call(message, "usageResourceAllowance")) + $root.google.cloud.batch.v1alpha.UsageResourceAllowance.encode(message.usageResourceAllowance, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.notifications != null && message.notifications.length) + for (var i = 0; i < message.notifications.length; ++i) + $root.google.cloud.batch.v1alpha.Notification.encode(message.notifications[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResourceAllowance message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ResourceAllowance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.ResourceAllowance + * @static + * @param {google.cloud.batch.v1alpha.IResourceAllowance} message ResourceAllowance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceAllowance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceAllowance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.ResourceAllowance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.ResourceAllowance} ResourceAllowance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceAllowance.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ResourceAllowance(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.usageResourceAllowance = $root.google.cloud.batch.v1alpha.UsageResourceAllowance.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.uid = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 6: { + if (!(message.notifications && message.notifications.length)) + message.notifications = []; + message.notifications.push($root.google.cloud.batch.v1alpha.Notification.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceAllowance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.ResourceAllowance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.ResourceAllowance} ResourceAllowance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceAllowance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceAllowance message. + * @function verify + * @memberof google.cloud.batch.v1alpha.ResourceAllowance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceAllowance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.usageResourceAllowance != null && message.hasOwnProperty("usageResourceAllowance")) { + properties.resourceAllowance = 1; + { + var error = $root.google.cloud.batch.v1alpha.UsageResourceAllowance.verify(message.usageResourceAllowance); + if (error) + return "usageResourceAllowance." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.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.notifications != null && message.hasOwnProperty("notifications")) { + if (!Array.isArray(message.notifications)) + return "notifications: array expected"; + for (var i = 0; i < message.notifications.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.Notification.verify(message.notifications[i]); + if (error) + return "notifications." + error; + } + } + return null; + }; + + /** + * Creates a ResourceAllowance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.ResourceAllowance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.ResourceAllowance} ResourceAllowance + */ + ResourceAllowance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.ResourceAllowance) + return object; + var message = new $root.google.cloud.batch.v1alpha.ResourceAllowance(); + if (object.usageResourceAllowance != null) { + if (typeof object.usageResourceAllowance !== "object") + throw TypeError(".google.cloud.batch.v1alpha.ResourceAllowance.usageResourceAllowance: object expected"); + message.usageResourceAllowance = $root.google.cloud.batch.v1alpha.UsageResourceAllowance.fromObject(object.usageResourceAllowance); + } + if (object.name != null) + message.name = String(object.name); + if (object.uid != null) + message.uid = String(object.uid); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.batch.v1alpha.ResourceAllowance.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.batch.v1alpha.ResourceAllowance.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.notifications) { + if (!Array.isArray(object.notifications)) + throw TypeError(".google.cloud.batch.v1alpha.ResourceAllowance.notifications: array expected"); + message.notifications = []; + for (var i = 0; i < object.notifications.length; ++i) { + if (typeof object.notifications[i] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.ResourceAllowance.notifications: object expected"); + message.notifications[i] = $root.google.cloud.batch.v1alpha.Notification.fromObject(object.notifications[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceAllowance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.ResourceAllowance + * @static + * @param {google.cloud.batch.v1alpha.ResourceAllowance} message ResourceAllowance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceAllowance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.notifications = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.uid = ""; + object.createTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.usageResourceAllowance != null && message.hasOwnProperty("usageResourceAllowance")) { + object.usageResourceAllowance = $root.google.cloud.batch.v1alpha.UsageResourceAllowance.toObject(message.usageResourceAllowance, options); + if (options.oneofs) + object.resourceAllowance = "usageResourceAllowance"; + } + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.notifications && message.notifications.length) { + object.notifications = []; + for (var j = 0; j < message.notifications.length; ++j) + object.notifications[j] = $root.google.cloud.batch.v1alpha.Notification.toObject(message.notifications[j], options); + } + return object; + }; + + /** + * Converts this ResourceAllowance to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.ResourceAllowance + * @instance + * @returns {Object.} JSON object + */ + ResourceAllowance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceAllowance + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.ResourceAllowance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceAllowance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.ResourceAllowance"; + }; + + return ResourceAllowance; + })(); + + v1alpha.UsageResourceAllowance = (function() { + + /** + * Properties of a UsageResourceAllowance. + * @memberof google.cloud.batch.v1alpha + * @interface IUsageResourceAllowance + * @property {google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec|null} [spec] UsageResourceAllowance spec + * @property {google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus|null} [status] UsageResourceAllowance status + */ + + /** + * Constructs a new UsageResourceAllowance. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a UsageResourceAllowance. + * @implements IUsageResourceAllowance + * @constructor + * @param {google.cloud.batch.v1alpha.IUsageResourceAllowance=} [properties] Properties to set + */ + function UsageResourceAllowance(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UsageResourceAllowance spec. + * @member {google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec|null|undefined} spec + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance + * @instance + */ + UsageResourceAllowance.prototype.spec = null; + + /** + * UsageResourceAllowance status. + * @member {google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus|null|undefined} status + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance + * @instance + */ + UsageResourceAllowance.prototype.status = null; + + /** + * Creates a new UsageResourceAllowance instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance + * @static + * @param {google.cloud.batch.v1alpha.IUsageResourceAllowance=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowance} UsageResourceAllowance instance + */ + UsageResourceAllowance.create = function create(properties) { + return new UsageResourceAllowance(properties); + }; + + /** + * Encodes the specified UsageResourceAllowance message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowance.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance + * @static + * @param {google.cloud.batch.v1alpha.IUsageResourceAllowance} message UsageResourceAllowance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UsageResourceAllowance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.spec != null && Object.hasOwnProperty.call(message, "spec")) + $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.encode(message.spec, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UsageResourceAllowance message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance + * @static + * @param {google.cloud.batch.v1alpha.IUsageResourceAllowance} message UsageResourceAllowance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UsageResourceAllowance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UsageResourceAllowance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowance} UsageResourceAllowance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UsageResourceAllowance.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowance(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.spec = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.decode(reader, reader.uint32()); + break; + } + case 2: { + message.status = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UsageResourceAllowance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowance} UsageResourceAllowance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UsageResourceAllowance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UsageResourceAllowance message. + * @function verify + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UsageResourceAllowance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.spec != null && message.hasOwnProperty("spec")) { + var error = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.verify(message.spec); + if (error) + return "spec." + error; + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.verify(message.status); + if (error) + return "status." + error; + } + return null; + }; + + /** + * Creates a UsageResourceAllowance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowance} UsageResourceAllowance + */ + UsageResourceAllowance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.UsageResourceAllowance) + return object; + var message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowance(); + if (object.spec != null) { + if (typeof object.spec !== "object") + throw TypeError(".google.cloud.batch.v1alpha.UsageResourceAllowance.spec: object expected"); + message.spec = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.fromObject(object.spec); + } + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.batch.v1alpha.UsageResourceAllowance.status: object expected"); + message.status = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.fromObject(object.status); + } + return message; + }; + + /** + * Creates a plain object from a UsageResourceAllowance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowance} message UsageResourceAllowance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UsageResourceAllowance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.spec = null; + object.status = null; + } + if (message.spec != null && message.hasOwnProperty("spec")) + object.spec = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.toObject(message.spec, options); + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.toObject(message.status, options); + return object; + }; + + /** + * Converts this UsageResourceAllowance to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance + * @instance + * @returns {Object.} JSON object + */ + UsageResourceAllowance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UsageResourceAllowance + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UsageResourceAllowance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.UsageResourceAllowance"; + }; + + return UsageResourceAllowance; + })(); + + v1alpha.UsageResourceAllowanceSpec = (function() { + + /** + * Properties of a UsageResourceAllowanceSpec. + * @memberof google.cloud.batch.v1alpha + * @interface IUsageResourceAllowanceSpec + * @property {string|null} [type] UsageResourceAllowanceSpec type + * @property {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit|null} [limit] UsageResourceAllowanceSpec limit + */ + + /** + * Constructs a new UsageResourceAllowanceSpec. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a UsageResourceAllowanceSpec. + * @implements IUsageResourceAllowanceSpec + * @constructor + * @param {google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec=} [properties] Properties to set + */ + function UsageResourceAllowanceSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UsageResourceAllowanceSpec type. + * @member {string} type + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec + * @instance + */ + UsageResourceAllowanceSpec.prototype.type = ""; + + /** + * UsageResourceAllowanceSpec limit. + * @member {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit|null|undefined} limit + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec + * @instance + */ + UsageResourceAllowanceSpec.prototype.limit = null; + + /** + * Creates a new UsageResourceAllowanceSpec instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec + * @static + * @param {google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec} UsageResourceAllowanceSpec instance + */ + UsageResourceAllowanceSpec.create = function create(properties) { + return new UsageResourceAllowanceSpec(properties); + }; + + /** + * Encodes the specified UsageResourceAllowanceSpec message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec + * @static + * @param {google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec} message UsageResourceAllowanceSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UsageResourceAllowanceSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit.encode(message.limit, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UsageResourceAllowanceSpec message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec + * @static + * @param {google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec} message UsageResourceAllowanceSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UsageResourceAllowanceSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UsageResourceAllowanceSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec} UsageResourceAllowanceSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UsageResourceAllowanceSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.limit = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UsageResourceAllowanceSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec} UsageResourceAllowanceSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UsageResourceAllowanceSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UsageResourceAllowanceSpec message. + * @function verify + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UsageResourceAllowanceSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.limit != null && message.hasOwnProperty("limit")) { + var error = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit.verify(message.limit); + if (error) + return "limit." + error; + } + return null; + }; + + /** + * Creates a UsageResourceAllowanceSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec} UsageResourceAllowanceSpec + */ + UsageResourceAllowanceSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec) + return object; + var message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec(); + if (object.type != null) + message.type = String(object.type); + if (object.limit != null) { + if (typeof object.limit !== "object") + throw TypeError(".google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.limit: object expected"); + message.limit = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit.fromObject(object.limit); + } + return message; + }; + + /** + * Creates a plain object from a UsageResourceAllowanceSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec} message UsageResourceAllowanceSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UsageResourceAllowanceSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.limit = null; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit.toObject(message.limit, options); + return object; + }; + + /** + * Converts this UsageResourceAllowanceSpec to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec + * @instance + * @returns {Object.} JSON object + */ + UsageResourceAllowanceSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UsageResourceAllowanceSpec + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UsageResourceAllowanceSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.UsageResourceAllowanceSpec"; + }; + + UsageResourceAllowanceSpec.Limit = (function() { + + /** + * Properties of a Limit. + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec + * @interface ILimit + * @property {google.cloud.batch.v1alpha.CalendarPeriod|null} [calendarPeriod] Limit calendarPeriod + * @property {number|null} [limit] Limit limit + */ + + /** + * Constructs a new Limit. + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec + * @classdesc Represents a Limit. + * @implements ILimit + * @constructor + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit=} [properties] Properties to set + */ + function Limit(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Limit calendarPeriod. + * @member {google.cloud.batch.v1alpha.CalendarPeriod|null|undefined} calendarPeriod + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit + * @instance + */ + Limit.prototype.calendarPeriod = null; + + /** + * Limit limit. + * @member {number|null|undefined} limit + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit + * @instance + */ + Limit.prototype.limit = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Limit duration. + * @member {"calendarPeriod"|undefined} duration + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit + * @instance + */ + Object.defineProperty(Limit.prototype, "duration", { + get: $util.oneOfGetter($oneOfFields = ["calendarPeriod"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Limit _limit. + * @member {"limit"|undefined} _limit + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit + * @instance + */ + Object.defineProperty(Limit.prototype, "_limit", { + get: $util.oneOfGetter($oneOfFields = ["limit"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Limit instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit} Limit instance + */ + Limit.create = function create(properties) { + return new Limit(properties); + }; + + /** + * Encodes the specified Limit message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit} message Limit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Limit.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.calendarPeriod != null && Object.hasOwnProperty.call(message, "calendarPeriod")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.calendarPeriod); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.limit); + return writer; + }; + + /** + * Encodes the specified Limit message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit} message Limit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Limit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Limit message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit} Limit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Limit.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.calendarPeriod = reader.int32(); + break; + } + case 2: { + message.limit = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Limit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit} Limit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Limit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Limit message. + * @function verify + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Limit.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.calendarPeriod != null && message.hasOwnProperty("calendarPeriod")) { + properties.duration = 1; + switch (message.calendarPeriod) { + default: + return "calendarPeriod: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + } + if (message.limit != null && message.hasOwnProperty("limit")) { + properties._limit = 1; + if (typeof message.limit !== "number") + return "limit: number expected"; + } + return null; + }; + + /** + * Creates a Limit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit} Limit + */ + Limit.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit) + return object; + var message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit(); + switch (object.calendarPeriod) { + default: + if (typeof object.calendarPeriod === "number") { + message.calendarPeriod = object.calendarPeriod; + break; + } + break; + case "CALENDAR_PERIOD_UNSPECIFIED": + case 0: + message.calendarPeriod = 0; + break; + case "MONTH": + case 1: + message.calendarPeriod = 1; + break; + case "QUARTER": + case 2: + message.calendarPeriod = 2; + break; + case "YEAR": + case 3: + message.calendarPeriod = 3; + break; + case "WEEK": + case 4: + message.calendarPeriod = 4; + break; + case "DAY": + case 5: + message.calendarPeriod = 5; + break; + } + if (object.limit != null) + message.limit = Number(object.limit); + return message; + }; + + /** + * Creates a plain object from a Limit message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit} message Limit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Limit.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.calendarPeriod != null && message.hasOwnProperty("calendarPeriod")) { + object.calendarPeriod = options.enums === String ? $root.google.cloud.batch.v1alpha.CalendarPeriod[message.calendarPeriod] === undefined ? message.calendarPeriod : $root.google.cloud.batch.v1alpha.CalendarPeriod[message.calendarPeriod] : message.calendarPeriod; + if (options.oneofs) + object.duration = "calendarPeriod"; + } + if (message.limit != null && message.hasOwnProperty("limit")) { + object.limit = options.json && !isFinite(message.limit) ? String(message.limit) : message.limit; + if (options.oneofs) + object._limit = "limit"; + } + return object; + }; + + /** + * Converts this Limit to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit + * @instance + * @returns {Object.} JSON object + */ + Limit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Limit + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Limit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit"; + }; + + return Limit; + })(); + + return UsageResourceAllowanceSpec; + })(); + + v1alpha.UsageResourceAllowanceStatus = (function() { + + /** + * Properties of a UsageResourceAllowanceStatus. + * @memberof google.cloud.batch.v1alpha + * @interface IUsageResourceAllowanceStatus + * @property {google.cloud.batch.v1alpha.ResourceAllowanceState|null} [state] UsageResourceAllowanceStatus state + * @property {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus|null} [limitStatus] UsageResourceAllowanceStatus limitStatus + * @property {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport|null} [report] UsageResourceAllowanceStatus report + */ + + /** + * Constructs a new UsageResourceAllowanceStatus. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a UsageResourceAllowanceStatus. + * @implements IUsageResourceAllowanceStatus + * @constructor + * @param {google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus=} [properties] Properties to set + */ + function UsageResourceAllowanceStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UsageResourceAllowanceStatus state. + * @member {google.cloud.batch.v1alpha.ResourceAllowanceState} state + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @instance + */ + UsageResourceAllowanceStatus.prototype.state = 0; + + /** + * UsageResourceAllowanceStatus limitStatus. + * @member {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus|null|undefined} limitStatus + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @instance + */ + UsageResourceAllowanceStatus.prototype.limitStatus = null; + + /** + * UsageResourceAllowanceStatus report. + * @member {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport|null|undefined} report + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @instance + */ + UsageResourceAllowanceStatus.prototype.report = null; + + /** + * Creates a new UsageResourceAllowanceStatus instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @static + * @param {google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus} UsageResourceAllowanceStatus instance + */ + UsageResourceAllowanceStatus.create = function create(properties) { + return new UsageResourceAllowanceStatus(properties); + }; + + /** + * Encodes the specified UsageResourceAllowanceStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @static + * @param {google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus} message UsageResourceAllowanceStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UsageResourceAllowanceStatus.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); + if (message.limitStatus != null && Object.hasOwnProperty.call(message, "limitStatus")) + $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.encode(message.limitStatus, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.report != null && Object.hasOwnProperty.call(message, "report")) + $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.encode(message.report, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UsageResourceAllowanceStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @static + * @param {google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus} message UsageResourceAllowanceStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UsageResourceAllowanceStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UsageResourceAllowanceStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus} UsageResourceAllowanceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UsageResourceAllowanceStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.limitStatus = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.decode(reader, reader.uint32()); + break; + } + case 3: { + message.report = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UsageResourceAllowanceStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus} UsageResourceAllowanceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UsageResourceAllowanceStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UsageResourceAllowanceStatus message. + * @function verify + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UsageResourceAllowanceStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.limitStatus != null && message.hasOwnProperty("limitStatus")) { + var error = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.verify(message.limitStatus); + if (error) + return "limitStatus." + error; + } + if (message.report != null && message.hasOwnProperty("report")) { + var error = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.verify(message.report); + if (error) + return "report." + error; + } + return null; + }; + + /** + * Creates a UsageResourceAllowanceStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus} UsageResourceAllowanceStatus + */ + UsageResourceAllowanceStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus) + return object; + var message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "RESOURCE_ALLOWANCE_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "RESOURCE_ALLOWANCE_ACTIVE": + case 1: + message.state = 1; + break; + case "RESOURCE_ALLOWANCE_DEPLETED": + case 2: + message.state = 2; + break; + } + if (object.limitStatus != null) { + if (typeof object.limitStatus !== "object") + throw TypeError(".google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.limitStatus: object expected"); + message.limitStatus = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.fromObject(object.limitStatus); + } + if (object.report != null) { + if (typeof object.report !== "object") + throw TypeError(".google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.report: object expected"); + message.report = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.fromObject(object.report); + } + return message; + }; + + /** + * Creates a plain object from a UsageResourceAllowanceStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus} message UsageResourceAllowanceStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UsageResourceAllowanceStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "RESOURCE_ALLOWANCE_STATE_UNSPECIFIED" : 0; + object.limitStatus = null; + object.report = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.batch.v1alpha.ResourceAllowanceState[message.state] === undefined ? message.state : $root.google.cloud.batch.v1alpha.ResourceAllowanceState[message.state] : message.state; + if (message.limitStatus != null && message.hasOwnProperty("limitStatus")) + object.limitStatus = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.toObject(message.limitStatus, options); + if (message.report != null && message.hasOwnProperty("report")) + object.report = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.toObject(message.report, options); + return object; + }; + + /** + * Converts this UsageResourceAllowanceStatus to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @instance + * @returns {Object.} JSON object + */ + UsageResourceAllowanceStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UsageResourceAllowanceStatus + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UsageResourceAllowanceStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.UsageResourceAllowanceStatus"; + }; + + UsageResourceAllowanceStatus.LimitStatus = (function() { + + /** + * Properties of a LimitStatus. + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @interface ILimitStatus + * @property {google.type.IInterval|null} [consumptionInterval] LimitStatus consumptionInterval + * @property {number|null} [limit] LimitStatus limit + * @property {number|null} [consumed] LimitStatus consumed + */ + + /** + * Constructs a new LimitStatus. + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @classdesc Represents a LimitStatus. + * @implements ILimitStatus + * @constructor + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus=} [properties] Properties to set + */ + function LimitStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LimitStatus consumptionInterval. + * @member {google.type.IInterval|null|undefined} consumptionInterval + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus + * @instance + */ + LimitStatus.prototype.consumptionInterval = null; + + /** + * LimitStatus limit. + * @member {number|null|undefined} limit + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus + * @instance + */ + LimitStatus.prototype.limit = null; + + /** + * LimitStatus consumed. + * @member {number|null|undefined} consumed + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus + * @instance + */ + LimitStatus.prototype.consumed = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LimitStatus _limit. + * @member {"limit"|undefined} _limit + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus + * @instance + */ + Object.defineProperty(LimitStatus.prototype, "_limit", { + get: $util.oneOfGetter($oneOfFields = ["limit"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * LimitStatus _consumed. + * @member {"consumed"|undefined} _consumed + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus + * @instance + */ + Object.defineProperty(LimitStatus.prototype, "_consumed", { + get: $util.oneOfGetter($oneOfFields = ["consumed"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LimitStatus instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus} LimitStatus instance + */ + LimitStatus.create = function create(properties) { + return new LimitStatus(properties); + }; + + /** + * Encodes the specified LimitStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus} message LimitStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LimitStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.consumptionInterval != null && Object.hasOwnProperty.call(message, "consumptionInterval")) + $root.google.type.Interval.encode(message.consumptionInterval, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.limit); + if (message.consumed != null && Object.hasOwnProperty.call(message, "consumed")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.consumed); + return writer; + }; + + /** + * Encodes the specified LimitStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus} message LimitStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LimitStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LimitStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus} LimitStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LimitStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.consumptionInterval = $root.google.type.Interval.decode(reader, reader.uint32()); + break; + } + case 2: { + message.limit = reader.double(); + break; + } + case 3: { + message.consumed = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LimitStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus} LimitStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LimitStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LimitStatus message. + * @function verify + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LimitStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.consumptionInterval != null && message.hasOwnProperty("consumptionInterval")) { + var error = $root.google.type.Interval.verify(message.consumptionInterval); + if (error) + return "consumptionInterval." + error; + } + if (message.limit != null && message.hasOwnProperty("limit")) { + properties._limit = 1; + if (typeof message.limit !== "number") + return "limit: number expected"; + } + if (message.consumed != null && message.hasOwnProperty("consumed")) { + properties._consumed = 1; + if (typeof message.consumed !== "number") + return "consumed: number expected"; + } + return null; + }; + + /** + * Creates a LimitStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus} LimitStatus + */ + LimitStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus) + return object; + var message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus(); + if (object.consumptionInterval != null) { + if (typeof object.consumptionInterval !== "object") + throw TypeError(".google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.consumptionInterval: object expected"); + message.consumptionInterval = $root.google.type.Interval.fromObject(object.consumptionInterval); + } + if (object.limit != null) + message.limit = Number(object.limit); + if (object.consumed != null) + message.consumed = Number(object.consumed); + return message; + }; + + /** + * Creates a plain object from a LimitStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus} message LimitStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LimitStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.consumptionInterval = null; + if (message.consumptionInterval != null && message.hasOwnProperty("consumptionInterval")) + object.consumptionInterval = $root.google.type.Interval.toObject(message.consumptionInterval, options); + if (message.limit != null && message.hasOwnProperty("limit")) { + object.limit = options.json && !isFinite(message.limit) ? String(message.limit) : message.limit; + if (options.oneofs) + object._limit = "limit"; + } + if (message.consumed != null && message.hasOwnProperty("consumed")) { + object.consumed = options.json && !isFinite(message.consumed) ? String(message.consumed) : message.consumed; + if (options.oneofs) + object._consumed = "consumed"; + } + return object; + }; + + /** + * Converts this LimitStatus to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus + * @instance + * @returns {Object.} JSON object + */ + LimitStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LimitStatus + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LimitStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus"; + }; + + return LimitStatus; + })(); + + UsageResourceAllowanceStatus.PeriodConsumption = (function() { + + /** + * Properties of a PeriodConsumption. + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @interface IPeriodConsumption + * @property {google.type.IInterval|null} [consumptionInterval] PeriodConsumption consumptionInterval + * @property {number|null} [consumed] PeriodConsumption consumed + */ + + /** + * Constructs a new PeriodConsumption. + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @classdesc Represents a PeriodConsumption. + * @implements IPeriodConsumption + * @constructor + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption=} [properties] Properties to set + */ + function PeriodConsumption(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PeriodConsumption consumptionInterval. + * @member {google.type.IInterval|null|undefined} consumptionInterval + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption + * @instance + */ + PeriodConsumption.prototype.consumptionInterval = null; + + /** + * PeriodConsumption consumed. + * @member {number|null|undefined} consumed + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption + * @instance + */ + PeriodConsumption.prototype.consumed = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PeriodConsumption _consumed. + * @member {"consumed"|undefined} _consumed + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption + * @instance + */ + Object.defineProperty(PeriodConsumption.prototype, "_consumed", { + get: $util.oneOfGetter($oneOfFields = ["consumed"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PeriodConsumption instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption} PeriodConsumption instance + */ + PeriodConsumption.create = function create(properties) { + return new PeriodConsumption(properties); + }; + + /** + * Encodes the specified PeriodConsumption message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption} message PeriodConsumption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PeriodConsumption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.consumptionInterval != null && Object.hasOwnProperty.call(message, "consumptionInterval")) + $root.google.type.Interval.encode(message.consumptionInterval, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.consumed != null && Object.hasOwnProperty.call(message, "consumed")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.consumed); + return writer; + }; + + /** + * Encodes the specified PeriodConsumption message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption} message PeriodConsumption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PeriodConsumption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PeriodConsumption message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption} PeriodConsumption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PeriodConsumption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.consumptionInterval = $root.google.type.Interval.decode(reader, reader.uint32()); + break; + } + case 2: { + message.consumed = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PeriodConsumption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption} PeriodConsumption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PeriodConsumption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PeriodConsumption message. + * @function verify + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PeriodConsumption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.consumptionInterval != null && message.hasOwnProperty("consumptionInterval")) { + var error = $root.google.type.Interval.verify(message.consumptionInterval); + if (error) + return "consumptionInterval." + error; + } + if (message.consumed != null && message.hasOwnProperty("consumed")) { + properties._consumed = 1; + if (typeof message.consumed !== "number") + return "consumed: number expected"; + } + return null; + }; + + /** + * Creates a PeriodConsumption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption} PeriodConsumption + */ + PeriodConsumption.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption) + return object; + var message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption(); + if (object.consumptionInterval != null) { + if (typeof object.consumptionInterval !== "object") + throw TypeError(".google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.consumptionInterval: object expected"); + message.consumptionInterval = $root.google.type.Interval.fromObject(object.consumptionInterval); + } + if (object.consumed != null) + message.consumed = Number(object.consumed); + return message; + }; + + /** + * Creates a plain object from a PeriodConsumption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption} message PeriodConsumption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PeriodConsumption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.consumptionInterval = null; + if (message.consumptionInterval != null && message.hasOwnProperty("consumptionInterval")) + object.consumptionInterval = $root.google.type.Interval.toObject(message.consumptionInterval, options); + if (message.consumed != null && message.hasOwnProperty("consumed")) { + object.consumed = options.json && !isFinite(message.consumed) ? String(message.consumed) : message.consumed; + if (options.oneofs) + object._consumed = "consumed"; + } + return object; + }; + + /** + * Converts this PeriodConsumption to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption + * @instance + * @returns {Object.} JSON object + */ + PeriodConsumption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PeriodConsumption + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PeriodConsumption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption"; + }; + + return PeriodConsumption; + })(); + + UsageResourceAllowanceStatus.ConsumptionReport = (function() { + + /** + * Properties of a ConsumptionReport. + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @interface IConsumptionReport + * @property {Object.|null} [latestPeriodConsumptions] ConsumptionReport latestPeriodConsumptions + */ + + /** + * Constructs a new ConsumptionReport. + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus + * @classdesc Represents a ConsumptionReport. + * @implements IConsumptionReport + * @constructor + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport=} [properties] Properties to set + */ + function ConsumptionReport(properties) { + this.latestPeriodConsumptions = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConsumptionReport latestPeriodConsumptions. + * @member {Object.} latestPeriodConsumptions + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport + * @instance + */ + ConsumptionReport.prototype.latestPeriodConsumptions = $util.emptyObject; + + /** + * Creates a new ConsumptionReport instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport} ConsumptionReport instance + */ + ConsumptionReport.create = function create(properties) { + return new ConsumptionReport(properties); + }; + + /** + * Encodes the specified ConsumptionReport message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport} message ConsumptionReport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsumptionReport.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.latestPeriodConsumptions != null && Object.hasOwnProperty.call(message, "latestPeriodConsumptions")) + for (var keys = Object.keys(message.latestPeriodConsumptions), 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.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.encode(message.latestPeriodConsumptions[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ConsumptionReport message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport} message ConsumptionReport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsumptionReport.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConsumptionReport message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport} ConsumptionReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsumptionReport.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.latestPeriodConsumptions === $util.emptyObject) + message.latestPeriodConsumptions = {}; + 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.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.latestPeriodConsumptions[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConsumptionReport message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport} ConsumptionReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsumptionReport.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConsumptionReport message. + * @function verify + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConsumptionReport.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.latestPeriodConsumptions != null && message.hasOwnProperty("latestPeriodConsumptions")) { + if (!$util.isObject(message.latestPeriodConsumptions)) + return "latestPeriodConsumptions: object expected"; + var key = Object.keys(message.latestPeriodConsumptions); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.verify(message.latestPeriodConsumptions[key[i]]); + if (error) + return "latestPeriodConsumptions." + error; + } + } + return null; + }; + + /** + * Creates a ConsumptionReport message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport} ConsumptionReport + */ + ConsumptionReport.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport) + return object; + var message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport(); + if (object.latestPeriodConsumptions) { + if (typeof object.latestPeriodConsumptions !== "object") + throw TypeError(".google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.latestPeriodConsumptions: object expected"); + message.latestPeriodConsumptions = {}; + for (var keys = Object.keys(object.latestPeriodConsumptions), i = 0; i < keys.length; ++i) { + if (typeof object.latestPeriodConsumptions[keys[i]] !== "object") + throw TypeError(".google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.latestPeriodConsumptions: object expected"); + message.latestPeriodConsumptions[keys[i]] = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.fromObject(object.latestPeriodConsumptions[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a ConsumptionReport message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport + * @static + * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport} message ConsumptionReport + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConsumptionReport.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.latestPeriodConsumptions = {}; + var keys2; + if (message.latestPeriodConsumptions && (keys2 = Object.keys(message.latestPeriodConsumptions)).length) { + object.latestPeriodConsumptions = {}; + for (var j = 0; j < keys2.length; ++j) + object.latestPeriodConsumptions[keys2[j]] = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.toObject(message.latestPeriodConsumptions[keys2[j]], options); + } + return object; + }; + + /** + * Converts this ConsumptionReport to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport + * @instance + * @returns {Object.} JSON object + */ + ConsumptionReport.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConsumptionReport + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConsumptionReport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport"; + }; + + return ConsumptionReport; + })(); + + return UsageResourceAllowanceStatus; + })(); + + v1alpha.Notification = (function() { + + /** + * Properties of a Notification. + * @memberof google.cloud.batch.v1alpha + * @interface INotification + * @property {string|null} [pubsubTopic] Notification pubsubTopic + */ + + /** + * Constructs a new Notification. + * @memberof google.cloud.batch.v1alpha + * @classdesc Represents a Notification. + * @implements INotification + * @constructor + * @param {google.cloud.batch.v1alpha.INotification=} [properties] Properties to set + */ + function Notification(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Notification pubsubTopic. + * @member {string} pubsubTopic + * @memberof google.cloud.batch.v1alpha.Notification + * @instance + */ + Notification.prototype.pubsubTopic = ""; + + /** + * Creates a new Notification instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.Notification + * @static + * @param {google.cloud.batch.v1alpha.INotification=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.Notification} Notification instance + */ + Notification.create = function create(properties) { + return new Notification(properties); + }; + + /** + * Encodes the specified Notification message. Does not implicitly {@link google.cloud.batch.v1alpha.Notification.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.Notification + * @static + * @param {google.cloud.batch.v1alpha.INotification} message Notification message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Notification.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pubsubTopic != null && Object.hasOwnProperty.call(message, "pubsubTopic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pubsubTopic); + return writer; + }; + + /** + * Encodes the specified Notification message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Notification.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.Notification + * @static + * @param {google.cloud.batch.v1alpha.INotification} message Notification message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Notification.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Notification message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.Notification + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.Notification} Notification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Notification.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Notification(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.pubsubTopic = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Notification message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.Notification + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.Notification} Notification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Notification.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Notification message. + * @function verify + * @memberof google.cloud.batch.v1alpha.Notification + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Notification.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) + if (!$util.isString(message.pubsubTopic)) + return "pubsubTopic: string expected"; + return null; + }; + + /** + * Creates a Notification message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.Notification + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.Notification} Notification + */ + Notification.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.Notification) + return object; + var message = new $root.google.cloud.batch.v1alpha.Notification(); + if (object.pubsubTopic != null) + message.pubsubTopic = String(object.pubsubTopic); + return message; + }; + + /** + * Creates a plain object from a Notification message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.Notification + * @static + * @param {google.cloud.batch.v1alpha.Notification} message Notification + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Notification.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.pubsubTopic = ""; + if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) + object.pubsubTopic = message.pubsubTopic; + return object; + }; + + /** + * Converts this Notification to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.Notification + * @instance + * @returns {Object.} JSON object + */ + Notification.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Notification + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.Notification + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Notification.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.Notification"; + }; + + return Notification; + })(); + + return v1alpha; + })(); + + return batch; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + */ + + /** + * Constructs a new CommonLanguageSettings. + * @memberof google.api + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings + * @constructor + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + */ + function CommonLanguageSettings(properties) { + this.destinations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.referenceDocsUri = ""; + + /** + * CommonLanguageSettings destinations. + * @member {Array.} destinations + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.destinations = $util.emptyArray; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @function create + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance + */ + CommonLanguageSettings.create = function create(properties) { + return new CommonLanguageSettings(properties); + }; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); + if (message.destinations != null && message.destinations.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.destinations.length; ++i) + writer.int32(message.destinations[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLanguageSettings message. + * @function verify + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLanguageSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + if (!$util.isString(message.referenceDocsUri)) + return "referenceDocsUri: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + switch (message.destinations[i]) { + default: + return "destinations: enum value[] expected"; + case 0: + case 10: + case 20: + break; + } + } + return null; + }; + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + */ + CommonLanguageSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CommonLanguageSettings) + return object; + var message = new $root.google.api.CommonLanguageSettings(); + if (object.referenceDocsUri != null) + message.referenceDocsUri = String(object.referenceDocsUri); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + switch (object.destinations[i]) { + default: + if (typeof object.destinations[i] === "number") { + message.destinations[i] = object.destinations[i]; + break; + } + case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": + case 0: + message.destinations[i] = 0; + break; + case "GITHUB": + case 10: + message.destinations[i] = 10; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) + object.referenceDocsUri = ""; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + object.referenceDocsUri = message.referenceDocsUri; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + } + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + api.ClientLibrarySettings = (function() { + + /** + * Properties of a ClientLibrarySettings. + * @memberof google.api + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings + */ + + /** + * Constructs a new ClientLibrarySettings. + * @memberof google.api + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings + * @constructor + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + */ + function ClientLibrarySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && message.hasOwnProperty("goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (typeof object.javaSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); + } + if (object.cppSettings != null) { + if (typeof object.cppSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); + } + if (object.phpSettings != null) { + if (typeof object.phpSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); + } + if (object.pythonSettings != null) { + if (typeof object.pythonSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); + } + if (object.nodeSettings != null) { + if (typeof object.nodeSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); + } + if (object.dotnetSettings != null) { + if (typeof object.dotnetSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); + } + if (object.rubySettings != null) { + if (typeof object.rubySettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); + } + if (object.goSettings != null) { + if (typeof object.goSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); + } + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); + if (message.goSettings != null && message.hasOwnProperty("goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); + return object; + }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @memberof google.api + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + + /** + * Publishing restReferenceDocumentationUri. + * @member {string} restReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.restReferenceDocumentationUri = ""; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); + break; + } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } + case 111: { + message.restReferenceDocumentationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); + if (error) + return "librarySettings." + error; + } + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + if (!$util.isString(message.restReferenceDocumentationUri)) + return "restReferenceDocumentationUri: string expected"; + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Publishing) + return object; + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (typeof object.methodSettings[i] !== "object") + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + case "SHOPPING": + case 5: + message.organization = 5; + break; + case "GEO": + case 6: + message.organization = 6; + break; + case "GENERATIVE_AI": + case 7: + message.organization = 7; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (typeof object.librarySettings[i] !== "object") + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); + } + } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); + if (object.restReferenceDocumentationUri != null) + message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + object.protoReferenceDocumentationUri = ""; + object.restReferenceDocumentationUri = ""; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.JavaSettings) + return object; + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (typeof object.serviceClassNames !== "object") + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CppSettings) + return object; + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PhpSettings) + return object; + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + */ + + /** + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings + * @constructor + * @param {google.api.IPythonSettings=} [properties] Properties to set + */ + function PythonSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings) + return object; + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.NodeSettings) + return object; + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + * @property {Object.|null} [renamedServices] DotnetSettings renamedServices + * @property {Object.|null} [renamedResources] DotnetSettings renamedResources + * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources + * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases + * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(properties) { + this.renamedServices = {}; + this.renamedResources = {}; + this.ignoredResources = []; + this.forcedNamespaceAliases = []; + this.handwrittenSignatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * DotnetSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedServices = $util.emptyObject; + + /** + * DotnetSettings renamedResources. + * @member {Object.} renamedResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedResources = $util.emptyObject; + + /** + * DotnetSettings ignoredResources. + * @member {Array.} ignoredResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + + /** + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + + /** + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) + for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); + if (message.ignoredResources != null && message.ignoredResources.length) + for (var i = 0; i < message.ignoredResources.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); + if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); + if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } + case 3: { + if (message.renamedResources === $util.emptyObject) + message.renamedResources = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedResources[key] = value; + break; + } + case 4: { + if (!(message.ignoredResources && message.ignoredResources.length)) + message.ignoredResources = []; + message.ignoredResources.push(reader.string()); + break; + } + case 5: { + if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) + message.forcedNamespaceAliases = []; + message.forcedNamespaceAliases.push(reader.string()); + break; + } + case 6: { + if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) + message.handwrittenSignatures = []; + message.handwrittenSignatures.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { + if (!$util.isObject(message.renamedResources)) + return "renamedResources: object expected"; + var key = Object.keys(message.renamedResources); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedResources[key[i]])) + return "renamedResources: string{k:string} expected"; + } + if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { + if (!Array.isArray(message.ignoredResources)) + return "ignoredResources: array expected"; + for (var i = 0; i < message.ignoredResources.length; ++i) + if (!$util.isString(message.ignoredResources[i])) + return "ignoredResources: string[] expected"; + } + if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { + if (!Array.isArray(message.forcedNamespaceAliases)) + return "forcedNamespaceAliases: array expected"; + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + if (!$util.isString(message.forcedNamespaceAliases[i])) + return "forcedNamespaceAliases: string[] expected"; + } + if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { + if (!Array.isArray(message.handwrittenSignatures)) + return "handwrittenSignatures: array expected"; + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + if (!$util.isString(message.handwrittenSignatures[i])) + return "handwrittenSignatures: string[] expected"; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + if (object.renamedResources) { + if (typeof object.renamedResources !== "object") + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) + message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); + } + if (object.ignoredResources) { + if (!Array.isArray(object.ignoredResources)) + throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); + message.ignoredResources = []; + for (var i = 0; i < object.ignoredResources.length; ++i) + message.ignoredResources[i] = String(object.ignoredResources[i]); + } + if (object.forcedNamespaceAliases) { + if (!Array.isArray(object.forcedNamespaceAliases)) + throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); + message.forcedNamespaceAliases = []; + for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) + message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); + } + if (object.handwrittenSignatures) { + if (!Array.isArray(object.handwrittenSignatures)) + throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); + message.handwrittenSignatures = []; + for (var i = 0; i < object.handwrittenSignatures.length; ++i) + message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; + } + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; + } + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { + object.renamedResources = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + } + if (message.ignoredResources && message.ignoredResources.length) { + object.ignoredResources = []; + for (var j = 0; j < message.ignoredResources.length; ++j) + object.ignoredResources[j] = message.ignoredResources[j]; + } + if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { + object.forcedNamespaceAliases = []; + for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) + object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + } + if (message.handwrittenSignatures && message.handwrittenSignatures.length) { + object.handwrittenSignatures = []; + for (var j = 0; j < message.handwrittenSignatures.length; ++j) + object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; + } + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RubySettings) + return object; + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings + * @constructor + * @param {google.api.IGoSettings=} [properties] Properties to set + */ + function GoSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.common = null; + + /** + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.GoSettings) + return object; + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(properties) { + this.autoPopulatedFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) + message.autoPopulatedFields = []; + message.autoPopulatedFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); + if (error) + return "longRunning." + error; + } + if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { + if (!Array.isArray(message.autoPopulatedFields)) + return "autoPopulatedFields: array expected"; + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + if (!$util.isString(message.autoPopulatedFields[i])) + return "autoPopulatedFields: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings) + return object; + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (typeof object.longRunning !== "object") + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); + } + if (object.autoPopulatedFields) { + if (!Array.isArray(object.autoPopulatedFields)) + throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); + message.autoPopulatedFields = []; + for (var i = 0; i < object.autoPopulatedFields.length; ++i) + message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.autoPopulatedFields = []; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); + if (message.autoPopulatedFields && message.autoPopulatedFields.length) { + object.autoPopulatedFields = []; + for (var j = 0; j < message.autoPopulatedFields.length; ++j) + object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; + } + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (typeof object.initialPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (typeof object.maxPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); + } + if (object.totalPollTimeout != null) { + if (typeof object.totalPollTimeout !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + * @property {number} SHOPPING=5 SHOPPING value + * @property {number} GEO=6 GEO value + * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + values[valuesById[5] = "SHOPPING"] = 5; + values[valuesById[6] = "GEO"] = 6; + values[valuesById[7] = "GENERATIVE_AI"] = 7; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + + /** + * 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.FieldInfo = (function() { + + /** + * Properties of a FieldInfo. + * @memberof google.api + * @interface IFieldInfo + * @property {google.api.FieldInfo.Format|null} [format] FieldInfo format + */ + + /** + * Constructs a new FieldInfo. + * @memberof google.api + * @classdesc Represents a FieldInfo. + * @implements IFieldInfo + * @constructor + * @param {google.api.IFieldInfo=} [properties] Properties to set + */ + function FieldInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldInfo format. + * @member {google.api.FieldInfo.Format} format + * @memberof google.api.FieldInfo + * @instance + */ + FieldInfo.prototype.format = 0; + + /** + * Creates a new FieldInfo instance using the specified properties. + * @function create + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo=} [properties] Properties to set + * @returns {google.api.FieldInfo} FieldInfo instance + */ + FieldInfo.create = function create(properties) { + return new FieldInfo(properties); + }; + + /** + * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @function encode + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.format); + return writer; + }; + + /** + * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldInfo message from the specified reader or buffer. + * @function decode + * @memberof google.api.FieldInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.FieldInfo} FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.FieldInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.format = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.FieldInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.FieldInfo} FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldInfo message. + * @function verify + * @memberof google.api.FieldInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.format != null && message.hasOwnProperty("format")) + switch (message.format) { + default: + return "format: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.FieldInfo + * @static + * @param {Object.} object Plain object + * @returns {google.api.FieldInfo} FieldInfo + */ + FieldInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.FieldInfo) + return object; + var message = new $root.google.api.FieldInfo(); + switch (object.format) { + default: + if (typeof object.format === "number") { + message.format = object.format; + break; + } + break; + case "FORMAT_UNSPECIFIED": + case 0: + message.format = 0; + break; + case "UUID4": + case 1: + message.format = 1; + break; + case "IPV4": + case 2: + message.format = 2; + break; + case "IPV6": + case 3: + message.format = 3; + break; + case "IPV4_OR_IPV6": + case 4: + message.format = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.FieldInfo + * @static + * @param {google.api.FieldInfo} message FieldInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.format = options.enums === String ? "FORMAT_UNSPECIFIED" : 0; + if (message.format != null && message.hasOwnProperty("format")) + object.format = options.enums === String ? $root.google.api.FieldInfo.Format[message.format] === undefined ? message.format : $root.google.api.FieldInfo.Format[message.format] : message.format; + return object; + }; + + /** + * Converts this FieldInfo to JSON. + * @function toJSON + * @memberof google.api.FieldInfo + * @instance + * @returns {Object.} JSON object + */ + FieldInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldInfo + * @function getTypeUrl + * @memberof google.api.FieldInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.FieldInfo"; + }; + + /** + * Format enum. + * @name google.api.FieldInfo.Format + * @enum {number} + * @property {number} FORMAT_UNSPECIFIED=0 FORMAT_UNSPECIFIED value + * @property {number} UUID4=1 UUID4 value + * @property {number} IPV4=2 IPV4 value + * @property {number} IPV6=3 IPV6 value + * @property {number} IPV4_OR_IPV6=4 IPV4_OR_IPV6 value + */ + FieldInfo.Format = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "UUID4"] = 1; + values[valuesById[2] = "IPV4"] = 2; + values[valuesById[3] = "IPV6"] = 3; + values[valuesById[4] = "IPV4_OR_IPV6"] = 4; + return values; + })(); + + return FieldInfo; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value + * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value + * @property {number} EDITION_2023=1000 EDITION_2023 value + * @property {number} EDITION_2024=1001 EDITION_2024 value + * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value + * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value + * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value + * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value + * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value + * @property {number} EDITION_MAX=2147483647 EDITION_MAX value + */ + protobuf.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[998] = "EDITION_PROTO2"] = 998; + values[valuesById[999] = "EDITION_PROTO3"] = 999; + values[valuesById[1000] = "EDITION_2023"] = 1000; + values[valuesById[1001] = "EDITION_2024"] = 1001; + values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; + values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; + values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; + values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; + values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; + values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; + return values; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = 0; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 14: { + message.edition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + this.declaration = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.verification = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message.declaration != null && message.hasOwnProperty("declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); + if (error) + return "declaration." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.verification != null && message.hasOwnProperty("verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (typeof object.declaration[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); + } + if (message.verification != null && message.hasOwnProperty("verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.fullName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 5: { + message.reserved = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Declaration message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Declaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && message.hasOwnProperty("reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + return null; + }; + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + */ + Declaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + if (object.number != null) + message.number = object.number | 0; + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.type != null) + message.type = String(object.type); + if (object.reserved != null) + message.reserved = Boolean(object.reserved); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + return message; + }; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Declaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.reserved != null && message.hasOwnProperty("reserved")) + object.reserved = message.reserved; + if (message.repeated != null && message.hasOwnProperty("repeated")) + object.repeated = message.repeated; + return object; + }; + + /** + * Converts this Declaration to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + * @returns {Object.} JSON object + */ + Declaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Declaration + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; + }; + + return Declaration; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 3: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.features = null; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FileOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + object.features = null; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * MessageOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.features = null; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 12: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {Array.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IFieldInfo|null} [".google.api.fieldInfo"] FieldOptions .google.api.fieldInfo + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.targets = []; + this.editionDefaults = []; + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions targets. + * @member {Array.} targets + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.targets = $util.emptyArray; + + /** + * FieldOptions editionDefaults. + * @member {Array.} editionDefaults + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.editionDefaults = $util.emptyArray; + + /** + * FieldOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.features = null; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldInfo. + * @member {google.api.IFieldInfo|null|undefined} .google.api.fieldInfo + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldInfo"] = null; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); + if (message.editionDefaults != null && message.editionDefaults.length) + for (var i = 0; i < message.editionDefaults.length; ++i) + $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + if (message[".google.api.fieldInfo"] != null && Object.hasOwnProperty.call(message, ".google.api.fieldInfo")) + $root.google.api.FieldInfo.encode(message[".google.api.fieldInfo"], writer.uint32(/* id 291403980, wireType 2 =*/2331231842).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 19: { + if (!(message.targets && message.targets.length)) + message.targets = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targets.push(reader.int32()); + } else + message.targets.push(reader.int32()); + break; + } + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 291403980: { + message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.decode(reader, reader.uint32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && message.hasOwnProperty("retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.targets != null && message.hasOwnProperty("targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) + switch (message.targets[i]) { + default: + return "targets: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + } + if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { + if (!Array.isArray(message.editionDefaults)) + return "editionDefaults: array expected"; + for (var i = 0; i < message.editionDefaults.length; ++i) { + var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); + if (error) + return "editionDefaults." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) { + var error = $root.google.api.FieldInfo.verify(message[".google.api.fieldInfo"]); + if (error) + return ".google.api.fieldInfo." + error; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) + switch (object.targets[i]) { + default: + if (typeof object.targets[i] === "number") { + message.targets[i] = object.targets[i]; + break; + } + case "TARGET_TYPE_UNKNOWN": + case 0: + message.targets[i] = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.targets[i] = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.targets[i] = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.targets[i] = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.targets[i] = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.targets[i] = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.targets[i] = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.targets[i] = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.targets[i] = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.targets[i] = 9; + break; + } + } + if (object.editionDefaults) { + if (!Array.isArray(object.editionDefaults)) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); + message.editionDefaults = []; + for (var i = 0; i < object.editionDefaults.length; ++i) { + if (typeof object.editionDefaults[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); + message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FieldOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + break; + } + } + if (object[".google.api.fieldInfo"] != null) { + if (typeof object[".google.api.fieldInfo"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldInfo: object expected"); + message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.fromObject(object[".google.api.fieldInfo"]); + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targets = []; + object.editionDefaults = []; + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object.debugRedact = false; + object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; + object.features = null; + object[".google.api.resourceReference"] = null; + object[".google.api.fieldInfo"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.retention != null && message.hasOwnProperty("retention")) + object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; + if (message.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; + } + if (message.editionDefaults && message.editionDefaults.length) { + object.editionDefaults = []; + for (var j = 0; j < message.editionDefaults.length; ++j) + object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) + object[".google.api.fieldInfo"] = $root.google.api.FieldInfo.toObject(message[".google.api.fieldInfo"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.features = null; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.features = null; + + /** + * EnumValueOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.debugRedact = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.debugRedact = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object.debugRedact = false; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + case 525000001: { + message[".google.api.apiVersion"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.features = null; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 35: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MethodOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object.features = null; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + */ + + /** + * Constructs a new FeatureSet. + * @memberof google.protobuf + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet + * @constructor + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + */ + function FeatureSet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.fieldPresence = 0; + + /** + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enumType = 0; + + /** + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.repeatedFieldEncoding = 0; + + /** + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.utf8Validation = 0; + + /** + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.messageEncoding = 0; + + /** + * FeatureSet jsonFormat. + * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.jsonFormat = 0; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance + */ + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); + }; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fieldPresence = reader.int32(); + break; + } + case 2: { + message.enumType = reader.int32(); + break; + } + case 3: { + message.repeatedFieldEncoding = reader.int32(); + break; + } + case 4: { + message.utf8Validation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + switch (message.fieldPresence) { + default: + return "fieldPresence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) + switch (message.enumType) { + default: + return "enumType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + switch (message.repeatedFieldEncoding) { + default: + return "repeatedFieldEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + switch (message.utf8Validation) { + default: + return "utf8Validation: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + switch (message.messageEncoding) { + default: + return "messageEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + switch (message.jsonFormat) { + default: + return "jsonFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet} FeatureSet + */ + FeatureSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { + default: + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; + break; + } + break; + case "FIELD_PRESENCE_UNKNOWN": + case 0: + message.fieldPresence = 0; + break; + case "EXPLICIT": + case 1: + message.fieldPresence = 1; + break; + case "IMPLICIT": + case 2: + message.fieldPresence = 2; + break; + case "LEGACY_REQUIRED": + case 3: + message.fieldPresence = 3; + break; + } + switch (object.enumType) { + default: + if (typeof object.enumType === "number") { + message.enumType = object.enumType; + break; + } + break; + case "ENUM_TYPE_UNKNOWN": + case 0: + message.enumType = 0; + break; + case "OPEN": + case 1: + message.enumType = 1; + break; + case "CLOSED": + case 2: + message.enumType = 2; + break; + } + switch (object.repeatedFieldEncoding) { + default: + if (typeof object.repeatedFieldEncoding === "number") { + message.repeatedFieldEncoding = object.repeatedFieldEncoding; + break; + } + break; + case "REPEATED_FIELD_ENCODING_UNKNOWN": + case 0: + message.repeatedFieldEncoding = 0; + break; + case "PACKED": + case 1: + message.repeatedFieldEncoding = 1; + break; + case "EXPANDED": + case 2: + message.repeatedFieldEncoding = 2; + break; + } + switch (object.utf8Validation) { + default: + if (typeof object.utf8Validation === "number") { + message.utf8Validation = object.utf8Validation; + break; + } + break; + case "UTF8_VALIDATION_UNKNOWN": + case 0: + message.utf8Validation = 0; + break; + case "VERIFY": + case 2: + message.utf8Validation = 2; + break; + case "NONE": + case 3: + message.utf8Validation = 3; + break; + } + switch (object.messageEncoding) { + default: + if (typeof object.messageEncoding === "number") { + message.messageEncoding = object.messageEncoding; + break; + } + break; + case "MESSAGE_ENCODING_UNKNOWN": + case 0: + message.messageEncoding = 0; + break; + case "LENGTH_PREFIXED": + case 1: + message.messageEncoding = 1; + break; + case "DELIMITED": + case 2: + message.messageEncoding = 2; + break; + } + switch (object.jsonFormat) { + default: + if (typeof object.jsonFormat === "number") { + message.jsonFormat = object.jsonFormat; + break; + } + break; + case "JSON_FORMAT_UNKNOWN": + case 0: + message.jsonFormat = 0; + break; + case "ALLOW": + case 1: + message.jsonFormat = 1; + break; + case "LEGACY_BEST_EFFORT": + case 2: + message.jsonFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.FeatureSet} message FeatureSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; + object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; + object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; + object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + } + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; + if (message.enumType != null && message.hasOwnProperty("enumType")) + object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + return object; + }; + + /** + * Converts this FeatureSet to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet + * @instance + * @returns {Object.} JSON object + */ + FeatureSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSet + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet"; + }; + + /** + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence + * @enum {number} + * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value + * @property {number} EXPLICIT=1 EXPLICIT value + * @property {number} IMPLICIT=2 IMPLICIT value + * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value + */ + FeatureSet.FieldPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; + values[valuesById[1] = "EXPLICIT"] = 1; + values[valuesById[2] = "IMPLICIT"] = 2; + values[valuesById[3] = "LEGACY_REQUIRED"] = 3; + return values; + })(); + + /** + * EnumType enum. + * @name google.protobuf.FeatureSet.EnumType + * @enum {number} + * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + FeatureSet.EnumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * RepeatedFieldEncoding enum. + * @name google.protobuf.FeatureSet.RepeatedFieldEncoding + * @enum {number} + * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value + * @property {number} PACKED=1 PACKED value + * @property {number} EXPANDED=2 EXPANDED value + */ + FeatureSet.RepeatedFieldEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "PACKED"] = 1; + values[valuesById[2] = "EXPANDED"] = 2; + return values; + })(); + + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition + */ + + /** + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.defaults && message.defaults.length)) + message.defaults = []; + message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); + break; + } + case 4: { + message.minimumEdition = reader.int32(); + break; + } + case 5: { + message.maximumEdition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetDefaults message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetDefaults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaults != null && message.hasOwnProperty("defaults")) { + if (!Array.isArray(message.defaults)) + return "defaults: array expected"; + for (var i = 0; i < message.defaults.length; ++i) { + var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); + if (error) + return "defaults." + error; + } + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + switch (message.minimumEdition) { + default: + return "minimumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + switch (message.maximumEdition) { + default: + return "maximumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + */ + FeatureSetDefaults.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults(); + if (object.defaults) { + if (!Array.isArray(object.defaults)) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); + message.defaults = []; + for (var i = 0; i < object.defaults.length; ++i) { + if (typeof object.defaults[i] !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); + message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); + } + } + switch (object.minimumEdition) { + default: + if (typeof object.minimumEdition === "number") { + message.minimumEdition = object.minimumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.minimumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.minimumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.minimumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.minimumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.minimumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.minimumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.minimumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.minimumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.minimumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.minimumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.minimumEdition = 2147483647; + break; + } + switch (object.maximumEdition) { + default: + if (typeof object.maximumEdition === "number") { + message.maximumEdition = object.maximumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.maximumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.maximumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.maximumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.maximumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.maximumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.maximumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.maximumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.maximumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.maximumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.maximumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.maximumEdition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetDefaults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; + if (options.defaults) { + object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.defaults && message.defaults.length) { + object.defaults = []; + for (var j = 0; j < message.defaults.length; ++j) + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; + return object; + }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults + * @instance + * @returns {Object.} JSON object + */ + FeatureSetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetDefaults + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; + }; + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + + /** + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + */ + + /** + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault + * @constructor + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + */ + function FeatureSetEditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.edition = 0; + + /** + * FeatureSetEditionDefault features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.features = null; + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance + */ + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); + }; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetEditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + return null; + }; + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + */ + FeatureSetEditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetEditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.features = null; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + return protobuf; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Interval = (function() { + + /** + * Properties of an Interval. + * @memberof google.type + * @interface IInterval + * @property {google.protobuf.ITimestamp|null} [startTime] Interval startTime + * @property {google.protobuf.ITimestamp|null} [endTime] Interval endTime + */ + + /** + * Constructs a new Interval. + * @memberof google.type + * @classdesc Represents an Interval. + * @implements IInterval + * @constructor + * @param {google.type.IInterval=} [properties] Properties to set + */ + function Interval(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Interval startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.type.Interval + * @instance + */ + Interval.prototype.startTime = null; + + /** + * Interval endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.type.Interval + * @instance + */ + Interval.prototype.endTime = null; + + /** + * Creates a new Interval instance using the specified properties. + * @function create + * @memberof google.type.Interval + * @static + * @param {google.type.IInterval=} [properties] Properties to set + * @returns {google.type.Interval} Interval instance + */ + Interval.create = function create(properties) { + return new Interval(properties); + }; + + /** + * Encodes the specified Interval message. Does not implicitly {@link google.type.Interval.verify|verify} messages. + * @function encode + * @memberof google.type.Interval + * @static + * @param {google.type.IInterval} message Interval message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Interval.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(); + return writer; + }; + + /** + * Encodes the specified Interval message, length delimited. Does not implicitly {@link google.type.Interval.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Interval + * @static + * @param {google.type.IInterval} message Interval message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Interval.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Interval message from the specified reader or buffer. + * @function decode + * @memberof google.type.Interval + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Interval} Interval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Interval.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Interval(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Interval message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Interval + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Interval} Interval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Interval.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Interval message. + * @function verify + * @memberof google.type.Interval + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Interval.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates an Interval message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Interval + * @static + * @param {Object.} object Plain object + * @returns {google.type.Interval} Interval + */ + Interval.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Interval) + return object; + var message = new $root.google.type.Interval(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.type.Interval.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.type.Interval.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from an Interval message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Interval + * @static + * @param {google.type.Interval} message Interval + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Interval.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this Interval to JSON. + * @function toJSON + * @memberof google.type.Interval + * @instance + * @returns {Object.} JSON object + */ + Interval.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Interval + * @function getTypeUrl + * @memberof google.type.Interval + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Interval.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Interval"; + }; + + return Interval; + })(); + + return type; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.json b/owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.json new file mode 100644 index 00000000000..15385d6317b --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.json @@ -0,0 +1,4203 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "batch": { + "nested": { + "v1alpha": { + "options": { + "csharp_namespace": "Google.Cloud.Batch.V1Alpha", + "go_package": "cloud.google.com/go/batch/apiv1alpha/batchpb;batchpb", + "java_multiple_files": true, + "java_outer_classname": "NotificationProto", + "java_package": "com.google.cloud.batch.v1alpha", + "objc_class_prefix": "GCB", + "php_namespace": "Google\\Cloud\\Batch\\V1alpha", + "ruby_package": "Google::Cloud::Batch::V1alpha" + }, + "nested": { + "BatchService": { + "options": { + "(google.api.default_host)": "batch.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateJob": { + "requestType": "CreateJobRequest", + "responseType": "Job", + "options": { + "(google.api.http).post": "/v1alpha/{parent=projects/*/locations/*}/jobs", + "(google.api.http).body": "job", + "(google.api.method_signature)": "parent,job,job_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{parent=projects/*/locations/*}/jobs", + "body": "job" + } + }, + { + "(google.api.method_signature)": "parent,job,job_id" + } + ] + }, + "GetJob": { + "requestType": "GetJobRequest", + "responseType": "Job", + "options": { + "(google.api.http).get": "/v1alpha/{name=projects/*/locations/*/jobs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{name=projects/*/locations/*/jobs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteJob": { + "requestType": "DeleteJobRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1alpha/{name=projects/*/locations/*/jobs/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.batch.v1alpha.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1alpha/{name=projects/*/locations/*/jobs/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.batch.v1alpha.OperationMetadata" + } + } + ] + }, + "CancelJob": { + "requestType": "CancelJobRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha/{name=projects/*/locations/*/jobs/*}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.cloud.batch.v1alpha.CancelJobResponse", + "(google.longrunning.operation_info).metadata_type": "google.cloud.batch.v1alpha.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{name=projects/*/locations/*/jobs/*}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.batch.v1alpha.CancelJobResponse", + "metadata_type": "google.cloud.batch.v1alpha.OperationMetadata" + } + } + ] + }, + "UpdateJob": { + "requestType": "UpdateJobRequest", + "responseType": "Job", + "options": { + "(google.api.http).patch": "/v1alpha/{job.name=projects/*/locations/*/jobs/*}", + "(google.api.http).body": "job", + "(google.api.method_signature)": "job,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1alpha/{job.name=projects/*/locations/*/jobs/*}", + "body": "job" + } + }, + { + "(google.api.method_signature)": "job,update_mask" + } + ] + }, + "ListJobs": { + "requestType": "ListJobsRequest", + "responseType": "ListJobsResponse", + "options": { + "(google.api.http).get": "/v1alpha/{parent=projects/*/locations/*}/jobs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{parent=projects/*/locations/*}/jobs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetTask": { + "requestType": "GetTaskRequest", + "responseType": "Task", + "options": { + "(google.api.http).get": "/v1alpha/{name=projects/*/locations/*/jobs/*/taskGroups/*/tasks/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{name=projects/*/locations/*/jobs/*/taskGroups/*/tasks/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListTasks": { + "requestType": "ListTasksRequest", + "responseType": "ListTasksResponse", + "options": { + "(google.api.http).get": "/v1alpha/{parent=projects/*/locations/*/jobs/*/taskGroups/*}/tasks", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{parent=projects/*/locations/*/jobs/*/taskGroups/*}/tasks" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateResourceAllowance": { + "requestType": "CreateResourceAllowanceRequest", + "responseType": "ResourceAllowance", + "options": { + "(google.api.http).post": "/v1alpha/{parent=projects/*/locations/*}/resourceAllowances", + "(google.api.http).body": "resource_allowance", + "(google.api.method_signature)": "parent,resource_allowance,resource_allowance_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{parent=projects/*/locations/*}/resourceAllowances", + "body": "resource_allowance" + } + }, + { + "(google.api.method_signature)": "parent,resource_allowance,resource_allowance_id" + } + ] + }, + "GetResourceAllowance": { + "requestType": "GetResourceAllowanceRequest", + "responseType": "ResourceAllowance", + "options": { + "(google.api.http).get": "/v1alpha/{name=projects/*/locations/*/resourceAllowances/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{name=projects/*/locations/*/resourceAllowances/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteResourceAllowance": { + "requestType": "DeleteResourceAllowanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1alpha/{name=projects/*/locations/*/resourceAllowances/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.batch.v1alpha.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1alpha/{name=projects/*/locations/*/resourceAllowances/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.batch.v1alpha.OperationMetadata" + } + } + ] + }, + "ListResourceAllowances": { + "requestType": "ListResourceAllowancesRequest", + "responseType": "ListResourceAllowancesResponse", + "options": { + "(google.api.http).get": "/v1alpha/{parent=projects/*/locations/*}/resourceAllowances", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{parent=projects/*/locations/*}/resourceAllowances" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateResourceAllowance": { + "requestType": "UpdateResourceAllowanceRequest", + "responseType": "ResourceAllowance", + "options": { + "(google.api.http).patch": "/v1alpha/{resource_allowance.name=projects/*/locations/*/resourceAllowances/*}", + "(google.api.http).body": "resource_allowance", + "(google.api.method_signature)": "resource_allowance,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1alpha/{resource_allowance.name=projects/*/locations/*/resourceAllowances/*}", + "body": "resource_allowance" + } + }, + { + "(google.api.method_signature)": "resource_allowance,update_mask" + } + ] + } + } + }, + "CreateJobRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "batch.googleapis.com/Job" + } + }, + "jobId": { + "type": "string", + "id": 2 + }, + "job": { + "type": "Job", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "batch.googleapis.com/Job" + } + } + } + }, + "DeleteJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "reason": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CancelJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "batch.googleapis.com/Job" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CancelJobResponse": { + "fields": {} + }, + "UpdateJobRequest": { + "fields": { + "job": { + "type": "Job", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListJobsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListJobsResponse": { + "fields": { + "jobs": { + "rule": "repeated", + "type": "Job", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "ListTasksRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "batch.googleapis.com/TaskGroup" + } + }, + "filter": { + "type": "string", + "id": 2 + }, + "orderBy": { + "type": "string", + "id": 5 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListTasksResponse": { + "fields": { + "tasks": { + "rule": "repeated", + "type": "Task", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetTaskRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "batch.googleapis.com/Task" + } + } + } + }, + "CreateResourceAllowanceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "batch.googleapis.com/ResourceAllowance" + } + }, + "resourceAllowanceId": { + "type": "string", + "id": 2 + }, + "resourceAllowance": { + "type": "ResourceAllowance", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetResourceAllowanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "batch.googleapis.com/ResourceAllowance" + } + } + } + }, + "DeleteResourceAllowanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "batch.googleapis.com/ResourceAllowance" + } + }, + "reason": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListResourceAllowancesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "batch.googleapis.com/ResourceAllowance" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListResourceAllowancesResponse": { + "fields": { + "resourceAllowances": { + "rule": "repeated", + "type": "ResourceAllowance", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "UpdateResourceAllowanceRequest": { + "fields": { + "resourceAllowance": { + "type": "ResourceAllowance", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "OperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "target": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusMessage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiVersion": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Job": { + "options": { + "(google.api.resource).type": "batch.googleapis.com/Job", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/jobs/{job}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "uid": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "priority": { + "type": "int64", + "id": 3 + }, + "taskGroups": { + "rule": "repeated", + "type": "TaskGroup", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "schedulingPolicy": { + "type": "SchedulingPolicy", + "id": 5 + }, + "dependencies": { + "rule": "repeated", + "type": "JobDependency", + "id": 6 + }, + "allocationPolicy": { + "type": "AllocationPolicy", + "id": 7 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 8 + }, + "status": { + "type": "JobStatus", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "notification": { + "type": "JobNotification", + "id": 10, + "options": { + "deprecated": true + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "logsPolicy": { + "type": "LogsPolicy", + "id": 13 + }, + "notifications": { + "rule": "repeated", + "type": "JobNotification", + "id": 14 + } + }, + "nested": { + "SchedulingPolicy": { + "values": { + "SCHEDULING_POLICY_UNSPECIFIED": 0, + "AS_SOON_AS_POSSIBLE": 1 + } + } + } + }, + "LogsPolicy": { + "fields": { + "destination": { + "type": "Destination", + "id": 1 + }, + "logsPath": { + "type": "string", + "id": 2 + }, + "cloudLoggingOption": { + "type": "CloudLoggingOption", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "CloudLoggingOption": { + "fields": { + "useGenericTaskMonitoredResource": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Destination": { + "values": { + "DESTINATION_UNSPECIFIED": 0, + "CLOUD_LOGGING": 1, + "PATH": 2 + } + } + } + }, + "JobDependency": { + "fields": { + "items": { + "keyType": "string", + "type": "Type", + "id": 1 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "SUCCEEDED": 1, + "FAILED": 2, + "FINISHED": 3 + } + } + } + }, + "JobStatus": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "statusEvents": { + "rule": "repeated", + "type": "StatusEvent", + "id": 2 + }, + "taskGroups": { + "keyType": "string", + "type": "TaskGroupStatus", + "id": 4 + }, + "runDuration": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "resourceUsage": { + "type": "ResourceUsage", + "id": 6 + } + }, + "nested": { + "InstanceStatus": { + "fields": { + "machineType": { + "type": "string", + "id": 1 + }, + "provisioningModel": { + "type": "AllocationPolicy.ProvisioningModel", + "id": 2 + }, + "taskPack": { + "type": "int64", + "id": 3 + }, + "bootDisk": { + "type": "AllocationPolicy.Disk", + "id": 4 + } + } + }, + "TaskGroupStatus": { + "fields": { + "counts": { + "keyType": "string", + "type": "int64", + "id": 1 + }, + "instances": { + "rule": "repeated", + "type": "InstanceStatus", + "id": 2 + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "QUEUED": 1, + "SCHEDULED": 2, + "RUNNING": 3, + "SUCCEEDED": 4, + "FAILED": 5, + "DELETION_IN_PROGRESS": 6, + "CANCELLATION_IN_PROGRESS": 7, + "CANCELLED": 8 + } + } + } + }, + "ResourceUsage": { + "fields": { + "coreHours": { + "type": "double", + "id": 1 + } + } + }, + "JobNotification": { + "fields": { + "pubsubTopic": { + "type": "string", + "id": 1 + }, + "message": { + "type": "Message", + "id": 2 + } + }, + "nested": { + "Message": { + "fields": { + "type": { + "type": "Type", + "id": 1 + }, + "newJobState": { + "type": "JobStatus.State", + "id": 2 + }, + "newTaskState": { + "type": "TaskStatus.State", + "id": 3 + } + } + }, + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "JOB_STATE_CHANGED": 1, + "TASK_STATE_CHANGED": 2 + } + } + } + }, + "AllocationPolicy": { + "fields": { + "location": { + "type": "LocationPolicy", + "id": 1 + }, + "instance": { + "type": "InstancePolicy", + "id": 2, + "options": { + "deprecated": true + } + }, + "instances": { + "rule": "repeated", + "type": "InstancePolicyOrTemplate", + "id": 8 + }, + "instanceTemplates": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "deprecated": true + } + }, + "provisioningModels": { + "rule": "repeated", + "type": "ProvisioningModel", + "id": 4, + "options": { + "deprecated": true + } + }, + "serviceAccountEmail": { + "type": "string", + "id": 5, + "options": { + "deprecated": true + } + }, + "serviceAccount": { + "type": "ServiceAccount", + "id": 9 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 6 + }, + "network": { + "type": "NetworkPolicy", + "id": 7 + }, + "placement": { + "type": "PlacementPolicy", + "id": 10 + }, + "tags": { + "rule": "repeated", + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "LocationPolicy": { + "fields": { + "allowedLocations": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "deniedLocations": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "Disk": { + "oneofs": { + "dataSource": { + "oneof": [ + "image", + "snapshot" + ] + } + }, + "fields": { + "image": { + "type": "string", + "id": 4 + }, + "snapshot": { + "type": "string", + "id": 5 + }, + "type": { + "type": "string", + "id": 1 + }, + "sizeGb": { + "type": "int64", + "id": 2 + }, + "diskInterface": { + "type": "string", + "id": 6 + } + } + }, + "AttachedDisk": { + "oneofs": { + "attached": { + "oneof": [ + "newDisk", + "existingDisk" + ] + } + }, + "fields": { + "newDisk": { + "type": "Disk", + "id": 1 + }, + "existingDisk": { + "type": "string", + "id": 2 + }, + "deviceName": { + "type": "string", + "id": 3 + } + } + }, + "Accelerator": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "count": { + "type": "int64", + "id": 2 + }, + "installGpuDrivers": { + "type": "bool", + "id": 3, + "options": { + "deprecated": true + } + }, + "driverVersion": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "InstancePolicy": { + "fields": { + "allowedMachineTypes": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "machineType": { + "type": "string", + "id": 2 + }, + "minCpuPlatform": { + "type": "string", + "id": 3 + }, + "provisioningModel": { + "type": "ProvisioningModel", + "id": 4 + }, + "accelerators": { + "rule": "repeated", + "type": "Accelerator", + "id": 5 + }, + "bootDisk": { + "type": "Disk", + "id": 8 + }, + "disks": { + "rule": "repeated", + "type": "AttachedDisk", + "id": 6 + }, + "reservation": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "InstancePolicyOrTemplate": { + "oneofs": { + "policyTemplate": { + "oneof": [ + "policy", + "instanceTemplate" + ] + } + }, + "fields": { + "policy": { + "type": "InstancePolicy", + "id": 1 + }, + "instanceTemplate": { + "type": "string", + "id": 2 + }, + "installGpuDrivers": { + "type": "bool", + "id": 3 + }, + "installOpsAgent": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "blockProjectSshKeys": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "NetworkInterface": { + "fields": { + "network": { + "type": "string", + "id": 1 + }, + "subnetwork": { + "type": "string", + "id": 2 + }, + "noExternalIpAddress": { + "type": "bool", + "id": 3 + } + } + }, + "NetworkPolicy": { + "fields": { + "networkInterfaces": { + "rule": "repeated", + "type": "NetworkInterface", + "id": 1 + } + } + }, + "PlacementPolicy": { + "fields": { + "collocation": { + "type": "string", + "id": 1 + }, + "maxDistance": { + "type": "int64", + "id": 2 + } + } + }, + "ProvisioningModel": { + "values": { + "PROVISIONING_MODEL_UNSPECIFIED": 0, + "STANDARD": 1, + "SPOT": 2, + "PREEMPTIBLE": 3 + } + } + } + }, + "TaskGroup": { + "options": { + "(google.api.resource).type": "batch.googleapis.com/TaskGroup", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "taskSpec": { + "type": "TaskSpec", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "taskCount": { + "type": "int64", + "id": 4 + }, + "parallelism": { + "type": "int64", + "id": 5 + }, + "schedulingPolicy": { + "type": "SchedulingPolicy", + "id": 6 + }, + "allocationPolicy": { + "type": "AllocationPolicy", + "id": 7 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 8 + }, + "taskEnvironments": { + "rule": "repeated", + "type": "Environment", + "id": 9 + }, + "taskCountPerNode": { + "type": "int64", + "id": 10 + }, + "requireHostsFile": { + "type": "bool", + "id": 11 + }, + "permissiveSsh": { + "type": "bool", + "id": 12 + }, + "runAsNonRoot": { + "type": "bool", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceAccount": { + "type": "ServiceAccount", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "SchedulingPolicy": { + "values": { + "SCHEDULING_POLICY_UNSPECIFIED": 0, + "AS_SOON_AS_POSSIBLE": 1, + "IN_ORDER": 2 + } + } + } + }, + "ServiceAccount": { + "fields": { + "email": { + "type": "string", + "id": 1 + }, + "scopes": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "ComputeResource": { + "fields": { + "cpuMilli": { + "type": "int64", + "id": 1 + }, + "memoryMib": { + "type": "int64", + "id": 2 + }, + "gpuCount": { + "type": "int64", + "id": 3 + }, + "bootDiskMib": { + "type": "int64", + "id": 4 + } + } + }, + "StatusEvent": { + "fields": { + "type": { + "type": "string", + "id": 3 + }, + "description": { + "type": "string", + "id": 1 + }, + "eventTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "taskExecution": { + "type": "TaskExecution", + "id": 4 + }, + "taskState": { + "type": "TaskStatus.State", + "id": 5 + } + } + }, + "TaskExecution": { + "fields": { + "exitCode": { + "type": "int32", + "id": 1 + }, + "stderrSnippet": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "TaskStatus": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "statusEvents": { + "rule": "repeated", + "type": "StatusEvent", + "id": 2 + }, + "resourceUsage": { + "type": "TaskResourceUsage", + "id": 3 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PENDING": 1, + "ASSIGNED": 2, + "RUNNING": 3, + "FAILED": 4, + "SUCCEEDED": 5, + "UNEXECUTED": 6 + } + } + } + }, + "TaskResourceUsage": { + "fields": { + "coreHours": { + "type": "double", + "id": 1 + } + } + }, + "Runnable": { + "oneofs": { + "executable": { + "oneof": [ + "container", + "script", + "barrier" + ] + } + }, + "fields": { + "container": { + "type": "Container", + "id": 1 + }, + "script": { + "type": "Script", + "id": 2 + }, + "barrier": { + "type": "Barrier", + "id": 6 + }, + "displayName": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ignoreExitStatus": { + "type": "bool", + "id": 3 + }, + "background": { + "type": "bool", + "id": 4 + }, + "alwaysRun": { + "type": "bool", + "id": 5 + }, + "environment": { + "type": "Environment", + "id": 7 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 8 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 9 + } + }, + "nested": { + "Container": { + "fields": { + "imageUri": { + "type": "string", + "id": 1 + }, + "commands": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "entrypoint": { + "type": "string", + "id": 3 + }, + "volumes": { + "rule": "repeated", + "type": "string", + "id": 7 + }, + "options": { + "type": "string", + "id": 8 + }, + "blockExternalNetwork": { + "type": "bool", + "id": 9 + }, + "username": { + "type": "string", + "id": 10 + }, + "password": { + "type": "string", + "id": 11 + }, + "enableImageStreaming": { + "type": "bool", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Script": { + "oneofs": { + "command": { + "oneof": [ + "path", + "text" + ] + } + }, + "fields": { + "path": { + "type": "string", + "id": 1 + }, + "text": { + "type": "string", + "id": 2 + } + } + }, + "Barrier": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + } + } + }, + "TaskSpec": { + "fields": { + "runnables": { + "rule": "repeated", + "type": "Runnable", + "id": 8 + }, + "computeResource": { + "type": "ComputeResource", + "id": 3 + }, + "maxRunDuration": { + "type": "google.protobuf.Duration", + "id": 4 + }, + "maxRetryCount": { + "type": "int32", + "id": 5 + }, + "lifecyclePolicies": { + "rule": "repeated", + "type": "LifecyclePolicy", + "id": 9 + }, + "environments": { + "keyType": "string", + "type": "string", + "id": 6, + "options": { + "deprecated": true + } + }, + "volumes": { + "rule": "repeated", + "type": "Volume", + "id": 7 + }, + "environment": { + "type": "Environment", + "id": 10 + } + } + }, + "LifecyclePolicy": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "actionCondition": { + "type": "ActionCondition", + "id": 2 + } + }, + "nested": { + "ActionCondition": { + "fields": { + "exitCodes": { + "rule": "repeated", + "type": "int32", + "id": 1 + } + } + }, + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "RETRY_TASK": 1, + "FAIL_TASK": 2 + } + } + } + }, + "Task": { + "options": { + "(google.api.resource).type": "batch.googleapis.com/Task", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}/tasks/{task}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "status": { + "type": "TaskStatus", + "id": 2 + } + } + }, + "Environment": { + "fields": { + "variables": { + "keyType": "string", + "type": "string", + "id": 1 + }, + "secretVariables": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "encryptedVariables": { + "type": "KMSEnvMap", + "id": 3 + } + }, + "nested": { + "KMSEnvMap": { + "fields": { + "keyName": { + "type": "string", + "id": 1 + }, + "cipherText": { + "type": "string", + "id": 2 + } + } + } + } + }, + "Volume": { + "oneofs": { + "source": { + "oneof": [ + "nfs", + "pd", + "gcs", + "deviceName" + ] + } + }, + "fields": { + "nfs": { + "type": "NFS", + "id": 1 + }, + "pd": { + "type": "PD", + "id": 2, + "options": { + "deprecated": true + } + }, + "gcs": { + "type": "GCS", + "id": 3 + }, + "deviceName": { + "type": "string", + "id": 6 + }, + "mountPath": { + "type": "string", + "id": 4 + }, + "mountOptions": { + "rule": "repeated", + "type": "string", + "id": 5 + } + } + }, + "NFS": { + "fields": { + "server": { + "type": "string", + "id": 1 + }, + "remotePath": { + "type": "string", + "id": 2 + } + } + }, + "PD": { + "fields": { + "disk": { + "type": "string", + "id": 1 + }, + "device": { + "type": "string", + "id": 2 + }, + "existing": { + "type": "bool", + "id": 3, + "options": { + "deprecated": true + } + } + } + }, + "GCS": { + "fields": { + "remotePath": { + "type": "string", + "id": 1 + } + } + }, + "CalendarPeriod": { + "values": { + "CALENDAR_PERIOD_UNSPECIFIED": 0, + "MONTH": 1, + "QUARTER": 2, + "YEAR": 3, + "WEEK": 4, + "DAY": 5 + } + }, + "ResourceAllowanceState": { + "values": { + "RESOURCE_ALLOWANCE_STATE_UNSPECIFIED": 0, + "RESOURCE_ALLOWANCE_ACTIVE": 1, + "RESOURCE_ALLOWANCE_DEPLETED": 2 + } + }, + "ResourceAllowance": { + "options": { + "(google.api.resource).type": "batch.googleapis.com/ResourceAllowance", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/resourceAllowances/{resource_allowance}", + "(google.api.resource).plural": "resourceAllowances", + "(google.api.resource).singular": "resourceAllowance" + }, + "oneofs": { + "resourceAllowance": { + "oneof": [ + "usageResourceAllowance" + ] + } + }, + "fields": { + "usageResourceAllowance": { + "type": "UsageResourceAllowance", + "id": 4 + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "uid": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "notifications": { + "rule": "repeated", + "type": "Notification", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UsageResourceAllowance": { + "fields": { + "spec": { + "type": "UsageResourceAllowanceSpec", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "status": { + "type": "UsageResourceAllowanceStatus", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "UsageResourceAllowanceSpec": { + "fields": { + "type": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "limit": { + "type": "Limit", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "Limit": { + "oneofs": { + "duration": { + "oneof": [ + "calendarPeriod" + ] + }, + "_limit": { + "oneof": [ + "limit" + ] + } + }, + "fields": { + "calendarPeriod": { + "type": "CalendarPeriod", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "limit": { + "type": "double", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + } + } + } + } + }, + "UsageResourceAllowanceStatus": { + "fields": { + "state": { + "type": "ResourceAllowanceState", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "limitStatus": { + "type": "LimitStatus", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "report": { + "type": "ConsumptionReport", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "LimitStatus": { + "oneofs": { + "_limit": { + "oneof": [ + "limit" + ] + }, + "_consumed": { + "oneof": [ + "consumed" + ] + } + }, + "fields": { + "consumptionInterval": { + "type": "google.type.Interval", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "limit": { + "type": "double", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "consumed": { + "type": "double", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + } + } + }, + "PeriodConsumption": { + "oneofs": { + "_consumed": { + "oneof": [ + "consumed" + ] + } + }, + "fields": { + "consumptionInterval": { + "type": "google.type.Interval", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "consumed": { + "type": "double", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + } + } + }, + "ConsumptionReport": { + "fields": { + "latestPeriodConsumptions": { + "keyType": "string", + "type": "PeriodConsumption", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, + "Notification": { + "fields": { + "pubsubTopic": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ResourceProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "apiVersion": { + "type": "string", + "id": 525000001, + "extend": "google.protobuf.ServiceOptions" + }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 + }, + "restReferenceDocumentationUri": { + "type": "string", + "id": 111 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "renamedResources": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "ignoredResources": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "forcedNamespaceAliases": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "handwrittenSignatures": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + }, + "autoPopulatedFields": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "PACKAGE_MANAGER": 20 + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + }, + "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 + } + }, + "fieldInfo": { + "type": "google.api.FieldInfo", + "id": 291403980, + "extend": "google.protobuf.FieldOptions" + }, + "FieldInfo": { + "fields": { + "format": { + "type": "Format", + "id": 1 + } + }, + "nested": { + "Format": { + "values": { + "FORMAT_UNSPECIFIED": 0, + "UUID4": 1, + "IPV4": 2, + "IPV6": 3, + "IPV4_OR_IPV6": 4 + } + } + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "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": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "Edition": { + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, + "FileDescriptorProto": { + "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, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "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": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "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": { + "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": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "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": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "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": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19, + "options": { + "packed": false + } + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 18, + 18 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "value": { + "type": "string", + "id": 2 + } + } + } + } + }, + "OneofOptions": { + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "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": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "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": { + "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": { + "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": { + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO2", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + } + }, + "extensions": [ + [ + 1000, + 1000 + ], + [ + 1001, + 1001 + ], + [ + 1002, + 1002 + ], + [ + 9990, + 9990 + ], + [ + 9995, + 9999 + ], + [ + 10000, + 10000 + ] + ], + "reserved": [ + [ + 999, + 999 + ] + ], + "nested": { + "FieldPresence": { + "values": { + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3 + } + }, + "EnumType": { + "values": { + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "RepeatedFieldEncoding": { + "values": { + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2 + } + }, + "Utf8Validation": { + "values": { + "UTF8_VALIDATION_UNKNOWN": 0, + "VERIFY": 2, + "NONE": 3 + } + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + } + } + }, + "FeatureSetDefaults": { + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "features": { + "type": "FeatureSet", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "type": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/type/interval;interval", + "java_multiple_files": true, + "java_outer_classname": "IntervalProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Interval": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.cancel_job.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.cancel_job.js new file mode 100644 index 00000000000..db19d7b5b83 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.cancel_job.js @@ -0,0 +1,76 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START batch_v1alpha_generated_BatchService_CancelJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Job name. + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callCancelJob() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await batchClient.cancelJob(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCancelJob(); + // [END batch_v1alpha_generated_BatchService_CancelJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.create_job.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.create_job.js new file mode 100644 index 00000000000..29d4db9cb4e --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.create_job.js @@ -0,0 +1,92 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, job) { + // [START batch_v1alpha_generated_BatchService_CreateJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name where the Job will be created. + * Pattern: "projects/{project}/locations/{location}" + */ + // const parent = 'abc123' + /** + * ID used to uniquely identify the Job within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and '-' are accepted. + * The '-' character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The job.name field in the request will be ignored and the created resource + * name of the Job will be "{parent}/jobs/{job_id}". + */ + // const jobId = 'abc123' + /** + * Required. The Job to create. + */ + // const job = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callCreateJob() { + // Construct request + const request = { + parent, + job, + }; + + // Run request + const response = await batchClient.createJob(request); + console.log(response); + } + + callCreateJob(); + // [END batch_v1alpha_generated_BatchService_CreateJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.create_resource_allowance.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.create_resource_allowance.js new file mode 100644 index 00000000000..b5856107cd7 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.create_resource_allowance.js @@ -0,0 +1,93 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, resourceAllowance) { + // [START batch_v1alpha_generated_BatchService_CreateResourceAllowance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name where the ResourceAllowance will be + * created. Pattern: "projects/{project}/locations/{location}" + */ + // const parent = 'abc123' + /** + * ID used to uniquely identify the ResourceAllowance within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and '-' are accepted. + * The '-' character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * The resource_allowance.name field in the request will be ignored and the + * created resource name of the ResourceAllowance will be + * "{parent}/resourceAllowances/{resource_allowance_id}". + */ + // const resourceAllowanceId = 'abc123' + /** + * Required. The ResourceAllowance to create. + */ + // const resourceAllowance = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callCreateResourceAllowance() { + // Construct request + const request = { + parent, + resourceAllowance, + }; + + // Run request + const response = await batchClient.createResourceAllowance(request); + console.log(response); + } + + callCreateResourceAllowance(); + // [END batch_v1alpha_generated_BatchService_CreateResourceAllowance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.delete_job.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.delete_job.js new file mode 100644 index 00000000000..3f513786b47 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.delete_job.js @@ -0,0 +1,79 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START batch_v1alpha_generated_BatchService_DeleteJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Job name. + */ + // const name = 'abc123' + /** + * Optional. Reason for this deletion. + */ + // const reason = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callDeleteJob() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await batchClient.deleteJob(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteJob(); + // [END batch_v1alpha_generated_BatchService_DeleteJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.delete_resource_allowance.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.delete_resource_allowance.js new file mode 100644 index 00000000000..5b3cf737119 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.delete_resource_allowance.js @@ -0,0 +1,80 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START batch_v1alpha_generated_BatchService_DeleteResourceAllowance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. ResourceAllowance name. + */ + // const name = 'abc123' + /** + * Optional. Reason for this deletion. + */ + // const reason = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callDeleteResourceAllowance() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await batchClient.deleteResourceAllowance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteResourceAllowance(); + // [END batch_v1alpha_generated_BatchService_DeleteResourceAllowance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_job.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_job.js new file mode 100644 index 00000000000..4a8b7580df0 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_job.js @@ -0,0 +1,61 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START batch_v1alpha_generated_BatchService_GetJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Job name. + */ + // const name = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callGetJob() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await batchClient.getJob(request); + console.log(response); + } + + callGetJob(); + // [END batch_v1alpha_generated_BatchService_GetJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_resource_allowance.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_resource_allowance.js new file mode 100644 index 00000000000..0fbe3143354 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_resource_allowance.js @@ -0,0 +1,61 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START batch_v1alpha_generated_BatchService_GetResourceAllowance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. ResourceAllowance name. + */ + // const name = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callGetResourceAllowance() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await batchClient.getResourceAllowance(request); + console.log(response); + } + + callGetResourceAllowance(); + // [END batch_v1alpha_generated_BatchService_GetResourceAllowance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_task.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_task.js new file mode 100644 index 00000000000..4de5248d352 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_task.js @@ -0,0 +1,61 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START batch_v1alpha_generated_BatchService_GetTask_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Task name. + */ + // const name = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callGetTask() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await batchClient.getTask(request); + console.log(response); + } + + callGetTask(); + // [END batch_v1alpha_generated_BatchService_GetTask_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_jobs.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_jobs.js new file mode 100644 index 00000000000..42a2ecc05b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_jobs.js @@ -0,0 +1,79 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START batch_v1alpha_generated_BatchService_ListJobs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Parent path. + */ + // const parent = 'abc123' + /** + * List filter. + */ + // const filter = 'abc123' + /** + * Optional. Sort results. Supported are "name", "name desc", "create_time", + * and "create_time desc". + */ + // const orderBy = 'abc123' + /** + * Page size. + */ + // const pageSize = 1234 + /** + * Page token. + */ + // const pageToken = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callListJobs() { + // Construct request + const request = { + }; + + // Run request + const iterable = batchClient.listJobsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListJobs(); + // [END batch_v1alpha_generated_BatchService_ListJobs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_resource_allowances.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_resource_allowances.js new file mode 100644 index 00000000000..db9329acf53 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_resource_allowances.js @@ -0,0 +1,71 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START batch_v1alpha_generated_BatchService_ListResourceAllowances_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent path. + */ + // const parent = 'abc123' + /** + * Optional. Page size. + */ + // const pageSize = 1234 + /** + * Optional. Page token. + */ + // const pageToken = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callListResourceAllowances() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = batchClient.listResourceAllowancesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListResourceAllowances(); + // [END batch_v1alpha_generated_BatchService_ListResourceAllowances_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_tasks.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_tasks.js new file mode 100644 index 00000000000..8214c4fede3 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_tasks.js @@ -0,0 +1,83 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START batch_v1alpha_generated_BatchService_ListTasks_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of a TaskGroup from which Tasks are being requested. + * Pattern: + * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + */ + // const parent = 'abc123' + /** + * Task filter, null filter matches all Tasks. + * Filter string should be of the format State=TaskStatus.State e.g. + * State=RUNNING + */ + // const filter = 'abc123' + /** + * Not implemented. + */ + // const orderBy = 'abc123' + /** + * Page size. + */ + // const pageSize = 1234 + /** + * Page token. + */ + // const pageToken = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callListTasks() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = batchClient.listTasksAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTasks(); + // [END batch_v1alpha_generated_BatchService_ListTasks_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.update_job.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.update_job.js new file mode 100644 index 00000000000..3b8066040b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.update_job.js @@ -0,0 +1,95 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(job, updateMask) { + // [START batch_v1alpha_generated_BatchService_UpdateJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The Job to update. + * Only fields specified in `updateMask` are updated. + */ + // const job = {} + /** + * Required. Mask of fields to update. + * The `jobs.patch` method can only be used while a job is in the `QUEUED`, + * `SCHEDULED`, or `RUNNING` state and currently only supports increasing the + * value of the first `taskCount` field in the job's `taskGroups` field. + * Therefore, you must set the value of `updateMask` to `taskGroups`. Any + * other job fields in the update request will be ignored. + * For example, to update a job's `taskCount` to `2`, set `updateMask` to + * `taskGroups` and use the following request body: + * ``` + * { + * "taskGroups":{ + * "taskCount": 2 + * } + * } + * ``` + */ + // const updateMask = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callUpdateJob() { + // Construct request + const request = { + job, + updateMask, + }; + + // Run request + const response = await batchClient.updateJob(request); + console.log(response); + } + + callUpdateJob(); + // [END batch_v1alpha_generated_BatchService_UpdateJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.update_resource_allowance.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.update_resource_allowance.js new file mode 100644 index 00000000000..0cdf6071c8f --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.update_resource_allowance.js @@ -0,0 +1,88 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(resourceAllowance, updateMask) { + // [START batch_v1alpha_generated_BatchService_UpdateResourceAllowance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The ResourceAllowance to update. + * Update description. + * Only fields specified in `update_mask` are updated. + */ + // const resourceAllowance = {} + /** + * Required. Mask of fields to update. + * Field mask is used to specify the fields to be overwritten in the + * ResourceAllowance resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * UpdateResourceAllowance request now only supports update on `limit` field. + */ + // const updateMask = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callUpdateResourceAllowance() { + // Construct request + const request = { + resourceAllowance, + updateMask, + }; + + // Run request + const response = await batchClient.updateResourceAllowance(request); + console.log(response); + } + + callUpdateResourceAllowance(); + // [END batch_v1alpha_generated_BatchService_UpdateResourceAllowance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/snippet_metadata_google.cloud.batch.v1alpha.json b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/snippet_metadata_google.cloud.batch.v1alpha.json new file mode 100644 index 00000000000..a02256ec594 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/snippet_metadata_google.cloud.batch.v1alpha.json @@ -0,0 +1,635 @@ +{ + "clientLibrary": { + "name": "nodejs-batch", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.batch.v1alpha", + "version": "v1alpha" + } + ] + }, + "snippets": [ + { + "regionTag": "batch_v1alpha_generated_BatchService_CreateJob_async", + "title": "BatchService createJob Sample", + "origin": "API_DEFINITION", + "description": " Create a Job.", + "canonical": true, + "file": "batch_service.create_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 84, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateJob", + "fullName": "google.cloud.batch.v1alpha.BatchService.CreateJob", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "job_id", + "type": "TYPE_STRING" + }, + { + "name": "job", + "type": ".google.cloud.batch.v1alpha.Job" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.batch.v1alpha.Job", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" + }, + "method": { + "shortName": "CreateJob", + "fullName": "google.cloud.batch.v1alpha.BatchService.CreateJob", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1alpha.BatchService" + } + } + } + }, + { + "regionTag": "batch_v1alpha_generated_BatchService_GetJob_async", + "title": "BatchService getJob Sample", + "origin": "API_DEFINITION", + "description": " Get a Job specified by its resource name.", + "canonical": true, + "file": "batch_service.get_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetJob", + "fullName": "google.cloud.batch.v1alpha.BatchService.GetJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.batch.v1alpha.Job", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" + }, + "method": { + "shortName": "GetJob", + "fullName": "google.cloud.batch.v1alpha.BatchService.GetJob", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1alpha.BatchService" + } + } + } + }, + { + "regionTag": "batch_v1alpha_generated_BatchService_DeleteJob_async", + "title": "BatchService deleteJob Sample", + "origin": "API_DEFINITION", + "description": " Delete a Job.", + "canonical": true, + "file": "batch_service.delete_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteJob", + "fullName": "google.cloud.batch.v1alpha.BatchService.DeleteJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "reason", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" + }, + "method": { + "shortName": "DeleteJob", + "fullName": "google.cloud.batch.v1alpha.BatchService.DeleteJob", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1alpha.BatchService" + } + } + } + }, + { + "regionTag": "batch_v1alpha_generated_BatchService_CancelJob_async", + "title": "BatchService cancelJob Sample", + "origin": "API_DEFINITION", + "description": " Cancel a Job.", + "canonical": true, + "file": "batch_service.cancel_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CancelJob", + "fullName": "google.cloud.batch.v1alpha.BatchService.CancelJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" + }, + "method": { + "shortName": "CancelJob", + "fullName": "google.cloud.batch.v1alpha.BatchService.CancelJob", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1alpha.BatchService" + } + } + } + }, + { + "regionTag": "batch_v1alpha_generated_BatchService_UpdateJob_async", + "title": "BatchService updateJob Sample", + "origin": "API_DEFINITION", + "description": " Update a Job.", + "canonical": true, + "file": "batch_service.update_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 87, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateJob", + "fullName": "google.cloud.batch.v1alpha.BatchService.UpdateJob", + "async": true, + "parameters": [ + { + "name": "job", + "type": ".google.cloud.batch.v1alpha.Job" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.batch.v1alpha.Job", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" + }, + "method": { + "shortName": "UpdateJob", + "fullName": "google.cloud.batch.v1alpha.BatchService.UpdateJob", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1alpha.BatchService" + } + } + } + }, + { + "regionTag": "batch_v1alpha_generated_BatchService_ListJobs_async", + "title": "BatchService listJobs Sample", + "origin": "API_DEFINITION", + "description": " List all Jobs for a project within a region.", + "canonical": true, + "file": "batch_service.list_jobs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListJobs", + "fullName": "google.cloud.batch.v1alpha.BatchService.ListJobs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.batch.v1alpha.ListJobsResponse", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" + }, + "method": { + "shortName": "ListJobs", + "fullName": "google.cloud.batch.v1alpha.BatchService.ListJobs", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1alpha.BatchService" + } + } + } + }, + { + "regionTag": "batch_v1alpha_generated_BatchService_GetTask_async", + "title": "BatchService getTask Sample", + "origin": "API_DEFINITION", + "description": " Return a single Task.", + "canonical": true, + "file": "batch_service.get_task.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetTask", + "fullName": "google.cloud.batch.v1alpha.BatchService.GetTask", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.batch.v1alpha.Task", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" + }, + "method": { + "shortName": "GetTask", + "fullName": "google.cloud.batch.v1alpha.BatchService.GetTask", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1alpha.BatchService" + } + } + } + }, + { + "regionTag": "batch_v1alpha_generated_BatchService_ListTasks_async", + "title": "BatchService listTasks Sample", + "origin": "API_DEFINITION", + "description": " List Tasks associated with a job.", + "canonical": true, + "file": "batch_service.list_tasks.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListTasks", + "fullName": "google.cloud.batch.v1alpha.BatchService.ListTasks", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.batch.v1alpha.ListTasksResponse", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" + }, + "method": { + "shortName": "ListTasks", + "fullName": "google.cloud.batch.v1alpha.BatchService.ListTasks", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1alpha.BatchService" + } + } + } + }, + { + "regionTag": "batch_v1alpha_generated_BatchService_CreateResourceAllowance_async", + "title": "BatchService createResourceAllowance Sample", + "origin": "API_DEFINITION", + "description": " Create a Resource Allowance.", + "canonical": true, + "file": "batch_service.create_resource_allowance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateResourceAllowance", + "fullName": "google.cloud.batch.v1alpha.BatchService.CreateResourceAllowance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "resource_allowance_id", + "type": "TYPE_STRING" + }, + { + "name": "resource_allowance", + "type": ".google.cloud.batch.v1alpha.ResourceAllowance" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.batch.v1alpha.ResourceAllowance", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" + }, + "method": { + "shortName": "CreateResourceAllowance", + "fullName": "google.cloud.batch.v1alpha.BatchService.CreateResourceAllowance", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1alpha.BatchService" + } + } + } + }, + { + "regionTag": "batch_v1alpha_generated_BatchService_GetResourceAllowance_async", + "title": "BatchService getResourceAllowance Sample", + "origin": "API_DEFINITION", + "description": " Get a ResourceAllowance specified by its resource name.", + "canonical": true, + "file": "batch_service.get_resource_allowance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetResourceAllowance", + "fullName": "google.cloud.batch.v1alpha.BatchService.GetResourceAllowance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.batch.v1alpha.ResourceAllowance", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" + }, + "method": { + "shortName": "GetResourceAllowance", + "fullName": "google.cloud.batch.v1alpha.BatchService.GetResourceAllowance", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1alpha.BatchService" + } + } + } + }, + { + "regionTag": "batch_v1alpha_generated_BatchService_DeleteResourceAllowance_async", + "title": "BatchService deleteResourceAllowance Sample", + "origin": "API_DEFINITION", + "description": " Delete a ResourceAllowance.", + "canonical": true, + "file": "batch_service.delete_resource_allowance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteResourceAllowance", + "fullName": "google.cloud.batch.v1alpha.BatchService.DeleteResourceAllowance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "reason", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" + }, + "method": { + "shortName": "DeleteResourceAllowance", + "fullName": "google.cloud.batch.v1alpha.BatchService.DeleteResourceAllowance", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1alpha.BatchService" + } + } + } + }, + { + "regionTag": "batch_v1alpha_generated_BatchService_ListResourceAllowances_async", + "title": "BatchService listResourceAllowances Sample", + "origin": "API_DEFINITION", + "description": " List all ResourceAllowances for a project within a region.", + "canonical": true, + "file": "batch_service.list_resource_allowances.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListResourceAllowances", + "fullName": "google.cloud.batch.v1alpha.BatchService.ListResourceAllowances", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.batch.v1alpha.ListResourceAllowancesResponse", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" + }, + "method": { + "shortName": "ListResourceAllowances", + "fullName": "google.cloud.batch.v1alpha.BatchService.ListResourceAllowances", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1alpha.BatchService" + } + } + } + }, + { + "regionTag": "batch_v1alpha_generated_BatchService_UpdateResourceAllowance_async", + "title": "BatchService updateResourceAllowance Sample", + "origin": "API_DEFINITION", + "description": " Update a Resource Allowance.", + "canonical": true, + "file": "batch_service.update_resource_allowance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateResourceAllowance", + "fullName": "google.cloud.batch.v1alpha.BatchService.UpdateResourceAllowance", + "async": true, + "parameters": [ + { + "name": "resource_allowance", + "type": ".google.cloud.batch.v1alpha.ResourceAllowance" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.batch.v1alpha.ResourceAllowance", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" + }, + "method": { + "shortName": "UpdateResourceAllowance", + "fullName": "google.cloud.batch.v1alpha.BatchService.UpdateResourceAllowance", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1alpha.BatchService" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/src/index.ts b/owl-bot-staging/google-cloud-batch/v1alpha/src/index.ts new file mode 100644 index 00000000000..8208d9bc746 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 v1alpha from './v1alpha'; +const BatchServiceClient = v1alpha.BatchServiceClient; +type BatchServiceClient = v1alpha.BatchServiceClient; +export {v1alpha, BatchServiceClient}; +export default {v1alpha, BatchServiceClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_client.ts b/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_client.ts new file mode 100644 index 00000000000..c7897648928 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_client.ts @@ -0,0 +1,2441 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v1alpha/batch_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './batch_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Google Batch Service. + * The service manages user submitted batch jobs and allocates Google Compute + * Engine VM instances to run the jobs. + * @class + * @memberof v1alpha + */ +export class BatchServiceClient { + 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; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + batchServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of BatchServiceClient. + * + * @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://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @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 BatchServiceClient({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 BatchServiceClient; + 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 = 'batch.' + 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; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + jobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/jobs/{job}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + resourceAllowancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/resourceAllowances/{resource_allowance}' + ), + taskPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}/tasks/{task}' + ), + taskGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}' + ), + }; + + // 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 = { + listJobs: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'jobs'), + listTasks: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'tasks'), + listResourceAllowances: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'resourceAllowances') + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v1alpha/{name=projects/*/locations/*}',},{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1alpha/{name=projects/*}/locations',},{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1alpha/{name=projects/*/locations/*/operations/*}:cancel',body: '*',},{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1alpha/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1alpha/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1alpha/{name=projects/*/locations/*}/operations',}]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const deleteJobResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteJobMetadata = protoFilesRoot.lookup( + '.google.cloud.batch.v1alpha.OperationMetadata') as gax.protobuf.Type; + const cancelJobResponse = protoFilesRoot.lookup( + '.google.cloud.batch.v1alpha.CancelJobResponse') as gax.protobuf.Type; + const cancelJobMetadata = protoFilesRoot.lookup( + '.google.cloud.batch.v1alpha.OperationMetadata') as gax.protobuf.Type; + const deleteResourceAllowanceResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteResourceAllowanceMetadata = protoFilesRoot.lookup( + '.google.cloud.batch.v1alpha.OperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + deleteJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteJobResponse.decode.bind(deleteJobResponse), + deleteJobMetadata.decode.bind(deleteJobMetadata)), + cancelJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + cancelJobResponse.decode.bind(cancelJobResponse), + cancelJobMetadata.decode.bind(cancelJobMetadata)), + deleteResourceAllowance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteResourceAllowanceResponse.decode.bind(deleteResourceAllowanceResponse), + deleteResourceAllowanceMetadata.decode.bind(deleteResourceAllowanceMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.batch.v1alpha.BatchService', 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.batchServiceStub) { + return this.batchServiceStub; + } + + // Put together the "service stub" for + // google.cloud.batch.v1alpha.BatchService. + this.batchServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.batch.v1alpha.BatchService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.batch.v1alpha.BatchService, + 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 batchServiceStubMethods = + ['createJob', 'getJob', 'deleteJob', 'cancelJob', 'updateJob', 'listJobs', 'getTask', 'listTasks', 'createResourceAllowance', 'getResourceAllowance', 'deleteResourceAllowance', 'listResourceAllowances', 'updateResourceAllowance']; + for (const methodName of batchServiceStubMethods) { + const callPromise = this.batchServiceStub.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.batchServiceStub; + } + + /** + * 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 'batch.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 'batch.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' + ]; + } + + 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 -- + // ------------------- +/** + * Create a Job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name where the Job will be created. + * Pattern: "projects/{project}/locations/{location}" + * @param {string} request.jobId + * ID used to uniquely identify the Job within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and '-' are accepted. + * The '-' character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * + * The job.name field in the request will be ignored and the created resource + * name of the Job will be "{parent}/jobs/{job_id}". + * @param {google.cloud.batch.v1alpha.Job} request.job + * Required. The Job to create. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1alpha.Job|Job}. + * 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/v1alpha/batch_service.create_job.js + * region_tag:batch_v1alpha_generated_BatchService_CreateJob_async + */ + createJob( + request?: protos.google.cloud.batch.v1alpha.ICreateJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.ICreateJobRequest|undefined, {}|undefined + ]>; + createJob( + request: protos.google.cloud.batch.v1alpha.ICreateJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.ICreateJobRequest|null|undefined, + {}|null|undefined>): void; + createJob( + request: protos.google.cloud.batch.v1alpha.ICreateJobRequest, + callback: Callback< + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.ICreateJobRequest|null|undefined, + {}|null|undefined>): void; + createJob( + request?: protos.google.cloud.batch.v1alpha.ICreateJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.ICreateJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.ICreateJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.ICreateJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createJob(request, options, callback); + } +/** + * Get a Job specified by its resource name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Job name. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1alpha.Job|Job}. + * 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/v1alpha/batch_service.get_job.js + * region_tag:batch_v1alpha_generated_BatchService_GetJob_async + */ + getJob( + request?: protos.google.cloud.batch.v1alpha.IGetJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.IGetJobRequest|undefined, {}|undefined + ]>; + getJob( + request: protos.google.cloud.batch.v1alpha.IGetJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.IGetJobRequest|null|undefined, + {}|null|undefined>): void; + getJob( + request: protos.google.cloud.batch.v1alpha.IGetJobRequest, + callback: Callback< + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.IGetJobRequest|null|undefined, + {}|null|undefined>): void; + getJob( + request?: protos.google.cloud.batch.v1alpha.IGetJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.IGetJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.IGetJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.IGetJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getJob(request, options, callback); + } +/** + * Update a Job. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.batch.v1alpha.Job} request.job + * Required. The Job to update. + * Only fields specified in `updateMask` are updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. + * + * The `jobs.patch` method can only be used while a job is in the `QUEUED`, + * `SCHEDULED`, or `RUNNING` state and currently only supports increasing the + * value of the first `taskCount` field in the job's `taskGroups` field. + * Therefore, you must set the value of `updateMask` to `taskGroups`. Any + * other job fields in the update request will be ignored. + * + * For example, to update a job's `taskCount` to `2`, set `updateMask` to + * `taskGroups` and use the following request body: + * ``` + * { + * "taskGroups":[{ + * "taskCount": 2 + * }] + * } + * ``` + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1alpha.Job|Job}. + * 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/v1alpha/batch_service.update_job.js + * region_tag:batch_v1alpha_generated_BatchService_UpdateJob_async + */ + updateJob( + request?: protos.google.cloud.batch.v1alpha.IUpdateJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.IUpdateJobRequest|undefined, {}|undefined + ]>; + updateJob( + request: protos.google.cloud.batch.v1alpha.IUpdateJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.IUpdateJobRequest|null|undefined, + {}|null|undefined>): void; + updateJob( + request: protos.google.cloud.batch.v1alpha.IUpdateJobRequest, + callback: Callback< + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.IUpdateJobRequest|null|undefined, + {}|null|undefined>): void; + updateJob( + request?: protos.google.cloud.batch.v1alpha.IUpdateJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.IUpdateJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.IUpdateJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.IUpdateJobRequest|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({ + 'job.name': request.job!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateJob(request, options, callback); + } +/** + * Return a single Task. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Task name. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1alpha.Task|Task}. + * 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/v1alpha/batch_service.get_task.js + * region_tag:batch_v1alpha_generated_BatchService_GetTask_async + */ + getTask( + request?: protos.google.cloud.batch.v1alpha.IGetTaskRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.batch.v1alpha.ITask, + protos.google.cloud.batch.v1alpha.IGetTaskRequest|undefined, {}|undefined + ]>; + getTask( + request: protos.google.cloud.batch.v1alpha.IGetTaskRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.batch.v1alpha.ITask, + protos.google.cloud.batch.v1alpha.IGetTaskRequest|null|undefined, + {}|null|undefined>): void; + getTask( + request: protos.google.cloud.batch.v1alpha.IGetTaskRequest, + callback: Callback< + protos.google.cloud.batch.v1alpha.ITask, + protos.google.cloud.batch.v1alpha.IGetTaskRequest|null|undefined, + {}|null|undefined>): void; + getTask( + request?: protos.google.cloud.batch.v1alpha.IGetTaskRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.batch.v1alpha.ITask, + protos.google.cloud.batch.v1alpha.IGetTaskRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.batch.v1alpha.ITask, + protos.google.cloud.batch.v1alpha.IGetTaskRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.batch.v1alpha.ITask, + protos.google.cloud.batch.v1alpha.IGetTaskRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getTask(request, options, callback); + } +/** + * Create a Resource Allowance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name where the ResourceAllowance will be + * created. Pattern: "projects/{project}/locations/{location}" + * @param {string} request.resourceAllowanceId + * ID used to uniquely identify the ResourceAllowance within its parent scope. + * This field should contain at most 63 characters and must start with + * lowercase characters. + * Only lowercase characters, numbers and '-' are accepted. + * The '-' character cannot be the first or the last one. + * A system generated ID will be used if the field is not set. + * + * The resource_allowance.name field in the request will be ignored and the + * created resource name of the ResourceAllowance will be + * "{parent}/resourceAllowances/{resource_allowance_id}". + * @param {google.cloud.batch.v1alpha.ResourceAllowance} request.resourceAllowance + * Required. The ResourceAllowance to create. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1alpha.ResourceAllowance|ResourceAllowance}. + * 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/v1alpha/batch_service.create_resource_allowance.js + * region_tag:batch_v1alpha_generated_BatchService_CreateResourceAllowance_async + */ + createResourceAllowance( + request?: protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.batch.v1alpha.IResourceAllowance, + protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest|undefined, {}|undefined + ]>; + createResourceAllowance( + request: protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.batch.v1alpha.IResourceAllowance, + protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest|null|undefined, + {}|null|undefined>): void; + createResourceAllowance( + request: protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest, + callback: Callback< + protos.google.cloud.batch.v1alpha.IResourceAllowance, + protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest|null|undefined, + {}|null|undefined>): void; + createResourceAllowance( + request?: protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.batch.v1alpha.IResourceAllowance, + protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.batch.v1alpha.IResourceAllowance, + protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.batch.v1alpha.IResourceAllowance, + protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createResourceAllowance(request, options, callback); + } +/** + * Get a ResourceAllowance specified by its resource name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. ResourceAllowance name. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1alpha.ResourceAllowance|ResourceAllowance}. + * 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/v1alpha/batch_service.get_resource_allowance.js + * region_tag:batch_v1alpha_generated_BatchService_GetResourceAllowance_async + */ + getResourceAllowance( + request?: protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.batch.v1alpha.IResourceAllowance, + protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest|undefined, {}|undefined + ]>; + getResourceAllowance( + request: protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.batch.v1alpha.IResourceAllowance, + protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest|null|undefined, + {}|null|undefined>): void; + getResourceAllowance( + request: protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest, + callback: Callback< + protos.google.cloud.batch.v1alpha.IResourceAllowance, + protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest|null|undefined, + {}|null|undefined>): void; + getResourceAllowance( + request?: protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.batch.v1alpha.IResourceAllowance, + protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.batch.v1alpha.IResourceAllowance, + protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.batch.v1alpha.IResourceAllowance, + protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getResourceAllowance(request, options, callback); + } +/** + * Update a Resource Allowance. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.batch.v1alpha.ResourceAllowance} request.resourceAllowance + * Required. The ResourceAllowance to update. + * Update description. + * Only fields specified in `update_mask` are updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. + * + * Field mask is used to specify the fields to be overwritten in the + * ResourceAllowance resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * UpdateResourceAllowance request now only supports update on `limit` field. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1alpha.ResourceAllowance|ResourceAllowance}. + * 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/v1alpha/batch_service.update_resource_allowance.js + * region_tag:batch_v1alpha_generated_BatchService_UpdateResourceAllowance_async + */ + updateResourceAllowance( + request?: protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.batch.v1alpha.IResourceAllowance, + protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest|undefined, {}|undefined + ]>; + updateResourceAllowance( + request: protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.batch.v1alpha.IResourceAllowance, + protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest|null|undefined, + {}|null|undefined>): void; + updateResourceAllowance( + request: protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest, + callback: Callback< + protos.google.cloud.batch.v1alpha.IResourceAllowance, + protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest|null|undefined, + {}|null|undefined>): void; + updateResourceAllowance( + request?: protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.batch.v1alpha.IResourceAllowance, + protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.batch.v1alpha.IResourceAllowance, + protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.batch.v1alpha.IResourceAllowance, + protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'resource_allowance.name': request.resourceAllowance!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateResourceAllowance(request, options, callback); + } + +/** + * Delete a Job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Job name. + * @param {string} [request.reason] + * Optional. Reason for this deletion. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v1alpha/batch_service.delete_job.js + * region_tag:batch_v1alpha_generated_BatchService_DeleteJob_async + */ + deleteJob( + request?: protos.google.cloud.batch.v1alpha.IDeleteJobRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteJob( + request: protos.google.cloud.batch.v1alpha.IDeleteJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteJob( + request: protos.google.cloud.batch.v1alpha.IDeleteJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteJob( + request?: protos.google.cloud.batch.v1alpha.IDeleteJobRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteJob(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteJob()`. + * @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/v1alpha/batch_service.delete_job.js + * region_tag:batch_v1alpha_generated_BatchService_DeleteJob_async + */ + async checkDeleteJobProgress(name: string): Promise>{ + 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.deleteJob, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Cancel a Job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Job name. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v1alpha/batch_service.cancel_job.js + * region_tag:batch_v1alpha_generated_BatchService_CancelJob_async + */ + cancelJob( + request?: protos.google.cloud.batch.v1alpha.ICancelJobRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + cancelJob( + request: protos.google.cloud.batch.v1alpha.ICancelJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + cancelJob( + request: protos.google.cloud.batch.v1alpha.ICancelJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + cancelJob( + request?: protos.google.cloud.batch.v1alpha.ICancelJobRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.cancelJob(request, options, callback); + } +/** + * Check the status of the long running operation returned by `cancelJob()`. + * @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/v1alpha/batch_service.cancel_job.js + * region_tag:batch_v1alpha_generated_BatchService_CancelJob_async + */ + async checkCancelJobProgress(name: string): Promise>{ + 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.cancelJob, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Delete a ResourceAllowance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. ResourceAllowance name. + * @param {string} [request.reason] + * Optional. Reason for this deletion. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v1alpha/batch_service.delete_resource_allowance.js + * region_tag:batch_v1alpha_generated_BatchService_DeleteResourceAllowance_async + */ + deleteResourceAllowance( + request?: protos.google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteResourceAllowance( + request: protos.google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteResourceAllowance( + request: protos.google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteResourceAllowance( + request?: protos.google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteResourceAllowance(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteResourceAllowance()`. + * @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/v1alpha/batch_service.delete_resource_allowance.js + * region_tag:batch_v1alpha_generated_BatchService_DeleteResourceAllowance_async + */ + async checkDeleteResourceAllowanceProgress(name: string): Promise>{ + 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.deleteResourceAllowance, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * List all Jobs for a project within a region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Parent path. + * @param {string} request.filter + * List filter. + * @param {string} [request.orderBy] + * Optional. Sort results. Supported are "name", "name desc", "create_time", + * and "create_time desc". + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.batch.v1alpha.Job|Job}. + * 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 `listJobsAsync()` + * 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. + */ + listJobs( + request?: protos.google.cloud.batch.v1alpha.IListJobsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.batch.v1alpha.IJob[], + protos.google.cloud.batch.v1alpha.IListJobsRequest|null, + protos.google.cloud.batch.v1alpha.IListJobsResponse + ]>; + listJobs( + request: protos.google.cloud.batch.v1alpha.IListJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.batch.v1alpha.IListJobsRequest, + protos.google.cloud.batch.v1alpha.IListJobsResponse|null|undefined, + protos.google.cloud.batch.v1alpha.IJob>): void; + listJobs( + request: protos.google.cloud.batch.v1alpha.IListJobsRequest, + callback: PaginationCallback< + protos.google.cloud.batch.v1alpha.IListJobsRequest, + protos.google.cloud.batch.v1alpha.IListJobsResponse|null|undefined, + protos.google.cloud.batch.v1alpha.IJob>): void; + listJobs( + request?: protos.google.cloud.batch.v1alpha.IListJobsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.batch.v1alpha.IListJobsRequest, + protos.google.cloud.batch.v1alpha.IListJobsResponse|null|undefined, + protos.google.cloud.batch.v1alpha.IJob>, + callback?: PaginationCallback< + protos.google.cloud.batch.v1alpha.IListJobsRequest, + protos.google.cloud.batch.v1alpha.IListJobsResponse|null|undefined, + protos.google.cloud.batch.v1alpha.IJob>): + Promise<[ + protos.google.cloud.batch.v1alpha.IJob[], + protos.google.cloud.batch.v1alpha.IListJobsRequest|null, + protos.google.cloud.batch.v1alpha.IListJobsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listJobs(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Parent path. + * @param {string} request.filter + * List filter. + * @param {string} [request.orderBy] + * Optional. Sort results. Supported are "name", "name desc", "create_time", + * and "create_time desc". + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.batch.v1alpha.Job|Job} 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 `listJobsAsync()` + * 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. + */ + listJobsStream( + request?: protos.google.cloud.batch.v1alpha.IListJobsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listJobs.createStream( + this.innerApiCalls.listJobs as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listJobs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Parent path. + * @param {string} request.filter + * List filter. + * @param {string} [request.orderBy] + * Optional. Sort results. Supported are "name", "name desc", "create_time", + * and "create_time desc". + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.batch.v1alpha.Job|Job}. 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/v1alpha/batch_service.list_jobs.js + * region_tag:batch_v1alpha_generated_BatchService_ListJobs_async + */ + listJobsAsync( + request?: protos.google.cloud.batch.v1alpha.IListJobsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listJobs.asyncIterate( + this.innerApiCalls['listJobs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List Tasks associated with a job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of a TaskGroup from which Tasks are being requested. + * Pattern: + * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + * @param {string} request.filter + * Task filter, null filter matches all Tasks. + * Filter string should be of the format State=TaskStatus.State e.g. + * State=RUNNING + * @param {string} request.orderBy + * Not implemented. + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.batch.v1alpha.Task|Task}. + * 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 `listTasksAsync()` + * 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. + */ + listTasks( + request?: protos.google.cloud.batch.v1alpha.IListTasksRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.batch.v1alpha.ITask[], + protos.google.cloud.batch.v1alpha.IListTasksRequest|null, + protos.google.cloud.batch.v1alpha.IListTasksResponse + ]>; + listTasks( + request: protos.google.cloud.batch.v1alpha.IListTasksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.batch.v1alpha.IListTasksRequest, + protos.google.cloud.batch.v1alpha.IListTasksResponse|null|undefined, + protos.google.cloud.batch.v1alpha.ITask>): void; + listTasks( + request: protos.google.cloud.batch.v1alpha.IListTasksRequest, + callback: PaginationCallback< + protos.google.cloud.batch.v1alpha.IListTasksRequest, + protos.google.cloud.batch.v1alpha.IListTasksResponse|null|undefined, + protos.google.cloud.batch.v1alpha.ITask>): void; + listTasks( + request?: protos.google.cloud.batch.v1alpha.IListTasksRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.batch.v1alpha.IListTasksRequest, + protos.google.cloud.batch.v1alpha.IListTasksResponse|null|undefined, + protos.google.cloud.batch.v1alpha.ITask>, + callback?: PaginationCallback< + protos.google.cloud.batch.v1alpha.IListTasksRequest, + protos.google.cloud.batch.v1alpha.IListTasksResponse|null|undefined, + protos.google.cloud.batch.v1alpha.ITask>): + Promise<[ + protos.google.cloud.batch.v1alpha.ITask[], + protos.google.cloud.batch.v1alpha.IListTasksRequest|null, + protos.google.cloud.batch.v1alpha.IListTasksResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listTasks(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of a TaskGroup from which Tasks are being requested. + * Pattern: + * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + * @param {string} request.filter + * Task filter, null filter matches all Tasks. + * Filter string should be of the format State=TaskStatus.State e.g. + * State=RUNNING + * @param {string} request.orderBy + * Not implemented. + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.batch.v1alpha.Task|Task} 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 `listTasksAsync()` + * 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. + */ + listTasksStream( + request?: protos.google.cloud.batch.v1alpha.IListTasksRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listTasks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTasks.createStream( + this.innerApiCalls.listTasks as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listTasks`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of a TaskGroup from which Tasks are being requested. + * Pattern: + * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" + * @param {string} request.filter + * Task filter, null filter matches all Tasks. + * Filter string should be of the format State=TaskStatus.State e.g. + * State=RUNNING + * @param {string} request.orderBy + * Not implemented. + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.batch.v1alpha.Task|Task}. 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/v1alpha/batch_service.list_tasks.js + * region_tag:batch_v1alpha_generated_BatchService_ListTasks_async + */ + listTasksAsync( + request?: protos.google.cloud.batch.v1alpha.IListTasksRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listTasks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTasks.asyncIterate( + this.innerApiCalls['listTasks'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List all ResourceAllowances for a project within a region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent path. + * @param {number} [request.pageSize] + * Optional. Page size. + * @param {string} [request.pageToken] + * Optional. Page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.batch.v1alpha.ResourceAllowance|ResourceAllowance}. + * 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 `listResourceAllowancesAsync()` + * 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. + */ + listResourceAllowances( + request?: protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.batch.v1alpha.IResourceAllowance[], + protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest|null, + protos.google.cloud.batch.v1alpha.IListResourceAllowancesResponse + ]>; + listResourceAllowances( + request: protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, + protos.google.cloud.batch.v1alpha.IListResourceAllowancesResponse|null|undefined, + protos.google.cloud.batch.v1alpha.IResourceAllowance>): void; + listResourceAllowances( + request: protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, + callback: PaginationCallback< + protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, + protos.google.cloud.batch.v1alpha.IListResourceAllowancesResponse|null|undefined, + protos.google.cloud.batch.v1alpha.IResourceAllowance>): void; + listResourceAllowances( + request?: protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, + protos.google.cloud.batch.v1alpha.IListResourceAllowancesResponse|null|undefined, + protos.google.cloud.batch.v1alpha.IResourceAllowance>, + callback?: PaginationCallback< + protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, + protos.google.cloud.batch.v1alpha.IListResourceAllowancesResponse|null|undefined, + protos.google.cloud.batch.v1alpha.IResourceAllowance>): + Promise<[ + protos.google.cloud.batch.v1alpha.IResourceAllowance[], + protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest|null, + protos.google.cloud.batch.v1alpha.IListResourceAllowancesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listResourceAllowances(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent path. + * @param {number} [request.pageSize] + * Optional. Page size. + * @param {string} [request.pageToken] + * Optional. Page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.batch.v1alpha.ResourceAllowance|ResourceAllowance} 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 `listResourceAllowancesAsync()` + * 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. + */ + listResourceAllowancesStream( + request?: protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listResourceAllowances']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listResourceAllowances.createStream( + this.innerApiCalls.listResourceAllowances as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listResourceAllowances`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent path. + * @param {number} [request.pageSize] + * Optional. Page size. + * @param {string} [request.pageToken] + * Optional. Page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.batch.v1alpha.ResourceAllowance|ResourceAllowance}. 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/v1alpha/batch_service.list_resource_allowances.js + * region_tag:batch_v1alpha_generated_BatchService_ListResourceAllowances_async + */ + listResourceAllowancesAsync( + request?: protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listResourceAllowances']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listResourceAllowances.asyncIterate( + this.innerApiCalls['listResourceAllowances'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * 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, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@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 { + 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, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@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, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified job resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} job + * @returns {string} Resource name string. + */ + jobPath(project:string,location:string,job:string) { + return this.pathTemplates.jobPathTemplate.render({ + project: project, + location: location, + job: job, + }); + } + + /** + * Parse the project from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the project. + */ + matchProjectFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).project; + } + + /** + * Parse the location from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the location. + */ + matchLocationFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).location; + } + + /** + * Parse the job from Job resource. + * + * @param {string} jobName + * A fully-qualified path representing Job resource. + * @returns {string} A string representing the job. + */ + matchJobFromJobName(jobName: string) { + return this.pathTemplates.jobPathTemplate.match(jobName).job; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified resourceAllowance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} resource_allowance + * @returns {string} Resource name string. + */ + resourceAllowancePath(project:string,location:string,resourceAllowance:string) { + return this.pathTemplates.resourceAllowancePathTemplate.render({ + project: project, + location: location, + resource_allowance: resourceAllowance, + }); + } + + /** + * Parse the project from ResourceAllowance resource. + * + * @param {string} resourceAllowanceName + * A fully-qualified path representing ResourceAllowance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromResourceAllowanceName(resourceAllowanceName: string) { + return this.pathTemplates.resourceAllowancePathTemplate.match(resourceAllowanceName).project; + } + + /** + * Parse the location from ResourceAllowance resource. + * + * @param {string} resourceAllowanceName + * A fully-qualified path representing ResourceAllowance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromResourceAllowanceName(resourceAllowanceName: string) { + return this.pathTemplates.resourceAllowancePathTemplate.match(resourceAllowanceName).location; + } + + /** + * Parse the resource_allowance from ResourceAllowance resource. + * + * @param {string} resourceAllowanceName + * A fully-qualified path representing ResourceAllowance resource. + * @returns {string} A string representing the resource_allowance. + */ + matchResourceAllowanceFromResourceAllowanceName(resourceAllowanceName: string) { + return this.pathTemplates.resourceAllowancePathTemplate.match(resourceAllowanceName).resource_allowance; + } + + /** + * Return a fully-qualified task resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} job + * @param {string} task_group + * @param {string} task + * @returns {string} Resource name string. + */ + taskPath(project:string,location:string,job:string,taskGroup:string,task:string) { + return this.pathTemplates.taskPathTemplate.render({ + project: project, + location: location, + job: job, + task_group: taskGroup, + task: task, + }); + } + + /** + * Parse the project from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).project; + } + + /** + * Parse the location from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).location; + } + + /** + * Parse the job from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the job. + */ + matchJobFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).job; + } + + /** + * Parse the task_group from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the task_group. + */ + matchTaskGroupFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).task_group; + } + + /** + * Parse the task from Task resource. + * + * @param {string} taskName + * A fully-qualified path representing Task resource. + * @returns {string} A string representing the task. + */ + matchTaskFromTaskName(taskName: string) { + return this.pathTemplates.taskPathTemplate.match(taskName).task; + } + + /** + * Return a fully-qualified taskGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} job + * @param {string} task_group + * @returns {string} Resource name string. + */ + taskGroupPath(project:string,location:string,job:string,taskGroup:string) { + return this.pathTemplates.taskGroupPathTemplate.render({ + project: project, + location: location, + job: job, + task_group: taskGroup, + }); + } + + /** + * Parse the project from TaskGroup resource. + * + * @param {string} taskGroupName + * A fully-qualified path representing TaskGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTaskGroupName(taskGroupName: string) { + return this.pathTemplates.taskGroupPathTemplate.match(taskGroupName).project; + } + + /** + * Parse the location from TaskGroup resource. + * + * @param {string} taskGroupName + * A fully-qualified path representing TaskGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTaskGroupName(taskGroupName: string) { + return this.pathTemplates.taskGroupPathTemplate.match(taskGroupName).location; + } + + /** + * Parse the job from TaskGroup resource. + * + * @param {string} taskGroupName + * A fully-qualified path representing TaskGroup resource. + * @returns {string} A string representing the job. + */ + matchJobFromTaskGroupName(taskGroupName: string) { + return this.pathTemplates.taskGroupPathTemplate.match(taskGroupName).job; + } + + /** + * Parse the task_group from TaskGroup resource. + * + * @param {string} taskGroupName + * A fully-qualified path representing TaskGroup resource. + * @returns {string} A string representing the task_group. + */ + matchTaskGroupFromTaskGroupName(taskGroupName: string) { + return this.pathTemplates.taskGroupPathTemplate.match(taskGroupName).task_group; + } + + /** + * 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.batchServiceStub && !this._terminated) { + return this.batchServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.locationsClient.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_client_config.json b/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_client_config.json new file mode 100644 index 00000000000..6ac4ca807a8 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_client_config.json @@ -0,0 +1,103 @@ +{ + "interfaces": { + "google.cloud.batch.v1alpha.BatchService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "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 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetJob": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CancelJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListJobs": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetTask": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListTasks": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateResourceAllowance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetResourceAllowance": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteResourceAllowance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListResourceAllowances": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateResourceAllowance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_proto_list.json b/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_proto_list.json new file mode 100644 index 00000000000..cd5a69f0276 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_proto_list.json @@ -0,0 +1,8 @@ +[ + "../../protos/google/cloud/batch/v1alpha/batch.proto", + "../../protos/google/cloud/batch/v1alpha/job.proto", + "../../protos/google/cloud/batch/v1alpha/notification.proto", + "../../protos/google/cloud/batch/v1alpha/resource_allowance.proto", + "../../protos/google/cloud/batch/v1alpha/task.proto", + "../../protos/google/cloud/batch/v1alpha/volume.proto" +] diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/gapic_metadata.json b/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/gapic_metadata.json new file mode 100644 index 00000000000..4e922577356 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/gapic_metadata.json @@ -0,0 +1,165 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.batch.v1alpha", + "libraryPackage": "@google-cloud/batch", + "services": { + "BatchService": { + "clients": { + "grpc": { + "libraryClient": "BatchServiceClient", + "rpcs": { + "CreateJob": { + "methods": [ + "createJob" + ] + }, + "GetJob": { + "methods": [ + "getJob" + ] + }, + "UpdateJob": { + "methods": [ + "updateJob" + ] + }, + "GetTask": { + "methods": [ + "getTask" + ] + }, + "CreateResourceAllowance": { + "methods": [ + "createResourceAllowance" + ] + }, + "GetResourceAllowance": { + "methods": [ + "getResourceAllowance" + ] + }, + "UpdateResourceAllowance": { + "methods": [ + "updateResourceAllowance" + ] + }, + "DeleteJob": { + "methods": [ + "deleteJob" + ] + }, + "CancelJob": { + "methods": [ + "cancelJob" + ] + }, + "DeleteResourceAllowance": { + "methods": [ + "deleteResourceAllowance" + ] + }, + "ListJobs": { + "methods": [ + "listJobs", + "listJobsStream", + "listJobsAsync" + ] + }, + "ListTasks": { + "methods": [ + "listTasks", + "listTasksStream", + "listTasksAsync" + ] + }, + "ListResourceAllowances": { + "methods": [ + "listResourceAllowances", + "listResourceAllowancesStream", + "listResourceAllowancesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "BatchServiceClient", + "rpcs": { + "CreateJob": { + "methods": [ + "createJob" + ] + }, + "GetJob": { + "methods": [ + "getJob" + ] + }, + "UpdateJob": { + "methods": [ + "updateJob" + ] + }, + "GetTask": { + "methods": [ + "getTask" + ] + }, + "CreateResourceAllowance": { + "methods": [ + "createResourceAllowance" + ] + }, + "GetResourceAllowance": { + "methods": [ + "getResourceAllowance" + ] + }, + "UpdateResourceAllowance": { + "methods": [ + "updateResourceAllowance" + ] + }, + "DeleteJob": { + "methods": [ + "deleteJob" + ] + }, + "CancelJob": { + "methods": [ + "cancelJob" + ] + }, + "DeleteResourceAllowance": { + "methods": [ + "deleteResourceAllowance" + ] + }, + "ListJobs": { + "methods": [ + "listJobs", + "listJobsStream", + "listJobsAsync" + ] + }, + "ListTasks": { + "methods": [ + "listTasks", + "listTasksStream", + "listTasksAsync" + ] + }, + "ListResourceAllowances": { + "methods": [ + "listResourceAllowances", + "listResourceAllowancesStream", + "listResourceAllowancesAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/index.ts b/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/index.ts new file mode 100644 index 00000000000..fb53b495001 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/index.ts @@ -0,0 +1,19 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {BatchServiceClient} from './batch_service_client'; diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-batch/v1alpha/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..b9ac0eb683e --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const batch = require('@google-cloud/batch'); + +function main() { + const batchServiceClient = new batch.BatchServiceClient(); +} + +main(); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-batch/v1alpha/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..c43e51952e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 {BatchServiceClient} from '@google-cloud/batch'; + +// check that the client class type name can be used +function doStuffWithBatchServiceClient(client: BatchServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const batchServiceClient = new BatchServiceClient(); + doStuffWithBatchServiceClient(batchServiceClient); +} + +main(); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/system-test/install.ts b/owl-bot-staging/google-cloud-batch/v1alpha/system-test/install.ts new file mode 100644 index 00000000000..fd5bfdc71d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/test/gapic_batch_service_v1alpha.ts b/owl-bot-staging/google-cloud-batch/v1alpha/test/gapic_batch_service_v1alpha.ts new file mode 100644 index 00000000000..1ef8a8bde46 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/test/gapic_batch_service_v1alpha.ts @@ -0,0 +1,2938 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 batchserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos, LocationProtos} 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('v1alpha.BatchServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'batch.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient(); + 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 = batchserviceModule.v1alpha.BatchServiceClient.servicePath; + assert.strictEqual(servicePath, 'batch.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = batchserviceModule.v1alpha.BatchServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'batch.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'batch.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'batch.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 batchserviceModule.v1alpha.BatchServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'batch.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 batchserviceModule.v1alpha.BatchServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'batch.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 batchserviceModule.v1alpha.BatchServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = batchserviceModule.v1alpha.BatchServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.batchServiceStub, undefined); + await client.initialize(); + assert(client.batchServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.batchServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.batchServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + 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 batchserviceModule.v1alpha.BatchServiceClient({ + 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('createJob', () => { + it('invokes createJob without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.CreateJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.CreateJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.Job() + ); + client.innerApiCalls.createJob = stubSimpleCall(expectedResponse); + const [response] = await client.createJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createJob without error using callback', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.CreateJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.CreateJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.Job() + ); + client.innerApiCalls.createJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createJob( + request, + (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.IJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createJob with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.CreateJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.CreateJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createJob(request), expectedError); + const actualRequest = (client.innerApiCalls.createJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createJob with closed client', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.CreateJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.CreateJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createJob(request), expectedError); + }); + }); + + describe('getJob', () => { + it('invokes getJob without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.GetJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.GetJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.Job() + ); + client.innerApiCalls.getJob = stubSimpleCall(expectedResponse); + const [response] = await client.getJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJob without error using callback', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.GetJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.GetJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.Job() + ); + client.innerApiCalls.getJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getJob( + request, + (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.IJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJob with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.GetJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.GetJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getJob(request), expectedError); + const actualRequest = (client.innerApiCalls.getJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJob with closed client', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.GetJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.GetJobRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getJob(request), expectedError); + }); + }); + + describe('updateJob', () => { + it('invokes updateJob without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.UpdateJobRequest() + ); + request.job ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.UpdateJobRequest', ['job', 'name']); + request.job.name = defaultValue1; + const expectedHeaderRequestParams = `job.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.Job() + ); + client.innerApiCalls.updateJob = stubSimpleCall(expectedResponse); + const [response] = await client.updateJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateJob without error using callback', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.UpdateJobRequest() + ); + request.job ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.UpdateJobRequest', ['job', 'name']); + request.job.name = defaultValue1; + const expectedHeaderRequestParams = `job.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.Job() + ); + client.innerApiCalls.updateJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateJob( + request, + (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.IJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateJob with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.UpdateJobRequest() + ); + request.job ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.UpdateJobRequest', ['job', 'name']); + request.job.name = defaultValue1; + const expectedHeaderRequestParams = `job.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateJob(request), expectedError); + const actualRequest = (client.innerApiCalls.updateJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateJob with closed client', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.UpdateJobRequest() + ); + request.job ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.UpdateJobRequest', ['job', 'name']); + request.job.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateJob(request), expectedError); + }); + }); + + describe('getTask', () => { + it('invokes getTask without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.GetTaskRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.GetTaskRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.Task() + ); + client.innerApiCalls.getTask = stubSimpleCall(expectedResponse); + const [response] = await client.getTask(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getTask as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTask as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTask without error using callback', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.GetTaskRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.GetTaskRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.Task() + ); + client.innerApiCalls.getTask = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTask( + request, + (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.ITask|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getTask as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTask as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTask with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.GetTaskRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.GetTaskRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTask = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTask(request), expectedError); + const actualRequest = (client.innerApiCalls.getTask as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTask as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTask with closed client', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.GetTaskRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.GetTaskRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTask(request), expectedError); + }); + }); + + describe('createResourceAllowance', () => { + it('invokes createResourceAllowance without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ResourceAllowance() + ); + client.innerApiCalls.createResourceAllowance = stubSimpleCall(expectedResponse); + const [response] = await client.createResourceAllowance(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createResourceAllowance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createResourceAllowance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createResourceAllowance without error using callback', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ResourceAllowance() + ); + client.innerApiCalls.createResourceAllowance = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createResourceAllowance( + request, + (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.IResourceAllowance|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createResourceAllowance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createResourceAllowance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createResourceAllowance with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createResourceAllowance = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createResourceAllowance(request), expectedError); + const actualRequest = (client.innerApiCalls.createResourceAllowance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createResourceAllowance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createResourceAllowance with closed client', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createResourceAllowance(request), expectedError); + }); + }); + + describe('getResourceAllowance', () => { + it('invokes getResourceAllowance without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.GetResourceAllowanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.GetResourceAllowanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ResourceAllowance() + ); + client.innerApiCalls.getResourceAllowance = stubSimpleCall(expectedResponse); + const [response] = await client.getResourceAllowance(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getResourceAllowance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getResourceAllowance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getResourceAllowance without error using callback', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.GetResourceAllowanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.GetResourceAllowanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ResourceAllowance() + ); + client.innerApiCalls.getResourceAllowance = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getResourceAllowance( + request, + (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.IResourceAllowance|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getResourceAllowance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getResourceAllowance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getResourceAllowance with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.GetResourceAllowanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.GetResourceAllowanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getResourceAllowance = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getResourceAllowance(request), expectedError); + const actualRequest = (client.innerApiCalls.getResourceAllowance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getResourceAllowance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getResourceAllowance with closed client', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.GetResourceAllowanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.GetResourceAllowanceRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getResourceAllowance(request), expectedError); + }); + }); + + describe('updateResourceAllowance', () => { + it('invokes updateResourceAllowance without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest() + ); + request.resourceAllowance ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest', ['resourceAllowance', 'name']); + request.resourceAllowance.name = defaultValue1; + const expectedHeaderRequestParams = `resource_allowance.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ResourceAllowance() + ); + client.innerApiCalls.updateResourceAllowance = stubSimpleCall(expectedResponse); + const [response] = await client.updateResourceAllowance(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateResourceAllowance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateResourceAllowance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateResourceAllowance without error using callback', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest() + ); + request.resourceAllowance ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest', ['resourceAllowance', 'name']); + request.resourceAllowance.name = defaultValue1; + const expectedHeaderRequestParams = `resource_allowance.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ResourceAllowance() + ); + client.innerApiCalls.updateResourceAllowance = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateResourceAllowance( + request, + (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.IResourceAllowance|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateResourceAllowance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateResourceAllowance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateResourceAllowance with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest() + ); + request.resourceAllowance ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest', ['resourceAllowance', 'name']); + request.resourceAllowance.name = defaultValue1; + const expectedHeaderRequestParams = `resource_allowance.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateResourceAllowance = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateResourceAllowance(request), expectedError); + const actualRequest = (client.innerApiCalls.updateResourceAllowance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateResourceAllowance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateResourceAllowance with closed client', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest() + ); + request.resourceAllowance ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest', ['resourceAllowance', 'name']); + request.resourceAllowance.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateResourceAllowance(request), expectedError); + }); + }); + + describe('deleteJob', () => { + it('invokes deleteJob without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.DeleteJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.DeleteJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteJob = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteJob without error using callback', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.DeleteJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.DeleteJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteJob = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteJob( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteJob with call error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.DeleteJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.DeleteJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteJob(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteJob with LRO error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.DeleteJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.DeleteJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteJobProgress without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkDeleteJobProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteJobProgress with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteJobProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('cancelJob', () => { + it('invokes cancelJob without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.CancelJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.CancelJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.cancelJob = stubLongRunningCall(expectedResponse); + const [operation] = await client.cancelJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.cancelJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelJob without error using callback', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.CancelJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.CancelJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.cancelJob = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cancelJob( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.cancelJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelJob with call error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.CancelJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.CancelJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.cancelJob(request), expectedError); + const actualRequest = (client.innerApiCalls.cancelJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelJob with LRO error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.CancelJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.CancelJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.cancelJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.cancelJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCancelJobProgress without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkCancelJobProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCancelJobProgress with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCancelJobProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteResourceAllowance', () => { + it('invokes deleteResourceAllowance without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteResourceAllowance = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteResourceAllowance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteResourceAllowance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteResourceAllowance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteResourceAllowance without error using callback', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteResourceAllowance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteResourceAllowance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteResourceAllowance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteResourceAllowance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteResourceAllowance with call error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteResourceAllowance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteResourceAllowance(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteResourceAllowance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteResourceAllowance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteResourceAllowance with LRO error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteResourceAllowance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteResourceAllowance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteResourceAllowance as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteResourceAllowance as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteResourceAllowanceProgress without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkDeleteResourceAllowanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteResourceAllowanceProgress with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteResourceAllowanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listJobs', () => { + it('invokes listJobs without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), + ]; + client.innerApiCalls.listJobs = stubSimpleCall(expectedResponse); + const [response] = await client.listJobs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobs without error using callback', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), + ]; + client.innerApiCalls.listJobs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listJobs( + request, + (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.IJob[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobs with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listJobs(request), expectedError); + const actualRequest = (client.innerApiCalls.listJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobsStream without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), + ]; + client.descriptors.page.listJobs.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.batch.v1alpha.Job[] = []; + stream.on('data', (response: protos.google.cloud.batch.v1alpha.Job) => { + 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.listJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listJobs, request)); + assert( + (client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listJobsStream with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listJobs.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.batch.v1alpha.Job[] = []; + stream.on('data', (response: protos.google.cloud.batch.v1alpha.Job) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listJobs, request)); + assert( + (client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listJobs without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), + ]; + client.descriptors.page.listJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.batch.v1alpha.IJob[] = []; + const iterable = client.listJobsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listJobs with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listJobsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.batch.v1alpha.IJob[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listTasks', () => { + it('invokes listTasks without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListTasksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListTasksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), + ]; + client.innerApiCalls.listTasks = stubSimpleCall(expectedResponse); + const [response] = await client.listTasks(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listTasks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTasks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTasks without error using callback', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListTasksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListTasksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), + ]; + client.innerApiCalls.listTasks = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTasks( + request, + (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.ITask[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listTasks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTasks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTasks with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListTasksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListTasksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTasks = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTasks(request), expectedError); + const actualRequest = (client.innerApiCalls.listTasks as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTasks as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTasksStream without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListTasksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListTasksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), + ]; + client.descriptors.page.listTasks.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listTasksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.batch.v1alpha.Task[] = []; + stream.on('data', (response: protos.google.cloud.batch.v1alpha.Task) => { + 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.listTasks.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTasks, request)); + assert( + (client.descriptors.page.listTasks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listTasksStream with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListTasksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListTasksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTasks.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listTasksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.batch.v1alpha.Task[] = []; + stream.on('data', (response: protos.google.cloud.batch.v1alpha.Task) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listTasks.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTasks, request)); + assert( + (client.descriptors.page.listTasks.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTasks without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListTasksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListTasksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), + ]; + client.descriptors.page.listTasks.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.batch.v1alpha.ITask[] = []; + const iterable = client.listTasksAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTasks.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listTasks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTasks with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListTasksRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListTasksRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTasks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTasksAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.batch.v1alpha.ITask[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTasks.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listTasks.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listResourceAllowances', () => { + it('invokes listResourceAllowances without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListResourceAllowancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListResourceAllowancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), + ]; + client.innerApiCalls.listResourceAllowances = stubSimpleCall(expectedResponse); + const [response] = await client.listResourceAllowances(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listResourceAllowances as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listResourceAllowances as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listResourceAllowances without error using callback', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListResourceAllowancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListResourceAllowancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), + ]; + client.innerApiCalls.listResourceAllowances = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listResourceAllowances( + request, + (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.IResourceAllowance[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listResourceAllowances as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listResourceAllowances as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listResourceAllowances with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListResourceAllowancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListResourceAllowancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listResourceAllowances = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listResourceAllowances(request), expectedError); + const actualRequest = (client.innerApiCalls.listResourceAllowances as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listResourceAllowances as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listResourceAllowancesStream without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListResourceAllowancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListResourceAllowancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), + ]; + client.descriptors.page.listResourceAllowances.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listResourceAllowancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.batch.v1alpha.ResourceAllowance[] = []; + stream.on('data', (response: protos.google.cloud.batch.v1alpha.ResourceAllowance) => { + 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.listResourceAllowances.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listResourceAllowances, request)); + assert( + (client.descriptors.page.listResourceAllowances.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listResourceAllowancesStream with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListResourceAllowancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListResourceAllowancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listResourceAllowances.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listResourceAllowancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.batch.v1alpha.ResourceAllowance[] = []; + stream.on('data', (response: protos.google.cloud.batch.v1alpha.ResourceAllowance) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listResourceAllowances.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listResourceAllowances, request)); + assert( + (client.descriptors.page.listResourceAllowances.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listResourceAllowances without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListResourceAllowancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListResourceAllowancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), + generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), + ]; + client.descriptors.page.listResourceAllowances.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.batch.v1alpha.IResourceAllowance[] = []; + const iterable = client.listResourceAllowancesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listResourceAllowances.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listResourceAllowances.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listResourceAllowances with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1alpha.ListResourceAllowancesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.batch.v1alpha.ListResourceAllowancesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listResourceAllowances.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listResourceAllowancesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.batch.v1alpha.IResourceAllowance[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listResourceAllowances.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listResourceAllowances.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation without error using callback', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.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 batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + 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 batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + 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 batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + 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 batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('job', () => { + const fakePath = "/rendered/path/job"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + job: "jobValue", + }; + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.jobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.jobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('jobPath', () => { + const result = client.jobPath("projectValue", "locationValue", "jobValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.jobPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromJobName', () => { + const result = client.matchProjectFromJobName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromJobName', () => { + const result = client.matchLocationFromJobName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchJobFromJobName', () => { + const result = client.matchJobFromJobName(fakePath); + assert.strictEqual(result, "jobValue"); + assert((client.pathTemplates.jobPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('resourceAllowance', () => { + const fakePath = "/rendered/path/resourceAllowance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + resource_allowance: "resourceAllowanceValue", + }; + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.resourceAllowancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.resourceAllowancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('resourceAllowancePath', () => { + const result = client.resourceAllowancePath("projectValue", "locationValue", "resourceAllowanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.resourceAllowancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromResourceAllowanceName', () => { + const result = client.matchProjectFromResourceAllowanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.resourceAllowancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromResourceAllowanceName', () => { + const result = client.matchLocationFromResourceAllowanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.resourceAllowancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchResourceAllowanceFromResourceAllowanceName', () => { + const result = client.matchResourceAllowanceFromResourceAllowanceName(fakePath); + assert.strictEqual(result, "resourceAllowanceValue"); + assert((client.pathTemplates.resourceAllowancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('task', () => { + const fakePath = "/rendered/path/task"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + job: "jobValue", + task_group: "taskGroupValue", + task: "taskValue", + }; + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.taskPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.taskPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('taskPath', () => { + const result = client.taskPath("projectValue", "locationValue", "jobValue", "taskGroupValue", "taskValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.taskPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTaskName', () => { + const result = client.matchProjectFromTaskName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.taskPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTaskName', () => { + const result = client.matchLocationFromTaskName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.taskPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchJobFromTaskName', () => { + const result = client.matchJobFromTaskName(fakePath); + assert.strictEqual(result, "jobValue"); + assert((client.pathTemplates.taskPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTaskGroupFromTaskName', () => { + const result = client.matchTaskGroupFromTaskName(fakePath); + assert.strictEqual(result, "taskGroupValue"); + assert((client.pathTemplates.taskPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTaskFromTaskName', () => { + const result = client.matchTaskFromTaskName(fakePath); + assert.strictEqual(result, "taskValue"); + assert((client.pathTemplates.taskPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('taskGroup', () => { + const fakePath = "/rendered/path/taskGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + job: "jobValue", + task_group: "taskGroupValue", + }; + const client = new batchserviceModule.v1alpha.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.taskGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.taskGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('taskGroupPath', () => { + const result = client.taskGroupPath("projectValue", "locationValue", "jobValue", "taskGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.taskGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTaskGroupName', () => { + const result = client.matchProjectFromTaskGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.taskGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTaskGroupName', () => { + const result = client.matchLocationFromTaskGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.taskGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchJobFromTaskGroupName', () => { + const result = client.matchJobFromTaskGroupName(fakePath); + assert.strictEqual(result, "jobValue"); + assert((client.pathTemplates.taskGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTaskGroupFromTaskGroupName', () => { + const result = client.matchTaskGroupFromTaskGroupName(fakePath); + assert.strictEqual(result, "taskGroupValue"); + assert((client.pathTemplates.taskGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/tsconfig.json b/owl-bot-staging/google-cloud-batch/v1alpha/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/webpack.config.js b/owl-bot-staging/google-cloud-batch/v1alpha/webpack.config.js new file mode 100644 index 00000000000..04a4c53960a --- /dev/null +++ b/owl-bot-staging/google-cloud-batch/v1alpha/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'BatchService', + filename: './batch-service.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; From fa9fee8549a6e5338c9262f0b2485f2641c62274 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 27 Dec 2024 19:08:28 +0000 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../google-cloud-batch/v1/.eslintignore | 7 - .../google-cloud-batch/v1/.eslintrc.json | 3 - .../google-cloud-batch/v1/.gitignore | 14 - .../google-cloud-batch/v1/.jsdoc.js | 55 - .../google-cloud-batch/v1/.mocharc.js | 33 - .../google-cloud-batch/v1/.prettierrc.js | 22 - .../google-cloud-batch/v1/README.md | 1 - .../google-cloud-batch/v1/package.json | 58 - .../protos/google/cloud/batch/v1/batch.proto | 276 - .../v1/protos/google/cloud/batch/v1/job.proto | 693 - .../protos/google/cloud/batch/v1/task.proto | 475 - .../protos/google/cloud/batch/v1/volume.proto | 80 - .../google-cloud-batch/v1/protos/protos.d.ts | 13321 ----- .../google-cloud-batch/v1/protos/protos.js | 35612 ------------- .../google-cloud-batch/v1/protos/protos.json | 3401 -- .../generated/v1/batch_service.create_job.js | 92 - .../generated/v1/batch_service.delete_job.js | 79 - .../generated/v1/batch_service.get_job.js | 61 - .../generated/v1/batch_service.get_task.js | 61 - .../generated/v1/batch_service.list_jobs.js | 79 - .../generated/v1/batch_service.list_tasks.js | 79 - ...nippet_metadata_google.cloud.batch.v1.json | 303 - .../google-cloud-batch/v1/src/index.ts | 25 - .../v1/src/v1/batch_service_client.ts | 1620 - .../src/v1/batch_service_client_config.json | 68 - .../v1/src/v1/batch_service_proto_list.json | 6 - .../v1/src/v1/gapic_metadata.json | 91 - .../google-cloud-batch/v1/src/v1/index.ts | 19 - .../system-test/fixtures/sample/src/index.js | 27 - .../system-test/fixtures/sample/src/index.ts | 32 - .../v1/system-test/install.ts | 49 - .../v1/test/gapic_batch_service_v1.ts | 1899 - .../google-cloud-batch/v1/tsconfig.json | 19 - .../google-cloud-batch/v1/webpack.config.js | 64 - .../google-cloud-batch/v1alpha/.eslintignore | 7 - .../google-cloud-batch/v1alpha/.eslintrc.json | 3 - .../google-cloud-batch/v1alpha/.gitignore | 14 - .../google-cloud-batch/v1alpha/.jsdoc.js | 55 - .../google-cloud-batch/v1alpha/.mocharc.js | 33 - .../google-cloud-batch/v1alpha/.prettierrc.js | 22 - .../google-cloud-batch/v1alpha/README.md | 1 - .../google-cloud-batch/v1alpha/package.json | 58 - .../google/cloud/batch/v1alpha/batch.proto | 587 - .../google/cloud/batch/v1alpha/job.proto | 802 - .../cloud/batch/v1alpha/notification.proto | 38 - .../batch/v1alpha/resource_allowance.proto | 208 - .../google/cloud/batch/v1alpha/task.proto | 494 - .../google/cloud/batch/v1alpha/volume.proto | 98 - .../v1alpha/protos/protos.d.ts | 16145 ------ .../v1alpha/protos/protos.js | 42614 ---------------- .../v1alpha/protos/protos.json | 4203 -- .../v1alpha/batch_service.cancel_job.js | 76 - .../v1alpha/batch_service.create_job.js | 92 - ...batch_service.create_resource_allowance.js | 93 - .../v1alpha/batch_service.delete_job.js | 79 - ...batch_service.delete_resource_allowance.js | 80 - .../v1alpha/batch_service.get_job.js | 61 - .../batch_service.get_resource_allowance.js | 61 - .../v1alpha/batch_service.get_task.js | 61 - .../v1alpha/batch_service.list_jobs.js | 79 - .../batch_service.list_resource_allowances.js | 71 - .../v1alpha/batch_service.list_tasks.js | 83 - .../v1alpha/batch_service.update_job.js | 95 - ...batch_service.update_resource_allowance.js | 88 - ...t_metadata_google.cloud.batch.v1alpha.json | 635 - .../google-cloud-batch/v1alpha/src/index.ts | 25 - .../src/v1alpha/batch_service_client.ts | 2441 - .../v1alpha/batch_service_client_config.json | 103 - .../src/v1alpha/batch_service_proto_list.json | 8 - .../v1alpha/src/v1alpha/gapic_metadata.json | 165 - .../v1alpha/src/v1alpha/index.ts | 19 - .../system-test/fixtures/sample/src/index.js | 27 - .../system-test/fixtures/sample/src/index.ts | 32 - .../v1alpha/system-test/install.ts | 49 - .../test/gapic_batch_service_v1alpha.ts | 2938 -- .../google-cloud-batch/v1alpha/tsconfig.json | 19 - .../v1alpha/webpack.config.js | 64 - .../protos/google/cloud/batch/v1/batch.proto | 7 +- 78 files changed, 4 insertions(+), 131653 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-batch/v1/.eslintignore delete mode 100644 owl-bot-staging/google-cloud-batch/v1/.eslintrc.json delete mode 100644 owl-bot-staging/google-cloud-batch/v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-batch/v1/.jsdoc.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1/.mocharc.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1/.prettierrc.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1/README.md delete mode 100644 owl-bot-staging/google-cloud-batch/v1/package.json delete mode 100644 owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/batch.proto delete mode 100644 owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/job.proto delete mode 100644 owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/task.proto delete mode 100644 owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/volume.proto delete mode 100644 owl-bot-staging/google-cloud-batch/v1/protos/protos.d.ts delete mode 100644 owl-bot-staging/google-cloud-batch/v1/protos/protos.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1/protos/protos.json delete mode 100644 owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.create_job.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.delete_job.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.get_job.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.get_task.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.list_jobs.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.list_tasks.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/snippet_metadata_google.cloud.batch.v1.json delete mode 100644 owl-bot-staging/google-cloud-batch/v1/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-batch/v1/src/v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-batch/v1/src/v1/index.ts delete mode 100644 owl-bot-staging/google-cloud-batch/v1/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-batch/v1/system-test/install.ts delete mode 100644 owl-bot-staging/google-cloud-batch/v1/test/gapic_batch_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-batch/v1/tsconfig.json delete mode 100644 owl-bot-staging/google-cloud-batch/v1/webpack.config.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/.eslintignore delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/.eslintrc.json delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/.gitignore delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/.jsdoc.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/.mocharc.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/.prettierrc.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/README.md delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/package.json delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/batch.proto delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/job.proto delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/notification.proto delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/resource_allowance.proto delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/task.proto delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/volume.proto delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.d.ts delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.json delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.cancel_job.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.create_job.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.create_resource_allowance.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.delete_job.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.delete_resource_allowance.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_job.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_resource_allowance.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_task.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_jobs.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_resource_allowances.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_tasks.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.update_job.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.update_resource_allowance.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/snippet_metadata_google.cloud.batch.v1alpha.json delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/index.ts delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/system-test/install.ts delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/test/gapic_batch_service_v1alpha.ts delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/tsconfig.json delete mode 100644 owl-bot-staging/google-cloud-batch/v1alpha/webpack.config.js diff --git a/owl-bot-staging/google-cloud-batch/v1/.eslintignore b/owl-bot-staging/google-cloud-batch/v1/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/google-cloud-batch/v1/.eslintrc.json b/owl-bot-staging/google-cloud-batch/v1/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/google-cloud-batch/v1/.gitignore b/owl-bot-staging/google-cloud-batch/v1/.gitignore deleted file mode 100644 index d4f03a0df2e..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.log -**/node_modules -/.coverage -/coverage -/.nyc_output -/docs/ -/out/ -/build/ -system-test/secrets.js -system-test/*key.json -*.lock -.DS_Store -package-lock.json -__pycache__ diff --git a/owl-bot-staging/google-cloud-batch/v1/.jsdoc.js b/owl-bot-staging/google-cloud-batch/v1/.jsdoc.js deleted file mode 100644 index f3c1e45a4fc..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -'use strict'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2024 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/batch', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/google-cloud-batch/v1/.mocharc.js b/owl-bot-staging/google-cloud-batch/v1/.mocharc.js deleted file mode 100644 index 13b67c34edc..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/google-cloud-batch/v1/.prettierrc.js b/owl-bot-staging/google-cloud-batch/v1/.prettierrc.js deleted file mode 100644 index 9a8fd690982..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/google-cloud-batch/v1/README.md b/owl-bot-staging/google-cloud-batch/v1/README.md deleted file mode 100644 index 15b2fa3f3e4..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/README.md +++ /dev/null @@ -1 +0,0 @@ -Batch: Nodejs Client diff --git a/owl-bot-staging/google-cloud-batch/v1/package.json b/owl-bot-staging/google-cloud-batch/v1/package.json deleted file mode 100644 index d27d57773ff..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "@google-cloud/batch", - "version": "0.1.0", - "description": "Batch client for Node.js", - "repository": "googleapis/nodejs-batch", - "license": "Apache-2.0", - "author": "Google LLC", - "main": "build/src/index.js", - "files": [ - "build/src", - "build/protos" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "google batch", - "batch", - "batch service" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^4.3.4" - }, - "devDependencies": { - "@types/mocha": "^10.0.6", - "@types/node": "^20.12.12", - "@types/sinon": "^10.0.20", - "c8": "^9.1.0", - "gapic-tools": "^0.4.2", - "gts": "5.3.0", - "jsdoc": "^4.0.3", - "jsdoc-fresh": "^3.0.0", - "jsdoc-region-tag": "^3.0.0", - "mocha": "^10.4.0", - "pack-n-play": "^2.0.3", - "sinon": "^15.2.0", - "typescript": "5.1.6" - }, - "engines": { - "node": ">=v14" - } -} diff --git a/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/batch.proto b/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/batch.proto deleted file mode 100644 index 91b902cdb18..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/batch.proto +++ /dev/null @@ -1,276 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.batch.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/field_info.proto"; -import "google/api/resource.proto"; -import "google/cloud/batch/v1/job.proto"; -import "google/cloud/batch/v1/task.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.Batch.V1"; -option go_package = "cloud.google.com/go/batch/apiv1/batchpb;batchpb"; -option java_multiple_files = true; -option java_outer_classname = "BatchProto"; -option java_package = "com.google.cloud.batch.v1"; -option objc_class_prefix = "GCB"; -option php_namespace = "Google\\Cloud\\Batch\\V1"; -option ruby_package = "Google::Cloud::Batch::V1"; - -// Google Batch Service. -// The service manages user submitted batch jobs and allocates Google Compute -// Engine VM instances to run the jobs. -service BatchService { - option (google.api.default_host) = "batch.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Create a Job. - rpc CreateJob(CreateJobRequest) returns (Job) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/jobs" - body: "job" - }; - option (google.api.method_signature) = "parent,job,job_id"; - } - - // Get a Job specified by its resource name. - rpc GetJob(GetJobRequest) returns (Job) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/jobs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Delete a Job. - rpc DeleteJob(DeleteJobRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/jobs/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "google.cloud.batch.v1.OperationMetadata" - }; - } - - // List all Jobs for a project within a region. - rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/jobs" - }; - option (google.api.method_signature) = "parent"; - } - - // Return a single Task. - rpc GetTask(GetTaskRequest) returns (Task) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/jobs/*/taskGroups/*/tasks/*}" - }; - option (google.api.method_signature) = "name"; - } - - // List Tasks associated with a job. - rpc ListTasks(ListTasksRequest) returns (ListTasksResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/jobs/*/taskGroups/*}/tasks" - }; - option (google.api.method_signature) = "parent"; - } -} - -// CreateJob Request. -message CreateJobRequest { - // Required. The parent resource name where the Job will be created. - // Pattern: "projects/{project}/locations/{location}" - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { child_type: "batch.googleapis.com/Job" } - ]; - - // ID used to uniquely identify the Job within its parent scope. - // This field should contain at most 63 characters and must start with - // lowercase characters. - // Only lowercase characters, numbers and '-' are accepted. - // The '-' character cannot be the first or the last one. - // A system generated ID will be used if the field is not set. - // - // The job.name field in the request will be ignored and the created resource - // name of the Job will be "{parent}/jobs/{job_id}". - string job_id = 2; - - // Required. The Job to create. - Job job = 3 [(google.api.field_behavior) = REQUIRED]; - - // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// GetJob Request. -message GetJobRequest { - // Required. Job name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "batch.googleapis.com/Job" } - ]; -} - -// DeleteJob Request. -message DeleteJobRequest { - // Job name. - string name = 1; - - // Optional. Reason for this deletion. - string reason = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// ListJob Request. -message ListJobsRequest { - // Parent path. - string parent = 1; - - // List filter. - string filter = 4; - - // Optional. Sort results. Supported are "name", "name desc", "create_time", - // and "create_time desc". - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Page size. - int32 page_size = 2; - - // Page token. - string page_token = 3; -} - -// ListJob Response. -message ListJobsResponse { - // Jobs. - repeated Job jobs = 1; - - // Next page token. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// ListTasks Request. -message ListTasksRequest { - // Required. Name of a TaskGroup from which Tasks are being requested. - // Pattern: - // "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "batch.googleapis.com/TaskGroup" } - ]; - - // Task filter, null filter matches all Tasks. - // Filter string should be of the format State=TaskStatus.State e.g. - // State=RUNNING - string filter = 2; - - // Page size. - int32 page_size = 3; - - // Page token. - string page_token = 4; -} - -// ListTasks Response. -message ListTasksResponse { - // Tasks. - repeated Task tasks = 1; - - // Next page token. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// Request for a single Task by name. -message GetTaskRequest { - // Required. Task name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "batch.googleapis.com/Task" } - ]; -} - -// Represents the metadata of the long-running operation. -message OperationMetadata { - // Output only. The time the operation was created. - google.protobuf.Timestamp create_time = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time the operation finished running. - google.protobuf.Timestamp end_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Server-defined resource path for the target of the operation. - string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Name of the verb executed by the operation. - string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Human-readable status of the operation, if any. - string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Identifies whether the user has requested cancellation - // of the operation. Operations that have successfully been cancelled - // have - // [google.longrunning.Operation.error][google.longrunning.Operation.error] - // value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - // corresponding to `Code.CANCELLED`. - bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. API version used to start the operation. - string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/job.proto b/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/job.proto deleted file mode 100644 index a215c35b837..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/job.proto +++ /dev/null @@ -1,693 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.batch.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/batch/v1/task.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.Batch.V1"; -option go_package = "cloud.google.com/go/batch/apiv1/batchpb;batchpb"; -option java_multiple_files = true; -option java_outer_classname = "JobProto"; -option java_package = "com.google.cloud.batch.v1"; -option objc_class_prefix = "GCB"; -option php_namespace = "Google\\Cloud\\Batch\\V1"; -option ruby_package = "Google::Cloud::Batch::V1"; - -// The Cloud Batch Job description. -message Job { - option (google.api.resource) = { - type: "batch.googleapis.com/Job" - pattern: "projects/{project}/locations/{location}/jobs/{job}" - }; - - // Output only. Job name. - // For example: "projects/123456/locations/us-central1/jobs/job01". - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A system generated unique ID for the Job. - string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Priority of the Job. - // The valid value range is [0, 100). Default value is 0. - // Higher value indicates higher priority. - // A job with higher priority value is more likely to run earlier if all other - // requirements are satisfied. - int64 priority = 3; - - // Required. TaskGroups in the Job. Only one TaskGroup is supported now. - repeated TaskGroup task_groups = 4 [(google.api.field_behavior) = REQUIRED]; - - // Compute resource allocation for all TaskGroups in the Job. - AllocationPolicy allocation_policy = 7; - - // Custom labels to apply to the job and any Cloud Logging - // [LogEntry](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry) - // that it generates. - // - // Use labels to group and describe the resources they are applied to. Batch - // automatically applies predefined labels and supports multiple `labels` - // fields for each job, which each let you apply custom labels to various - // resources. Label names that start with "goog-" or "google-" are - // reserved for predefined labels. For more information about labels with - // Batch, see - // [Organize resources using - // labels](https://cloud.google.com/batch/docs/organize-resources-using-labels). - map labels = 8; - - // Output only. Job status. It is read only for users. - JobStatus status = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. When the Job was created. - google.protobuf.Timestamp create_time = 11 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The last time the Job was updated. - google.protobuf.Timestamp update_time = 12 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Log preservation policy for the Job. - LogsPolicy logs_policy = 13; - - // Notification configurations. - repeated JobNotification notifications = 14; -} - -// LogsPolicy describes if and how a job's logs are preserved. Logs include -// information that is automatically written by the Batch service agent and any -// information that you configured the job's runnables to write to the `stdout` -// or `stderr` streams. -message LogsPolicy { - // `CloudLoggingOption` contains additional settings for Cloud Logging logs - // generated by Batch job. - message CloudLoggingOption { - // Optional. Set this field to `true` to change the [monitored resource - // type](https://cloud.google.com/monitoring/api/resources) for - // Cloud Logging logs generated by this Batch job from - // the - // [`batch.googleapis.com/Job`](https://cloud.google.com/monitoring/api/resources#tag_batch.googleapis.com/Job) - // type to the formerly used - // [`generic_task`](https://cloud.google.com/monitoring/api/resources#tag_generic_task) - // type. - bool use_generic_task_monitored_resource = 1 - [(google.api.field_behavior) = OPTIONAL]; - } - - // The destination (if any) for logs. - enum Destination { - // (Default) Logs are not preserved. - DESTINATION_UNSPECIFIED = 0; - - // Logs are streamed to Cloud Logging. Optionally, you can configure - // additional settings in the `cloudLoggingOption` field. - CLOUD_LOGGING = 1; - - // Logs are saved to the file path specified in the `logsPath` field. - PATH = 2; - } - - // If and where logs should be saved. - Destination destination = 1; - - // When `destination` is set to `PATH`, you must set this field to the path - // where you want logs to be saved. This path can point to a local directory - // on the VM or (if congifured) a directory under the mount path of any - // Cloud Storage bucket, network file system (NFS), or writable persistent - // disk that is mounted to the job. For example, if the job has a bucket with - // `mountPath` set to `/mnt/disks/my-bucket`, you can write logs to the - // root directory of the `remotePath` of that bucket by setting this field to - // `/mnt/disks/my-bucket/`. - string logs_path = 2; - - // Optional. When `destination` is set to `CLOUD_LOGGING`, you can optionally - // set this field to configure additional settings for Cloud Logging. - CloudLoggingOption cloud_logging_option = 3 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Job status. -message JobStatus { - // VM instance status. - message InstanceStatus { - // The Compute Engine machine type. - string machine_type = 1; - - // The VM instance provisioning model. - AllocationPolicy.ProvisioningModel provisioning_model = 2; - - // The max number of tasks can be assigned to this instance type. - int64 task_pack = 3; - - // The VM boot disk. - AllocationPolicy.Disk boot_disk = 4; - } - - // Aggregated task status for a TaskGroup. - message TaskGroupStatus { - // Count of task in each state in the TaskGroup. - // The map key is task state name. - map counts = 1; - - // Status of instances allocated for the TaskGroup. - repeated InstanceStatus instances = 2; - } - - // Valid Job states. - enum State { - // Job state unspecified. - STATE_UNSPECIFIED = 0; - - // Job is admitted (validated and persisted) and waiting for resources. - QUEUED = 1; - - // Job is scheduled to run as soon as resource allocation is ready. - // The resource allocation may happen at a later time but with a high - // chance to succeed. - SCHEDULED = 2; - - // Resource allocation has been successful. At least one Task in the Job is - // RUNNING. - RUNNING = 3; - - // All Tasks in the Job have finished successfully. - SUCCEEDED = 4; - - // At least one Task in the Job has failed. - FAILED = 5; - - // The Job will be deleted, but has not been deleted yet. Typically this is - // because resources used by the Job are still being cleaned up. - DELETION_IN_PROGRESS = 6; - } - - // Job state - State state = 1; - - // Job status events - repeated StatusEvent status_events = 2; - - // Aggregated task status for each TaskGroup in the Job. - // The map key is TaskGroup ID. - map task_groups = 4; - - // The duration of time that the Job spent in status RUNNING. - google.protobuf.Duration run_duration = 5; -} - -// Notification configurations. -message JobNotification { - // Message details. - // Describe the conditions under which messages will be sent. - // If no attribute is defined, no message will be sent by default. - // One message should specify either the job or the task level attributes, - // but not both. For example, - // job level: JOB_STATE_CHANGED and/or a specified new_job_state; - // task level: TASK_STATE_CHANGED and/or a specified new_task_state. - message Message { - // The message type. - Type type = 1; - - // The new job state. - JobStatus.State new_job_state = 2; - - // The new task state. - TaskStatus.State new_task_state = 3; - } - - // The message type. - enum Type { - // Unspecified. - TYPE_UNSPECIFIED = 0; - - // Notify users that the job state has changed. - JOB_STATE_CHANGED = 1; - - // Notify users that the task state has changed. - TASK_STATE_CHANGED = 2; - } - - // The Pub/Sub topic where notifications for the job, like state - // changes, will be published. If undefined, no Pub/Sub notifications - // are sent for this job. - // - // Specify the topic using the following format: - // `projects/{project}/topics/{topic}`. - // Notably, if you want to specify a Pub/Sub topic that is in a - // different project than the job, your administrator must grant your - // project's Batch service agent permission to publish to that topic. - // - // For more information about configuring Pub/Sub notifications for - // a job, see - // https://cloud.google.com/batch/docs/enable-notifications. - string pubsub_topic = 1; - - // The attribute requirements of messages to be sent to this Pub/Sub topic. - // Without this field, no message will be sent. - Message message = 2; -} - -// A Job's resource allocation policy describes when, where, and how compute -// resources should be allocated for the Job. -message AllocationPolicy { - message LocationPolicy { - // A list of allowed location names represented by internal URLs. - // - // Each location can be a region or a zone. - // Only one region or multiple zones in one region is supported now. - // For example, - // ["regions/us-central1"] allow VMs in any zones in region us-central1. - // ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs - // in zones us-central1-a and us-central1-c. - // - // Mixing locations from different regions would cause errors. - // For example, - // ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b", - // "zones/us-west1-a"] contains locations from two distinct regions: - // us-central1 and us-west1. This combination will trigger an error. - repeated string allowed_locations = 1; - } - - // A new persistent disk or a local ssd. - // A VM can only have one local SSD setting but multiple local SSD partitions. - // See https://cloud.google.com/compute/docs/disks#pdspecs and - // https://cloud.google.com/compute/docs/disks#localssds. - message Disk { - // A data source from which a PD will be created. - oneof data_source { - // URL for a VM image to use as the data source for this disk. - // For example, the following are all valid URLs: - // - // * Specify the image by its family name: - // projects/{project}/global/images/family/{image_family} - // * Specify the image version: - // projects/{project}/global/images/{image_version} - // - // You can also use Batch customized image in short names. - // The following image values are supported for a boot disk: - // - // * `batch-debian`: use Batch Debian images. - // * `batch-cos`: use Batch Container-Optimized images. - // * `batch-hpc-rocky`: use Batch HPC Rocky Linux images. - string image = 4; - - // Name of a snapshot used as the data source. - // Snapshot is not supported as boot disk now. - string snapshot = 5; - } - - // Disk type as shown in `gcloud compute disk-types list`. - // For example, local SSD uses type "local-ssd". - // Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd" - // or "pd-standard". If not specified, "pd-standard" will be used as the - // default type for non-boot disks, "pd-balanced" will be used as the - // default type for boot disks. - string type = 1; - - // Disk size in GB. - // - // **Non-Boot Disk**: - // If the `type` specifies a persistent disk, this field - // is ignored if `data_source` is set as `image` or `snapshot`. - // If the `type` specifies a local SSD, this field should be a multiple of - // 375 GB, otherwise, the final size will be the next greater multiple of - // 375 GB. - // - // **Boot Disk**: - // Batch will calculate the boot disk size based on source - // image and task requirements if you do not speicify the size. - // If both this field and the `boot_disk_mib` field in task spec's - // `compute_resource` are defined, Batch will only honor this field. - // Also, this field should be no smaller than the source disk's - // size when the `data_source` is set as `snapshot` or `image`. - // For example, if you set an image as the `data_source` field and the - // image's default disk size 30 GB, you can only use this field to make the - // disk larger or equal to 30 GB. - int64 size_gb = 2; - - // Local SSDs are available through both "SCSI" and "NVMe" interfaces. - // If not indicated, "NVMe" will be the default one for local ssds. - // This field is ignored for persistent disks as the interface is chosen - // automatically. See - // https://cloud.google.com/compute/docs/disks/persistent-disks#choose_an_interface. - string disk_interface = 6; - } - - // A new or an existing persistent disk (PD) or a local ssd attached to a VM - // instance. - message AttachedDisk { - oneof attached { - Disk new_disk = 1; - - // Name of an existing PD. - string existing_disk = 2; - } - - // Device name that the guest operating system will see. - // It is used by Runnable.volumes field to mount disks. So please specify - // the device_name if you want Batch to help mount the disk, and it should - // match the device_name field in volumes. - string device_name = 3; - } - - // Accelerator describes Compute Engine accelerators to be attached to the VM. - message Accelerator { - // The accelerator type. For example, "nvidia-tesla-t4". - // See `gcloud compute accelerator-types list`. - string type = 1; - - // The number of accelerators of this type. - int64 count = 2; - - // Deprecated: please use instances[0].install_gpu_drivers instead. - bool install_gpu_drivers = 3 [deprecated = true]; - - // Optional. The NVIDIA GPU driver version that should be installed for this - // type. - // - // You can define the specific driver version such as "470.103.01", - // following the driver version requirements in - // https://cloud.google.com/compute/docs/gpus/install-drivers-gpu#minimum-driver. - // Batch will install the specific accelerator driver if qualified. - string driver_version = 4 [(google.api.field_behavior) = OPTIONAL]; - } - - // InstancePolicy describes an instance type and resources attached to each VM - // created by this InstancePolicy. - message InstancePolicy { - // The Compute Engine machine type. - string machine_type = 2; - - // The minimum CPU platform. - // See - // https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. - string min_cpu_platform = 3; - - // The provisioning model. - ProvisioningModel provisioning_model = 4; - - // The accelerators attached to each VM instance. - repeated Accelerator accelerators = 5; - - // Boot disk to be created and attached to each VM by this InstancePolicy. - // Boot disk will be deleted when the VM is deleted. - // Batch API now only supports booting from image. - Disk boot_disk = 8; - - // Non-boot disks to be attached for each VM created by this InstancePolicy. - // New disks will be deleted when the VM is deleted. - // A non-boot disk is a disk that can be of a device with a - // file system or a raw storage drive that is not ready for data - // storage and accessing. - repeated AttachedDisk disks = 6; - - // Optional. If not specified (default), VMs will consume any applicable - // reservation. If "NO_RESERVATION" is specified, VMs will not consume any - // reservation. Otherwise, if specified, VMs will consume only the specified - // reservation. - string reservation = 7 [(google.api.field_behavior) = OPTIONAL]; - } - - // InstancePolicyOrTemplate lets you define the type of resources to use for - // this job either with an InstancePolicy or an instance template. - // If undefined, Batch picks the type of VM to use and doesn't include - // optional VM resources such as GPUs and extra disks. - message InstancePolicyOrTemplate { - oneof policy_template { - // InstancePolicy. - InstancePolicy policy = 1; - - // Name of an instance template used to create VMs. - // Named the field as 'instance_template' instead of 'template' to avoid - // C++ keyword conflict. - // - // Batch only supports global instance templates from the same project as - // the job. - // You can specify the global instance template as a full or partial URL. - string instance_template = 2; - } - - // Set this field true if you want Batch to help fetch drivers from a third - // party location and install them for GPUs specified in - // `policy.accelerators` or `instance_template` on your behalf. Default is - // false. - // - // For Container-Optimized Image cases, Batch will install the - // accelerator driver following milestones of - // https://cloud.google.com/container-optimized-os/docs/release-notes. For - // non Container-Optimized Image cases, following - // https://github.com/GoogleCloudPlatform/compute-gpu-installation/blob/main/linux/install_gpu_driver.py. - bool install_gpu_drivers = 3; - - // Optional. Set this field true if you want Batch to install Ops Agent on - // your behalf. Default is false. - bool install_ops_agent = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Set this field to `true` if you want Batch to block - // project-level SSH keys from accessing this job's VMs. Alternatively, you - // can configure the job to specify a VM instance template that blocks - // project-level SSH keys. In either case, Batch blocks project-level SSH - // keys while creating the VMs for this job. - // - // Batch allows project-level SSH keys for a job's VMs only if all - // the following are true: - // - // + This field is undefined or set to `false`. - // + The job's VM instance template (if any) doesn't block project-level - // SSH keys. - // - // Notably, you can override this behavior by manually updating a VM to - // block or allow project-level SSH keys. For more information about - // blocking project-level SSH keys, see the Compute Engine documentation: - // https://cloud.google.com/compute/docs/connect/restrict-ssh-keys#block-keys - bool block_project_ssh_keys = 5 [(google.api.field_behavior) = OPTIONAL]; - } - - // A network interface. - message NetworkInterface { - // The URL of an existing network resource. - // You can specify the network as a full or partial URL. - // - // For example, the following are all valid URLs: - // - // * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network} - // * projects/{project}/global/networks/{network} - // * global/networks/{network} - string network = 1; - - // The URL of an existing subnetwork resource in the network. - // You can specify the subnetwork as a full or partial URL. - // - // For example, the following are all valid URLs: - // - // * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork} - // * projects/{project}/regions/{region}/subnetworks/{subnetwork} - // * regions/{region}/subnetworks/{subnetwork} - string subnetwork = 2; - - // Default is false (with an external IP address). Required if - // no external public IP address is attached to the VM. If no external - // public IP address, additional configuration is required to allow the VM - // to access Google Services. See - // https://cloud.google.com/vpc/docs/configure-private-google-access and - // https://cloud.google.com/nat/docs/gce-example#create-nat for more - // information. - bool no_external_ip_address = 3; - } - - // NetworkPolicy describes VM instance network configurations. - message NetworkPolicy { - // Network configurations. - repeated NetworkInterface network_interfaces = 1; - } - - // PlacementPolicy describes a group placement policy for the VMs controlled - // by this AllocationPolicy. - message PlacementPolicy { - // UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you - // want VMs to be located close to each other for low network latency - // between the VMs. No placement policy will be generated when collocation - // is UNSPECIFIED. - string collocation = 1; - - // When specified, causes the job to fail if more than max_distance logical - // switches are required between VMs. Batch uses the most compact possible - // placement of VMs even when max_distance is not specified. An explicit - // max_distance makes that level of compactness a strict requirement. - // Not yet implemented - int64 max_distance = 2; - } - - // Compute Engine VM instance provisioning model. - enum ProvisioningModel { - // Unspecified. - PROVISIONING_MODEL_UNSPECIFIED = 0; - - // Standard VM. - STANDARD = 1; - - // SPOT VM. - SPOT = 2; - - // Preemptible VM (PVM). - // - // Above SPOT VM is the preferable model for preemptible VM instances: the - // old preemptible VM model (indicated by this field) is the older model, - // and has been migrated to use the SPOT model as the underlying technology. - // This old model will still be supported. - PREEMPTIBLE = 3; - } - - // Location where compute resources should be allocated for the Job. - LocationPolicy location = 1; - - // Describe instances that can be created by this AllocationPolicy. - // Only instances[0] is supported now. - repeated InstancePolicyOrTemplate instances = 8; - - // Defines the service account for Batch-created VMs. If omitted, the [default - // Compute Engine service - // account](https://cloud.google.com/compute/docs/access/service-accounts#default_service_account) - // is used. Must match the service account specified in any used instance - // template configured in the Batch job. - // - // Includes the following fields: - // * email: The service account's email address. If not set, the default - // Compute Engine service account is used. - // * scopes: Additional OAuth scopes to grant the service account, beyond the - // default cloud-platform scope. (list of strings) - ServiceAccount service_account = 9; - - // Custom labels to apply to the job and all the Compute Engine resources - // that both are created by this allocation policy and support labels. - // - // Use labels to group and describe the resources they are applied to. Batch - // automatically applies predefined labels and supports multiple `labels` - // fields for each job, which each let you apply custom labels to various - // resources. Label names that start with "goog-" or "google-" are - // reserved for predefined labels. For more information about labels with - // Batch, see - // [Organize resources using - // labels](https://cloud.google.com/batch/docs/organize-resources-using-labels). - map labels = 6; - - // The network policy. - // - // If you define an instance template in the `InstancePolicyOrTemplate` field, - // Batch will use the network settings in the instance template instead of - // this field. - NetworkPolicy network = 7; - - // The placement policy. - PlacementPolicy placement = 10; - - // Optional. Tags applied to the VM instances. - // - // The tags identify valid sources or targets for network firewalls. - // Each tag must be 1-63 characters long, and comply with - // [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). - repeated string tags = 11 [(google.api.field_behavior) = OPTIONAL]; -} - -// A TaskGroup defines one or more Tasks that all share the same TaskSpec. -message TaskGroup { - option (google.api.resource) = { - type: "batch.googleapis.com/TaskGroup" - pattern: "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" - }; - - // How Tasks in the TaskGroup should be scheduled relative to each other. - enum SchedulingPolicy { - // Unspecified. - SCHEDULING_POLICY_UNSPECIFIED = 0; - - // Run Tasks as soon as resources are available. - // - // Tasks might be executed in parallel depending on parallelism and - // task_count values. - AS_SOON_AS_POSSIBLE = 1; - - // Run Tasks sequentially with increased task index. - IN_ORDER = 2; - } - - // Output only. TaskGroup name. - // The system generates this field based on parent Job name. - // For example: - // "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01". - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. Tasks in the group share the same task spec. - TaskSpec task_spec = 3 [(google.api.field_behavior) = REQUIRED]; - - // Number of Tasks in the TaskGroup. - // Default is 1. - int64 task_count = 4; - - // Max number of tasks that can run in parallel. - // Default to min(task_count, parallel tasks per job limit). - // See: [Job Limits](https://cloud.google.com/batch/quotas#job_limits). - // Field parallelism must be 1 if the scheduling_policy is IN_ORDER. - int64 parallelism = 5; - - // Scheduling policy for Tasks in the TaskGroup. - // The default value is AS_SOON_AS_POSSIBLE. - SchedulingPolicy scheduling_policy = 6; - - // An array of environment variable mappings, which are passed to Tasks with - // matching indices. If task_environments is used then task_count should - // not be specified in the request (and will be ignored). Task count will be - // the length of task_environments. - // - // Tasks get a BATCH_TASK_INDEX and BATCH_TASK_COUNT environment variable, in - // addition to any environment variables set in task_environments, specifying - // the number of Tasks in the Task's parent TaskGroup, and the specific Task's - // index in the TaskGroup (0 through BATCH_TASK_COUNT - 1). - repeated Environment task_environments = 9; - - // Max number of tasks that can be run on a VM at the same time. - // If not specified, the system will decide a value based on available - // compute resources on a VM and task requirements. - int64 task_count_per_node = 10; - - // When true, Batch will populate a file with a list of all VMs assigned to - // the TaskGroup and set the BATCH_HOSTS_FILE environment variable to the path - // of that file. Defaults to false. The host file supports up to 1000 VMs. - bool require_hosts_file = 11; - - // When true, Batch will configure SSH to allow passwordless login between - // VMs running the Batch tasks in the same TaskGroup. - bool permissive_ssh = 12; - - // Optional. If not set or set to false, Batch uses the root user to execute - // runnables. If set to true, Batch runs the runnables using a non-root user. - // Currently, the non-root user Batch used is generated by OS Login. For more - // information, see [About OS - // Login](https://cloud.google.com/compute/docs/oslogin). - bool run_as_non_root = 14 [(google.api.field_behavior) = OPTIONAL]; -} - -// Carries information about a Google Cloud service account. -message ServiceAccount { - // Email address of the service account. - string email = 1; - - // List of scopes to be enabled for this service account. - repeated string scopes = 2; -} diff --git a/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/task.proto b/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/task.proto deleted file mode 100644 index f9edabb2b6a..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/task.proto +++ /dev/null @@ -1,475 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.batch.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/batch/v1/volume.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.Batch.V1"; -option go_package = "cloud.google.com/go/batch/apiv1/batchpb;batchpb"; -option java_multiple_files = true; -option java_outer_classname = "TaskProto"; -option java_package = "com.google.cloud.batch.v1"; -option objc_class_prefix = "GCB"; -option php_namespace = "Google\\Cloud\\Batch\\V1"; -option ruby_package = "Google::Cloud::Batch::V1"; - -// Compute resource requirements. -// -// ComputeResource defines the amount of resources required for each task. -// Make sure your tasks have enough resources to successfully run. -// If you also define the types of resources for a job to use with the -// [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) -// field, make sure both fields are compatible with each other. -message ComputeResource { - // The milliCPU count. - // - // `cpuMilli` defines the amount of CPU resources per task in milliCPU units. - // For example, `1000` corresponds to 1 vCPU per task. If undefined, the - // default value is `2000`. - // - // If you also define the VM's machine type using the `machineType` in - // [InstancePolicy](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicy) - // field or inside the `instanceTemplate` in the - // [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) - // field, make sure the CPU resources for both fields are compatible with each - // other and with how many tasks you want to allow to run on the same VM at - // the same time. - // - // For example, if you specify the `n2-standard-2` machine type, which has 2 - // vCPUs each, you are recommended to set `cpuMilli` no more than `2000`, or - // you are recommended to run two tasks on the same VM if you set `cpuMilli` - // to `1000` or less. - int64 cpu_milli = 1; - - // Memory in MiB. - // - // `memoryMib` defines the amount of memory per task in MiB units. - // If undefined, the default value is `2000`. - // If you also define the VM's machine type using the `machineType` in - // [InstancePolicy](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicy) - // field or inside the `instanceTemplate` in the - // [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) - // field, make sure the memory resources for both fields are compatible with - // each other and with how many tasks you want to allow to run on the same VM - // at the same time. - // - // For example, if you specify the `n2-standard-2` machine type, which has 8 - // GiB each, you are recommended to set `memoryMib` to no more than `8192`, - // or you are recommended to run two tasks on the same VM if you set - // `memoryMib` to `4096` or less. - int64 memory_mib = 2; - - // Extra boot disk size in MiB for each task. - int64 boot_disk_mib = 4; -} - -// Status event. -message StatusEvent { - // Type of the event. - string type = 3; - - // Description of the event. - string description = 1; - - // The time this event occurred. - google.protobuf.Timestamp event_time = 2; - - // Task Execution. - // This field is only defined for task-level status events where the task - // fails. - TaskExecution task_execution = 4; - - // Task State. - // This field is only defined for task-level status events. - TaskStatus.State task_state = 5; -} - -// This Task Execution field includes detail information for -// task execution procedures, based on StatusEvent types. -message TaskExecution { - // The exit code of a finished task. - // - // If the task succeeded, the exit code will be 0. If the task failed but not - // due to the following reasons, the exit code will be 50000. - // - // Otherwise, it can be from different sources: - // * Batch known failures: - // https://cloud.google.com/batch/docs/troubleshooting#reserved-exit-codes. - // * Batch runnable execution failures; you can rely on Batch logs to further - // diagnose: https://cloud.google.com/batch/docs/analyze-job-using-logs. If - // there are multiple runnables failures, Batch only exposes the first error. - int32 exit_code = 1; -} - -// Status of a task. -message TaskStatus { - // Task states. - enum State { - // Unknown state. - STATE_UNSPECIFIED = 0; - - // The Task is created and waiting for resources. - PENDING = 1; - - // The Task is assigned to at least one VM. - ASSIGNED = 2; - - // The Task is running. - RUNNING = 3; - - // The Task has failed. - FAILED = 4; - - // The Task has succeeded. - SUCCEEDED = 5; - - // The Task has not been executed when the Job finishes. - UNEXECUTED = 6; - } - - // Task state. - State state = 1; - - // Detailed info about why the state is reached. - repeated StatusEvent status_events = 2; -} - -// Runnable describes instructions for executing a specific script or container -// as part of a Task. -message Runnable { - // Container runnable. - message Container { - // Required. The URI to pull the container image from. - string image_uri = 1; - - // Required for some container images. Overrides the `CMD` specified in the - // container. If there is an `ENTRYPOINT` (either in the container image or - // with the `entrypoint` field below) then these commands are appended as - // arguments to the `ENTRYPOINT`. - repeated string commands = 2; - - // Required for some container images. Overrides the `ENTRYPOINT` specified - // in the container. - string entrypoint = 3; - - // Volumes to mount (bind mount) from the host machine files or directories - // into the container, formatted to match `--volume` option for the - // `docker run` command—for example, `/foo:/bar` or `/foo:/bar:ro`. - // - // If the `TaskSpec.Volumes` field is specified but this field is not, Batch - // will mount each volume from the host machine to the container with the - // same mount path by default. In this case, the default mount option for - // containers will be read-only (`ro`) for existing persistent disks and - // read-write (`rw`) for other volume types, regardless of the original - // mount options specified in `TaskSpec.Volumes`. If you need different - // mount settings, you can explicitly configure them in this field. - repeated string volumes = 7; - - // Required for some container images. Arbitrary additional options to - // include in the `docker run` command when running this container—for - // example, `--network host`. For the `--volume` option, use the `volumes` - // field for the container. - string options = 8; - - // If set to true, external network access to and from container will be - // blocked, containers that are with block_external_network as true can - // still communicate with each other, network cannot be specified in the - // `container.options` field. - bool block_external_network = 9; - - // Required if the container image is from a private Docker registry. The - // username to login to the Docker registry that contains the image. - // - // You can either specify the username directly by using plain text or - // specify an encrypted username by using a Secret Manager secret: - // `projects/*/secrets/*/versions/*`. However, using a secret is - // recommended for enhanced security. - // - // Caution: If you specify the username using plain text, you risk the - // username being exposed to any users who can view the job or its logs. - // To avoid this risk, specify a secret that contains the username instead. - // - // Learn more about [Secret - // Manager](https://cloud.google.com/secret-manager/docs/) and [using - // Secret Manager with - // Batch](https://cloud.google.com/batch/docs/create-run-job-secret-manager). - string username = 10; - - // Required if the container image is from a private Docker registry. The - // password to login to the Docker registry that contains the image. - // - // For security, it is strongly recommended to specify an - // encrypted password by using a Secret Manager secret: - // `projects/*/secrets/*/versions/*`. - // - // Warning: If you specify the password using plain text, you risk the - // password being exposed to any users who can view the job or its logs. - // To avoid this risk, specify a secret that contains the password instead. - // - // Learn more about [Secret - // Manager](https://cloud.google.com/secret-manager/docs/) and [using - // Secret Manager with - // Batch](https://cloud.google.com/batch/docs/create-run-job-secret-manager). - string password = 11; - - // Optional. If set to true, this container runnable uses Image streaming. - // - // Use Image streaming to allow the runnable to initialize without - // waiting for the entire container image to download, which can - // significantly reduce startup time for large container images. - // - // When `enableImageStreaming` is set to true, the container - // runtime is [containerd](https://containerd.io/) instead of Docker. - // Additionally, this container runnable only supports the following - // `container` subfields: `imageUri`, - // `commands[]`, `entrypoint`, and - // `volumes[]`; any other `container` subfields are ignored. - // - // For more information about the requirements and limitations for using - // Image streaming with Batch, see the [`image-streaming` - // sample on - // GitHub](https://github.com/GoogleCloudPlatform/batch-samples/tree/main/api-samples/image-streaming). - bool enable_image_streaming = 12 [(google.api.field_behavior) = OPTIONAL]; - } - - // Script runnable. - message Script { - // Required. The source code for this script runnable. - oneof command { - // The path to a script file that is accessible from the host VM(s). - // - // Unless the script file supports the default `#!/bin/sh` shell - // interpreter, you must specify an interpreter by including a - // [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix) as the - // first line of the file. For example, to execute the script using bash, - // include `#!/bin/bash` as the first line of the file. Alternatively, - // to execute the script using Python3, include `#!/usr/bin/env python3` - // as the first line of the file. - string path = 1; - - // The text for a script. - // - // Unless the script text supports the default `#!/bin/sh` shell - // interpreter, you must specify an interpreter by including a - // [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix) at the - // beginning of the text. For example, to execute the script using bash, - // include `#!/bin/bash\n` at the beginning of the text. Alternatively, - // to execute the script using Python3, include `#!/usr/bin/env python3\n` - // at the beginning of the text. - string text = 2; - } - } - - // A barrier runnable automatically blocks the execution of subsequent - // runnables until all the tasks in the task group reach the barrier. - message Barrier { - // Barriers are identified by their index in runnable list. - // Names are not required, but if present should be an identifier. - string name = 1; - } - - // Required. The script, container, or barrier for this runnable to execute. - oneof executable { - // Container runnable. - Container container = 1; - - // Script runnable. - Script script = 2; - - // Barrier runnable. - Barrier barrier = 6; - } - - // Optional. DisplayName is an optional field that can be provided by the - // caller. If provided, it will be used in logs and other outputs to identify - // the script, making it easier for users to understand the logs. If not - // provided the index of the runnable will be used for outputs. - string display_name = 10 [(google.api.field_behavior) = OPTIONAL]; - - // Normally, a runnable that returns a non-zero exit status fails and causes - // the task to fail. However, you can set this field to `true` to allow the - // task to continue executing its other runnables even if this runnable - // fails. - bool ignore_exit_status = 3; - - // Normally, a runnable that doesn't exit causes its task to fail. However, - // you can set this field to `true` to configure a background runnable. - // Background runnables are allowed continue running in the background while - // the task executes subsequent runnables. For example, background runnables - // are useful for providing services to other runnables or providing - // debugging-support tools like SSH servers. - // - // Specifically, background runnables are killed automatically (if they have - // not already exited) a short time after all foreground runnables have - // completed. Even though this is likely to result in a non-zero exit status - // for the background runnable, these automatic kills are not treated as task - // failures. - bool background = 4; - - // By default, after a Runnable fails, no further Runnable are executed. This - // flag indicates that this Runnable must be run even if the Task has already - // failed. This is useful for Runnables that copy output files off of the VM - // or for debugging. - // - // The always_run flag does not override the Task's overall max_run_duration. - // If the max_run_duration has expired then no further Runnables will execute, - // not even always_run Runnables. - bool always_run = 5; - - // Environment variables for this Runnable (overrides variables set for the - // whole Task or TaskGroup). - Environment environment = 7; - - // Timeout for this Runnable. - google.protobuf.Duration timeout = 8; - - // Labels for this Runnable. - map labels = 9; -} - -// Spec of a task -message TaskSpec { - // Required. The sequence of one or more runnables (executable scripts, - // executable containers, and/or barriers) for each task in this task group to - // run. Each task runs this list of runnables in order. For a task to succeed, - // all of its script and container runnables each must meet at least one of - // the following conditions: - // - // + The runnable exited with a zero status. - // + The runnable didn't finish, but you enabled its `background` subfield. - // + The runnable exited with a non-zero status, but you enabled its - // `ignore_exit_status` subfield. - repeated Runnable runnables = 8; - - // ComputeResource requirements. - ComputeResource compute_resource = 3; - - // Maximum duration the task should run before being automatically retried - // (if enabled) or automatically failed. Format the value of this field - // as a time limit in seconds followed by `s`—for example, `3600s` - // for 1 hour. The field accepts any value between 0 and the maximum listed - // for the `Duration` field type at - // https://protobuf.dev/reference/protobuf/google.protobuf/#duration; however, - // the actual maximum run time for a job will be limited to the maximum run - // time for a job listed at - // https://cloud.google.com/batch/quotas#max-job-duration. - google.protobuf.Duration max_run_duration = 4; - - // Maximum number of retries on failures. - // The default, 0, which means never retry. - // The valid value range is [0, 10]. - int32 max_retry_count = 5; - - // Lifecycle management schema when any task in a task group is failed. - // Currently we only support one lifecycle policy. - // When the lifecycle policy condition is met, - // the action in the policy will execute. - // If task execution result does not meet with the defined lifecycle - // policy, we consider it as the default policy. - // Default policy means if the exit code is 0, exit task. - // If task ends with non-zero exit code, retry the task with max_retry_count. - repeated LifecyclePolicy lifecycle_policies = 9; - - // Deprecated: please use environment(non-plural) instead. - map environments = 6 [deprecated = true]; - - // Volumes to mount before running Tasks using this TaskSpec. - repeated Volume volumes = 7; - - // Environment variables to set before running the Task. - Environment environment = 10; -} - -// LifecyclePolicy describes how to deal with task failures -// based on different conditions. -message LifecyclePolicy { - // Conditions for actions to deal with task failures. - message ActionCondition { - // Exit codes of a task execution. - // If there are more than 1 exit codes, - // when task executes with any of the exit code in the list, - // the condition is met and the action will be executed. - repeated int32 exit_codes = 1; - } - - // Action on task failures based on different conditions. - enum Action { - // Action unspecified. - ACTION_UNSPECIFIED = 0; - - // Action that tasks in the group will be scheduled to re-execute. - RETRY_TASK = 1; - - // Action that tasks in the group will be stopped immediately. - FAIL_TASK = 2; - } - - // Action to execute when ActionCondition is true. - // When RETRY_TASK is specified, we will retry failed tasks - // if we notice any exit code match and fail tasks if no match is found. - // Likewise, when FAIL_TASK is specified, we will fail tasks - // if we notice any exit code match and retry tasks if no match is found. - Action action = 1; - - // Conditions that decide why a task failure is dealt with a specific action. - ActionCondition action_condition = 2; -} - -// A Cloud Batch task. -message Task { - option (google.api.resource) = { - type: "batch.googleapis.com/Task" - pattern: "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}/tasks/{task}" - }; - - // Task name. - // The name is generated from the parent TaskGroup name and 'id' field. - // For example: - // "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01/tasks/task01". - string name = 1; - - // Task Status. - TaskStatus status = 2; -} - -// An Environment describes a collection of environment variables to set when -// executing Tasks. -message Environment { - message KMSEnvMap { - // The name of the KMS key that will be used to decrypt the cipher text. - string key_name = 1; - - // The value of the cipherText response from the `encrypt` method. - string cipher_text = 2; - } - - // A map of environment variable names to values. - map variables = 1; - - // A map of environment variable names to Secret Manager secret names. - // The VM will access the named secrets to set the value of each environment - // variable. - map secret_variables = 2; - - // An encrypted JSON dictionary where the key/value pairs correspond to - // environment variable names and their values. - KMSEnvMap encrypted_variables = 3; -} diff --git a/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/volume.proto b/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/volume.proto deleted file mode 100644 index 9bf8126f634..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/protos/google/cloud/batch/v1/volume.proto +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.batch.v1; - -option csharp_namespace = "Google.Cloud.Batch.V1"; -option go_package = "cloud.google.com/go/batch/apiv1/batchpb;batchpb"; -option java_multiple_files = true; -option java_outer_classname = "VolumeProto"; -option java_package = "com.google.cloud.batch.v1"; -option objc_class_prefix = "GCB"; -option php_namespace = "Google\\Cloud\\Batch\\V1"; -option ruby_package = "Google::Cloud::Batch::V1"; - -// Volume describes a volume and parameters for it to be mounted to a VM. -message Volume { - // The source for the volume. - oneof source { - // A Network File System (NFS) volume. For example, a - // Filestore file share. - NFS nfs = 1; - - // A Google Cloud Storage (GCS) volume. - GCS gcs = 3; - - // Device name of an attached disk volume, which should align with a - // device_name specified by - // job.allocation_policy.instances[0].policy.disks[i].device_name or - // defined by the given instance template in - // job.allocation_policy.instances[0].instance_template. - string device_name = 6; - } - - // The mount path for the volume, e.g. /mnt/disks/share. - string mount_path = 4; - - // Mount options vary based on the type of storage volume: - // - // * For a Cloud Storage bucket, all the mount options provided - // by - // the [`gcsfuse` tool](https://cloud.google.com/storage/docs/gcsfuse-cli) - // are supported. - // * For an existing persistent disk, all mount options provided by the - // [`mount` command](https://man7.org/linux/man-pages/man8/mount.8.html) - // except writing are supported. This is due to restrictions of - // [multi-writer - // mode](https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms). - // * For any other disk or a Network File System (NFS), all the - // mount options provided by the `mount` command are supported. - repeated string mount_options = 5; -} - -// Represents an NFS volume. -message NFS { - // The IP address of the NFS. - string server = 1; - - // Remote source path exported from the NFS, e.g., "/share". - string remote_path = 2; -} - -// Represents a Google Cloud Storage volume. -message GCS { - // Remote path, either a bucket name or a subdirectory of a bucket, e.g.: - // bucket_name, bucket_name/subdirectory/ - string remote_path = 1; -} diff --git a/owl-bot-staging/google-cloud-batch/v1/protos/protos.d.ts b/owl-bot-staging/google-cloud-batch/v1/protos/protos.d.ts deleted file mode 100644 index 4d35440216c..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/protos/protos.d.ts +++ /dev/null @@ -1,13321 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import type {protobuf as $protobuf} from "google-gax"; -import Long = require("long"); -/** Namespace google. */ -export namespace google { - - /** Namespace cloud. */ - namespace cloud { - - /** Namespace batch. */ - namespace batch { - - /** Namespace v1. */ - namespace v1 { - - /** Represents a BatchService */ - class BatchService extends $protobuf.rpc.Service { - - /** - * Constructs a new BatchService 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 BatchService 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): BatchService; - - /** - * Calls CreateJob. - * @param request CreateJobRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Job - */ - public createJob(request: google.cloud.batch.v1.ICreateJobRequest, callback: google.cloud.batch.v1.BatchService.CreateJobCallback): void; - - /** - * Calls CreateJob. - * @param request CreateJobRequest message or plain object - * @returns Promise - */ - public createJob(request: google.cloud.batch.v1.ICreateJobRequest): Promise; - - /** - * Calls GetJob. - * @param request GetJobRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Job - */ - public getJob(request: google.cloud.batch.v1.IGetJobRequest, callback: google.cloud.batch.v1.BatchService.GetJobCallback): void; - - /** - * Calls GetJob. - * @param request GetJobRequest message or plain object - * @returns Promise - */ - public getJob(request: google.cloud.batch.v1.IGetJobRequest): Promise; - - /** - * Calls DeleteJob. - * @param request DeleteJobRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteJob(request: google.cloud.batch.v1.IDeleteJobRequest, callback: google.cloud.batch.v1.BatchService.DeleteJobCallback): void; - - /** - * Calls DeleteJob. - * @param request DeleteJobRequest message or plain object - * @returns Promise - */ - public deleteJob(request: google.cloud.batch.v1.IDeleteJobRequest): Promise; - - /** - * Calls ListJobs. - * @param request ListJobsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListJobsResponse - */ - public listJobs(request: google.cloud.batch.v1.IListJobsRequest, callback: google.cloud.batch.v1.BatchService.ListJobsCallback): void; - - /** - * Calls ListJobs. - * @param request ListJobsRequest message or plain object - * @returns Promise - */ - public listJobs(request: google.cloud.batch.v1.IListJobsRequest): Promise; - - /** - * Calls GetTask. - * @param request GetTaskRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Task - */ - public getTask(request: google.cloud.batch.v1.IGetTaskRequest, callback: google.cloud.batch.v1.BatchService.GetTaskCallback): void; - - /** - * Calls GetTask. - * @param request GetTaskRequest message or plain object - * @returns Promise - */ - public getTask(request: google.cloud.batch.v1.IGetTaskRequest): Promise; - - /** - * Calls ListTasks. - * @param request ListTasksRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListTasksResponse - */ - public listTasks(request: google.cloud.batch.v1.IListTasksRequest, callback: google.cloud.batch.v1.BatchService.ListTasksCallback): void; - - /** - * Calls ListTasks. - * @param request ListTasksRequest message or plain object - * @returns Promise - */ - public listTasks(request: google.cloud.batch.v1.IListTasksRequest): Promise; - } - - namespace BatchService { - - /** - * Callback as used by {@link google.cloud.batch.v1.BatchService|createJob}. - * @param error Error, if any - * @param [response] Job - */ - type CreateJobCallback = (error: (Error|null), response?: google.cloud.batch.v1.Job) => void; - - /** - * Callback as used by {@link google.cloud.batch.v1.BatchService|getJob}. - * @param error Error, if any - * @param [response] Job - */ - type GetJobCallback = (error: (Error|null), response?: google.cloud.batch.v1.Job) => void; - - /** - * Callback as used by {@link google.cloud.batch.v1.BatchService|deleteJob}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.batch.v1.BatchService|listJobs}. - * @param error Error, if any - * @param [response] ListJobsResponse - */ - type ListJobsCallback = (error: (Error|null), response?: google.cloud.batch.v1.ListJobsResponse) => void; - - /** - * Callback as used by {@link google.cloud.batch.v1.BatchService|getTask}. - * @param error Error, if any - * @param [response] Task - */ - type GetTaskCallback = (error: (Error|null), response?: google.cloud.batch.v1.Task) => void; - - /** - * Callback as used by {@link google.cloud.batch.v1.BatchService|listTasks}. - * @param error Error, if any - * @param [response] ListTasksResponse - */ - type ListTasksCallback = (error: (Error|null), response?: google.cloud.batch.v1.ListTasksResponse) => void; - } - - /** Properties of a CreateJobRequest. */ - interface ICreateJobRequest { - - /** CreateJobRequest parent */ - parent?: (string|null); - - /** CreateJobRequest jobId */ - jobId?: (string|null); - - /** CreateJobRequest job */ - job?: (google.cloud.batch.v1.IJob|null); - - /** CreateJobRequest requestId */ - requestId?: (string|null); - } - - /** Represents a CreateJobRequest. */ - class CreateJobRequest implements ICreateJobRequest { - - /** - * Constructs a new CreateJobRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.ICreateJobRequest); - - /** CreateJobRequest parent. */ - public parent: string; - - /** CreateJobRequest jobId. */ - public jobId: string; - - /** CreateJobRequest job. */ - public job?: (google.cloud.batch.v1.IJob|null); - - /** CreateJobRequest requestId. */ - public requestId: string; - - /** - * Creates a new CreateJobRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateJobRequest instance - */ - public static create(properties?: google.cloud.batch.v1.ICreateJobRequest): google.cloud.batch.v1.CreateJobRequest; - - /** - * Encodes the specified CreateJobRequest message. Does not implicitly {@link google.cloud.batch.v1.CreateJobRequest.verify|verify} messages. - * @param message CreateJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.ICreateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.CreateJobRequest.verify|verify} messages. - * @param message CreateJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.ICreateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateJobRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.CreateJobRequest; - - /** - * Decodes a CreateJobRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.CreateJobRequest; - - /** - * Verifies a CreateJobRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateJobRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateJobRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.CreateJobRequest; - - /** - * Creates a plain object from a CreateJobRequest message. Also converts values to other types if specified. - * @param message CreateJobRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.CreateJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateJobRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateJobRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetJobRequest. */ - interface IGetJobRequest { - - /** GetJobRequest name */ - name?: (string|null); - } - - /** Represents a GetJobRequest. */ - class GetJobRequest implements IGetJobRequest { - - /** - * Constructs a new GetJobRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IGetJobRequest); - - /** GetJobRequest name. */ - public name: string; - - /** - * Creates a new GetJobRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetJobRequest instance - */ - public static create(properties?: google.cloud.batch.v1.IGetJobRequest): google.cloud.batch.v1.GetJobRequest; - - /** - * Encodes the specified GetJobRequest message. Does not implicitly {@link google.cloud.batch.v1.GetJobRequest.verify|verify} messages. - * @param message GetJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IGetJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.GetJobRequest.verify|verify} messages. - * @param message GetJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IGetJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetJobRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.GetJobRequest; - - /** - * Decodes a GetJobRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.GetJobRequest; - - /** - * Verifies a GetJobRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetJobRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetJobRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.GetJobRequest; - - /** - * Creates a plain object from a GetJobRequest message. Also converts values to other types if specified. - * @param message GetJobRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.GetJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetJobRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetJobRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteJobRequest. */ - interface IDeleteJobRequest { - - /** DeleteJobRequest name */ - name?: (string|null); - - /** DeleteJobRequest reason */ - reason?: (string|null); - - /** DeleteJobRequest requestId */ - requestId?: (string|null); - } - - /** Represents a DeleteJobRequest. */ - class DeleteJobRequest implements IDeleteJobRequest { - - /** - * Constructs a new DeleteJobRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IDeleteJobRequest); - - /** DeleteJobRequest name. */ - public name: string; - - /** DeleteJobRequest reason. */ - public reason: string; - - /** DeleteJobRequest requestId. */ - public requestId: string; - - /** - * Creates a new DeleteJobRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteJobRequest instance - */ - public static create(properties?: google.cloud.batch.v1.IDeleteJobRequest): google.cloud.batch.v1.DeleteJobRequest; - - /** - * Encodes the specified DeleteJobRequest message. Does not implicitly {@link google.cloud.batch.v1.DeleteJobRequest.verify|verify} messages. - * @param message DeleteJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IDeleteJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.DeleteJobRequest.verify|verify} messages. - * @param message DeleteJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IDeleteJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteJobRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.DeleteJobRequest; - - /** - * Decodes a DeleteJobRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.DeleteJobRequest; - - /** - * Verifies a DeleteJobRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteJobRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteJobRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.DeleteJobRequest; - - /** - * Creates a plain object from a DeleteJobRequest message. Also converts values to other types if specified. - * @param message DeleteJobRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.DeleteJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteJobRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteJobRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListJobsRequest. */ - interface IListJobsRequest { - - /** ListJobsRequest parent */ - parent?: (string|null); - - /** ListJobsRequest filter */ - filter?: (string|null); - - /** ListJobsRequest orderBy */ - orderBy?: (string|null); - - /** ListJobsRequest pageSize */ - pageSize?: (number|null); - - /** ListJobsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListJobsRequest. */ - class ListJobsRequest implements IListJobsRequest { - - /** - * Constructs a new ListJobsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IListJobsRequest); - - /** ListJobsRequest parent. */ - public parent: string; - - /** ListJobsRequest filter. */ - public filter: string; - - /** ListJobsRequest orderBy. */ - public orderBy: string; - - /** ListJobsRequest pageSize. */ - public pageSize: number; - - /** ListJobsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListJobsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListJobsRequest instance - */ - public static create(properties?: google.cloud.batch.v1.IListJobsRequest): google.cloud.batch.v1.ListJobsRequest; - - /** - * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.cloud.batch.v1.ListJobsRequest.verify|verify} messages. - * @param message ListJobsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IListJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListJobsRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ListJobsRequest.verify|verify} messages. - * @param message ListJobsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IListJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListJobsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListJobsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.ListJobsRequest; - - /** - * Decodes a ListJobsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListJobsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.ListJobsRequest; - - /** - * Verifies a ListJobsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListJobsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListJobsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.ListJobsRequest; - - /** - * Creates a plain object from a ListJobsRequest message. Also converts values to other types if specified. - * @param message ListJobsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.ListJobsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListJobsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListJobsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListJobsResponse. */ - interface IListJobsResponse { - - /** ListJobsResponse jobs */ - jobs?: (google.cloud.batch.v1.IJob[]|null); - - /** ListJobsResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListJobsResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListJobsResponse. */ - class ListJobsResponse implements IListJobsResponse { - - /** - * Constructs a new ListJobsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IListJobsResponse); - - /** ListJobsResponse jobs. */ - public jobs: google.cloud.batch.v1.IJob[]; - - /** ListJobsResponse nextPageToken. */ - public nextPageToken: string; - - /** ListJobsResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListJobsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListJobsResponse instance - */ - public static create(properties?: google.cloud.batch.v1.IListJobsResponse): google.cloud.batch.v1.ListJobsResponse; - - /** - * Encodes the specified ListJobsResponse message. Does not implicitly {@link google.cloud.batch.v1.ListJobsResponse.verify|verify} messages. - * @param message ListJobsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IListJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListJobsResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ListJobsResponse.verify|verify} messages. - * @param message ListJobsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IListJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListJobsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListJobsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.ListJobsResponse; - - /** - * Decodes a ListJobsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListJobsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.ListJobsResponse; - - /** - * Verifies a ListJobsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListJobsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListJobsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.ListJobsResponse; - - /** - * Creates a plain object from a ListJobsResponse message. Also converts values to other types if specified. - * @param message ListJobsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.ListJobsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListJobsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListJobsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListTasksRequest. */ - interface IListTasksRequest { - - /** ListTasksRequest parent */ - parent?: (string|null); - - /** ListTasksRequest filter */ - filter?: (string|null); - - /** ListTasksRequest pageSize */ - pageSize?: (number|null); - - /** ListTasksRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListTasksRequest. */ - class ListTasksRequest implements IListTasksRequest { - - /** - * Constructs a new ListTasksRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IListTasksRequest); - - /** ListTasksRequest parent. */ - public parent: string; - - /** ListTasksRequest filter. */ - public filter: string; - - /** ListTasksRequest pageSize. */ - public pageSize: number; - - /** ListTasksRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListTasksRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListTasksRequest instance - */ - public static create(properties?: google.cloud.batch.v1.IListTasksRequest): google.cloud.batch.v1.ListTasksRequest; - - /** - * Encodes the specified ListTasksRequest message. Does not implicitly {@link google.cloud.batch.v1.ListTasksRequest.verify|verify} messages. - * @param message ListTasksRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IListTasksRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListTasksRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ListTasksRequest.verify|verify} messages. - * @param message ListTasksRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IListTasksRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListTasksRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListTasksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.ListTasksRequest; - - /** - * Decodes a ListTasksRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListTasksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.ListTasksRequest; - - /** - * Verifies a ListTasksRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListTasksRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListTasksRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.ListTasksRequest; - - /** - * Creates a plain object from a ListTasksRequest message. Also converts values to other types if specified. - * @param message ListTasksRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.ListTasksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListTasksRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListTasksRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListTasksResponse. */ - interface IListTasksResponse { - - /** ListTasksResponse tasks */ - tasks?: (google.cloud.batch.v1.ITask[]|null); - - /** ListTasksResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListTasksResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListTasksResponse. */ - class ListTasksResponse implements IListTasksResponse { - - /** - * Constructs a new ListTasksResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IListTasksResponse); - - /** ListTasksResponse tasks. */ - public tasks: google.cloud.batch.v1.ITask[]; - - /** ListTasksResponse nextPageToken. */ - public nextPageToken: string; - - /** ListTasksResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListTasksResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListTasksResponse instance - */ - public static create(properties?: google.cloud.batch.v1.IListTasksResponse): google.cloud.batch.v1.ListTasksResponse; - - /** - * Encodes the specified ListTasksResponse message. Does not implicitly {@link google.cloud.batch.v1.ListTasksResponse.verify|verify} messages. - * @param message ListTasksResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IListTasksResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListTasksResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ListTasksResponse.verify|verify} messages. - * @param message ListTasksResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IListTasksResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListTasksResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListTasksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.ListTasksResponse; - - /** - * Decodes a ListTasksResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListTasksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.ListTasksResponse; - - /** - * Verifies a ListTasksResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListTasksResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListTasksResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.ListTasksResponse; - - /** - * Creates a plain object from a ListTasksResponse message. Also converts values to other types if specified. - * @param message ListTasksResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.ListTasksResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListTasksResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListTasksResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetTaskRequest. */ - interface IGetTaskRequest { - - /** GetTaskRequest name */ - name?: (string|null); - } - - /** Represents a GetTaskRequest. */ - class GetTaskRequest implements IGetTaskRequest { - - /** - * Constructs a new GetTaskRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IGetTaskRequest); - - /** GetTaskRequest name. */ - public name: string; - - /** - * Creates a new GetTaskRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetTaskRequest instance - */ - public static create(properties?: google.cloud.batch.v1.IGetTaskRequest): google.cloud.batch.v1.GetTaskRequest; - - /** - * Encodes the specified GetTaskRequest message. Does not implicitly {@link google.cloud.batch.v1.GetTaskRequest.verify|verify} messages. - * @param message GetTaskRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IGetTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetTaskRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.GetTaskRequest.verify|verify} messages. - * @param message GetTaskRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IGetTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetTaskRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.GetTaskRequest; - - /** - * Decodes a GetTaskRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.GetTaskRequest; - - /** - * Verifies a GetTaskRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetTaskRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetTaskRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.GetTaskRequest; - - /** - * Creates a plain object from a GetTaskRequest message. Also converts values to other types if specified. - * @param message GetTaskRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.GetTaskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetTaskRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetTaskRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OperationMetadata. */ - interface IOperationMetadata { - - /** OperationMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata target */ - target?: (string|null); - - /** OperationMetadata verb */ - verb?: (string|null); - - /** OperationMetadata statusMessage */ - statusMessage?: (string|null); - - /** OperationMetadata requestedCancellation */ - requestedCancellation?: (boolean|null); - - /** OperationMetadata apiVersion */ - apiVersion?: (string|null); - } - - /** Represents an OperationMetadata. */ - class OperationMetadata implements IOperationMetadata { - - /** - * Constructs a new OperationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IOperationMetadata); - - /** OperationMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata target. */ - public target: string; - - /** OperationMetadata verb. */ - public verb: string; - - /** OperationMetadata statusMessage. */ - public statusMessage: string; - - /** OperationMetadata requestedCancellation. */ - public requestedCancellation: boolean; - - /** OperationMetadata apiVersion. */ - public apiVersion: string; - - /** - * Creates a new OperationMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns OperationMetadata instance - */ - public static create(properties?: google.cloud.batch.v1.IOperationMetadata): google.cloud.batch.v1.OperationMetadata; - - /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.batch.v1.OperationMetadata.verify|verify} messages. - * @param message OperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.batch.v1.OperationMetadata.verify|verify} messages. - * @param message OperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.OperationMetadata; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.OperationMetadata; - - /** - * Verifies an OperationMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OperationMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.OperationMetadata; - - /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. - * @param message OperationMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OperationMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OperationMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Job. */ - interface IJob { - - /** Job name */ - name?: (string|null); - - /** Job uid */ - uid?: (string|null); - - /** Job priority */ - priority?: (number|Long|string|null); - - /** Job taskGroups */ - taskGroups?: (google.cloud.batch.v1.ITaskGroup[]|null); - - /** Job allocationPolicy */ - allocationPolicy?: (google.cloud.batch.v1.IAllocationPolicy|null); - - /** Job labels */ - labels?: ({ [k: string]: string }|null); - - /** Job status */ - status?: (google.cloud.batch.v1.IJobStatus|null); - - /** Job createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Job updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Job logsPolicy */ - logsPolicy?: (google.cloud.batch.v1.ILogsPolicy|null); - - /** Job notifications */ - notifications?: (google.cloud.batch.v1.IJobNotification[]|null); - } - - /** Represents a Job. */ - class Job implements IJob { - - /** - * Constructs a new Job. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IJob); - - /** Job name. */ - public name: string; - - /** Job uid. */ - public uid: string; - - /** Job priority. */ - public priority: (number|Long|string); - - /** Job taskGroups. */ - public taskGroups: google.cloud.batch.v1.ITaskGroup[]; - - /** Job allocationPolicy. */ - public allocationPolicy?: (google.cloud.batch.v1.IAllocationPolicy|null); - - /** Job labels. */ - public labels: { [k: string]: string }; - - /** Job status. */ - public status?: (google.cloud.batch.v1.IJobStatus|null); - - /** Job createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Job updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Job logsPolicy. */ - public logsPolicy?: (google.cloud.batch.v1.ILogsPolicy|null); - - /** Job notifications. */ - public notifications: google.cloud.batch.v1.IJobNotification[]; - - /** - * Creates a new Job instance using the specified properties. - * @param [properties] Properties to set - * @returns Job instance - */ - public static create(properties?: google.cloud.batch.v1.IJob): google.cloud.batch.v1.Job; - - /** - * Encodes the specified Job message. Does not implicitly {@link google.cloud.batch.v1.Job.verify|verify} messages. - * @param message Job message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IJob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Job.verify|verify} messages. - * @param message Job message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IJob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Job message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Job - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.Job; - - /** - * Decodes a Job message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Job - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.Job; - - /** - * Verifies a Job message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Job message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Job - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.Job; - - /** - * Creates a plain object from a Job message. Also converts values to other types if specified. - * @param message Job - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.Job, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Job to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Job - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a LogsPolicy. */ - interface ILogsPolicy { - - /** LogsPolicy destination */ - destination?: (google.cloud.batch.v1.LogsPolicy.Destination|keyof typeof google.cloud.batch.v1.LogsPolicy.Destination|null); - - /** LogsPolicy logsPath */ - logsPath?: (string|null); - - /** LogsPolicy cloudLoggingOption */ - cloudLoggingOption?: (google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption|null); - } - - /** Represents a LogsPolicy. */ - class LogsPolicy implements ILogsPolicy { - - /** - * Constructs a new LogsPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.ILogsPolicy); - - /** LogsPolicy destination. */ - public destination: (google.cloud.batch.v1.LogsPolicy.Destination|keyof typeof google.cloud.batch.v1.LogsPolicy.Destination); - - /** LogsPolicy logsPath. */ - public logsPath: string; - - /** LogsPolicy cloudLoggingOption. */ - public cloudLoggingOption?: (google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption|null); - - /** - * Creates a new LogsPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns LogsPolicy instance - */ - public static create(properties?: google.cloud.batch.v1.ILogsPolicy): google.cloud.batch.v1.LogsPolicy; - - /** - * Encodes the specified LogsPolicy message. Does not implicitly {@link google.cloud.batch.v1.LogsPolicy.verify|verify} messages. - * @param message LogsPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.ILogsPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LogsPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.LogsPolicy.verify|verify} messages. - * @param message LogsPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.ILogsPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LogsPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LogsPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.LogsPolicy; - - /** - * Decodes a LogsPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LogsPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.LogsPolicy; - - /** - * Verifies a LogsPolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LogsPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LogsPolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.LogsPolicy; - - /** - * Creates a plain object from a LogsPolicy message. Also converts values to other types if specified. - * @param message LogsPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.LogsPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LogsPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LogsPolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace LogsPolicy { - - /** Properties of a CloudLoggingOption. */ - interface ICloudLoggingOption { - - /** CloudLoggingOption useGenericTaskMonitoredResource */ - useGenericTaskMonitoredResource?: (boolean|null); - } - - /** Represents a CloudLoggingOption. */ - class CloudLoggingOption implements ICloudLoggingOption { - - /** - * Constructs a new CloudLoggingOption. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption); - - /** CloudLoggingOption useGenericTaskMonitoredResource. */ - public useGenericTaskMonitoredResource: boolean; - - /** - * Creates a new CloudLoggingOption instance using the specified properties. - * @param [properties] Properties to set - * @returns CloudLoggingOption instance - */ - public static create(properties?: google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption): google.cloud.batch.v1.LogsPolicy.CloudLoggingOption; - - /** - * Encodes the specified CloudLoggingOption message. Does not implicitly {@link google.cloud.batch.v1.LogsPolicy.CloudLoggingOption.verify|verify} messages. - * @param message CloudLoggingOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CloudLoggingOption message, length delimited. Does not implicitly {@link google.cloud.batch.v1.LogsPolicy.CloudLoggingOption.verify|verify} messages. - * @param message CloudLoggingOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CloudLoggingOption message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CloudLoggingOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.LogsPolicy.CloudLoggingOption; - - /** - * Decodes a CloudLoggingOption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CloudLoggingOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.LogsPolicy.CloudLoggingOption; - - /** - * Verifies a CloudLoggingOption message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CloudLoggingOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CloudLoggingOption - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.LogsPolicy.CloudLoggingOption; - - /** - * Creates a plain object from a CloudLoggingOption message. Also converts values to other types if specified. - * @param message CloudLoggingOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.LogsPolicy.CloudLoggingOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CloudLoggingOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CloudLoggingOption - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Destination enum. */ - enum Destination { - DESTINATION_UNSPECIFIED = 0, - CLOUD_LOGGING = 1, - PATH = 2 - } - } - - /** Properties of a JobStatus. */ - interface IJobStatus { - - /** JobStatus state */ - state?: (google.cloud.batch.v1.JobStatus.State|keyof typeof google.cloud.batch.v1.JobStatus.State|null); - - /** JobStatus statusEvents */ - statusEvents?: (google.cloud.batch.v1.IStatusEvent[]|null); - - /** JobStatus taskGroups */ - taskGroups?: ({ [k: string]: google.cloud.batch.v1.JobStatus.ITaskGroupStatus }|null); - - /** JobStatus runDuration */ - runDuration?: (google.protobuf.IDuration|null); - } - - /** Represents a JobStatus. */ - class JobStatus implements IJobStatus { - - /** - * Constructs a new JobStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IJobStatus); - - /** JobStatus state. */ - public state: (google.cloud.batch.v1.JobStatus.State|keyof typeof google.cloud.batch.v1.JobStatus.State); - - /** JobStatus statusEvents. */ - public statusEvents: google.cloud.batch.v1.IStatusEvent[]; - - /** JobStatus taskGroups. */ - public taskGroups: { [k: string]: google.cloud.batch.v1.JobStatus.ITaskGroupStatus }; - - /** JobStatus runDuration. */ - public runDuration?: (google.protobuf.IDuration|null); - - /** - * Creates a new JobStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns JobStatus instance - */ - public static create(properties?: google.cloud.batch.v1.IJobStatus): google.cloud.batch.v1.JobStatus; - - /** - * Encodes the specified JobStatus message. Does not implicitly {@link google.cloud.batch.v1.JobStatus.verify|verify} messages. - * @param message JobStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IJobStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified JobStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobStatus.verify|verify} messages. - * @param message JobStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IJobStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a JobStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns JobStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.JobStatus; - - /** - * Decodes a JobStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns JobStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.JobStatus; - - /** - * Verifies a JobStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a JobStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns JobStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.JobStatus; - - /** - * Creates a plain object from a JobStatus message. Also converts values to other types if specified. - * @param message JobStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.JobStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this JobStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for JobStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace JobStatus { - - /** Properties of an InstanceStatus. */ - interface IInstanceStatus { - - /** InstanceStatus machineType */ - machineType?: (string|null); - - /** InstanceStatus provisioningModel */ - provisioningModel?: (google.cloud.batch.v1.AllocationPolicy.ProvisioningModel|keyof typeof google.cloud.batch.v1.AllocationPolicy.ProvisioningModel|null); - - /** InstanceStatus taskPack */ - taskPack?: (number|Long|string|null); - - /** InstanceStatus bootDisk */ - bootDisk?: (google.cloud.batch.v1.AllocationPolicy.IDisk|null); - } - - /** Represents an InstanceStatus. */ - class InstanceStatus implements IInstanceStatus { - - /** - * Constructs a new InstanceStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.JobStatus.IInstanceStatus); - - /** InstanceStatus machineType. */ - public machineType: string; - - /** InstanceStatus provisioningModel. */ - public provisioningModel: (google.cloud.batch.v1.AllocationPolicy.ProvisioningModel|keyof typeof google.cloud.batch.v1.AllocationPolicy.ProvisioningModel); - - /** InstanceStatus taskPack. */ - public taskPack: (number|Long|string); - - /** InstanceStatus bootDisk. */ - public bootDisk?: (google.cloud.batch.v1.AllocationPolicy.IDisk|null); - - /** - * Creates a new InstanceStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns InstanceStatus instance - */ - public static create(properties?: google.cloud.batch.v1.JobStatus.IInstanceStatus): google.cloud.batch.v1.JobStatus.InstanceStatus; - - /** - * Encodes the specified InstanceStatus message. Does not implicitly {@link google.cloud.batch.v1.JobStatus.InstanceStatus.verify|verify} messages. - * @param message InstanceStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.JobStatus.IInstanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InstanceStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobStatus.InstanceStatus.verify|verify} messages. - * @param message InstanceStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.JobStatus.IInstanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InstanceStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InstanceStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.JobStatus.InstanceStatus; - - /** - * Decodes an InstanceStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InstanceStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.JobStatus.InstanceStatus; - - /** - * Verifies an InstanceStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InstanceStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InstanceStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.JobStatus.InstanceStatus; - - /** - * Creates a plain object from an InstanceStatus message. Also converts values to other types if specified. - * @param message InstanceStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.JobStatus.InstanceStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InstanceStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InstanceStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TaskGroupStatus. */ - interface ITaskGroupStatus { - - /** TaskGroupStatus counts */ - counts?: ({ [k: string]: (number|Long|string) }|null); - - /** TaskGroupStatus instances */ - instances?: (google.cloud.batch.v1.JobStatus.IInstanceStatus[]|null); - } - - /** Represents a TaskGroupStatus. */ - class TaskGroupStatus implements ITaskGroupStatus { - - /** - * Constructs a new TaskGroupStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.JobStatus.ITaskGroupStatus); - - /** TaskGroupStatus counts. */ - public counts: { [k: string]: (number|Long|string) }; - - /** TaskGroupStatus instances. */ - public instances: google.cloud.batch.v1.JobStatus.IInstanceStatus[]; - - /** - * Creates a new TaskGroupStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns TaskGroupStatus instance - */ - public static create(properties?: google.cloud.batch.v1.JobStatus.ITaskGroupStatus): google.cloud.batch.v1.JobStatus.TaskGroupStatus; - - /** - * Encodes the specified TaskGroupStatus message. Does not implicitly {@link google.cloud.batch.v1.JobStatus.TaskGroupStatus.verify|verify} messages. - * @param message TaskGroupStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.JobStatus.ITaskGroupStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TaskGroupStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobStatus.TaskGroupStatus.verify|verify} messages. - * @param message TaskGroupStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.JobStatus.ITaskGroupStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TaskGroupStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TaskGroupStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.JobStatus.TaskGroupStatus; - - /** - * Decodes a TaskGroupStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TaskGroupStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.JobStatus.TaskGroupStatus; - - /** - * Verifies a TaskGroupStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TaskGroupStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TaskGroupStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.JobStatus.TaskGroupStatus; - - /** - * Creates a plain object from a TaskGroupStatus message. Also converts values to other types if specified. - * @param message TaskGroupStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.JobStatus.TaskGroupStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TaskGroupStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TaskGroupStatus - * @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, - QUEUED = 1, - SCHEDULED = 2, - RUNNING = 3, - SUCCEEDED = 4, - FAILED = 5, - DELETION_IN_PROGRESS = 6 - } - } - - /** Properties of a JobNotification. */ - interface IJobNotification { - - /** JobNotification pubsubTopic */ - pubsubTopic?: (string|null); - - /** JobNotification message */ - message?: (google.cloud.batch.v1.JobNotification.IMessage|null); - } - - /** Represents a JobNotification. */ - class JobNotification implements IJobNotification { - - /** - * Constructs a new JobNotification. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IJobNotification); - - /** JobNotification pubsubTopic. */ - public pubsubTopic: string; - - /** JobNotification message. */ - public message?: (google.cloud.batch.v1.JobNotification.IMessage|null); - - /** - * Creates a new JobNotification instance using the specified properties. - * @param [properties] Properties to set - * @returns JobNotification instance - */ - public static create(properties?: google.cloud.batch.v1.IJobNotification): google.cloud.batch.v1.JobNotification; - - /** - * Encodes the specified JobNotification message. Does not implicitly {@link google.cloud.batch.v1.JobNotification.verify|verify} messages. - * @param message JobNotification message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IJobNotification, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified JobNotification message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobNotification.verify|verify} messages. - * @param message JobNotification message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IJobNotification, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a JobNotification message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns JobNotification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.JobNotification; - - /** - * Decodes a JobNotification message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns JobNotification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.JobNotification; - - /** - * Verifies a JobNotification message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a JobNotification message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns JobNotification - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.JobNotification; - - /** - * Creates a plain object from a JobNotification message. Also converts values to other types if specified. - * @param message JobNotification - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.JobNotification, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this JobNotification to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for JobNotification - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace JobNotification { - - /** Properties of a Message. */ - interface IMessage { - - /** Message type */ - type?: (google.cloud.batch.v1.JobNotification.Type|keyof typeof google.cloud.batch.v1.JobNotification.Type|null); - - /** Message newJobState */ - newJobState?: (google.cloud.batch.v1.JobStatus.State|keyof typeof google.cloud.batch.v1.JobStatus.State|null); - - /** Message newTaskState */ - newTaskState?: (google.cloud.batch.v1.TaskStatus.State|keyof typeof google.cloud.batch.v1.TaskStatus.State|null); - } - - /** Represents a Message. */ - class Message implements IMessage { - - /** - * Constructs a new Message. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.JobNotification.IMessage); - - /** Message type. */ - public type: (google.cloud.batch.v1.JobNotification.Type|keyof typeof google.cloud.batch.v1.JobNotification.Type); - - /** Message newJobState. */ - public newJobState: (google.cloud.batch.v1.JobStatus.State|keyof typeof google.cloud.batch.v1.JobStatus.State); - - /** Message newTaskState. */ - public newTaskState: (google.cloud.batch.v1.TaskStatus.State|keyof typeof google.cloud.batch.v1.TaskStatus.State); - - /** - * Creates a new Message instance using the specified properties. - * @param [properties] Properties to set - * @returns Message instance - */ - public static create(properties?: google.cloud.batch.v1.JobNotification.IMessage): google.cloud.batch.v1.JobNotification.Message; - - /** - * Encodes the specified Message message. Does not implicitly {@link google.cloud.batch.v1.JobNotification.Message.verify|verify} messages. - * @param message Message message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.JobNotification.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobNotification.Message.verify|verify} messages. - * @param message Message message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.JobNotification.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Message message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.JobNotification.Message; - - /** - * Decodes a Message message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.JobNotification.Message; - - /** - * Verifies a Message message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Message message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Message - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.JobNotification.Message; - - /** - * Creates a plain object from a Message message. Also converts values to other types if specified. - * @param message Message - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.JobNotification.Message, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Message to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Message - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - JOB_STATE_CHANGED = 1, - TASK_STATE_CHANGED = 2 - } - } - - /** Properties of an AllocationPolicy. */ - interface IAllocationPolicy { - - /** AllocationPolicy location */ - location?: (google.cloud.batch.v1.AllocationPolicy.ILocationPolicy|null); - - /** AllocationPolicy instances */ - instances?: (google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate[]|null); - - /** AllocationPolicy serviceAccount */ - serviceAccount?: (google.cloud.batch.v1.IServiceAccount|null); - - /** AllocationPolicy labels */ - labels?: ({ [k: string]: string }|null); - - /** AllocationPolicy network */ - network?: (google.cloud.batch.v1.AllocationPolicy.INetworkPolicy|null); - - /** AllocationPolicy placement */ - placement?: (google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy|null); - - /** AllocationPolicy tags */ - tags?: (string[]|null); - } - - /** Represents an AllocationPolicy. */ - class AllocationPolicy implements IAllocationPolicy { - - /** - * Constructs a new AllocationPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IAllocationPolicy); - - /** AllocationPolicy location. */ - public location?: (google.cloud.batch.v1.AllocationPolicy.ILocationPolicy|null); - - /** AllocationPolicy instances. */ - public instances: google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate[]; - - /** AllocationPolicy serviceAccount. */ - public serviceAccount?: (google.cloud.batch.v1.IServiceAccount|null); - - /** AllocationPolicy labels. */ - public labels: { [k: string]: string }; - - /** AllocationPolicy network. */ - public network?: (google.cloud.batch.v1.AllocationPolicy.INetworkPolicy|null); - - /** AllocationPolicy placement. */ - public placement?: (google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy|null); - - /** AllocationPolicy tags. */ - public tags: string[]; - - /** - * Creates a new AllocationPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns AllocationPolicy instance - */ - public static create(properties?: google.cloud.batch.v1.IAllocationPolicy): google.cloud.batch.v1.AllocationPolicy; - - /** - * Encodes the specified AllocationPolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.verify|verify} messages. - * @param message AllocationPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IAllocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AllocationPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.verify|verify} messages. - * @param message AllocationPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IAllocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AllocationPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AllocationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy; - - /** - * Decodes an AllocationPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AllocationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy; - - /** - * Verifies an AllocationPolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AllocationPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AllocationPolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy; - - /** - * Creates a plain object from an AllocationPolicy message. Also converts values to other types if specified. - * @param message AllocationPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.AllocationPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AllocationPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AllocationPolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AllocationPolicy { - - /** Properties of a LocationPolicy. */ - interface ILocationPolicy { - - /** LocationPolicy allowedLocations */ - allowedLocations?: (string[]|null); - } - - /** Represents a LocationPolicy. */ - class LocationPolicy implements ILocationPolicy { - - /** - * Constructs a new LocationPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.AllocationPolicy.ILocationPolicy); - - /** LocationPolicy allowedLocations. */ - public allowedLocations: string[]; - - /** - * Creates a new LocationPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns LocationPolicy instance - */ - public static create(properties?: google.cloud.batch.v1.AllocationPolicy.ILocationPolicy): google.cloud.batch.v1.AllocationPolicy.LocationPolicy; - - /** - * Encodes the specified LocationPolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.LocationPolicy.verify|verify} messages. - * @param message LocationPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.AllocationPolicy.ILocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LocationPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.LocationPolicy.verify|verify} messages. - * @param message LocationPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.AllocationPolicy.ILocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LocationPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LocationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy.LocationPolicy; - - /** - * Decodes a LocationPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LocationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy.LocationPolicy; - - /** - * Verifies a LocationPolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LocationPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LocationPolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy.LocationPolicy; - - /** - * Creates a plain object from a LocationPolicy message. Also converts values to other types if specified. - * @param message LocationPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.AllocationPolicy.LocationPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LocationPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LocationPolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Disk. */ - interface IDisk { - - /** Disk image */ - image?: (string|null); - - /** Disk snapshot */ - snapshot?: (string|null); - - /** Disk type */ - type?: (string|null); - - /** Disk sizeGb */ - sizeGb?: (number|Long|string|null); - - /** Disk diskInterface */ - diskInterface?: (string|null); - } - - /** Represents a Disk. */ - class Disk implements IDisk { - - /** - * Constructs a new Disk. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.AllocationPolicy.IDisk); - - /** Disk image. */ - public image?: (string|null); - - /** Disk snapshot. */ - public snapshot?: (string|null); - - /** Disk type. */ - public type: string; - - /** Disk sizeGb. */ - public sizeGb: (number|Long|string); - - /** Disk diskInterface. */ - public diskInterface: string; - - /** Disk dataSource. */ - public dataSource?: ("image"|"snapshot"); - - /** - * Creates a new Disk instance using the specified properties. - * @param [properties] Properties to set - * @returns Disk instance - */ - public static create(properties?: google.cloud.batch.v1.AllocationPolicy.IDisk): google.cloud.batch.v1.AllocationPolicy.Disk; - - /** - * Encodes the specified Disk message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.Disk.verify|verify} messages. - * @param message Disk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.AllocationPolicy.IDisk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Disk message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.Disk.verify|verify} messages. - * @param message Disk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.AllocationPolicy.IDisk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Disk message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Disk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy.Disk; - - /** - * Decodes a Disk message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Disk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy.Disk; - - /** - * Verifies a Disk message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Disk message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Disk - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy.Disk; - - /** - * Creates a plain object from a Disk message. Also converts values to other types if specified. - * @param message Disk - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.AllocationPolicy.Disk, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Disk to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Disk - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AttachedDisk. */ - interface IAttachedDisk { - - /** AttachedDisk newDisk */ - newDisk?: (google.cloud.batch.v1.AllocationPolicy.IDisk|null); - - /** AttachedDisk existingDisk */ - existingDisk?: (string|null); - - /** AttachedDisk deviceName */ - deviceName?: (string|null); - } - - /** Represents an AttachedDisk. */ - class AttachedDisk implements IAttachedDisk { - - /** - * Constructs a new AttachedDisk. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.AllocationPolicy.IAttachedDisk); - - /** AttachedDisk newDisk. */ - public newDisk?: (google.cloud.batch.v1.AllocationPolicy.IDisk|null); - - /** AttachedDisk existingDisk. */ - public existingDisk?: (string|null); - - /** AttachedDisk deviceName. */ - public deviceName: string; - - /** AttachedDisk attached. */ - public attached?: ("newDisk"|"existingDisk"); - - /** - * Creates a new AttachedDisk instance using the specified properties. - * @param [properties] Properties to set - * @returns AttachedDisk instance - */ - public static create(properties?: google.cloud.batch.v1.AllocationPolicy.IAttachedDisk): google.cloud.batch.v1.AllocationPolicy.AttachedDisk; - - /** - * Encodes the specified AttachedDisk message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.AttachedDisk.verify|verify} messages. - * @param message AttachedDisk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.AllocationPolicy.IAttachedDisk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AttachedDisk message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.AttachedDisk.verify|verify} messages. - * @param message AttachedDisk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.AllocationPolicy.IAttachedDisk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AttachedDisk message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AttachedDisk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy.AttachedDisk; - - /** - * Decodes an AttachedDisk message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AttachedDisk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy.AttachedDisk; - - /** - * Verifies an AttachedDisk message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AttachedDisk message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AttachedDisk - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy.AttachedDisk; - - /** - * Creates a plain object from an AttachedDisk message. Also converts values to other types if specified. - * @param message AttachedDisk - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.AllocationPolicy.AttachedDisk, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AttachedDisk to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AttachedDisk - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Accelerator. */ - interface IAccelerator { - - /** Accelerator type */ - type?: (string|null); - - /** Accelerator count */ - count?: (number|Long|string|null); - - /** Accelerator installGpuDrivers */ - installGpuDrivers?: (boolean|null); - - /** Accelerator driverVersion */ - driverVersion?: (string|null); - } - - /** Represents an Accelerator. */ - class Accelerator implements IAccelerator { - - /** - * Constructs a new Accelerator. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.AllocationPolicy.IAccelerator); - - /** Accelerator type. */ - public type: string; - - /** Accelerator count. */ - public count: (number|Long|string); - - /** Accelerator installGpuDrivers. */ - public installGpuDrivers: boolean; - - /** Accelerator driverVersion. */ - public driverVersion: string; - - /** - * Creates a new Accelerator instance using the specified properties. - * @param [properties] Properties to set - * @returns Accelerator instance - */ - public static create(properties?: google.cloud.batch.v1.AllocationPolicy.IAccelerator): google.cloud.batch.v1.AllocationPolicy.Accelerator; - - /** - * Encodes the specified Accelerator message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.Accelerator.verify|verify} messages. - * @param message Accelerator message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.AllocationPolicy.IAccelerator, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Accelerator message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.Accelerator.verify|verify} messages. - * @param message Accelerator message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.AllocationPolicy.IAccelerator, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Accelerator message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Accelerator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy.Accelerator; - - /** - * Decodes an Accelerator message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Accelerator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy.Accelerator; - - /** - * Verifies an Accelerator message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Accelerator message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Accelerator - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy.Accelerator; - - /** - * Creates a plain object from an Accelerator message. Also converts values to other types if specified. - * @param message Accelerator - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.AllocationPolicy.Accelerator, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Accelerator to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Accelerator - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InstancePolicy. */ - interface IInstancePolicy { - - /** InstancePolicy machineType */ - machineType?: (string|null); - - /** InstancePolicy minCpuPlatform */ - minCpuPlatform?: (string|null); - - /** InstancePolicy provisioningModel */ - provisioningModel?: (google.cloud.batch.v1.AllocationPolicy.ProvisioningModel|keyof typeof google.cloud.batch.v1.AllocationPolicy.ProvisioningModel|null); - - /** InstancePolicy accelerators */ - accelerators?: (google.cloud.batch.v1.AllocationPolicy.IAccelerator[]|null); - - /** InstancePolicy bootDisk */ - bootDisk?: (google.cloud.batch.v1.AllocationPolicy.IDisk|null); - - /** InstancePolicy disks */ - disks?: (google.cloud.batch.v1.AllocationPolicy.IAttachedDisk[]|null); - - /** InstancePolicy reservation */ - reservation?: (string|null); - } - - /** Represents an InstancePolicy. */ - class InstancePolicy implements IInstancePolicy { - - /** - * Constructs a new InstancePolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.AllocationPolicy.IInstancePolicy); - - /** InstancePolicy machineType. */ - public machineType: string; - - /** InstancePolicy minCpuPlatform. */ - public minCpuPlatform: string; - - /** InstancePolicy provisioningModel. */ - public provisioningModel: (google.cloud.batch.v1.AllocationPolicy.ProvisioningModel|keyof typeof google.cloud.batch.v1.AllocationPolicy.ProvisioningModel); - - /** InstancePolicy accelerators. */ - public accelerators: google.cloud.batch.v1.AllocationPolicy.IAccelerator[]; - - /** InstancePolicy bootDisk. */ - public bootDisk?: (google.cloud.batch.v1.AllocationPolicy.IDisk|null); - - /** InstancePolicy disks. */ - public disks: google.cloud.batch.v1.AllocationPolicy.IAttachedDisk[]; - - /** InstancePolicy reservation. */ - public reservation: string; - - /** - * Creates a new InstancePolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns InstancePolicy instance - */ - public static create(properties?: google.cloud.batch.v1.AllocationPolicy.IInstancePolicy): google.cloud.batch.v1.AllocationPolicy.InstancePolicy; - - /** - * Encodes the specified InstancePolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.InstancePolicy.verify|verify} messages. - * @param message InstancePolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.AllocationPolicy.IInstancePolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InstancePolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.InstancePolicy.verify|verify} messages. - * @param message InstancePolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.AllocationPolicy.IInstancePolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InstancePolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InstancePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy.InstancePolicy; - - /** - * Decodes an InstancePolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InstancePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy.InstancePolicy; - - /** - * Verifies an InstancePolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InstancePolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InstancePolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy.InstancePolicy; - - /** - * Creates a plain object from an InstancePolicy message. Also converts values to other types if specified. - * @param message InstancePolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.AllocationPolicy.InstancePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InstancePolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InstancePolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InstancePolicyOrTemplate. */ - interface IInstancePolicyOrTemplate { - - /** InstancePolicyOrTemplate policy */ - policy?: (google.cloud.batch.v1.AllocationPolicy.IInstancePolicy|null); - - /** InstancePolicyOrTemplate instanceTemplate */ - instanceTemplate?: (string|null); - - /** InstancePolicyOrTemplate installGpuDrivers */ - installGpuDrivers?: (boolean|null); - - /** InstancePolicyOrTemplate installOpsAgent */ - installOpsAgent?: (boolean|null); - - /** InstancePolicyOrTemplate blockProjectSshKeys */ - blockProjectSshKeys?: (boolean|null); - } - - /** Represents an InstancePolicyOrTemplate. */ - class InstancePolicyOrTemplate implements IInstancePolicyOrTemplate { - - /** - * Constructs a new InstancePolicyOrTemplate. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate); - - /** InstancePolicyOrTemplate policy. */ - public policy?: (google.cloud.batch.v1.AllocationPolicy.IInstancePolicy|null); - - /** InstancePolicyOrTemplate instanceTemplate. */ - public instanceTemplate?: (string|null); - - /** InstancePolicyOrTemplate installGpuDrivers. */ - public installGpuDrivers: boolean; - - /** InstancePolicyOrTemplate installOpsAgent. */ - public installOpsAgent: boolean; - - /** InstancePolicyOrTemplate blockProjectSshKeys. */ - public blockProjectSshKeys: boolean; - - /** InstancePolicyOrTemplate policyTemplate. */ - public policyTemplate?: ("policy"|"instanceTemplate"); - - /** - * Creates a new InstancePolicyOrTemplate instance using the specified properties. - * @param [properties] Properties to set - * @returns InstancePolicyOrTemplate instance - */ - public static create(properties?: google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate): google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate; - - /** - * Encodes the specified InstancePolicyOrTemplate message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.verify|verify} messages. - * @param message InstancePolicyOrTemplate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InstancePolicyOrTemplate message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.verify|verify} messages. - * @param message InstancePolicyOrTemplate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InstancePolicyOrTemplate message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InstancePolicyOrTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate; - - /** - * Decodes an InstancePolicyOrTemplate message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InstancePolicyOrTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate; - - /** - * Verifies an InstancePolicyOrTemplate message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InstancePolicyOrTemplate message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InstancePolicyOrTemplate - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate; - - /** - * Creates a plain object from an InstancePolicyOrTemplate message. Also converts values to other types if specified. - * @param message InstancePolicyOrTemplate - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InstancePolicyOrTemplate to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InstancePolicyOrTemplate - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a NetworkInterface. */ - interface INetworkInterface { - - /** NetworkInterface network */ - network?: (string|null); - - /** NetworkInterface subnetwork */ - subnetwork?: (string|null); - - /** NetworkInterface noExternalIpAddress */ - noExternalIpAddress?: (boolean|null); - } - - /** Represents a NetworkInterface. */ - class NetworkInterface implements INetworkInterface { - - /** - * Constructs a new NetworkInterface. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.AllocationPolicy.INetworkInterface); - - /** NetworkInterface network. */ - public network: string; - - /** NetworkInterface subnetwork. */ - public subnetwork: string; - - /** NetworkInterface noExternalIpAddress. */ - public noExternalIpAddress: boolean; - - /** - * Creates a new NetworkInterface instance using the specified properties. - * @param [properties] Properties to set - * @returns NetworkInterface instance - */ - public static create(properties?: google.cloud.batch.v1.AllocationPolicy.INetworkInterface): google.cloud.batch.v1.AllocationPolicy.NetworkInterface; - - /** - * Encodes the specified NetworkInterface message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.NetworkInterface.verify|verify} messages. - * @param message NetworkInterface message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.AllocationPolicy.INetworkInterface, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NetworkInterface message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.NetworkInterface.verify|verify} messages. - * @param message NetworkInterface message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.AllocationPolicy.INetworkInterface, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NetworkInterface message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NetworkInterface - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy.NetworkInterface; - - /** - * Decodes a NetworkInterface message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NetworkInterface - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy.NetworkInterface; - - /** - * Verifies a NetworkInterface message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NetworkInterface message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NetworkInterface - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy.NetworkInterface; - - /** - * Creates a plain object from a NetworkInterface message. Also converts values to other types if specified. - * @param message NetworkInterface - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.AllocationPolicy.NetworkInterface, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NetworkInterface to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NetworkInterface - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a NetworkPolicy. */ - interface INetworkPolicy { - - /** NetworkPolicy networkInterfaces */ - networkInterfaces?: (google.cloud.batch.v1.AllocationPolicy.INetworkInterface[]|null); - } - - /** Represents a NetworkPolicy. */ - class NetworkPolicy implements INetworkPolicy { - - /** - * Constructs a new NetworkPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.AllocationPolicy.INetworkPolicy); - - /** NetworkPolicy networkInterfaces. */ - public networkInterfaces: google.cloud.batch.v1.AllocationPolicy.INetworkInterface[]; - - /** - * Creates a new NetworkPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns NetworkPolicy instance - */ - public static create(properties?: google.cloud.batch.v1.AllocationPolicy.INetworkPolicy): google.cloud.batch.v1.AllocationPolicy.NetworkPolicy; - - /** - * Encodes the specified NetworkPolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.verify|verify} messages. - * @param message NetworkPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.AllocationPolicy.INetworkPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NetworkPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.verify|verify} messages. - * @param message NetworkPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.AllocationPolicy.INetworkPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NetworkPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NetworkPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy.NetworkPolicy; - - /** - * Decodes a NetworkPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NetworkPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy.NetworkPolicy; - - /** - * Verifies a NetworkPolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NetworkPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NetworkPolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy.NetworkPolicy; - - /** - * Creates a plain object from a NetworkPolicy message. Also converts values to other types if specified. - * @param message NetworkPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.AllocationPolicy.NetworkPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NetworkPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NetworkPolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PlacementPolicy. */ - interface IPlacementPolicy { - - /** PlacementPolicy collocation */ - collocation?: (string|null); - - /** PlacementPolicy maxDistance */ - maxDistance?: (number|Long|string|null); - } - - /** Represents a PlacementPolicy. */ - class PlacementPolicy implements IPlacementPolicy { - - /** - * Constructs a new PlacementPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy); - - /** PlacementPolicy collocation. */ - public collocation: string; - - /** PlacementPolicy maxDistance. */ - public maxDistance: (number|Long|string); - - /** - * Creates a new PlacementPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns PlacementPolicy instance - */ - public static create(properties?: google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy): google.cloud.batch.v1.AllocationPolicy.PlacementPolicy; - - /** - * Encodes the specified PlacementPolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.verify|verify} messages. - * @param message PlacementPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PlacementPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.verify|verify} messages. - * @param message PlacementPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PlacementPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PlacementPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy.PlacementPolicy; - - /** - * Decodes a PlacementPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PlacementPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy.PlacementPolicy; - - /** - * Verifies a PlacementPolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PlacementPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PlacementPolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy.PlacementPolicy; - - /** - * Creates a plain object from a PlacementPolicy message. Also converts values to other types if specified. - * @param message PlacementPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.AllocationPolicy.PlacementPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PlacementPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PlacementPolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** ProvisioningModel enum. */ - enum ProvisioningModel { - PROVISIONING_MODEL_UNSPECIFIED = 0, - STANDARD = 1, - SPOT = 2, - PREEMPTIBLE = 3 - } - } - - /** Properties of a TaskGroup. */ - interface ITaskGroup { - - /** TaskGroup name */ - name?: (string|null); - - /** TaskGroup taskSpec */ - taskSpec?: (google.cloud.batch.v1.ITaskSpec|null); - - /** TaskGroup taskCount */ - taskCount?: (number|Long|string|null); - - /** TaskGroup parallelism */ - parallelism?: (number|Long|string|null); - - /** TaskGroup schedulingPolicy */ - schedulingPolicy?: (google.cloud.batch.v1.TaskGroup.SchedulingPolicy|keyof typeof google.cloud.batch.v1.TaskGroup.SchedulingPolicy|null); - - /** TaskGroup taskEnvironments */ - taskEnvironments?: (google.cloud.batch.v1.IEnvironment[]|null); - - /** TaskGroup taskCountPerNode */ - taskCountPerNode?: (number|Long|string|null); - - /** TaskGroup requireHostsFile */ - requireHostsFile?: (boolean|null); - - /** TaskGroup permissiveSsh */ - permissiveSsh?: (boolean|null); - - /** TaskGroup runAsNonRoot */ - runAsNonRoot?: (boolean|null); - } - - /** Represents a TaskGroup. */ - class TaskGroup implements ITaskGroup { - - /** - * Constructs a new TaskGroup. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.ITaskGroup); - - /** TaskGroup name. */ - public name: string; - - /** TaskGroup taskSpec. */ - public taskSpec?: (google.cloud.batch.v1.ITaskSpec|null); - - /** TaskGroup taskCount. */ - public taskCount: (number|Long|string); - - /** TaskGroup parallelism. */ - public parallelism: (number|Long|string); - - /** TaskGroup schedulingPolicy. */ - public schedulingPolicy: (google.cloud.batch.v1.TaskGroup.SchedulingPolicy|keyof typeof google.cloud.batch.v1.TaskGroup.SchedulingPolicy); - - /** TaskGroup taskEnvironments. */ - public taskEnvironments: google.cloud.batch.v1.IEnvironment[]; - - /** TaskGroup taskCountPerNode. */ - public taskCountPerNode: (number|Long|string); - - /** TaskGroup requireHostsFile. */ - public requireHostsFile: boolean; - - /** TaskGroup permissiveSsh. */ - public permissiveSsh: boolean; - - /** TaskGroup runAsNonRoot. */ - public runAsNonRoot: boolean; - - /** - * Creates a new TaskGroup instance using the specified properties. - * @param [properties] Properties to set - * @returns TaskGroup instance - */ - public static create(properties?: google.cloud.batch.v1.ITaskGroup): google.cloud.batch.v1.TaskGroup; - - /** - * Encodes the specified TaskGroup message. Does not implicitly {@link google.cloud.batch.v1.TaskGroup.verify|verify} messages. - * @param message TaskGroup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.ITaskGroup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TaskGroup message, length delimited. Does not implicitly {@link google.cloud.batch.v1.TaskGroup.verify|verify} messages. - * @param message TaskGroup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.ITaskGroup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TaskGroup message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TaskGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.TaskGroup; - - /** - * Decodes a TaskGroup message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TaskGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.TaskGroup; - - /** - * Verifies a TaskGroup message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TaskGroup message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TaskGroup - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.TaskGroup; - - /** - * Creates a plain object from a TaskGroup message. Also converts values to other types if specified. - * @param message TaskGroup - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.TaskGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TaskGroup to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TaskGroup - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace TaskGroup { - - /** SchedulingPolicy enum. */ - enum SchedulingPolicy { - SCHEDULING_POLICY_UNSPECIFIED = 0, - AS_SOON_AS_POSSIBLE = 1, - IN_ORDER = 2 - } - } - - /** Properties of a ServiceAccount. */ - interface IServiceAccount { - - /** ServiceAccount email */ - email?: (string|null); - - /** ServiceAccount scopes */ - scopes?: (string[]|null); - } - - /** Represents a ServiceAccount. */ - class ServiceAccount implements IServiceAccount { - - /** - * Constructs a new ServiceAccount. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IServiceAccount); - - /** ServiceAccount email. */ - public email: string; - - /** ServiceAccount scopes. */ - public scopes: string[]; - - /** - * Creates a new ServiceAccount instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceAccount instance - */ - public static create(properties?: google.cloud.batch.v1.IServiceAccount): google.cloud.batch.v1.ServiceAccount; - - /** - * Encodes the specified ServiceAccount message. Does not implicitly {@link google.cloud.batch.v1.ServiceAccount.verify|verify} messages. - * @param message ServiceAccount message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IServiceAccount, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceAccount message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ServiceAccount.verify|verify} messages. - * @param message ServiceAccount message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IServiceAccount, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceAccount message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.ServiceAccount; - - /** - * Decodes a ServiceAccount message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.ServiceAccount; - - /** - * Verifies a ServiceAccount message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceAccount message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceAccount - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.ServiceAccount; - - /** - * Creates a plain object from a ServiceAccount message. Also converts values to other types if specified. - * @param message ServiceAccount - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.ServiceAccount, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceAccount to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceAccount - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ComputeResource. */ - interface IComputeResource { - - /** ComputeResource cpuMilli */ - cpuMilli?: (number|Long|string|null); - - /** ComputeResource memoryMib */ - memoryMib?: (number|Long|string|null); - - /** ComputeResource bootDiskMib */ - bootDiskMib?: (number|Long|string|null); - } - - /** Represents a ComputeResource. */ - class ComputeResource implements IComputeResource { - - /** - * Constructs a new ComputeResource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IComputeResource); - - /** ComputeResource cpuMilli. */ - public cpuMilli: (number|Long|string); - - /** ComputeResource memoryMib. */ - public memoryMib: (number|Long|string); - - /** ComputeResource bootDiskMib. */ - public bootDiskMib: (number|Long|string); - - /** - * Creates a new ComputeResource instance using the specified properties. - * @param [properties] Properties to set - * @returns ComputeResource instance - */ - public static create(properties?: google.cloud.batch.v1.IComputeResource): google.cloud.batch.v1.ComputeResource; - - /** - * Encodes the specified ComputeResource message. Does not implicitly {@link google.cloud.batch.v1.ComputeResource.verify|verify} messages. - * @param message ComputeResource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IComputeResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ComputeResource message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ComputeResource.verify|verify} messages. - * @param message ComputeResource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IComputeResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ComputeResource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ComputeResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.ComputeResource; - - /** - * Decodes a ComputeResource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ComputeResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.ComputeResource; - - /** - * Verifies a ComputeResource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ComputeResource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ComputeResource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.ComputeResource; - - /** - * Creates a plain object from a ComputeResource message. Also converts values to other types if specified. - * @param message ComputeResource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.ComputeResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ComputeResource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ComputeResource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a StatusEvent. */ - interface IStatusEvent { - - /** StatusEvent type */ - type?: (string|null); - - /** StatusEvent description */ - description?: (string|null); - - /** StatusEvent eventTime */ - eventTime?: (google.protobuf.ITimestamp|null); - - /** StatusEvent taskExecution */ - taskExecution?: (google.cloud.batch.v1.ITaskExecution|null); - - /** StatusEvent taskState */ - taskState?: (google.cloud.batch.v1.TaskStatus.State|keyof typeof google.cloud.batch.v1.TaskStatus.State|null); - } - - /** Represents a StatusEvent. */ - class StatusEvent implements IStatusEvent { - - /** - * Constructs a new StatusEvent. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IStatusEvent); - - /** StatusEvent type. */ - public type: string; - - /** StatusEvent description. */ - public description: string; - - /** StatusEvent eventTime. */ - public eventTime?: (google.protobuf.ITimestamp|null); - - /** StatusEvent taskExecution. */ - public taskExecution?: (google.cloud.batch.v1.ITaskExecution|null); - - /** StatusEvent taskState. */ - public taskState: (google.cloud.batch.v1.TaskStatus.State|keyof typeof google.cloud.batch.v1.TaskStatus.State); - - /** - * Creates a new StatusEvent instance using the specified properties. - * @param [properties] Properties to set - * @returns StatusEvent instance - */ - public static create(properties?: google.cloud.batch.v1.IStatusEvent): google.cloud.batch.v1.StatusEvent; - - /** - * Encodes the specified StatusEvent message. Does not implicitly {@link google.cloud.batch.v1.StatusEvent.verify|verify} messages. - * @param message StatusEvent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IStatusEvent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StatusEvent message, length delimited. Does not implicitly {@link google.cloud.batch.v1.StatusEvent.verify|verify} messages. - * @param message StatusEvent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IStatusEvent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StatusEvent message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StatusEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.StatusEvent; - - /** - * Decodes a StatusEvent message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StatusEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.StatusEvent; - - /** - * Verifies a StatusEvent message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StatusEvent message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StatusEvent - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.StatusEvent; - - /** - * Creates a plain object from a StatusEvent message. Also converts values to other types if specified. - * @param message StatusEvent - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.StatusEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StatusEvent to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StatusEvent - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TaskExecution. */ - interface ITaskExecution { - - /** TaskExecution exitCode */ - exitCode?: (number|null); - } - - /** Represents a TaskExecution. */ - class TaskExecution implements ITaskExecution { - - /** - * Constructs a new TaskExecution. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.ITaskExecution); - - /** TaskExecution exitCode. */ - public exitCode: number; - - /** - * Creates a new TaskExecution instance using the specified properties. - * @param [properties] Properties to set - * @returns TaskExecution instance - */ - public static create(properties?: google.cloud.batch.v1.ITaskExecution): google.cloud.batch.v1.TaskExecution; - - /** - * Encodes the specified TaskExecution message. Does not implicitly {@link google.cloud.batch.v1.TaskExecution.verify|verify} messages. - * @param message TaskExecution message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.ITaskExecution, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TaskExecution message, length delimited. Does not implicitly {@link google.cloud.batch.v1.TaskExecution.verify|verify} messages. - * @param message TaskExecution message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.ITaskExecution, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TaskExecution message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TaskExecution - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.TaskExecution; - - /** - * Decodes a TaskExecution message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TaskExecution - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.TaskExecution; - - /** - * Verifies a TaskExecution message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TaskExecution message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TaskExecution - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.TaskExecution; - - /** - * Creates a plain object from a TaskExecution message. Also converts values to other types if specified. - * @param message TaskExecution - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.TaskExecution, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TaskExecution to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TaskExecution - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TaskStatus. */ - interface ITaskStatus { - - /** TaskStatus state */ - state?: (google.cloud.batch.v1.TaskStatus.State|keyof typeof google.cloud.batch.v1.TaskStatus.State|null); - - /** TaskStatus statusEvents */ - statusEvents?: (google.cloud.batch.v1.IStatusEvent[]|null); - } - - /** Represents a TaskStatus. */ - class TaskStatus implements ITaskStatus { - - /** - * Constructs a new TaskStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.ITaskStatus); - - /** TaskStatus state. */ - public state: (google.cloud.batch.v1.TaskStatus.State|keyof typeof google.cloud.batch.v1.TaskStatus.State); - - /** TaskStatus statusEvents. */ - public statusEvents: google.cloud.batch.v1.IStatusEvent[]; - - /** - * Creates a new TaskStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns TaskStatus instance - */ - public static create(properties?: google.cloud.batch.v1.ITaskStatus): google.cloud.batch.v1.TaskStatus; - - /** - * Encodes the specified TaskStatus message. Does not implicitly {@link google.cloud.batch.v1.TaskStatus.verify|verify} messages. - * @param message TaskStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.ITaskStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TaskStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1.TaskStatus.verify|verify} messages. - * @param message TaskStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.ITaskStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TaskStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TaskStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.TaskStatus; - - /** - * Decodes a TaskStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TaskStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.TaskStatus; - - /** - * Verifies a TaskStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TaskStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TaskStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.TaskStatus; - - /** - * Creates a plain object from a TaskStatus message. Also converts values to other types if specified. - * @param message TaskStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.TaskStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TaskStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TaskStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace TaskStatus { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - PENDING = 1, - ASSIGNED = 2, - RUNNING = 3, - FAILED = 4, - SUCCEEDED = 5, - UNEXECUTED = 6 - } - } - - /** Properties of a Runnable. */ - interface IRunnable { - - /** Runnable container */ - container?: (google.cloud.batch.v1.Runnable.IContainer|null); - - /** Runnable script */ - script?: (google.cloud.batch.v1.Runnable.IScript|null); - - /** Runnable barrier */ - barrier?: (google.cloud.batch.v1.Runnable.IBarrier|null); - - /** Runnable displayName */ - displayName?: (string|null); - - /** Runnable ignoreExitStatus */ - ignoreExitStatus?: (boolean|null); - - /** Runnable background */ - background?: (boolean|null); - - /** Runnable alwaysRun */ - alwaysRun?: (boolean|null); - - /** Runnable environment */ - environment?: (google.cloud.batch.v1.IEnvironment|null); - - /** Runnable timeout */ - timeout?: (google.protobuf.IDuration|null); - - /** Runnable labels */ - labels?: ({ [k: string]: string }|null); - } - - /** Represents a Runnable. */ - class Runnable implements IRunnable { - - /** - * Constructs a new Runnable. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IRunnable); - - /** Runnable container. */ - public container?: (google.cloud.batch.v1.Runnable.IContainer|null); - - /** Runnable script. */ - public script?: (google.cloud.batch.v1.Runnable.IScript|null); - - /** Runnable barrier. */ - public barrier?: (google.cloud.batch.v1.Runnable.IBarrier|null); - - /** Runnable displayName. */ - public displayName: string; - - /** Runnable ignoreExitStatus. */ - public ignoreExitStatus: boolean; - - /** Runnable background. */ - public background: boolean; - - /** Runnable alwaysRun. */ - public alwaysRun: boolean; - - /** Runnable environment. */ - public environment?: (google.cloud.batch.v1.IEnvironment|null); - - /** Runnable timeout. */ - public timeout?: (google.protobuf.IDuration|null); - - /** Runnable labels. */ - public labels: { [k: string]: string }; - - /** Runnable executable. */ - public executable?: ("container"|"script"|"barrier"); - - /** - * Creates a new Runnable instance using the specified properties. - * @param [properties] Properties to set - * @returns Runnable instance - */ - public static create(properties?: google.cloud.batch.v1.IRunnable): google.cloud.batch.v1.Runnable; - - /** - * Encodes the specified Runnable message. Does not implicitly {@link google.cloud.batch.v1.Runnable.verify|verify} messages. - * @param message Runnable message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IRunnable, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Runnable message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Runnable.verify|verify} messages. - * @param message Runnable message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IRunnable, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Runnable message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Runnable - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.Runnable; - - /** - * Decodes a Runnable message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Runnable - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.Runnable; - - /** - * Verifies a Runnable message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Runnable message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Runnable - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.Runnable; - - /** - * Creates a plain object from a Runnable message. Also converts values to other types if specified. - * @param message Runnable - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.Runnable, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Runnable to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Runnable - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Runnable { - - /** Properties of a Container. */ - interface IContainer { - - /** Container imageUri */ - imageUri?: (string|null); - - /** Container commands */ - commands?: (string[]|null); - - /** Container entrypoint */ - entrypoint?: (string|null); - - /** Container volumes */ - volumes?: (string[]|null); - - /** Container options */ - options?: (string|null); - - /** Container blockExternalNetwork */ - blockExternalNetwork?: (boolean|null); - - /** Container username */ - username?: (string|null); - - /** Container password */ - password?: (string|null); - - /** Container enableImageStreaming */ - enableImageStreaming?: (boolean|null); - } - - /** Represents a Container. */ - class Container implements IContainer { - - /** - * Constructs a new Container. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.Runnable.IContainer); - - /** Container imageUri. */ - public imageUri: string; - - /** Container commands. */ - public commands: string[]; - - /** Container entrypoint. */ - public entrypoint: string; - - /** Container volumes. */ - public volumes: string[]; - - /** Container options. */ - public options: string; - - /** Container blockExternalNetwork. */ - public blockExternalNetwork: boolean; - - /** Container username. */ - public username: string; - - /** Container password. */ - public password: string; - - /** Container enableImageStreaming. */ - public enableImageStreaming: boolean; - - /** - * Creates a new Container instance using the specified properties. - * @param [properties] Properties to set - * @returns Container instance - */ - public static create(properties?: google.cloud.batch.v1.Runnable.IContainer): google.cloud.batch.v1.Runnable.Container; - - /** - * Encodes the specified Container message. Does not implicitly {@link google.cloud.batch.v1.Runnable.Container.verify|verify} messages. - * @param message Container message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.Runnable.IContainer, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Container message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Runnable.Container.verify|verify} messages. - * @param message Container message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.Runnable.IContainer, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Container message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Container - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.Runnable.Container; - - /** - * Decodes a Container message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Container - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.Runnable.Container; - - /** - * Verifies a Container message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Container message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Container - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.Runnable.Container; - - /** - * Creates a plain object from a Container message. Also converts values to other types if specified. - * @param message Container - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.Runnable.Container, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Container to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Container - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Script. */ - interface IScript { - - /** Script path */ - path?: (string|null); - - /** Script text */ - text?: (string|null); - } - - /** Represents a Script. */ - class Script implements IScript { - - /** - * Constructs a new Script. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.Runnable.IScript); - - /** Script path. */ - public path?: (string|null); - - /** Script text. */ - public text?: (string|null); - - /** Script command. */ - public command?: ("path"|"text"); - - /** - * Creates a new Script instance using the specified properties. - * @param [properties] Properties to set - * @returns Script instance - */ - public static create(properties?: google.cloud.batch.v1.Runnable.IScript): google.cloud.batch.v1.Runnable.Script; - - /** - * Encodes the specified Script message. Does not implicitly {@link google.cloud.batch.v1.Runnable.Script.verify|verify} messages. - * @param message Script message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.Runnable.IScript, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Script message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Runnable.Script.verify|verify} messages. - * @param message Script message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.Runnable.IScript, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Script message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Script - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.Runnable.Script; - - /** - * Decodes a Script message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Script - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.Runnable.Script; - - /** - * Verifies a Script message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Script message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Script - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.Runnable.Script; - - /** - * Creates a plain object from a Script message. Also converts values to other types if specified. - * @param message Script - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.Runnable.Script, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Script to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Script - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Barrier. */ - interface IBarrier { - - /** Barrier name */ - name?: (string|null); - } - - /** Represents a Barrier. */ - class Barrier implements IBarrier { - - /** - * Constructs a new Barrier. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.Runnable.IBarrier); - - /** Barrier name. */ - public name: string; - - /** - * Creates a new Barrier instance using the specified properties. - * @param [properties] Properties to set - * @returns Barrier instance - */ - public static create(properties?: google.cloud.batch.v1.Runnable.IBarrier): google.cloud.batch.v1.Runnable.Barrier; - - /** - * Encodes the specified Barrier message. Does not implicitly {@link google.cloud.batch.v1.Runnable.Barrier.verify|verify} messages. - * @param message Barrier message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.Runnable.IBarrier, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Barrier message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Runnable.Barrier.verify|verify} messages. - * @param message Barrier message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.Runnable.IBarrier, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Barrier message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Barrier - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.Runnable.Barrier; - - /** - * Decodes a Barrier message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Barrier - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.Runnable.Barrier; - - /** - * Verifies a Barrier message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Barrier message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Barrier - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.Runnable.Barrier; - - /** - * Creates a plain object from a Barrier message. Also converts values to other types if specified. - * @param message Barrier - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.Runnable.Barrier, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Barrier to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Barrier - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a TaskSpec. */ - interface ITaskSpec { - - /** TaskSpec runnables */ - runnables?: (google.cloud.batch.v1.IRunnable[]|null); - - /** TaskSpec computeResource */ - computeResource?: (google.cloud.batch.v1.IComputeResource|null); - - /** TaskSpec maxRunDuration */ - maxRunDuration?: (google.protobuf.IDuration|null); - - /** TaskSpec maxRetryCount */ - maxRetryCount?: (number|null); - - /** TaskSpec lifecyclePolicies */ - lifecyclePolicies?: (google.cloud.batch.v1.ILifecyclePolicy[]|null); - - /** TaskSpec environments */ - environments?: ({ [k: string]: string }|null); - - /** TaskSpec volumes */ - volumes?: (google.cloud.batch.v1.IVolume[]|null); - - /** TaskSpec environment */ - environment?: (google.cloud.batch.v1.IEnvironment|null); - } - - /** Represents a TaskSpec. */ - class TaskSpec implements ITaskSpec { - - /** - * Constructs a new TaskSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.ITaskSpec); - - /** TaskSpec runnables. */ - public runnables: google.cloud.batch.v1.IRunnable[]; - - /** TaskSpec computeResource. */ - public computeResource?: (google.cloud.batch.v1.IComputeResource|null); - - /** TaskSpec maxRunDuration. */ - public maxRunDuration?: (google.protobuf.IDuration|null); - - /** TaskSpec maxRetryCount. */ - public maxRetryCount: number; - - /** TaskSpec lifecyclePolicies. */ - public lifecyclePolicies: google.cloud.batch.v1.ILifecyclePolicy[]; - - /** TaskSpec environments. */ - public environments: { [k: string]: string }; - - /** TaskSpec volumes. */ - public volumes: google.cloud.batch.v1.IVolume[]; - - /** TaskSpec environment. */ - public environment?: (google.cloud.batch.v1.IEnvironment|null); - - /** - * Creates a new TaskSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns TaskSpec instance - */ - public static create(properties?: google.cloud.batch.v1.ITaskSpec): google.cloud.batch.v1.TaskSpec; - - /** - * Encodes the specified TaskSpec message. Does not implicitly {@link google.cloud.batch.v1.TaskSpec.verify|verify} messages. - * @param message TaskSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.ITaskSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TaskSpec message, length delimited. Does not implicitly {@link google.cloud.batch.v1.TaskSpec.verify|verify} messages. - * @param message TaskSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.ITaskSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TaskSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TaskSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.TaskSpec; - - /** - * Decodes a TaskSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TaskSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.TaskSpec; - - /** - * Verifies a TaskSpec message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TaskSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TaskSpec - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.TaskSpec; - - /** - * Creates a plain object from a TaskSpec message. Also converts values to other types if specified. - * @param message TaskSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.TaskSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TaskSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TaskSpec - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a LifecyclePolicy. */ - interface ILifecyclePolicy { - - /** LifecyclePolicy action */ - action?: (google.cloud.batch.v1.LifecyclePolicy.Action|keyof typeof google.cloud.batch.v1.LifecyclePolicy.Action|null); - - /** LifecyclePolicy actionCondition */ - actionCondition?: (google.cloud.batch.v1.LifecyclePolicy.IActionCondition|null); - } - - /** Represents a LifecyclePolicy. */ - class LifecyclePolicy implements ILifecyclePolicy { - - /** - * Constructs a new LifecyclePolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.ILifecyclePolicy); - - /** LifecyclePolicy action. */ - public action: (google.cloud.batch.v1.LifecyclePolicy.Action|keyof typeof google.cloud.batch.v1.LifecyclePolicy.Action); - - /** LifecyclePolicy actionCondition. */ - public actionCondition?: (google.cloud.batch.v1.LifecyclePolicy.IActionCondition|null); - - /** - * Creates a new LifecyclePolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns LifecyclePolicy instance - */ - public static create(properties?: google.cloud.batch.v1.ILifecyclePolicy): google.cloud.batch.v1.LifecyclePolicy; - - /** - * Encodes the specified LifecyclePolicy message. Does not implicitly {@link google.cloud.batch.v1.LifecyclePolicy.verify|verify} messages. - * @param message LifecyclePolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.ILifecyclePolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LifecyclePolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.LifecyclePolicy.verify|verify} messages. - * @param message LifecyclePolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.ILifecyclePolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LifecyclePolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LifecyclePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.LifecyclePolicy; - - /** - * Decodes a LifecyclePolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LifecyclePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.LifecyclePolicy; - - /** - * Verifies a LifecyclePolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LifecyclePolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LifecyclePolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.LifecyclePolicy; - - /** - * Creates a plain object from a LifecyclePolicy message. Also converts values to other types if specified. - * @param message LifecyclePolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.LifecyclePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LifecyclePolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LifecyclePolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace LifecyclePolicy { - - /** Properties of an ActionCondition. */ - interface IActionCondition { - - /** ActionCondition exitCodes */ - exitCodes?: (number[]|null); - } - - /** Represents an ActionCondition. */ - class ActionCondition implements IActionCondition { - - /** - * Constructs a new ActionCondition. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.LifecyclePolicy.IActionCondition); - - /** ActionCondition exitCodes. */ - public exitCodes: number[]; - - /** - * Creates a new ActionCondition instance using the specified properties. - * @param [properties] Properties to set - * @returns ActionCondition instance - */ - public static create(properties?: google.cloud.batch.v1.LifecyclePolicy.IActionCondition): google.cloud.batch.v1.LifecyclePolicy.ActionCondition; - - /** - * Encodes the specified ActionCondition message. Does not implicitly {@link google.cloud.batch.v1.LifecyclePolicy.ActionCondition.verify|verify} messages. - * @param message ActionCondition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.LifecyclePolicy.IActionCondition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ActionCondition message, length delimited. Does not implicitly {@link google.cloud.batch.v1.LifecyclePolicy.ActionCondition.verify|verify} messages. - * @param message ActionCondition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.LifecyclePolicy.IActionCondition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ActionCondition message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ActionCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.LifecyclePolicy.ActionCondition; - - /** - * Decodes an ActionCondition message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ActionCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.LifecyclePolicy.ActionCondition; - - /** - * Verifies an ActionCondition message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ActionCondition message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ActionCondition - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.LifecyclePolicy.ActionCondition; - - /** - * Creates a plain object from an ActionCondition message. Also converts values to other types if specified. - * @param message ActionCondition - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.LifecyclePolicy.ActionCondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ActionCondition to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ActionCondition - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Action enum. */ - enum Action { - ACTION_UNSPECIFIED = 0, - RETRY_TASK = 1, - FAIL_TASK = 2 - } - } - - /** Properties of a Task. */ - interface ITask { - - /** Task name */ - name?: (string|null); - - /** Task status */ - status?: (google.cloud.batch.v1.ITaskStatus|null); - } - - /** Represents a Task. */ - class Task implements ITask { - - /** - * Constructs a new Task. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.ITask); - - /** Task name. */ - public name: string; - - /** Task status. */ - public status?: (google.cloud.batch.v1.ITaskStatus|null); - - /** - * Creates a new Task instance using the specified properties. - * @param [properties] Properties to set - * @returns Task instance - */ - public static create(properties?: google.cloud.batch.v1.ITask): google.cloud.batch.v1.Task; - - /** - * Encodes the specified Task message. Does not implicitly {@link google.cloud.batch.v1.Task.verify|verify} messages. - * @param message Task message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.ITask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Task message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Task.verify|verify} messages. - * @param message Task message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.ITask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Task message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Task - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.Task; - - /** - * Decodes a Task message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Task - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.Task; - - /** - * Verifies a Task message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Task message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Task - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.Task; - - /** - * Creates a plain object from a Task message. Also converts values to other types if specified. - * @param message Task - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.Task, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Task to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Task - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Environment. */ - interface IEnvironment { - - /** Environment variables */ - variables?: ({ [k: string]: string }|null); - - /** Environment secretVariables */ - secretVariables?: ({ [k: string]: string }|null); - - /** Environment encryptedVariables */ - encryptedVariables?: (google.cloud.batch.v1.Environment.IKMSEnvMap|null); - } - - /** Represents an Environment. */ - class Environment implements IEnvironment { - - /** - * Constructs a new Environment. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IEnvironment); - - /** Environment variables. */ - public variables: { [k: string]: string }; - - /** Environment secretVariables. */ - public secretVariables: { [k: string]: string }; - - /** Environment encryptedVariables. */ - public encryptedVariables?: (google.cloud.batch.v1.Environment.IKMSEnvMap|null); - - /** - * Creates a new Environment instance using the specified properties. - * @param [properties] Properties to set - * @returns Environment instance - */ - public static create(properties?: google.cloud.batch.v1.IEnvironment): google.cloud.batch.v1.Environment; - - /** - * Encodes the specified Environment message. Does not implicitly {@link google.cloud.batch.v1.Environment.verify|verify} messages. - * @param message Environment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Environment.verify|verify} messages. - * @param message Environment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Environment message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Environment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.Environment; - - /** - * Decodes an Environment message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Environment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.Environment; - - /** - * Verifies an Environment message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Environment message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Environment - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.Environment; - - /** - * Creates a plain object from an Environment message. Also converts values to other types if specified. - * @param message Environment - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.Environment, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Environment to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Environment - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Environment { - - /** Properties of a KMSEnvMap. */ - interface IKMSEnvMap { - - /** KMSEnvMap keyName */ - keyName?: (string|null); - - /** KMSEnvMap cipherText */ - cipherText?: (string|null); - } - - /** Represents a KMSEnvMap. */ - class KMSEnvMap implements IKMSEnvMap { - - /** - * Constructs a new KMSEnvMap. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.Environment.IKMSEnvMap); - - /** KMSEnvMap keyName. */ - public keyName: string; - - /** KMSEnvMap cipherText. */ - public cipherText: string; - - /** - * Creates a new KMSEnvMap instance using the specified properties. - * @param [properties] Properties to set - * @returns KMSEnvMap instance - */ - public static create(properties?: google.cloud.batch.v1.Environment.IKMSEnvMap): google.cloud.batch.v1.Environment.KMSEnvMap; - - /** - * Encodes the specified KMSEnvMap message. Does not implicitly {@link google.cloud.batch.v1.Environment.KMSEnvMap.verify|verify} messages. - * @param message KMSEnvMap message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.Environment.IKMSEnvMap, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified KMSEnvMap message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Environment.KMSEnvMap.verify|verify} messages. - * @param message KMSEnvMap message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.Environment.IKMSEnvMap, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a KMSEnvMap message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns KMSEnvMap - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.Environment.KMSEnvMap; - - /** - * Decodes a KMSEnvMap message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns KMSEnvMap - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.Environment.KMSEnvMap; - - /** - * Verifies a KMSEnvMap message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a KMSEnvMap message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns KMSEnvMap - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.Environment.KMSEnvMap; - - /** - * Creates a plain object from a KMSEnvMap message. Also converts values to other types if specified. - * @param message KMSEnvMap - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.Environment.KMSEnvMap, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this KMSEnvMap to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for KMSEnvMap - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a Volume. */ - interface IVolume { - - /** Volume nfs */ - nfs?: (google.cloud.batch.v1.INFS|null); - - /** Volume gcs */ - gcs?: (google.cloud.batch.v1.IGCS|null); - - /** Volume deviceName */ - deviceName?: (string|null); - - /** Volume mountPath */ - mountPath?: (string|null); - - /** Volume mountOptions */ - mountOptions?: (string[]|null); - } - - /** Represents a Volume. */ - class Volume implements IVolume { - - /** - * Constructs a new Volume. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IVolume); - - /** Volume nfs. */ - public nfs?: (google.cloud.batch.v1.INFS|null); - - /** Volume gcs. */ - public gcs?: (google.cloud.batch.v1.IGCS|null); - - /** Volume deviceName. */ - public deviceName?: (string|null); - - /** Volume mountPath. */ - public mountPath: string; - - /** Volume mountOptions. */ - public mountOptions: string[]; - - /** Volume source. */ - public source?: ("nfs"|"gcs"|"deviceName"); - - /** - * Creates a new Volume instance using the specified properties. - * @param [properties] Properties to set - * @returns Volume instance - */ - public static create(properties?: google.cloud.batch.v1.IVolume): google.cloud.batch.v1.Volume; - - /** - * Encodes the specified Volume message. Does not implicitly {@link google.cloud.batch.v1.Volume.verify|verify} messages. - * @param message Volume message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IVolume, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Volume message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Volume.verify|verify} messages. - * @param message Volume message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IVolume, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Volume message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Volume - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.Volume; - - /** - * Decodes a Volume message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Volume - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.Volume; - - /** - * Verifies a Volume message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Volume message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Volume - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.Volume; - - /** - * Creates a plain object from a Volume message. Also converts values to other types if specified. - * @param message Volume - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.Volume, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Volume to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Volume - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a NFS. */ - interface INFS { - - /** NFS server */ - server?: (string|null); - - /** NFS remotePath */ - remotePath?: (string|null); - } - - /** Represents a NFS. */ - class NFS implements INFS { - - /** - * Constructs a new NFS. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.INFS); - - /** NFS server. */ - public server: string; - - /** NFS remotePath. */ - public remotePath: string; - - /** - * Creates a new NFS instance using the specified properties. - * @param [properties] Properties to set - * @returns NFS instance - */ - public static create(properties?: google.cloud.batch.v1.INFS): google.cloud.batch.v1.NFS; - - /** - * Encodes the specified NFS message. Does not implicitly {@link google.cloud.batch.v1.NFS.verify|verify} messages. - * @param message NFS message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.INFS, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NFS message, length delimited. Does not implicitly {@link google.cloud.batch.v1.NFS.verify|verify} messages. - * @param message NFS message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.INFS, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NFS message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NFS - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.NFS; - - /** - * Decodes a NFS message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NFS - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.NFS; - - /** - * Verifies a NFS message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NFS message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NFS - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.NFS; - - /** - * Creates a plain object from a NFS message. Also converts values to other types if specified. - * @param message NFS - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.NFS, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NFS to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NFS - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GCS. */ - interface IGCS { - - /** GCS remotePath */ - remotePath?: (string|null); - } - - /** Represents a GCS. */ - class GCS implements IGCS { - - /** - * Constructs a new GCS. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1.IGCS); - - /** GCS remotePath. */ - public remotePath: string; - - /** - * Creates a new GCS instance using the specified properties. - * @param [properties] Properties to set - * @returns GCS instance - */ - public static create(properties?: google.cloud.batch.v1.IGCS): google.cloud.batch.v1.GCS; - - /** - * Encodes the specified GCS message. Does not implicitly {@link google.cloud.batch.v1.GCS.verify|verify} messages. - * @param message GCS message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1.IGCS, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GCS message, length delimited. Does not implicitly {@link google.cloud.batch.v1.GCS.verify|verify} messages. - * @param message GCS message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1.IGCS, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GCS message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GCS - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.GCS; - - /** - * Decodes a GCS message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GCS - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.GCS; - - /** - * Verifies a GCS message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GCS message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GCS - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.GCS; - - /** - * Creates a plain object from a GCS message. Also converts values to other types if specified. - * @param message GCS - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1.GCS, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GCS to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GCS - * @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); - } - - /** Represents a CommonLanguageSettings. */ - class CommonLanguageSettings implements ICommonLanguageSettings { - - /** - * Constructs a new CommonLanguageSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICommonLanguageSettings); - - /** CommonLanguageSettings referenceDocsUri. */ - public referenceDocsUri: string; - - /** CommonLanguageSettings destinations. */ - public destinations: google.api.ClientLibraryDestination[]; - - /** - * Creates a new CommonLanguageSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns CommonLanguageSettings instance - */ - public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; - - /** - * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @param message CommonLanguageSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @param message CommonLanguageSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; - - /** - * Verifies a CommonLanguageSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CommonLanguageSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; - - /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. - * @param message CommonLanguageSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CommonLanguageSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CommonLanguageSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ClientLibrarySettings. */ - interface IClientLibrarySettings { - - /** ClientLibrarySettings version */ - version?: (string|null); - - /** ClientLibrarySettings launchStage */ - launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); - - /** ClientLibrarySettings restNumericEnums */ - restNumericEnums?: (boolean|null); - - /** ClientLibrarySettings javaSettings */ - javaSettings?: (google.api.IJavaSettings|null); - - /** ClientLibrarySettings cppSettings */ - cppSettings?: (google.api.ICppSettings|null); - - /** ClientLibrarySettings phpSettings */ - phpSettings?: (google.api.IPhpSettings|null); - - /** ClientLibrarySettings pythonSettings */ - pythonSettings?: (google.api.IPythonSettings|null); - - /** ClientLibrarySettings nodeSettings */ - nodeSettings?: (google.api.INodeSettings|null); - - /** ClientLibrarySettings dotnetSettings */ - dotnetSettings?: (google.api.IDotnetSettings|null); - - /** ClientLibrarySettings rubySettings */ - rubySettings?: (google.api.IRubySettings|null); - - /** ClientLibrarySettings goSettings */ - goSettings?: (google.api.IGoSettings|null); - } - - /** Represents a ClientLibrarySettings. */ - class ClientLibrarySettings implements IClientLibrarySettings { - - /** - * Constructs a new ClientLibrarySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IClientLibrarySettings); - - /** ClientLibrarySettings version. */ - public version: string; - - /** ClientLibrarySettings launchStage. */ - public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); - - /** ClientLibrarySettings restNumericEnums. */ - public restNumericEnums: boolean; - - /** ClientLibrarySettings javaSettings. */ - public javaSettings?: (google.api.IJavaSettings|null); - - /** ClientLibrarySettings cppSettings. */ - public cppSettings?: (google.api.ICppSettings|null); - - /** ClientLibrarySettings phpSettings. */ - public phpSettings?: (google.api.IPhpSettings|null); - - /** ClientLibrarySettings pythonSettings. */ - public pythonSettings?: (google.api.IPythonSettings|null); - - /** ClientLibrarySettings nodeSettings. */ - public nodeSettings?: (google.api.INodeSettings|null); - - /** ClientLibrarySettings dotnetSettings. */ - public dotnetSettings?: (google.api.IDotnetSettings|null); - - /** ClientLibrarySettings rubySettings. */ - public rubySettings?: (google.api.IRubySettings|null); - - /** ClientLibrarySettings goSettings. */ - public goSettings?: (google.api.IGoSettings|null); - - /** - * Creates a new ClientLibrarySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns ClientLibrarySettings instance - */ - public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; - - /** - * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @param message ClientLibrarySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @param message ClientLibrarySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; - - /** - * Verifies a ClientLibrarySettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClientLibrarySettings - */ - public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; - - /** - * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. - * @param message ClientLibrarySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClientLibrarySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ClientLibrarySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Publishing. */ - interface IPublishing { - - /** Publishing methodSettings */ - methodSettings?: (google.api.IMethodSettings[]|null); - - /** Publishing newIssueUri */ - newIssueUri?: (string|null); - - /** Publishing documentationUri */ - documentationUri?: (string|null); - - /** Publishing apiShortName */ - apiShortName?: (string|null); - - /** Publishing githubLabel */ - githubLabel?: (string|null); - - /** Publishing codeownerGithubTeams */ - codeownerGithubTeams?: (string[]|null); - - /** Publishing docTagPrefix */ - docTagPrefix?: (string|null); - - /** Publishing organization */ - organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); - - /** Publishing librarySettings */ - librarySettings?: (google.api.IClientLibrarySettings[]|null); - - /** Publishing protoReferenceDocumentationUri */ - protoReferenceDocumentationUri?: (string|null); - - /** Publishing restReferenceDocumentationUri */ - restReferenceDocumentationUri?: (string|null); - } - - /** Represents a Publishing. */ - class Publishing implements IPublishing { - - /** - * Constructs a new Publishing. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPublishing); - - /** Publishing methodSettings. */ - public methodSettings: google.api.IMethodSettings[]; - - /** Publishing newIssueUri. */ - public newIssueUri: string; - - /** Publishing documentationUri. */ - public documentationUri: string; - - /** Publishing apiShortName. */ - public apiShortName: string; - - /** Publishing githubLabel. */ - public githubLabel: string; - - /** Publishing codeownerGithubTeams. */ - public codeownerGithubTeams: string[]; - - /** Publishing docTagPrefix. */ - public docTagPrefix: string; - - /** Publishing organization. */ - public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); - - /** Publishing librarySettings. */ - public librarySettings: google.api.IClientLibrarySettings[]; - - /** Publishing protoReferenceDocumentationUri. */ - public protoReferenceDocumentationUri: string; - - /** Publishing restReferenceDocumentationUri. */ - public restReferenceDocumentationUri: string; - - /** - * Creates a new Publishing instance using the specified properties. - * @param [properties] Properties to set - * @returns Publishing instance - */ - public static create(properties?: google.api.IPublishing): google.api.Publishing; - - /** - * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @param message Publishing message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @param message Publishing message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Publishing message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; - - /** - * Decodes a Publishing message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; - - /** - * Verifies a Publishing message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Publishing message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Publishing - */ - public static fromObject(object: { [k: string]: any }): google.api.Publishing; - - /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @param message Publishing - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Publishing to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Publishing - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a JavaSettings. */ - interface IJavaSettings { - - /** JavaSettings libraryPackage */ - libraryPackage?: (string|null); - - /** JavaSettings serviceClassNames */ - serviceClassNames?: ({ [k: string]: string }|null); - - /** JavaSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a JavaSettings. */ - class JavaSettings implements IJavaSettings { - - /** - * Constructs a new JavaSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IJavaSettings); - - /** JavaSettings libraryPackage. */ - public libraryPackage: string; - - /** JavaSettings serviceClassNames. */ - public serviceClassNames: { [k: string]: string }; - - /** JavaSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new JavaSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns JavaSettings instance - */ - public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; - - /** - * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @param message JavaSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @param message JavaSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a JavaSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; - - /** - * Decodes a JavaSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; - - /** - * Verifies a JavaSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns JavaSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; - - /** - * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. - * @param message JavaSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this JavaSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for JavaSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CppSettings. */ - interface ICppSettings { - - /** CppSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a CppSettings. */ - class CppSettings implements ICppSettings { - - /** - * Constructs a new CppSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICppSettings); - - /** CppSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new CppSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns CppSettings instance - */ - public static create(properties?: google.api.ICppSettings): google.api.CppSettings; - - /** - * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @param message CppSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @param message CppSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CppSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; - - /** - * Decodes a CppSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; - - /** - * Verifies a CppSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CppSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.CppSettings; - - /** - * Creates a plain object from a CppSettings message. Also converts values to other types if specified. - * @param message CppSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CppSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CppSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PhpSettings. */ - interface IPhpSettings { - - /** PhpSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a PhpSettings. */ - class PhpSettings implements IPhpSettings { - - /** - * Constructs a new PhpSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPhpSettings); - - /** PhpSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new PhpSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns PhpSettings instance - */ - public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; - - /** - * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @param message PhpSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @param message PhpSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PhpSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; - - /** - * Decodes a PhpSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; - - /** - * Verifies a PhpSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PhpSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; - - /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @param message PhpSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PhpSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PhpSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PythonSettings. */ - interface IPythonSettings { - - /** PythonSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a PythonSettings. */ - class PythonSettings implements IPythonSettings { - - /** - * Constructs a new PythonSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPythonSettings); - - /** PythonSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new PythonSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns PythonSettings instance - */ - public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; - - /** - * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @param message PythonSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @param message PythonSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PythonSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; - - /** - * Decodes a PythonSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; - - /** - * Verifies a PythonSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PythonSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; - - /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. - * @param message PythonSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PythonSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PythonSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a NodeSettings. */ - interface INodeSettings { - - /** NodeSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a NodeSettings. */ - class NodeSettings implements INodeSettings { - - /** - * Constructs a new NodeSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.INodeSettings); - - /** NodeSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new NodeSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns NodeSettings instance - */ - public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; - - /** - * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @param message NodeSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @param message NodeSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NodeSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; - - /** - * Decodes a NodeSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; - - /** - * Verifies a NodeSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NodeSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; - - /** - * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. - * @param message NodeSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NodeSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NodeSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DotnetSettings. */ - interface IDotnetSettings { - - /** DotnetSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - - /** DotnetSettings renamedServices */ - renamedServices?: ({ [k: string]: string }|null); - - /** DotnetSettings renamedResources */ - renamedResources?: ({ [k: string]: string }|null); - - /** DotnetSettings ignoredResources */ - ignoredResources?: (string[]|null); - - /** DotnetSettings forcedNamespaceAliases */ - forcedNamespaceAliases?: (string[]|null); - - /** DotnetSettings handwrittenSignatures */ - handwrittenSignatures?: (string[]|null); - } - - /** Represents a DotnetSettings. */ - class DotnetSettings implements IDotnetSettings { - - /** - * Constructs a new DotnetSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IDotnetSettings); - - /** DotnetSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** DotnetSettings renamedServices. */ - public renamedServices: { [k: string]: string }; - - /** DotnetSettings renamedResources. */ - public renamedResources: { [k: string]: string }; - - /** DotnetSettings ignoredResources. */ - public ignoredResources: string[]; - - /** DotnetSettings forcedNamespaceAliases. */ - public forcedNamespaceAliases: string[]; - - /** DotnetSettings handwrittenSignatures. */ - public handwrittenSignatures: string[]; - - /** - * Creates a new DotnetSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns DotnetSettings instance - */ - public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; - - /** - * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @param message DotnetSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @param message DotnetSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; - - /** - * Verifies a DotnetSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DotnetSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; - - /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @param message DotnetSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DotnetSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DotnetSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RubySettings. */ - interface IRubySettings { - - /** RubySettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a RubySettings. */ - class RubySettings implements IRubySettings { - - /** - * Constructs a new RubySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IRubySettings); - - /** RubySettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new RubySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns RubySettings instance - */ - public static create(properties?: google.api.IRubySettings): google.api.RubySettings; - - /** - * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @param message RubySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @param message RubySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RubySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; - - /** - * Decodes a RubySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; - - /** - * Verifies a RubySettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RubySettings - */ - public static fromObject(object: { [k: string]: any }): google.api.RubySettings; - - /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @param message RubySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RubySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RubySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GoSettings. */ - interface IGoSettings { - - /** GoSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a GoSettings. */ - class GoSettings implements IGoSettings { - - /** - * Constructs a new GoSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IGoSettings); - - /** GoSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new GoSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns GoSettings instance - */ - public static create(properties?: google.api.IGoSettings): google.api.GoSettings; - - /** - * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @param message GoSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @param message GoSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GoSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; - - /** - * Decodes a GoSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; - - /** - * Verifies a GoSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GoSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.GoSettings; - - /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. - * @param message GoSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GoSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GoSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodSettings. */ - interface IMethodSettings { - - /** MethodSettings selector */ - selector?: (string|null); - - /** MethodSettings longRunning */ - longRunning?: (google.api.MethodSettings.ILongRunning|null); - - /** MethodSettings autoPopulatedFields */ - autoPopulatedFields?: (string[]|null); - } - - /** Represents a MethodSettings. */ - class MethodSettings implements IMethodSettings { - - /** - * Constructs a new MethodSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IMethodSettings); - - /** MethodSettings selector. */ - public selector: string; - - /** MethodSettings longRunning. */ - public longRunning?: (google.api.MethodSettings.ILongRunning|null); - - /** MethodSettings autoPopulatedFields. */ - public autoPopulatedFields: string[]; - - /** - * Creates a new MethodSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodSettings instance - */ - public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; - - /** - * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @param message MethodSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @param message MethodSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; - - /** - * Decodes a MethodSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; - - /** - * Verifies a MethodSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; - - /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @param message MethodSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MethodSettings { - - /** Properties of a LongRunning. */ - interface ILongRunning { - - /** LongRunning initialPollDelay */ - initialPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning pollDelayMultiplier */ - pollDelayMultiplier?: (number|null); - - /** LongRunning maxPollDelay */ - maxPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning totalPollTimeout */ - totalPollTimeout?: (google.protobuf.IDuration|null); - } - - /** Represents a LongRunning. */ - class LongRunning implements ILongRunning { - - /** - * Constructs a new LongRunning. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.MethodSettings.ILongRunning); - - /** LongRunning initialPollDelay. */ - public initialPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning pollDelayMultiplier. */ - public pollDelayMultiplier: number; - - /** LongRunning maxPollDelay. */ - public maxPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning totalPollTimeout. */ - public totalPollTimeout?: (google.protobuf.IDuration|null); - - /** - * Creates a new LongRunning instance using the specified properties. - * @param [properties] Properties to set - * @returns LongRunning instance - */ - public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; - - /** - * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @param message LongRunning message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @param message LongRunning message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LongRunning message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; - - /** - * Decodes a LongRunning message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; - - /** - * Verifies a LongRunning message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LongRunning - */ - public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; - - /** - * Creates a plain object from a LongRunning message. Also converts values to other types if specified. - * @param message LongRunning - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LongRunning to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LongRunning - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** ClientLibraryOrganization enum. */ - enum ClientLibraryOrganization { - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, - CLOUD = 1, - ADS = 2, - PHOTOS = 3, - STREET_VIEW = 4, - SHOPPING = 5, - GEO = 6, - GENERATIVE_AI = 7 - } - - /** ClientLibraryDestination enum. */ - enum ClientLibraryDestination { - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, - GITHUB = 10, - PACKAGE_MANAGER = 20 - } - - /** LaunchStage enum. */ - enum LaunchStage { - LAUNCH_STAGE_UNSPECIFIED = 0, - UNIMPLEMENTED = 6, - PRELAUNCH = 7, - EARLY_ACCESS = 1, - ALPHA = 2, - BETA = 3, - GA = 4, - DEPRECATED = 5 - } - - /** 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 FieldInfo. */ - interface IFieldInfo { - - /** FieldInfo format */ - format?: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format|null); - } - - /** Represents a FieldInfo. */ - class FieldInfo implements IFieldInfo { - - /** - * Constructs a new FieldInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IFieldInfo); - - /** FieldInfo format. */ - public format: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format); - - /** - * Creates a new FieldInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldInfo instance - */ - public static create(properties?: google.api.IFieldInfo): google.api.FieldInfo; - - /** - * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @param message FieldInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @param message FieldInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldInfo - * @throws {Error} If the payload is not 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.FieldInfo; - - /** - * Decodes a FieldInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldInfo - * @throws {Error} If the payload 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.FieldInfo; - - /** - * Verifies a FieldInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldInfo - */ - public static fromObject(object: { [k: string]: any }): google.api.FieldInfo; - - /** - * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. - * @param message FieldInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.FieldInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldInfo { - - /** Format enum. */ - enum Format { - FORMAT_UNSPECIFIED = 0, - UUID4 = 1, - IPV4 = 2, - IPV6 = 3, - IPV4_OR_IPV6 = 4 - } - } - - /** Properties of a ResourceDescriptor. */ - interface IResourceDescriptor { - - /** ResourceDescriptor type */ - type?: (string|null); - - /** ResourceDescriptor pattern */ - pattern?: (string[]|null); - - /** ResourceDescriptor nameField */ - nameField?: (string|null); - - /** ResourceDescriptor history */ - history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); - - /** ResourceDescriptor plural */ - plural?: (string|null); - - /** ResourceDescriptor singular */ - singular?: (string|null); - - /** ResourceDescriptor style */ - style?: (google.api.ResourceDescriptor.Style[]|null); - } - - /** Represents a ResourceDescriptor. */ - class ResourceDescriptor implements IResourceDescriptor { - - /** - * Constructs a new ResourceDescriptor. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceDescriptor); - - /** ResourceDescriptor type. */ - public type: string; - - /** ResourceDescriptor pattern. */ - public pattern: string[]; - - /** ResourceDescriptor nameField. */ - public nameField: string; - - /** ResourceDescriptor history. */ - public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); - - /** ResourceDescriptor plural. */ - public plural: string; - - /** ResourceDescriptor singular. */ - public singular: string; - - /** ResourceDescriptor style. */ - public style: google.api.ResourceDescriptor.Style[]; - - /** - * Creates a new ResourceDescriptor instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceDescriptor instance - */ - public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; - - /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; - - /** - * Verifies a ResourceDescriptor message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceDescriptor - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; - - /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @param message ResourceDescriptor - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceDescriptor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceDescriptor - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ResourceDescriptor { - - /** History enum. */ - enum History { - HISTORY_UNSPECIFIED = 0, - ORIGINALLY_SINGLE_PATTERN = 1, - FUTURE_MULTI_PATTERN = 2 - } - - /** Style enum. */ - enum Style { - STYLE_UNSPECIFIED = 0, - DECLARATIVE_FRIENDLY = 1 - } - } - - /** Properties of a ResourceReference. */ - interface IResourceReference { - - /** ResourceReference type */ - type?: (string|null); - - /** ResourceReference childType */ - childType?: (string|null); - } - - /** Represents a ResourceReference. */ - class ResourceReference implements IResourceReference { - - /** - * Constructs a new ResourceReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceReference); - - /** ResourceReference type. */ - public type: string; - - /** ResourceReference childType. */ - public childType: string; - - /** - * Creates a new ResourceReference instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceReference instance - */ - public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; - - /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceReference message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; - - /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; - - /** - * Verifies a ResourceReference message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceReference - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; - - /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @param message ResourceReference - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceReference - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace protobuf. */ - namespace protobuf { - - /** Properties of a FileDescriptorSet. */ - interface IFileDescriptorSet { - - /** FileDescriptorSet file */ - file?: (google.protobuf.IFileDescriptorProto[]|null); - } - - /** Represents a FileDescriptorSet. */ - class FileDescriptorSet implements IFileDescriptorSet { - - /** - * Constructs a new FileDescriptorSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorSet); - - /** FileDescriptorSet file. */ - public file: google.protobuf.IFileDescriptorProto[]; - - /** - * Creates a new FileDescriptorSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorSet instance - */ - public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; - - /** - * Verifies a FileDescriptorSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @param message FileDescriptorSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileDescriptorSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Edition enum. */ - enum Edition { - EDITION_UNKNOWN = 0, - EDITION_PROTO2 = 998, - EDITION_PROTO3 = 999, - EDITION_2023 = 1000, - EDITION_2024 = 1001, - EDITION_1_TEST_ONLY = 1, - EDITION_2_TEST_ONLY = 2, - EDITION_99997_TEST_ONLY = 99997, - EDITION_99998_TEST_ONLY = 99998, - EDITION_99999_TEST_ONLY = 99999, - EDITION_MAX = 2147483647 - } - - /** Properties of a FileDescriptorProto. */ - interface IFileDescriptorProto { - - /** FileDescriptorProto name */ - name?: (string|null); - - /** FileDescriptorProto package */ - "package"?: (string|null); - - /** FileDescriptorProto dependency */ - dependency?: (string[]|null); - - /** FileDescriptorProto publicDependency */ - publicDependency?: (number[]|null); - - /** FileDescriptorProto weakDependency */ - weakDependency?: (number[]|null); - - /** FileDescriptorProto messageType */ - messageType?: (google.protobuf.IDescriptorProto[]|null); - - /** FileDescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** FileDescriptorProto service */ - service?: (google.protobuf.IServiceDescriptorProto[]|null); - - /** FileDescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** FileDescriptorProto options */ - options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo */ - sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax */ - syntax?: (string|null); - - /** FileDescriptorProto edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FileDescriptorProto. */ - class FileDescriptorProto implements IFileDescriptorProto { - - /** - * Constructs a new FileDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorProto); - - /** FileDescriptorProto name. */ - public name: string; - - /** FileDescriptorProto package. */ - public package: string; - - /** FileDescriptorProto dependency. */ - public dependency: string[]; - - /** FileDescriptorProto publicDependency. */ - public publicDependency: number[]; - - /** FileDescriptorProto weakDependency. */ - public weakDependency: number[]; - - /** FileDescriptorProto messageType. */ - public messageType: google.protobuf.IDescriptorProto[]; - - /** FileDescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** FileDescriptorProto service. */ - public service: google.protobuf.IServiceDescriptorProto[]; - - /** FileDescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** FileDescriptorProto options. */ - public options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo. */ - public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax. */ - public syntax: string; - - /** FileDescriptorProto edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; - - /** - * Verifies a FileDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @param message FileDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DescriptorProto. */ - interface IDescriptorProto { - - /** DescriptorProto name */ - name?: (string|null); - - /** DescriptorProto field */ - field?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto nestedType */ - nestedType?: (google.protobuf.IDescriptorProto[]|null); - - /** DescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** DescriptorProto extensionRange */ - extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); - - /** DescriptorProto oneofDecl */ - oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); - - /** DescriptorProto options */ - options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange */ - reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); - - /** DescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents a DescriptorProto. */ - class DescriptorProto implements IDescriptorProto { - - /** - * Constructs a new DescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDescriptorProto); - - /** DescriptorProto name. */ - public name: string; - - /** DescriptorProto field. */ - public field: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto nestedType. */ - public nestedType: google.protobuf.IDescriptorProto[]; - - /** DescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** DescriptorProto extensionRange. */ - public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; - - /** DescriptorProto oneofDecl. */ - public oneofDecl: google.protobuf.IOneofDescriptorProto[]; - - /** DescriptorProto options. */ - public options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange. */ - public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; - - /** DescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns DescriptorProto instance - */ - public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; - - /** - * Verifies a DescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @param message DescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DescriptorProto { - - /** Properties of an ExtensionRange. */ - interface IExtensionRange { - - /** ExtensionRange start */ - start?: (number|null); - - /** ExtensionRange end */ - end?: (number|null); - - /** ExtensionRange options */ - options?: (google.protobuf.IExtensionRangeOptions|null); - } - - /** Represents an ExtensionRange. */ - class ExtensionRange implements IExtensionRange { - - /** - * Constructs a new ExtensionRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); - - /** ExtensionRange start. */ - public start: number; - - /** ExtensionRange end. */ - public end: number; - - /** ExtensionRange options. */ - public options?: (google.protobuf.IExtensionRangeOptions|null); - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Verifies an ExtensionRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @param message ExtensionRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtensionRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ReservedRange. */ - interface IReservedRange { - - /** ReservedRange start */ - start?: (number|null); - - /** ReservedRange end */ - end?: (number|null); - } - - /** Represents a ReservedRange. */ - class ReservedRange implements IReservedRange { - - /** - * Constructs a new ReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); - - /** ReservedRange start. */ - public start: number; - - /** ReservedRange end. */ - public end: number; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ReservedRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Verifies a ReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @param message ReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ExtensionRangeOptions. */ - interface IExtensionRangeOptions { - - /** ExtensionRangeOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ExtensionRangeOptions declaration */ - declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); - - /** ExtensionRangeOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification */ - verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); - } - - /** Represents an ExtensionRangeOptions. */ - class ExtensionRangeOptions implements IExtensionRangeOptions { - - /** - * Constructs a new ExtensionRangeOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IExtensionRangeOptions); - - /** ExtensionRangeOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** ExtensionRangeOptions declaration. */ - public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; - - /** ExtensionRangeOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification. */ - public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRangeOptions instance - */ - public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; - - /** - * Verifies an ExtensionRangeOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRangeOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @param message ExtensionRangeOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ExtensionRangeOptions { - - /** Properties of a Declaration. */ - interface IDeclaration { - - /** Declaration number */ - number?: (number|null); - - /** Declaration fullName */ - fullName?: (string|null); - - /** Declaration type */ - type?: (string|null); - - /** Declaration reserved */ - reserved?: (boolean|null); - - /** Declaration repeated */ - repeated?: (boolean|null); - } - - /** Represents a Declaration. */ - class Declaration implements IDeclaration { - - /** - * Constructs a new Declaration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); - - /** Declaration number. */ - public number: number; - - /** Declaration fullName. */ - public fullName: string; - - /** Declaration type. */ - public type: string; - - /** Declaration reserved. */ - public reserved: boolean; - - /** Declaration repeated. */ - public repeated: boolean; - - /** - * Creates a new Declaration instance using the specified properties. - * @param [properties] Properties to set - * @returns Declaration instance - */ - public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Verifies a Declaration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Declaration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Declaration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @param message Declaration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Declaration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Declaration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** VerificationState enum. */ - enum VerificationState { - DECLARATION = 0, - UNVERIFIED = 1 - } - } - - /** Properties of a FieldDescriptorProto. */ - interface IFieldDescriptorProto { - - /** FieldDescriptorProto name */ - name?: (string|null); - - /** FieldDescriptorProto number */ - number?: (number|null); - - /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); - - /** FieldDescriptorProto type */ - type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); - - /** FieldDescriptorProto typeName */ - typeName?: (string|null); - - /** FieldDescriptorProto extendee */ - extendee?: (string|null); - - /** FieldDescriptorProto defaultValue */ - defaultValue?: (string|null); - - /** FieldDescriptorProto oneofIndex */ - oneofIndex?: (number|null); - - /** FieldDescriptorProto jsonName */ - jsonName?: (string|null); - - /** FieldDescriptorProto options */ - options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional */ - proto3Optional?: (boolean|null); - } - - /** Represents a FieldDescriptorProto. */ - class FieldDescriptorProto implements IFieldDescriptorProto { - - /** - * Constructs a new FieldDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldDescriptorProto); - - /** FieldDescriptorProto name. */ - public name: string; - - /** FieldDescriptorProto number. */ - public number: number; - - /** FieldDescriptorProto label. */ - public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); - - /** FieldDescriptorProto type. */ - public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); - - /** FieldDescriptorProto typeName. */ - public typeName: string; - - /** FieldDescriptorProto extendee. */ - public extendee: string; - - /** FieldDescriptorProto defaultValue. */ - public defaultValue: string; - - /** FieldDescriptorProto oneofIndex. */ - public oneofIndex: number; - - /** FieldDescriptorProto jsonName. */ - public jsonName: string; - - /** FieldDescriptorProto options. */ - public options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional. */ - public proto3Optional: boolean; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; - - /** - * Verifies a FieldDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @param message FieldDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldDescriptorProto { - - /** Type enum. */ - enum Type { - TYPE_DOUBLE = 1, - TYPE_FLOAT = 2, - TYPE_INT64 = 3, - TYPE_UINT64 = 4, - TYPE_INT32 = 5, - TYPE_FIXED64 = 6, - TYPE_FIXED32 = 7, - TYPE_BOOL = 8, - TYPE_STRING = 9, - TYPE_GROUP = 10, - TYPE_MESSAGE = 11, - TYPE_BYTES = 12, - TYPE_UINT32 = 13, - TYPE_ENUM = 14, - TYPE_SFIXED32 = 15, - TYPE_SFIXED64 = 16, - TYPE_SINT32 = 17, - TYPE_SINT64 = 18 - } - - /** Label enum. */ - enum Label { - LABEL_OPTIONAL = 1, - LABEL_REPEATED = 3, - LABEL_REQUIRED = 2 - } - } - - /** Properties of an OneofDescriptorProto. */ - interface IOneofDescriptorProto { - - /** OneofDescriptorProto name */ - name?: (string|null); - - /** OneofDescriptorProto options */ - options?: (google.protobuf.IOneofOptions|null); - } - - /** Represents an OneofDescriptorProto. */ - class OneofDescriptorProto implements IOneofDescriptorProto { - - /** - * Constructs a new OneofDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofDescriptorProto); - - /** OneofDescriptorProto name. */ - public name: string; - - /** OneofDescriptorProto options. */ - public options?: (google.protobuf.IOneofOptions|null); - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofDescriptorProto instance - */ - public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; - - /** - * Verifies an OneofDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @param message OneofDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OneofDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumDescriptorProto. */ - interface IEnumDescriptorProto { - - /** EnumDescriptorProto name */ - name?: (string|null); - - /** EnumDescriptorProto value */ - value?: (google.protobuf.IEnumValueDescriptorProto[]|null); - - /** EnumDescriptorProto options */ - options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange */ - reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); - - /** EnumDescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents an EnumDescriptorProto. */ - class EnumDescriptorProto implements IEnumDescriptorProto { - - /** - * Constructs a new EnumDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumDescriptorProto); - - /** EnumDescriptorProto name. */ - public name: string; - - /** EnumDescriptorProto value. */ - public value: google.protobuf.IEnumValueDescriptorProto[]; - - /** EnumDescriptorProto options. */ - public options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange. */ - public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; - - /** EnumDescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; - - /** - * Verifies an EnumDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @param message EnumDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EnumDescriptorProto { - - /** Properties of an EnumReservedRange. */ - interface IEnumReservedRange { - - /** EnumReservedRange start */ - start?: (number|null); - - /** EnumReservedRange end */ - end?: (number|null); - } - - /** Represents an EnumReservedRange. */ - class EnumReservedRange implements IEnumReservedRange { - - /** - * Constructs a new EnumReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); - - /** EnumReservedRange start. */ - public start: number; - - /** EnumReservedRange end. */ - public end: number; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumReservedRange instance - */ - public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Verifies an EnumReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @param message EnumReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an EnumValueDescriptorProto. */ - interface IEnumValueDescriptorProto { - - /** EnumValueDescriptorProto name */ - name?: (string|null); - - /** EnumValueDescriptorProto number */ - number?: (number|null); - - /** EnumValueDescriptorProto options */ - options?: (google.protobuf.IEnumValueOptions|null); - } - - /** Represents an EnumValueDescriptorProto. */ - class EnumValueDescriptorProto implements IEnumValueDescriptorProto { - - /** - * Constructs a new EnumValueDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueDescriptorProto); - - /** EnumValueDescriptorProto name. */ - public name: string; - - /** EnumValueDescriptorProto number. */ - public number: number; - - /** EnumValueDescriptorProto options. */ - public options?: (google.protobuf.IEnumValueOptions|null); - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; - - /** - * Verifies an EnumValueDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @param message EnumValueDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceDescriptorProto. */ - interface IServiceDescriptorProto { - - /** ServiceDescriptorProto name */ - name?: (string|null); - - /** ServiceDescriptorProto method */ - method?: (google.protobuf.IMethodDescriptorProto[]|null); - - /** ServiceDescriptorProto options */ - options?: (google.protobuf.IServiceOptions|null); - } - - /** Represents a ServiceDescriptorProto. */ - class ServiceDescriptorProto implements IServiceDescriptorProto { - - /** - * Constructs a new ServiceDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceDescriptorProto); - - /** ServiceDescriptorProto name. */ - public name: string; - - /** ServiceDescriptorProto method. */ - public method: google.protobuf.IMethodDescriptorProto[]; - - /** ServiceDescriptorProto options. */ - public options?: (google.protobuf.IServiceOptions|null); - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceDescriptorProto instance - */ - public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; - - /** - * Verifies a ServiceDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @param message ServiceDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodDescriptorProto. */ - interface IMethodDescriptorProto { - - /** MethodDescriptorProto name */ - name?: (string|null); - - /** MethodDescriptorProto inputType */ - inputType?: (string|null); - - /** MethodDescriptorProto outputType */ - outputType?: (string|null); - - /** MethodDescriptorProto options */ - options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming */ - clientStreaming?: (boolean|null); - - /** MethodDescriptorProto serverStreaming */ - serverStreaming?: (boolean|null); - } - - /** Represents a MethodDescriptorProto. */ - class MethodDescriptorProto implements IMethodDescriptorProto { - - /** - * Constructs a new MethodDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodDescriptorProto); - - /** MethodDescriptorProto name. */ - public name: string; - - /** MethodDescriptorProto inputType. */ - public inputType: string; - - /** MethodDescriptorProto outputType. */ - public outputType: string; - - /** MethodDescriptorProto options. */ - public options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming. */ - public clientStreaming: boolean; - - /** MethodDescriptorProto serverStreaming. */ - public serverStreaming: boolean; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodDescriptorProto instance - */ - public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; - - /** - * Verifies a MethodDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @param message MethodDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FileOptions. */ - interface IFileOptions { - - /** FileOptions javaPackage */ - javaPackage?: (string|null); - - /** FileOptions javaOuterClassname */ - javaOuterClassname?: (string|null); - - /** FileOptions javaMultipleFiles */ - javaMultipleFiles?: (boolean|null); - - /** FileOptions javaGenerateEqualsAndHash */ - javaGenerateEqualsAndHash?: (boolean|null); - - /** FileOptions javaStringCheckUtf8 */ - javaStringCheckUtf8?: (boolean|null); - - /** FileOptions optimizeFor */ - optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); - - /** FileOptions goPackage */ - goPackage?: (string|null); - - /** FileOptions ccGenericServices */ - ccGenericServices?: (boolean|null); - - /** FileOptions javaGenericServices */ - javaGenericServices?: (boolean|null); - - /** FileOptions pyGenericServices */ - pyGenericServices?: (boolean|null); - - /** FileOptions deprecated */ - deprecated?: (boolean|null); - - /** FileOptions ccEnableArenas */ - ccEnableArenas?: (boolean|null); - - /** FileOptions objcClassPrefix */ - objcClassPrefix?: (string|null); - - /** FileOptions csharpNamespace */ - csharpNamespace?: (string|null); - - /** FileOptions swiftPrefix */ - swiftPrefix?: (string|null); - - /** FileOptions phpClassPrefix */ - phpClassPrefix?: (string|null); - - /** FileOptions phpNamespace */ - phpNamespace?: (string|null); - - /** FileOptions phpMetadataNamespace */ - phpMetadataNamespace?: (string|null); - - /** FileOptions rubyPackage */ - rubyPackage?: (string|null); - - /** FileOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** FileOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FileOptions .google.api.resourceDefinition */ - ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); - } - - /** Represents a FileOptions. */ - class FileOptions implements IFileOptions { - - /** - * Constructs a new FileOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileOptions); - - /** FileOptions javaPackage. */ - public javaPackage: string; - - /** FileOptions javaOuterClassname. */ - public javaOuterClassname: string; - - /** FileOptions javaMultipleFiles. */ - public javaMultipleFiles: boolean; - - /** FileOptions javaGenerateEqualsAndHash. */ - public javaGenerateEqualsAndHash: boolean; - - /** FileOptions javaStringCheckUtf8. */ - public javaStringCheckUtf8: boolean; - - /** FileOptions optimizeFor. */ - public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); - - /** FileOptions goPackage. */ - public goPackage: string; - - /** FileOptions ccGenericServices. */ - public ccGenericServices: boolean; - - /** FileOptions javaGenericServices. */ - public javaGenericServices: boolean; - - /** FileOptions pyGenericServices. */ - public pyGenericServices: boolean; - - /** FileOptions deprecated. */ - public deprecated: boolean; - - /** FileOptions ccEnableArenas. */ - public ccEnableArenas: boolean; - - /** FileOptions objcClassPrefix. */ - public objcClassPrefix: string; - - /** FileOptions csharpNamespace. */ - public csharpNamespace: string; - - /** FileOptions swiftPrefix. */ - public swiftPrefix: string; - - /** FileOptions phpClassPrefix. */ - public phpClassPrefix: string; - - /** FileOptions phpNamespace. */ - public phpNamespace: string; - - /** FileOptions phpMetadataNamespace. */ - public phpMetadataNamespace: string; - - /** FileOptions rubyPackage. */ - public rubyPackage: string; - - /** FileOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** FileOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FileOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FileOptions instance - */ - public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; - - /** - * Verifies a FileOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @param message FileOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FileOptions { - - /** OptimizeMode enum. */ - enum OptimizeMode { - SPEED = 1, - CODE_SIZE = 2, - LITE_RUNTIME = 3 - } - } - - /** Properties of a MessageOptions. */ - interface IMessageOptions { - - /** MessageOptions messageSetWireFormat */ - messageSetWireFormat?: (boolean|null); - - /** MessageOptions noStandardDescriptorAccessor */ - noStandardDescriptorAccessor?: (boolean|null); - - /** MessageOptions deprecated */ - deprecated?: (boolean|null); - - /** MessageOptions mapEntry */ - mapEntry?: (boolean|null); - - /** MessageOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** MessageOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** MessageOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MessageOptions .google.api.resource */ - ".google.api.resource"?: (google.api.IResourceDescriptor|null); - } - - /** Represents a MessageOptions. */ - class MessageOptions implements IMessageOptions { - - /** - * Constructs a new MessageOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMessageOptions); - - /** MessageOptions messageSetWireFormat. */ - public messageSetWireFormat: boolean; - - /** MessageOptions noStandardDescriptorAccessor. */ - public noStandardDescriptorAccessor: boolean; - - /** MessageOptions deprecated. */ - public deprecated: boolean; - - /** MessageOptions mapEntry. */ - public mapEntry: boolean; - - /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; - - /** MessageOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** MessageOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MessageOptions instance - */ - public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; - - /** - * Verifies a MessageOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MessageOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @param message MessageOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MessageOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MessageOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FieldOptions. */ - interface IFieldOptions { - - /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); - - /** FieldOptions packed */ - packed?: (boolean|null); - - /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); - - /** FieldOptions lazy */ - lazy?: (boolean|null); - - /** FieldOptions unverifiedLazy */ - unverifiedLazy?: (boolean|null); - - /** FieldOptions deprecated */ - deprecated?: (boolean|null); - - /** FieldOptions weak */ - weak?: (boolean|null); - - /** FieldOptions debugRedact */ - debugRedact?: (boolean|null); - - /** FieldOptions retention */ - retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); - - /** FieldOptions targets */ - targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); - - /** FieldOptions editionDefaults */ - editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); - - /** FieldOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** FieldOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FieldOptions .google.api.fieldBehavior */ - ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); - - /** FieldOptions .google.api.fieldInfo */ - ".google.api.fieldInfo"?: (google.api.IFieldInfo|null); - - /** FieldOptions .google.api.resourceReference */ - ".google.api.resourceReference"?: (google.api.IResourceReference|null); - } - - /** Represents a FieldOptions. */ - class FieldOptions implements IFieldOptions { - - /** - * Constructs a new FieldOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldOptions); - - /** FieldOptions ctype. */ - public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); - - /** FieldOptions packed. */ - public packed: boolean; - - /** FieldOptions jstype. */ - public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); - - /** FieldOptions lazy. */ - public lazy: boolean; - - /** FieldOptions unverifiedLazy. */ - public unverifiedLazy: boolean; - - /** FieldOptions deprecated. */ - public deprecated: boolean; - - /** FieldOptions weak. */ - public weak: boolean; - - /** FieldOptions debugRedact. */ - public debugRedact: boolean; - - /** FieldOptions retention. */ - public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); - - /** FieldOptions targets. */ - public targets: google.protobuf.FieldOptions.OptionTargetType[]; - - /** FieldOptions editionDefaults. */ - public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; - - /** FieldOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** FieldOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldOptions instance - */ - public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; - - /** - * Verifies a FieldOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @param message FieldOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldOptions { - - /** CType enum. */ - enum CType { - STRING = 0, - CORD = 1, - STRING_PIECE = 2 - } - - /** JSType enum. */ - enum JSType { - JS_NORMAL = 0, - JS_STRING = 1, - JS_NUMBER = 2 - } - - /** OptionRetention enum. */ - enum OptionRetention { - RETENTION_UNKNOWN = 0, - RETENTION_RUNTIME = 1, - RETENTION_SOURCE = 2 - } - - /** OptionTargetType enum. */ - enum OptionTargetType { - TARGET_TYPE_UNKNOWN = 0, - TARGET_TYPE_FILE = 1, - TARGET_TYPE_EXTENSION_RANGE = 2, - TARGET_TYPE_MESSAGE = 3, - TARGET_TYPE_FIELD = 4, - TARGET_TYPE_ONEOF = 5, - TARGET_TYPE_ENUM = 6, - TARGET_TYPE_ENUM_ENTRY = 7, - TARGET_TYPE_SERVICE = 8, - TARGET_TYPE_METHOD = 9 - } - - /** Properties of an EditionDefault. */ - interface IEditionDefault { - - /** EditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** EditionDefault value */ - value?: (string|null); - } - - /** Represents an EditionDefault. */ - class EditionDefault implements IEditionDefault { - - /** - * Constructs a new EditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); - - /** EditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** EditionDefault value. */ - public value: string; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns EditionDefault instance - */ - public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; - - /** - * Verifies an EditionDefault message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @param message EditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an OneofOptions. */ - interface IOneofOptions { - - /** OneofOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** OneofOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an OneofOptions. */ - class OneofOptions implements IOneofOptions { - - /** - * Constructs a new OneofOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofOptions); - - /** OneofOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** OneofOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofOptions instance - */ - public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; - - /** - * Verifies an OneofOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @param message OneofOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OneofOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumOptions. */ - interface IEnumOptions { - - /** EnumOptions allowAlias */ - allowAlias?: (boolean|null); - - /** EnumOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** EnumOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** EnumOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumOptions. */ - class EnumOptions implements IEnumOptions { - - /** - * Constructs a new EnumOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumOptions); - - /** EnumOptions allowAlias. */ - public allowAlias: boolean; - - /** EnumOptions deprecated. */ - public deprecated: boolean; - - /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; - - /** EnumOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** EnumOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumOptions instance - */ - public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; - - /** - * Verifies an EnumOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @param message EnumOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumValueOptions. */ - interface IEnumValueOptions { - - /** EnumValueOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumValueOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact */ - debugRedact?: (boolean|null); - - /** EnumValueOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumValueOptions. */ - class EnumValueOptions implements IEnumValueOptions { - - /** - * Constructs a new EnumValueOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueOptions); - - /** EnumValueOptions deprecated. */ - public deprecated: boolean; - - /** EnumValueOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact. */ - public debugRedact: boolean; - - /** EnumValueOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueOptions instance - */ - public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; - - /** - * Verifies an EnumValueOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @param message EnumValueOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceOptions. */ - interface IServiceOptions { - - /** ServiceOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** ServiceOptions deprecated */ - deprecated?: (boolean|null); - - /** ServiceOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ServiceOptions .google.api.defaultHost */ - ".google.api.defaultHost"?: (string|null); - - /** ServiceOptions .google.api.oauthScopes */ - ".google.api.oauthScopes"?: (string|null); - - /** ServiceOptions .google.api.apiVersion */ - ".google.api.apiVersion"?: (string|null); - } - - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { - - /** - * Constructs a new ServiceOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceOptions); - - /** ServiceOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** ServiceOptions deprecated. */ - public deprecated: boolean; - - /** ServiceOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceOptions instance - */ - public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; - - /** - * Verifies a ServiceOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @param message ServiceOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodOptions. */ - interface IMethodOptions { - - /** MethodOptions deprecated */ - deprecated?: (boolean|null); - - /** MethodOptions idempotencyLevel */ - idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); - - /** MethodOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** MethodOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MethodOptions .google.api.http */ - ".google.api.http"?: (google.api.IHttpRule|null); - - /** MethodOptions .google.api.methodSignature */ - ".google.api.methodSignature"?: (string[]|null); - - /** MethodOptions .google.longrunning.operationInfo */ - ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); - } - - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { - - /** - * Constructs a new MethodOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodOptions); - - /** MethodOptions deprecated. */ - public deprecated: boolean; - - /** MethodOptions idempotencyLevel. */ - public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); - - /** MethodOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** MethodOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MethodOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodOptions instance - */ - public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; - - /** - * Verifies a MethodOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @param message MethodOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MethodOptions { - - /** IdempotencyLevel enum. */ - enum IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0, - NO_SIDE_EFFECTS = 1, - IDEMPOTENT = 2 - } - } - - /** Properties of an UninterpretedOption. */ - interface IUninterpretedOption { - - /** UninterpretedOption name */ - name?: (google.protobuf.UninterpretedOption.INamePart[]|null); - - /** UninterpretedOption identifierValue */ - identifierValue?: (string|null); - - /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|Long|string|null); - - /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|Long|string|null); - - /** UninterpretedOption doubleValue */ - doubleValue?: (number|null); - - /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|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|string); - - /** UninterpretedOption aggregateValue. */ - public aggregateValue: string; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @param [properties] Properties to set - * @returns UninterpretedOption instance - */ - public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; - - /** - * Verifies an UninterpretedOption message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UninterpretedOption - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @param message UninterpretedOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UninterpretedOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UninterpretedOption - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace UninterpretedOption { - - /** Properties of a NamePart. */ - interface INamePart { - - /** NamePart namePart */ - namePart: string; - - /** NamePart isExtension */ - isExtension: boolean; - } - - /** Represents a NamePart. */ - class NamePart implements INamePart { - - /** - * Constructs a new NamePart. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.UninterpretedOption.INamePart); - - /** NamePart namePart. */ - public namePart: string; - - /** NamePart isExtension. */ - public isExtension: boolean; - - /** - * Creates a new NamePart instance using the specified properties. - * @param [properties] Properties to set - * @returns NamePart instance - */ - public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; - - /** - * Verifies a NamePart message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NamePart - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @param message NamePart - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NamePart to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NamePart - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a FeatureSet. */ - interface IFeatureSet { - - /** FeatureSet fieldPresence */ - fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); - - /** FeatureSet enumType */ - enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); - - /** FeatureSet repeatedFieldEncoding */ - repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); - - /** FeatureSet utf8Validation */ - utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); - - /** FeatureSet messageEncoding */ - messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); - - /** FeatureSet jsonFormat */ - jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); - } - - /** Represents a FeatureSet. */ - class FeatureSet implements IFeatureSet { - - /** - * Constructs a new FeatureSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSet); - - /** FeatureSet fieldPresence. */ - public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); - - /** FeatureSet enumType. */ - public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); - - /** FeatureSet repeatedFieldEncoding. */ - public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); - - /** FeatureSet utf8Validation. */ - public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); - - /** FeatureSet messageEncoding. */ - public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); - - /** FeatureSet jsonFormat. */ - public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); - - /** - * Creates a new FeatureSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSet instance - */ - public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; - - /** - * Verifies a FeatureSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @param message FeatureSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSet { - - /** FieldPresence enum. */ - enum FieldPresence { - FIELD_PRESENCE_UNKNOWN = 0, - EXPLICIT = 1, - IMPLICIT = 2, - LEGACY_REQUIRED = 3 - } - - /** EnumType enum. */ - enum EnumType { - ENUM_TYPE_UNKNOWN = 0, - OPEN = 1, - CLOSED = 2 - } - - /** RepeatedFieldEncoding enum. */ - enum RepeatedFieldEncoding { - REPEATED_FIELD_ENCODING_UNKNOWN = 0, - PACKED = 1, - EXPANDED = 2 - } - - /** Utf8Validation enum. */ - enum Utf8Validation { - UTF8_VALIDATION_UNKNOWN = 0, - VERIFY = 2, - NONE = 3 - } - - /** MessageEncoding enum. */ - enum MessageEncoding { - MESSAGE_ENCODING_UNKNOWN = 0, - LENGTH_PREFIXED = 1, - DELIMITED = 2 - } - - /** JsonFormat enum. */ - enum JsonFormat { - JSON_FORMAT_UNKNOWN = 0, - ALLOW = 1, - LEGACY_BEST_EFFORT = 2 - } - } - - /** Properties of a FeatureSetDefaults. */ - interface IFeatureSetDefaults { - - /** FeatureSetDefaults defaults */ - defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); - - /** FeatureSetDefaults minimumEdition */ - minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetDefaults maximumEdition */ - maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FeatureSetDefaults. */ - class FeatureSetDefaults implements IFeatureSetDefaults { - - /** - * Constructs a new FeatureSetDefaults. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSetDefaults); - - /** FeatureSetDefaults defaults. */ - public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; - - /** FeatureSetDefaults minimumEdition. */ - public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetDefaults maximumEdition. */ - public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetDefaults instance - */ - public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; - - /** - * Verifies a FeatureSetDefaults message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetDefaults - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @param message FeatureSetDefaults - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetDefaults - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSetDefaults { - - /** Properties of a FeatureSetEditionDefault. */ - interface IFeatureSetEditionDefault { - - /** FeatureSetEditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetEditionDefault features */ - features?: (google.protobuf.IFeatureSet|null); - } - - /** Represents a FeatureSetEditionDefault. */ - class FeatureSetEditionDefault implements IFeatureSetEditionDefault { - - /** - * Constructs a new FeatureSetEditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); - - /** FeatureSetEditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetEditionDefault features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetEditionDefault instance - */ - public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Verifies a FeatureSetEditionDefault message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetEditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @param message FeatureSetEditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a SourceCodeInfo. */ - interface ISourceCodeInfo { - - /** SourceCodeInfo location */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); - } - - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { - - /** - * Constructs a new SourceCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ISourceCodeInfo); - - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns SourceCodeInfo instance - */ - public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; - - /** - * Verifies a SourceCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SourceCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @param message SourceCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SourceCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SourceCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SourceCodeInfo { - - /** Properties of a Location. */ - interface ILocation { - - /** Location path */ - path?: (number[]|null); - - /** Location span */ - span?: (number[]|null); - - /** Location leadingComments */ - leadingComments?: (string|null); - - /** Location trailingComments */ - trailingComments?: (string|null); - - /** Location leadingDetachedComments */ - leadingDetachedComments?: (string[]|null); - } - - /** Represents a Location. */ - class Location implements ILocation { - - /** - * Constructs a new Location. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); - - /** Location path. */ - public path: number[]; - - /** Location span. */ - public span: number[]; - - /** Location leadingComments. */ - public leadingComments: string; - - /** Location trailingComments. */ - public trailingComments: string; - - /** Location leadingDetachedComments. */ - public leadingDetachedComments: string[]; - - /** - * Creates a new Location instance using the specified properties. - * @param [properties] Properties to set - * @returns Location instance - */ - public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Location message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; - - /** - * Verifies a Location message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Location - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @param message Location - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Location to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Location - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a GeneratedCodeInfo. */ - interface IGeneratedCodeInfo { - - /** GeneratedCodeInfo annotation */ - annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); - } - - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { - - /** - * Constructs a new GeneratedCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IGeneratedCodeInfo); - - /** GeneratedCodeInfo annotation. */ - public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns GeneratedCodeInfo instance - */ - public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; - - /** - * Verifies a GeneratedCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GeneratedCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @param message GeneratedCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace GeneratedCodeInfo { - - /** Properties of an Annotation. */ - interface IAnnotation { - - /** Annotation path */ - path?: (number[]|null); - - /** Annotation sourceFile */ - sourceFile?: (string|null); - - /** Annotation begin */ - begin?: (number|null); - - /** Annotation end */ - end?: (number|null); - - /** Annotation semantic */ - semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); - } - - /** Represents an Annotation. */ - class Annotation implements IAnnotation { - - /** - * Constructs a new Annotation. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); - - /** Annotation path. */ - public path: number[]; - - /** Annotation sourceFile. */ - public sourceFile: string; - - /** Annotation begin. */ - public begin: number; - - /** Annotation end. */ - public end: number; - - /** Annotation semantic. */ - public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); - - /** - * Creates a new Annotation instance using the specified properties. - * @param [properties] Properties to set - * @returns Annotation instance - */ - public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Verifies an Annotation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Annotation - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @param message Annotation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Annotation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Annotation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Annotation { - - /** Semantic enum. */ - enum Semantic { - NONE = 0, - SET = 1, - ALIAS = 2 - } - } - } - - /** Properties of a Duration. */ - interface IDuration { - - /** Duration seconds */ - seconds?: (number|Long|string|null); - - /** Duration nanos */ - nanos?: (number|null); - } - - /** Represents a Duration. */ - class Duration implements IDuration { - - /** - * Constructs a new Duration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDuration); - - /** Duration seconds. */ - public seconds: (number|Long|string); - - /** Duration nanos. */ - public nanos: number; - - /** - * Creates a new Duration instance using the specified properties. - * @param [properties] Properties to set - * @returns Duration instance - */ - public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; - - /** - * Verifies a Duration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Duration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @param message Duration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Duration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Duration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of 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 an Any. */ - interface IAny { - - /** Any type_url */ - type_url?: (string|null); - - /** Any value */ - value?: (Uint8Array|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|string); - - /** - * Creates a new Any instance using the specified properties. - * @param [properties] Properties to set - * @returns Any instance - */ - public static create(properties?: google.protobuf.IAny): google.protobuf.Any; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Any message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; - - /** - * Verifies an Any message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Any - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Any; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @param message Any - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Any to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Any - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Empty. */ - interface IEmpty { - } - - /** Represents an Empty. */ - class Empty implements IEmpty { - - /** - * Constructs a new Empty. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEmpty); - - /** - * Creates a new Empty instance using the specified properties. - * @param [properties] Properties to set - * @returns Empty instance - */ - public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; - - /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Empty message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; - - /** - * Decodes an Empty message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; - - /** - * Verifies an Empty message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Empty - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; - - /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @param message Empty - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Empty to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Empty - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace longrunning. */ - namespace longrunning { - - /** Represents an Operations */ - class Operations extends $protobuf.rpc.Service { - - /** - * Constructs a new Operations service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new Operations service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; - - /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListOperationsResponse - */ - public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; - - /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @returns Promise - */ - public listOperations(request: google.longrunning.IListOperationsRequest): Promise; - - /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; - - /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @returns Promise - */ - public getOperation(request: google.longrunning.IGetOperationRequest): Promise; - - /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; - - /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @returns Promise - */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; - - /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; - - /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @returns Promise - */ - public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; - - /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; - - /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @returns Promise - */ - public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; - } - - namespace Operations { - - /** - * Callback as used by {@link google.longrunning.Operations|listOperations}. - * @param error Error, if any - * @param [response] ListOperationsResponse - */ - type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|getOperation}. - * @param error Error, if any - * @param [response] Operation - */ - type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|deleteOperation}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|cancelOperation}. - * @param error Error, if any - * @param [response] Empty - */ - type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|waitOperation}. - * @param error Error, if any - * @param [response] Operation - */ - type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of an Operation. */ - interface IOperation { - - /** Operation name */ - name?: (string|null); - - /** Operation metadata */ - metadata?: (google.protobuf.IAny|null); - - /** Operation done */ - done?: (boolean|null); - - /** Operation error */ - error?: (google.rpc.IStatus|null); - - /** Operation response */ - response?: (google.protobuf.IAny|null); - } - - /** Represents an Operation. */ - class Operation implements IOperation { - - /** - * Constructs a new Operation. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IOperation); - - /** Operation name. */ - public name: string; - - /** Operation metadata. */ - public metadata?: (google.protobuf.IAny|null); - - /** Operation done. */ - public done: boolean; - - /** Operation error. */ - public error?: (google.rpc.IStatus|null); - - /** Operation response. */ - public response?: (google.protobuf.IAny|null); - - /** Operation result. */ - public result?: ("error"|"response"); - - /** - * Creates a new Operation instance using the specified properties. - * @param [properties] Properties to set - * @returns Operation instance - */ - public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; - - /** - * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @param message Operation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @param message Operation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Operation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; - - /** - * Decodes an Operation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; - - /** - * Verifies an Operation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Operation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Operation - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; - - /** - * Creates a plain object from an Operation message. Also converts values to other types if specified. - * @param message Operation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Operation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Operation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetOperationRequest. */ - interface IGetOperationRequest { - - /** GetOperationRequest name */ - name?: (string|null); - } - - /** Represents a GetOperationRequest. */ - class GetOperationRequest implements IGetOperationRequest { - - /** - * Constructs a new GetOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IGetOperationRequest); - - /** GetOperationRequest name. */ - public name: string; - - /** - * Creates a new GetOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetOperationRequest instance - */ - public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; - - /** - * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @param message GetOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @param message GetOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; - - /** - * Verifies a GetOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; - - /** - * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. - * @param message GetOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListOperationsRequest. */ - interface IListOperationsRequest { - - /** ListOperationsRequest name */ - name?: (string|null); - - /** ListOperationsRequest filter */ - filter?: (string|null); - - /** ListOperationsRequest pageSize */ - pageSize?: (number|null); - - /** ListOperationsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListOperationsRequest. */ - class ListOperationsRequest implements IListOperationsRequest { - - /** - * Constructs a new ListOperationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IListOperationsRequest); - - /** ListOperationsRequest name. */ - public name: string; - - /** ListOperationsRequest filter. */ - public filter: string; - - /** ListOperationsRequest pageSize. */ - public pageSize: number; - - /** ListOperationsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListOperationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListOperationsRequest instance - */ - public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; - - /** - * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @param message ListOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @param message ListOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; - - /** - * Verifies a ListOperationsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListOperationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; - - /** - * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. - * @param message ListOperationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListOperationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListOperationsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListOperationsResponse. */ - interface IListOperationsResponse { - - /** ListOperationsResponse operations */ - operations?: (google.longrunning.IOperation[]|null); - - /** ListOperationsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListOperationsResponse. */ - class ListOperationsResponse implements IListOperationsResponse { - - /** - * Constructs a new ListOperationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IListOperationsResponse); - - /** ListOperationsResponse operations. */ - public operations: google.longrunning.IOperation[]; - - /** ListOperationsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListOperationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListOperationsResponse instance - */ - public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; - - /** - * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @param message ListOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @param message ListOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; - - /** - * Verifies a ListOperationsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListOperationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; - - /** - * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. - * @param message ListOperationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListOperationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListOperationsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CancelOperationRequest. */ - interface ICancelOperationRequest { - - /** CancelOperationRequest name */ - name?: (string|null); - } - - /** Represents a CancelOperationRequest. */ - class CancelOperationRequest implements ICancelOperationRequest { - - /** - * Constructs a new CancelOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.ICancelOperationRequest); - - /** CancelOperationRequest name. */ - public name: string; - - /** - * Creates a new CancelOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CancelOperationRequest instance - */ - public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; - - /** - * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @param message CancelOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @param message CancelOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; - - /** - * Verifies a CancelOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CancelOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; - - /** - * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. - * @param message CancelOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CancelOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CancelOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteOperationRequest. */ - interface IDeleteOperationRequest { - - /** DeleteOperationRequest name */ - name?: (string|null); - } - - /** Represents a DeleteOperationRequest. */ - class DeleteOperationRequest implements IDeleteOperationRequest { - - /** - * Constructs a new DeleteOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IDeleteOperationRequest); - - /** DeleteOperationRequest name. */ - public name: string; - - /** - * Creates a new DeleteOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteOperationRequest instance - */ - public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; - - /** - * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @param message DeleteOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @param message DeleteOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; - - /** - * Verifies a DeleteOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; - - /** - * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. - * @param message DeleteOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a WaitOperationRequest. */ - interface IWaitOperationRequest { - - /** WaitOperationRequest name */ - name?: (string|null); - - /** WaitOperationRequest timeout */ - timeout?: (google.protobuf.IDuration|null); - } - - /** Represents a WaitOperationRequest. */ - class WaitOperationRequest implements IWaitOperationRequest { - - /** - * Constructs a new WaitOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IWaitOperationRequest); - - /** WaitOperationRequest name. */ - public name: string; - - /** WaitOperationRequest timeout. */ - public timeout?: (google.protobuf.IDuration|null); - - /** - * Creates a new WaitOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns WaitOperationRequest instance - */ - public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; - - /** - * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @param message WaitOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @param message WaitOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; - - /** - * Verifies a WaitOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WaitOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; - - /** - * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. - * @param message WaitOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WaitOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WaitOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OperationInfo. */ - interface IOperationInfo { - - /** OperationInfo responseType */ - responseType?: (string|null); - - /** OperationInfo metadataType */ - metadataType?: (string|null); - } - - /** Represents an OperationInfo. */ - class OperationInfo implements IOperationInfo { - - /** - * Constructs a new OperationInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IOperationInfo); - - /** OperationInfo responseType. */ - public responseType: string; - - /** OperationInfo metadataType. */ - public metadataType: string; - - /** - * Creates a new OperationInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns OperationInfo instance - */ - public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; - - /** - * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @param message OperationInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @param message OperationInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OperationInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; - - /** - * Decodes an OperationInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; - - /** - * Verifies an OperationInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OperationInfo - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; - - /** - * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. - * @param message OperationInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OperationInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OperationInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace rpc. */ - namespace rpc { - - /** Properties of a Status. */ - interface IStatus { - - /** Status code */ - code?: (number|null); - - /** Status message */ - message?: (string|null); - - /** Status details */ - details?: (google.protobuf.IAny[]|null); - } - - /** Represents a Status. */ - class Status implements IStatus { - - /** - * Constructs a new Status. - * @param [properties] Properties to set - */ - constructor(properties?: google.rpc.IStatus); - - /** Status code. */ - public code: number; - - /** Status message. */ - public message: string; - - /** Status details. */ - public details: google.protobuf.IAny[]; - - /** - * Creates a new Status instance using the specified properties. - * @param [properties] Properties to set - * @returns Status instance - */ - public static create(properties?: google.rpc.IStatus): google.rpc.Status; - - /** - * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @param message Status message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @param message Status message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Status message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; - - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; - - /** - * Verifies a Status message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Status - */ - public static fromObject(object: { [k: string]: any }): google.rpc.Status; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @param message Status - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Status to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Status - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } -} diff --git a/owl-bot-staging/google-cloud-batch/v1/protos/protos.js b/owl-bot-staging/google-cloud-batch/v1/protos/protos.js deleted file mode 100644 index 6d87f323961..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/protos/protos.js +++ /dev/null @@ -1,35612 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*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_batch_protos || ($protobuf.roots._google_cloud_batch_protos = {}); - - $root.google = (function() { - - /** - * Namespace google. - * @exports google - * @namespace - */ - var google = {}; - - google.cloud = (function() { - - /** - * Namespace cloud. - * @memberof google - * @namespace - */ - var cloud = {}; - - cloud.batch = (function() { - - /** - * Namespace batch. - * @memberof google.cloud - * @namespace - */ - var batch = {}; - - batch.v1 = (function() { - - /** - * Namespace v1. - * @memberof google.cloud.batch - * @namespace - */ - var v1 = {}; - - v1.BatchService = (function() { - - /** - * Constructs a new BatchService service. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a BatchService - * @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 BatchService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (BatchService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = BatchService; - - /** - * Creates new BatchService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.batch.v1.BatchService - * @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 {BatchService} RPC service. Useful where requests and/or responses are streamed. - */ - BatchService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.batch.v1.BatchService|createJob}. - * @memberof google.cloud.batch.v1.BatchService - * @typedef CreateJobCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.batch.v1.Job} [response] Job - */ - - /** - * Calls CreateJob. - * @function createJob - * @memberof google.cloud.batch.v1.BatchService - * @instance - * @param {google.cloud.batch.v1.ICreateJobRequest} request CreateJobRequest message or plain object - * @param {google.cloud.batch.v1.BatchService.CreateJobCallback} callback Node-style callback called with the error, if any, and Job - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.createJob = function createJob(request, callback) { - return this.rpcCall(createJob, $root.google.cloud.batch.v1.CreateJobRequest, $root.google.cloud.batch.v1.Job, request, callback); - }, "name", { value: "CreateJob" }); - - /** - * Calls CreateJob. - * @function createJob - * @memberof google.cloud.batch.v1.BatchService - * @instance - * @param {google.cloud.batch.v1.ICreateJobRequest} request CreateJobRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.batch.v1.BatchService|getJob}. - * @memberof google.cloud.batch.v1.BatchService - * @typedef GetJobCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.batch.v1.Job} [response] Job - */ - - /** - * Calls GetJob. - * @function getJob - * @memberof google.cloud.batch.v1.BatchService - * @instance - * @param {google.cloud.batch.v1.IGetJobRequest} request GetJobRequest message or plain object - * @param {google.cloud.batch.v1.BatchService.GetJobCallback} callback Node-style callback called with the error, if any, and Job - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.getJob = function getJob(request, callback) { - return this.rpcCall(getJob, $root.google.cloud.batch.v1.GetJobRequest, $root.google.cloud.batch.v1.Job, request, callback); - }, "name", { value: "GetJob" }); - - /** - * Calls GetJob. - * @function getJob - * @memberof google.cloud.batch.v1.BatchService - * @instance - * @param {google.cloud.batch.v1.IGetJobRequest} request GetJobRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.batch.v1.BatchService|deleteJob}. - * @memberof google.cloud.batch.v1.BatchService - * @typedef DeleteJobCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteJob. - * @function deleteJob - * @memberof google.cloud.batch.v1.BatchService - * @instance - * @param {google.cloud.batch.v1.IDeleteJobRequest} request DeleteJobRequest message or plain object - * @param {google.cloud.batch.v1.BatchService.DeleteJobCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.deleteJob = function deleteJob(request, callback) { - return this.rpcCall(deleteJob, $root.google.cloud.batch.v1.DeleteJobRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteJob" }); - - /** - * Calls DeleteJob. - * @function deleteJob - * @memberof google.cloud.batch.v1.BatchService - * @instance - * @param {google.cloud.batch.v1.IDeleteJobRequest} request DeleteJobRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.batch.v1.BatchService|listJobs}. - * @memberof google.cloud.batch.v1.BatchService - * @typedef ListJobsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.batch.v1.ListJobsResponse} [response] ListJobsResponse - */ - - /** - * Calls ListJobs. - * @function listJobs - * @memberof google.cloud.batch.v1.BatchService - * @instance - * @param {google.cloud.batch.v1.IListJobsRequest} request ListJobsRequest message or plain object - * @param {google.cloud.batch.v1.BatchService.ListJobsCallback} callback Node-style callback called with the error, if any, and ListJobsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.listJobs = function listJobs(request, callback) { - return this.rpcCall(listJobs, $root.google.cloud.batch.v1.ListJobsRequest, $root.google.cloud.batch.v1.ListJobsResponse, request, callback); - }, "name", { value: "ListJobs" }); - - /** - * Calls ListJobs. - * @function listJobs - * @memberof google.cloud.batch.v1.BatchService - * @instance - * @param {google.cloud.batch.v1.IListJobsRequest} request ListJobsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.batch.v1.BatchService|getTask}. - * @memberof google.cloud.batch.v1.BatchService - * @typedef GetTaskCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.batch.v1.Task} [response] Task - */ - - /** - * Calls GetTask. - * @function getTask - * @memberof google.cloud.batch.v1.BatchService - * @instance - * @param {google.cloud.batch.v1.IGetTaskRequest} request GetTaskRequest message or plain object - * @param {google.cloud.batch.v1.BatchService.GetTaskCallback} callback Node-style callback called with the error, if any, and Task - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.getTask = function getTask(request, callback) { - return this.rpcCall(getTask, $root.google.cloud.batch.v1.GetTaskRequest, $root.google.cloud.batch.v1.Task, request, callback); - }, "name", { value: "GetTask" }); - - /** - * Calls GetTask. - * @function getTask - * @memberof google.cloud.batch.v1.BatchService - * @instance - * @param {google.cloud.batch.v1.IGetTaskRequest} request GetTaskRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.batch.v1.BatchService|listTasks}. - * @memberof google.cloud.batch.v1.BatchService - * @typedef ListTasksCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.batch.v1.ListTasksResponse} [response] ListTasksResponse - */ - - /** - * Calls ListTasks. - * @function listTasks - * @memberof google.cloud.batch.v1.BatchService - * @instance - * @param {google.cloud.batch.v1.IListTasksRequest} request ListTasksRequest message or plain object - * @param {google.cloud.batch.v1.BatchService.ListTasksCallback} callback Node-style callback called with the error, if any, and ListTasksResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.listTasks = function listTasks(request, callback) { - return this.rpcCall(listTasks, $root.google.cloud.batch.v1.ListTasksRequest, $root.google.cloud.batch.v1.ListTasksResponse, request, callback); - }, "name", { value: "ListTasks" }); - - /** - * Calls ListTasks. - * @function listTasks - * @memberof google.cloud.batch.v1.BatchService - * @instance - * @param {google.cloud.batch.v1.IListTasksRequest} request ListTasksRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return BatchService; - })(); - - v1.CreateJobRequest = (function() { - - /** - * Properties of a CreateJobRequest. - * @memberof google.cloud.batch.v1 - * @interface ICreateJobRequest - * @property {string|null} [parent] CreateJobRequest parent - * @property {string|null} [jobId] CreateJobRequest jobId - * @property {google.cloud.batch.v1.IJob|null} [job] CreateJobRequest job - * @property {string|null} [requestId] CreateJobRequest requestId - */ - - /** - * Constructs a new CreateJobRequest. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a CreateJobRequest. - * @implements ICreateJobRequest - * @constructor - * @param {google.cloud.batch.v1.ICreateJobRequest=} [properties] Properties to set - */ - function CreateJobRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateJobRequest parent. - * @member {string} parent - * @memberof google.cloud.batch.v1.CreateJobRequest - * @instance - */ - CreateJobRequest.prototype.parent = ""; - - /** - * CreateJobRequest jobId. - * @member {string} jobId - * @memberof google.cloud.batch.v1.CreateJobRequest - * @instance - */ - CreateJobRequest.prototype.jobId = ""; - - /** - * CreateJobRequest job. - * @member {google.cloud.batch.v1.IJob|null|undefined} job - * @memberof google.cloud.batch.v1.CreateJobRequest - * @instance - */ - CreateJobRequest.prototype.job = null; - - /** - * CreateJobRequest requestId. - * @member {string} requestId - * @memberof google.cloud.batch.v1.CreateJobRequest - * @instance - */ - CreateJobRequest.prototype.requestId = ""; - - /** - * Creates a new CreateJobRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.CreateJobRequest - * @static - * @param {google.cloud.batch.v1.ICreateJobRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1.CreateJobRequest} CreateJobRequest instance - */ - CreateJobRequest.create = function create(properties) { - return new CreateJobRequest(properties); - }; - - /** - * Encodes the specified CreateJobRequest message. Does not implicitly {@link google.cloud.batch.v1.CreateJobRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.CreateJobRequest - * @static - * @param {google.cloud.batch.v1.ICreateJobRequest} message CreateJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateJobRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.jobId); - if (message.job != null && Object.hasOwnProperty.call(message, "job")) - $root.google.cloud.batch.v1.Job.encode(message.job, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified CreateJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.CreateJobRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.CreateJobRequest - * @static - * @param {google.cloud.batch.v1.ICreateJobRequest} message CreateJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateJobRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateJobRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.CreateJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.CreateJobRequest} CreateJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateJobRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.CreateJobRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.jobId = reader.string(); - break; - } - case 3: { - message.job = $root.google.cloud.batch.v1.Job.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateJobRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.CreateJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.CreateJobRequest} CreateJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateJobRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateJobRequest message. - * @function verify - * @memberof google.cloud.batch.v1.CreateJobRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateJobRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.jobId != null && message.hasOwnProperty("jobId")) - if (!$util.isString(message.jobId)) - return "jobId: string expected"; - if (message.job != null && message.hasOwnProperty("job")) { - var error = $root.google.cloud.batch.v1.Job.verify(message.job); - if (error) - return "job." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a CreateJobRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.CreateJobRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.CreateJobRequest} CreateJobRequest - */ - CreateJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.CreateJobRequest) - return object; - var message = new $root.google.cloud.batch.v1.CreateJobRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.jobId != null) - message.jobId = String(object.jobId); - if (object.job != null) { - if (typeof object.job !== "object") - throw TypeError(".google.cloud.batch.v1.CreateJobRequest.job: object expected"); - message.job = $root.google.cloud.batch.v1.Job.fromObject(object.job); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a CreateJobRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.CreateJobRequest - * @static - * @param {google.cloud.batch.v1.CreateJobRequest} message CreateJobRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateJobRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.jobId = ""; - object.job = null; - object.requestId = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.jobId != null && message.hasOwnProperty("jobId")) - object.jobId = message.jobId; - if (message.job != null && message.hasOwnProperty("job")) - object.job = $root.google.cloud.batch.v1.Job.toObject(message.job, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this CreateJobRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.CreateJobRequest - * @instance - * @returns {Object.} JSON object - */ - CreateJobRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateJobRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1.CreateJobRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.CreateJobRequest"; - }; - - return CreateJobRequest; - })(); - - v1.GetJobRequest = (function() { - - /** - * Properties of a GetJobRequest. - * @memberof google.cloud.batch.v1 - * @interface IGetJobRequest - * @property {string|null} [name] GetJobRequest name - */ - - /** - * Constructs a new GetJobRequest. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a GetJobRequest. - * @implements IGetJobRequest - * @constructor - * @param {google.cloud.batch.v1.IGetJobRequest=} [properties] Properties to set - */ - function GetJobRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetJobRequest name. - * @member {string} name - * @memberof google.cloud.batch.v1.GetJobRequest - * @instance - */ - GetJobRequest.prototype.name = ""; - - /** - * Creates a new GetJobRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.GetJobRequest - * @static - * @param {google.cloud.batch.v1.IGetJobRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1.GetJobRequest} GetJobRequest instance - */ - GetJobRequest.create = function create(properties) { - return new GetJobRequest(properties); - }; - - /** - * Encodes the specified GetJobRequest message. Does not implicitly {@link google.cloud.batch.v1.GetJobRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.GetJobRequest - * @static - * @param {google.cloud.batch.v1.IGetJobRequest} message GetJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetJobRequest.encode = function encode(message, writer) { - 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 GetJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.GetJobRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.GetJobRequest - * @static - * @param {google.cloud.batch.v1.IGetJobRequest} message GetJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetJobRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetJobRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.GetJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.GetJobRequest} GetJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetJobRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.GetJobRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetJobRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.GetJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.GetJobRequest} GetJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetJobRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetJobRequest message. - * @function verify - * @memberof google.cloud.batch.v1.GetJobRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetJobRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetJobRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.GetJobRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.GetJobRequest} GetJobRequest - */ - GetJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.GetJobRequest) - return object; - var message = new $root.google.cloud.batch.v1.GetJobRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetJobRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.GetJobRequest - * @static - * @param {google.cloud.batch.v1.GetJobRequest} message GetJobRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetJobRequest.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 GetJobRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.GetJobRequest - * @instance - * @returns {Object.} JSON object - */ - GetJobRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetJobRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1.GetJobRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.GetJobRequest"; - }; - - return GetJobRequest; - })(); - - v1.DeleteJobRequest = (function() { - - /** - * Properties of a DeleteJobRequest. - * @memberof google.cloud.batch.v1 - * @interface IDeleteJobRequest - * @property {string|null} [name] DeleteJobRequest name - * @property {string|null} [reason] DeleteJobRequest reason - * @property {string|null} [requestId] DeleteJobRequest requestId - */ - - /** - * Constructs a new DeleteJobRequest. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a DeleteJobRequest. - * @implements IDeleteJobRequest - * @constructor - * @param {google.cloud.batch.v1.IDeleteJobRequest=} [properties] Properties to set - */ - function DeleteJobRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteJobRequest name. - * @member {string} name - * @memberof google.cloud.batch.v1.DeleteJobRequest - * @instance - */ - DeleteJobRequest.prototype.name = ""; - - /** - * DeleteJobRequest reason. - * @member {string} reason - * @memberof google.cloud.batch.v1.DeleteJobRequest - * @instance - */ - DeleteJobRequest.prototype.reason = ""; - - /** - * DeleteJobRequest requestId. - * @member {string} requestId - * @memberof google.cloud.batch.v1.DeleteJobRequest - * @instance - */ - DeleteJobRequest.prototype.requestId = ""; - - /** - * Creates a new DeleteJobRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.DeleteJobRequest - * @static - * @param {google.cloud.batch.v1.IDeleteJobRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1.DeleteJobRequest} DeleteJobRequest instance - */ - DeleteJobRequest.create = function create(properties) { - return new DeleteJobRequest(properties); - }; - - /** - * Encodes the specified DeleteJobRequest message. Does not implicitly {@link google.cloud.batch.v1.DeleteJobRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.DeleteJobRequest - * @static - * @param {google.cloud.batch.v1.IDeleteJobRequest} message DeleteJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteJobRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.reason); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified DeleteJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.DeleteJobRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.DeleteJobRequest - * @static - * @param {google.cloud.batch.v1.IDeleteJobRequest} message DeleteJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteJobRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteJobRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.DeleteJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.DeleteJobRequest} DeleteJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteJobRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.DeleteJobRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.reason = reader.string(); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteJobRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.DeleteJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.DeleteJobRequest} DeleteJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteJobRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteJobRequest message. - * @function verify - * @memberof google.cloud.batch.v1.DeleteJobRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteJobRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.reason != null && message.hasOwnProperty("reason")) - if (!$util.isString(message.reason)) - return "reason: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a DeleteJobRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.DeleteJobRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.DeleteJobRequest} DeleteJobRequest - */ - DeleteJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.DeleteJobRequest) - return object; - var message = new $root.google.cloud.batch.v1.DeleteJobRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.reason != null) - message.reason = String(object.reason); - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a DeleteJobRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.DeleteJobRequest - * @static - * @param {google.cloud.batch.v1.DeleteJobRequest} message DeleteJobRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteJobRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.reason = ""; - object.requestId = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.reason != null && message.hasOwnProperty("reason")) - object.reason = message.reason; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this DeleteJobRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.DeleteJobRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteJobRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteJobRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1.DeleteJobRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.DeleteJobRequest"; - }; - - return DeleteJobRequest; - })(); - - v1.ListJobsRequest = (function() { - - /** - * Properties of a ListJobsRequest. - * @memberof google.cloud.batch.v1 - * @interface IListJobsRequest - * @property {string|null} [parent] ListJobsRequest parent - * @property {string|null} [filter] ListJobsRequest filter - * @property {string|null} [orderBy] ListJobsRequest orderBy - * @property {number|null} [pageSize] ListJobsRequest pageSize - * @property {string|null} [pageToken] ListJobsRequest pageToken - */ - - /** - * Constructs a new ListJobsRequest. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a ListJobsRequest. - * @implements IListJobsRequest - * @constructor - * @param {google.cloud.batch.v1.IListJobsRequest=} [properties] Properties to set - */ - function ListJobsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListJobsRequest parent. - * @member {string} parent - * @memberof google.cloud.batch.v1.ListJobsRequest - * @instance - */ - ListJobsRequest.prototype.parent = ""; - - /** - * ListJobsRequest filter. - * @member {string} filter - * @memberof google.cloud.batch.v1.ListJobsRequest - * @instance - */ - ListJobsRequest.prototype.filter = ""; - - /** - * ListJobsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.batch.v1.ListJobsRequest - * @instance - */ - ListJobsRequest.prototype.orderBy = ""; - - /** - * ListJobsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.batch.v1.ListJobsRequest - * @instance - */ - ListJobsRequest.prototype.pageSize = 0; - - /** - * ListJobsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.batch.v1.ListJobsRequest - * @instance - */ - ListJobsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListJobsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.ListJobsRequest - * @static - * @param {google.cloud.batch.v1.IListJobsRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1.ListJobsRequest} ListJobsRequest instance - */ - ListJobsRequest.create = function create(properties) { - return new ListJobsRequest(properties); - }; - - /** - * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.cloud.batch.v1.ListJobsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.ListJobsRequest - * @static - * @param {google.cloud.batch.v1.IListJobsRequest} message ListJobsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListJobsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; - - /** - * Encodes the specified ListJobsRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ListJobsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.ListJobsRequest - * @static - * @param {google.cloud.batch.v1.IListJobsRequest} message ListJobsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListJobsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.ListJobsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.ListJobsRequest} ListJobsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListJobsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.ListJobsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListJobsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.ListJobsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.ListJobsRequest} ListJobsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListJobsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListJobsRequest message. - * @function verify - * @memberof google.cloud.batch.v1.ListJobsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListJobsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListJobsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.ListJobsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.ListJobsRequest} ListJobsRequest - */ - ListJobsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.ListJobsRequest) - return object; - var message = new $root.google.cloud.batch.v1.ListJobsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListJobsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.ListJobsRequest - * @static - * @param {google.cloud.batch.v1.ListJobsRequest} message ListJobsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListJobsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; - - /** - * Converts this ListJobsRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.ListJobsRequest - * @instance - * @returns {Object.} JSON object - */ - ListJobsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListJobsRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1.ListJobsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListJobsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.ListJobsRequest"; - }; - - return ListJobsRequest; - })(); - - v1.ListJobsResponse = (function() { - - /** - * Properties of a ListJobsResponse. - * @memberof google.cloud.batch.v1 - * @interface IListJobsResponse - * @property {Array.|null} [jobs] ListJobsResponse jobs - * @property {string|null} [nextPageToken] ListJobsResponse nextPageToken - * @property {Array.|null} [unreachable] ListJobsResponse unreachable - */ - - /** - * Constructs a new ListJobsResponse. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a ListJobsResponse. - * @implements IListJobsResponse - * @constructor - * @param {google.cloud.batch.v1.IListJobsResponse=} [properties] Properties to set - */ - function ListJobsResponse(properties) { - this.jobs = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListJobsResponse jobs. - * @member {Array.} jobs - * @memberof google.cloud.batch.v1.ListJobsResponse - * @instance - */ - ListJobsResponse.prototype.jobs = $util.emptyArray; - - /** - * ListJobsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.batch.v1.ListJobsResponse - * @instance - */ - ListJobsResponse.prototype.nextPageToken = ""; - - /** - * ListJobsResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.batch.v1.ListJobsResponse - * @instance - */ - ListJobsResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListJobsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.ListJobsResponse - * @static - * @param {google.cloud.batch.v1.IListJobsResponse=} [properties] Properties to set - * @returns {google.cloud.batch.v1.ListJobsResponse} ListJobsResponse instance - */ - ListJobsResponse.create = function create(properties) { - return new ListJobsResponse(properties); - }; - - /** - * Encodes the specified ListJobsResponse message. Does not implicitly {@link google.cloud.batch.v1.ListJobsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.ListJobsResponse - * @static - * @param {google.cloud.batch.v1.IListJobsResponse} message ListJobsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListJobsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.jobs != null && message.jobs.length) - for (var i = 0; i < message.jobs.length; ++i) - $root.google.cloud.batch.v1.Job.encode(message.jobs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; - - /** - * Encodes the specified ListJobsResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ListJobsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.ListJobsResponse - * @static - * @param {google.cloud.batch.v1.IListJobsResponse} message ListJobsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListJobsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListJobsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.ListJobsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.ListJobsResponse} ListJobsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListJobsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.ListJobsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.jobs && message.jobs.length)) - message.jobs = []; - message.jobs.push($root.google.cloud.batch.v1.Job.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListJobsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.ListJobsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.ListJobsResponse} ListJobsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListJobsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListJobsResponse message. - * @function verify - * @memberof google.cloud.batch.v1.ListJobsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListJobsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.jobs != null && message.hasOwnProperty("jobs")) { - if (!Array.isArray(message.jobs)) - return "jobs: array expected"; - for (var i = 0; i < message.jobs.length; ++i) { - var error = $root.google.cloud.batch.v1.Job.verify(message.jobs[i]); - if (error) - return "jobs." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; - - /** - * Creates a ListJobsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.ListJobsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.ListJobsResponse} ListJobsResponse - */ - ListJobsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.ListJobsResponse) - return object; - var message = new $root.google.cloud.batch.v1.ListJobsResponse(); - if (object.jobs) { - if (!Array.isArray(object.jobs)) - throw TypeError(".google.cloud.batch.v1.ListJobsResponse.jobs: array expected"); - message.jobs = []; - for (var i = 0; i < object.jobs.length; ++i) { - if (typeof object.jobs[i] !== "object") - throw TypeError(".google.cloud.batch.v1.ListJobsResponse.jobs: object expected"); - message.jobs[i] = $root.google.cloud.batch.v1.Job.fromObject(object.jobs[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.batch.v1.ListJobsResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListJobsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.ListJobsResponse - * @static - * @param {google.cloud.batch.v1.ListJobsResponse} message ListJobsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListJobsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.jobs = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.jobs && message.jobs.length) { - object.jobs = []; - for (var j = 0; j < message.jobs.length; ++j) - object.jobs[j] = $root.google.cloud.batch.v1.Job.toObject(message.jobs[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; - - /** - * Converts this ListJobsResponse to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.ListJobsResponse - * @instance - * @returns {Object.} JSON object - */ - ListJobsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListJobsResponse - * @function getTypeUrl - * @memberof google.cloud.batch.v1.ListJobsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListJobsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.ListJobsResponse"; - }; - - return ListJobsResponse; - })(); - - v1.ListTasksRequest = (function() { - - /** - * Properties of a ListTasksRequest. - * @memberof google.cloud.batch.v1 - * @interface IListTasksRequest - * @property {string|null} [parent] ListTasksRequest parent - * @property {string|null} [filter] ListTasksRequest filter - * @property {number|null} [pageSize] ListTasksRequest pageSize - * @property {string|null} [pageToken] ListTasksRequest pageToken - */ - - /** - * Constructs a new ListTasksRequest. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a ListTasksRequest. - * @implements IListTasksRequest - * @constructor - * @param {google.cloud.batch.v1.IListTasksRequest=} [properties] Properties to set - */ - function ListTasksRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListTasksRequest parent. - * @member {string} parent - * @memberof google.cloud.batch.v1.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.parent = ""; - - /** - * ListTasksRequest filter. - * @member {string} filter - * @memberof google.cloud.batch.v1.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.filter = ""; - - /** - * ListTasksRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.batch.v1.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.pageSize = 0; - - /** - * ListTasksRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.batch.v1.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.pageToken = ""; - - /** - * Creates a new ListTasksRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.ListTasksRequest - * @static - * @param {google.cloud.batch.v1.IListTasksRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1.ListTasksRequest} ListTasksRequest instance - */ - ListTasksRequest.create = function create(properties) { - return new ListTasksRequest(properties); - }; - - /** - * Encodes the specified ListTasksRequest message. Does not implicitly {@link google.cloud.batch.v1.ListTasksRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.ListTasksRequest - * @static - * @param {google.cloud.batch.v1.IListTasksRequest} message ListTasksRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTasksRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListTasksRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ListTasksRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.ListTasksRequest - * @static - * @param {google.cloud.batch.v1.IListTasksRequest} message ListTasksRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTasksRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListTasksRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.ListTasksRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.ListTasksRequest} ListTasksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTasksRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.ListTasksRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.filter = reader.string(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListTasksRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.ListTasksRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.ListTasksRequest} ListTasksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTasksRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListTasksRequest message. - * @function verify - * @memberof google.cloud.batch.v1.ListTasksRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListTasksRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListTasksRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.ListTasksRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.ListTasksRequest} ListTasksRequest - */ - ListTasksRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.ListTasksRequest) - return object; - var message = new $root.google.cloud.batch.v1.ListTasksRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListTasksRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.ListTasksRequest - * @static - * @param {google.cloud.batch.v1.ListTasksRequest} message ListTasksRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListTasksRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListTasksRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.ListTasksRequest - * @instance - * @returns {Object.} JSON object - */ - ListTasksRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListTasksRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1.ListTasksRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListTasksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.ListTasksRequest"; - }; - - return ListTasksRequest; - })(); - - v1.ListTasksResponse = (function() { - - /** - * Properties of a ListTasksResponse. - * @memberof google.cloud.batch.v1 - * @interface IListTasksResponse - * @property {Array.|null} [tasks] ListTasksResponse tasks - * @property {string|null} [nextPageToken] ListTasksResponse nextPageToken - * @property {Array.|null} [unreachable] ListTasksResponse unreachable - */ - - /** - * Constructs a new ListTasksResponse. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a ListTasksResponse. - * @implements IListTasksResponse - * @constructor - * @param {google.cloud.batch.v1.IListTasksResponse=} [properties] Properties to set - */ - function ListTasksResponse(properties) { - this.tasks = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListTasksResponse tasks. - * @member {Array.} tasks - * @memberof google.cloud.batch.v1.ListTasksResponse - * @instance - */ - ListTasksResponse.prototype.tasks = $util.emptyArray; - - /** - * ListTasksResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.batch.v1.ListTasksResponse - * @instance - */ - ListTasksResponse.prototype.nextPageToken = ""; - - /** - * ListTasksResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.batch.v1.ListTasksResponse - * @instance - */ - ListTasksResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListTasksResponse instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.ListTasksResponse - * @static - * @param {google.cloud.batch.v1.IListTasksResponse=} [properties] Properties to set - * @returns {google.cloud.batch.v1.ListTasksResponse} ListTasksResponse instance - */ - ListTasksResponse.create = function create(properties) { - return new ListTasksResponse(properties); - }; - - /** - * Encodes the specified ListTasksResponse message. Does not implicitly {@link google.cloud.batch.v1.ListTasksResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.ListTasksResponse - * @static - * @param {google.cloud.batch.v1.IListTasksResponse} message ListTasksResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTasksResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tasks != null && message.tasks.length) - for (var i = 0; i < message.tasks.length; ++i) - $root.google.cloud.batch.v1.Task.encode(message.tasks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; - - /** - * Encodes the specified ListTasksResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ListTasksResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.ListTasksResponse - * @static - * @param {google.cloud.batch.v1.IListTasksResponse} message ListTasksResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTasksResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListTasksResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.ListTasksResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.ListTasksResponse} ListTasksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTasksResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.ListTasksResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.tasks && message.tasks.length)) - message.tasks = []; - message.tasks.push($root.google.cloud.batch.v1.Task.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListTasksResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.ListTasksResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.ListTasksResponse} ListTasksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTasksResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListTasksResponse message. - * @function verify - * @memberof google.cloud.batch.v1.ListTasksResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListTasksResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tasks != null && message.hasOwnProperty("tasks")) { - if (!Array.isArray(message.tasks)) - return "tasks: array expected"; - for (var i = 0; i < message.tasks.length; ++i) { - var error = $root.google.cloud.batch.v1.Task.verify(message.tasks[i]); - if (error) - return "tasks." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; - - /** - * Creates a ListTasksResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.ListTasksResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.ListTasksResponse} ListTasksResponse - */ - ListTasksResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.ListTasksResponse) - return object; - var message = new $root.google.cloud.batch.v1.ListTasksResponse(); - if (object.tasks) { - if (!Array.isArray(object.tasks)) - throw TypeError(".google.cloud.batch.v1.ListTasksResponse.tasks: array expected"); - message.tasks = []; - for (var i = 0; i < object.tasks.length; ++i) { - if (typeof object.tasks[i] !== "object") - throw TypeError(".google.cloud.batch.v1.ListTasksResponse.tasks: object expected"); - message.tasks[i] = $root.google.cloud.batch.v1.Task.fromObject(object.tasks[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.batch.v1.ListTasksResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListTasksResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.ListTasksResponse - * @static - * @param {google.cloud.batch.v1.ListTasksResponse} message ListTasksResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListTasksResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.tasks = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.tasks && message.tasks.length) { - object.tasks = []; - for (var j = 0; j < message.tasks.length; ++j) - object.tasks[j] = $root.google.cloud.batch.v1.Task.toObject(message.tasks[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; - - /** - * Converts this ListTasksResponse to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.ListTasksResponse - * @instance - * @returns {Object.} JSON object - */ - ListTasksResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListTasksResponse - * @function getTypeUrl - * @memberof google.cloud.batch.v1.ListTasksResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListTasksResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.ListTasksResponse"; - }; - - return ListTasksResponse; - })(); - - v1.GetTaskRequest = (function() { - - /** - * Properties of a GetTaskRequest. - * @memberof google.cloud.batch.v1 - * @interface IGetTaskRequest - * @property {string|null} [name] GetTaskRequest name - */ - - /** - * Constructs a new GetTaskRequest. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a GetTaskRequest. - * @implements IGetTaskRequest - * @constructor - * @param {google.cloud.batch.v1.IGetTaskRequest=} [properties] Properties to set - */ - function GetTaskRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTaskRequest name. - * @member {string} name - * @memberof google.cloud.batch.v1.GetTaskRequest - * @instance - */ - GetTaskRequest.prototype.name = ""; - - /** - * Creates a new GetTaskRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.GetTaskRequest - * @static - * @param {google.cloud.batch.v1.IGetTaskRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1.GetTaskRequest} GetTaskRequest instance - */ - GetTaskRequest.create = function create(properties) { - return new GetTaskRequest(properties); - }; - - /** - * Encodes the specified GetTaskRequest message. Does not implicitly {@link google.cloud.batch.v1.GetTaskRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.GetTaskRequest - * @static - * @param {google.cloud.batch.v1.IGetTaskRequest} message GetTaskRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTaskRequest.encode = function encode(message, writer) { - 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 GetTaskRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.GetTaskRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.GetTaskRequest - * @static - * @param {google.cloud.batch.v1.IGetTaskRequest} message GetTaskRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTaskRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTaskRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.GetTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.GetTaskRequest} GetTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTaskRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.GetTaskRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTaskRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.GetTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.GetTaskRequest} GetTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTaskRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTaskRequest message. - * @function verify - * @memberof google.cloud.batch.v1.GetTaskRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTaskRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetTaskRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.GetTaskRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.GetTaskRequest} GetTaskRequest - */ - GetTaskRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.GetTaskRequest) - return object; - var message = new $root.google.cloud.batch.v1.GetTaskRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetTaskRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.GetTaskRequest - * @static - * @param {google.cloud.batch.v1.GetTaskRequest} message GetTaskRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTaskRequest.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 GetTaskRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.GetTaskRequest - * @instance - * @returns {Object.} JSON object - */ - GetTaskRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetTaskRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1.GetTaskRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetTaskRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.GetTaskRequest"; - }; - - return GetTaskRequest; - })(); - - v1.OperationMetadata = (function() { - - /** - * Properties of an OperationMetadata. - * @memberof google.cloud.batch.v1 - * @interface IOperationMetadata - * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime - * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime - * @property {string|null} [target] OperationMetadata target - * @property {string|null} [verb] OperationMetadata verb - * @property {string|null} [statusMessage] OperationMetadata statusMessage - * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation - * @property {string|null} [apiVersion] OperationMetadata apiVersion - */ - - /** - * Constructs a new OperationMetadata. - * @memberof google.cloud.batch.v1 - * @classdesc Represents an OperationMetadata. - * @implements IOperationMetadata - * @constructor - * @param {google.cloud.batch.v1.IOperationMetadata=} [properties] Properties to set - */ - function OperationMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OperationMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.batch.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.createTime = null; - - /** - * OperationMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.batch.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.endTime = null; - - /** - * OperationMetadata target. - * @member {string} target - * @memberof google.cloud.batch.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.target = ""; - - /** - * OperationMetadata verb. - * @member {string} verb - * @memberof google.cloud.batch.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.verb = ""; - - /** - * OperationMetadata statusMessage. - * @member {string} statusMessage - * @memberof google.cloud.batch.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.statusMessage = ""; - - /** - * OperationMetadata requestedCancellation. - * @member {boolean} requestedCancellation - * @memberof google.cloud.batch.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.requestedCancellation = false; - - /** - * OperationMetadata apiVersion. - * @member {string} apiVersion - * @memberof google.cloud.batch.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.apiVersion = ""; - - /** - * Creates a new OperationMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.OperationMetadata - * @static - * @param {google.cloud.batch.v1.IOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.batch.v1.OperationMetadata} OperationMetadata instance - */ - OperationMetadata.create = function create(properties) { - return new OperationMetadata(properties); - }; - - /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.batch.v1.OperationMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.OperationMetadata - * @static - * @param {google.cloud.batch.v1.IOperationMetadata} message OperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, 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.target != null && Object.hasOwnProperty.call(message, "target")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); - if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); - if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); - if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); - if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); - return writer; - }; - - /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.batch.v1.OperationMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.OperationMetadata - * @static - * @param {google.cloud.batch.v1.IOperationMetadata} message OperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.OperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.OperationMetadata} OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationMetadata.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.OperationMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.target = reader.string(); - break; - } - case 4: { - message.verb = reader.string(); - break; - } - case 5: { - message.statusMessage = reader.string(); - break; - } - case 6: { - message.requestedCancellation = reader.bool(); - break; - } - case 7: { - message.apiVersion = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.OperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.OperationMetadata} OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OperationMetadata message. - * @function verify - * @memberof google.cloud.batch.v1.OperationMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OperationMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - if (message.target != null && message.hasOwnProperty("target")) - if (!$util.isString(message.target)) - return "target: string expected"; - if (message.verb != null && message.hasOwnProperty("verb")) - if (!$util.isString(message.verb)) - return "verb: string expected"; - if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) - if (!$util.isString(message.statusMessage)) - return "statusMessage: string expected"; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - if (typeof message.requestedCancellation !== "boolean") - return "requestedCancellation: boolean expected"; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - if (!$util.isString(message.apiVersion)) - return "apiVersion: string expected"; - return null; - }; - - /** - * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.OperationMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.OperationMetadata} OperationMetadata - */ - OperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.OperationMetadata) - return object; - var message = new $root.google.cloud.batch.v1.OperationMetadata(); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.batch.v1.OperationMetadata.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.batch.v1.OperationMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.target != null) - message.target = String(object.target); - if (object.verb != null) - message.verb = String(object.verb); - if (object.statusMessage != null) - message.statusMessage = String(object.statusMessage); - if (object.requestedCancellation != null) - message.requestedCancellation = Boolean(object.requestedCancellation); - if (object.apiVersion != null) - message.apiVersion = String(object.apiVersion); - return message; - }; - - /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.OperationMetadata - * @static - * @param {google.cloud.batch.v1.OperationMetadata} message OperationMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OperationMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.createTime = null; - object.endTime = null; - object.target = ""; - object.verb = ""; - object.statusMessage = ""; - object.requestedCancellation = false; - object.apiVersion = ""; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.target != null && message.hasOwnProperty("target")) - object.target = message.target; - if (message.verb != null && message.hasOwnProperty("verb")) - object.verb = message.verb; - if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) - object.statusMessage = message.statusMessage; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - object.requestedCancellation = message.requestedCancellation; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - object.apiVersion = message.apiVersion; - return object; - }; - - /** - * Converts this OperationMetadata to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.OperationMetadata - * @instance - * @returns {Object.} JSON object - */ - OperationMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OperationMetadata - * @function getTypeUrl - * @memberof google.cloud.batch.v1.OperationMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.OperationMetadata"; - }; - - return OperationMetadata; - })(); - - v1.Job = (function() { - - /** - * Properties of a Job. - * @memberof google.cloud.batch.v1 - * @interface IJob - * @property {string|null} [name] Job name - * @property {string|null} [uid] Job uid - * @property {number|Long|null} [priority] Job priority - * @property {Array.|null} [taskGroups] Job taskGroups - * @property {google.cloud.batch.v1.IAllocationPolicy|null} [allocationPolicy] Job allocationPolicy - * @property {Object.|null} [labels] Job labels - * @property {google.cloud.batch.v1.IJobStatus|null} [status] Job status - * @property {google.protobuf.ITimestamp|null} [createTime] Job createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Job updateTime - * @property {google.cloud.batch.v1.ILogsPolicy|null} [logsPolicy] Job logsPolicy - * @property {Array.|null} [notifications] Job notifications - */ - - /** - * Constructs a new Job. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a Job. - * @implements IJob - * @constructor - * @param {google.cloud.batch.v1.IJob=} [properties] Properties to set - */ - function Job(properties) { - this.taskGroups = []; - this.labels = {}; - this.notifications = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Job name. - * @member {string} name - * @memberof google.cloud.batch.v1.Job - * @instance - */ - Job.prototype.name = ""; - - /** - * Job uid. - * @member {string} uid - * @memberof google.cloud.batch.v1.Job - * @instance - */ - Job.prototype.uid = ""; - - /** - * Job priority. - * @member {number|Long} priority - * @memberof google.cloud.batch.v1.Job - * @instance - */ - Job.prototype.priority = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Job taskGroups. - * @member {Array.} taskGroups - * @memberof google.cloud.batch.v1.Job - * @instance - */ - Job.prototype.taskGroups = $util.emptyArray; - - /** - * Job allocationPolicy. - * @member {google.cloud.batch.v1.IAllocationPolicy|null|undefined} allocationPolicy - * @memberof google.cloud.batch.v1.Job - * @instance - */ - Job.prototype.allocationPolicy = null; - - /** - * Job labels. - * @member {Object.} labels - * @memberof google.cloud.batch.v1.Job - * @instance - */ - Job.prototype.labels = $util.emptyObject; - - /** - * Job status. - * @member {google.cloud.batch.v1.IJobStatus|null|undefined} status - * @memberof google.cloud.batch.v1.Job - * @instance - */ - Job.prototype.status = null; - - /** - * Job createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.batch.v1.Job - * @instance - */ - Job.prototype.createTime = null; - - /** - * Job updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.batch.v1.Job - * @instance - */ - Job.prototype.updateTime = null; - - /** - * Job logsPolicy. - * @member {google.cloud.batch.v1.ILogsPolicy|null|undefined} logsPolicy - * @memberof google.cloud.batch.v1.Job - * @instance - */ - Job.prototype.logsPolicy = null; - - /** - * Job notifications. - * @member {Array.} notifications - * @memberof google.cloud.batch.v1.Job - * @instance - */ - Job.prototype.notifications = $util.emptyArray; - - /** - * Creates a new Job instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.Job - * @static - * @param {google.cloud.batch.v1.IJob=} [properties] Properties to set - * @returns {google.cloud.batch.v1.Job} Job instance - */ - Job.create = function create(properties) { - return new Job(properties); - }; - - /** - * Encodes the specified Job message. Does not implicitly {@link google.cloud.batch.v1.Job.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.Job - * @static - * @param {google.cloud.batch.v1.IJob} message Job message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Job.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); - if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.priority); - if (message.taskGroups != null && message.taskGroups.length) - for (var i = 0; i < message.taskGroups.length; ++i) - $root.google.cloud.batch.v1.TaskGroup.encode(message.taskGroups[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.allocationPolicy != null && Object.hasOwnProperty.call(message, "allocationPolicy")) - $root.google.cloud.batch.v1.AllocationPolicy.encode(message.allocationPolicy, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.cloud.batch.v1.JobStatus.encode(message.status, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.logsPolicy != null && Object.hasOwnProperty.call(message, "logsPolicy")) - $root.google.cloud.batch.v1.LogsPolicy.encode(message.logsPolicy, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.notifications != null && message.notifications.length) - for (var i = 0; i < message.notifications.length; ++i) - $root.google.cloud.batch.v1.JobNotification.encode(message.notifications[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Job.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.Job - * @static - * @param {google.cloud.batch.v1.IJob} message Job message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Job.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Job message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.Job - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.Job} Job - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Job.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Job(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.uid = reader.string(); - break; - } - case 3: { - message.priority = reader.int64(); - break; - } - case 4: { - if (!(message.taskGroups && message.taskGroups.length)) - message.taskGroups = []; - message.taskGroups.push($root.google.cloud.batch.v1.TaskGroup.decode(reader, reader.uint32())); - break; - } - case 7: { - message.allocationPolicy = $root.google.cloud.batch.v1.AllocationPolicy.decode(reader, reader.uint32()); - break; - } - case 8: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 9: { - message.status = $root.google.cloud.batch.v1.JobStatus.decode(reader, reader.uint32()); - break; - } - case 11: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 12: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 13: { - message.logsPolicy = $root.google.cloud.batch.v1.LogsPolicy.decode(reader, reader.uint32()); - break; - } - case 14: { - if (!(message.notifications && message.notifications.length)) - message.notifications = []; - message.notifications.push($root.google.cloud.batch.v1.JobNotification.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Job message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.Job - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.Job} Job - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Job.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Job message. - * @function verify - * @memberof google.cloud.batch.v1.Job - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Job.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.uid != null && message.hasOwnProperty("uid")) - if (!$util.isString(message.uid)) - return "uid: string expected"; - if (message.priority != null && message.hasOwnProperty("priority")) - if (!$util.isInteger(message.priority) && !(message.priority && $util.isInteger(message.priority.low) && $util.isInteger(message.priority.high))) - return "priority: integer|Long expected"; - if (message.taskGroups != null && message.hasOwnProperty("taskGroups")) { - if (!Array.isArray(message.taskGroups)) - return "taskGroups: array expected"; - for (var i = 0; i < message.taskGroups.length; ++i) { - var error = $root.google.cloud.batch.v1.TaskGroup.verify(message.taskGroups[i]); - if (error) - return "taskGroups." + error; - } - } - if (message.allocationPolicy != null && message.hasOwnProperty("allocationPolicy")) { - var error = $root.google.cloud.batch.v1.AllocationPolicy.verify(message.allocationPolicy); - if (error) - return "allocationPolicy." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.status != null && message.hasOwnProperty("status")) { - var error = $root.google.cloud.batch.v1.JobStatus.verify(message.status); - if (error) - return "status." + error; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.logsPolicy != null && message.hasOwnProperty("logsPolicy")) { - var error = $root.google.cloud.batch.v1.LogsPolicy.verify(message.logsPolicy); - if (error) - return "logsPolicy." + error; - } - if (message.notifications != null && message.hasOwnProperty("notifications")) { - if (!Array.isArray(message.notifications)) - return "notifications: array expected"; - for (var i = 0; i < message.notifications.length; ++i) { - var error = $root.google.cloud.batch.v1.JobNotification.verify(message.notifications[i]); - if (error) - return "notifications." + error; - } - } - return null; - }; - - /** - * Creates a Job message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.Job - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.Job} Job - */ - Job.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.Job) - return object; - var message = new $root.google.cloud.batch.v1.Job(); - if (object.name != null) - message.name = String(object.name); - if (object.uid != null) - message.uid = String(object.uid); - if (object.priority != null) - if ($util.Long) - (message.priority = $util.Long.fromValue(object.priority)).unsigned = false; - else if (typeof object.priority === "string") - message.priority = parseInt(object.priority, 10); - else if (typeof object.priority === "number") - message.priority = object.priority; - else if (typeof object.priority === "object") - message.priority = new $util.LongBits(object.priority.low >>> 0, object.priority.high >>> 0).toNumber(); - if (object.taskGroups) { - if (!Array.isArray(object.taskGroups)) - throw TypeError(".google.cloud.batch.v1.Job.taskGroups: array expected"); - message.taskGroups = []; - for (var i = 0; i < object.taskGroups.length; ++i) { - if (typeof object.taskGroups[i] !== "object") - throw TypeError(".google.cloud.batch.v1.Job.taskGroups: object expected"); - message.taskGroups[i] = $root.google.cloud.batch.v1.TaskGroup.fromObject(object.taskGroups[i]); - } - } - if (object.allocationPolicy != null) { - if (typeof object.allocationPolicy !== "object") - throw TypeError(".google.cloud.batch.v1.Job.allocationPolicy: object expected"); - message.allocationPolicy = $root.google.cloud.batch.v1.AllocationPolicy.fromObject(object.allocationPolicy); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.batch.v1.Job.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - if (object.status != null) { - if (typeof object.status !== "object") - throw TypeError(".google.cloud.batch.v1.Job.status: object expected"); - message.status = $root.google.cloud.batch.v1.JobStatus.fromObject(object.status); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.batch.v1.Job.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.batch.v1.Job.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.logsPolicy != null) { - if (typeof object.logsPolicy !== "object") - throw TypeError(".google.cloud.batch.v1.Job.logsPolicy: object expected"); - message.logsPolicy = $root.google.cloud.batch.v1.LogsPolicy.fromObject(object.logsPolicy); - } - if (object.notifications) { - if (!Array.isArray(object.notifications)) - throw TypeError(".google.cloud.batch.v1.Job.notifications: array expected"); - message.notifications = []; - for (var i = 0; i < object.notifications.length; ++i) { - if (typeof object.notifications[i] !== "object") - throw TypeError(".google.cloud.batch.v1.Job.notifications: object expected"); - message.notifications[i] = $root.google.cloud.batch.v1.JobNotification.fromObject(object.notifications[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Job message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.Job - * @static - * @param {google.cloud.batch.v1.Job} message Job - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Job.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.taskGroups = []; - object.notifications = []; - } - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.uid = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.priority = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.priority = options.longs === String ? "0" : 0; - object.allocationPolicy = null; - object.status = null; - object.createTime = null; - object.updateTime = null; - object.logsPolicy = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - if (message.priority != null && message.hasOwnProperty("priority")) - if (typeof message.priority === "number") - object.priority = options.longs === String ? String(message.priority) : message.priority; - else - object.priority = options.longs === String ? $util.Long.prototype.toString.call(message.priority) : options.longs === Number ? new $util.LongBits(message.priority.low >>> 0, message.priority.high >>> 0).toNumber() : message.priority; - if (message.taskGroups && message.taskGroups.length) { - object.taskGroups = []; - for (var j = 0; j < message.taskGroups.length; ++j) - object.taskGroups[j] = $root.google.cloud.batch.v1.TaskGroup.toObject(message.taskGroups[j], options); - } - if (message.allocationPolicy != null && message.hasOwnProperty("allocationPolicy")) - object.allocationPolicy = $root.google.cloud.batch.v1.AllocationPolicy.toObject(message.allocationPolicy, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.cloud.batch.v1.JobStatus.toObject(message.status, options); - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.logsPolicy != null && message.hasOwnProperty("logsPolicy")) - object.logsPolicy = $root.google.cloud.batch.v1.LogsPolicy.toObject(message.logsPolicy, options); - if (message.notifications && message.notifications.length) { - object.notifications = []; - for (var j = 0; j < message.notifications.length; ++j) - object.notifications[j] = $root.google.cloud.batch.v1.JobNotification.toObject(message.notifications[j], options); - } - return object; - }; - - /** - * Converts this Job to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.Job - * @instance - * @returns {Object.} JSON object - */ - Job.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Job - * @function getTypeUrl - * @memberof google.cloud.batch.v1.Job - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Job.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.Job"; - }; - - return Job; - })(); - - v1.LogsPolicy = (function() { - - /** - * Properties of a LogsPolicy. - * @memberof google.cloud.batch.v1 - * @interface ILogsPolicy - * @property {google.cloud.batch.v1.LogsPolicy.Destination|null} [destination] LogsPolicy destination - * @property {string|null} [logsPath] LogsPolicy logsPath - * @property {google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption|null} [cloudLoggingOption] LogsPolicy cloudLoggingOption - */ - - /** - * Constructs a new LogsPolicy. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a LogsPolicy. - * @implements ILogsPolicy - * @constructor - * @param {google.cloud.batch.v1.ILogsPolicy=} [properties] Properties to set - */ - function LogsPolicy(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LogsPolicy destination. - * @member {google.cloud.batch.v1.LogsPolicy.Destination} destination - * @memberof google.cloud.batch.v1.LogsPolicy - * @instance - */ - LogsPolicy.prototype.destination = 0; - - /** - * LogsPolicy logsPath. - * @member {string} logsPath - * @memberof google.cloud.batch.v1.LogsPolicy - * @instance - */ - LogsPolicy.prototype.logsPath = ""; - - /** - * LogsPolicy cloudLoggingOption. - * @member {google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption|null|undefined} cloudLoggingOption - * @memberof google.cloud.batch.v1.LogsPolicy - * @instance - */ - LogsPolicy.prototype.cloudLoggingOption = null; - - /** - * Creates a new LogsPolicy instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.LogsPolicy - * @static - * @param {google.cloud.batch.v1.ILogsPolicy=} [properties] Properties to set - * @returns {google.cloud.batch.v1.LogsPolicy} LogsPolicy instance - */ - LogsPolicy.create = function create(properties) { - return new LogsPolicy(properties); - }; - - /** - * Encodes the specified LogsPolicy message. Does not implicitly {@link google.cloud.batch.v1.LogsPolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.LogsPolicy - * @static - * @param {google.cloud.batch.v1.ILogsPolicy} message LogsPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LogsPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.destination); - if (message.logsPath != null && Object.hasOwnProperty.call(message, "logsPath")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.logsPath); - if (message.cloudLoggingOption != null && Object.hasOwnProperty.call(message, "cloudLoggingOption")) - $root.google.cloud.batch.v1.LogsPolicy.CloudLoggingOption.encode(message.cloudLoggingOption, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LogsPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.LogsPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.LogsPolicy - * @static - * @param {google.cloud.batch.v1.ILogsPolicy} message LogsPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LogsPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LogsPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.LogsPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.LogsPolicy} LogsPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LogsPolicy.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.LogsPolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.destination = reader.int32(); - break; - } - case 2: { - message.logsPath = reader.string(); - break; - } - case 3: { - message.cloudLoggingOption = $root.google.cloud.batch.v1.LogsPolicy.CloudLoggingOption.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LogsPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.LogsPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.LogsPolicy} LogsPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LogsPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LogsPolicy message. - * @function verify - * @memberof google.cloud.batch.v1.LogsPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LogsPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.destination != null && message.hasOwnProperty("destination")) - switch (message.destination) { - default: - return "destination: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.logsPath != null && message.hasOwnProperty("logsPath")) - if (!$util.isString(message.logsPath)) - return "logsPath: string expected"; - if (message.cloudLoggingOption != null && message.hasOwnProperty("cloudLoggingOption")) { - var error = $root.google.cloud.batch.v1.LogsPolicy.CloudLoggingOption.verify(message.cloudLoggingOption); - if (error) - return "cloudLoggingOption." + error; - } - return null; - }; - - /** - * Creates a LogsPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.LogsPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.LogsPolicy} LogsPolicy - */ - LogsPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.LogsPolicy) - return object; - var message = new $root.google.cloud.batch.v1.LogsPolicy(); - switch (object.destination) { - default: - if (typeof object.destination === "number") { - message.destination = object.destination; - break; - } - break; - case "DESTINATION_UNSPECIFIED": - case 0: - message.destination = 0; - break; - case "CLOUD_LOGGING": - case 1: - message.destination = 1; - break; - case "PATH": - case 2: - message.destination = 2; - break; - } - if (object.logsPath != null) - message.logsPath = String(object.logsPath); - if (object.cloudLoggingOption != null) { - if (typeof object.cloudLoggingOption !== "object") - throw TypeError(".google.cloud.batch.v1.LogsPolicy.cloudLoggingOption: object expected"); - message.cloudLoggingOption = $root.google.cloud.batch.v1.LogsPolicy.CloudLoggingOption.fromObject(object.cloudLoggingOption); - } - return message; - }; - - /** - * Creates a plain object from a LogsPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.LogsPolicy - * @static - * @param {google.cloud.batch.v1.LogsPolicy} message LogsPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LogsPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.destination = options.enums === String ? "DESTINATION_UNSPECIFIED" : 0; - object.logsPath = ""; - object.cloudLoggingOption = null; - } - if (message.destination != null && message.hasOwnProperty("destination")) - object.destination = options.enums === String ? $root.google.cloud.batch.v1.LogsPolicy.Destination[message.destination] === undefined ? message.destination : $root.google.cloud.batch.v1.LogsPolicy.Destination[message.destination] : message.destination; - if (message.logsPath != null && message.hasOwnProperty("logsPath")) - object.logsPath = message.logsPath; - if (message.cloudLoggingOption != null && message.hasOwnProperty("cloudLoggingOption")) - object.cloudLoggingOption = $root.google.cloud.batch.v1.LogsPolicy.CloudLoggingOption.toObject(message.cloudLoggingOption, options); - return object; - }; - - /** - * Converts this LogsPolicy to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.LogsPolicy - * @instance - * @returns {Object.} JSON object - */ - LogsPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LogsPolicy - * @function getTypeUrl - * @memberof google.cloud.batch.v1.LogsPolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LogsPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.LogsPolicy"; - }; - - LogsPolicy.CloudLoggingOption = (function() { - - /** - * Properties of a CloudLoggingOption. - * @memberof google.cloud.batch.v1.LogsPolicy - * @interface ICloudLoggingOption - * @property {boolean|null} [useGenericTaskMonitoredResource] CloudLoggingOption useGenericTaskMonitoredResource - */ - - /** - * Constructs a new CloudLoggingOption. - * @memberof google.cloud.batch.v1.LogsPolicy - * @classdesc Represents a CloudLoggingOption. - * @implements ICloudLoggingOption - * @constructor - * @param {google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption=} [properties] Properties to set - */ - function CloudLoggingOption(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CloudLoggingOption useGenericTaskMonitoredResource. - * @member {boolean} useGenericTaskMonitoredResource - * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption - * @instance - */ - CloudLoggingOption.prototype.useGenericTaskMonitoredResource = false; - - /** - * Creates a new CloudLoggingOption instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption - * @static - * @param {google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption=} [properties] Properties to set - * @returns {google.cloud.batch.v1.LogsPolicy.CloudLoggingOption} CloudLoggingOption instance - */ - CloudLoggingOption.create = function create(properties) { - return new CloudLoggingOption(properties); - }; - - /** - * Encodes the specified CloudLoggingOption message. Does not implicitly {@link google.cloud.batch.v1.LogsPolicy.CloudLoggingOption.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption - * @static - * @param {google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption} message CloudLoggingOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudLoggingOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.useGenericTaskMonitoredResource != null && Object.hasOwnProperty.call(message, "useGenericTaskMonitoredResource")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.useGenericTaskMonitoredResource); - return writer; - }; - - /** - * Encodes the specified CloudLoggingOption message, length delimited. Does not implicitly {@link google.cloud.batch.v1.LogsPolicy.CloudLoggingOption.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption - * @static - * @param {google.cloud.batch.v1.LogsPolicy.ICloudLoggingOption} message CloudLoggingOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudLoggingOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CloudLoggingOption message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.LogsPolicy.CloudLoggingOption} CloudLoggingOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudLoggingOption.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.LogsPolicy.CloudLoggingOption(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.useGenericTaskMonitoredResource = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CloudLoggingOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.LogsPolicy.CloudLoggingOption} CloudLoggingOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudLoggingOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CloudLoggingOption message. - * @function verify - * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CloudLoggingOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.useGenericTaskMonitoredResource != null && message.hasOwnProperty("useGenericTaskMonitoredResource")) - if (typeof message.useGenericTaskMonitoredResource !== "boolean") - return "useGenericTaskMonitoredResource: boolean expected"; - return null; - }; - - /** - * Creates a CloudLoggingOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.LogsPolicy.CloudLoggingOption} CloudLoggingOption - */ - CloudLoggingOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.LogsPolicy.CloudLoggingOption) - return object; - var message = new $root.google.cloud.batch.v1.LogsPolicy.CloudLoggingOption(); - if (object.useGenericTaskMonitoredResource != null) - message.useGenericTaskMonitoredResource = Boolean(object.useGenericTaskMonitoredResource); - return message; - }; - - /** - * Creates a plain object from a CloudLoggingOption message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption - * @static - * @param {google.cloud.batch.v1.LogsPolicy.CloudLoggingOption} message CloudLoggingOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CloudLoggingOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.useGenericTaskMonitoredResource = false; - if (message.useGenericTaskMonitoredResource != null && message.hasOwnProperty("useGenericTaskMonitoredResource")) - object.useGenericTaskMonitoredResource = message.useGenericTaskMonitoredResource; - return object; - }; - - /** - * Converts this CloudLoggingOption to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption - * @instance - * @returns {Object.} JSON object - */ - CloudLoggingOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CloudLoggingOption - * @function getTypeUrl - * @memberof google.cloud.batch.v1.LogsPolicy.CloudLoggingOption - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CloudLoggingOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.LogsPolicy.CloudLoggingOption"; - }; - - return CloudLoggingOption; - })(); - - /** - * Destination enum. - * @name google.cloud.batch.v1.LogsPolicy.Destination - * @enum {number} - * @property {number} DESTINATION_UNSPECIFIED=0 DESTINATION_UNSPECIFIED value - * @property {number} CLOUD_LOGGING=1 CLOUD_LOGGING value - * @property {number} PATH=2 PATH value - */ - LogsPolicy.Destination = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DESTINATION_UNSPECIFIED"] = 0; - values[valuesById[1] = "CLOUD_LOGGING"] = 1; - values[valuesById[2] = "PATH"] = 2; - return values; - })(); - - return LogsPolicy; - })(); - - v1.JobStatus = (function() { - - /** - * Properties of a JobStatus. - * @memberof google.cloud.batch.v1 - * @interface IJobStatus - * @property {google.cloud.batch.v1.JobStatus.State|null} [state] JobStatus state - * @property {Array.|null} [statusEvents] JobStatus statusEvents - * @property {Object.|null} [taskGroups] JobStatus taskGroups - * @property {google.protobuf.IDuration|null} [runDuration] JobStatus runDuration - */ - - /** - * Constructs a new JobStatus. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a JobStatus. - * @implements IJobStatus - * @constructor - * @param {google.cloud.batch.v1.IJobStatus=} [properties] Properties to set - */ - function JobStatus(properties) { - this.statusEvents = []; - this.taskGroups = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * JobStatus state. - * @member {google.cloud.batch.v1.JobStatus.State} state - * @memberof google.cloud.batch.v1.JobStatus - * @instance - */ - JobStatus.prototype.state = 0; - - /** - * JobStatus statusEvents. - * @member {Array.} statusEvents - * @memberof google.cloud.batch.v1.JobStatus - * @instance - */ - JobStatus.prototype.statusEvents = $util.emptyArray; - - /** - * JobStatus taskGroups. - * @member {Object.} taskGroups - * @memberof google.cloud.batch.v1.JobStatus - * @instance - */ - JobStatus.prototype.taskGroups = $util.emptyObject; - - /** - * JobStatus runDuration. - * @member {google.protobuf.IDuration|null|undefined} runDuration - * @memberof google.cloud.batch.v1.JobStatus - * @instance - */ - JobStatus.prototype.runDuration = null; - - /** - * Creates a new JobStatus instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.JobStatus - * @static - * @param {google.cloud.batch.v1.IJobStatus=} [properties] Properties to set - * @returns {google.cloud.batch.v1.JobStatus} JobStatus instance - */ - JobStatus.create = function create(properties) { - return new JobStatus(properties); - }; - - /** - * Encodes the specified JobStatus message. Does not implicitly {@link google.cloud.batch.v1.JobStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.JobStatus - * @static - * @param {google.cloud.batch.v1.IJobStatus} message JobStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JobStatus.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); - if (message.statusEvents != null && message.statusEvents.length) - for (var i = 0; i < message.statusEvents.length; ++i) - $root.google.cloud.batch.v1.StatusEvent.encode(message.statusEvents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.taskGroups != null && Object.hasOwnProperty.call(message, "taskGroups")) - for (var keys = Object.keys(message.taskGroups), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.batch.v1.JobStatus.TaskGroupStatus.encode(message.taskGroups[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.runDuration != null && Object.hasOwnProperty.call(message, "runDuration")) - $root.google.protobuf.Duration.encode(message.runDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified JobStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.JobStatus - * @static - * @param {google.cloud.batch.v1.IJobStatus} message JobStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JobStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a JobStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.JobStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.JobStatus} JobStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JobStatus.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.JobStatus(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.state = reader.int32(); - break; - } - case 2: { - if (!(message.statusEvents && message.statusEvents.length)) - message.statusEvents = []; - message.statusEvents.push($root.google.cloud.batch.v1.StatusEvent.decode(reader, reader.uint32())); - break; - } - case 4: { - if (message.taskGroups === $util.emptyObject) - message.taskGroups = {}; - 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.cloud.batch.v1.JobStatus.TaskGroupStatus.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.taskGroups[key] = value; - break; - } - case 5: { - message.runDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a JobStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.JobStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.JobStatus} JobStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JobStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a JobStatus message. - * @function verify - * @memberof google.cloud.batch.v1.JobStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - JobStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.statusEvents != null && message.hasOwnProperty("statusEvents")) { - if (!Array.isArray(message.statusEvents)) - return "statusEvents: array expected"; - for (var i = 0; i < message.statusEvents.length; ++i) { - var error = $root.google.cloud.batch.v1.StatusEvent.verify(message.statusEvents[i]); - if (error) - return "statusEvents." + error; - } - } - if (message.taskGroups != null && message.hasOwnProperty("taskGroups")) { - if (!$util.isObject(message.taskGroups)) - return "taskGroups: object expected"; - var key = Object.keys(message.taskGroups); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.batch.v1.JobStatus.TaskGroupStatus.verify(message.taskGroups[key[i]]); - if (error) - return "taskGroups." + error; - } - } - if (message.runDuration != null && message.hasOwnProperty("runDuration")) { - var error = $root.google.protobuf.Duration.verify(message.runDuration); - if (error) - return "runDuration." + error; - } - return null; - }; - - /** - * Creates a JobStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.JobStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.JobStatus} JobStatus - */ - JobStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.JobStatus) - return object; - var message = new $root.google.cloud.batch.v1.JobStatus(); - 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 "QUEUED": - case 1: - message.state = 1; - break; - case "SCHEDULED": - case 2: - message.state = 2; - break; - case "RUNNING": - case 3: - message.state = 3; - break; - case "SUCCEEDED": - case 4: - message.state = 4; - break; - case "FAILED": - case 5: - message.state = 5; - break; - case "DELETION_IN_PROGRESS": - case 6: - message.state = 6; - break; - } - if (object.statusEvents) { - if (!Array.isArray(object.statusEvents)) - throw TypeError(".google.cloud.batch.v1.JobStatus.statusEvents: array expected"); - message.statusEvents = []; - for (var i = 0; i < object.statusEvents.length; ++i) { - if (typeof object.statusEvents[i] !== "object") - throw TypeError(".google.cloud.batch.v1.JobStatus.statusEvents: object expected"); - message.statusEvents[i] = $root.google.cloud.batch.v1.StatusEvent.fromObject(object.statusEvents[i]); - } - } - if (object.taskGroups) { - if (typeof object.taskGroups !== "object") - throw TypeError(".google.cloud.batch.v1.JobStatus.taskGroups: object expected"); - message.taskGroups = {}; - for (var keys = Object.keys(object.taskGroups), i = 0; i < keys.length; ++i) { - if (typeof object.taskGroups[keys[i]] !== "object") - throw TypeError(".google.cloud.batch.v1.JobStatus.taskGroups: object expected"); - message.taskGroups[keys[i]] = $root.google.cloud.batch.v1.JobStatus.TaskGroupStatus.fromObject(object.taskGroups[keys[i]]); - } - } - if (object.runDuration != null) { - if (typeof object.runDuration !== "object") - throw TypeError(".google.cloud.batch.v1.JobStatus.runDuration: object expected"); - message.runDuration = $root.google.protobuf.Duration.fromObject(object.runDuration); - } - return message; - }; - - /** - * Creates a plain object from a JobStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.JobStatus - * @static - * @param {google.cloud.batch.v1.JobStatus} message JobStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - JobStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.statusEvents = []; - if (options.objects || options.defaults) - object.taskGroups = {}; - if (options.defaults) { - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.runDuration = null; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.batch.v1.JobStatus.State[message.state] === undefined ? message.state : $root.google.cloud.batch.v1.JobStatus.State[message.state] : message.state; - if (message.statusEvents && message.statusEvents.length) { - object.statusEvents = []; - for (var j = 0; j < message.statusEvents.length; ++j) - object.statusEvents[j] = $root.google.cloud.batch.v1.StatusEvent.toObject(message.statusEvents[j], options); - } - var keys2; - if (message.taskGroups && (keys2 = Object.keys(message.taskGroups)).length) { - object.taskGroups = {}; - for (var j = 0; j < keys2.length; ++j) - object.taskGroups[keys2[j]] = $root.google.cloud.batch.v1.JobStatus.TaskGroupStatus.toObject(message.taskGroups[keys2[j]], options); - } - if (message.runDuration != null && message.hasOwnProperty("runDuration")) - object.runDuration = $root.google.protobuf.Duration.toObject(message.runDuration, options); - return object; - }; - - /** - * Converts this JobStatus to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.JobStatus - * @instance - * @returns {Object.} JSON object - */ - JobStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for JobStatus - * @function getTypeUrl - * @memberof google.cloud.batch.v1.JobStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - JobStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.JobStatus"; - }; - - JobStatus.InstanceStatus = (function() { - - /** - * Properties of an InstanceStatus. - * @memberof google.cloud.batch.v1.JobStatus - * @interface IInstanceStatus - * @property {string|null} [machineType] InstanceStatus machineType - * @property {google.cloud.batch.v1.AllocationPolicy.ProvisioningModel|null} [provisioningModel] InstanceStatus provisioningModel - * @property {number|Long|null} [taskPack] InstanceStatus taskPack - * @property {google.cloud.batch.v1.AllocationPolicy.IDisk|null} [bootDisk] InstanceStatus bootDisk - */ - - /** - * Constructs a new InstanceStatus. - * @memberof google.cloud.batch.v1.JobStatus - * @classdesc Represents an InstanceStatus. - * @implements IInstanceStatus - * @constructor - * @param {google.cloud.batch.v1.JobStatus.IInstanceStatus=} [properties] Properties to set - */ - function InstanceStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InstanceStatus machineType. - * @member {string} machineType - * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus - * @instance - */ - InstanceStatus.prototype.machineType = ""; - - /** - * InstanceStatus provisioningModel. - * @member {google.cloud.batch.v1.AllocationPolicy.ProvisioningModel} provisioningModel - * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus - * @instance - */ - InstanceStatus.prototype.provisioningModel = 0; - - /** - * InstanceStatus taskPack. - * @member {number|Long} taskPack - * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus - * @instance - */ - InstanceStatus.prototype.taskPack = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * InstanceStatus bootDisk. - * @member {google.cloud.batch.v1.AllocationPolicy.IDisk|null|undefined} bootDisk - * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus - * @instance - */ - InstanceStatus.prototype.bootDisk = null; - - /** - * Creates a new InstanceStatus instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus - * @static - * @param {google.cloud.batch.v1.JobStatus.IInstanceStatus=} [properties] Properties to set - * @returns {google.cloud.batch.v1.JobStatus.InstanceStatus} InstanceStatus instance - */ - InstanceStatus.create = function create(properties) { - return new InstanceStatus(properties); - }; - - /** - * Encodes the specified InstanceStatus message. Does not implicitly {@link google.cloud.batch.v1.JobStatus.InstanceStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus - * @static - * @param {google.cloud.batch.v1.JobStatus.IInstanceStatus} message InstanceStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.machineType); - if (message.provisioningModel != null && Object.hasOwnProperty.call(message, "provisioningModel")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.provisioningModel); - if (message.taskPack != null && Object.hasOwnProperty.call(message, "taskPack")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.taskPack); - if (message.bootDisk != null && Object.hasOwnProperty.call(message, "bootDisk")) - $root.google.cloud.batch.v1.AllocationPolicy.Disk.encode(message.bootDisk, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified InstanceStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobStatus.InstanceStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus - * @static - * @param {google.cloud.batch.v1.JobStatus.IInstanceStatus} message InstanceStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InstanceStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.JobStatus.InstanceStatus} InstanceStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceStatus.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.JobStatus.InstanceStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.machineType = reader.string(); - break; - } - case 2: { - message.provisioningModel = reader.int32(); - break; - } - case 3: { - message.taskPack = reader.int64(); - break; - } - case 4: { - message.bootDisk = $root.google.cloud.batch.v1.AllocationPolicy.Disk.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InstanceStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.JobStatus.InstanceStatus} InstanceStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InstanceStatus message. - * @function verify - * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstanceStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.machineType != null && message.hasOwnProperty("machineType")) - if (!$util.isString(message.machineType)) - return "machineType: string expected"; - if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) - switch (message.provisioningModel) { - default: - return "provisioningModel: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.taskPack != null && message.hasOwnProperty("taskPack")) - if (!$util.isInteger(message.taskPack) && !(message.taskPack && $util.isInteger(message.taskPack.low) && $util.isInteger(message.taskPack.high))) - return "taskPack: integer|Long expected"; - if (message.bootDisk != null && message.hasOwnProperty("bootDisk")) { - var error = $root.google.cloud.batch.v1.AllocationPolicy.Disk.verify(message.bootDisk); - if (error) - return "bootDisk." + error; - } - return null; - }; - - /** - * Creates an InstanceStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.JobStatus.InstanceStatus} InstanceStatus - */ - InstanceStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.JobStatus.InstanceStatus) - return object; - var message = new $root.google.cloud.batch.v1.JobStatus.InstanceStatus(); - if (object.machineType != null) - message.machineType = String(object.machineType); - switch (object.provisioningModel) { - default: - if (typeof object.provisioningModel === "number") { - message.provisioningModel = object.provisioningModel; - break; - } - break; - case "PROVISIONING_MODEL_UNSPECIFIED": - case 0: - message.provisioningModel = 0; - break; - case "STANDARD": - case 1: - message.provisioningModel = 1; - break; - case "SPOT": - case 2: - message.provisioningModel = 2; - break; - case "PREEMPTIBLE": - case 3: - message.provisioningModel = 3; - break; - } - if (object.taskPack != null) - if ($util.Long) - (message.taskPack = $util.Long.fromValue(object.taskPack)).unsigned = false; - else if (typeof object.taskPack === "string") - message.taskPack = parseInt(object.taskPack, 10); - else if (typeof object.taskPack === "number") - message.taskPack = object.taskPack; - else if (typeof object.taskPack === "object") - message.taskPack = new $util.LongBits(object.taskPack.low >>> 0, object.taskPack.high >>> 0).toNumber(); - if (object.bootDisk != null) { - if (typeof object.bootDisk !== "object") - throw TypeError(".google.cloud.batch.v1.JobStatus.InstanceStatus.bootDisk: object expected"); - message.bootDisk = $root.google.cloud.batch.v1.AllocationPolicy.Disk.fromObject(object.bootDisk); - } - return message; - }; - - /** - * Creates a plain object from an InstanceStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus - * @static - * @param {google.cloud.batch.v1.JobStatus.InstanceStatus} message InstanceStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstanceStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.machineType = ""; - object.provisioningModel = options.enums === String ? "PROVISIONING_MODEL_UNSPECIFIED" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.taskPack = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.taskPack = options.longs === String ? "0" : 0; - object.bootDisk = null; - } - if (message.machineType != null && message.hasOwnProperty("machineType")) - object.machineType = message.machineType; - if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) - object.provisioningModel = options.enums === String ? $root.google.cloud.batch.v1.AllocationPolicy.ProvisioningModel[message.provisioningModel] === undefined ? message.provisioningModel : $root.google.cloud.batch.v1.AllocationPolicy.ProvisioningModel[message.provisioningModel] : message.provisioningModel; - if (message.taskPack != null && message.hasOwnProperty("taskPack")) - if (typeof message.taskPack === "number") - object.taskPack = options.longs === String ? String(message.taskPack) : message.taskPack; - else - object.taskPack = options.longs === String ? $util.Long.prototype.toString.call(message.taskPack) : options.longs === Number ? new $util.LongBits(message.taskPack.low >>> 0, message.taskPack.high >>> 0).toNumber() : message.taskPack; - if (message.bootDisk != null && message.hasOwnProperty("bootDisk")) - object.bootDisk = $root.google.cloud.batch.v1.AllocationPolicy.Disk.toObject(message.bootDisk, options); - return object; - }; - - /** - * Converts this InstanceStatus to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus - * @instance - * @returns {Object.} JSON object - */ - InstanceStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InstanceStatus - * @function getTypeUrl - * @memberof google.cloud.batch.v1.JobStatus.InstanceStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstanceStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.JobStatus.InstanceStatus"; - }; - - return InstanceStatus; - })(); - - JobStatus.TaskGroupStatus = (function() { - - /** - * Properties of a TaskGroupStatus. - * @memberof google.cloud.batch.v1.JobStatus - * @interface ITaskGroupStatus - * @property {Object.|null} [counts] TaskGroupStatus counts - * @property {Array.|null} [instances] TaskGroupStatus instances - */ - - /** - * Constructs a new TaskGroupStatus. - * @memberof google.cloud.batch.v1.JobStatus - * @classdesc Represents a TaskGroupStatus. - * @implements ITaskGroupStatus - * @constructor - * @param {google.cloud.batch.v1.JobStatus.ITaskGroupStatus=} [properties] Properties to set - */ - function TaskGroupStatus(properties) { - this.counts = {}; - this.instances = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TaskGroupStatus counts. - * @member {Object.} counts - * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus - * @instance - */ - TaskGroupStatus.prototype.counts = $util.emptyObject; - - /** - * TaskGroupStatus instances. - * @member {Array.} instances - * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus - * @instance - */ - TaskGroupStatus.prototype.instances = $util.emptyArray; - - /** - * Creates a new TaskGroupStatus instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus - * @static - * @param {google.cloud.batch.v1.JobStatus.ITaskGroupStatus=} [properties] Properties to set - * @returns {google.cloud.batch.v1.JobStatus.TaskGroupStatus} TaskGroupStatus instance - */ - TaskGroupStatus.create = function create(properties) { - return new TaskGroupStatus(properties); - }; - - /** - * Encodes the specified TaskGroupStatus message. Does not implicitly {@link google.cloud.batch.v1.JobStatus.TaskGroupStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus - * @static - * @param {google.cloud.batch.v1.JobStatus.ITaskGroupStatus} message TaskGroupStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskGroupStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.counts != null && Object.hasOwnProperty.call(message, "counts")) - for (var keys = Object.keys(message.counts), i = 0; i < keys.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int64(message.counts[keys[i]]).ldelim(); - if (message.instances != null && message.instances.length) - for (var i = 0; i < message.instances.length; ++i) - $root.google.cloud.batch.v1.JobStatus.InstanceStatus.encode(message.instances[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TaskGroupStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobStatus.TaskGroupStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus - * @static - * @param {google.cloud.batch.v1.JobStatus.ITaskGroupStatus} message TaskGroupStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskGroupStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TaskGroupStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.JobStatus.TaskGroupStatus} TaskGroupStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskGroupStatus.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.JobStatus.TaskGroupStatus(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (message.counts === $util.emptyObject) - message.counts = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = 0; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.int64(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.counts[key] = value; - break; - } - case 2: { - if (!(message.instances && message.instances.length)) - message.instances = []; - message.instances.push($root.google.cloud.batch.v1.JobStatus.InstanceStatus.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TaskGroupStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.JobStatus.TaskGroupStatus} TaskGroupStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskGroupStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TaskGroupStatus message. - * @function verify - * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TaskGroupStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.counts != null && message.hasOwnProperty("counts")) { - if (!$util.isObject(message.counts)) - return "counts: object expected"; - var key = Object.keys(message.counts); - for (var i = 0; i < key.length; ++i) - if (!$util.isInteger(message.counts[key[i]]) && !(message.counts[key[i]] && $util.isInteger(message.counts[key[i]].low) && $util.isInteger(message.counts[key[i]].high))) - return "counts: integer|Long{k:string} expected"; - } - if (message.instances != null && message.hasOwnProperty("instances")) { - if (!Array.isArray(message.instances)) - return "instances: array expected"; - for (var i = 0; i < message.instances.length; ++i) { - var error = $root.google.cloud.batch.v1.JobStatus.InstanceStatus.verify(message.instances[i]); - if (error) - return "instances." + error; - } - } - return null; - }; - - /** - * Creates a TaskGroupStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.JobStatus.TaskGroupStatus} TaskGroupStatus - */ - TaskGroupStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.JobStatus.TaskGroupStatus) - return object; - var message = new $root.google.cloud.batch.v1.JobStatus.TaskGroupStatus(); - if (object.counts) { - if (typeof object.counts !== "object") - throw TypeError(".google.cloud.batch.v1.JobStatus.TaskGroupStatus.counts: object expected"); - message.counts = {}; - for (var keys = Object.keys(object.counts), i = 0; i < keys.length; ++i) - if ($util.Long) - (message.counts[keys[i]] = $util.Long.fromValue(object.counts[keys[i]])).unsigned = false; - else if (typeof object.counts[keys[i]] === "string") - message.counts[keys[i]] = parseInt(object.counts[keys[i]], 10); - else if (typeof object.counts[keys[i]] === "number") - message.counts[keys[i]] = object.counts[keys[i]]; - else if (typeof object.counts[keys[i]] === "object") - message.counts[keys[i]] = new $util.LongBits(object.counts[keys[i]].low >>> 0, object.counts[keys[i]].high >>> 0).toNumber(); - } - if (object.instances) { - if (!Array.isArray(object.instances)) - throw TypeError(".google.cloud.batch.v1.JobStatus.TaskGroupStatus.instances: array expected"); - message.instances = []; - for (var i = 0; i < object.instances.length; ++i) { - if (typeof object.instances[i] !== "object") - throw TypeError(".google.cloud.batch.v1.JobStatus.TaskGroupStatus.instances: object expected"); - message.instances[i] = $root.google.cloud.batch.v1.JobStatus.InstanceStatus.fromObject(object.instances[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a TaskGroupStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus - * @static - * @param {google.cloud.batch.v1.JobStatus.TaskGroupStatus} message TaskGroupStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TaskGroupStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.instances = []; - if (options.objects || options.defaults) - object.counts = {}; - var keys2; - if (message.counts && (keys2 = Object.keys(message.counts)).length) { - object.counts = {}; - for (var j = 0; j < keys2.length; ++j) - if (typeof message.counts[keys2[j]] === "number") - object.counts[keys2[j]] = options.longs === String ? String(message.counts[keys2[j]]) : message.counts[keys2[j]]; - else - object.counts[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.counts[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.counts[keys2[j]].low >>> 0, message.counts[keys2[j]].high >>> 0).toNumber() : message.counts[keys2[j]]; - } - if (message.instances && message.instances.length) { - object.instances = []; - for (var j = 0; j < message.instances.length; ++j) - object.instances[j] = $root.google.cloud.batch.v1.JobStatus.InstanceStatus.toObject(message.instances[j], options); - } - return object; - }; - - /** - * Converts this TaskGroupStatus to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus - * @instance - * @returns {Object.} JSON object - */ - TaskGroupStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TaskGroupStatus - * @function getTypeUrl - * @memberof google.cloud.batch.v1.JobStatus.TaskGroupStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TaskGroupStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.JobStatus.TaskGroupStatus"; - }; - - return TaskGroupStatus; - })(); - - /** - * State enum. - * @name google.cloud.batch.v1.JobStatus.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} QUEUED=1 QUEUED value - * @property {number} SCHEDULED=2 SCHEDULED value - * @property {number} RUNNING=3 RUNNING value - * @property {number} SUCCEEDED=4 SUCCEEDED value - * @property {number} FAILED=5 FAILED value - * @property {number} DELETION_IN_PROGRESS=6 DELETION_IN_PROGRESS value - */ - JobStatus.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "QUEUED"] = 1; - values[valuesById[2] = "SCHEDULED"] = 2; - values[valuesById[3] = "RUNNING"] = 3; - values[valuesById[4] = "SUCCEEDED"] = 4; - values[valuesById[5] = "FAILED"] = 5; - values[valuesById[6] = "DELETION_IN_PROGRESS"] = 6; - return values; - })(); - - return JobStatus; - })(); - - v1.JobNotification = (function() { - - /** - * Properties of a JobNotification. - * @memberof google.cloud.batch.v1 - * @interface IJobNotification - * @property {string|null} [pubsubTopic] JobNotification pubsubTopic - * @property {google.cloud.batch.v1.JobNotification.IMessage|null} [message] JobNotification message - */ - - /** - * Constructs a new JobNotification. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a JobNotification. - * @implements IJobNotification - * @constructor - * @param {google.cloud.batch.v1.IJobNotification=} [properties] Properties to set - */ - function JobNotification(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * JobNotification pubsubTopic. - * @member {string} pubsubTopic - * @memberof google.cloud.batch.v1.JobNotification - * @instance - */ - JobNotification.prototype.pubsubTopic = ""; - - /** - * JobNotification message. - * @member {google.cloud.batch.v1.JobNotification.IMessage|null|undefined} message - * @memberof google.cloud.batch.v1.JobNotification - * @instance - */ - JobNotification.prototype.message = null; - - /** - * Creates a new JobNotification instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.JobNotification - * @static - * @param {google.cloud.batch.v1.IJobNotification=} [properties] Properties to set - * @returns {google.cloud.batch.v1.JobNotification} JobNotification instance - */ - JobNotification.create = function create(properties) { - return new JobNotification(properties); - }; - - /** - * Encodes the specified JobNotification message. Does not implicitly {@link google.cloud.batch.v1.JobNotification.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.JobNotification - * @static - * @param {google.cloud.batch.v1.IJobNotification} message JobNotification message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JobNotification.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pubsubTopic != null && Object.hasOwnProperty.call(message, "pubsubTopic")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.pubsubTopic); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - $root.google.cloud.batch.v1.JobNotification.Message.encode(message.message, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified JobNotification message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobNotification.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.JobNotification - * @static - * @param {google.cloud.batch.v1.IJobNotification} message JobNotification message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JobNotification.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a JobNotification message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.JobNotification - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.JobNotification} JobNotification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JobNotification.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.JobNotification(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.pubsubTopic = reader.string(); - break; - } - case 2: { - message.message = $root.google.cloud.batch.v1.JobNotification.Message.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a JobNotification message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.JobNotification - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.JobNotification} JobNotification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JobNotification.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a JobNotification message. - * @function verify - * @memberof google.cloud.batch.v1.JobNotification - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - JobNotification.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) - if (!$util.isString(message.pubsubTopic)) - return "pubsubTopic: string expected"; - if (message.message != null && message.hasOwnProperty("message")) { - var error = $root.google.cloud.batch.v1.JobNotification.Message.verify(message.message); - if (error) - return "message." + error; - } - return null; - }; - - /** - * Creates a JobNotification message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.JobNotification - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.JobNotification} JobNotification - */ - JobNotification.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.JobNotification) - return object; - var message = new $root.google.cloud.batch.v1.JobNotification(); - if (object.pubsubTopic != null) - message.pubsubTopic = String(object.pubsubTopic); - if (object.message != null) { - if (typeof object.message !== "object") - throw TypeError(".google.cloud.batch.v1.JobNotification.message: object expected"); - message.message = $root.google.cloud.batch.v1.JobNotification.Message.fromObject(object.message); - } - return message; - }; - - /** - * Creates a plain object from a JobNotification message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.JobNotification - * @static - * @param {google.cloud.batch.v1.JobNotification} message JobNotification - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - JobNotification.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.pubsubTopic = ""; - object.message = null; - } - if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) - object.pubsubTopic = message.pubsubTopic; - if (message.message != null && message.hasOwnProperty("message")) - object.message = $root.google.cloud.batch.v1.JobNotification.Message.toObject(message.message, options); - return object; - }; - - /** - * Converts this JobNotification to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.JobNotification - * @instance - * @returns {Object.} JSON object - */ - JobNotification.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for JobNotification - * @function getTypeUrl - * @memberof google.cloud.batch.v1.JobNotification - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - JobNotification.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.JobNotification"; - }; - - JobNotification.Message = (function() { - - /** - * Properties of a Message. - * @memberof google.cloud.batch.v1.JobNotification - * @interface IMessage - * @property {google.cloud.batch.v1.JobNotification.Type|null} [type] Message type - * @property {google.cloud.batch.v1.JobStatus.State|null} [newJobState] Message newJobState - * @property {google.cloud.batch.v1.TaskStatus.State|null} [newTaskState] Message newTaskState - */ - - /** - * Constructs a new Message. - * @memberof google.cloud.batch.v1.JobNotification - * @classdesc Represents a Message. - * @implements IMessage - * @constructor - * @param {google.cloud.batch.v1.JobNotification.IMessage=} [properties] Properties to set - */ - function Message(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Message type. - * @member {google.cloud.batch.v1.JobNotification.Type} type - * @memberof google.cloud.batch.v1.JobNotification.Message - * @instance - */ - Message.prototype.type = 0; - - /** - * Message newJobState. - * @member {google.cloud.batch.v1.JobStatus.State} newJobState - * @memberof google.cloud.batch.v1.JobNotification.Message - * @instance - */ - Message.prototype.newJobState = 0; - - /** - * Message newTaskState. - * @member {google.cloud.batch.v1.TaskStatus.State} newTaskState - * @memberof google.cloud.batch.v1.JobNotification.Message - * @instance - */ - Message.prototype.newTaskState = 0; - - /** - * Creates a new Message instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.JobNotification.Message - * @static - * @param {google.cloud.batch.v1.JobNotification.IMessage=} [properties] Properties to set - * @returns {google.cloud.batch.v1.JobNotification.Message} Message instance - */ - Message.create = function create(properties) { - return new Message(properties); - }; - - /** - * Encodes the specified Message message. Does not implicitly {@link google.cloud.batch.v1.JobNotification.Message.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.JobNotification.Message - * @static - * @param {google.cloud.batch.v1.JobNotification.IMessage} message Message message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Message.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); - if (message.newJobState != null && Object.hasOwnProperty.call(message, "newJobState")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.newJobState); - if (message.newTaskState != null && Object.hasOwnProperty.call(message, "newTaskState")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.newTaskState); - return writer; - }; - - /** - * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.batch.v1.JobNotification.Message.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.JobNotification.Message - * @static - * @param {google.cloud.batch.v1.JobNotification.IMessage} message Message message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Message.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Message message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.JobNotification.Message - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.JobNotification.Message} Message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Message.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.JobNotification.Message(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.type = reader.int32(); - break; - } - case 2: { - message.newJobState = reader.int32(); - break; - } - case 3: { - message.newTaskState = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Message message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.JobNotification.Message - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.JobNotification.Message} Message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Message.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Message message. - * @function verify - * @memberof google.cloud.batch.v1.JobNotification.Message - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Message.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.newJobState != null && message.hasOwnProperty("newJobState")) - switch (message.newJobState) { - default: - return "newJobState: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.newTaskState != null && message.hasOwnProperty("newTaskState")) - switch (message.newTaskState) { - default: - return "newTaskState: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - return null; - }; - - /** - * Creates a Message message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.JobNotification.Message - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.JobNotification.Message} Message - */ - Message.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.JobNotification.Message) - return object; - var message = new $root.google.cloud.batch.v1.JobNotification.Message(); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "JOB_STATE_CHANGED": - case 1: - message.type = 1; - break; - case "TASK_STATE_CHANGED": - case 2: - message.type = 2; - break; - } - switch (object.newJobState) { - default: - if (typeof object.newJobState === "number") { - message.newJobState = object.newJobState; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.newJobState = 0; - break; - case "QUEUED": - case 1: - message.newJobState = 1; - break; - case "SCHEDULED": - case 2: - message.newJobState = 2; - break; - case "RUNNING": - case 3: - message.newJobState = 3; - break; - case "SUCCEEDED": - case 4: - message.newJobState = 4; - break; - case "FAILED": - case 5: - message.newJobState = 5; - break; - case "DELETION_IN_PROGRESS": - case 6: - message.newJobState = 6; - break; - } - switch (object.newTaskState) { - default: - if (typeof object.newTaskState === "number") { - message.newTaskState = object.newTaskState; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.newTaskState = 0; - break; - case "PENDING": - case 1: - message.newTaskState = 1; - break; - case "ASSIGNED": - case 2: - message.newTaskState = 2; - break; - case "RUNNING": - case 3: - message.newTaskState = 3; - break; - case "FAILED": - case 4: - message.newTaskState = 4; - break; - case "SUCCEEDED": - case 5: - message.newTaskState = 5; - break; - case "UNEXECUTED": - case 6: - message.newTaskState = 6; - break; - } - return message; - }; - - /** - * Creates a plain object from a Message message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.JobNotification.Message - * @static - * @param {google.cloud.batch.v1.JobNotification.Message} message Message - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Message.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.newJobState = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.newTaskState = options.enums === String ? "STATE_UNSPECIFIED" : 0; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.batch.v1.JobNotification.Type[message.type] === undefined ? message.type : $root.google.cloud.batch.v1.JobNotification.Type[message.type] : message.type; - if (message.newJobState != null && message.hasOwnProperty("newJobState")) - object.newJobState = options.enums === String ? $root.google.cloud.batch.v1.JobStatus.State[message.newJobState] === undefined ? message.newJobState : $root.google.cloud.batch.v1.JobStatus.State[message.newJobState] : message.newJobState; - if (message.newTaskState != null && message.hasOwnProperty("newTaskState")) - object.newTaskState = options.enums === String ? $root.google.cloud.batch.v1.TaskStatus.State[message.newTaskState] === undefined ? message.newTaskState : $root.google.cloud.batch.v1.TaskStatus.State[message.newTaskState] : message.newTaskState; - return object; - }; - - /** - * Converts this Message to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.JobNotification.Message - * @instance - * @returns {Object.} JSON object - */ - Message.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Message - * @function getTypeUrl - * @memberof google.cloud.batch.v1.JobNotification.Message - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Message.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.JobNotification.Message"; - }; - - return Message; - })(); - - /** - * Type enum. - * @name google.cloud.batch.v1.JobNotification.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} JOB_STATE_CHANGED=1 JOB_STATE_CHANGED value - * @property {number} TASK_STATE_CHANGED=2 TASK_STATE_CHANGED value - */ - JobNotification.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "JOB_STATE_CHANGED"] = 1; - values[valuesById[2] = "TASK_STATE_CHANGED"] = 2; - return values; - })(); - - return JobNotification; - })(); - - v1.AllocationPolicy = (function() { - - /** - * Properties of an AllocationPolicy. - * @memberof google.cloud.batch.v1 - * @interface IAllocationPolicy - * @property {google.cloud.batch.v1.AllocationPolicy.ILocationPolicy|null} [location] AllocationPolicy location - * @property {Array.|null} [instances] AllocationPolicy instances - * @property {google.cloud.batch.v1.IServiceAccount|null} [serviceAccount] AllocationPolicy serviceAccount - * @property {Object.|null} [labels] AllocationPolicy labels - * @property {google.cloud.batch.v1.AllocationPolicy.INetworkPolicy|null} [network] AllocationPolicy network - * @property {google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy|null} [placement] AllocationPolicy placement - * @property {Array.|null} [tags] AllocationPolicy tags - */ - - /** - * Constructs a new AllocationPolicy. - * @memberof google.cloud.batch.v1 - * @classdesc Represents an AllocationPolicy. - * @implements IAllocationPolicy - * @constructor - * @param {google.cloud.batch.v1.IAllocationPolicy=} [properties] Properties to set - */ - function AllocationPolicy(properties) { - this.instances = []; - this.labels = {}; - this.tags = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AllocationPolicy location. - * @member {google.cloud.batch.v1.AllocationPolicy.ILocationPolicy|null|undefined} location - * @memberof google.cloud.batch.v1.AllocationPolicy - * @instance - */ - AllocationPolicy.prototype.location = null; - - /** - * AllocationPolicy instances. - * @member {Array.} instances - * @memberof google.cloud.batch.v1.AllocationPolicy - * @instance - */ - AllocationPolicy.prototype.instances = $util.emptyArray; - - /** - * AllocationPolicy serviceAccount. - * @member {google.cloud.batch.v1.IServiceAccount|null|undefined} serviceAccount - * @memberof google.cloud.batch.v1.AllocationPolicy - * @instance - */ - AllocationPolicy.prototype.serviceAccount = null; - - /** - * AllocationPolicy labels. - * @member {Object.} labels - * @memberof google.cloud.batch.v1.AllocationPolicy - * @instance - */ - AllocationPolicy.prototype.labels = $util.emptyObject; - - /** - * AllocationPolicy network. - * @member {google.cloud.batch.v1.AllocationPolicy.INetworkPolicy|null|undefined} network - * @memberof google.cloud.batch.v1.AllocationPolicy - * @instance - */ - AllocationPolicy.prototype.network = null; - - /** - * AllocationPolicy placement. - * @member {google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy|null|undefined} placement - * @memberof google.cloud.batch.v1.AllocationPolicy - * @instance - */ - AllocationPolicy.prototype.placement = null; - - /** - * AllocationPolicy tags. - * @member {Array.} tags - * @memberof google.cloud.batch.v1.AllocationPolicy - * @instance - */ - AllocationPolicy.prototype.tags = $util.emptyArray; - - /** - * Creates a new AllocationPolicy instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.AllocationPolicy - * @static - * @param {google.cloud.batch.v1.IAllocationPolicy=} [properties] Properties to set - * @returns {google.cloud.batch.v1.AllocationPolicy} AllocationPolicy instance - */ - AllocationPolicy.create = function create(properties) { - return new AllocationPolicy(properties); - }; - - /** - * Encodes the specified AllocationPolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.AllocationPolicy - * @static - * @param {google.cloud.batch.v1.IAllocationPolicy} message AllocationPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AllocationPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - $root.google.cloud.batch.v1.AllocationPolicy.LocationPolicy.encode(message.location, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.network != null && Object.hasOwnProperty.call(message, "network")) - $root.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.encode(message.network, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.instances != null && message.instances.length) - for (var i = 0; i < message.instances.length; ++i) - $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.encode(message.instances[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) - $root.google.cloud.batch.v1.ServiceAccount.encode(message.serviceAccount, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.placement != null && Object.hasOwnProperty.call(message, "placement")) - $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.encode(message.placement, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.tags != null && message.tags.length) - for (var i = 0; i < message.tags.length; ++i) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.tags[i]); - return writer; - }; - - /** - * Encodes the specified AllocationPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy - * @static - * @param {google.cloud.batch.v1.IAllocationPolicy} message AllocationPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AllocationPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AllocationPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.AllocationPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.AllocationPolicy} AllocationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AllocationPolicy.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.location = $root.google.cloud.batch.v1.AllocationPolicy.LocationPolicy.decode(reader, reader.uint32()); - break; - } - case 8: { - if (!(message.instances && message.instances.length)) - message.instances = []; - message.instances.push($root.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.decode(reader, reader.uint32())); - break; - } - case 9: { - message.serviceAccount = $root.google.cloud.batch.v1.ServiceAccount.decode(reader, reader.uint32()); - break; - } - case 6: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 7: { - message.network = $root.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.decode(reader, reader.uint32()); - break; - } - case 10: { - message.placement = $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.decode(reader, reader.uint32()); - break; - } - case 11: { - if (!(message.tags && message.tags.length)) - message.tags = []; - message.tags.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AllocationPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.AllocationPolicy} AllocationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AllocationPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AllocationPolicy message. - * @function verify - * @memberof google.cloud.batch.v1.AllocationPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AllocationPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) { - var error = $root.google.cloud.batch.v1.AllocationPolicy.LocationPolicy.verify(message.location); - if (error) - return "location." + error; - } - if (message.instances != null && message.hasOwnProperty("instances")) { - if (!Array.isArray(message.instances)) - return "instances: array expected"; - for (var i = 0; i < message.instances.length; ++i) { - var error = $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.verify(message.instances[i]); - if (error) - return "instances." + error; - } - } - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) { - var error = $root.google.cloud.batch.v1.ServiceAccount.verify(message.serviceAccount); - if (error) - return "serviceAccount." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.network != null && message.hasOwnProperty("network")) { - var error = $root.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.verify(message.network); - if (error) - return "network." + error; - } - if (message.placement != null && message.hasOwnProperty("placement")) { - var error = $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.verify(message.placement); - if (error) - return "placement." + error; - } - if (message.tags != null && message.hasOwnProperty("tags")) { - if (!Array.isArray(message.tags)) - return "tags: array expected"; - for (var i = 0; i < message.tags.length; ++i) - if (!$util.isString(message.tags[i])) - return "tags: string[] expected"; - } - return null; - }; - - /** - * Creates an AllocationPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.AllocationPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.AllocationPolicy} AllocationPolicy - */ - AllocationPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy) - return object; - var message = new $root.google.cloud.batch.v1.AllocationPolicy(); - if (object.location != null) { - if (typeof object.location !== "object") - throw TypeError(".google.cloud.batch.v1.AllocationPolicy.location: object expected"); - message.location = $root.google.cloud.batch.v1.AllocationPolicy.LocationPolicy.fromObject(object.location); - } - if (object.instances) { - if (!Array.isArray(object.instances)) - throw TypeError(".google.cloud.batch.v1.AllocationPolicy.instances: array expected"); - message.instances = []; - for (var i = 0; i < object.instances.length; ++i) { - if (typeof object.instances[i] !== "object") - throw TypeError(".google.cloud.batch.v1.AllocationPolicy.instances: object expected"); - message.instances[i] = $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.fromObject(object.instances[i]); - } - } - if (object.serviceAccount != null) { - if (typeof object.serviceAccount !== "object") - throw TypeError(".google.cloud.batch.v1.AllocationPolicy.serviceAccount: object expected"); - message.serviceAccount = $root.google.cloud.batch.v1.ServiceAccount.fromObject(object.serviceAccount); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.batch.v1.AllocationPolicy.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - if (object.network != null) { - if (typeof object.network !== "object") - throw TypeError(".google.cloud.batch.v1.AllocationPolicy.network: object expected"); - message.network = $root.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.fromObject(object.network); - } - if (object.placement != null) { - if (typeof object.placement !== "object") - throw TypeError(".google.cloud.batch.v1.AllocationPolicy.placement: object expected"); - message.placement = $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.fromObject(object.placement); - } - if (object.tags) { - if (!Array.isArray(object.tags)) - throw TypeError(".google.cloud.batch.v1.AllocationPolicy.tags: array expected"); - message.tags = []; - for (var i = 0; i < object.tags.length; ++i) - message.tags[i] = String(object.tags[i]); - } - return message; - }; - - /** - * Creates a plain object from an AllocationPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.AllocationPolicy - * @static - * @param {google.cloud.batch.v1.AllocationPolicy} message AllocationPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AllocationPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.instances = []; - object.tags = []; - } - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.location = null; - object.network = null; - object.serviceAccount = null; - object.placement = null; - } - if (message.location != null && message.hasOwnProperty("location")) - object.location = $root.google.cloud.batch.v1.AllocationPolicy.LocationPolicy.toObject(message.location, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.network != null && message.hasOwnProperty("network")) - object.network = $root.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.toObject(message.network, options); - if (message.instances && message.instances.length) { - object.instances = []; - for (var j = 0; j < message.instances.length; ++j) - object.instances[j] = $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.toObject(message.instances[j], options); - } - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - object.serviceAccount = $root.google.cloud.batch.v1.ServiceAccount.toObject(message.serviceAccount, options); - if (message.placement != null && message.hasOwnProperty("placement")) - object.placement = $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.toObject(message.placement, options); - if (message.tags && message.tags.length) { - object.tags = []; - for (var j = 0; j < message.tags.length; ++j) - object.tags[j] = message.tags[j]; - } - return object; - }; - - /** - * Converts this AllocationPolicy to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.AllocationPolicy - * @instance - * @returns {Object.} JSON object - */ - AllocationPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AllocationPolicy - * @function getTypeUrl - * @memberof google.cloud.batch.v1.AllocationPolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AllocationPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy"; - }; - - AllocationPolicy.LocationPolicy = (function() { - - /** - * Properties of a LocationPolicy. - * @memberof google.cloud.batch.v1.AllocationPolicy - * @interface ILocationPolicy - * @property {Array.|null} [allowedLocations] LocationPolicy allowedLocations - */ - - /** - * Constructs a new LocationPolicy. - * @memberof google.cloud.batch.v1.AllocationPolicy - * @classdesc Represents a LocationPolicy. - * @implements ILocationPolicy - * @constructor - * @param {google.cloud.batch.v1.AllocationPolicy.ILocationPolicy=} [properties] Properties to set - */ - function LocationPolicy(properties) { - this.allowedLocations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LocationPolicy allowedLocations. - * @member {Array.} allowedLocations - * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy - * @instance - */ - LocationPolicy.prototype.allowedLocations = $util.emptyArray; - - /** - * Creates a new LocationPolicy instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.ILocationPolicy=} [properties] Properties to set - * @returns {google.cloud.batch.v1.AllocationPolicy.LocationPolicy} LocationPolicy instance - */ - LocationPolicy.create = function create(properties) { - return new LocationPolicy(properties); - }; - - /** - * Encodes the specified LocationPolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.LocationPolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.ILocationPolicy} message LocationPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LocationPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowedLocations != null && message.allowedLocations.length) - for (var i = 0; i < message.allowedLocations.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedLocations[i]); - return writer; - }; - - /** - * Encodes the specified LocationPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.LocationPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.ILocationPolicy} message LocationPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LocationPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LocationPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.AllocationPolicy.LocationPolicy} LocationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LocationPolicy.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy.LocationPolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.allowedLocations && message.allowedLocations.length)) - message.allowedLocations = []; - message.allowedLocations.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LocationPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.AllocationPolicy.LocationPolicy} LocationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LocationPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LocationPolicy message. - * @function verify - * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LocationPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowedLocations != null && message.hasOwnProperty("allowedLocations")) { - if (!Array.isArray(message.allowedLocations)) - return "allowedLocations: array expected"; - for (var i = 0; i < message.allowedLocations.length; ++i) - if (!$util.isString(message.allowedLocations[i])) - return "allowedLocations: string[] expected"; - } - return null; - }; - - /** - * Creates a LocationPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.AllocationPolicy.LocationPolicy} LocationPolicy - */ - LocationPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy.LocationPolicy) - return object; - var message = new $root.google.cloud.batch.v1.AllocationPolicy.LocationPolicy(); - if (object.allowedLocations) { - if (!Array.isArray(object.allowedLocations)) - throw TypeError(".google.cloud.batch.v1.AllocationPolicy.LocationPolicy.allowedLocations: array expected"); - message.allowedLocations = []; - for (var i = 0; i < object.allowedLocations.length; ++i) - message.allowedLocations[i] = String(object.allowedLocations[i]); - } - return message; - }; - - /** - * Creates a plain object from a LocationPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.LocationPolicy} message LocationPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LocationPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.allowedLocations = []; - if (message.allowedLocations && message.allowedLocations.length) { - object.allowedLocations = []; - for (var j = 0; j < message.allowedLocations.length; ++j) - object.allowedLocations[j] = message.allowedLocations[j]; - } - return object; - }; - - /** - * Converts this LocationPolicy to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy - * @instance - * @returns {Object.} JSON object - */ - LocationPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LocationPolicy - * @function getTypeUrl - * @memberof google.cloud.batch.v1.AllocationPolicy.LocationPolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LocationPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy.LocationPolicy"; - }; - - return LocationPolicy; - })(); - - AllocationPolicy.Disk = (function() { - - /** - * Properties of a Disk. - * @memberof google.cloud.batch.v1.AllocationPolicy - * @interface IDisk - * @property {string|null} [image] Disk image - * @property {string|null} [snapshot] Disk snapshot - * @property {string|null} [type] Disk type - * @property {number|Long|null} [sizeGb] Disk sizeGb - * @property {string|null} [diskInterface] Disk diskInterface - */ - - /** - * Constructs a new Disk. - * @memberof google.cloud.batch.v1.AllocationPolicy - * @classdesc Represents a Disk. - * @implements IDisk - * @constructor - * @param {google.cloud.batch.v1.AllocationPolicy.IDisk=} [properties] Properties to set - */ - function Disk(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Disk image. - * @member {string|null|undefined} image - * @memberof google.cloud.batch.v1.AllocationPolicy.Disk - * @instance - */ - Disk.prototype.image = null; - - /** - * Disk snapshot. - * @member {string|null|undefined} snapshot - * @memberof google.cloud.batch.v1.AllocationPolicy.Disk - * @instance - */ - Disk.prototype.snapshot = null; - - /** - * Disk type. - * @member {string} type - * @memberof google.cloud.batch.v1.AllocationPolicy.Disk - * @instance - */ - Disk.prototype.type = ""; - - /** - * Disk sizeGb. - * @member {number|Long} sizeGb - * @memberof google.cloud.batch.v1.AllocationPolicy.Disk - * @instance - */ - Disk.prototype.sizeGb = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Disk diskInterface. - * @member {string} diskInterface - * @memberof google.cloud.batch.v1.AllocationPolicy.Disk - * @instance - */ - Disk.prototype.diskInterface = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Disk dataSource. - * @member {"image"|"snapshot"|undefined} dataSource - * @memberof google.cloud.batch.v1.AllocationPolicy.Disk - * @instance - */ - Object.defineProperty(Disk.prototype, "dataSource", { - get: $util.oneOfGetter($oneOfFields = ["image", "snapshot"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Disk instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.AllocationPolicy.Disk - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.IDisk=} [properties] Properties to set - * @returns {google.cloud.batch.v1.AllocationPolicy.Disk} Disk instance - */ - Disk.create = function create(properties) { - return new Disk(properties); - }; - - /** - * Encodes the specified Disk message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.Disk.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.AllocationPolicy.Disk - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.IDisk} message Disk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Disk.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.sizeGb != null && Object.hasOwnProperty.call(message, "sizeGb")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.sizeGb); - if (message.image != null && Object.hasOwnProperty.call(message, "image")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.image); - if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.snapshot); - if (message.diskInterface != null && Object.hasOwnProperty.call(message, "diskInterface")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.diskInterface); - return writer; - }; - - /** - * Encodes the specified Disk message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.Disk.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy.Disk - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.IDisk} message Disk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Disk.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Disk message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.AllocationPolicy.Disk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.AllocationPolicy.Disk} Disk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Disk.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy.Disk(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 4: { - message.image = reader.string(); - break; - } - case 5: { - message.snapshot = reader.string(); - break; - } - case 1: { - message.type = reader.string(); - break; - } - case 2: { - message.sizeGb = reader.int64(); - break; - } - case 6: { - message.diskInterface = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Disk message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy.Disk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.AllocationPolicy.Disk} Disk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Disk.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Disk message. - * @function verify - * @memberof google.cloud.batch.v1.AllocationPolicy.Disk - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Disk.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.image != null && message.hasOwnProperty("image")) { - properties.dataSource = 1; - if (!$util.isString(message.image)) - return "image: string expected"; - } - if (message.snapshot != null && message.hasOwnProperty("snapshot")) { - if (properties.dataSource === 1) - return "dataSource: multiple values"; - properties.dataSource = 1; - if (!$util.isString(message.snapshot)) - return "snapshot: string expected"; - } - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) - if (!$util.isInteger(message.sizeGb) && !(message.sizeGb && $util.isInteger(message.sizeGb.low) && $util.isInteger(message.sizeGb.high))) - return "sizeGb: integer|Long expected"; - if (message.diskInterface != null && message.hasOwnProperty("diskInterface")) - if (!$util.isString(message.diskInterface)) - return "diskInterface: string expected"; - return null; - }; - - /** - * Creates a Disk message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.AllocationPolicy.Disk - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.AllocationPolicy.Disk} Disk - */ - Disk.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy.Disk) - return object; - var message = new $root.google.cloud.batch.v1.AllocationPolicy.Disk(); - if (object.image != null) - message.image = String(object.image); - if (object.snapshot != null) - message.snapshot = String(object.snapshot); - if (object.type != null) - message.type = String(object.type); - if (object.sizeGb != null) - if ($util.Long) - (message.sizeGb = $util.Long.fromValue(object.sizeGb)).unsigned = false; - else if (typeof object.sizeGb === "string") - message.sizeGb = parseInt(object.sizeGb, 10); - else if (typeof object.sizeGb === "number") - message.sizeGb = object.sizeGb; - else if (typeof object.sizeGb === "object") - message.sizeGb = new $util.LongBits(object.sizeGb.low >>> 0, object.sizeGb.high >>> 0).toNumber(); - if (object.diskInterface != null) - message.diskInterface = String(object.diskInterface); - return message; - }; - - /** - * Creates a plain object from a Disk message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.AllocationPolicy.Disk - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.Disk} message Disk - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Disk.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.sizeGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sizeGb = options.longs === String ? "0" : 0; - object.diskInterface = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) - if (typeof message.sizeGb === "number") - object.sizeGb = options.longs === String ? String(message.sizeGb) : message.sizeGb; - else - object.sizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.sizeGb) : options.longs === Number ? new $util.LongBits(message.sizeGb.low >>> 0, message.sizeGb.high >>> 0).toNumber() : message.sizeGb; - if (message.image != null && message.hasOwnProperty("image")) { - object.image = message.image; - if (options.oneofs) - object.dataSource = "image"; - } - if (message.snapshot != null && message.hasOwnProperty("snapshot")) { - object.snapshot = message.snapshot; - if (options.oneofs) - object.dataSource = "snapshot"; - } - if (message.diskInterface != null && message.hasOwnProperty("diskInterface")) - object.diskInterface = message.diskInterface; - return object; - }; - - /** - * Converts this Disk to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.AllocationPolicy.Disk - * @instance - * @returns {Object.} JSON object - */ - Disk.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Disk - * @function getTypeUrl - * @memberof google.cloud.batch.v1.AllocationPolicy.Disk - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Disk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy.Disk"; - }; - - return Disk; - })(); - - AllocationPolicy.AttachedDisk = (function() { - - /** - * Properties of an AttachedDisk. - * @memberof google.cloud.batch.v1.AllocationPolicy - * @interface IAttachedDisk - * @property {google.cloud.batch.v1.AllocationPolicy.IDisk|null} [newDisk] AttachedDisk newDisk - * @property {string|null} [existingDisk] AttachedDisk existingDisk - * @property {string|null} [deviceName] AttachedDisk deviceName - */ - - /** - * Constructs a new AttachedDisk. - * @memberof google.cloud.batch.v1.AllocationPolicy - * @classdesc Represents an AttachedDisk. - * @implements IAttachedDisk - * @constructor - * @param {google.cloud.batch.v1.AllocationPolicy.IAttachedDisk=} [properties] Properties to set - */ - function AttachedDisk(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AttachedDisk newDisk. - * @member {google.cloud.batch.v1.AllocationPolicy.IDisk|null|undefined} newDisk - * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk - * @instance - */ - AttachedDisk.prototype.newDisk = null; - - /** - * AttachedDisk existingDisk. - * @member {string|null|undefined} existingDisk - * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk - * @instance - */ - AttachedDisk.prototype.existingDisk = null; - - /** - * AttachedDisk deviceName. - * @member {string} deviceName - * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk - * @instance - */ - AttachedDisk.prototype.deviceName = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * AttachedDisk attached. - * @member {"newDisk"|"existingDisk"|undefined} attached - * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk - * @instance - */ - Object.defineProperty(AttachedDisk.prototype, "attached", { - get: $util.oneOfGetter($oneOfFields = ["newDisk", "existingDisk"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new AttachedDisk instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.IAttachedDisk=} [properties] Properties to set - * @returns {google.cloud.batch.v1.AllocationPolicy.AttachedDisk} AttachedDisk instance - */ - AttachedDisk.create = function create(properties) { - return new AttachedDisk(properties); - }; - - /** - * Encodes the specified AttachedDisk message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.AttachedDisk.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.IAttachedDisk} message AttachedDisk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttachedDisk.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.newDisk != null && Object.hasOwnProperty.call(message, "newDisk")) - $root.google.cloud.batch.v1.AllocationPolicy.Disk.encode(message.newDisk, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.existingDisk != null && Object.hasOwnProperty.call(message, "existingDisk")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.existingDisk); - if (message.deviceName != null && Object.hasOwnProperty.call(message, "deviceName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.deviceName); - return writer; - }; - - /** - * Encodes the specified AttachedDisk message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.AttachedDisk.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.IAttachedDisk} message AttachedDisk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttachedDisk.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AttachedDisk message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.AllocationPolicy.AttachedDisk} AttachedDisk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttachedDisk.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy.AttachedDisk(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.newDisk = $root.google.cloud.batch.v1.AllocationPolicy.Disk.decode(reader, reader.uint32()); - break; - } - case 2: { - message.existingDisk = reader.string(); - break; - } - case 3: { - message.deviceName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AttachedDisk message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.AllocationPolicy.AttachedDisk} AttachedDisk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttachedDisk.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AttachedDisk message. - * @function verify - * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AttachedDisk.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.newDisk != null && message.hasOwnProperty("newDisk")) { - properties.attached = 1; - { - var error = $root.google.cloud.batch.v1.AllocationPolicy.Disk.verify(message.newDisk); - if (error) - return "newDisk." + error; - } - } - if (message.existingDisk != null && message.hasOwnProperty("existingDisk")) { - if (properties.attached === 1) - return "attached: multiple values"; - properties.attached = 1; - if (!$util.isString(message.existingDisk)) - return "existingDisk: string expected"; - } - if (message.deviceName != null && message.hasOwnProperty("deviceName")) - if (!$util.isString(message.deviceName)) - return "deviceName: string expected"; - return null; - }; - - /** - * Creates an AttachedDisk message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.AllocationPolicy.AttachedDisk} AttachedDisk - */ - AttachedDisk.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy.AttachedDisk) - return object; - var message = new $root.google.cloud.batch.v1.AllocationPolicy.AttachedDisk(); - if (object.newDisk != null) { - if (typeof object.newDisk !== "object") - throw TypeError(".google.cloud.batch.v1.AllocationPolicy.AttachedDisk.newDisk: object expected"); - message.newDisk = $root.google.cloud.batch.v1.AllocationPolicy.Disk.fromObject(object.newDisk); - } - if (object.existingDisk != null) - message.existingDisk = String(object.existingDisk); - if (object.deviceName != null) - message.deviceName = String(object.deviceName); - return message; - }; - - /** - * Creates a plain object from an AttachedDisk message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.AttachedDisk} message AttachedDisk - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AttachedDisk.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.deviceName = ""; - if (message.newDisk != null && message.hasOwnProperty("newDisk")) { - object.newDisk = $root.google.cloud.batch.v1.AllocationPolicy.Disk.toObject(message.newDisk, options); - if (options.oneofs) - object.attached = "newDisk"; - } - if (message.existingDisk != null && message.hasOwnProperty("existingDisk")) { - object.existingDisk = message.existingDisk; - if (options.oneofs) - object.attached = "existingDisk"; - } - if (message.deviceName != null && message.hasOwnProperty("deviceName")) - object.deviceName = message.deviceName; - return object; - }; - - /** - * Converts this AttachedDisk to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk - * @instance - * @returns {Object.} JSON object - */ - AttachedDisk.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AttachedDisk - * @function getTypeUrl - * @memberof google.cloud.batch.v1.AllocationPolicy.AttachedDisk - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AttachedDisk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy.AttachedDisk"; - }; - - return AttachedDisk; - })(); - - AllocationPolicy.Accelerator = (function() { - - /** - * Properties of an Accelerator. - * @memberof google.cloud.batch.v1.AllocationPolicy - * @interface IAccelerator - * @property {string|null} [type] Accelerator type - * @property {number|Long|null} [count] Accelerator count - * @property {boolean|null} [installGpuDrivers] Accelerator installGpuDrivers - * @property {string|null} [driverVersion] Accelerator driverVersion - */ - - /** - * Constructs a new Accelerator. - * @memberof google.cloud.batch.v1.AllocationPolicy - * @classdesc Represents an Accelerator. - * @implements IAccelerator - * @constructor - * @param {google.cloud.batch.v1.AllocationPolicy.IAccelerator=} [properties] Properties to set - */ - function Accelerator(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Accelerator type. - * @member {string} type - * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator - * @instance - */ - Accelerator.prototype.type = ""; - - /** - * Accelerator count. - * @member {number|Long} count - * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator - * @instance - */ - Accelerator.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Accelerator installGpuDrivers. - * @member {boolean} installGpuDrivers - * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator - * @instance - */ - Accelerator.prototype.installGpuDrivers = false; - - /** - * Accelerator driverVersion. - * @member {string} driverVersion - * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator - * @instance - */ - Accelerator.prototype.driverVersion = ""; - - /** - * Creates a new Accelerator instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.IAccelerator=} [properties] Properties to set - * @returns {google.cloud.batch.v1.AllocationPolicy.Accelerator} Accelerator instance - */ - Accelerator.create = function create(properties) { - return new Accelerator(properties); - }; - - /** - * Encodes the specified Accelerator message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.Accelerator.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.IAccelerator} message Accelerator message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Accelerator.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); - if (message.installGpuDrivers != null && Object.hasOwnProperty.call(message, "installGpuDrivers")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.installGpuDrivers); - if (message.driverVersion != null && Object.hasOwnProperty.call(message, "driverVersion")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.driverVersion); - return writer; - }; - - /** - * Encodes the specified Accelerator message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.Accelerator.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.IAccelerator} message Accelerator message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Accelerator.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Accelerator message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.AllocationPolicy.Accelerator} Accelerator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Accelerator.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy.Accelerator(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - message.count = reader.int64(); - break; - } - case 3: { - message.installGpuDrivers = reader.bool(); - break; - } - case 4: { - message.driverVersion = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Accelerator message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.AllocationPolicy.Accelerator} Accelerator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Accelerator.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Accelerator message. - * @function verify - * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Accelerator.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) - return "count: integer|Long expected"; - if (message.installGpuDrivers != null && message.hasOwnProperty("installGpuDrivers")) - if (typeof message.installGpuDrivers !== "boolean") - return "installGpuDrivers: boolean expected"; - if (message.driverVersion != null && message.hasOwnProperty("driverVersion")) - if (!$util.isString(message.driverVersion)) - return "driverVersion: string expected"; - return null; - }; - - /** - * Creates an Accelerator message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.AllocationPolicy.Accelerator} Accelerator - */ - Accelerator.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy.Accelerator) - return object; - var message = new $root.google.cloud.batch.v1.AllocationPolicy.Accelerator(); - if (object.type != null) - message.type = String(object.type); - if (object.count != null) - if ($util.Long) - (message.count = $util.Long.fromValue(object.count)).unsigned = false; - else if (typeof object.count === "string") - message.count = parseInt(object.count, 10); - else if (typeof object.count === "number") - message.count = object.count; - else if (typeof object.count === "object") - message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); - if (object.installGpuDrivers != null) - message.installGpuDrivers = Boolean(object.installGpuDrivers); - if (object.driverVersion != null) - message.driverVersion = String(object.driverVersion); - return message; - }; - - /** - * Creates a plain object from an Accelerator message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.Accelerator} message Accelerator - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Accelerator.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.count = options.longs === String ? "0" : 0; - object.installGpuDrivers = false; - object.driverVersion = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.count != null && message.hasOwnProperty("count")) - if (typeof message.count === "number") - object.count = options.longs === String ? String(message.count) : message.count; - else - object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; - if (message.installGpuDrivers != null && message.hasOwnProperty("installGpuDrivers")) - object.installGpuDrivers = message.installGpuDrivers; - if (message.driverVersion != null && message.hasOwnProperty("driverVersion")) - object.driverVersion = message.driverVersion; - return object; - }; - - /** - * Converts this Accelerator to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator - * @instance - * @returns {Object.} JSON object - */ - Accelerator.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Accelerator - * @function getTypeUrl - * @memberof google.cloud.batch.v1.AllocationPolicy.Accelerator - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Accelerator.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy.Accelerator"; - }; - - return Accelerator; - })(); - - AllocationPolicy.InstancePolicy = (function() { - - /** - * Properties of an InstancePolicy. - * @memberof google.cloud.batch.v1.AllocationPolicy - * @interface IInstancePolicy - * @property {string|null} [machineType] InstancePolicy machineType - * @property {string|null} [minCpuPlatform] InstancePolicy minCpuPlatform - * @property {google.cloud.batch.v1.AllocationPolicy.ProvisioningModel|null} [provisioningModel] InstancePolicy provisioningModel - * @property {Array.|null} [accelerators] InstancePolicy accelerators - * @property {google.cloud.batch.v1.AllocationPolicy.IDisk|null} [bootDisk] InstancePolicy bootDisk - * @property {Array.|null} [disks] InstancePolicy disks - * @property {string|null} [reservation] InstancePolicy reservation - */ - - /** - * Constructs a new InstancePolicy. - * @memberof google.cloud.batch.v1.AllocationPolicy - * @classdesc Represents an InstancePolicy. - * @implements IInstancePolicy - * @constructor - * @param {google.cloud.batch.v1.AllocationPolicy.IInstancePolicy=} [properties] Properties to set - */ - function InstancePolicy(properties) { - this.accelerators = []; - this.disks = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InstancePolicy machineType. - * @member {string} machineType - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy - * @instance - */ - InstancePolicy.prototype.machineType = ""; - - /** - * InstancePolicy minCpuPlatform. - * @member {string} minCpuPlatform - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy - * @instance - */ - InstancePolicy.prototype.minCpuPlatform = ""; - - /** - * InstancePolicy provisioningModel. - * @member {google.cloud.batch.v1.AllocationPolicy.ProvisioningModel} provisioningModel - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy - * @instance - */ - InstancePolicy.prototype.provisioningModel = 0; - - /** - * InstancePolicy accelerators. - * @member {Array.} accelerators - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy - * @instance - */ - InstancePolicy.prototype.accelerators = $util.emptyArray; - - /** - * InstancePolicy bootDisk. - * @member {google.cloud.batch.v1.AllocationPolicy.IDisk|null|undefined} bootDisk - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy - * @instance - */ - InstancePolicy.prototype.bootDisk = null; - - /** - * InstancePolicy disks. - * @member {Array.} disks - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy - * @instance - */ - InstancePolicy.prototype.disks = $util.emptyArray; - - /** - * InstancePolicy reservation. - * @member {string} reservation - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy - * @instance - */ - InstancePolicy.prototype.reservation = ""; - - /** - * Creates a new InstancePolicy instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.IInstancePolicy=} [properties] Properties to set - * @returns {google.cloud.batch.v1.AllocationPolicy.InstancePolicy} InstancePolicy instance - */ - InstancePolicy.create = function create(properties) { - return new InstancePolicy(properties); - }; - - /** - * Encodes the specified InstancePolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.InstancePolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.IInstancePolicy} message InstancePolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstancePolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.machineType); - if (message.minCpuPlatform != null && Object.hasOwnProperty.call(message, "minCpuPlatform")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.minCpuPlatform); - if (message.provisioningModel != null && Object.hasOwnProperty.call(message, "provisioningModel")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.provisioningModel); - if (message.accelerators != null && message.accelerators.length) - for (var i = 0; i < message.accelerators.length; ++i) - $root.google.cloud.batch.v1.AllocationPolicy.Accelerator.encode(message.accelerators[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.disks != null && message.disks.length) - for (var i = 0; i < message.disks.length; ++i) - $root.google.cloud.batch.v1.AllocationPolicy.AttachedDisk.encode(message.disks[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.reservation != null && Object.hasOwnProperty.call(message, "reservation")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.reservation); - if (message.bootDisk != null && Object.hasOwnProperty.call(message, "bootDisk")) - $root.google.cloud.batch.v1.AllocationPolicy.Disk.encode(message.bootDisk, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified InstancePolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.InstancePolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.IInstancePolicy} message InstancePolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstancePolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InstancePolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.AllocationPolicy.InstancePolicy} InstancePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstancePolicy.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - message.machineType = reader.string(); - break; - } - case 3: { - message.minCpuPlatform = reader.string(); - break; - } - case 4: { - message.provisioningModel = reader.int32(); - break; - } - case 5: { - if (!(message.accelerators && message.accelerators.length)) - message.accelerators = []; - message.accelerators.push($root.google.cloud.batch.v1.AllocationPolicy.Accelerator.decode(reader, reader.uint32())); - break; - } - case 8: { - message.bootDisk = $root.google.cloud.batch.v1.AllocationPolicy.Disk.decode(reader, reader.uint32()); - break; - } - case 6: { - if (!(message.disks && message.disks.length)) - message.disks = []; - message.disks.push($root.google.cloud.batch.v1.AllocationPolicy.AttachedDisk.decode(reader, reader.uint32())); - break; - } - case 7: { - message.reservation = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InstancePolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.AllocationPolicy.InstancePolicy} InstancePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstancePolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InstancePolicy message. - * @function verify - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstancePolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.machineType != null && message.hasOwnProperty("machineType")) - if (!$util.isString(message.machineType)) - return "machineType: string expected"; - if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) - if (!$util.isString(message.minCpuPlatform)) - return "minCpuPlatform: string expected"; - if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) - switch (message.provisioningModel) { - default: - return "provisioningModel: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.accelerators != null && message.hasOwnProperty("accelerators")) { - if (!Array.isArray(message.accelerators)) - return "accelerators: array expected"; - for (var i = 0; i < message.accelerators.length; ++i) { - var error = $root.google.cloud.batch.v1.AllocationPolicy.Accelerator.verify(message.accelerators[i]); - if (error) - return "accelerators." + error; - } - } - if (message.bootDisk != null && message.hasOwnProperty("bootDisk")) { - var error = $root.google.cloud.batch.v1.AllocationPolicy.Disk.verify(message.bootDisk); - if (error) - return "bootDisk." + error; - } - if (message.disks != null && message.hasOwnProperty("disks")) { - if (!Array.isArray(message.disks)) - return "disks: array expected"; - for (var i = 0; i < message.disks.length; ++i) { - var error = $root.google.cloud.batch.v1.AllocationPolicy.AttachedDisk.verify(message.disks[i]); - if (error) - return "disks." + error; - } - } - if (message.reservation != null && message.hasOwnProperty("reservation")) - if (!$util.isString(message.reservation)) - return "reservation: string expected"; - return null; - }; - - /** - * Creates an InstancePolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.AllocationPolicy.InstancePolicy} InstancePolicy - */ - InstancePolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicy) - return object; - var message = new $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicy(); - if (object.machineType != null) - message.machineType = String(object.machineType); - if (object.minCpuPlatform != null) - message.minCpuPlatform = String(object.minCpuPlatform); - switch (object.provisioningModel) { - default: - if (typeof object.provisioningModel === "number") { - message.provisioningModel = object.provisioningModel; - break; - } - break; - case "PROVISIONING_MODEL_UNSPECIFIED": - case 0: - message.provisioningModel = 0; - break; - case "STANDARD": - case 1: - message.provisioningModel = 1; - break; - case "SPOT": - case 2: - message.provisioningModel = 2; - break; - case "PREEMPTIBLE": - case 3: - message.provisioningModel = 3; - break; - } - if (object.accelerators) { - if (!Array.isArray(object.accelerators)) - throw TypeError(".google.cloud.batch.v1.AllocationPolicy.InstancePolicy.accelerators: array expected"); - message.accelerators = []; - for (var i = 0; i < object.accelerators.length; ++i) { - if (typeof object.accelerators[i] !== "object") - throw TypeError(".google.cloud.batch.v1.AllocationPolicy.InstancePolicy.accelerators: object expected"); - message.accelerators[i] = $root.google.cloud.batch.v1.AllocationPolicy.Accelerator.fromObject(object.accelerators[i]); - } - } - if (object.bootDisk != null) { - if (typeof object.bootDisk !== "object") - throw TypeError(".google.cloud.batch.v1.AllocationPolicy.InstancePolicy.bootDisk: object expected"); - message.bootDisk = $root.google.cloud.batch.v1.AllocationPolicy.Disk.fromObject(object.bootDisk); - } - if (object.disks) { - if (!Array.isArray(object.disks)) - throw TypeError(".google.cloud.batch.v1.AllocationPolicy.InstancePolicy.disks: array expected"); - message.disks = []; - for (var i = 0; i < object.disks.length; ++i) { - if (typeof object.disks[i] !== "object") - throw TypeError(".google.cloud.batch.v1.AllocationPolicy.InstancePolicy.disks: object expected"); - message.disks[i] = $root.google.cloud.batch.v1.AllocationPolicy.AttachedDisk.fromObject(object.disks[i]); - } - } - if (object.reservation != null) - message.reservation = String(object.reservation); - return message; - }; - - /** - * Creates a plain object from an InstancePolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.InstancePolicy} message InstancePolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstancePolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.accelerators = []; - object.disks = []; - } - if (options.defaults) { - object.machineType = ""; - object.minCpuPlatform = ""; - object.provisioningModel = options.enums === String ? "PROVISIONING_MODEL_UNSPECIFIED" : 0; - object.reservation = ""; - object.bootDisk = null; - } - if (message.machineType != null && message.hasOwnProperty("machineType")) - object.machineType = message.machineType; - if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) - object.minCpuPlatform = message.minCpuPlatform; - if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) - object.provisioningModel = options.enums === String ? $root.google.cloud.batch.v1.AllocationPolicy.ProvisioningModel[message.provisioningModel] === undefined ? message.provisioningModel : $root.google.cloud.batch.v1.AllocationPolicy.ProvisioningModel[message.provisioningModel] : message.provisioningModel; - if (message.accelerators && message.accelerators.length) { - object.accelerators = []; - for (var j = 0; j < message.accelerators.length; ++j) - object.accelerators[j] = $root.google.cloud.batch.v1.AllocationPolicy.Accelerator.toObject(message.accelerators[j], options); - } - if (message.disks && message.disks.length) { - object.disks = []; - for (var j = 0; j < message.disks.length; ++j) - object.disks[j] = $root.google.cloud.batch.v1.AllocationPolicy.AttachedDisk.toObject(message.disks[j], options); - } - if (message.reservation != null && message.hasOwnProperty("reservation")) - object.reservation = message.reservation; - if (message.bootDisk != null && message.hasOwnProperty("bootDisk")) - object.bootDisk = $root.google.cloud.batch.v1.AllocationPolicy.Disk.toObject(message.bootDisk, options); - return object; - }; - - /** - * Converts this InstancePolicy to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy - * @instance - * @returns {Object.} JSON object - */ - InstancePolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InstancePolicy - * @function getTypeUrl - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstancePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy.InstancePolicy"; - }; - - return InstancePolicy; - })(); - - AllocationPolicy.InstancePolicyOrTemplate = (function() { - - /** - * Properties of an InstancePolicyOrTemplate. - * @memberof google.cloud.batch.v1.AllocationPolicy - * @interface IInstancePolicyOrTemplate - * @property {google.cloud.batch.v1.AllocationPolicy.IInstancePolicy|null} [policy] InstancePolicyOrTemplate policy - * @property {string|null} [instanceTemplate] InstancePolicyOrTemplate instanceTemplate - * @property {boolean|null} [installGpuDrivers] InstancePolicyOrTemplate installGpuDrivers - * @property {boolean|null} [installOpsAgent] InstancePolicyOrTemplate installOpsAgent - * @property {boolean|null} [blockProjectSshKeys] InstancePolicyOrTemplate blockProjectSshKeys - */ - - /** - * Constructs a new InstancePolicyOrTemplate. - * @memberof google.cloud.batch.v1.AllocationPolicy - * @classdesc Represents an InstancePolicyOrTemplate. - * @implements IInstancePolicyOrTemplate - * @constructor - * @param {google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate=} [properties] Properties to set - */ - function InstancePolicyOrTemplate(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InstancePolicyOrTemplate policy. - * @member {google.cloud.batch.v1.AllocationPolicy.IInstancePolicy|null|undefined} policy - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate - * @instance - */ - InstancePolicyOrTemplate.prototype.policy = null; - - /** - * InstancePolicyOrTemplate instanceTemplate. - * @member {string|null|undefined} instanceTemplate - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate - * @instance - */ - InstancePolicyOrTemplate.prototype.instanceTemplate = null; - - /** - * InstancePolicyOrTemplate installGpuDrivers. - * @member {boolean} installGpuDrivers - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate - * @instance - */ - InstancePolicyOrTemplate.prototype.installGpuDrivers = false; - - /** - * InstancePolicyOrTemplate installOpsAgent. - * @member {boolean} installOpsAgent - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate - * @instance - */ - InstancePolicyOrTemplate.prototype.installOpsAgent = false; - - /** - * InstancePolicyOrTemplate blockProjectSshKeys. - * @member {boolean} blockProjectSshKeys - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate - * @instance - */ - InstancePolicyOrTemplate.prototype.blockProjectSshKeys = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * InstancePolicyOrTemplate policyTemplate. - * @member {"policy"|"instanceTemplate"|undefined} policyTemplate - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate - * @instance - */ - Object.defineProperty(InstancePolicyOrTemplate.prototype, "policyTemplate", { - get: $util.oneOfGetter($oneOfFields = ["policy", "instanceTemplate"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new InstancePolicyOrTemplate instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate=} [properties] Properties to set - * @returns {google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate} InstancePolicyOrTemplate instance - */ - InstancePolicyOrTemplate.create = function create(properties) { - return new InstancePolicyOrTemplate(properties); - }; - - /** - * Encodes the specified InstancePolicyOrTemplate message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate} message InstancePolicyOrTemplate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstancePolicyOrTemplate.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) - $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicy.encode(message.policy, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.instanceTemplate != null && Object.hasOwnProperty.call(message, "instanceTemplate")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceTemplate); - if (message.installGpuDrivers != null && Object.hasOwnProperty.call(message, "installGpuDrivers")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.installGpuDrivers); - if (message.installOpsAgent != null && Object.hasOwnProperty.call(message, "installOpsAgent")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.installOpsAgent); - if (message.blockProjectSshKeys != null && Object.hasOwnProperty.call(message, "blockProjectSshKeys")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.blockProjectSshKeys); - return writer; - }; - - /** - * Encodes the specified InstancePolicyOrTemplate message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.IInstancePolicyOrTemplate} message InstancePolicyOrTemplate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstancePolicyOrTemplate.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InstancePolicyOrTemplate message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate} InstancePolicyOrTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstancePolicyOrTemplate.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.policy = $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicy.decode(reader, reader.uint32()); - break; - } - case 2: { - message.instanceTemplate = reader.string(); - break; - } - case 3: { - message.installGpuDrivers = reader.bool(); - break; - } - case 4: { - message.installOpsAgent = reader.bool(); - break; - } - case 5: { - message.blockProjectSshKeys = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InstancePolicyOrTemplate message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate} InstancePolicyOrTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstancePolicyOrTemplate.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InstancePolicyOrTemplate message. - * @function verify - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstancePolicyOrTemplate.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.policy != null && message.hasOwnProperty("policy")) { - properties.policyTemplate = 1; - { - var error = $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicy.verify(message.policy); - if (error) - return "policy." + error; - } - } - if (message.instanceTemplate != null && message.hasOwnProperty("instanceTemplate")) { - if (properties.policyTemplate === 1) - return "policyTemplate: multiple values"; - properties.policyTemplate = 1; - if (!$util.isString(message.instanceTemplate)) - return "instanceTemplate: string expected"; - } - if (message.installGpuDrivers != null && message.hasOwnProperty("installGpuDrivers")) - if (typeof message.installGpuDrivers !== "boolean") - return "installGpuDrivers: boolean expected"; - if (message.installOpsAgent != null && message.hasOwnProperty("installOpsAgent")) - if (typeof message.installOpsAgent !== "boolean") - return "installOpsAgent: boolean expected"; - if (message.blockProjectSshKeys != null && message.hasOwnProperty("blockProjectSshKeys")) - if (typeof message.blockProjectSshKeys !== "boolean") - return "blockProjectSshKeys: boolean expected"; - return null; - }; - - /** - * Creates an InstancePolicyOrTemplate message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate} InstancePolicyOrTemplate - */ - InstancePolicyOrTemplate.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate) - return object; - var message = new $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate(); - if (object.policy != null) { - if (typeof object.policy !== "object") - throw TypeError(".google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.policy: object expected"); - message.policy = $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicy.fromObject(object.policy); - } - if (object.instanceTemplate != null) - message.instanceTemplate = String(object.instanceTemplate); - if (object.installGpuDrivers != null) - message.installGpuDrivers = Boolean(object.installGpuDrivers); - if (object.installOpsAgent != null) - message.installOpsAgent = Boolean(object.installOpsAgent); - if (object.blockProjectSshKeys != null) - message.blockProjectSshKeys = Boolean(object.blockProjectSshKeys); - return message; - }; - - /** - * Creates a plain object from an InstancePolicyOrTemplate message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate} message InstancePolicyOrTemplate - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstancePolicyOrTemplate.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.installGpuDrivers = false; - object.installOpsAgent = false; - object.blockProjectSshKeys = false; - } - if (message.policy != null && message.hasOwnProperty("policy")) { - object.policy = $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicy.toObject(message.policy, options); - if (options.oneofs) - object.policyTemplate = "policy"; - } - if (message.instanceTemplate != null && message.hasOwnProperty("instanceTemplate")) { - object.instanceTemplate = message.instanceTemplate; - if (options.oneofs) - object.policyTemplate = "instanceTemplate"; - } - if (message.installGpuDrivers != null && message.hasOwnProperty("installGpuDrivers")) - object.installGpuDrivers = message.installGpuDrivers; - if (message.installOpsAgent != null && message.hasOwnProperty("installOpsAgent")) - object.installOpsAgent = message.installOpsAgent; - if (message.blockProjectSshKeys != null && message.hasOwnProperty("blockProjectSshKeys")) - object.blockProjectSshKeys = message.blockProjectSshKeys; - return object; - }; - - /** - * Converts this InstancePolicyOrTemplate to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate - * @instance - * @returns {Object.} JSON object - */ - InstancePolicyOrTemplate.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InstancePolicyOrTemplate - * @function getTypeUrl - * @memberof google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstancePolicyOrTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate"; - }; - - return InstancePolicyOrTemplate; - })(); - - AllocationPolicy.NetworkInterface = (function() { - - /** - * Properties of a NetworkInterface. - * @memberof google.cloud.batch.v1.AllocationPolicy - * @interface INetworkInterface - * @property {string|null} [network] NetworkInterface network - * @property {string|null} [subnetwork] NetworkInterface subnetwork - * @property {boolean|null} [noExternalIpAddress] NetworkInterface noExternalIpAddress - */ - - /** - * Constructs a new NetworkInterface. - * @memberof google.cloud.batch.v1.AllocationPolicy - * @classdesc Represents a NetworkInterface. - * @implements INetworkInterface - * @constructor - * @param {google.cloud.batch.v1.AllocationPolicy.INetworkInterface=} [properties] Properties to set - */ - function NetworkInterface(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NetworkInterface network. - * @member {string} network - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface - * @instance - */ - NetworkInterface.prototype.network = ""; - - /** - * NetworkInterface subnetwork. - * @member {string} subnetwork - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface - * @instance - */ - NetworkInterface.prototype.subnetwork = ""; - - /** - * NetworkInterface noExternalIpAddress. - * @member {boolean} noExternalIpAddress - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface - * @instance - */ - NetworkInterface.prototype.noExternalIpAddress = false; - - /** - * Creates a new NetworkInterface instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.INetworkInterface=} [properties] Properties to set - * @returns {google.cloud.batch.v1.AllocationPolicy.NetworkInterface} NetworkInterface instance - */ - NetworkInterface.create = function create(properties) { - return new NetworkInterface(properties); - }; - - /** - * Encodes the specified NetworkInterface message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.NetworkInterface.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.INetworkInterface} message NetworkInterface message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NetworkInterface.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.network != null && Object.hasOwnProperty.call(message, "network")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.network); - if (message.subnetwork != null && Object.hasOwnProperty.call(message, "subnetwork")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.subnetwork); - if (message.noExternalIpAddress != null && Object.hasOwnProperty.call(message, "noExternalIpAddress")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.noExternalIpAddress); - return writer; - }; - - /** - * Encodes the specified NetworkInterface message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.NetworkInterface.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.INetworkInterface} message NetworkInterface message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NetworkInterface.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NetworkInterface message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.AllocationPolicy.NetworkInterface} NetworkInterface - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NetworkInterface.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy.NetworkInterface(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.network = reader.string(); - break; - } - case 2: { - message.subnetwork = reader.string(); - break; - } - case 3: { - message.noExternalIpAddress = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NetworkInterface message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.AllocationPolicy.NetworkInterface} NetworkInterface - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NetworkInterface.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NetworkInterface message. - * @function verify - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NetworkInterface.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.network != null && message.hasOwnProperty("network")) - if (!$util.isString(message.network)) - return "network: string expected"; - if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) - if (!$util.isString(message.subnetwork)) - return "subnetwork: string expected"; - if (message.noExternalIpAddress != null && message.hasOwnProperty("noExternalIpAddress")) - if (typeof message.noExternalIpAddress !== "boolean") - return "noExternalIpAddress: boolean expected"; - return null; - }; - - /** - * Creates a NetworkInterface message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.AllocationPolicy.NetworkInterface} NetworkInterface - */ - NetworkInterface.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy.NetworkInterface) - return object; - var message = new $root.google.cloud.batch.v1.AllocationPolicy.NetworkInterface(); - if (object.network != null) - message.network = String(object.network); - if (object.subnetwork != null) - message.subnetwork = String(object.subnetwork); - if (object.noExternalIpAddress != null) - message.noExternalIpAddress = Boolean(object.noExternalIpAddress); - return message; - }; - - /** - * Creates a plain object from a NetworkInterface message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.NetworkInterface} message NetworkInterface - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NetworkInterface.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.network = ""; - object.subnetwork = ""; - object.noExternalIpAddress = false; - } - if (message.network != null && message.hasOwnProperty("network")) - object.network = message.network; - if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) - object.subnetwork = message.subnetwork; - if (message.noExternalIpAddress != null && message.hasOwnProperty("noExternalIpAddress")) - object.noExternalIpAddress = message.noExternalIpAddress; - return object; - }; - - /** - * Converts this NetworkInterface to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface - * @instance - * @returns {Object.} JSON object - */ - NetworkInterface.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NetworkInterface - * @function getTypeUrl - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkInterface - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NetworkInterface.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy.NetworkInterface"; - }; - - return NetworkInterface; - })(); - - AllocationPolicy.NetworkPolicy = (function() { - - /** - * Properties of a NetworkPolicy. - * @memberof google.cloud.batch.v1.AllocationPolicy - * @interface INetworkPolicy - * @property {Array.|null} [networkInterfaces] NetworkPolicy networkInterfaces - */ - - /** - * Constructs a new NetworkPolicy. - * @memberof google.cloud.batch.v1.AllocationPolicy - * @classdesc Represents a NetworkPolicy. - * @implements INetworkPolicy - * @constructor - * @param {google.cloud.batch.v1.AllocationPolicy.INetworkPolicy=} [properties] Properties to set - */ - function NetworkPolicy(properties) { - this.networkInterfaces = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NetworkPolicy networkInterfaces. - * @member {Array.} networkInterfaces - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy - * @instance - */ - NetworkPolicy.prototype.networkInterfaces = $util.emptyArray; - - /** - * Creates a new NetworkPolicy instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.INetworkPolicy=} [properties] Properties to set - * @returns {google.cloud.batch.v1.AllocationPolicy.NetworkPolicy} NetworkPolicy instance - */ - NetworkPolicy.create = function create(properties) { - return new NetworkPolicy(properties); - }; - - /** - * Encodes the specified NetworkPolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.INetworkPolicy} message NetworkPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NetworkPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.networkInterfaces != null && message.networkInterfaces.length) - for (var i = 0; i < message.networkInterfaces.length; ++i) - $root.google.cloud.batch.v1.AllocationPolicy.NetworkInterface.encode(message.networkInterfaces[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified NetworkPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.INetworkPolicy} message NetworkPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NetworkPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NetworkPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.AllocationPolicy.NetworkPolicy} NetworkPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NetworkPolicy.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.networkInterfaces && message.networkInterfaces.length)) - message.networkInterfaces = []; - message.networkInterfaces.push($root.google.cloud.batch.v1.AllocationPolicy.NetworkInterface.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NetworkPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.AllocationPolicy.NetworkPolicy} NetworkPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NetworkPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NetworkPolicy message. - * @function verify - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NetworkPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.networkInterfaces != null && message.hasOwnProperty("networkInterfaces")) { - if (!Array.isArray(message.networkInterfaces)) - return "networkInterfaces: array expected"; - for (var i = 0; i < message.networkInterfaces.length; ++i) { - var error = $root.google.cloud.batch.v1.AllocationPolicy.NetworkInterface.verify(message.networkInterfaces[i]); - if (error) - return "networkInterfaces." + error; - } - } - return null; - }; - - /** - * Creates a NetworkPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.AllocationPolicy.NetworkPolicy} NetworkPolicy - */ - NetworkPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy) - return object; - var message = new $root.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy(); - if (object.networkInterfaces) { - if (!Array.isArray(object.networkInterfaces)) - throw TypeError(".google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.networkInterfaces: array expected"); - message.networkInterfaces = []; - for (var i = 0; i < object.networkInterfaces.length; ++i) { - if (typeof object.networkInterfaces[i] !== "object") - throw TypeError(".google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.networkInterfaces: object expected"); - message.networkInterfaces[i] = $root.google.cloud.batch.v1.AllocationPolicy.NetworkInterface.fromObject(object.networkInterfaces[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a NetworkPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.NetworkPolicy} message NetworkPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NetworkPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.networkInterfaces = []; - if (message.networkInterfaces && message.networkInterfaces.length) { - object.networkInterfaces = []; - for (var j = 0; j < message.networkInterfaces.length; ++j) - object.networkInterfaces[j] = $root.google.cloud.batch.v1.AllocationPolicy.NetworkInterface.toObject(message.networkInterfaces[j], options); - } - return object; - }; - - /** - * Converts this NetworkPolicy to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy - * @instance - * @returns {Object.} JSON object - */ - NetworkPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NetworkPolicy - * @function getTypeUrl - * @memberof google.cloud.batch.v1.AllocationPolicy.NetworkPolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NetworkPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy.NetworkPolicy"; - }; - - return NetworkPolicy; - })(); - - AllocationPolicy.PlacementPolicy = (function() { - - /** - * Properties of a PlacementPolicy. - * @memberof google.cloud.batch.v1.AllocationPolicy - * @interface IPlacementPolicy - * @property {string|null} [collocation] PlacementPolicy collocation - * @property {number|Long|null} [maxDistance] PlacementPolicy maxDistance - */ - - /** - * Constructs a new PlacementPolicy. - * @memberof google.cloud.batch.v1.AllocationPolicy - * @classdesc Represents a PlacementPolicy. - * @implements IPlacementPolicy - * @constructor - * @param {google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy=} [properties] Properties to set - */ - function PlacementPolicy(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PlacementPolicy collocation. - * @member {string} collocation - * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy - * @instance - */ - PlacementPolicy.prototype.collocation = ""; - - /** - * PlacementPolicy maxDistance. - * @member {number|Long} maxDistance - * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy - * @instance - */ - PlacementPolicy.prototype.maxDistance = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new PlacementPolicy instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy=} [properties] Properties to set - * @returns {google.cloud.batch.v1.AllocationPolicy.PlacementPolicy} PlacementPolicy instance - */ - PlacementPolicy.create = function create(properties) { - return new PlacementPolicy(properties); - }; - - /** - * Encodes the specified PlacementPolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy} message PlacementPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PlacementPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.collocation != null && Object.hasOwnProperty.call(message, "collocation")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.collocation); - if (message.maxDistance != null && Object.hasOwnProperty.call(message, "maxDistance")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.maxDistance); - return writer; - }; - - /** - * Encodes the specified PlacementPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy} message PlacementPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PlacementPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PlacementPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.AllocationPolicy.PlacementPolicy} PlacementPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PlacementPolicy.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.collocation = reader.string(); - break; - } - case 2: { - message.maxDistance = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PlacementPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.AllocationPolicy.PlacementPolicy} PlacementPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PlacementPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PlacementPolicy message. - * @function verify - * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PlacementPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.collocation != null && message.hasOwnProperty("collocation")) - if (!$util.isString(message.collocation)) - return "collocation: string expected"; - if (message.maxDistance != null && message.hasOwnProperty("maxDistance")) - if (!$util.isInteger(message.maxDistance) && !(message.maxDistance && $util.isInteger(message.maxDistance.low) && $util.isInteger(message.maxDistance.high))) - return "maxDistance: integer|Long expected"; - return null; - }; - - /** - * Creates a PlacementPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.AllocationPolicy.PlacementPolicy} PlacementPolicy - */ - PlacementPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy) - return object; - var message = new $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy(); - if (object.collocation != null) - message.collocation = String(object.collocation); - if (object.maxDistance != null) - if ($util.Long) - (message.maxDistance = $util.Long.fromValue(object.maxDistance)).unsigned = false; - else if (typeof object.maxDistance === "string") - message.maxDistance = parseInt(object.maxDistance, 10); - else if (typeof object.maxDistance === "number") - message.maxDistance = object.maxDistance; - else if (typeof object.maxDistance === "object") - message.maxDistance = new $util.LongBits(object.maxDistance.low >>> 0, object.maxDistance.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a PlacementPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy - * @static - * @param {google.cloud.batch.v1.AllocationPolicy.PlacementPolicy} message PlacementPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PlacementPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.collocation = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.maxDistance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.maxDistance = options.longs === String ? "0" : 0; - } - if (message.collocation != null && message.hasOwnProperty("collocation")) - object.collocation = message.collocation; - if (message.maxDistance != null && message.hasOwnProperty("maxDistance")) - if (typeof message.maxDistance === "number") - object.maxDistance = options.longs === String ? String(message.maxDistance) : message.maxDistance; - else - object.maxDistance = options.longs === String ? $util.Long.prototype.toString.call(message.maxDistance) : options.longs === Number ? new $util.LongBits(message.maxDistance.low >>> 0, message.maxDistance.high >>> 0).toNumber() : message.maxDistance; - return object; - }; - - /** - * Converts this PlacementPolicy to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy - * @instance - * @returns {Object.} JSON object - */ - PlacementPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PlacementPolicy - * @function getTypeUrl - * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PlacementPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy.PlacementPolicy"; - }; - - return PlacementPolicy; - })(); - - /** - * ProvisioningModel enum. - * @name google.cloud.batch.v1.AllocationPolicy.ProvisioningModel - * @enum {number} - * @property {number} PROVISIONING_MODEL_UNSPECIFIED=0 PROVISIONING_MODEL_UNSPECIFIED value - * @property {number} STANDARD=1 STANDARD value - * @property {number} SPOT=2 SPOT value - * @property {number} PREEMPTIBLE=3 PREEMPTIBLE value - */ - AllocationPolicy.ProvisioningModel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PROVISIONING_MODEL_UNSPECIFIED"] = 0; - values[valuesById[1] = "STANDARD"] = 1; - values[valuesById[2] = "SPOT"] = 2; - values[valuesById[3] = "PREEMPTIBLE"] = 3; - return values; - })(); - - return AllocationPolicy; - })(); - - v1.TaskGroup = (function() { - - /** - * Properties of a TaskGroup. - * @memberof google.cloud.batch.v1 - * @interface ITaskGroup - * @property {string|null} [name] TaskGroup name - * @property {google.cloud.batch.v1.ITaskSpec|null} [taskSpec] TaskGroup taskSpec - * @property {number|Long|null} [taskCount] TaskGroup taskCount - * @property {number|Long|null} [parallelism] TaskGroup parallelism - * @property {google.cloud.batch.v1.TaskGroup.SchedulingPolicy|null} [schedulingPolicy] TaskGroup schedulingPolicy - * @property {Array.|null} [taskEnvironments] TaskGroup taskEnvironments - * @property {number|Long|null} [taskCountPerNode] TaskGroup taskCountPerNode - * @property {boolean|null} [requireHostsFile] TaskGroup requireHostsFile - * @property {boolean|null} [permissiveSsh] TaskGroup permissiveSsh - * @property {boolean|null} [runAsNonRoot] TaskGroup runAsNonRoot - */ - - /** - * Constructs a new TaskGroup. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a TaskGroup. - * @implements ITaskGroup - * @constructor - * @param {google.cloud.batch.v1.ITaskGroup=} [properties] Properties to set - */ - function TaskGroup(properties) { - this.taskEnvironments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TaskGroup name. - * @member {string} name - * @memberof google.cloud.batch.v1.TaskGroup - * @instance - */ - TaskGroup.prototype.name = ""; - - /** - * TaskGroup taskSpec. - * @member {google.cloud.batch.v1.ITaskSpec|null|undefined} taskSpec - * @memberof google.cloud.batch.v1.TaskGroup - * @instance - */ - TaskGroup.prototype.taskSpec = null; - - /** - * TaskGroup taskCount. - * @member {number|Long} taskCount - * @memberof google.cloud.batch.v1.TaskGroup - * @instance - */ - TaskGroup.prototype.taskCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * TaskGroup parallelism. - * @member {number|Long} parallelism - * @memberof google.cloud.batch.v1.TaskGroup - * @instance - */ - TaskGroup.prototype.parallelism = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * TaskGroup schedulingPolicy. - * @member {google.cloud.batch.v1.TaskGroup.SchedulingPolicy} schedulingPolicy - * @memberof google.cloud.batch.v1.TaskGroup - * @instance - */ - TaskGroup.prototype.schedulingPolicy = 0; - - /** - * TaskGroup taskEnvironments. - * @member {Array.} taskEnvironments - * @memberof google.cloud.batch.v1.TaskGroup - * @instance - */ - TaskGroup.prototype.taskEnvironments = $util.emptyArray; - - /** - * TaskGroup taskCountPerNode. - * @member {number|Long} taskCountPerNode - * @memberof google.cloud.batch.v1.TaskGroup - * @instance - */ - TaskGroup.prototype.taskCountPerNode = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * TaskGroup requireHostsFile. - * @member {boolean} requireHostsFile - * @memberof google.cloud.batch.v1.TaskGroup - * @instance - */ - TaskGroup.prototype.requireHostsFile = false; - - /** - * TaskGroup permissiveSsh. - * @member {boolean} permissiveSsh - * @memberof google.cloud.batch.v1.TaskGroup - * @instance - */ - TaskGroup.prototype.permissiveSsh = false; - - /** - * TaskGroup runAsNonRoot. - * @member {boolean} runAsNonRoot - * @memberof google.cloud.batch.v1.TaskGroup - * @instance - */ - TaskGroup.prototype.runAsNonRoot = false; - - /** - * Creates a new TaskGroup instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.TaskGroup - * @static - * @param {google.cloud.batch.v1.ITaskGroup=} [properties] Properties to set - * @returns {google.cloud.batch.v1.TaskGroup} TaskGroup instance - */ - TaskGroup.create = function create(properties) { - return new TaskGroup(properties); - }; - - /** - * Encodes the specified TaskGroup message. Does not implicitly {@link google.cloud.batch.v1.TaskGroup.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.TaskGroup - * @static - * @param {google.cloud.batch.v1.ITaskGroup} message TaskGroup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskGroup.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.taskSpec != null && Object.hasOwnProperty.call(message, "taskSpec")) - $root.google.cloud.batch.v1.TaskSpec.encode(message.taskSpec, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.taskCount != null && Object.hasOwnProperty.call(message, "taskCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.taskCount); - if (message.parallelism != null && Object.hasOwnProperty.call(message, "parallelism")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.parallelism); - if (message.schedulingPolicy != null && Object.hasOwnProperty.call(message, "schedulingPolicy")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.schedulingPolicy); - if (message.taskEnvironments != null && message.taskEnvironments.length) - for (var i = 0; i < message.taskEnvironments.length; ++i) - $root.google.cloud.batch.v1.Environment.encode(message.taskEnvironments[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.taskCountPerNode != null && Object.hasOwnProperty.call(message, "taskCountPerNode")) - writer.uint32(/* id 10, wireType 0 =*/80).int64(message.taskCountPerNode); - if (message.requireHostsFile != null && Object.hasOwnProperty.call(message, "requireHostsFile")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.requireHostsFile); - if (message.permissiveSsh != null && Object.hasOwnProperty.call(message, "permissiveSsh")) - writer.uint32(/* id 12, wireType 0 =*/96).bool(message.permissiveSsh); - if (message.runAsNonRoot != null && Object.hasOwnProperty.call(message, "runAsNonRoot")) - writer.uint32(/* id 14, wireType 0 =*/112).bool(message.runAsNonRoot); - return writer; - }; - - /** - * Encodes the specified TaskGroup message, length delimited. Does not implicitly {@link google.cloud.batch.v1.TaskGroup.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.TaskGroup - * @static - * @param {google.cloud.batch.v1.ITaskGroup} message TaskGroup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskGroup.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TaskGroup message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.TaskGroup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.TaskGroup} TaskGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskGroup.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.TaskGroup(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.taskSpec = $root.google.cloud.batch.v1.TaskSpec.decode(reader, reader.uint32()); - break; - } - case 4: { - message.taskCount = reader.int64(); - break; - } - case 5: { - message.parallelism = reader.int64(); - break; - } - case 6: { - message.schedulingPolicy = reader.int32(); - break; - } - case 9: { - if (!(message.taskEnvironments && message.taskEnvironments.length)) - message.taskEnvironments = []; - message.taskEnvironments.push($root.google.cloud.batch.v1.Environment.decode(reader, reader.uint32())); - break; - } - case 10: { - message.taskCountPerNode = reader.int64(); - break; - } - case 11: { - message.requireHostsFile = reader.bool(); - break; - } - case 12: { - message.permissiveSsh = reader.bool(); - break; - } - case 14: { - message.runAsNonRoot = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TaskGroup message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.TaskGroup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.TaskGroup} TaskGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskGroup.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TaskGroup message. - * @function verify - * @memberof google.cloud.batch.v1.TaskGroup - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TaskGroup.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.taskSpec != null && message.hasOwnProperty("taskSpec")) { - var error = $root.google.cloud.batch.v1.TaskSpec.verify(message.taskSpec); - if (error) - return "taskSpec." + error; - } - if (message.taskCount != null && message.hasOwnProperty("taskCount")) - if (!$util.isInteger(message.taskCount) && !(message.taskCount && $util.isInteger(message.taskCount.low) && $util.isInteger(message.taskCount.high))) - return "taskCount: integer|Long expected"; - if (message.parallelism != null && message.hasOwnProperty("parallelism")) - if (!$util.isInteger(message.parallelism) && !(message.parallelism && $util.isInteger(message.parallelism.low) && $util.isInteger(message.parallelism.high))) - return "parallelism: integer|Long expected"; - if (message.schedulingPolicy != null && message.hasOwnProperty("schedulingPolicy")) - switch (message.schedulingPolicy) { - default: - return "schedulingPolicy: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.taskEnvironments != null && message.hasOwnProperty("taskEnvironments")) { - if (!Array.isArray(message.taskEnvironments)) - return "taskEnvironments: array expected"; - for (var i = 0; i < message.taskEnvironments.length; ++i) { - var error = $root.google.cloud.batch.v1.Environment.verify(message.taskEnvironments[i]); - if (error) - return "taskEnvironments." + error; - } - } - if (message.taskCountPerNode != null && message.hasOwnProperty("taskCountPerNode")) - if (!$util.isInteger(message.taskCountPerNode) && !(message.taskCountPerNode && $util.isInteger(message.taskCountPerNode.low) && $util.isInteger(message.taskCountPerNode.high))) - return "taskCountPerNode: integer|Long expected"; - if (message.requireHostsFile != null && message.hasOwnProperty("requireHostsFile")) - if (typeof message.requireHostsFile !== "boolean") - return "requireHostsFile: boolean expected"; - if (message.permissiveSsh != null && message.hasOwnProperty("permissiveSsh")) - if (typeof message.permissiveSsh !== "boolean") - return "permissiveSsh: boolean expected"; - if (message.runAsNonRoot != null && message.hasOwnProperty("runAsNonRoot")) - if (typeof message.runAsNonRoot !== "boolean") - return "runAsNonRoot: boolean expected"; - return null; - }; - - /** - * Creates a TaskGroup message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.TaskGroup - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.TaskGroup} TaskGroup - */ - TaskGroup.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.TaskGroup) - return object; - var message = new $root.google.cloud.batch.v1.TaskGroup(); - if (object.name != null) - message.name = String(object.name); - if (object.taskSpec != null) { - if (typeof object.taskSpec !== "object") - throw TypeError(".google.cloud.batch.v1.TaskGroup.taskSpec: object expected"); - message.taskSpec = $root.google.cloud.batch.v1.TaskSpec.fromObject(object.taskSpec); - } - if (object.taskCount != null) - if ($util.Long) - (message.taskCount = $util.Long.fromValue(object.taskCount)).unsigned = false; - else if (typeof object.taskCount === "string") - message.taskCount = parseInt(object.taskCount, 10); - else if (typeof object.taskCount === "number") - message.taskCount = object.taskCount; - else if (typeof object.taskCount === "object") - message.taskCount = new $util.LongBits(object.taskCount.low >>> 0, object.taskCount.high >>> 0).toNumber(); - if (object.parallelism != null) - if ($util.Long) - (message.parallelism = $util.Long.fromValue(object.parallelism)).unsigned = false; - else if (typeof object.parallelism === "string") - message.parallelism = parseInt(object.parallelism, 10); - else if (typeof object.parallelism === "number") - message.parallelism = object.parallelism; - else if (typeof object.parallelism === "object") - message.parallelism = new $util.LongBits(object.parallelism.low >>> 0, object.parallelism.high >>> 0).toNumber(); - switch (object.schedulingPolicy) { - default: - if (typeof object.schedulingPolicy === "number") { - message.schedulingPolicy = object.schedulingPolicy; - break; - } - break; - case "SCHEDULING_POLICY_UNSPECIFIED": - case 0: - message.schedulingPolicy = 0; - break; - case "AS_SOON_AS_POSSIBLE": - case 1: - message.schedulingPolicy = 1; - break; - case "IN_ORDER": - case 2: - message.schedulingPolicy = 2; - break; - } - if (object.taskEnvironments) { - if (!Array.isArray(object.taskEnvironments)) - throw TypeError(".google.cloud.batch.v1.TaskGroup.taskEnvironments: array expected"); - message.taskEnvironments = []; - for (var i = 0; i < object.taskEnvironments.length; ++i) { - if (typeof object.taskEnvironments[i] !== "object") - throw TypeError(".google.cloud.batch.v1.TaskGroup.taskEnvironments: object expected"); - message.taskEnvironments[i] = $root.google.cloud.batch.v1.Environment.fromObject(object.taskEnvironments[i]); - } - } - if (object.taskCountPerNode != null) - if ($util.Long) - (message.taskCountPerNode = $util.Long.fromValue(object.taskCountPerNode)).unsigned = false; - else if (typeof object.taskCountPerNode === "string") - message.taskCountPerNode = parseInt(object.taskCountPerNode, 10); - else if (typeof object.taskCountPerNode === "number") - message.taskCountPerNode = object.taskCountPerNode; - else if (typeof object.taskCountPerNode === "object") - message.taskCountPerNode = new $util.LongBits(object.taskCountPerNode.low >>> 0, object.taskCountPerNode.high >>> 0).toNumber(); - if (object.requireHostsFile != null) - message.requireHostsFile = Boolean(object.requireHostsFile); - if (object.permissiveSsh != null) - message.permissiveSsh = Boolean(object.permissiveSsh); - if (object.runAsNonRoot != null) - message.runAsNonRoot = Boolean(object.runAsNonRoot); - return message; - }; - - /** - * Creates a plain object from a TaskGroup message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.TaskGroup - * @static - * @param {google.cloud.batch.v1.TaskGroup} message TaskGroup - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TaskGroup.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.taskEnvironments = []; - if (options.defaults) { - object.name = ""; - object.taskSpec = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.taskCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.taskCount = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.parallelism = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.parallelism = options.longs === String ? "0" : 0; - object.schedulingPolicy = options.enums === String ? "SCHEDULING_POLICY_UNSPECIFIED" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.taskCountPerNode = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.taskCountPerNode = options.longs === String ? "0" : 0; - object.requireHostsFile = false; - object.permissiveSsh = false; - object.runAsNonRoot = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.taskSpec != null && message.hasOwnProperty("taskSpec")) - object.taskSpec = $root.google.cloud.batch.v1.TaskSpec.toObject(message.taskSpec, options); - if (message.taskCount != null && message.hasOwnProperty("taskCount")) - if (typeof message.taskCount === "number") - object.taskCount = options.longs === String ? String(message.taskCount) : message.taskCount; - else - object.taskCount = options.longs === String ? $util.Long.prototype.toString.call(message.taskCount) : options.longs === Number ? new $util.LongBits(message.taskCount.low >>> 0, message.taskCount.high >>> 0).toNumber() : message.taskCount; - if (message.parallelism != null && message.hasOwnProperty("parallelism")) - if (typeof message.parallelism === "number") - object.parallelism = options.longs === String ? String(message.parallelism) : message.parallelism; - else - object.parallelism = options.longs === String ? $util.Long.prototype.toString.call(message.parallelism) : options.longs === Number ? new $util.LongBits(message.parallelism.low >>> 0, message.parallelism.high >>> 0).toNumber() : message.parallelism; - if (message.schedulingPolicy != null && message.hasOwnProperty("schedulingPolicy")) - object.schedulingPolicy = options.enums === String ? $root.google.cloud.batch.v1.TaskGroup.SchedulingPolicy[message.schedulingPolicy] === undefined ? message.schedulingPolicy : $root.google.cloud.batch.v1.TaskGroup.SchedulingPolicy[message.schedulingPolicy] : message.schedulingPolicy; - if (message.taskEnvironments && message.taskEnvironments.length) { - object.taskEnvironments = []; - for (var j = 0; j < message.taskEnvironments.length; ++j) - object.taskEnvironments[j] = $root.google.cloud.batch.v1.Environment.toObject(message.taskEnvironments[j], options); - } - if (message.taskCountPerNode != null && message.hasOwnProperty("taskCountPerNode")) - if (typeof message.taskCountPerNode === "number") - object.taskCountPerNode = options.longs === String ? String(message.taskCountPerNode) : message.taskCountPerNode; - else - object.taskCountPerNode = options.longs === String ? $util.Long.prototype.toString.call(message.taskCountPerNode) : options.longs === Number ? new $util.LongBits(message.taskCountPerNode.low >>> 0, message.taskCountPerNode.high >>> 0).toNumber() : message.taskCountPerNode; - if (message.requireHostsFile != null && message.hasOwnProperty("requireHostsFile")) - object.requireHostsFile = message.requireHostsFile; - if (message.permissiveSsh != null && message.hasOwnProperty("permissiveSsh")) - object.permissiveSsh = message.permissiveSsh; - if (message.runAsNonRoot != null && message.hasOwnProperty("runAsNonRoot")) - object.runAsNonRoot = message.runAsNonRoot; - return object; - }; - - /** - * Converts this TaskGroup to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.TaskGroup - * @instance - * @returns {Object.} JSON object - */ - TaskGroup.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TaskGroup - * @function getTypeUrl - * @memberof google.cloud.batch.v1.TaskGroup - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TaskGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.TaskGroup"; - }; - - /** - * SchedulingPolicy enum. - * @name google.cloud.batch.v1.TaskGroup.SchedulingPolicy - * @enum {number} - * @property {number} SCHEDULING_POLICY_UNSPECIFIED=0 SCHEDULING_POLICY_UNSPECIFIED value - * @property {number} AS_SOON_AS_POSSIBLE=1 AS_SOON_AS_POSSIBLE value - * @property {number} IN_ORDER=2 IN_ORDER value - */ - TaskGroup.SchedulingPolicy = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SCHEDULING_POLICY_UNSPECIFIED"] = 0; - values[valuesById[1] = "AS_SOON_AS_POSSIBLE"] = 1; - values[valuesById[2] = "IN_ORDER"] = 2; - return values; - })(); - - return TaskGroup; - })(); - - v1.ServiceAccount = (function() { - - /** - * Properties of a ServiceAccount. - * @memberof google.cloud.batch.v1 - * @interface IServiceAccount - * @property {string|null} [email] ServiceAccount email - * @property {Array.|null} [scopes] ServiceAccount scopes - */ - - /** - * Constructs a new ServiceAccount. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a ServiceAccount. - * @implements IServiceAccount - * @constructor - * @param {google.cloud.batch.v1.IServiceAccount=} [properties] Properties to set - */ - function ServiceAccount(properties) { - this.scopes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceAccount email. - * @member {string} email - * @memberof google.cloud.batch.v1.ServiceAccount - * @instance - */ - ServiceAccount.prototype.email = ""; - - /** - * ServiceAccount scopes. - * @member {Array.} scopes - * @memberof google.cloud.batch.v1.ServiceAccount - * @instance - */ - ServiceAccount.prototype.scopes = $util.emptyArray; - - /** - * Creates a new ServiceAccount instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.ServiceAccount - * @static - * @param {google.cloud.batch.v1.IServiceAccount=} [properties] Properties to set - * @returns {google.cloud.batch.v1.ServiceAccount} ServiceAccount instance - */ - ServiceAccount.create = function create(properties) { - return new ServiceAccount(properties); - }; - - /** - * Encodes the specified ServiceAccount message. Does not implicitly {@link google.cloud.batch.v1.ServiceAccount.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.ServiceAccount - * @static - * @param {google.cloud.batch.v1.IServiceAccount} message ServiceAccount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceAccount.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.email != null && Object.hasOwnProperty.call(message, "email")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.email); - if (message.scopes != null && message.scopes.length) - for (var i = 0; i < message.scopes.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.scopes[i]); - return writer; - }; - - /** - * Encodes the specified ServiceAccount message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ServiceAccount.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.ServiceAccount - * @static - * @param {google.cloud.batch.v1.IServiceAccount} message ServiceAccount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceAccount.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceAccount message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.ServiceAccount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.ServiceAccount} ServiceAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceAccount.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.ServiceAccount(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.email = reader.string(); - break; - } - case 2: { - if (!(message.scopes && message.scopes.length)) - message.scopes = []; - message.scopes.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceAccount message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.ServiceAccount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.ServiceAccount} ServiceAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceAccount.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceAccount message. - * @function verify - * @memberof google.cloud.batch.v1.ServiceAccount - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceAccount.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.email != null && message.hasOwnProperty("email")) - if (!$util.isString(message.email)) - return "email: string expected"; - if (message.scopes != null && message.hasOwnProperty("scopes")) { - if (!Array.isArray(message.scopes)) - return "scopes: array expected"; - for (var i = 0; i < message.scopes.length; ++i) - if (!$util.isString(message.scopes[i])) - return "scopes: string[] expected"; - } - return null; - }; - - /** - * Creates a ServiceAccount message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.ServiceAccount - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.ServiceAccount} ServiceAccount - */ - ServiceAccount.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.ServiceAccount) - return object; - var message = new $root.google.cloud.batch.v1.ServiceAccount(); - if (object.email != null) - message.email = String(object.email); - if (object.scopes) { - if (!Array.isArray(object.scopes)) - throw TypeError(".google.cloud.batch.v1.ServiceAccount.scopes: array expected"); - message.scopes = []; - for (var i = 0; i < object.scopes.length; ++i) - message.scopes[i] = String(object.scopes[i]); - } - return message; - }; - - /** - * Creates a plain object from a ServiceAccount message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.ServiceAccount - * @static - * @param {google.cloud.batch.v1.ServiceAccount} message ServiceAccount - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceAccount.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.scopes = []; - if (options.defaults) - object.email = ""; - if (message.email != null && message.hasOwnProperty("email")) - object.email = message.email; - if (message.scopes && message.scopes.length) { - object.scopes = []; - for (var j = 0; j < message.scopes.length; ++j) - object.scopes[j] = message.scopes[j]; - } - return object; - }; - - /** - * Converts this ServiceAccount to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.ServiceAccount - * @instance - * @returns {Object.} JSON object - */ - ServiceAccount.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceAccount - * @function getTypeUrl - * @memberof google.cloud.batch.v1.ServiceAccount - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceAccount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.ServiceAccount"; - }; - - return ServiceAccount; - })(); - - v1.ComputeResource = (function() { - - /** - * Properties of a ComputeResource. - * @memberof google.cloud.batch.v1 - * @interface IComputeResource - * @property {number|Long|null} [cpuMilli] ComputeResource cpuMilli - * @property {number|Long|null} [memoryMib] ComputeResource memoryMib - * @property {number|Long|null} [bootDiskMib] ComputeResource bootDiskMib - */ - - /** - * Constructs a new ComputeResource. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a ComputeResource. - * @implements IComputeResource - * @constructor - * @param {google.cloud.batch.v1.IComputeResource=} [properties] Properties to set - */ - function ComputeResource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ComputeResource cpuMilli. - * @member {number|Long} cpuMilli - * @memberof google.cloud.batch.v1.ComputeResource - * @instance - */ - ComputeResource.prototype.cpuMilli = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ComputeResource memoryMib. - * @member {number|Long} memoryMib - * @memberof google.cloud.batch.v1.ComputeResource - * @instance - */ - ComputeResource.prototype.memoryMib = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ComputeResource bootDiskMib. - * @member {number|Long} bootDiskMib - * @memberof google.cloud.batch.v1.ComputeResource - * @instance - */ - ComputeResource.prototype.bootDiskMib = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new ComputeResource instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.ComputeResource - * @static - * @param {google.cloud.batch.v1.IComputeResource=} [properties] Properties to set - * @returns {google.cloud.batch.v1.ComputeResource} ComputeResource instance - */ - ComputeResource.create = function create(properties) { - return new ComputeResource(properties); - }; - - /** - * Encodes the specified ComputeResource message. Does not implicitly {@link google.cloud.batch.v1.ComputeResource.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.ComputeResource - * @static - * @param {google.cloud.batch.v1.IComputeResource} message ComputeResource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ComputeResource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cpuMilli != null && Object.hasOwnProperty.call(message, "cpuMilli")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.cpuMilli); - if (message.memoryMib != null && Object.hasOwnProperty.call(message, "memoryMib")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.memoryMib); - if (message.bootDiskMib != null && Object.hasOwnProperty.call(message, "bootDiskMib")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.bootDiskMib); - return writer; - }; - - /** - * Encodes the specified ComputeResource message, length delimited. Does not implicitly {@link google.cloud.batch.v1.ComputeResource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.ComputeResource - * @static - * @param {google.cloud.batch.v1.IComputeResource} message ComputeResource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ComputeResource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ComputeResource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.ComputeResource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.ComputeResource} ComputeResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ComputeResource.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.ComputeResource(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.cpuMilli = reader.int64(); - break; - } - case 2: { - message.memoryMib = reader.int64(); - break; - } - case 4: { - message.bootDiskMib = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ComputeResource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.ComputeResource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.ComputeResource} ComputeResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ComputeResource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ComputeResource message. - * @function verify - * @memberof google.cloud.batch.v1.ComputeResource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ComputeResource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.cpuMilli != null && message.hasOwnProperty("cpuMilli")) - if (!$util.isInteger(message.cpuMilli) && !(message.cpuMilli && $util.isInteger(message.cpuMilli.low) && $util.isInteger(message.cpuMilli.high))) - return "cpuMilli: integer|Long expected"; - if (message.memoryMib != null && message.hasOwnProperty("memoryMib")) - if (!$util.isInteger(message.memoryMib) && !(message.memoryMib && $util.isInteger(message.memoryMib.low) && $util.isInteger(message.memoryMib.high))) - return "memoryMib: integer|Long expected"; - if (message.bootDiskMib != null && message.hasOwnProperty("bootDiskMib")) - if (!$util.isInteger(message.bootDiskMib) && !(message.bootDiskMib && $util.isInteger(message.bootDiskMib.low) && $util.isInteger(message.bootDiskMib.high))) - return "bootDiskMib: integer|Long expected"; - return null; - }; - - /** - * Creates a ComputeResource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.ComputeResource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.ComputeResource} ComputeResource - */ - ComputeResource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.ComputeResource) - return object; - var message = new $root.google.cloud.batch.v1.ComputeResource(); - if (object.cpuMilli != null) - if ($util.Long) - (message.cpuMilli = $util.Long.fromValue(object.cpuMilli)).unsigned = false; - else if (typeof object.cpuMilli === "string") - message.cpuMilli = parseInt(object.cpuMilli, 10); - else if (typeof object.cpuMilli === "number") - message.cpuMilli = object.cpuMilli; - else if (typeof object.cpuMilli === "object") - message.cpuMilli = new $util.LongBits(object.cpuMilli.low >>> 0, object.cpuMilli.high >>> 0).toNumber(); - if (object.memoryMib != null) - if ($util.Long) - (message.memoryMib = $util.Long.fromValue(object.memoryMib)).unsigned = false; - else if (typeof object.memoryMib === "string") - message.memoryMib = parseInt(object.memoryMib, 10); - else if (typeof object.memoryMib === "number") - message.memoryMib = object.memoryMib; - else if (typeof object.memoryMib === "object") - message.memoryMib = new $util.LongBits(object.memoryMib.low >>> 0, object.memoryMib.high >>> 0).toNumber(); - if (object.bootDiskMib != null) - if ($util.Long) - (message.bootDiskMib = $util.Long.fromValue(object.bootDiskMib)).unsigned = false; - else if (typeof object.bootDiskMib === "string") - message.bootDiskMib = parseInt(object.bootDiskMib, 10); - else if (typeof object.bootDiskMib === "number") - message.bootDiskMib = object.bootDiskMib; - else if (typeof object.bootDiskMib === "object") - message.bootDiskMib = new $util.LongBits(object.bootDiskMib.low >>> 0, object.bootDiskMib.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a ComputeResource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.ComputeResource - * @static - * @param {google.cloud.batch.v1.ComputeResource} message ComputeResource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ComputeResource.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.cpuMilli = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.cpuMilli = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.memoryMib = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.memoryMib = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.bootDiskMib = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.bootDiskMib = options.longs === String ? "0" : 0; - } - if (message.cpuMilli != null && message.hasOwnProperty("cpuMilli")) - if (typeof message.cpuMilli === "number") - object.cpuMilli = options.longs === String ? String(message.cpuMilli) : message.cpuMilli; - else - object.cpuMilli = options.longs === String ? $util.Long.prototype.toString.call(message.cpuMilli) : options.longs === Number ? new $util.LongBits(message.cpuMilli.low >>> 0, message.cpuMilli.high >>> 0).toNumber() : message.cpuMilli; - if (message.memoryMib != null && message.hasOwnProperty("memoryMib")) - if (typeof message.memoryMib === "number") - object.memoryMib = options.longs === String ? String(message.memoryMib) : message.memoryMib; - else - object.memoryMib = options.longs === String ? $util.Long.prototype.toString.call(message.memoryMib) : options.longs === Number ? new $util.LongBits(message.memoryMib.low >>> 0, message.memoryMib.high >>> 0).toNumber() : message.memoryMib; - if (message.bootDiskMib != null && message.hasOwnProperty("bootDiskMib")) - if (typeof message.bootDiskMib === "number") - object.bootDiskMib = options.longs === String ? String(message.bootDiskMib) : message.bootDiskMib; - else - object.bootDiskMib = options.longs === String ? $util.Long.prototype.toString.call(message.bootDiskMib) : options.longs === Number ? new $util.LongBits(message.bootDiskMib.low >>> 0, message.bootDiskMib.high >>> 0).toNumber() : message.bootDiskMib; - return object; - }; - - /** - * Converts this ComputeResource to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.ComputeResource - * @instance - * @returns {Object.} JSON object - */ - ComputeResource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ComputeResource - * @function getTypeUrl - * @memberof google.cloud.batch.v1.ComputeResource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ComputeResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.ComputeResource"; - }; - - return ComputeResource; - })(); - - v1.StatusEvent = (function() { - - /** - * Properties of a StatusEvent. - * @memberof google.cloud.batch.v1 - * @interface IStatusEvent - * @property {string|null} [type] StatusEvent type - * @property {string|null} [description] StatusEvent description - * @property {google.protobuf.ITimestamp|null} [eventTime] StatusEvent eventTime - * @property {google.cloud.batch.v1.ITaskExecution|null} [taskExecution] StatusEvent taskExecution - * @property {google.cloud.batch.v1.TaskStatus.State|null} [taskState] StatusEvent taskState - */ - - /** - * Constructs a new StatusEvent. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a StatusEvent. - * @implements IStatusEvent - * @constructor - * @param {google.cloud.batch.v1.IStatusEvent=} [properties] Properties to set - */ - function StatusEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StatusEvent type. - * @member {string} type - * @memberof google.cloud.batch.v1.StatusEvent - * @instance - */ - StatusEvent.prototype.type = ""; - - /** - * StatusEvent description. - * @member {string} description - * @memberof google.cloud.batch.v1.StatusEvent - * @instance - */ - StatusEvent.prototype.description = ""; - - /** - * StatusEvent eventTime. - * @member {google.protobuf.ITimestamp|null|undefined} eventTime - * @memberof google.cloud.batch.v1.StatusEvent - * @instance - */ - StatusEvent.prototype.eventTime = null; - - /** - * StatusEvent taskExecution. - * @member {google.cloud.batch.v1.ITaskExecution|null|undefined} taskExecution - * @memberof google.cloud.batch.v1.StatusEvent - * @instance - */ - StatusEvent.prototype.taskExecution = null; - - /** - * StatusEvent taskState. - * @member {google.cloud.batch.v1.TaskStatus.State} taskState - * @memberof google.cloud.batch.v1.StatusEvent - * @instance - */ - StatusEvent.prototype.taskState = 0; - - /** - * Creates a new StatusEvent instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.StatusEvent - * @static - * @param {google.cloud.batch.v1.IStatusEvent=} [properties] Properties to set - * @returns {google.cloud.batch.v1.StatusEvent} StatusEvent instance - */ - StatusEvent.create = function create(properties) { - return new StatusEvent(properties); - }; - - /** - * Encodes the specified StatusEvent message. Does not implicitly {@link google.cloud.batch.v1.StatusEvent.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.StatusEvent - * @static - * @param {google.cloud.batch.v1.IStatusEvent} message StatusEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StatusEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); - if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) - $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); - if (message.taskExecution != null && Object.hasOwnProperty.call(message, "taskExecution")) - $root.google.cloud.batch.v1.TaskExecution.encode(message.taskExecution, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.taskState != null && Object.hasOwnProperty.call(message, "taskState")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.taskState); - return writer; - }; - - /** - * Encodes the specified StatusEvent message, length delimited. Does not implicitly {@link google.cloud.batch.v1.StatusEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.StatusEvent - * @static - * @param {google.cloud.batch.v1.IStatusEvent} message StatusEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StatusEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StatusEvent message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.StatusEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.StatusEvent} StatusEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StatusEvent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.StatusEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 3: { - message.type = reader.string(); - break; - } - case 1: { - message.description = reader.string(); - break; - } - case 2: { - message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.taskExecution = $root.google.cloud.batch.v1.TaskExecution.decode(reader, reader.uint32()); - break; - } - case 5: { - message.taskState = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StatusEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.StatusEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.StatusEvent} StatusEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StatusEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StatusEvent message. - * @function verify - * @memberof google.cloud.batch.v1.StatusEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StatusEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.eventTime != null && message.hasOwnProperty("eventTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.eventTime); - if (error) - return "eventTime." + error; - } - if (message.taskExecution != null && message.hasOwnProperty("taskExecution")) { - var error = $root.google.cloud.batch.v1.TaskExecution.verify(message.taskExecution); - if (error) - return "taskExecution." + error; - } - if (message.taskState != null && message.hasOwnProperty("taskState")) - switch (message.taskState) { - default: - return "taskState: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - return null; - }; - - /** - * Creates a StatusEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.StatusEvent - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.StatusEvent} StatusEvent - */ - StatusEvent.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.StatusEvent) - return object; - var message = new $root.google.cloud.batch.v1.StatusEvent(); - if (object.type != null) - message.type = String(object.type); - if (object.description != null) - message.description = String(object.description); - if (object.eventTime != null) { - if (typeof object.eventTime !== "object") - throw TypeError(".google.cloud.batch.v1.StatusEvent.eventTime: object expected"); - message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); - } - if (object.taskExecution != null) { - if (typeof object.taskExecution !== "object") - throw TypeError(".google.cloud.batch.v1.StatusEvent.taskExecution: object expected"); - message.taskExecution = $root.google.cloud.batch.v1.TaskExecution.fromObject(object.taskExecution); - } - switch (object.taskState) { - default: - if (typeof object.taskState === "number") { - message.taskState = object.taskState; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.taskState = 0; - break; - case "PENDING": - case 1: - message.taskState = 1; - break; - case "ASSIGNED": - case 2: - message.taskState = 2; - break; - case "RUNNING": - case 3: - message.taskState = 3; - break; - case "FAILED": - case 4: - message.taskState = 4; - break; - case "SUCCEEDED": - case 5: - message.taskState = 5; - break; - case "UNEXECUTED": - case 6: - message.taskState = 6; - break; - } - return message; - }; - - /** - * Creates a plain object from a StatusEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.StatusEvent - * @static - * @param {google.cloud.batch.v1.StatusEvent} message StatusEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StatusEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.description = ""; - object.eventTime = null; - object.type = ""; - object.taskExecution = null; - object.taskState = options.enums === String ? "STATE_UNSPECIFIED" : 0; - } - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.eventTime != null && message.hasOwnProperty("eventTime")) - object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.taskExecution != null && message.hasOwnProperty("taskExecution")) - object.taskExecution = $root.google.cloud.batch.v1.TaskExecution.toObject(message.taskExecution, options); - if (message.taskState != null && message.hasOwnProperty("taskState")) - object.taskState = options.enums === String ? $root.google.cloud.batch.v1.TaskStatus.State[message.taskState] === undefined ? message.taskState : $root.google.cloud.batch.v1.TaskStatus.State[message.taskState] : message.taskState; - return object; - }; - - /** - * Converts this StatusEvent to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.StatusEvent - * @instance - * @returns {Object.} JSON object - */ - StatusEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StatusEvent - * @function getTypeUrl - * @memberof google.cloud.batch.v1.StatusEvent - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StatusEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.StatusEvent"; - }; - - return StatusEvent; - })(); - - v1.TaskExecution = (function() { - - /** - * Properties of a TaskExecution. - * @memberof google.cloud.batch.v1 - * @interface ITaskExecution - * @property {number|null} [exitCode] TaskExecution exitCode - */ - - /** - * Constructs a new TaskExecution. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a TaskExecution. - * @implements ITaskExecution - * @constructor - * @param {google.cloud.batch.v1.ITaskExecution=} [properties] Properties to set - */ - function TaskExecution(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TaskExecution exitCode. - * @member {number} exitCode - * @memberof google.cloud.batch.v1.TaskExecution - * @instance - */ - TaskExecution.prototype.exitCode = 0; - - /** - * Creates a new TaskExecution instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.TaskExecution - * @static - * @param {google.cloud.batch.v1.ITaskExecution=} [properties] Properties to set - * @returns {google.cloud.batch.v1.TaskExecution} TaskExecution instance - */ - TaskExecution.create = function create(properties) { - return new TaskExecution(properties); - }; - - /** - * Encodes the specified TaskExecution message. Does not implicitly {@link google.cloud.batch.v1.TaskExecution.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.TaskExecution - * @static - * @param {google.cloud.batch.v1.ITaskExecution} message TaskExecution message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskExecution.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.exitCode != null && Object.hasOwnProperty.call(message, "exitCode")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.exitCode); - return writer; - }; - - /** - * Encodes the specified TaskExecution message, length delimited. Does not implicitly {@link google.cloud.batch.v1.TaskExecution.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.TaskExecution - * @static - * @param {google.cloud.batch.v1.ITaskExecution} message TaskExecution message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskExecution.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TaskExecution message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.TaskExecution - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.TaskExecution} TaskExecution - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskExecution.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.TaskExecution(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.exitCode = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TaskExecution message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.TaskExecution - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.TaskExecution} TaskExecution - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskExecution.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TaskExecution message. - * @function verify - * @memberof google.cloud.batch.v1.TaskExecution - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TaskExecution.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.exitCode != null && message.hasOwnProperty("exitCode")) - if (!$util.isInteger(message.exitCode)) - return "exitCode: integer expected"; - return null; - }; - - /** - * Creates a TaskExecution message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.TaskExecution - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.TaskExecution} TaskExecution - */ - TaskExecution.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.TaskExecution) - return object; - var message = new $root.google.cloud.batch.v1.TaskExecution(); - if (object.exitCode != null) - message.exitCode = object.exitCode | 0; - return message; - }; - - /** - * Creates a plain object from a TaskExecution message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.TaskExecution - * @static - * @param {google.cloud.batch.v1.TaskExecution} message TaskExecution - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TaskExecution.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.exitCode = 0; - if (message.exitCode != null && message.hasOwnProperty("exitCode")) - object.exitCode = message.exitCode; - return object; - }; - - /** - * Converts this TaskExecution to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.TaskExecution - * @instance - * @returns {Object.} JSON object - */ - TaskExecution.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TaskExecution - * @function getTypeUrl - * @memberof google.cloud.batch.v1.TaskExecution - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TaskExecution.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.TaskExecution"; - }; - - return TaskExecution; - })(); - - v1.TaskStatus = (function() { - - /** - * Properties of a TaskStatus. - * @memberof google.cloud.batch.v1 - * @interface ITaskStatus - * @property {google.cloud.batch.v1.TaskStatus.State|null} [state] TaskStatus state - * @property {Array.|null} [statusEvents] TaskStatus statusEvents - */ - - /** - * Constructs a new TaskStatus. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a TaskStatus. - * @implements ITaskStatus - * @constructor - * @param {google.cloud.batch.v1.ITaskStatus=} [properties] Properties to set - */ - function TaskStatus(properties) { - this.statusEvents = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TaskStatus state. - * @member {google.cloud.batch.v1.TaskStatus.State} state - * @memberof google.cloud.batch.v1.TaskStatus - * @instance - */ - TaskStatus.prototype.state = 0; - - /** - * TaskStatus statusEvents. - * @member {Array.} statusEvents - * @memberof google.cloud.batch.v1.TaskStatus - * @instance - */ - TaskStatus.prototype.statusEvents = $util.emptyArray; - - /** - * Creates a new TaskStatus instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.TaskStatus - * @static - * @param {google.cloud.batch.v1.ITaskStatus=} [properties] Properties to set - * @returns {google.cloud.batch.v1.TaskStatus} TaskStatus instance - */ - TaskStatus.create = function create(properties) { - return new TaskStatus(properties); - }; - - /** - * Encodes the specified TaskStatus message. Does not implicitly {@link google.cloud.batch.v1.TaskStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.TaskStatus - * @static - * @param {google.cloud.batch.v1.ITaskStatus} message TaskStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskStatus.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); - if (message.statusEvents != null && message.statusEvents.length) - for (var i = 0; i < message.statusEvents.length; ++i) - $root.google.cloud.batch.v1.StatusEvent.encode(message.statusEvents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TaskStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1.TaskStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.TaskStatus - * @static - * @param {google.cloud.batch.v1.ITaskStatus} message TaskStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TaskStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.TaskStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.TaskStatus} TaskStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskStatus.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.TaskStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.state = reader.int32(); - break; - } - case 2: { - if (!(message.statusEvents && message.statusEvents.length)) - message.statusEvents = []; - message.statusEvents.push($root.google.cloud.batch.v1.StatusEvent.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TaskStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.TaskStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.TaskStatus} TaskStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TaskStatus message. - * @function verify - * @memberof google.cloud.batch.v1.TaskStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TaskStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.statusEvents != null && message.hasOwnProperty("statusEvents")) { - if (!Array.isArray(message.statusEvents)) - return "statusEvents: array expected"; - for (var i = 0; i < message.statusEvents.length; ++i) { - var error = $root.google.cloud.batch.v1.StatusEvent.verify(message.statusEvents[i]); - if (error) - return "statusEvents." + error; - } - } - return null; - }; - - /** - * Creates a TaskStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.TaskStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.TaskStatus} TaskStatus - */ - TaskStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.TaskStatus) - return object; - var message = new $root.google.cloud.batch.v1.TaskStatus(); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "PENDING": - case 1: - message.state = 1; - break; - case "ASSIGNED": - case 2: - message.state = 2; - break; - case "RUNNING": - case 3: - message.state = 3; - break; - case "FAILED": - case 4: - message.state = 4; - break; - case "SUCCEEDED": - case 5: - message.state = 5; - break; - case "UNEXECUTED": - case 6: - message.state = 6; - break; - } - if (object.statusEvents) { - if (!Array.isArray(object.statusEvents)) - throw TypeError(".google.cloud.batch.v1.TaskStatus.statusEvents: array expected"); - message.statusEvents = []; - for (var i = 0; i < object.statusEvents.length; ++i) { - if (typeof object.statusEvents[i] !== "object") - throw TypeError(".google.cloud.batch.v1.TaskStatus.statusEvents: object expected"); - message.statusEvents[i] = $root.google.cloud.batch.v1.StatusEvent.fromObject(object.statusEvents[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a TaskStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.TaskStatus - * @static - * @param {google.cloud.batch.v1.TaskStatus} message TaskStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TaskStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.statusEvents = []; - if (options.defaults) - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.batch.v1.TaskStatus.State[message.state] === undefined ? message.state : $root.google.cloud.batch.v1.TaskStatus.State[message.state] : message.state; - if (message.statusEvents && message.statusEvents.length) { - object.statusEvents = []; - for (var j = 0; j < message.statusEvents.length; ++j) - object.statusEvents[j] = $root.google.cloud.batch.v1.StatusEvent.toObject(message.statusEvents[j], options); - } - return object; - }; - - /** - * Converts this TaskStatus to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.TaskStatus - * @instance - * @returns {Object.} JSON object - */ - TaskStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TaskStatus - * @function getTypeUrl - * @memberof google.cloud.batch.v1.TaskStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TaskStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.TaskStatus"; - }; - - /** - * State enum. - * @name google.cloud.batch.v1.TaskStatus.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} PENDING=1 PENDING value - * @property {number} ASSIGNED=2 ASSIGNED value - * @property {number} RUNNING=3 RUNNING value - * @property {number} FAILED=4 FAILED value - * @property {number} SUCCEEDED=5 SUCCEEDED value - * @property {number} UNEXECUTED=6 UNEXECUTED value - */ - TaskStatus.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PENDING"] = 1; - values[valuesById[2] = "ASSIGNED"] = 2; - values[valuesById[3] = "RUNNING"] = 3; - values[valuesById[4] = "FAILED"] = 4; - values[valuesById[5] = "SUCCEEDED"] = 5; - values[valuesById[6] = "UNEXECUTED"] = 6; - return values; - })(); - - return TaskStatus; - })(); - - v1.Runnable = (function() { - - /** - * Properties of a Runnable. - * @memberof google.cloud.batch.v1 - * @interface IRunnable - * @property {google.cloud.batch.v1.Runnable.IContainer|null} [container] Runnable container - * @property {google.cloud.batch.v1.Runnable.IScript|null} [script] Runnable script - * @property {google.cloud.batch.v1.Runnable.IBarrier|null} [barrier] Runnable barrier - * @property {string|null} [displayName] Runnable displayName - * @property {boolean|null} [ignoreExitStatus] Runnable ignoreExitStatus - * @property {boolean|null} [background] Runnable background - * @property {boolean|null} [alwaysRun] Runnable alwaysRun - * @property {google.cloud.batch.v1.IEnvironment|null} [environment] Runnable environment - * @property {google.protobuf.IDuration|null} [timeout] Runnable timeout - * @property {Object.|null} [labels] Runnable labels - */ - - /** - * Constructs a new Runnable. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a Runnable. - * @implements IRunnable - * @constructor - * @param {google.cloud.batch.v1.IRunnable=} [properties] Properties to set - */ - function Runnable(properties) { - this.labels = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Runnable container. - * @member {google.cloud.batch.v1.Runnable.IContainer|null|undefined} container - * @memberof google.cloud.batch.v1.Runnable - * @instance - */ - Runnable.prototype.container = null; - - /** - * Runnable script. - * @member {google.cloud.batch.v1.Runnable.IScript|null|undefined} script - * @memberof google.cloud.batch.v1.Runnable - * @instance - */ - Runnable.prototype.script = null; - - /** - * Runnable barrier. - * @member {google.cloud.batch.v1.Runnable.IBarrier|null|undefined} barrier - * @memberof google.cloud.batch.v1.Runnable - * @instance - */ - Runnable.prototype.barrier = null; - - /** - * Runnable displayName. - * @member {string} displayName - * @memberof google.cloud.batch.v1.Runnable - * @instance - */ - Runnable.prototype.displayName = ""; - - /** - * Runnable ignoreExitStatus. - * @member {boolean} ignoreExitStatus - * @memberof google.cloud.batch.v1.Runnable - * @instance - */ - Runnable.prototype.ignoreExitStatus = false; - - /** - * Runnable background. - * @member {boolean} background - * @memberof google.cloud.batch.v1.Runnable - * @instance - */ - Runnable.prototype.background = false; - - /** - * Runnable alwaysRun. - * @member {boolean} alwaysRun - * @memberof google.cloud.batch.v1.Runnable - * @instance - */ - Runnable.prototype.alwaysRun = false; - - /** - * Runnable environment. - * @member {google.cloud.batch.v1.IEnvironment|null|undefined} environment - * @memberof google.cloud.batch.v1.Runnable - * @instance - */ - Runnable.prototype.environment = null; - - /** - * Runnable timeout. - * @member {google.protobuf.IDuration|null|undefined} timeout - * @memberof google.cloud.batch.v1.Runnable - * @instance - */ - Runnable.prototype.timeout = null; - - /** - * Runnable labels. - * @member {Object.} labels - * @memberof google.cloud.batch.v1.Runnable - * @instance - */ - Runnable.prototype.labels = $util.emptyObject; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Runnable executable. - * @member {"container"|"script"|"barrier"|undefined} executable - * @memberof google.cloud.batch.v1.Runnable - * @instance - */ - Object.defineProperty(Runnable.prototype, "executable", { - get: $util.oneOfGetter($oneOfFields = ["container", "script", "barrier"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Runnable instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.Runnable - * @static - * @param {google.cloud.batch.v1.IRunnable=} [properties] Properties to set - * @returns {google.cloud.batch.v1.Runnable} Runnable instance - */ - Runnable.create = function create(properties) { - return new Runnable(properties); - }; - - /** - * Encodes the specified Runnable message. Does not implicitly {@link google.cloud.batch.v1.Runnable.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.Runnable - * @static - * @param {google.cloud.batch.v1.IRunnable} message Runnable message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Runnable.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.container != null && Object.hasOwnProperty.call(message, "container")) - $root.google.cloud.batch.v1.Runnable.Container.encode(message.container, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.script != null && Object.hasOwnProperty.call(message, "script")) - $root.google.cloud.batch.v1.Runnable.Script.encode(message.script, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.ignoreExitStatus != null && Object.hasOwnProperty.call(message, "ignoreExitStatus")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.ignoreExitStatus); - if (message.background != null && Object.hasOwnProperty.call(message, "background")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.background); - if (message.alwaysRun != null && Object.hasOwnProperty.call(message, "alwaysRun")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.alwaysRun); - if (message.barrier != null && Object.hasOwnProperty.call(message, "barrier")) - $root.google.cloud.batch.v1.Runnable.Barrier.encode(message.barrier, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) - $root.google.cloud.batch.v1.Environment.encode(message.environment, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) - $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - 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 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.displayName); - return writer; - }; - - /** - * Encodes the specified Runnable message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Runnable.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.Runnable - * @static - * @param {google.cloud.batch.v1.IRunnable} message Runnable message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Runnable.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Runnable message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.Runnable - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.Runnable} Runnable - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Runnable.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Runnable(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.container = $root.google.cloud.batch.v1.Runnable.Container.decode(reader, reader.uint32()); - break; - } - case 2: { - message.script = $root.google.cloud.batch.v1.Runnable.Script.decode(reader, reader.uint32()); - break; - } - case 6: { - message.barrier = $root.google.cloud.batch.v1.Runnable.Barrier.decode(reader, reader.uint32()); - break; - } - case 10: { - message.displayName = reader.string(); - break; - } - case 3: { - message.ignoreExitStatus = reader.bool(); - break; - } - case 4: { - message.background = reader.bool(); - break; - } - case 5: { - message.alwaysRun = reader.bool(); - break; - } - case 7: { - message.environment = $root.google.cloud.batch.v1.Environment.decode(reader, reader.uint32()); - break; - } - case 8: { - message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 9: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Runnable message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.Runnable - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.Runnable} Runnable - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Runnable.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Runnable message. - * @function verify - * @memberof google.cloud.batch.v1.Runnable - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Runnable.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.container != null && message.hasOwnProperty("container")) { - properties.executable = 1; - { - var error = $root.google.cloud.batch.v1.Runnable.Container.verify(message.container); - if (error) - return "container." + error; - } - } - if (message.script != null && message.hasOwnProperty("script")) { - if (properties.executable === 1) - return "executable: multiple values"; - properties.executable = 1; - { - var error = $root.google.cloud.batch.v1.Runnable.Script.verify(message.script); - if (error) - return "script." + error; - } - } - if (message.barrier != null && message.hasOwnProperty("barrier")) { - if (properties.executable === 1) - return "executable: multiple values"; - properties.executable = 1; - { - var error = $root.google.cloud.batch.v1.Runnable.Barrier.verify(message.barrier); - if (error) - return "barrier." + error; - } - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.ignoreExitStatus != null && message.hasOwnProperty("ignoreExitStatus")) - if (typeof message.ignoreExitStatus !== "boolean") - return "ignoreExitStatus: boolean expected"; - if (message.background != null && message.hasOwnProperty("background")) - if (typeof message.background !== "boolean") - return "background: boolean expected"; - if (message.alwaysRun != null && message.hasOwnProperty("alwaysRun")) - if (typeof message.alwaysRun !== "boolean") - return "alwaysRun: boolean expected"; - if (message.environment != null && message.hasOwnProperty("environment")) { - var error = $root.google.cloud.batch.v1.Environment.verify(message.environment); - if (error) - return "environment." + error; - } - if (message.timeout != null && message.hasOwnProperty("timeout")) { - var error = $root.google.protobuf.Duration.verify(message.timeout); - if (error) - return "timeout." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - return null; - }; - - /** - * Creates a Runnable message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.Runnable - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.Runnable} Runnable - */ - Runnable.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.Runnable) - return object; - var message = new $root.google.cloud.batch.v1.Runnable(); - if (object.container != null) { - if (typeof object.container !== "object") - throw TypeError(".google.cloud.batch.v1.Runnable.container: object expected"); - message.container = $root.google.cloud.batch.v1.Runnable.Container.fromObject(object.container); - } - if (object.script != null) { - if (typeof object.script !== "object") - throw TypeError(".google.cloud.batch.v1.Runnable.script: object expected"); - message.script = $root.google.cloud.batch.v1.Runnable.Script.fromObject(object.script); - } - if (object.barrier != null) { - if (typeof object.barrier !== "object") - throw TypeError(".google.cloud.batch.v1.Runnable.barrier: object expected"); - message.barrier = $root.google.cloud.batch.v1.Runnable.Barrier.fromObject(object.barrier); - } - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.ignoreExitStatus != null) - message.ignoreExitStatus = Boolean(object.ignoreExitStatus); - if (object.background != null) - message.background = Boolean(object.background); - if (object.alwaysRun != null) - message.alwaysRun = Boolean(object.alwaysRun); - if (object.environment != null) { - if (typeof object.environment !== "object") - throw TypeError(".google.cloud.batch.v1.Runnable.environment: object expected"); - message.environment = $root.google.cloud.batch.v1.Environment.fromObject(object.environment); - } - if (object.timeout != null) { - if (typeof object.timeout !== "object") - throw TypeError(".google.cloud.batch.v1.Runnable.timeout: object expected"); - message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.batch.v1.Runnable.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - return message; - }; - - /** - * Creates a plain object from a Runnable message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.Runnable - * @static - * @param {google.cloud.batch.v1.Runnable} message Runnable - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Runnable.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.ignoreExitStatus = false; - object.background = false; - object.alwaysRun = false; - object.environment = null; - object.timeout = null; - object.displayName = ""; - } - if (message.container != null && message.hasOwnProperty("container")) { - object.container = $root.google.cloud.batch.v1.Runnable.Container.toObject(message.container, options); - if (options.oneofs) - object.executable = "container"; - } - if (message.script != null && message.hasOwnProperty("script")) { - object.script = $root.google.cloud.batch.v1.Runnable.Script.toObject(message.script, options); - if (options.oneofs) - object.executable = "script"; - } - if (message.ignoreExitStatus != null && message.hasOwnProperty("ignoreExitStatus")) - object.ignoreExitStatus = message.ignoreExitStatus; - if (message.background != null && message.hasOwnProperty("background")) - object.background = message.background; - if (message.alwaysRun != null && message.hasOwnProperty("alwaysRun")) - object.alwaysRun = message.alwaysRun; - if (message.barrier != null && message.hasOwnProperty("barrier")) { - object.barrier = $root.google.cloud.batch.v1.Runnable.Barrier.toObject(message.barrier, options); - if (options.oneofs) - object.executable = "barrier"; - } - if (message.environment != null && message.hasOwnProperty("environment")) - object.environment = $root.google.cloud.batch.v1.Environment.toObject(message.environment, options); - if (message.timeout != null && message.hasOwnProperty("timeout")) - object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - return object; - }; - - /** - * Converts this Runnable to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.Runnable - * @instance - * @returns {Object.} JSON object - */ - Runnable.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Runnable - * @function getTypeUrl - * @memberof google.cloud.batch.v1.Runnable - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Runnable.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.Runnable"; - }; - - Runnable.Container = (function() { - - /** - * Properties of a Container. - * @memberof google.cloud.batch.v1.Runnable - * @interface IContainer - * @property {string|null} [imageUri] Container imageUri - * @property {Array.|null} [commands] Container commands - * @property {string|null} [entrypoint] Container entrypoint - * @property {Array.|null} [volumes] Container volumes - * @property {string|null} [options] Container options - * @property {boolean|null} [blockExternalNetwork] Container blockExternalNetwork - * @property {string|null} [username] Container username - * @property {string|null} [password] Container password - * @property {boolean|null} [enableImageStreaming] Container enableImageStreaming - */ - - /** - * Constructs a new Container. - * @memberof google.cloud.batch.v1.Runnable - * @classdesc Represents a Container. - * @implements IContainer - * @constructor - * @param {google.cloud.batch.v1.Runnable.IContainer=} [properties] Properties to set - */ - function Container(properties) { - this.commands = []; - this.volumes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Container imageUri. - * @member {string} imageUri - * @memberof google.cloud.batch.v1.Runnable.Container - * @instance - */ - Container.prototype.imageUri = ""; - - /** - * Container commands. - * @member {Array.} commands - * @memberof google.cloud.batch.v1.Runnable.Container - * @instance - */ - Container.prototype.commands = $util.emptyArray; - - /** - * Container entrypoint. - * @member {string} entrypoint - * @memberof google.cloud.batch.v1.Runnable.Container - * @instance - */ - Container.prototype.entrypoint = ""; - - /** - * Container volumes. - * @member {Array.} volumes - * @memberof google.cloud.batch.v1.Runnable.Container - * @instance - */ - Container.prototype.volumes = $util.emptyArray; - - /** - * Container options. - * @member {string} options - * @memberof google.cloud.batch.v1.Runnable.Container - * @instance - */ - Container.prototype.options = ""; - - /** - * Container blockExternalNetwork. - * @member {boolean} blockExternalNetwork - * @memberof google.cloud.batch.v1.Runnable.Container - * @instance - */ - Container.prototype.blockExternalNetwork = false; - - /** - * Container username. - * @member {string} username - * @memberof google.cloud.batch.v1.Runnable.Container - * @instance - */ - Container.prototype.username = ""; - - /** - * Container password. - * @member {string} password - * @memberof google.cloud.batch.v1.Runnable.Container - * @instance - */ - Container.prototype.password = ""; - - /** - * Container enableImageStreaming. - * @member {boolean} enableImageStreaming - * @memberof google.cloud.batch.v1.Runnable.Container - * @instance - */ - Container.prototype.enableImageStreaming = false; - - /** - * Creates a new Container instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.Runnable.Container - * @static - * @param {google.cloud.batch.v1.Runnable.IContainer=} [properties] Properties to set - * @returns {google.cloud.batch.v1.Runnable.Container} Container instance - */ - Container.create = function create(properties) { - return new Container(properties); - }; - - /** - * Encodes the specified Container message. Does not implicitly {@link google.cloud.batch.v1.Runnable.Container.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.Runnable.Container - * @static - * @param {google.cloud.batch.v1.Runnable.IContainer} message Container message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Container.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.imageUri != null && Object.hasOwnProperty.call(message, "imageUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.imageUri); - if (message.commands != null && message.commands.length) - for (var i = 0; i < message.commands.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.commands[i]); - if (message.entrypoint != null && Object.hasOwnProperty.call(message, "entrypoint")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.entrypoint); - if (message.volumes != null && message.volumes.length) - for (var i = 0; i < message.volumes.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.volumes[i]); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.options); - if (message.blockExternalNetwork != null && Object.hasOwnProperty.call(message, "blockExternalNetwork")) - writer.uint32(/* id 9, wireType 0 =*/72).bool(message.blockExternalNetwork); - if (message.username != null && Object.hasOwnProperty.call(message, "username")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.username); - if (message.password != null && Object.hasOwnProperty.call(message, "password")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.password); - if (message.enableImageStreaming != null && Object.hasOwnProperty.call(message, "enableImageStreaming")) - writer.uint32(/* id 12, wireType 0 =*/96).bool(message.enableImageStreaming); - return writer; - }; - - /** - * Encodes the specified Container message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Runnable.Container.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.Runnable.Container - * @static - * @param {google.cloud.batch.v1.Runnable.IContainer} message Container message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Container.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Container message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.Runnable.Container - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.Runnable.Container} Container - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Container.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Runnable.Container(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.imageUri = reader.string(); - break; - } - case 2: { - if (!(message.commands && message.commands.length)) - message.commands = []; - message.commands.push(reader.string()); - break; - } - case 3: { - message.entrypoint = reader.string(); - break; - } - case 7: { - if (!(message.volumes && message.volumes.length)) - message.volumes = []; - message.volumes.push(reader.string()); - break; - } - case 8: { - message.options = reader.string(); - break; - } - case 9: { - message.blockExternalNetwork = reader.bool(); - break; - } - case 10: { - message.username = reader.string(); - break; - } - case 11: { - message.password = reader.string(); - break; - } - case 12: { - message.enableImageStreaming = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Container message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.Runnable.Container - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.Runnable.Container} Container - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Container.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Container message. - * @function verify - * @memberof google.cloud.batch.v1.Runnable.Container - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Container.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.imageUri != null && message.hasOwnProperty("imageUri")) - if (!$util.isString(message.imageUri)) - return "imageUri: string expected"; - if (message.commands != null && message.hasOwnProperty("commands")) { - if (!Array.isArray(message.commands)) - return "commands: array expected"; - for (var i = 0; i < message.commands.length; ++i) - if (!$util.isString(message.commands[i])) - return "commands: string[] expected"; - } - if (message.entrypoint != null && message.hasOwnProperty("entrypoint")) - if (!$util.isString(message.entrypoint)) - return "entrypoint: string expected"; - if (message.volumes != null && message.hasOwnProperty("volumes")) { - if (!Array.isArray(message.volumes)) - return "volumes: array expected"; - for (var i = 0; i < message.volumes.length; ++i) - if (!$util.isString(message.volumes[i])) - return "volumes: string[] expected"; - } - if (message.options != null && message.hasOwnProperty("options")) - if (!$util.isString(message.options)) - return "options: string expected"; - if (message.blockExternalNetwork != null && message.hasOwnProperty("blockExternalNetwork")) - if (typeof message.blockExternalNetwork !== "boolean") - return "blockExternalNetwork: boolean expected"; - if (message.username != null && message.hasOwnProperty("username")) - if (!$util.isString(message.username)) - return "username: string expected"; - if (message.password != null && message.hasOwnProperty("password")) - if (!$util.isString(message.password)) - return "password: string expected"; - if (message.enableImageStreaming != null && message.hasOwnProperty("enableImageStreaming")) - if (typeof message.enableImageStreaming !== "boolean") - return "enableImageStreaming: boolean expected"; - return null; - }; - - /** - * Creates a Container message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.Runnable.Container - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.Runnable.Container} Container - */ - Container.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.Runnable.Container) - return object; - var message = new $root.google.cloud.batch.v1.Runnable.Container(); - if (object.imageUri != null) - message.imageUri = String(object.imageUri); - if (object.commands) { - if (!Array.isArray(object.commands)) - throw TypeError(".google.cloud.batch.v1.Runnable.Container.commands: array expected"); - message.commands = []; - for (var i = 0; i < object.commands.length; ++i) - message.commands[i] = String(object.commands[i]); - } - if (object.entrypoint != null) - message.entrypoint = String(object.entrypoint); - if (object.volumes) { - if (!Array.isArray(object.volumes)) - throw TypeError(".google.cloud.batch.v1.Runnable.Container.volumes: array expected"); - message.volumes = []; - for (var i = 0; i < object.volumes.length; ++i) - message.volumes[i] = String(object.volumes[i]); - } - if (object.options != null) - message.options = String(object.options); - if (object.blockExternalNetwork != null) - message.blockExternalNetwork = Boolean(object.blockExternalNetwork); - if (object.username != null) - message.username = String(object.username); - if (object.password != null) - message.password = String(object.password); - if (object.enableImageStreaming != null) - message.enableImageStreaming = Boolean(object.enableImageStreaming); - return message; - }; - - /** - * Creates a plain object from a Container message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.Runnable.Container - * @static - * @param {google.cloud.batch.v1.Runnable.Container} message Container - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Container.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.commands = []; - object.volumes = []; - } - if (options.defaults) { - object.imageUri = ""; - object.entrypoint = ""; - object.options = ""; - object.blockExternalNetwork = false; - object.username = ""; - object.password = ""; - object.enableImageStreaming = false; - } - if (message.imageUri != null && message.hasOwnProperty("imageUri")) - object.imageUri = message.imageUri; - if (message.commands && message.commands.length) { - object.commands = []; - for (var j = 0; j < message.commands.length; ++j) - object.commands[j] = message.commands[j]; - } - if (message.entrypoint != null && message.hasOwnProperty("entrypoint")) - object.entrypoint = message.entrypoint; - if (message.volumes && message.volumes.length) { - object.volumes = []; - for (var j = 0; j < message.volumes.length; ++j) - object.volumes[j] = message.volumes[j]; - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = message.options; - if (message.blockExternalNetwork != null && message.hasOwnProperty("blockExternalNetwork")) - object.blockExternalNetwork = message.blockExternalNetwork; - if (message.username != null && message.hasOwnProperty("username")) - object.username = message.username; - if (message.password != null && message.hasOwnProperty("password")) - object.password = message.password; - if (message.enableImageStreaming != null && message.hasOwnProperty("enableImageStreaming")) - object.enableImageStreaming = message.enableImageStreaming; - return object; - }; - - /** - * Converts this Container to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.Runnable.Container - * @instance - * @returns {Object.} JSON object - */ - Container.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Container - * @function getTypeUrl - * @memberof google.cloud.batch.v1.Runnable.Container - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Container.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.Runnable.Container"; - }; - - return Container; - })(); - - Runnable.Script = (function() { - - /** - * Properties of a Script. - * @memberof google.cloud.batch.v1.Runnable - * @interface IScript - * @property {string|null} [path] Script path - * @property {string|null} [text] Script text - */ - - /** - * Constructs a new Script. - * @memberof google.cloud.batch.v1.Runnable - * @classdesc Represents a Script. - * @implements IScript - * @constructor - * @param {google.cloud.batch.v1.Runnable.IScript=} [properties] Properties to set - */ - function Script(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Script path. - * @member {string|null|undefined} path - * @memberof google.cloud.batch.v1.Runnable.Script - * @instance - */ - Script.prototype.path = null; - - /** - * Script text. - * @member {string|null|undefined} text - * @memberof google.cloud.batch.v1.Runnable.Script - * @instance - */ - Script.prototype.text = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Script command. - * @member {"path"|"text"|undefined} command - * @memberof google.cloud.batch.v1.Runnable.Script - * @instance - */ - Object.defineProperty(Script.prototype, "command", { - get: $util.oneOfGetter($oneOfFields = ["path", "text"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Script instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.Runnable.Script - * @static - * @param {google.cloud.batch.v1.Runnable.IScript=} [properties] Properties to set - * @returns {google.cloud.batch.v1.Runnable.Script} Script instance - */ - Script.create = function create(properties) { - return new Script(properties); - }; - - /** - * Encodes the specified Script message. Does not implicitly {@link google.cloud.batch.v1.Runnable.Script.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.Runnable.Script - * @static - * @param {google.cloud.batch.v1.Runnable.IScript} message Script message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Script.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.path); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.text); - return writer; - }; - - /** - * Encodes the specified Script message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Runnable.Script.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.Runnable.Script - * @static - * @param {google.cloud.batch.v1.Runnable.IScript} message Script message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Script.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Script message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.Runnable.Script - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.Runnable.Script} Script - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Script.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Runnable.Script(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.path = reader.string(); - break; - } - case 2: { - message.text = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Script message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.Runnable.Script - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.Runnable.Script} Script - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Script.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Script message. - * @function verify - * @memberof google.cloud.batch.v1.Runnable.Script - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Script.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.path != null && message.hasOwnProperty("path")) { - properties.command = 1; - if (!$util.isString(message.path)) - return "path: string expected"; - } - if (message.text != null && message.hasOwnProperty("text")) { - if (properties.command === 1) - return "command: multiple values"; - properties.command = 1; - if (!$util.isString(message.text)) - return "text: string expected"; - } - return null; - }; - - /** - * Creates a Script message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.Runnable.Script - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.Runnable.Script} Script - */ - Script.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.Runnable.Script) - return object; - var message = new $root.google.cloud.batch.v1.Runnable.Script(); - if (object.path != null) - message.path = String(object.path); - if (object.text != null) - message.text = String(object.text); - return message; - }; - - /** - * Creates a plain object from a Script message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.Runnable.Script - * @static - * @param {google.cloud.batch.v1.Runnable.Script} message Script - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Script.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.path != null && message.hasOwnProperty("path")) { - object.path = message.path; - if (options.oneofs) - object.command = "path"; - } - if (message.text != null && message.hasOwnProperty("text")) { - object.text = message.text; - if (options.oneofs) - object.command = "text"; - } - return object; - }; - - /** - * Converts this Script to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.Runnable.Script - * @instance - * @returns {Object.} JSON object - */ - Script.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Script - * @function getTypeUrl - * @memberof google.cloud.batch.v1.Runnable.Script - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Script.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.Runnable.Script"; - }; - - return Script; - })(); - - Runnable.Barrier = (function() { - - /** - * Properties of a Barrier. - * @memberof google.cloud.batch.v1.Runnable - * @interface IBarrier - * @property {string|null} [name] Barrier name - */ - - /** - * Constructs a new Barrier. - * @memberof google.cloud.batch.v1.Runnable - * @classdesc Represents a Barrier. - * @implements IBarrier - * @constructor - * @param {google.cloud.batch.v1.Runnable.IBarrier=} [properties] Properties to set - */ - function Barrier(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Barrier name. - * @member {string} name - * @memberof google.cloud.batch.v1.Runnable.Barrier - * @instance - */ - Barrier.prototype.name = ""; - - /** - * Creates a new Barrier instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.Runnable.Barrier - * @static - * @param {google.cloud.batch.v1.Runnable.IBarrier=} [properties] Properties to set - * @returns {google.cloud.batch.v1.Runnable.Barrier} Barrier instance - */ - Barrier.create = function create(properties) { - return new Barrier(properties); - }; - - /** - * Encodes the specified Barrier message. Does not implicitly {@link google.cloud.batch.v1.Runnable.Barrier.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.Runnable.Barrier - * @static - * @param {google.cloud.batch.v1.Runnable.IBarrier} message Barrier message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Barrier.encode = function encode(message, writer) { - 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 Barrier message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Runnable.Barrier.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.Runnable.Barrier - * @static - * @param {google.cloud.batch.v1.Runnable.IBarrier} message Barrier message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Barrier.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Barrier message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.Runnable.Barrier - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.Runnable.Barrier} Barrier - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Barrier.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Runnable.Barrier(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Barrier message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.Runnable.Barrier - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.Runnable.Barrier} Barrier - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Barrier.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Barrier message. - * @function verify - * @memberof google.cloud.batch.v1.Runnable.Barrier - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Barrier.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a Barrier message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.Runnable.Barrier - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.Runnable.Barrier} Barrier - */ - Barrier.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.Runnable.Barrier) - return object; - var message = new $root.google.cloud.batch.v1.Runnable.Barrier(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a Barrier message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.Runnable.Barrier - * @static - * @param {google.cloud.batch.v1.Runnable.Barrier} message Barrier - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Barrier.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 Barrier to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.Runnable.Barrier - * @instance - * @returns {Object.} JSON object - */ - Barrier.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Barrier - * @function getTypeUrl - * @memberof google.cloud.batch.v1.Runnable.Barrier - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Barrier.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.Runnable.Barrier"; - }; - - return Barrier; - })(); - - return Runnable; - })(); - - v1.TaskSpec = (function() { - - /** - * Properties of a TaskSpec. - * @memberof google.cloud.batch.v1 - * @interface ITaskSpec - * @property {Array.|null} [runnables] TaskSpec runnables - * @property {google.cloud.batch.v1.IComputeResource|null} [computeResource] TaskSpec computeResource - * @property {google.protobuf.IDuration|null} [maxRunDuration] TaskSpec maxRunDuration - * @property {number|null} [maxRetryCount] TaskSpec maxRetryCount - * @property {Array.|null} [lifecyclePolicies] TaskSpec lifecyclePolicies - * @property {Object.|null} [environments] TaskSpec environments - * @property {Array.|null} [volumes] TaskSpec volumes - * @property {google.cloud.batch.v1.IEnvironment|null} [environment] TaskSpec environment - */ - - /** - * Constructs a new TaskSpec. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a TaskSpec. - * @implements ITaskSpec - * @constructor - * @param {google.cloud.batch.v1.ITaskSpec=} [properties] Properties to set - */ - function TaskSpec(properties) { - this.runnables = []; - this.lifecyclePolicies = []; - this.environments = {}; - this.volumes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TaskSpec runnables. - * @member {Array.} runnables - * @memberof google.cloud.batch.v1.TaskSpec - * @instance - */ - TaskSpec.prototype.runnables = $util.emptyArray; - - /** - * TaskSpec computeResource. - * @member {google.cloud.batch.v1.IComputeResource|null|undefined} computeResource - * @memberof google.cloud.batch.v1.TaskSpec - * @instance - */ - TaskSpec.prototype.computeResource = null; - - /** - * TaskSpec maxRunDuration. - * @member {google.protobuf.IDuration|null|undefined} maxRunDuration - * @memberof google.cloud.batch.v1.TaskSpec - * @instance - */ - TaskSpec.prototype.maxRunDuration = null; - - /** - * TaskSpec maxRetryCount. - * @member {number} maxRetryCount - * @memberof google.cloud.batch.v1.TaskSpec - * @instance - */ - TaskSpec.prototype.maxRetryCount = 0; - - /** - * TaskSpec lifecyclePolicies. - * @member {Array.} lifecyclePolicies - * @memberof google.cloud.batch.v1.TaskSpec - * @instance - */ - TaskSpec.prototype.lifecyclePolicies = $util.emptyArray; - - /** - * TaskSpec environments. - * @member {Object.} environments - * @memberof google.cloud.batch.v1.TaskSpec - * @instance - */ - TaskSpec.prototype.environments = $util.emptyObject; - - /** - * TaskSpec volumes. - * @member {Array.} volumes - * @memberof google.cloud.batch.v1.TaskSpec - * @instance - */ - TaskSpec.prototype.volumes = $util.emptyArray; - - /** - * TaskSpec environment. - * @member {google.cloud.batch.v1.IEnvironment|null|undefined} environment - * @memberof google.cloud.batch.v1.TaskSpec - * @instance - */ - TaskSpec.prototype.environment = null; - - /** - * Creates a new TaskSpec instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.TaskSpec - * @static - * @param {google.cloud.batch.v1.ITaskSpec=} [properties] Properties to set - * @returns {google.cloud.batch.v1.TaskSpec} TaskSpec instance - */ - TaskSpec.create = function create(properties) { - return new TaskSpec(properties); - }; - - /** - * Encodes the specified TaskSpec message. Does not implicitly {@link google.cloud.batch.v1.TaskSpec.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.TaskSpec - * @static - * @param {google.cloud.batch.v1.ITaskSpec} message TaskSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.computeResource != null && Object.hasOwnProperty.call(message, "computeResource")) - $root.google.cloud.batch.v1.ComputeResource.encode(message.computeResource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.maxRunDuration != null && Object.hasOwnProperty.call(message, "maxRunDuration")) - $root.google.protobuf.Duration.encode(message.maxRunDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.maxRetryCount != null && Object.hasOwnProperty.call(message, "maxRetryCount")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxRetryCount); - if (message.environments != null && Object.hasOwnProperty.call(message, "environments")) - for (var keys = Object.keys(message.environments), i = 0; i < keys.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.environments[keys[i]]).ldelim(); - if (message.volumes != null && message.volumes.length) - for (var i = 0; i < message.volumes.length; ++i) - $root.google.cloud.batch.v1.Volume.encode(message.volumes[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.runnables != null && message.runnables.length) - for (var i = 0; i < message.runnables.length; ++i) - $root.google.cloud.batch.v1.Runnable.encode(message.runnables[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.lifecyclePolicies != null && message.lifecyclePolicies.length) - for (var i = 0; i < message.lifecyclePolicies.length; ++i) - $root.google.cloud.batch.v1.LifecyclePolicy.encode(message.lifecyclePolicies[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) - $root.google.cloud.batch.v1.Environment.encode(message.environment, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TaskSpec message, length delimited. Does not implicitly {@link google.cloud.batch.v1.TaskSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.TaskSpec - * @static - * @param {google.cloud.batch.v1.ITaskSpec} message TaskSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TaskSpec message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.TaskSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.TaskSpec} TaskSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskSpec.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.TaskSpec(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 8: { - if (!(message.runnables && message.runnables.length)) - message.runnables = []; - message.runnables.push($root.google.cloud.batch.v1.Runnable.decode(reader, reader.uint32())); - break; - } - case 3: { - message.computeResource = $root.google.cloud.batch.v1.ComputeResource.decode(reader, reader.uint32()); - break; - } - case 4: { - message.maxRunDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 5: { - message.maxRetryCount = reader.int32(); - break; - } - case 9: { - if (!(message.lifecyclePolicies && message.lifecyclePolicies.length)) - message.lifecyclePolicies = []; - message.lifecyclePolicies.push($root.google.cloud.batch.v1.LifecyclePolicy.decode(reader, reader.uint32())); - break; - } - case 6: { - if (message.environments === $util.emptyObject) - message.environments = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.environments[key] = value; - break; - } - case 7: { - if (!(message.volumes && message.volumes.length)) - message.volumes = []; - message.volumes.push($root.google.cloud.batch.v1.Volume.decode(reader, reader.uint32())); - break; - } - case 10: { - message.environment = $root.google.cloud.batch.v1.Environment.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TaskSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.TaskSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.TaskSpec} TaskSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TaskSpec message. - * @function verify - * @memberof google.cloud.batch.v1.TaskSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TaskSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.runnables != null && message.hasOwnProperty("runnables")) { - if (!Array.isArray(message.runnables)) - return "runnables: array expected"; - for (var i = 0; i < message.runnables.length; ++i) { - var error = $root.google.cloud.batch.v1.Runnable.verify(message.runnables[i]); - if (error) - return "runnables." + error; - } - } - if (message.computeResource != null && message.hasOwnProperty("computeResource")) { - var error = $root.google.cloud.batch.v1.ComputeResource.verify(message.computeResource); - if (error) - return "computeResource." + error; - } - if (message.maxRunDuration != null && message.hasOwnProperty("maxRunDuration")) { - var error = $root.google.protobuf.Duration.verify(message.maxRunDuration); - if (error) - return "maxRunDuration." + error; - } - if (message.maxRetryCount != null && message.hasOwnProperty("maxRetryCount")) - if (!$util.isInteger(message.maxRetryCount)) - return "maxRetryCount: integer expected"; - if (message.lifecyclePolicies != null && message.hasOwnProperty("lifecyclePolicies")) { - if (!Array.isArray(message.lifecyclePolicies)) - return "lifecyclePolicies: array expected"; - for (var i = 0; i < message.lifecyclePolicies.length; ++i) { - var error = $root.google.cloud.batch.v1.LifecyclePolicy.verify(message.lifecyclePolicies[i]); - if (error) - return "lifecyclePolicies." + error; - } - } - if (message.environments != null && message.hasOwnProperty("environments")) { - if (!$util.isObject(message.environments)) - return "environments: object expected"; - var key = Object.keys(message.environments); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.environments[key[i]])) - return "environments: string{k:string} expected"; - } - if (message.volumes != null && message.hasOwnProperty("volumes")) { - if (!Array.isArray(message.volumes)) - return "volumes: array expected"; - for (var i = 0; i < message.volumes.length; ++i) { - var error = $root.google.cloud.batch.v1.Volume.verify(message.volumes[i]); - if (error) - return "volumes." + error; - } - } - if (message.environment != null && message.hasOwnProperty("environment")) { - var error = $root.google.cloud.batch.v1.Environment.verify(message.environment); - if (error) - return "environment." + error; - } - return null; - }; - - /** - * Creates a TaskSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.TaskSpec - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.TaskSpec} TaskSpec - */ - TaskSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.TaskSpec) - return object; - var message = new $root.google.cloud.batch.v1.TaskSpec(); - if (object.runnables) { - if (!Array.isArray(object.runnables)) - throw TypeError(".google.cloud.batch.v1.TaskSpec.runnables: array expected"); - message.runnables = []; - for (var i = 0; i < object.runnables.length; ++i) { - if (typeof object.runnables[i] !== "object") - throw TypeError(".google.cloud.batch.v1.TaskSpec.runnables: object expected"); - message.runnables[i] = $root.google.cloud.batch.v1.Runnable.fromObject(object.runnables[i]); - } - } - if (object.computeResource != null) { - if (typeof object.computeResource !== "object") - throw TypeError(".google.cloud.batch.v1.TaskSpec.computeResource: object expected"); - message.computeResource = $root.google.cloud.batch.v1.ComputeResource.fromObject(object.computeResource); - } - if (object.maxRunDuration != null) { - if (typeof object.maxRunDuration !== "object") - throw TypeError(".google.cloud.batch.v1.TaskSpec.maxRunDuration: object expected"); - message.maxRunDuration = $root.google.protobuf.Duration.fromObject(object.maxRunDuration); - } - if (object.maxRetryCount != null) - message.maxRetryCount = object.maxRetryCount | 0; - if (object.lifecyclePolicies) { - if (!Array.isArray(object.lifecyclePolicies)) - throw TypeError(".google.cloud.batch.v1.TaskSpec.lifecyclePolicies: array expected"); - message.lifecyclePolicies = []; - for (var i = 0; i < object.lifecyclePolicies.length; ++i) { - if (typeof object.lifecyclePolicies[i] !== "object") - throw TypeError(".google.cloud.batch.v1.TaskSpec.lifecyclePolicies: object expected"); - message.lifecyclePolicies[i] = $root.google.cloud.batch.v1.LifecyclePolicy.fromObject(object.lifecyclePolicies[i]); - } - } - if (object.environments) { - if (typeof object.environments !== "object") - throw TypeError(".google.cloud.batch.v1.TaskSpec.environments: object expected"); - message.environments = {}; - for (var keys = Object.keys(object.environments), i = 0; i < keys.length; ++i) - message.environments[keys[i]] = String(object.environments[keys[i]]); - } - if (object.volumes) { - if (!Array.isArray(object.volumes)) - throw TypeError(".google.cloud.batch.v1.TaskSpec.volumes: array expected"); - message.volumes = []; - for (var i = 0; i < object.volumes.length; ++i) { - if (typeof object.volumes[i] !== "object") - throw TypeError(".google.cloud.batch.v1.TaskSpec.volumes: object expected"); - message.volumes[i] = $root.google.cloud.batch.v1.Volume.fromObject(object.volumes[i]); - } - } - if (object.environment != null) { - if (typeof object.environment !== "object") - throw TypeError(".google.cloud.batch.v1.TaskSpec.environment: object expected"); - message.environment = $root.google.cloud.batch.v1.Environment.fromObject(object.environment); - } - return message; - }; - - /** - * Creates a plain object from a TaskSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.TaskSpec - * @static - * @param {google.cloud.batch.v1.TaskSpec} message TaskSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TaskSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.volumes = []; - object.runnables = []; - object.lifecyclePolicies = []; - } - if (options.objects || options.defaults) - object.environments = {}; - if (options.defaults) { - object.computeResource = null; - object.maxRunDuration = null; - object.maxRetryCount = 0; - object.environment = null; - } - if (message.computeResource != null && message.hasOwnProperty("computeResource")) - object.computeResource = $root.google.cloud.batch.v1.ComputeResource.toObject(message.computeResource, options); - if (message.maxRunDuration != null && message.hasOwnProperty("maxRunDuration")) - object.maxRunDuration = $root.google.protobuf.Duration.toObject(message.maxRunDuration, options); - if (message.maxRetryCount != null && message.hasOwnProperty("maxRetryCount")) - object.maxRetryCount = message.maxRetryCount; - var keys2; - if (message.environments && (keys2 = Object.keys(message.environments)).length) { - object.environments = {}; - for (var j = 0; j < keys2.length; ++j) - object.environments[keys2[j]] = message.environments[keys2[j]]; - } - if (message.volumes && message.volumes.length) { - object.volumes = []; - for (var j = 0; j < message.volumes.length; ++j) - object.volumes[j] = $root.google.cloud.batch.v1.Volume.toObject(message.volumes[j], options); - } - if (message.runnables && message.runnables.length) { - object.runnables = []; - for (var j = 0; j < message.runnables.length; ++j) - object.runnables[j] = $root.google.cloud.batch.v1.Runnable.toObject(message.runnables[j], options); - } - if (message.lifecyclePolicies && message.lifecyclePolicies.length) { - object.lifecyclePolicies = []; - for (var j = 0; j < message.lifecyclePolicies.length; ++j) - object.lifecyclePolicies[j] = $root.google.cloud.batch.v1.LifecyclePolicy.toObject(message.lifecyclePolicies[j], options); - } - if (message.environment != null && message.hasOwnProperty("environment")) - object.environment = $root.google.cloud.batch.v1.Environment.toObject(message.environment, options); - return object; - }; - - /** - * Converts this TaskSpec to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.TaskSpec - * @instance - * @returns {Object.} JSON object - */ - TaskSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TaskSpec - * @function getTypeUrl - * @memberof google.cloud.batch.v1.TaskSpec - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TaskSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.TaskSpec"; - }; - - return TaskSpec; - })(); - - v1.LifecyclePolicy = (function() { - - /** - * Properties of a LifecyclePolicy. - * @memberof google.cloud.batch.v1 - * @interface ILifecyclePolicy - * @property {google.cloud.batch.v1.LifecyclePolicy.Action|null} [action] LifecyclePolicy action - * @property {google.cloud.batch.v1.LifecyclePolicy.IActionCondition|null} [actionCondition] LifecyclePolicy actionCondition - */ - - /** - * Constructs a new LifecyclePolicy. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a LifecyclePolicy. - * @implements ILifecyclePolicy - * @constructor - * @param {google.cloud.batch.v1.ILifecyclePolicy=} [properties] Properties to set - */ - function LifecyclePolicy(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LifecyclePolicy action. - * @member {google.cloud.batch.v1.LifecyclePolicy.Action} action - * @memberof google.cloud.batch.v1.LifecyclePolicy - * @instance - */ - LifecyclePolicy.prototype.action = 0; - - /** - * LifecyclePolicy actionCondition. - * @member {google.cloud.batch.v1.LifecyclePolicy.IActionCondition|null|undefined} actionCondition - * @memberof google.cloud.batch.v1.LifecyclePolicy - * @instance - */ - LifecyclePolicy.prototype.actionCondition = null; - - /** - * Creates a new LifecyclePolicy instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.LifecyclePolicy - * @static - * @param {google.cloud.batch.v1.ILifecyclePolicy=} [properties] Properties to set - * @returns {google.cloud.batch.v1.LifecyclePolicy} LifecyclePolicy instance - */ - LifecyclePolicy.create = function create(properties) { - return new LifecyclePolicy(properties); - }; - - /** - * Encodes the specified LifecyclePolicy message. Does not implicitly {@link google.cloud.batch.v1.LifecyclePolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.LifecyclePolicy - * @static - * @param {google.cloud.batch.v1.ILifecyclePolicy} message LifecyclePolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LifecyclePolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); - if (message.actionCondition != null && Object.hasOwnProperty.call(message, "actionCondition")) - $root.google.cloud.batch.v1.LifecyclePolicy.ActionCondition.encode(message.actionCondition, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LifecyclePolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.LifecyclePolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.LifecyclePolicy - * @static - * @param {google.cloud.batch.v1.ILifecyclePolicy} message LifecyclePolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LifecyclePolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LifecyclePolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.LifecyclePolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.LifecyclePolicy} LifecyclePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LifecyclePolicy.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.LifecyclePolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.action = reader.int32(); - break; - } - case 2: { - message.actionCondition = $root.google.cloud.batch.v1.LifecyclePolicy.ActionCondition.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LifecyclePolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.LifecyclePolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.LifecyclePolicy} LifecyclePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LifecyclePolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LifecyclePolicy message. - * @function verify - * @memberof google.cloud.batch.v1.LifecyclePolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LifecyclePolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.action != null && message.hasOwnProperty("action")) - switch (message.action) { - default: - return "action: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.actionCondition != null && message.hasOwnProperty("actionCondition")) { - var error = $root.google.cloud.batch.v1.LifecyclePolicy.ActionCondition.verify(message.actionCondition); - if (error) - return "actionCondition." + error; - } - return null; - }; - - /** - * Creates a LifecyclePolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.LifecyclePolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.LifecyclePolicy} LifecyclePolicy - */ - LifecyclePolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.LifecyclePolicy) - return object; - var message = new $root.google.cloud.batch.v1.LifecyclePolicy(); - switch (object.action) { - default: - if (typeof object.action === "number") { - message.action = object.action; - break; - } - break; - case "ACTION_UNSPECIFIED": - case 0: - message.action = 0; - break; - case "RETRY_TASK": - case 1: - message.action = 1; - break; - case "FAIL_TASK": - case 2: - message.action = 2; - break; - } - if (object.actionCondition != null) { - if (typeof object.actionCondition !== "object") - throw TypeError(".google.cloud.batch.v1.LifecyclePolicy.actionCondition: object expected"); - message.actionCondition = $root.google.cloud.batch.v1.LifecyclePolicy.ActionCondition.fromObject(object.actionCondition); - } - return message; - }; - - /** - * Creates a plain object from a LifecyclePolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.LifecyclePolicy - * @static - * @param {google.cloud.batch.v1.LifecyclePolicy} message LifecyclePolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LifecyclePolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; - object.actionCondition = null; - } - if (message.action != null && message.hasOwnProperty("action")) - object.action = options.enums === String ? $root.google.cloud.batch.v1.LifecyclePolicy.Action[message.action] === undefined ? message.action : $root.google.cloud.batch.v1.LifecyclePolicy.Action[message.action] : message.action; - if (message.actionCondition != null && message.hasOwnProperty("actionCondition")) - object.actionCondition = $root.google.cloud.batch.v1.LifecyclePolicy.ActionCondition.toObject(message.actionCondition, options); - return object; - }; - - /** - * Converts this LifecyclePolicy to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.LifecyclePolicy - * @instance - * @returns {Object.} JSON object - */ - LifecyclePolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LifecyclePolicy - * @function getTypeUrl - * @memberof google.cloud.batch.v1.LifecyclePolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LifecyclePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.LifecyclePolicy"; - }; - - LifecyclePolicy.ActionCondition = (function() { - - /** - * Properties of an ActionCondition. - * @memberof google.cloud.batch.v1.LifecyclePolicy - * @interface IActionCondition - * @property {Array.|null} [exitCodes] ActionCondition exitCodes - */ - - /** - * Constructs a new ActionCondition. - * @memberof google.cloud.batch.v1.LifecyclePolicy - * @classdesc Represents an ActionCondition. - * @implements IActionCondition - * @constructor - * @param {google.cloud.batch.v1.LifecyclePolicy.IActionCondition=} [properties] Properties to set - */ - function ActionCondition(properties) { - this.exitCodes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ActionCondition exitCodes. - * @member {Array.} exitCodes - * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition - * @instance - */ - ActionCondition.prototype.exitCodes = $util.emptyArray; - - /** - * Creates a new ActionCondition instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition - * @static - * @param {google.cloud.batch.v1.LifecyclePolicy.IActionCondition=} [properties] Properties to set - * @returns {google.cloud.batch.v1.LifecyclePolicy.ActionCondition} ActionCondition instance - */ - ActionCondition.create = function create(properties) { - return new ActionCondition(properties); - }; - - /** - * Encodes the specified ActionCondition message. Does not implicitly {@link google.cloud.batch.v1.LifecyclePolicy.ActionCondition.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition - * @static - * @param {google.cloud.batch.v1.LifecyclePolicy.IActionCondition} message ActionCondition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ActionCondition.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.exitCodes != null && message.exitCodes.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.exitCodes.length; ++i) - writer.int32(message.exitCodes[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified ActionCondition message, length delimited. Does not implicitly {@link google.cloud.batch.v1.LifecyclePolicy.ActionCondition.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition - * @static - * @param {google.cloud.batch.v1.LifecyclePolicy.IActionCondition} message ActionCondition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ActionCondition.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ActionCondition message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.LifecyclePolicy.ActionCondition} ActionCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ActionCondition.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.LifecyclePolicy.ActionCondition(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.exitCodes && message.exitCodes.length)) - message.exitCodes = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.exitCodes.push(reader.int32()); - } else - message.exitCodes.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ActionCondition message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.LifecyclePolicy.ActionCondition} ActionCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ActionCondition.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ActionCondition message. - * @function verify - * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ActionCondition.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.exitCodes != null && message.hasOwnProperty("exitCodes")) { - if (!Array.isArray(message.exitCodes)) - return "exitCodes: array expected"; - for (var i = 0; i < message.exitCodes.length; ++i) - if (!$util.isInteger(message.exitCodes[i])) - return "exitCodes: integer[] expected"; - } - return null; - }; - - /** - * Creates an ActionCondition message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.LifecyclePolicy.ActionCondition} ActionCondition - */ - ActionCondition.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.LifecyclePolicy.ActionCondition) - return object; - var message = new $root.google.cloud.batch.v1.LifecyclePolicy.ActionCondition(); - if (object.exitCodes) { - if (!Array.isArray(object.exitCodes)) - throw TypeError(".google.cloud.batch.v1.LifecyclePolicy.ActionCondition.exitCodes: array expected"); - message.exitCodes = []; - for (var i = 0; i < object.exitCodes.length; ++i) - message.exitCodes[i] = object.exitCodes[i] | 0; - } - return message; - }; - - /** - * Creates a plain object from an ActionCondition message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition - * @static - * @param {google.cloud.batch.v1.LifecyclePolicy.ActionCondition} message ActionCondition - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ActionCondition.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.exitCodes = []; - if (message.exitCodes && message.exitCodes.length) { - object.exitCodes = []; - for (var j = 0; j < message.exitCodes.length; ++j) - object.exitCodes[j] = message.exitCodes[j]; - } - return object; - }; - - /** - * Converts this ActionCondition to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition - * @instance - * @returns {Object.} JSON object - */ - ActionCondition.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ActionCondition - * @function getTypeUrl - * @memberof google.cloud.batch.v1.LifecyclePolicy.ActionCondition - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ActionCondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.LifecyclePolicy.ActionCondition"; - }; - - return ActionCondition; - })(); - - /** - * Action enum. - * @name google.cloud.batch.v1.LifecyclePolicy.Action - * @enum {number} - * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value - * @property {number} RETRY_TASK=1 RETRY_TASK value - * @property {number} FAIL_TASK=2 FAIL_TASK value - */ - LifecyclePolicy.Action = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "RETRY_TASK"] = 1; - values[valuesById[2] = "FAIL_TASK"] = 2; - return values; - })(); - - return LifecyclePolicy; - })(); - - v1.Task = (function() { - - /** - * Properties of a Task. - * @memberof google.cloud.batch.v1 - * @interface ITask - * @property {string|null} [name] Task name - * @property {google.cloud.batch.v1.ITaskStatus|null} [status] Task status - */ - - /** - * Constructs a new Task. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a Task. - * @implements ITask - * @constructor - * @param {google.cloud.batch.v1.ITask=} [properties] Properties to set - */ - function Task(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Task name. - * @member {string} name - * @memberof google.cloud.batch.v1.Task - * @instance - */ - Task.prototype.name = ""; - - /** - * Task status. - * @member {google.cloud.batch.v1.ITaskStatus|null|undefined} status - * @memberof google.cloud.batch.v1.Task - * @instance - */ - Task.prototype.status = null; - - /** - * Creates a new Task instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.Task - * @static - * @param {google.cloud.batch.v1.ITask=} [properties] Properties to set - * @returns {google.cloud.batch.v1.Task} Task instance - */ - Task.create = function create(properties) { - return new Task(properties); - }; - - /** - * Encodes the specified Task message. Does not implicitly {@link google.cloud.batch.v1.Task.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.Task - * @static - * @param {google.cloud.batch.v1.ITask} message Task message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Task.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.cloud.batch.v1.TaskStatus.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Task message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Task.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.Task - * @static - * @param {google.cloud.batch.v1.ITask} message Task message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Task.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Task message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.Task - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.Task} Task - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Task.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Task(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.status = $root.google.cloud.batch.v1.TaskStatus.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Task message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.Task - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.Task} Task - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Task.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Task message. - * @function verify - * @memberof google.cloud.batch.v1.Task - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Task.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.status != null && message.hasOwnProperty("status")) { - var error = $root.google.cloud.batch.v1.TaskStatus.verify(message.status); - if (error) - return "status." + error; - } - return null; - }; - - /** - * Creates a Task message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.Task - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.Task} Task - */ - Task.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.Task) - return object; - var message = new $root.google.cloud.batch.v1.Task(); - if (object.name != null) - message.name = String(object.name); - if (object.status != null) { - if (typeof object.status !== "object") - throw TypeError(".google.cloud.batch.v1.Task.status: object expected"); - message.status = $root.google.cloud.batch.v1.TaskStatus.fromObject(object.status); - } - return message; - }; - - /** - * Creates a plain object from a Task message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.Task - * @static - * @param {google.cloud.batch.v1.Task} message Task - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Task.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.status = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.cloud.batch.v1.TaskStatus.toObject(message.status, options); - return object; - }; - - /** - * Converts this Task to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.Task - * @instance - * @returns {Object.} JSON object - */ - Task.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Task - * @function getTypeUrl - * @memberof google.cloud.batch.v1.Task - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Task.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.Task"; - }; - - return Task; - })(); - - v1.Environment = (function() { - - /** - * Properties of an Environment. - * @memberof google.cloud.batch.v1 - * @interface IEnvironment - * @property {Object.|null} [variables] Environment variables - * @property {Object.|null} [secretVariables] Environment secretVariables - * @property {google.cloud.batch.v1.Environment.IKMSEnvMap|null} [encryptedVariables] Environment encryptedVariables - */ - - /** - * Constructs a new Environment. - * @memberof google.cloud.batch.v1 - * @classdesc Represents an Environment. - * @implements IEnvironment - * @constructor - * @param {google.cloud.batch.v1.IEnvironment=} [properties] Properties to set - */ - function Environment(properties) { - this.variables = {}; - this.secretVariables = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Environment variables. - * @member {Object.} variables - * @memberof google.cloud.batch.v1.Environment - * @instance - */ - Environment.prototype.variables = $util.emptyObject; - - /** - * Environment secretVariables. - * @member {Object.} secretVariables - * @memberof google.cloud.batch.v1.Environment - * @instance - */ - Environment.prototype.secretVariables = $util.emptyObject; - - /** - * Environment encryptedVariables. - * @member {google.cloud.batch.v1.Environment.IKMSEnvMap|null|undefined} encryptedVariables - * @memberof google.cloud.batch.v1.Environment - * @instance - */ - Environment.prototype.encryptedVariables = null; - - /** - * Creates a new Environment instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.Environment - * @static - * @param {google.cloud.batch.v1.IEnvironment=} [properties] Properties to set - * @returns {google.cloud.batch.v1.Environment} Environment instance - */ - Environment.create = function create(properties) { - return new Environment(properties); - }; - - /** - * Encodes the specified Environment message. Does not implicitly {@link google.cloud.batch.v1.Environment.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.Environment - * @static - * @param {google.cloud.batch.v1.IEnvironment} message Environment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Environment.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.variables != null && Object.hasOwnProperty.call(message, "variables")) - for (var keys = Object.keys(message.variables), i = 0; i < keys.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.variables[keys[i]]).ldelim(); - if (message.secretVariables != null && Object.hasOwnProperty.call(message, "secretVariables")) - for (var keys = Object.keys(message.secretVariables), 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.secretVariables[keys[i]]).ldelim(); - if (message.encryptedVariables != null && Object.hasOwnProperty.call(message, "encryptedVariables")) - $root.google.cloud.batch.v1.Environment.KMSEnvMap.encode(message.encryptedVariables, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Environment.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.Environment - * @static - * @param {google.cloud.batch.v1.IEnvironment} message Environment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Environment.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Environment message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.Environment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.Environment} Environment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Environment.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Environment(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (message.variables === $util.emptyObject) - message.variables = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.variables[key] = value; - break; - } - case 2: { - if (message.secretVariables === $util.emptyObject) - message.secretVariables = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.secretVariables[key] = value; - break; - } - case 3: { - message.encryptedVariables = $root.google.cloud.batch.v1.Environment.KMSEnvMap.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Environment message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.Environment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.Environment} Environment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Environment.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Environment message. - * @function verify - * @memberof google.cloud.batch.v1.Environment - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Environment.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.variables != null && message.hasOwnProperty("variables")) { - if (!$util.isObject(message.variables)) - return "variables: object expected"; - var key = Object.keys(message.variables); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.variables[key[i]])) - return "variables: string{k:string} expected"; - } - if (message.secretVariables != null && message.hasOwnProperty("secretVariables")) { - if (!$util.isObject(message.secretVariables)) - return "secretVariables: object expected"; - var key = Object.keys(message.secretVariables); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.secretVariables[key[i]])) - return "secretVariables: string{k:string} expected"; - } - if (message.encryptedVariables != null && message.hasOwnProperty("encryptedVariables")) { - var error = $root.google.cloud.batch.v1.Environment.KMSEnvMap.verify(message.encryptedVariables); - if (error) - return "encryptedVariables." + error; - } - return null; - }; - - /** - * Creates an Environment message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.Environment - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.Environment} Environment - */ - Environment.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.Environment) - return object; - var message = new $root.google.cloud.batch.v1.Environment(); - if (object.variables) { - if (typeof object.variables !== "object") - throw TypeError(".google.cloud.batch.v1.Environment.variables: object expected"); - message.variables = {}; - for (var keys = Object.keys(object.variables), i = 0; i < keys.length; ++i) - message.variables[keys[i]] = String(object.variables[keys[i]]); - } - if (object.secretVariables) { - if (typeof object.secretVariables !== "object") - throw TypeError(".google.cloud.batch.v1.Environment.secretVariables: object expected"); - message.secretVariables = {}; - for (var keys = Object.keys(object.secretVariables), i = 0; i < keys.length; ++i) - message.secretVariables[keys[i]] = String(object.secretVariables[keys[i]]); - } - if (object.encryptedVariables != null) { - if (typeof object.encryptedVariables !== "object") - throw TypeError(".google.cloud.batch.v1.Environment.encryptedVariables: object expected"); - message.encryptedVariables = $root.google.cloud.batch.v1.Environment.KMSEnvMap.fromObject(object.encryptedVariables); - } - return message; - }; - - /** - * Creates a plain object from an Environment message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.Environment - * @static - * @param {google.cloud.batch.v1.Environment} message Environment - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Environment.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) { - object.variables = {}; - object.secretVariables = {}; - } - if (options.defaults) - object.encryptedVariables = null; - var keys2; - if (message.variables && (keys2 = Object.keys(message.variables)).length) { - object.variables = {}; - for (var j = 0; j < keys2.length; ++j) - object.variables[keys2[j]] = message.variables[keys2[j]]; - } - if (message.secretVariables && (keys2 = Object.keys(message.secretVariables)).length) { - object.secretVariables = {}; - for (var j = 0; j < keys2.length; ++j) - object.secretVariables[keys2[j]] = message.secretVariables[keys2[j]]; - } - if (message.encryptedVariables != null && message.hasOwnProperty("encryptedVariables")) - object.encryptedVariables = $root.google.cloud.batch.v1.Environment.KMSEnvMap.toObject(message.encryptedVariables, options); - return object; - }; - - /** - * Converts this Environment to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.Environment - * @instance - * @returns {Object.} JSON object - */ - Environment.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Environment - * @function getTypeUrl - * @memberof google.cloud.batch.v1.Environment - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Environment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.Environment"; - }; - - Environment.KMSEnvMap = (function() { - - /** - * Properties of a KMSEnvMap. - * @memberof google.cloud.batch.v1.Environment - * @interface IKMSEnvMap - * @property {string|null} [keyName] KMSEnvMap keyName - * @property {string|null} [cipherText] KMSEnvMap cipherText - */ - - /** - * Constructs a new KMSEnvMap. - * @memberof google.cloud.batch.v1.Environment - * @classdesc Represents a KMSEnvMap. - * @implements IKMSEnvMap - * @constructor - * @param {google.cloud.batch.v1.Environment.IKMSEnvMap=} [properties] Properties to set - */ - function KMSEnvMap(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * KMSEnvMap keyName. - * @member {string} keyName - * @memberof google.cloud.batch.v1.Environment.KMSEnvMap - * @instance - */ - KMSEnvMap.prototype.keyName = ""; - - /** - * KMSEnvMap cipherText. - * @member {string} cipherText - * @memberof google.cloud.batch.v1.Environment.KMSEnvMap - * @instance - */ - KMSEnvMap.prototype.cipherText = ""; - - /** - * Creates a new KMSEnvMap instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.Environment.KMSEnvMap - * @static - * @param {google.cloud.batch.v1.Environment.IKMSEnvMap=} [properties] Properties to set - * @returns {google.cloud.batch.v1.Environment.KMSEnvMap} KMSEnvMap instance - */ - KMSEnvMap.create = function create(properties) { - return new KMSEnvMap(properties); - }; - - /** - * Encodes the specified KMSEnvMap message. Does not implicitly {@link google.cloud.batch.v1.Environment.KMSEnvMap.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.Environment.KMSEnvMap - * @static - * @param {google.cloud.batch.v1.Environment.IKMSEnvMap} message KMSEnvMap message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KMSEnvMap.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.keyName != null && Object.hasOwnProperty.call(message, "keyName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.keyName); - if (message.cipherText != null && Object.hasOwnProperty.call(message, "cipherText")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.cipherText); - return writer; - }; - - /** - * Encodes the specified KMSEnvMap message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Environment.KMSEnvMap.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.Environment.KMSEnvMap - * @static - * @param {google.cloud.batch.v1.Environment.IKMSEnvMap} message KMSEnvMap message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KMSEnvMap.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a KMSEnvMap message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.Environment.KMSEnvMap - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.Environment.KMSEnvMap} KMSEnvMap - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KMSEnvMap.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Environment.KMSEnvMap(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.keyName = reader.string(); - break; - } - case 2: { - message.cipherText = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a KMSEnvMap message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.Environment.KMSEnvMap - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.Environment.KMSEnvMap} KMSEnvMap - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KMSEnvMap.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a KMSEnvMap message. - * @function verify - * @memberof google.cloud.batch.v1.Environment.KMSEnvMap - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KMSEnvMap.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.keyName != null && message.hasOwnProperty("keyName")) - if (!$util.isString(message.keyName)) - return "keyName: string expected"; - if (message.cipherText != null && message.hasOwnProperty("cipherText")) - if (!$util.isString(message.cipherText)) - return "cipherText: string expected"; - return null; - }; - - /** - * Creates a KMSEnvMap message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.Environment.KMSEnvMap - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.Environment.KMSEnvMap} KMSEnvMap - */ - KMSEnvMap.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.Environment.KMSEnvMap) - return object; - var message = new $root.google.cloud.batch.v1.Environment.KMSEnvMap(); - if (object.keyName != null) - message.keyName = String(object.keyName); - if (object.cipherText != null) - message.cipherText = String(object.cipherText); - return message; - }; - - /** - * Creates a plain object from a KMSEnvMap message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.Environment.KMSEnvMap - * @static - * @param {google.cloud.batch.v1.Environment.KMSEnvMap} message KMSEnvMap - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KMSEnvMap.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.keyName = ""; - object.cipherText = ""; - } - if (message.keyName != null && message.hasOwnProperty("keyName")) - object.keyName = message.keyName; - if (message.cipherText != null && message.hasOwnProperty("cipherText")) - object.cipherText = message.cipherText; - return object; - }; - - /** - * Converts this KMSEnvMap to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.Environment.KMSEnvMap - * @instance - * @returns {Object.} JSON object - */ - KMSEnvMap.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for KMSEnvMap - * @function getTypeUrl - * @memberof google.cloud.batch.v1.Environment.KMSEnvMap - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - KMSEnvMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.Environment.KMSEnvMap"; - }; - - return KMSEnvMap; - })(); - - return Environment; - })(); - - v1.Volume = (function() { - - /** - * Properties of a Volume. - * @memberof google.cloud.batch.v1 - * @interface IVolume - * @property {google.cloud.batch.v1.INFS|null} [nfs] Volume nfs - * @property {google.cloud.batch.v1.IGCS|null} [gcs] Volume gcs - * @property {string|null} [deviceName] Volume deviceName - * @property {string|null} [mountPath] Volume mountPath - * @property {Array.|null} [mountOptions] Volume mountOptions - */ - - /** - * Constructs a new Volume. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a Volume. - * @implements IVolume - * @constructor - * @param {google.cloud.batch.v1.IVolume=} [properties] Properties to set - */ - function Volume(properties) { - this.mountOptions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Volume nfs. - * @member {google.cloud.batch.v1.INFS|null|undefined} nfs - * @memberof google.cloud.batch.v1.Volume - * @instance - */ - Volume.prototype.nfs = null; - - /** - * Volume gcs. - * @member {google.cloud.batch.v1.IGCS|null|undefined} gcs - * @memberof google.cloud.batch.v1.Volume - * @instance - */ - Volume.prototype.gcs = null; - - /** - * Volume deviceName. - * @member {string|null|undefined} deviceName - * @memberof google.cloud.batch.v1.Volume - * @instance - */ - Volume.prototype.deviceName = null; - - /** - * Volume mountPath. - * @member {string} mountPath - * @memberof google.cloud.batch.v1.Volume - * @instance - */ - Volume.prototype.mountPath = ""; - - /** - * Volume mountOptions. - * @member {Array.} mountOptions - * @memberof google.cloud.batch.v1.Volume - * @instance - */ - Volume.prototype.mountOptions = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Volume source. - * @member {"nfs"|"gcs"|"deviceName"|undefined} source - * @memberof google.cloud.batch.v1.Volume - * @instance - */ - Object.defineProperty(Volume.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["nfs", "gcs", "deviceName"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Volume instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.Volume - * @static - * @param {google.cloud.batch.v1.IVolume=} [properties] Properties to set - * @returns {google.cloud.batch.v1.Volume} Volume instance - */ - Volume.create = function create(properties) { - return new Volume(properties); - }; - - /** - * Encodes the specified Volume message. Does not implicitly {@link google.cloud.batch.v1.Volume.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.Volume - * @static - * @param {google.cloud.batch.v1.IVolume} message Volume message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Volume.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nfs != null && Object.hasOwnProperty.call(message, "nfs")) - $root.google.cloud.batch.v1.NFS.encode(message.nfs, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.gcs != null && Object.hasOwnProperty.call(message, "gcs")) - $root.google.cloud.batch.v1.GCS.encode(message.gcs, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.mountPath != null && Object.hasOwnProperty.call(message, "mountPath")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.mountPath); - if (message.mountOptions != null && message.mountOptions.length) - for (var i = 0; i < message.mountOptions.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.mountOptions[i]); - if (message.deviceName != null && Object.hasOwnProperty.call(message, "deviceName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.deviceName); - return writer; - }; - - /** - * Encodes the specified Volume message, length delimited. Does not implicitly {@link google.cloud.batch.v1.Volume.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.Volume - * @static - * @param {google.cloud.batch.v1.IVolume} message Volume message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Volume.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Volume message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.Volume - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.Volume} Volume - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Volume.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Volume(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.nfs = $root.google.cloud.batch.v1.NFS.decode(reader, reader.uint32()); - break; - } - case 3: { - message.gcs = $root.google.cloud.batch.v1.GCS.decode(reader, reader.uint32()); - break; - } - case 6: { - message.deviceName = reader.string(); - break; - } - case 4: { - message.mountPath = reader.string(); - break; - } - case 5: { - if (!(message.mountOptions && message.mountOptions.length)) - message.mountOptions = []; - message.mountOptions.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Volume message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.Volume - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.Volume} Volume - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Volume.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Volume message. - * @function verify - * @memberof google.cloud.batch.v1.Volume - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Volume.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.nfs != null && message.hasOwnProperty("nfs")) { - properties.source = 1; - { - var error = $root.google.cloud.batch.v1.NFS.verify(message.nfs); - if (error) - return "nfs." + error; - } - } - if (message.gcs != null && message.hasOwnProperty("gcs")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.batch.v1.GCS.verify(message.gcs); - if (error) - return "gcs." + error; - } - } - if (message.deviceName != null && message.hasOwnProperty("deviceName")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - if (!$util.isString(message.deviceName)) - return "deviceName: string expected"; - } - if (message.mountPath != null && message.hasOwnProperty("mountPath")) - if (!$util.isString(message.mountPath)) - return "mountPath: string expected"; - if (message.mountOptions != null && message.hasOwnProperty("mountOptions")) { - if (!Array.isArray(message.mountOptions)) - return "mountOptions: array expected"; - for (var i = 0; i < message.mountOptions.length; ++i) - if (!$util.isString(message.mountOptions[i])) - return "mountOptions: string[] expected"; - } - return null; - }; - - /** - * Creates a Volume message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.Volume - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.Volume} Volume - */ - Volume.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.Volume) - return object; - var message = new $root.google.cloud.batch.v1.Volume(); - if (object.nfs != null) { - if (typeof object.nfs !== "object") - throw TypeError(".google.cloud.batch.v1.Volume.nfs: object expected"); - message.nfs = $root.google.cloud.batch.v1.NFS.fromObject(object.nfs); - } - if (object.gcs != null) { - if (typeof object.gcs !== "object") - throw TypeError(".google.cloud.batch.v1.Volume.gcs: object expected"); - message.gcs = $root.google.cloud.batch.v1.GCS.fromObject(object.gcs); - } - if (object.deviceName != null) - message.deviceName = String(object.deviceName); - if (object.mountPath != null) - message.mountPath = String(object.mountPath); - if (object.mountOptions) { - if (!Array.isArray(object.mountOptions)) - throw TypeError(".google.cloud.batch.v1.Volume.mountOptions: array expected"); - message.mountOptions = []; - for (var i = 0; i < object.mountOptions.length; ++i) - message.mountOptions[i] = String(object.mountOptions[i]); - } - return message; - }; - - /** - * Creates a plain object from a Volume message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.Volume - * @static - * @param {google.cloud.batch.v1.Volume} message Volume - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Volume.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.mountOptions = []; - if (options.defaults) - object.mountPath = ""; - if (message.nfs != null && message.hasOwnProperty("nfs")) { - object.nfs = $root.google.cloud.batch.v1.NFS.toObject(message.nfs, options); - if (options.oneofs) - object.source = "nfs"; - } - if (message.gcs != null && message.hasOwnProperty("gcs")) { - object.gcs = $root.google.cloud.batch.v1.GCS.toObject(message.gcs, options); - if (options.oneofs) - object.source = "gcs"; - } - if (message.mountPath != null && message.hasOwnProperty("mountPath")) - object.mountPath = message.mountPath; - if (message.mountOptions && message.mountOptions.length) { - object.mountOptions = []; - for (var j = 0; j < message.mountOptions.length; ++j) - object.mountOptions[j] = message.mountOptions[j]; - } - if (message.deviceName != null && message.hasOwnProperty("deviceName")) { - object.deviceName = message.deviceName; - if (options.oneofs) - object.source = "deviceName"; - } - return object; - }; - - /** - * Converts this Volume to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.Volume - * @instance - * @returns {Object.} JSON object - */ - Volume.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Volume - * @function getTypeUrl - * @memberof google.cloud.batch.v1.Volume - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Volume.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.Volume"; - }; - - return Volume; - })(); - - v1.NFS = (function() { - - /** - * Properties of a NFS. - * @memberof google.cloud.batch.v1 - * @interface INFS - * @property {string|null} [server] NFS server - * @property {string|null} [remotePath] NFS remotePath - */ - - /** - * Constructs a new NFS. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a NFS. - * @implements INFS - * @constructor - * @param {google.cloud.batch.v1.INFS=} [properties] Properties to set - */ - function NFS(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NFS server. - * @member {string} server - * @memberof google.cloud.batch.v1.NFS - * @instance - */ - NFS.prototype.server = ""; - - /** - * NFS remotePath. - * @member {string} remotePath - * @memberof google.cloud.batch.v1.NFS - * @instance - */ - NFS.prototype.remotePath = ""; - - /** - * Creates a new NFS instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.NFS - * @static - * @param {google.cloud.batch.v1.INFS=} [properties] Properties to set - * @returns {google.cloud.batch.v1.NFS} NFS instance - */ - NFS.create = function create(properties) { - return new NFS(properties); - }; - - /** - * Encodes the specified NFS message. Does not implicitly {@link google.cloud.batch.v1.NFS.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.NFS - * @static - * @param {google.cloud.batch.v1.INFS} message NFS message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NFS.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.server != null && Object.hasOwnProperty.call(message, "server")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.server); - if (message.remotePath != null && Object.hasOwnProperty.call(message, "remotePath")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.remotePath); - return writer; - }; - - /** - * Encodes the specified NFS message, length delimited. Does not implicitly {@link google.cloud.batch.v1.NFS.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.NFS - * @static - * @param {google.cloud.batch.v1.INFS} message NFS message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NFS.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NFS message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.NFS - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.NFS} NFS - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NFS.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.NFS(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.server = reader.string(); - break; - } - case 2: { - message.remotePath = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NFS message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.NFS - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.NFS} NFS - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NFS.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NFS message. - * @function verify - * @memberof google.cloud.batch.v1.NFS - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NFS.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.server != null && message.hasOwnProperty("server")) - if (!$util.isString(message.server)) - return "server: string expected"; - if (message.remotePath != null && message.hasOwnProperty("remotePath")) - if (!$util.isString(message.remotePath)) - return "remotePath: string expected"; - return null; - }; - - /** - * Creates a NFS message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.NFS - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.NFS} NFS - */ - NFS.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.NFS) - return object; - var message = new $root.google.cloud.batch.v1.NFS(); - if (object.server != null) - message.server = String(object.server); - if (object.remotePath != null) - message.remotePath = String(object.remotePath); - return message; - }; - - /** - * Creates a plain object from a NFS message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.NFS - * @static - * @param {google.cloud.batch.v1.NFS} message NFS - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NFS.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.server = ""; - object.remotePath = ""; - } - if (message.server != null && message.hasOwnProperty("server")) - object.server = message.server; - if (message.remotePath != null && message.hasOwnProperty("remotePath")) - object.remotePath = message.remotePath; - return object; - }; - - /** - * Converts this NFS to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.NFS - * @instance - * @returns {Object.} JSON object - */ - NFS.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NFS - * @function getTypeUrl - * @memberof google.cloud.batch.v1.NFS - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NFS.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.NFS"; - }; - - return NFS; - })(); - - v1.GCS = (function() { - - /** - * Properties of a GCS. - * @memberof google.cloud.batch.v1 - * @interface IGCS - * @property {string|null} [remotePath] GCS remotePath - */ - - /** - * Constructs a new GCS. - * @memberof google.cloud.batch.v1 - * @classdesc Represents a GCS. - * @implements IGCS - * @constructor - * @param {google.cloud.batch.v1.IGCS=} [properties] Properties to set - */ - function GCS(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GCS remotePath. - * @member {string} remotePath - * @memberof google.cloud.batch.v1.GCS - * @instance - */ - GCS.prototype.remotePath = ""; - - /** - * Creates a new GCS instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1.GCS - * @static - * @param {google.cloud.batch.v1.IGCS=} [properties] Properties to set - * @returns {google.cloud.batch.v1.GCS} GCS instance - */ - GCS.create = function create(properties) { - return new GCS(properties); - }; - - /** - * Encodes the specified GCS message. Does not implicitly {@link google.cloud.batch.v1.GCS.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1.GCS - * @static - * @param {google.cloud.batch.v1.IGCS} message GCS message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GCS.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.remotePath != null && Object.hasOwnProperty.call(message, "remotePath")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.remotePath); - return writer; - }; - - /** - * Encodes the specified GCS message, length delimited. Does not implicitly {@link google.cloud.batch.v1.GCS.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1.GCS - * @static - * @param {google.cloud.batch.v1.IGCS} message GCS message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GCS.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GCS message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1.GCS - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1.GCS} GCS - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GCS.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.GCS(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.remotePath = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GCS message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1.GCS - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1.GCS} GCS - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GCS.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GCS message. - * @function verify - * @memberof google.cloud.batch.v1.GCS - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GCS.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.remotePath != null && message.hasOwnProperty("remotePath")) - if (!$util.isString(message.remotePath)) - return "remotePath: string expected"; - return null; - }; - - /** - * Creates a GCS message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1.GCS - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1.GCS} GCS - */ - GCS.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1.GCS) - return object; - var message = new $root.google.cloud.batch.v1.GCS(); - if (object.remotePath != null) - message.remotePath = String(object.remotePath); - return message; - }; - - /** - * Creates a plain object from a GCS message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1.GCS - * @static - * @param {google.cloud.batch.v1.GCS} message GCS - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GCS.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.remotePath = ""; - if (message.remotePath != null && message.hasOwnProperty("remotePath")) - object.remotePath = message.remotePath; - return object; - }; - - /** - * Converts this GCS to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1.GCS - * @instance - * @returns {Object.} JSON object - */ - GCS.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GCS - * @function getTypeUrl - * @memberof google.cloud.batch.v1.GCS - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GCS.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1.GCS"; - }; - - return GCS; - })(); - - return v1; - })(); - - return batch; - })(); - - return cloud; - })(); - - google.api = (function() { - - /** - * Namespace api. - * @memberof google - * @namespace - */ - var api = {}; - - api.Http = (function() { - - /** - * Properties of a Http. - * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion - */ - - /** - * Constructs a new Http. - * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp - * @constructor - * @param {google.api.IHttp=} [properties] Properties to set - */ - function Http(properties) { - this.rules = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http - * @instance - */ - Http.prototype.rules = $util.emptyArray; - - /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http - * @instance - */ - Http.prototype.fullyDecodeReservedExpansion = false; - - /** - * Creates a new Http instance using the specified properties. - * @function create - * @memberof google.api.Http - * @static - * @param {google.api.IHttp=} [properties] Properties to set - * @returns {google.api.Http} Http instance - */ - Http.create = function create(properties) { - return new Http(properties); - }; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encode - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rules != null && message.rules.length) - for (var i = 0; i < message.rules.length; ++i) - $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); - return writer; - }; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Http message from the specified reader or buffer. - * @function decode - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - } - case 2: { - message.fullyDecodeReservedExpansion = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Http message. - * @function verify - * @memberof google.api.Http - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Http.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.rules != null && message.hasOwnProperty("rules")) { - if (!Array.isArray(message.rules)) - return "rules: array expected"; - for (var i = 0; i < message.rules.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.rules[i]); - if (error) - return "rules." + error; - } - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - if (typeof message.fullyDecodeReservedExpansion !== "boolean") - return "fullyDecodeReservedExpansion: boolean expected"; - return null; - }; - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Http - * @static - * @param {Object.} object Plain object - * @returns {google.api.Http} Http - */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) - return object; - var message = new $root.google.api.Http(); - if (object.rules) { - if (!Array.isArray(object.rules)) - throw TypeError(".google.api.Http.rules: array expected"); - message.rules = []; - for (var i = 0; i < object.rules.length; ++i) { - if (typeof object.rules[i] !== "object") - throw TypeError(".google.api.Http.rules: object expected"); - message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); - } - } - if (object.fullyDecodeReservedExpansion != null) - message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); - return message; - }; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Http - * @static - * @param {google.api.Http} message Http - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Http.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.rules = []; - if (options.defaults) - object.fullyDecodeReservedExpansion = false; - if (message.rules && message.rules.length) { - object.rules = []; - for (var j = 0; j < message.rules.length; ++j) - object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; - return object; - }; - - /** - * Converts this Http to JSON. - * @function toJSON - * @memberof google.api.Http - * @instance - * @returns {Object.} JSON object - */ - Http.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Http - * @function getTypeUrl - * @memberof google.api.Http - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Http"; - }; - - return Http; - })(); - - api.HttpRule = (function() { - - /** - * Properties of a HttpRule. - * @memberof google.api - * @interface IHttpRule - * @property {string|null} [selector] HttpRule selector - * @property {string|null} [get] HttpRule get - * @property {string|null} [put] HttpRule put - * @property {string|null} [post] HttpRule post - * @property {string|null} ["delete"] HttpRule delete - * @property {string|null} [patch] HttpRule patch - * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom - * @property {string|null} [body] HttpRule body - * @property {string|null} [responseBody] HttpRule responseBody - * @property {Array.|null} [additionalBindings] HttpRule additionalBindings - */ - - /** - * Constructs a new HttpRule. - * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule - * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set - */ - function HttpRule(properties) { - this.additionalBindings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; - - /** - * HttpRule get. - * @member {string|null|undefined} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = null; - - /** - * HttpRule put. - * @member {string|null|undefined} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = null; - - /** - * HttpRule post. - * @member {string|null|undefined} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = null; - - /** - * HttpRule delete. - * @member {string|null|undefined} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = null; - - /** - * HttpRule patch. - * @member {string|null|undefined} patch - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.patch = null; - - /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.custom = null; - - /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.body = ""; - - /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.responseBody = ""; - - /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule - * @instance - */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new HttpRule instance using the specified properties. - * @function create - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance - */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); - }; - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encode - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && Object.hasOwnProperty.call(message, "get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && Object.hasOwnProperty.call(message, "put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && Object.hasOwnProperty.call(message, "post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) - $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.additionalBindings != null && message.additionalBindings.length) - for (var i = 0; i < message.additionalBindings.length; ++i) - $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); - return writer; - }; - - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @function decode - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.selector = reader.string(); - break; - } - case 2: { - message.get = reader.string(); - break; - } - case 3: { - message.put = reader.string(); - break; - } - case 4: { - message.post = reader.string(); - break; - } - case 5: { - message["delete"] = reader.string(); - break; - } - case 6: { - message.patch = reader.string(); - break; - } - case 8: { - message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); - break; - } - case 7: { - message.body = reader.string(); - break; - } - case 12: { - message.responseBody = reader.string(); - break; - } - case 11: { - if (!(message.additionalBindings && message.additionalBindings.length)) - message.additionalBindings = []; - message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HttpRule message. - * @function verify - * @memberof google.api.HttpRule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HttpRule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.get != null && message.hasOwnProperty("get")) { - properties.pattern = 1; - if (!$util.isString(message.get)) - return "get: string expected"; - } - if (message.put != null && message.hasOwnProperty("put")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.put)) - return "put: string expected"; - } - if (message.post != null && message.hasOwnProperty("post")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.post)) - return "post: string expected"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message["delete"])) - return "delete: string expected"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.patch)) - return "patch: string expected"; - } - if (message.custom != null && message.hasOwnProperty("custom")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - { - var error = $root.google.api.CustomHttpPattern.verify(message.custom); - if (error) - return "custom." + error; - } - } - if (message.body != null && message.hasOwnProperty("body")) - if (!$util.isString(message.body)) - return "body: string expected"; - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - if (!$util.isString(message.responseBody)) - return "responseBody: string expected"; - if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { - if (!Array.isArray(message.additionalBindings)) - return "additionalBindings: array expected"; - for (var i = 0; i < message.additionalBindings.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); - if (error) - return "additionalBindings." + error; - } - } - return null; - }; - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.HttpRule - * @static - * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule - */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) - return object; - var message = new $root.google.api.HttpRule(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.get != null) - message.get = String(object.get); - if (object.put != null) - message.put = String(object.put); - if (object.post != null) - message.post = String(object.post); - if (object["delete"] != null) - message["delete"] = String(object["delete"]); - if (object.patch != null) - message.patch = String(object.patch); - if (object.custom != null) { - if (typeof object.custom !== "object") - throw TypeError(".google.api.HttpRule.custom: object expected"); - message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); - } - if (object.body != null) - message.body = String(object.body); - if (object.responseBody != null) - message.responseBody = String(object.responseBody); - if (object.additionalBindings) { - if (!Array.isArray(object.additionalBindings)) - throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); - message.additionalBindings = []; - for (var i = 0; i < object.additionalBindings.length; ++i) { - if (typeof object.additionalBindings[i] !== "object") - throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); - message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.HttpRule - * @static - * @param {google.api.HttpRule} message HttpRule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HttpRule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.additionalBindings = []; - if (options.defaults) { - object.selector = ""; - object.body = ""; - object.responseBody = ""; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.get != null && message.hasOwnProperty("get")) { - object.get = message.get; - if (options.oneofs) - object.pattern = "get"; - } - if (message.put != null && message.hasOwnProperty("put")) { - object.put = message.put; - if (options.oneofs) - object.pattern = "put"; - } - if (message.post != null && message.hasOwnProperty("post")) { - object.post = message.post; - if (options.oneofs) - object.pattern = "post"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - object["delete"] = message["delete"]; - if (options.oneofs) - object.pattern = "delete"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - object.patch = message.patch; - if (options.oneofs) - object.pattern = "patch"; - } - if (message.body != null && message.hasOwnProperty("body")) - object.body = message.body; - if (message.custom != null && message.hasOwnProperty("custom")) { - object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); - if (options.oneofs) - object.pattern = "custom"; - } - if (message.additionalBindings && message.additionalBindings.length) { - object.additionalBindings = []; - for (var j = 0; j < message.additionalBindings.length; ++j) - object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); - } - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; - return object; - }; - - /** - * Converts this HttpRule to JSON. - * @function toJSON - * @memberof google.api.HttpRule - * @instance - * @returns {Object.} JSON object - */ - HttpRule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HttpRule - * @function getTypeUrl - * @memberof google.api.HttpRule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.HttpRule"; - }; - - return HttpRule; - })(); - - api.CustomHttpPattern = (function() { - - /** - * Properties of a CustomHttpPattern. - * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path - */ - - /** - * Constructs a new CustomHttpPattern. - * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern - * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - */ - function CustomHttpPattern(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.kind = ""; - - /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.path = ""; - - /** - * Creates a new CustomHttpPattern instance using the specified properties. - * @function create - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance - */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); - }; - - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encode - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); - return writer; - }; - - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @function decode - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.kind = reader.string(); - break; - } - case 2: { - message.path = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CustomHttpPattern message. - * @function verify - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CustomHttpPattern.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - if (!$util.isString(message.kind)) - return "kind: string expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; - return null; - }; - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) - return object; - var message = new $root.google.api.CustomHttpPattern(); - if (object.kind != null) - message.kind = String(object.kind); - if (object.path != null) - message.path = String(object.path); - return message; - }; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomHttpPattern.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.kind = ""; - object.path = ""; - } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - return object; - }; - - /** - * Converts this CustomHttpPattern to JSON. - * @function toJSON - * @memberof google.api.CustomHttpPattern - * @instance - * @returns {Object.} JSON object - */ - CustomHttpPattern.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CustomHttpPattern - * @function getTypeUrl - * @memberof google.api.CustomHttpPattern - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CustomHttpPattern"; - }; - - return CustomHttpPattern; - })(); - - api.CommonLanguageSettings = (function() { - - /** - * Properties of a CommonLanguageSettings. - * @memberof google.api - * @interface ICommonLanguageSettings - * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri - * @property {Array.|null} [destinations] CommonLanguageSettings destinations - */ - - /** - * Constructs a new CommonLanguageSettings. - * @memberof google.api - * @classdesc Represents a CommonLanguageSettings. - * @implements ICommonLanguageSettings - * @constructor - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set - */ - function CommonLanguageSettings(properties) { - this.destinations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CommonLanguageSettings referenceDocsUri. - * @member {string} referenceDocsUri - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.referenceDocsUri = ""; - - /** - * CommonLanguageSettings destinations. - * @member {Array.} destinations - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.destinations = $util.emptyArray; - - /** - * Creates a new CommonLanguageSettings instance using the specified properties. - * @function create - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance - */ - CommonLanguageSettings.create = function create(properties) { - return new CommonLanguageSettings(properties); - }; - - /** - * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @function encode - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonLanguageSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); - if (message.destinations != null && message.destinations.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.destinations.length; ++i) - writer.int32(message.destinations[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.CommonLanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonLanguageSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.referenceDocsUri = reader.string(); - break; - } - case 2: { - if (!(message.destinations && message.destinations.length)) - message.destinations = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.destinations.push(reader.int32()); - } else - message.destinations.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CommonLanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CommonLanguageSettings message. - * @function verify - * @memberof google.api.CommonLanguageSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CommonLanguageSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) - if (!$util.isString(message.referenceDocsUri)) - return "referenceDocsUri: string expected"; - if (message.destinations != null && message.hasOwnProperty("destinations")) { - if (!Array.isArray(message.destinations)) - return "destinations: array expected"; - for (var i = 0; i < message.destinations.length; ++i) - switch (message.destinations[i]) { - default: - return "destinations: enum value[] expected"; - case 0: - case 10: - case 20: - break; - } - } - return null; - }; - - /** - * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CommonLanguageSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - */ - CommonLanguageSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CommonLanguageSettings) - return object; - var message = new $root.google.api.CommonLanguageSettings(); - if (object.referenceDocsUri != null) - message.referenceDocsUri = String(object.referenceDocsUri); - if (object.destinations) { - if (!Array.isArray(object.destinations)) - throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); - message.destinations = []; - for (var i = 0; i < object.destinations.length; ++i) - switch (object.destinations[i]) { - default: - if (typeof object.destinations[i] === "number") { - message.destinations[i] = object.destinations[i]; - break; - } - case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": - case 0: - message.destinations[i] = 0; - break; - case "GITHUB": - case 10: - message.destinations[i] = 10; - break; - case "PACKAGE_MANAGER": - case 20: - message.destinations[i] = 20; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CommonLanguageSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.destinations = []; - if (options.defaults) - object.referenceDocsUri = ""; - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) - object.referenceDocsUri = message.referenceDocsUri; - if (message.destinations && message.destinations.length) { - object.destinations = []; - for (var j = 0; j < message.destinations.length; ++j) - object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; - } - return object; - }; - - /** - * Converts this CommonLanguageSettings to JSON. - * @function toJSON - * @memberof google.api.CommonLanguageSettings - * @instance - * @returns {Object.} JSON object - */ - CommonLanguageSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CommonLanguageSettings - * @function getTypeUrl - * @memberof google.api.CommonLanguageSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CommonLanguageSettings"; - }; - - return CommonLanguageSettings; - })(); - - api.ClientLibrarySettings = (function() { - - /** - * Properties of a ClientLibrarySettings. - * @memberof google.api - * @interface IClientLibrarySettings - * @property {string|null} [version] ClientLibrarySettings version - * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage - * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums - * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings - * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings - * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings - * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings - * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings - * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings - * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings - * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings - */ - - /** - * Constructs a new ClientLibrarySettings. - * @memberof google.api - * @classdesc Represents a ClientLibrarySettings. - * @implements IClientLibrarySettings - * @constructor - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - */ - function ClientLibrarySettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientLibrarySettings version. - * @member {string} version - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.version = ""; - - /** - * ClientLibrarySettings launchStage. - * @member {google.api.LaunchStage} launchStage - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.launchStage = 0; - - /** - * ClientLibrarySettings restNumericEnums. - * @member {boolean} restNumericEnums - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.restNumericEnums = false; - - /** - * ClientLibrarySettings javaSettings. - * @member {google.api.IJavaSettings|null|undefined} javaSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.javaSettings = null; - - /** - * ClientLibrarySettings cppSettings. - * @member {google.api.ICppSettings|null|undefined} cppSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.cppSettings = null; - - /** - * ClientLibrarySettings phpSettings. - * @member {google.api.IPhpSettings|null|undefined} phpSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.phpSettings = null; - - /** - * ClientLibrarySettings pythonSettings. - * @member {google.api.IPythonSettings|null|undefined} pythonSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.pythonSettings = null; - - /** - * ClientLibrarySettings nodeSettings. - * @member {google.api.INodeSettings|null|undefined} nodeSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.nodeSettings = null; - - /** - * ClientLibrarySettings dotnetSettings. - * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.dotnetSettings = null; - - /** - * ClientLibrarySettings rubySettings. - * @member {google.api.IRubySettings|null|undefined} rubySettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.rubySettings = null; - - /** - * ClientLibrarySettings goSettings. - * @member {google.api.IGoSettings|null|undefined} goSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.goSettings = null; - - /** - * Creates a new ClientLibrarySettings instance using the specified properties. - * @function create - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance - */ - ClientLibrarySettings.create = function create(properties) { - return new ClientLibrarySettings(properties); - }; - - /** - * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @function encode - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientLibrarySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); - if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); - if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) - $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) - $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) - $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) - $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) - $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); - if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) - $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) - $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) - $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.ClientLibrarySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientLibrarySettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.version = reader.string(); - break; - } - case 2: { - message.launchStage = reader.int32(); - break; - } - case 3: { - message.restNumericEnums = reader.bool(); - break; - } - case 21: { - message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); - break; - } - case 22: { - message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); - break; - } - case 23: { - message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); - break; - } - case 24: { - message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); - break; - } - case 25: { - message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); - break; - } - case 26: { - message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); - break; - } - case 27: { - message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); - break; - } - case 28: { - message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ClientLibrarySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientLibrarySettings message. - * @function verify - * @memberof google.api.ClientLibrarySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientLibrarySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - switch (message.launchStage) { - default: - return "launchStage: enum value expected"; - case 0: - case 6: - case 7: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) - if (typeof message.restNumericEnums !== "boolean") - return "restNumericEnums: boolean expected"; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { - var error = $root.google.api.JavaSettings.verify(message.javaSettings); - if (error) - return "javaSettings." + error; - } - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { - var error = $root.google.api.CppSettings.verify(message.cppSettings); - if (error) - return "cppSettings." + error; - } - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { - var error = $root.google.api.PhpSettings.verify(message.phpSettings); - if (error) - return "phpSettings." + error; - } - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { - var error = $root.google.api.PythonSettings.verify(message.pythonSettings); - if (error) - return "pythonSettings." + error; - } - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { - var error = $root.google.api.NodeSettings.verify(message.nodeSettings); - if (error) - return "nodeSettings." + error; - } - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { - var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); - if (error) - return "dotnetSettings." + error; - } - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { - var error = $root.google.api.RubySettings.verify(message.rubySettings); - if (error) - return "rubySettings." + error; - } - if (message.goSettings != null && message.hasOwnProperty("goSettings")) { - var error = $root.google.api.GoSettings.verify(message.goSettings); - if (error) - return "goSettings." + error; - } - return null; - }; - - /** - * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ClientLibrarySettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - */ - ClientLibrarySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ClientLibrarySettings) - return object; - var message = new $root.google.api.ClientLibrarySettings(); - if (object.version != null) - message.version = String(object.version); - switch (object.launchStage) { - default: - if (typeof object.launchStage === "number") { - message.launchStage = object.launchStage; - break; - } - break; - case "LAUNCH_STAGE_UNSPECIFIED": - case 0: - message.launchStage = 0; - break; - case "UNIMPLEMENTED": - case 6: - message.launchStage = 6; - break; - case "PRELAUNCH": - case 7: - message.launchStage = 7; - break; - case "EARLY_ACCESS": - case 1: - message.launchStage = 1; - break; - case "ALPHA": - case 2: - message.launchStage = 2; - break; - case "BETA": - case 3: - message.launchStage = 3; - break; - case "GA": - case 4: - message.launchStage = 4; - break; - case "DEPRECATED": - case 5: - message.launchStage = 5; - break; - } - if (object.restNumericEnums != null) - message.restNumericEnums = Boolean(object.restNumericEnums); - if (object.javaSettings != null) { - if (typeof object.javaSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); - message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); - } - if (object.cppSettings != null) { - if (typeof object.cppSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); - message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); - } - if (object.phpSettings != null) { - if (typeof object.phpSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); - message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); - } - if (object.pythonSettings != null) { - if (typeof object.pythonSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); - message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); - } - if (object.nodeSettings != null) { - if (typeof object.nodeSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); - message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); - } - if (object.dotnetSettings != null) { - if (typeof object.dotnetSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); - message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); - } - if (object.rubySettings != null) { - if (typeof object.rubySettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); - message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); - } - if (object.goSettings != null) { - if (typeof object.goSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); - message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); - } - return message; - }; - - /** - * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientLibrarySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.version = ""; - object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - object.restNumericEnums = false; - object.javaSettings = null; - object.cppSettings = null; - object.phpSettings = null; - object.pythonSettings = null; - object.nodeSettings = null; - object.dotnetSettings = null; - object.rubySettings = null; - object.goSettings = null; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) - object.restNumericEnums = message.restNumericEnums; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) - object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) - object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) - object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) - object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) - object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) - object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) - object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); - if (message.goSettings != null && message.hasOwnProperty("goSettings")) - object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); - return object; - }; - - /** - * Converts this ClientLibrarySettings to JSON. - * @function toJSON - * @memberof google.api.ClientLibrarySettings - * @instance - * @returns {Object.} JSON object - */ - ClientLibrarySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClientLibrarySettings - * @function getTypeUrl - * @memberof google.api.ClientLibrarySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ClientLibrarySettings"; - }; - - return ClientLibrarySettings; - })(); - - api.Publishing = (function() { - - /** - * Properties of a Publishing. - * @memberof google.api - * @interface IPublishing - * @property {Array.|null} [methodSettings] Publishing methodSettings - * @property {string|null} [newIssueUri] Publishing newIssueUri - * @property {string|null} [documentationUri] Publishing documentationUri - * @property {string|null} [apiShortName] Publishing apiShortName - * @property {string|null} [githubLabel] Publishing githubLabel - * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams - * @property {string|null} [docTagPrefix] Publishing docTagPrefix - * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization - * @property {Array.|null} [librarySettings] Publishing librarySettings - * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri - * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri - */ - - /** - * Constructs a new Publishing. - * @memberof google.api - * @classdesc Represents a Publishing. - * @implements IPublishing - * @constructor - * @param {google.api.IPublishing=} [properties] Properties to set - */ - function Publishing(properties) { - this.methodSettings = []; - this.codeownerGithubTeams = []; - this.librarySettings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Publishing methodSettings. - * @member {Array.} methodSettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.methodSettings = $util.emptyArray; - - /** - * Publishing newIssueUri. - * @member {string} newIssueUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.newIssueUri = ""; - - /** - * Publishing documentationUri. - * @member {string} documentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.documentationUri = ""; - - /** - * Publishing apiShortName. - * @member {string} apiShortName - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.apiShortName = ""; - - /** - * Publishing githubLabel. - * @member {string} githubLabel - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.githubLabel = ""; - - /** - * Publishing codeownerGithubTeams. - * @member {Array.} codeownerGithubTeams - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.codeownerGithubTeams = $util.emptyArray; - - /** - * Publishing docTagPrefix. - * @member {string} docTagPrefix - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.docTagPrefix = ""; - - /** - * Publishing organization. - * @member {google.api.ClientLibraryOrganization} organization - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.organization = 0; - - /** - * Publishing librarySettings. - * @member {Array.} librarySettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.librarySettings = $util.emptyArray; - - /** - * Publishing protoReferenceDocumentationUri. - * @member {string} protoReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.protoReferenceDocumentationUri = ""; - - /** - * Publishing restReferenceDocumentationUri. - * @member {string} restReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.restReferenceDocumentationUri = ""; - - /** - * Creates a new Publishing instance using the specified properties. - * @function create - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing=} [properties] Properties to set - * @returns {google.api.Publishing} Publishing instance - */ - Publishing.create = function create(properties) { - return new Publishing(properties); - }; - - /** - * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @function encode - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing} message Publishing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Publishing.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.methodSettings != null && message.methodSettings.length) - for (var i = 0; i < message.methodSettings.length; ++i) - $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) - writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); - if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) - writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); - if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) - writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); - if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) - writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); - if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) - for (var i = 0; i < message.codeownerGithubTeams.length; ++i) - writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); - if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) - writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); - if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) - writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); - if (message.librarySettings != null && message.librarySettings.length) - for (var i = 0; i < message.librarySettings.length; ++i) - $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); - if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) - writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); - if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) - writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); - return writer; - }; - - /** - * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing} message Publishing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Publishing.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Publishing message from the specified reader or buffer. - * @function decode - * @memberof google.api.Publishing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Publishing} Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Publishing.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - if (!(message.methodSettings && message.methodSettings.length)) - message.methodSettings = []; - message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); - break; - } - case 101: { - message.newIssueUri = reader.string(); - break; - } - case 102: { - message.documentationUri = reader.string(); - break; - } - case 103: { - message.apiShortName = reader.string(); - break; - } - case 104: { - message.githubLabel = reader.string(); - break; - } - case 105: { - if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) - message.codeownerGithubTeams = []; - message.codeownerGithubTeams.push(reader.string()); - break; - } - case 106: { - message.docTagPrefix = reader.string(); - break; - } - case 107: { - message.organization = reader.int32(); - break; - } - case 109: { - if (!(message.librarySettings && message.librarySettings.length)) - message.librarySettings = []; - message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); - break; - } - case 110: { - message.protoReferenceDocumentationUri = reader.string(); - break; - } - case 111: { - message.restReferenceDocumentationUri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Publishing message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Publishing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Publishing} Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Publishing.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Publishing message. - * @function verify - * @memberof google.api.Publishing - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Publishing.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { - if (!Array.isArray(message.methodSettings)) - return "methodSettings: array expected"; - for (var i = 0; i < message.methodSettings.length; ++i) { - var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); - if (error) - return "methodSettings." + error; - } - } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) - if (!$util.isString(message.newIssueUri)) - return "newIssueUri: string expected"; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - if (!$util.isString(message.documentationUri)) - return "documentationUri: string expected"; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) - if (!$util.isString(message.apiShortName)) - return "apiShortName: string expected"; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) - if (!$util.isString(message.githubLabel)) - return "githubLabel: string expected"; - if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { - if (!Array.isArray(message.codeownerGithubTeams)) - return "codeownerGithubTeams: array expected"; - for (var i = 0; i < message.codeownerGithubTeams.length; ++i) - if (!$util.isString(message.codeownerGithubTeams[i])) - return "codeownerGithubTeams: string[] expected"; - } - if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) - if (!$util.isString(message.docTagPrefix)) - return "docTagPrefix: string expected"; - if (message.organization != null && message.hasOwnProperty("organization")) - switch (message.organization) { - default: - return "organization: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { - if (!Array.isArray(message.librarySettings)) - return "librarySettings: array expected"; - for (var i = 0; i < message.librarySettings.length; ++i) { - var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); - if (error) - return "librarySettings." + error; - } - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - if (!$util.isString(message.protoReferenceDocumentationUri)) - return "protoReferenceDocumentationUri: string expected"; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - if (!$util.isString(message.restReferenceDocumentationUri)) - return "restReferenceDocumentationUri: string expected"; - return null; - }; - - /** - * Creates a Publishing message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Publishing - * @static - * @param {Object.} object Plain object - * @returns {google.api.Publishing} Publishing - */ - Publishing.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Publishing) - return object; - var message = new $root.google.api.Publishing(); - if (object.methodSettings) { - if (!Array.isArray(object.methodSettings)) - throw TypeError(".google.api.Publishing.methodSettings: array expected"); - message.methodSettings = []; - for (var i = 0; i < object.methodSettings.length; ++i) { - if (typeof object.methodSettings[i] !== "object") - throw TypeError(".google.api.Publishing.methodSettings: object expected"); - message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); - } - } - if (object.newIssueUri != null) - message.newIssueUri = String(object.newIssueUri); - if (object.documentationUri != null) - message.documentationUri = String(object.documentationUri); - if (object.apiShortName != null) - message.apiShortName = String(object.apiShortName); - if (object.githubLabel != null) - message.githubLabel = String(object.githubLabel); - if (object.codeownerGithubTeams) { - if (!Array.isArray(object.codeownerGithubTeams)) - throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); - message.codeownerGithubTeams = []; - for (var i = 0; i < object.codeownerGithubTeams.length; ++i) - message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); - } - if (object.docTagPrefix != null) - message.docTagPrefix = String(object.docTagPrefix); - switch (object.organization) { - default: - if (typeof object.organization === "number") { - message.organization = object.organization; - break; - } - break; - case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": - case 0: - message.organization = 0; - break; - case "CLOUD": - case 1: - message.organization = 1; - break; - case "ADS": - case 2: - message.organization = 2; - break; - case "PHOTOS": - case 3: - message.organization = 3; - break; - case "STREET_VIEW": - case 4: - message.organization = 4; - break; - case "SHOPPING": - case 5: - message.organization = 5; - break; - case "GEO": - case 6: - message.organization = 6; - break; - case "GENERATIVE_AI": - case 7: - message.organization = 7; - break; - } - if (object.librarySettings) { - if (!Array.isArray(object.librarySettings)) - throw TypeError(".google.api.Publishing.librarySettings: array expected"); - message.librarySettings = []; - for (var i = 0; i < object.librarySettings.length; ++i) { - if (typeof object.librarySettings[i] !== "object") - throw TypeError(".google.api.Publishing.librarySettings: object expected"); - message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); - } - } - if (object.protoReferenceDocumentationUri != null) - message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); - if (object.restReferenceDocumentationUri != null) - message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); - return message; - }; - - /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Publishing - * @static - * @param {google.api.Publishing} message Publishing - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Publishing.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.methodSettings = []; - object.codeownerGithubTeams = []; - object.librarySettings = []; - } - if (options.defaults) { - object.newIssueUri = ""; - object.documentationUri = ""; - object.apiShortName = ""; - object.githubLabel = ""; - object.docTagPrefix = ""; - object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; - object.protoReferenceDocumentationUri = ""; - object.restReferenceDocumentationUri = ""; - } - if (message.methodSettings && message.methodSettings.length) { - object.methodSettings = []; - for (var j = 0; j < message.methodSettings.length; ++j) - object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); - } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) - object.newIssueUri = message.newIssueUri; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - object.documentationUri = message.documentationUri; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) - object.apiShortName = message.apiShortName; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) - object.githubLabel = message.githubLabel; - if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { - object.codeownerGithubTeams = []; - for (var j = 0; j < message.codeownerGithubTeams.length; ++j) - object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; - } - if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) - object.docTagPrefix = message.docTagPrefix; - if (message.organization != null && message.hasOwnProperty("organization")) - object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; - if (message.librarySettings && message.librarySettings.length) { - object.librarySettings = []; - for (var j = 0; j < message.librarySettings.length; ++j) - object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; - return object; - }; - - /** - * Converts this Publishing to JSON. - * @function toJSON - * @memberof google.api.Publishing - * @instance - * @returns {Object.} JSON object - */ - Publishing.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Publishing - * @function getTypeUrl - * @memberof google.api.Publishing - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Publishing"; - }; - - return Publishing; - })(); - - api.JavaSettings = (function() { - - /** - * Properties of a JavaSettings. - * @memberof google.api - * @interface IJavaSettings - * @property {string|null} [libraryPackage] JavaSettings libraryPackage - * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames - * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common - */ - - /** - * Constructs a new JavaSettings. - * @memberof google.api - * @classdesc Represents a JavaSettings. - * @implements IJavaSettings - * @constructor - * @param {google.api.IJavaSettings=} [properties] Properties to set - */ - function JavaSettings(properties) { - this.serviceClassNames = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * JavaSettings libraryPackage. - * @member {string} libraryPackage - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.libraryPackage = ""; - - /** - * JavaSettings serviceClassNames. - * @member {Object.} serviceClassNames - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.serviceClassNames = $util.emptyObject; - - /** - * JavaSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.common = null; - - /** - * Creates a new JavaSettings instance using the specified properties. - * @function create - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings=} [properties] Properties to set - * @returns {google.api.JavaSettings} JavaSettings instance - */ - JavaSettings.create = function create(properties) { - return new JavaSettings(properties); - }; - - /** - * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @function encode - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JavaSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); - if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) - for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a JavaSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.JavaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.JavaSettings} JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JavaSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.libraryPackage = reader.string(); - break; - } - case 2: { - if (message.serviceClassNames === $util.emptyObject) - message.serviceClassNames = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.serviceClassNames[key] = value; - break; - } - case 3: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a JavaSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.JavaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.JavaSettings} JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JavaSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a JavaSettings message. - * @function verify - * @memberof google.api.JavaSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - JavaSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) - if (!$util.isString(message.libraryPackage)) - return "libraryPackage: string expected"; - if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { - if (!$util.isObject(message.serviceClassNames)) - return "serviceClassNames: object expected"; - var key = Object.keys(message.serviceClassNames); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.serviceClassNames[key[i]])) - return "serviceClassNames: string{k:string} expected"; - } - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.JavaSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.JavaSettings} JavaSettings - */ - JavaSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.JavaSettings) - return object; - var message = new $root.google.api.JavaSettings(); - if (object.libraryPackage != null) - message.libraryPackage = String(object.libraryPackage); - if (object.serviceClassNames) { - if (typeof object.serviceClassNames !== "object") - throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); - message.serviceClassNames = {}; - for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) - message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); - } - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.JavaSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.JavaSettings - * @static - * @param {google.api.JavaSettings} message JavaSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - JavaSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.serviceClassNames = {}; - if (options.defaults) { - object.libraryPackage = ""; - object.common = null; - } - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) - object.libraryPackage = message.libraryPackage; - var keys2; - if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { - object.serviceClassNames = {}; - for (var j = 0; j < keys2.length; ++j) - object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; - } - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this JavaSettings to JSON. - * @function toJSON - * @memberof google.api.JavaSettings - * @instance - * @returns {Object.} JSON object - */ - JavaSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for JavaSettings - * @function getTypeUrl - * @memberof google.api.JavaSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.JavaSettings"; - }; - - return JavaSettings; - })(); - - api.CppSettings = (function() { - - /** - * Properties of a CppSettings. - * @memberof google.api - * @interface ICppSettings - * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common - */ - - /** - * Constructs a new CppSettings. - * @memberof google.api - * @classdesc Represents a CppSettings. - * @implements ICppSettings - * @constructor - * @param {google.api.ICppSettings=} [properties] Properties to set - */ - function CppSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CppSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.CppSettings - * @instance - */ - CppSettings.prototype.common = null; - - /** - * Creates a new CppSettings instance using the specified properties. - * @function create - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings=} [properties] Properties to set - * @returns {google.api.CppSettings} CppSettings instance - */ - CppSettings.create = function create(properties) { - return new CppSettings(properties); - }; - - /** - * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @function encode - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings} message CppSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CppSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings} message CppSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CppSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CppSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.CppSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CppSettings} CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CppSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CppSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CppSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CppSettings} CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CppSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CppSettings message. - * @function verify - * @memberof google.api.CppSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CppSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CppSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CppSettings} CppSettings - */ - CppSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CppSettings) - return object; - var message = new $root.google.api.CppSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.CppSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a CppSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CppSettings - * @static - * @param {google.api.CppSettings} message CppSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CppSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this CppSettings to JSON. - * @function toJSON - * @memberof google.api.CppSettings - * @instance - * @returns {Object.} JSON object - */ - CppSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CppSettings - * @function getTypeUrl - * @memberof google.api.CppSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CppSettings"; - }; - - return CppSettings; - })(); - - api.PhpSettings = (function() { - - /** - * Properties of a PhpSettings. - * @memberof google.api - * @interface IPhpSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common - */ - - /** - * Constructs a new PhpSettings. - * @memberof google.api - * @classdesc Represents a PhpSettings. - * @implements IPhpSettings - * @constructor - * @param {google.api.IPhpSettings=} [properties] Properties to set - */ - function PhpSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PhpSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PhpSettings - * @instance - */ - PhpSettings.prototype.common = null; - - /** - * Creates a new PhpSettings instance using the specified properties. - * @function create - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings=} [properties] Properties to set - * @returns {google.api.PhpSettings} PhpSettings instance - */ - PhpSettings.create = function create(properties) { - return new PhpSettings(properties); - }; - - /** - * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @function encode - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhpSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PhpSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.PhpSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PhpSettings} PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhpSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PhpSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PhpSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PhpSettings} PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhpSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PhpSettings message. - * @function verify - * @memberof google.api.PhpSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PhpSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PhpSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PhpSettings} PhpSettings - */ - PhpSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PhpSettings) - return object; - var message = new $root.google.api.PhpSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PhpSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PhpSettings - * @static - * @param {google.api.PhpSettings} message PhpSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PhpSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this PhpSettings to JSON. - * @function toJSON - * @memberof google.api.PhpSettings - * @instance - * @returns {Object.} JSON object - */ - PhpSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PhpSettings - * @function getTypeUrl - * @memberof google.api.PhpSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PhpSettings"; - }; - - return PhpSettings; - })(); - - api.PythonSettings = (function() { - - /** - * Properties of a PythonSettings. - * @memberof google.api - * @interface IPythonSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common - */ - - /** - * Constructs a new PythonSettings. - * @memberof google.api - * @classdesc Represents a PythonSettings. - * @implements IPythonSettings - * @constructor - * @param {google.api.IPythonSettings=} [properties] Properties to set - */ - function PythonSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PythonSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PythonSettings - * @instance - */ - PythonSettings.prototype.common = null; - - /** - * Creates a new PythonSettings instance using the specified properties. - * @function create - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings=} [properties] Properties to set - * @returns {google.api.PythonSettings} PythonSettings instance - */ - PythonSettings.create = function create(properties) { - return new PythonSettings(properties); - }; - - /** - * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @function encode - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PythonSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.PythonSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PythonSettings} PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PythonSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PythonSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PythonSettings} PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PythonSettings message. - * @function verify - * @memberof google.api.PythonSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PythonSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PythonSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PythonSettings} PythonSettings - */ - PythonSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PythonSettings) - return object; - var message = new $root.google.api.PythonSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PythonSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PythonSettings - * @static - * @param {google.api.PythonSettings} message PythonSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PythonSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this PythonSettings to JSON. - * @function toJSON - * @memberof google.api.PythonSettings - * @instance - * @returns {Object.} JSON object - */ - PythonSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PythonSettings - * @function getTypeUrl - * @memberof google.api.PythonSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PythonSettings"; - }; - - return PythonSettings; - })(); - - api.NodeSettings = (function() { - - /** - * Properties of a NodeSettings. - * @memberof google.api - * @interface INodeSettings - * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common - */ - - /** - * Constructs a new NodeSettings. - * @memberof google.api - * @classdesc Represents a NodeSettings. - * @implements INodeSettings - * @constructor - * @param {google.api.INodeSettings=} [properties] Properties to set - */ - function NodeSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NodeSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.NodeSettings - * @instance - */ - NodeSettings.prototype.common = null; - - /** - * Creates a new NodeSettings instance using the specified properties. - * @function create - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings=} [properties] Properties to set - * @returns {google.api.NodeSettings} NodeSettings instance - */ - NodeSettings.create = function create(properties) { - return new NodeSettings(properties); - }; - - /** - * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @function encode - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NodeSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.NodeSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.NodeSettings} NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NodeSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.NodeSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.NodeSettings} NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NodeSettings message. - * @function verify - * @memberof google.api.NodeSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NodeSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.NodeSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.NodeSettings} NodeSettings - */ - NodeSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.NodeSettings) - return object; - var message = new $root.google.api.NodeSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.NodeSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.NodeSettings - * @static - * @param {google.api.NodeSettings} message NodeSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NodeSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this NodeSettings to JSON. - * @function toJSON - * @memberof google.api.NodeSettings - * @instance - * @returns {Object.} JSON object - */ - NodeSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NodeSettings - * @function getTypeUrl - * @memberof google.api.NodeSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.NodeSettings"; - }; - - return NodeSettings; - })(); - - api.DotnetSettings = (function() { - - /** - * Properties of a DotnetSettings. - * @memberof google.api - * @interface IDotnetSettings - * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common - * @property {Object.|null} [renamedServices] DotnetSettings renamedServices - * @property {Object.|null} [renamedResources] DotnetSettings renamedResources - * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources - * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases - * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures - */ - - /** - * Constructs a new DotnetSettings. - * @memberof google.api - * @classdesc Represents a DotnetSettings. - * @implements IDotnetSettings - * @constructor - * @param {google.api.IDotnetSettings=} [properties] Properties to set - */ - function DotnetSettings(properties) { - this.renamedServices = {}; - this.renamedResources = {}; - this.ignoredResources = []; - this.forcedNamespaceAliases = []; - this.handwrittenSignatures = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DotnetSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.common = null; - - /** - * DotnetSettings renamedServices. - * @member {Object.} renamedServices - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedServices = $util.emptyObject; - - /** - * DotnetSettings renamedResources. - * @member {Object.} renamedResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedResources = $util.emptyObject; - - /** - * DotnetSettings ignoredResources. - * @member {Array.} ignoredResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.ignoredResources = $util.emptyArray; - - /** - * DotnetSettings forcedNamespaceAliases. - * @member {Array.} forcedNamespaceAliases - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; - - /** - * DotnetSettings handwrittenSignatures. - * @member {Array.} handwrittenSignatures - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; - - /** - * Creates a new DotnetSettings instance using the specified properties. - * @function create - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings=} [properties] Properties to set - * @returns {google.api.DotnetSettings} DotnetSettings instance - */ - DotnetSettings.create = function create(properties) { - return new DotnetSettings(properties); - }; - - /** - * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @function encode - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DotnetSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) - for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); - if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) - for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); - if (message.ignoredResources != null && message.ignoredResources.length) - for (var i = 0; i < message.ignoredResources.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); - if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); - if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); - return writer; - }; - - /** - * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.DotnetSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.DotnetSettings} DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DotnetSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - case 2: { - if (message.renamedServices === $util.emptyObject) - message.renamedServices = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.renamedServices[key] = value; - break; - } - case 3: { - if (message.renamedResources === $util.emptyObject) - message.renamedResources = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.renamedResources[key] = value; - break; - } - case 4: { - if (!(message.ignoredResources && message.ignoredResources.length)) - message.ignoredResources = []; - message.ignoredResources.push(reader.string()); - break; - } - case 5: { - if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) - message.forcedNamespaceAliases = []; - message.forcedNamespaceAliases.push(reader.string()); - break; - } - case 6: { - if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) - message.handwrittenSignatures = []; - message.handwrittenSignatures.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.DotnetSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.DotnetSettings} DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DotnetSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DotnetSettings message. - * @function verify - * @memberof google.api.DotnetSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DotnetSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { - if (!$util.isObject(message.renamedServices)) - return "renamedServices: object expected"; - var key = Object.keys(message.renamedServices); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedServices[key[i]])) - return "renamedServices: string{k:string} expected"; - } - if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { - if (!$util.isObject(message.renamedResources)) - return "renamedResources: object expected"; - var key = Object.keys(message.renamedResources); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedResources[key[i]])) - return "renamedResources: string{k:string} expected"; - } - if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { - if (!Array.isArray(message.ignoredResources)) - return "ignoredResources: array expected"; - for (var i = 0; i < message.ignoredResources.length; ++i) - if (!$util.isString(message.ignoredResources[i])) - return "ignoredResources: string[] expected"; - } - if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { - if (!Array.isArray(message.forcedNamespaceAliases)) - return "forcedNamespaceAliases: array expected"; - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - if (!$util.isString(message.forcedNamespaceAliases[i])) - return "forcedNamespaceAliases: string[] expected"; - } - if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { - if (!Array.isArray(message.handwrittenSignatures)) - return "handwrittenSignatures: array expected"; - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - if (!$util.isString(message.handwrittenSignatures[i])) - return "handwrittenSignatures: string[] expected"; - } - return null; - }; - - /** - * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.DotnetSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.DotnetSettings} DotnetSettings - */ - DotnetSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.DotnetSettings) - return object; - var message = new $root.google.api.DotnetSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.DotnetSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - if (object.renamedServices) { - if (typeof object.renamedServices !== "object") - throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); - message.renamedServices = {}; - for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) - message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); - } - if (object.renamedResources) { - if (typeof object.renamedResources !== "object") - throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); - message.renamedResources = {}; - for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) - message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); - } - if (object.ignoredResources) { - if (!Array.isArray(object.ignoredResources)) - throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); - message.ignoredResources = []; - for (var i = 0; i < object.ignoredResources.length; ++i) - message.ignoredResources[i] = String(object.ignoredResources[i]); - } - if (object.forcedNamespaceAliases) { - if (!Array.isArray(object.forcedNamespaceAliases)) - throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); - message.forcedNamespaceAliases = []; - for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) - message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); - } - if (object.handwrittenSignatures) { - if (!Array.isArray(object.handwrittenSignatures)) - throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); - message.handwrittenSignatures = []; - for (var i = 0; i < object.handwrittenSignatures.length; ++i) - message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); - } - return message; - }; - - /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.DotnetSettings} message DotnetSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DotnetSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.ignoredResources = []; - object.forcedNamespaceAliases = []; - object.handwrittenSignatures = []; - } - if (options.objects || options.defaults) { - object.renamedServices = {}; - object.renamedResources = {}; - } - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - var keys2; - if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { - object.renamedServices = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; - } - if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { - object.renamedResources = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; - } - if (message.ignoredResources && message.ignoredResources.length) { - object.ignoredResources = []; - for (var j = 0; j < message.ignoredResources.length; ++j) - object.ignoredResources[j] = message.ignoredResources[j]; - } - if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { - object.forcedNamespaceAliases = []; - for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) - object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; - } - if (message.handwrittenSignatures && message.handwrittenSignatures.length) { - object.handwrittenSignatures = []; - for (var j = 0; j < message.handwrittenSignatures.length; ++j) - object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; - } - return object; - }; - - /** - * Converts this DotnetSettings to JSON. - * @function toJSON - * @memberof google.api.DotnetSettings - * @instance - * @returns {Object.} JSON object - */ - DotnetSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DotnetSettings - * @function getTypeUrl - * @memberof google.api.DotnetSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.DotnetSettings"; - }; - - return DotnetSettings; - })(); - - api.RubySettings = (function() { - - /** - * Properties of a RubySettings. - * @memberof google.api - * @interface IRubySettings - * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common - */ - - /** - * Constructs a new RubySettings. - * @memberof google.api - * @classdesc Represents a RubySettings. - * @implements IRubySettings - * @constructor - * @param {google.api.IRubySettings=} [properties] Properties to set - */ - function RubySettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RubySettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.RubySettings - * @instance - */ - RubySettings.prototype.common = null; - - /** - * Creates a new RubySettings instance using the specified properties. - * @function create - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings=} [properties] Properties to set - * @returns {google.api.RubySettings} RubySettings instance - */ - RubySettings.create = function create(properties) { - return new RubySettings(properties); - }; - - /** - * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @function encode - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings} message RubySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RubySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings} message RubySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RubySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RubySettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.RubySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.RubySettings} RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RubySettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RubySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.RubySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.RubySettings} RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RubySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RubySettings message. - * @function verify - * @memberof google.api.RubySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RubySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.RubySettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.RubySettings} RubySettings - */ - RubySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.RubySettings) - return object; - var message = new $root.google.api.RubySettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.RubySettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.RubySettings - * @static - * @param {google.api.RubySettings} message RubySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RubySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this RubySettings to JSON. - * @function toJSON - * @memberof google.api.RubySettings - * @instance - * @returns {Object.} JSON object - */ - RubySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RubySettings - * @function getTypeUrl - * @memberof google.api.RubySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.RubySettings"; - }; - - return RubySettings; - })(); - - api.GoSettings = (function() { - - /** - * Properties of a GoSettings. - * @memberof google.api - * @interface IGoSettings - * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common - */ - - /** - * Constructs a new GoSettings. - * @memberof google.api - * @classdesc Represents a GoSettings. - * @implements IGoSettings - * @constructor - * @param {google.api.IGoSettings=} [properties] Properties to set - */ - function GoSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GoSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.GoSettings - * @instance - */ - GoSettings.prototype.common = null; - - /** - * Creates a new GoSettings instance using the specified properties. - * @function create - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings=} [properties] Properties to set - * @returns {google.api.GoSettings} GoSettings instance - */ - GoSettings.create = function create(properties) { - return new GoSettings(properties); - }; - - /** - * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @function encode - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings} message GoSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings} message GoSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GoSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.GoSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.GoSettings} GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GoSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.GoSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.GoSettings} GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GoSettings message. - * @function verify - * @memberof google.api.GoSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GoSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.GoSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.GoSettings} GoSettings - */ - GoSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.GoSettings) - return object; - var message = new $root.google.api.GoSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.GoSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.GoSettings - * @static - * @param {google.api.GoSettings} message GoSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GoSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this GoSettings to JSON. - * @function toJSON - * @memberof google.api.GoSettings - * @instance - * @returns {Object.} JSON object - */ - GoSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GoSettings - * @function getTypeUrl - * @memberof google.api.GoSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.GoSettings"; - }; - - return GoSettings; - })(); - - api.MethodSettings = (function() { - - /** - * Properties of a MethodSettings. - * @memberof google.api - * @interface IMethodSettings - * @property {string|null} [selector] MethodSettings selector - * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning - * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields - */ - - /** - * Constructs a new MethodSettings. - * @memberof google.api - * @classdesc Represents a MethodSettings. - * @implements IMethodSettings - * @constructor - * @param {google.api.IMethodSettings=} [properties] Properties to set - */ - function MethodSettings(properties) { - this.autoPopulatedFields = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodSettings selector. - * @member {string} selector - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.selector = ""; - - /** - * MethodSettings longRunning. - * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.longRunning = null; - - /** - * MethodSettings autoPopulatedFields. - * @member {Array.} autoPopulatedFields - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; - - /** - * Creates a new MethodSettings instance using the specified properties. - * @function create - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings=} [properties] Properties to set - * @returns {google.api.MethodSettings} MethodSettings instance - */ - MethodSettings.create = function create(properties) { - return new MethodSettings(properties); - }; - - /** - * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @function encode - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) - $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); - return writer; - }; - - /** - * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.MethodSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MethodSettings} MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.selector = reader.string(); - break; - } - case 2: { - message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) - message.autoPopulatedFields = []; - message.autoPopulatedFields.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MethodSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MethodSettings} MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodSettings message. - * @function verify - * @memberof google.api.MethodSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) { - var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); - if (error) - return "longRunning." + error; - } - if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { - if (!Array.isArray(message.autoPopulatedFields)) - return "autoPopulatedFields: array expected"; - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - if (!$util.isString(message.autoPopulatedFields[i])) - return "autoPopulatedFields: string[] expected"; - } - return null; - }; - - /** - * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings} MethodSettings - */ - MethodSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MethodSettings) - return object; - var message = new $root.google.api.MethodSettings(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.longRunning != null) { - if (typeof object.longRunning !== "object") - throw TypeError(".google.api.MethodSettings.longRunning: object expected"); - message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); - } - if (object.autoPopulatedFields) { - if (!Array.isArray(object.autoPopulatedFields)) - throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); - message.autoPopulatedFields = []; - for (var i = 0; i < object.autoPopulatedFields.length; ++i) - message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); - } - return message; - }; - - /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings - * @static - * @param {google.api.MethodSettings} message MethodSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.autoPopulatedFields = []; - if (options.defaults) { - object.selector = ""; - object.longRunning = null; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) - object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); - if (message.autoPopulatedFields && message.autoPopulatedFields.length) { - object.autoPopulatedFields = []; - for (var j = 0; j < message.autoPopulatedFields.length; ++j) - object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; - } - return object; - }; - - /** - * Converts this MethodSettings to JSON. - * @function toJSON - * @memberof google.api.MethodSettings - * @instance - * @returns {Object.} JSON object - */ - MethodSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodSettings - * @function getTypeUrl - * @memberof google.api.MethodSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.MethodSettings"; - }; - - MethodSettings.LongRunning = (function() { - - /** - * Properties of a LongRunning. - * @memberof google.api.MethodSettings - * @interface ILongRunning - * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay - * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier - * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay - * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout - */ - - /** - * Constructs a new LongRunning. - * @memberof google.api.MethodSettings - * @classdesc Represents a LongRunning. - * @implements ILongRunning - * @constructor - * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set - */ - function LongRunning(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LongRunning initialPollDelay. - * @member {google.protobuf.IDuration|null|undefined} initialPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.initialPollDelay = null; - - /** - * LongRunning pollDelayMultiplier. - * @member {number} pollDelayMultiplier - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.pollDelayMultiplier = 0; - - /** - * LongRunning maxPollDelay. - * @member {google.protobuf.IDuration|null|undefined} maxPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.maxPollDelay = null; - - /** - * LongRunning totalPollTimeout. - * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.totalPollTimeout = null; - - /** - * Creates a new LongRunning instance using the specified properties. - * @function create - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set - * @returns {google.api.MethodSettings.LongRunning} LongRunning instance - */ - LongRunning.create = function create(properties) { - return new LongRunning(properties); - }; - - /** - * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @function encode - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LongRunning.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) - $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); - if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) - $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) - $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LongRunning.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LongRunning message from the specified reader or buffer. - * @function decode - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MethodSettings.LongRunning} LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LongRunning.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 2: { - message.pollDelayMultiplier = reader.float(); - break; - } - case 3: { - message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LongRunning message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MethodSettings.LongRunning} LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LongRunning.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LongRunning message. - * @function verify - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LongRunning.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { - var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); - if (error) - return "initialPollDelay." + error; - } - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) - if (typeof message.pollDelayMultiplier !== "number") - return "pollDelayMultiplier: number expected"; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { - var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); - if (error) - return "maxPollDelay." + error; - } - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { - var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); - if (error) - return "totalPollTimeout." + error; - } - return null; - }; - - /** - * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings.LongRunning} LongRunning - */ - LongRunning.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MethodSettings.LongRunning) - return object; - var message = new $root.google.api.MethodSettings.LongRunning(); - if (object.initialPollDelay != null) { - if (typeof object.initialPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); - message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); - } - if (object.pollDelayMultiplier != null) - message.pollDelayMultiplier = Number(object.pollDelayMultiplier); - if (object.maxPollDelay != null) { - if (typeof object.maxPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); - message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); - } - if (object.totalPollTimeout != null) { - if (typeof object.totalPollTimeout !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); - message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); - } - return message; - }; - - /** - * Creates a plain object from a LongRunning message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.LongRunning} message LongRunning - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LongRunning.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.initialPollDelay = null; - object.pollDelayMultiplier = 0; - object.maxPollDelay = null; - object.totalPollTimeout = null; - } - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) - object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) - object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) - object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) - object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); - return object; - }; - - /** - * Converts this LongRunning to JSON. - * @function toJSON - * @memberof google.api.MethodSettings.LongRunning - * @instance - * @returns {Object.} JSON object - */ - LongRunning.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LongRunning - * @function getTypeUrl - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; - }; - - return LongRunning; - })(); - - return MethodSettings; - })(); - - /** - * ClientLibraryOrganization enum. - * @name google.api.ClientLibraryOrganization - * @enum {number} - * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value - * @property {number} CLOUD=1 CLOUD value - * @property {number} ADS=2 ADS value - * @property {number} PHOTOS=3 PHOTOS value - * @property {number} STREET_VIEW=4 STREET_VIEW value - * @property {number} SHOPPING=5 SHOPPING value - * @property {number} GEO=6 GEO value - * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value - */ - api.ClientLibraryOrganization = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; - values[valuesById[1] = "CLOUD"] = 1; - values[valuesById[2] = "ADS"] = 2; - values[valuesById[3] = "PHOTOS"] = 3; - values[valuesById[4] = "STREET_VIEW"] = 4; - values[valuesById[5] = "SHOPPING"] = 5; - values[valuesById[6] = "GEO"] = 6; - values[valuesById[7] = "GENERATIVE_AI"] = 7; - return values; - })(); - - /** - * ClientLibraryDestination enum. - * @name google.api.ClientLibraryDestination - * @enum {number} - * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value - * @property {number} GITHUB=10 GITHUB value - * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value - */ - api.ClientLibraryDestination = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; - values[valuesById[10] = "GITHUB"] = 10; - values[valuesById[20] = "PACKAGE_MANAGER"] = 20; - return values; - })(); - - /** - * LaunchStage enum. - * @name google.api.LaunchStage - * @enum {number} - * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value - * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value - * @property {number} PRELAUNCH=7 PRELAUNCH value - * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value - * @property {number} ALPHA=2 ALPHA value - * @property {number} BETA=3 BETA value - * @property {number} GA=4 GA value - * @property {number} DEPRECATED=5 DEPRECATED value - */ - api.LaunchStage = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; - values[valuesById[6] = "UNIMPLEMENTED"] = 6; - values[valuesById[7] = "PRELAUNCH"] = 7; - values[valuesById[1] = "EARLY_ACCESS"] = 1; - values[valuesById[2] = "ALPHA"] = 2; - values[valuesById[3] = "BETA"] = 3; - values[valuesById[4] = "GA"] = 4; - values[valuesById[5] = "DEPRECATED"] = 5; - return values; - })(); - - /** - * 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.FieldInfo = (function() { - - /** - * Properties of a FieldInfo. - * @memberof google.api - * @interface IFieldInfo - * @property {google.api.FieldInfo.Format|null} [format] FieldInfo format - */ - - /** - * Constructs a new FieldInfo. - * @memberof google.api - * @classdesc Represents a FieldInfo. - * @implements IFieldInfo - * @constructor - * @param {google.api.IFieldInfo=} [properties] Properties to set - */ - function FieldInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldInfo format. - * @member {google.api.FieldInfo.Format} format - * @memberof google.api.FieldInfo - * @instance - */ - FieldInfo.prototype.format = 0; - - /** - * Creates a new FieldInfo instance using the specified properties. - * @function create - * @memberof google.api.FieldInfo - * @static - * @param {google.api.IFieldInfo=} [properties] Properties to set - * @returns {google.api.FieldInfo} FieldInfo instance - */ - FieldInfo.create = function create(properties) { - return new FieldInfo(properties); - }; - - /** - * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @function encode - * @memberof google.api.FieldInfo - * @static - * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.format != null && Object.hasOwnProperty.call(message, "format")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.format); - return writer; - }; - - /** - * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.FieldInfo - * @static - * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldInfo message from the specified reader or buffer. - * @function decode - * @memberof google.api.FieldInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.FieldInfo} FieldInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.FieldInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.format = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.FieldInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.FieldInfo} FieldInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldInfo message. - * @function verify - * @memberof google.api.FieldInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.format != null && message.hasOwnProperty("format")) - switch (message.format) { - default: - return "format: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - return null; - }; - - /** - * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.FieldInfo - * @static - * @param {Object.} object Plain object - * @returns {google.api.FieldInfo} FieldInfo - */ - FieldInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.FieldInfo) - return object; - var message = new $root.google.api.FieldInfo(); - switch (object.format) { - default: - if (typeof object.format === "number") { - message.format = object.format; - break; - } - break; - case "FORMAT_UNSPECIFIED": - case 0: - message.format = 0; - break; - case "UUID4": - case 1: - message.format = 1; - break; - case "IPV4": - case 2: - message.format = 2; - break; - case "IPV6": - case 3: - message.format = 3; - break; - case "IPV4_OR_IPV6": - case 4: - message.format = 4; - break; - } - return message; - }; - - /** - * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.FieldInfo - * @static - * @param {google.api.FieldInfo} message FieldInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.format = options.enums === String ? "FORMAT_UNSPECIFIED" : 0; - if (message.format != null && message.hasOwnProperty("format")) - object.format = options.enums === String ? $root.google.api.FieldInfo.Format[message.format] === undefined ? message.format : $root.google.api.FieldInfo.Format[message.format] : message.format; - return object; - }; - - /** - * Converts this FieldInfo to JSON. - * @function toJSON - * @memberof google.api.FieldInfo - * @instance - * @returns {Object.} JSON object - */ - FieldInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldInfo - * @function getTypeUrl - * @memberof google.api.FieldInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.FieldInfo"; - }; - - /** - * Format enum. - * @name google.api.FieldInfo.Format - * @enum {number} - * @property {number} FORMAT_UNSPECIFIED=0 FORMAT_UNSPECIFIED value - * @property {number} UUID4=1 UUID4 value - * @property {number} IPV4=2 IPV4 value - * @property {number} IPV6=3 IPV6 value - * @property {number} IPV4_OR_IPV6=4 IPV4_OR_IPV6 value - */ - FieldInfo.Format = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FORMAT_UNSPECIFIED"] = 0; - values[valuesById[1] = "UUID4"] = 1; - values[valuesById[2] = "IPV4"] = 2; - values[valuesById[3] = "IPV6"] = 3; - values[valuesById[4] = "IPV4_OR_IPV6"] = 4; - return values; - })(); - - return FieldInfo; - })(); - - api.ResourceDescriptor = (function() { - - /** - * Properties of a ResourceDescriptor. - * @memberof google.api - * @interface IResourceDescriptor - * @property {string|null} [type] ResourceDescriptor type - * @property {Array.|null} [pattern] ResourceDescriptor pattern - * @property {string|null} [nameField] ResourceDescriptor nameField - * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history - * @property {string|null} [plural] ResourceDescriptor plural - * @property {string|null} [singular] ResourceDescriptor singular - * @property {Array.|null} [style] ResourceDescriptor style - */ - - /** - * Constructs a new ResourceDescriptor. - * @memberof google.api - * @classdesc Represents a ResourceDescriptor. - * @implements IResourceDescriptor - * @constructor - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - */ - function ResourceDescriptor(properties) { - this.pattern = []; - this.style = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceDescriptor type. - * @member {string} type - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.type = ""; - - /** - * ResourceDescriptor pattern. - * @member {Array.} pattern - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.pattern = $util.emptyArray; - - /** - * ResourceDescriptor nameField. - * @member {string} nameField - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.nameField = ""; - - /** - * ResourceDescriptor history. - * @member {google.api.ResourceDescriptor.History} history - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.history = 0; - - /** - * ResourceDescriptor plural. - * @member {string} plural - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.plural = ""; - - /** - * ResourceDescriptor singular. - * @member {string} singular - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.singular = ""; - - /** - * ResourceDescriptor style. - * @member {Array.} style - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.style = $util.emptyArray; - - /** - * Creates a new ResourceDescriptor instance using the specified properties. - * @function create - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance - */ - ResourceDescriptor.create = function create(properties) { - return new ResourceDescriptor(properties); - }; - - /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @function encode - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceDescriptor.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.pattern != null && message.pattern.length) - for (var i = 0; i < message.pattern.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); - if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && Object.hasOwnProperty.call(message, "history")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); - if (message.style != null && message.style.length) { - writer.uint32(/* id 10, wireType 2 =*/82).fork(); - for (var i = 0; i < message.style.length; ++i) - writer.int32(message.style[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. - * @function decode - * @memberof google.api.ResourceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceDescriptor.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - if (!(message.pattern && message.pattern.length)) - message.pattern = []; - message.pattern.push(reader.string()); - break; - } - case 3: { - message.nameField = reader.string(); - break; - } - case 4: { - message.history = reader.int32(); - break; - } - case 5: { - message.plural = reader.string(); - break; - } - case 6: { - message.singular = reader.string(); - break; - } - case 10: { - if (!(message.style && message.style.length)) - message.style = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.style.push(reader.int32()); - } else - message.style.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ResourceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceDescriptor message. - * @function verify - * @memberof google.api.ResourceDescriptor - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceDescriptor.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.pattern != null && message.hasOwnProperty("pattern")) { - if (!Array.isArray(message.pattern)) - return "pattern: array expected"; - for (var i = 0; i < message.pattern.length; ++i) - if (!$util.isString(message.pattern[i])) - return "pattern: string[] expected"; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - if (!$util.isString(message.nameField)) - return "nameField: string expected"; - if (message.history != null && message.hasOwnProperty("history")) - switch (message.history) { - default: - return "history: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.plural != null && message.hasOwnProperty("plural")) - if (!$util.isString(message.plural)) - return "plural: string expected"; - if (message.singular != null && message.hasOwnProperty("singular")) - if (!$util.isString(message.singular)) - return "singular: string expected"; - if (message.style != null && message.hasOwnProperty("style")) { - if (!Array.isArray(message.style)) - return "style: array expected"; - for (var i = 0; i < message.style.length; ++i) - switch (message.style[i]) { - default: - return "style: enum value[] expected"; - case 0: - case 1: - break; - } - } - return null; - }; - - /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ResourceDescriptor - * @static - * @param {Object.} object Plain object - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - */ - ResourceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceDescriptor) - return object; - var message = new $root.google.api.ResourceDescriptor(); - if (object.type != null) - message.type = String(object.type); - if (object.pattern) { - if (!Array.isArray(object.pattern)) - throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); - message.pattern = []; - for (var i = 0; i < object.pattern.length; ++i) - message.pattern[i] = String(object.pattern[i]); - } - if (object.nameField != null) - message.nameField = String(object.nameField); - switch (object.history) { - default: - if (typeof object.history === "number") { - message.history = object.history; - break; - } - break; - case "HISTORY_UNSPECIFIED": - case 0: - message.history = 0; - break; - case "ORIGINALLY_SINGLE_PATTERN": - case 1: - message.history = 1; - break; - case "FUTURE_MULTI_PATTERN": - case 2: - message.history = 2; - break; - } - if (object.plural != null) - message.plural = String(object.plural); - if (object.singular != null) - message.singular = String(object.singular); - if (object.style) { - if (!Array.isArray(object.style)) - throw TypeError(".google.api.ResourceDescriptor.style: array expected"); - message.style = []; - for (var i = 0; i < object.style.length; ++i) - switch (object.style[i]) { - default: - if (typeof object.style[i] === "number") { - message.style[i] = object.style[i]; - break; - } - case "STYLE_UNSPECIFIED": - case 0: - message.style[i] = 0; - break; - case "DECLARATIVE_FRIENDLY": - case 1: - message.style[i] = 1; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.ResourceDescriptor} message ResourceDescriptor - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceDescriptor.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.pattern = []; - object.style = []; - } - if (options.defaults) { - object.type = ""; - object.nameField = ""; - object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; - object.plural = ""; - object.singular = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.pattern && message.pattern.length) { - object.pattern = []; - for (var j = 0; j < message.pattern.length; ++j) - object.pattern[j] = message.pattern[j]; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - object.nameField = message.nameField; - if (message.history != null && message.hasOwnProperty("history")) - object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; - if (message.plural != null && message.hasOwnProperty("plural")) - object.plural = message.plural; - if (message.singular != null && message.hasOwnProperty("singular")) - object.singular = message.singular; - if (message.style && message.style.length) { - object.style = []; - for (var j = 0; j < message.style.length; ++j) - object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; - } - return object; - }; - - /** - * Converts this ResourceDescriptor to JSON. - * @function toJSON - * @memberof google.api.ResourceDescriptor - * @instance - * @returns {Object.} JSON object - */ - ResourceDescriptor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceDescriptor - * @function getTypeUrl - * @memberof google.api.ResourceDescriptor - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ResourceDescriptor"; - }; - - /** - * History enum. - * @name google.api.ResourceDescriptor.History - * @enum {number} - * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value - * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value - * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value - */ - ResourceDescriptor.History = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; - values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; - values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; - return values; - })(); - - /** - * Style enum. - * @name google.api.ResourceDescriptor.Style - * @enum {number} - * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value - * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value - */ - ResourceDescriptor.Style = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; - return values; - })(); - - return ResourceDescriptor; - })(); - - api.ResourceReference = (function() { - - /** - * Properties of a ResourceReference. - * @memberof google.api - * @interface IResourceReference - * @property {string|null} [type] ResourceReference type - * @property {string|null} [childType] ResourceReference childType - */ - - /** - * Constructs a new ResourceReference. - * @memberof google.api - * @classdesc Represents a ResourceReference. - * @implements IResourceReference - * @constructor - * @param {google.api.IResourceReference=} [properties] Properties to set - */ - function ResourceReference(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceReference type. - * @member {string} type - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.type = ""; - - /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.childType = ""; - - /** - * Creates a new ResourceReference instance using the specified properties. - * @function create - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference=} [properties] Properties to set - * @returns {google.api.ResourceReference} ResourceReference instance - */ - ResourceReference.create = function create(properties) { - return new ResourceReference(properties); - }; - - /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @function encode - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceReference.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); - return writer; - }; - - /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceReference message from the specified reader or buffer. - * @function decode - * @memberof google.api.ResourceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceReference} ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceReference.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - message.childType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ResourceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceReference} ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceReference.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceReference message. - * @function verify - * @memberof google.api.ResourceReference - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceReference.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.childType != null && message.hasOwnProperty("childType")) - if (!$util.isString(message.childType)) - return "childType: string expected"; - return null; - }; - - /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ResourceReference - * @static - * @param {Object.} object Plain object - * @returns {google.api.ResourceReference} ResourceReference - */ - ResourceReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceReference) - return object; - var message = new $root.google.api.ResourceReference(); - if (object.type != null) - message.type = String(object.type); - if (object.childType != null) - message.childType = String(object.childType); - return message; - }; - - /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ResourceReference - * @static - * @param {google.api.ResourceReference} message ResourceReference - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceReference.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = ""; - object.childType = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.childType != null && message.hasOwnProperty("childType")) - object.childType = message.childType; - return object; - }; - - /** - * Converts this ResourceReference to JSON. - * @function toJSON - * @memberof google.api.ResourceReference - * @instance - * @returns {Object.} JSON object - */ - ResourceReference.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceReference - * @function getTypeUrl - * @memberof google.api.ResourceReference - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ResourceReference"; - }; - - return ResourceReference; - })(); - - return api; - })(); - - google.protobuf = (function() { - - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - var protobuf = {}; - - protobuf.FileDescriptorSet = (function() { - - /** - * Properties of a FileDescriptorSet. - * @memberof google.protobuf - * @interface IFileDescriptorSet - * @property {Array.|null} [file] FileDescriptorSet file - */ - - /** - * Constructs a new FileDescriptorSet. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorSet. - * @implements IFileDescriptorSet - * @constructor - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - */ - function FileDescriptorSet(properties) { - this.file = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorSet file. - * @member {Array.} file - * @memberof google.protobuf.FileDescriptorSet - * @instance - */ - FileDescriptorSet.prototype.file = $util.emptyArray; - - /** - * Creates a new FileDescriptorSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance - */ - FileDescriptorSet.create = function create(properties) { - return new FileDescriptorSet(properties); - }; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.file != null && message.file.length) - for (var i = 0; i < message.file.length; ++i) - $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.file && message.file.length)) - message.file = []; - message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorSet message. - * @function verify - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.file != null && message.hasOwnProperty("file")) { - if (!Array.isArray(message.file)) - return "file: array expected"; - for (var i = 0; i < message.file.length; ++i) { - var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); - if (error) - return "file." + error; - } - } - return null; - }; - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - */ - FileDescriptorSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorSet) - return object; - var message = new $root.google.protobuf.FileDescriptorSet(); - if (object.file) { - if (!Array.isArray(object.file)) - throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); - message.file = []; - for (var i = 0; i < object.file.length; ++i) { - if (typeof object.file[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); - message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.file = []; - if (message.file && message.file.length) { - object.file = []; - for (var j = 0; j < message.file.length; ++j) - object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); - } - return object; - }; - - /** - * Converts this FileDescriptorSet to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorSet - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorSet - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; - }; - - return FileDescriptorSet; - })(); - - /** - * Edition enum. - * @name google.protobuf.Edition - * @enum {number} - * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value - * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value - * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value - * @property {number} EDITION_2023=1000 EDITION_2023 value - * @property {number} EDITION_2024=1001 EDITION_2024 value - * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value - * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value - * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value - * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value - * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value - * @property {number} EDITION_MAX=2147483647 EDITION_MAX value - */ - protobuf.Edition = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EDITION_UNKNOWN"] = 0; - values[valuesById[998] = "EDITION_PROTO2"] = 998; - values[valuesById[999] = "EDITION_PROTO3"] = 999; - values[valuesById[1000] = "EDITION_2023"] = 1000; - values[valuesById[1001] = "EDITION_2024"] = 1001; - values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; - values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; - values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; - values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; - values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; - values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; - return values; - })(); - - protobuf.FileDescriptorProto = (function() { - - /** - * Properties of a FileDescriptorProto. - * @memberof google.protobuf - * @interface IFileDescriptorProto - * @property {string|null} [name] FileDescriptorProto name - * @property {string|null} ["package"] FileDescriptorProto package - * @property {Array.|null} [dependency] FileDescriptorProto dependency - * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency - * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency - * @property {Array.|null} [messageType] FileDescriptorProto messageType - * @property {Array.|null} [enumType] FileDescriptorProto enumType - * @property {Array.|null} [service] FileDescriptorProto service - * @property {Array.|null} [extension] FileDescriptorProto extension - * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options - * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo - * @property {string|null} [syntax] FileDescriptorProto syntax - * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition - */ - - /** - * Constructs a new FileDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorProto. - * @implements IFileDescriptorProto - * @constructor - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - */ - function FileDescriptorProto(properties) { - this.dependency = []; - this.publicDependency = []; - this.weakDependency = []; - this.messageType = []; - this.enumType = []; - this.service = []; - this.extension = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.name = ""; - - /** - * FileDescriptorProto package. - * @member {string} package - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype["package"] = ""; - - /** - * FileDescriptorProto dependency. - * @member {Array.} dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.dependency = $util.emptyArray; - - /** - * FileDescriptorProto publicDependency. - * @member {Array.} publicDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.publicDependency = $util.emptyArray; - - /** - * FileDescriptorProto weakDependency. - * @member {Array.} weakDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.weakDependency = $util.emptyArray; - - /** - * FileDescriptorProto messageType. - * @member {Array.} messageType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.messageType = $util.emptyArray; - - /** - * FileDescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * FileDescriptorProto service. - * @member {Array.} service - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.service = $util.emptyArray; - - /** - * FileDescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.extension = $util.emptyArray; - - /** - * FileDescriptorProto options. - * @member {google.protobuf.IFileOptions|null|undefined} options - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.options = null; - - /** - * FileDescriptorProto sourceCodeInfo. - * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.sourceCodeInfo = null; - - /** - * FileDescriptorProto syntax. - * @member {string} syntax - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.syntax = ""; - - /** - * FileDescriptorProto edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.edition = 0; - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance - */ - FileDescriptorProto.create = function create(properties) { - return new FileDescriptorProto(properties); - }; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); - if (message.dependency != null && message.dependency.length) - for (var i = 0; i < message.dependency.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); - if (message.messageType != null && message.messageType.length) - for (var i = 0; i < message.messageType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.service != null && message.service.length) - for (var i = 0; i < message.service.length; ++i) - $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) - $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.publicDependency != null && message.publicDependency.length) - for (var i = 0; i < message.publicDependency.length; ++i) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); - if (message.weakDependency != null && message.weakDependency.length) - for (var i = 0; i < message.weakDependency.length; ++i) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); - if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message["package"] = reader.string(); - break; - } - case 3: { - if (!(message.dependency && message.dependency.length)) - message.dependency = []; - message.dependency.push(reader.string()); - break; - } - case 10: { - if (!(message.publicDependency && message.publicDependency.length)) - message.publicDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.publicDependency.push(reader.int32()); - } else - message.publicDependency.push(reader.int32()); - break; - } - case 11: { - if (!(message.weakDependency && message.weakDependency.length)) - message.weakDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.weakDependency.push(reader.int32()); - } else - message.weakDependency.push(reader.int32()); - break; - } - case 4: { - if (!(message.messageType && message.messageType.length)) - message.messageType = []; - message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.service && message.service.length)) - message.service = []; - message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 7: { - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 8: { - message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); - break; - } - case 12: { - message.syntax = reader.string(); - break; - } - case 14: { - message.edition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorProto message. - * @function verify - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message["package"] != null && message.hasOwnProperty("package")) - if (!$util.isString(message["package"])) - return "package: string expected"; - if (message.dependency != null && message.hasOwnProperty("dependency")) { - if (!Array.isArray(message.dependency)) - return "dependency: array expected"; - for (var i = 0; i < message.dependency.length; ++i) - if (!$util.isString(message.dependency[i])) - return "dependency: string[] expected"; - } - if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { - if (!Array.isArray(message.publicDependency)) - return "publicDependency: array expected"; - for (var i = 0; i < message.publicDependency.length; ++i) - if (!$util.isInteger(message.publicDependency[i])) - return "publicDependency: integer[] expected"; - } - if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { - if (!Array.isArray(message.weakDependency)) - return "weakDependency: array expected"; - for (var i = 0; i < message.weakDependency.length; ++i) - if (!$util.isInteger(message.weakDependency[i])) - return "weakDependency: integer[] expected"; - } - if (message.messageType != null && message.hasOwnProperty("messageType")) { - if (!Array.isArray(message.messageType)) - return "messageType: array expected"; - for (var i = 0; i < message.messageType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); - if (error) - return "messageType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.service != null && message.hasOwnProperty("service")) { - if (!Array.isArray(message.service)) - return "service: array expected"; - for (var i = 0; i < message.service.length; ++i) { - var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); - if (error) - return "service." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FileOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { - var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); - if (error) - return "sourceCodeInfo." + error; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - if (!$util.isString(message.syntax)) - return "syntax: string expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - */ - FileDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorProto) - return object; - var message = new $root.google.protobuf.FileDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object["package"] != null) - message["package"] = String(object["package"]); - if (object.dependency) { - if (!Array.isArray(object.dependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); - message.dependency = []; - for (var i = 0; i < object.dependency.length; ++i) - message.dependency[i] = String(object.dependency[i]); - } - if (object.publicDependency) { - if (!Array.isArray(object.publicDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); - message.publicDependency = []; - for (var i = 0; i < object.publicDependency.length; ++i) - message.publicDependency[i] = object.publicDependency[i] | 0; - } - if (object.weakDependency) { - if (!Array.isArray(object.weakDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); - message.weakDependency = []; - for (var i = 0; i < object.weakDependency.length; ++i) - message.weakDependency[i] = object.weakDependency[i] | 0; - } - if (object.messageType) { - if (!Array.isArray(object.messageType)) - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); - message.messageType = []; - for (var i = 0; i < object.messageType.length; ++i) { - if (typeof object.messageType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); - message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.service) { - if (!Array.isArray(object.service)) - throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); - message.service = []; - for (var i = 0; i < object.service.length; ++i) { - if (typeof object.service[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); - message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FileOptions.fromObject(object.options); - } - if (object.sourceCodeInfo != null) { - if (typeof object.sourceCodeInfo !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); - } - if (object.syntax != null) - message.syntax = String(object.syntax); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.dependency = []; - object.messageType = []; - object.enumType = []; - object.service = []; - object.extension = []; - object.publicDependency = []; - object.weakDependency = []; - } - if (options.defaults) { - object.name = ""; - object["package"] = ""; - object.options = null; - object.sourceCodeInfo = null; - object.syntax = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message["package"] != null && message.hasOwnProperty("package")) - object["package"] = message["package"]; - if (message.dependency && message.dependency.length) { - object.dependency = []; - for (var j = 0; j < message.dependency.length; ++j) - object.dependency[j] = message.dependency[j]; - } - if (message.messageType && message.messageType.length) { - object.messageType = []; - for (var j = 0; j < message.messageType.length; ++j) - object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.service && message.service.length) { - object.service = []; - for (var j = 0; j < message.service.length; ++j) - object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) - object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); - if (message.publicDependency && message.publicDependency.length) { - object.publicDependency = []; - for (var j = 0; j < message.publicDependency.length; ++j) - object.publicDependency[j] = message.publicDependency[j]; - } - if (message.weakDependency && message.weakDependency.length) { - object.weakDependency = []; - for (var j = 0; j < message.weakDependency.length; ++j) - object.weakDependency[j] = message.weakDependency[j]; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - object.syntax = message.syntax; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this FileDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; - }; - - return FileDescriptorProto; - })(); - - protobuf.DescriptorProto = (function() { - - /** - * Properties of a DescriptorProto. - * @memberof google.protobuf - * @interface IDescriptorProto - * @property {string|null} [name] DescriptorProto name - * @property {Array.|null} [field] DescriptorProto field - * @property {Array.|null} [extension] DescriptorProto extension - * @property {Array.|null} [nestedType] DescriptorProto nestedType - * @property {Array.|null} [enumType] DescriptorProto enumType - * @property {Array.|null} [extensionRange] DescriptorProto extensionRange - * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl - * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options - * @property {Array.|null} [reservedRange] DescriptorProto reservedRange - * @property {Array.|null} [reservedName] DescriptorProto reservedName - */ - - /** - * Constructs a new DescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a DescriptorProto. - * @implements IDescriptorProto - * @constructor - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - */ - function DescriptorProto(properties) { - this.field = []; - this.extension = []; - this.nestedType = []; - this.enumType = []; - this.extensionRange = []; - this.oneofDecl = []; - this.reservedRange = []; - this.reservedName = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DescriptorProto name. - * @member {string} name - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.name = ""; - - /** - * DescriptorProto field. - * @member {Array.} field - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.field = $util.emptyArray; - - /** - * DescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extension = $util.emptyArray; - - /** - * DescriptorProto nestedType. - * @member {Array.} nestedType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.nestedType = $util.emptyArray; - - /** - * DescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * DescriptorProto extensionRange. - * @member {Array.} extensionRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extensionRange = $util.emptyArray; - - /** - * DescriptorProto oneofDecl. - * @member {Array.} oneofDecl - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.oneofDecl = $util.emptyArray; - - /** - * DescriptorProto options. - * @member {google.protobuf.IMessageOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.options = null; - - /** - * DescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * DescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto} DescriptorProto instance - */ - DescriptorProto.create = function create(properties) { - return new DescriptorProto(properties); - }; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.field != null && message.field.length) - for (var i = 0; i < message.field.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nestedType != null && message.nestedType.length) - for (var i = 0; i < message.nestedType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.extensionRange != null && message.extensionRange.length) - for (var i = 0; i < message.extensionRange.length; ++i) - $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.oneofDecl != null && message.oneofDecl.length) - for (var i = 0; i < message.oneofDecl.length; ++i) - $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); - return writer; - }; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.field && message.field.length)) - message.field = []; - message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.nestedType && message.nestedType.length)) - message.nestedType = []; - message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - } - case 4: { - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.extensionRange && message.extensionRange.length)) - message.extensionRange = []; - message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); - break; - } - case 8: { - if (!(message.oneofDecl && message.oneofDecl.length)) - message.oneofDecl = []; - message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 7: { - message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); - break; - } - case 10: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DescriptorProto message. - * @function verify - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.field != null && message.hasOwnProperty("field")) { - if (!Array.isArray(message.field)) - return "field: array expected"; - for (var i = 0; i < message.field.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); - if (error) - return "field." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.nestedType != null && message.hasOwnProperty("nestedType")) { - if (!Array.isArray(message.nestedType)) - return "nestedType: array expected"; - for (var i = 0; i < message.nestedType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); - if (error) - return "nestedType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { - if (!Array.isArray(message.extensionRange)) - return "extensionRange: array expected"; - for (var i = 0; i < message.extensionRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); - if (error) - return "extensionRange." + error; - } - } - if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { - if (!Array.isArray(message.oneofDecl)) - return "oneofDecl: array expected"; - for (var i = 0; i < message.oneofDecl.length; ++i) { - var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); - if (error) - return "oneofDecl." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MessageOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto} DescriptorProto - */ - DescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto) - return object; - var message = new $root.google.protobuf.DescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.field) { - if (!Array.isArray(object.field)) - throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); - message.field = []; - for (var i = 0; i < object.field.length; ++i) { - if (typeof object.field[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); - message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.nestedType) { - if (!Array.isArray(object.nestedType)) - throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); - message.nestedType = []; - for (var i = 0; i < object.nestedType.length; ++i) { - if (typeof object.nestedType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); - message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.extensionRange) { - if (!Array.isArray(object.extensionRange)) - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); - message.extensionRange = []; - for (var i = 0; i < object.extensionRange.length; ++i) { - if (typeof object.extensionRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); - message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); - } - } - if (object.oneofDecl) { - if (!Array.isArray(object.oneofDecl)) - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); - message.oneofDecl = []; - for (var i = 0; i < object.oneofDecl.length; ++i) { - if (typeof object.oneofDecl[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); - message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.DescriptorProto} message DescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.field = []; - object.nestedType = []; - object.enumType = []; - object.extensionRange = []; - object.extension = []; - object.oneofDecl = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.field && message.field.length) { - object.field = []; - for (var j = 0; j < message.field.length; ++j) - object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); - } - if (message.nestedType && message.nestedType.length) { - object.nestedType = []; - for (var j = 0; j < message.nestedType.length; ++j) - object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.extensionRange && message.extensionRange.length) { - object.extensionRange = []; - for (var j = 0; j < message.extensionRange.length; ++j) - object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); - if (message.oneofDecl && message.oneofDecl.length) { - object.oneofDecl = []; - for (var j = 0; j < message.oneofDecl.length; ++j) - object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); - } - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this DescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto - * @instance - * @returns {Object.} JSON object - */ - DescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto"; - }; - - DescriptorProto.ExtensionRange = (function() { - - /** - * Properties of an ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @interface IExtensionRange - * @property {number|null} [start] ExtensionRange start - * @property {number|null} [end] ExtensionRange end - * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options - */ - - /** - * Constructs a new ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents an ExtensionRange. - * @implements IExtensionRange - * @constructor - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - */ - function ExtensionRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.start = 0; - - /** - * ExtensionRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.end = 0; - - /** - * ExtensionRange options. - * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.options = null; - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance - */ - ExtensionRange.create = function create(properties) { - return new ExtensionRange(properties); - }; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - case 3: { - message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - */ - ExtensionRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); - message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - object.options = null; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ExtensionRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - * @returns {Object.} JSON object - */ - ExtensionRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; - }; - - return ExtensionRange; - })(); - - DescriptorProto.ReservedRange = (function() { - - /** - * Properties of a ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @interface IReservedRange - * @property {number|null} [start] ReservedRange start - * @property {number|null} [end] ReservedRange end - */ - - /** - * Constructs a new ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents a ReservedRange. - * @implements IReservedRange - * @constructor - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - */ - function ReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReservedRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.start = 0; - - /** - * ReservedRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.end = 0; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance - */ - ReservedRange.create = function create(properties) { - return new ReservedRange(properties); - }; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReservedRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - */ - ReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this ReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - * @returns {Object.} JSON object - */ - ReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReservedRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; - }; - - return ReservedRange; - })(); - - return DescriptorProto; - })(); - - protobuf.ExtensionRangeOptions = (function() { - - /** - * Properties of an ExtensionRangeOptions. - * @memberof google.protobuf - * @interface IExtensionRangeOptions - * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption - * @property {Array.|null} [declaration] ExtensionRangeOptions declaration - * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features - * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification - */ - - /** - * Constructs a new ExtensionRangeOptions. - * @memberof google.protobuf - * @classdesc Represents an ExtensionRangeOptions. - * @implements IExtensionRangeOptions - * @constructor - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - */ - function ExtensionRangeOptions(properties) { - this.uninterpretedOption = []; - this.declaration = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRangeOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ExtensionRangeOptions declaration. - * @member {Array.} declaration - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.declaration = $util.emptyArray; - - /** - * ExtensionRangeOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.features = null; - - /** - * ExtensionRangeOptions verification. - * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.verification = 1; - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance - */ - ExtensionRangeOptions.create = function create(properties) { - return new ExtensionRangeOptions(properties); - }; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.declaration != null && message.declaration.length) - for (var i = 0; i < message.declaration.length; ++i) - $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.declaration && message.declaration.length)) - message.declaration = []; - message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); - break; - } - case 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.verification = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRangeOptions message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRangeOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message.declaration != null && message.hasOwnProperty("declaration")) { - if (!Array.isArray(message.declaration)) - return "declaration: array expected"; - for (var i = 0; i < message.declaration.length; ++i) { - var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); - if (error) - return "declaration." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.verification != null && message.hasOwnProperty("verification")) - switch (message.verification) { - default: - return "verification: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - */ - ExtensionRangeOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions(); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object.declaration) { - if (!Array.isArray(object.declaration)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); - message.declaration = []; - for (var i = 0; i < object.declaration.length; ++i) { - if (typeof object.declaration[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); - message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - switch (object.verification) { - case "DECLARATION": - case 0: - message.verification = 0; - break; - default: - if (typeof object.verification === "number") { - message.verification = object.verification; - break; - } - break; - case "UNVERIFIED": - case 1: - message.verification = 1; - break; - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRangeOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.declaration = []; - object.uninterpretedOption = []; - } - if (options.defaults) { - object.verification = options.enums === String ? "UNVERIFIED" : 1; - object.features = null; - } - if (message.declaration && message.declaration.length) { - object.declaration = []; - for (var j = 0; j < message.declaration.length; ++j) - object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); - } - if (message.verification != null && message.hasOwnProperty("verification")) - object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - * @returns {Object.} JSON object - */ - ExtensionRangeOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; - }; - - ExtensionRangeOptions.Declaration = (function() { - - /** - * Properties of a Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @interface IDeclaration - * @property {number|null} [number] Declaration number - * @property {string|null} [fullName] Declaration fullName - * @property {string|null} [type] Declaration type - * @property {boolean|null} [reserved] Declaration reserved - * @property {boolean|null} [repeated] Declaration repeated - */ - - /** - * Constructs a new Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @classdesc Represents a Declaration. - * @implements IDeclaration - * @constructor - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - */ - function Declaration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Declaration number. - * @member {number} number - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.number = 0; - - /** - * Declaration fullName. - * @member {string} fullName - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.fullName = ""; - - /** - * Declaration type. - * @member {string} type - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.type = ""; - - /** - * Declaration reserved. - * @member {boolean} reserved - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.reserved = false; - - /** - * Declaration repeated. - * @member {boolean} repeated - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.repeated = false; - - /** - * Creates a new Declaration instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance - */ - Declaration.create = function create(properties) { - return new Declaration(properties); - }; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); - if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); - if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); - if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); - return writer; - }; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.number = reader.int32(); - break; - } - case 2: { - message.fullName = reader.string(); - break; - } - case 3: { - message.type = reader.string(); - break; - } - case 5: { - message.reserved = reader.bool(); - break; - } - case 6: { - message.repeated = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Declaration message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Declaration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.fullName != null && message.hasOwnProperty("fullName")) - if (!$util.isString(message.fullName)) - return "fullName: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.reserved != null && message.hasOwnProperty("reserved")) - if (typeof message.reserved !== "boolean") - return "reserved: boolean expected"; - if (message.repeated != null && message.hasOwnProperty("repeated")) - if (typeof message.repeated !== "boolean") - return "repeated: boolean expected"; - return null; - }; - - /** - * Creates a Declaration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - */ - Declaration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - if (object.number != null) - message.number = object.number | 0; - if (object.fullName != null) - message.fullName = String(object.fullName); - if (object.type != null) - message.type = String(object.type); - if (object.reserved != null) - message.reserved = Boolean(object.reserved); - if (object.repeated != null) - message.repeated = Boolean(object.repeated); - return message; - }; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Declaration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.number = 0; - object.fullName = ""; - object.type = ""; - object.reserved = false; - object.repeated = false; - } - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.fullName != null && message.hasOwnProperty("fullName")) - object.fullName = message.fullName; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.reserved != null && message.hasOwnProperty("reserved")) - object.reserved = message.reserved; - if (message.repeated != null && message.hasOwnProperty("repeated")) - object.repeated = message.repeated; - return object; - }; - - /** - * Converts this Declaration to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - * @returns {Object.} JSON object - */ - Declaration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Declaration - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; - }; - - return Declaration; - })(); - - /** - * VerificationState enum. - * @name google.protobuf.ExtensionRangeOptions.VerificationState - * @enum {number} - * @property {number} DECLARATION=0 DECLARATION value - * @property {number} UNVERIFIED=1 UNVERIFIED value - */ - ExtensionRangeOptions.VerificationState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DECLARATION"] = 0; - values[valuesById[1] = "UNVERIFIED"] = 1; - return values; - })(); - - return ExtensionRangeOptions; - })(); - - protobuf.FieldDescriptorProto = (function() { - - /** - * Properties of a FieldDescriptorProto. - * @memberof google.protobuf - * @interface IFieldDescriptorProto - * @property {string|null} [name] FieldDescriptorProto name - * @property {number|null} [number] FieldDescriptorProto number - * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label - * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type - * @property {string|null} [typeName] FieldDescriptorProto typeName - * @property {string|null} [extendee] FieldDescriptorProto extendee - * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue - * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex - * @property {string|null} [jsonName] FieldDescriptorProto jsonName - * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options - * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional - */ - - /** - * Constructs a new FieldDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FieldDescriptorProto. - * @implements IFieldDescriptorProto - * @constructor - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - */ - function FieldDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.name = ""; - - /** - * FieldDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.number = 0; - - /** - * FieldDescriptorProto label. - * @member {google.protobuf.FieldDescriptorProto.Label} label - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.label = 1; - - /** - * FieldDescriptorProto type. - * @member {google.protobuf.FieldDescriptorProto.Type} type - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.type = 1; - - /** - * FieldDescriptorProto typeName. - * @member {string} typeName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.typeName = ""; - - /** - * FieldDescriptorProto extendee. - * @member {string} extendee - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.extendee = ""; - - /** - * FieldDescriptorProto defaultValue. - * @member {string} defaultValue - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.defaultValue = ""; - - /** - * FieldDescriptorProto oneofIndex. - * @member {number} oneofIndex - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.oneofIndex = 0; - - /** - * FieldDescriptorProto jsonName. - * @member {string} jsonName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.jsonName = ""; - - /** - * FieldDescriptorProto options. - * @member {google.protobuf.IFieldOptions|null|undefined} options - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.options = null; - - /** - * FieldDescriptorProto proto3Optional. - * @member {boolean} proto3Optional - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.proto3Optional = false; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance - */ - FieldDescriptorProto.create = function create(properties) { - return new FieldDescriptorProto(properties); - }; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && Object.hasOwnProperty.call(message, "label")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); - if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); - if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); - if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); - return writer; - }; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.number = reader.int32(); - break; - } - case 4: { - message.label = reader.int32(); - break; - } - case 5: { - message.type = reader.int32(); - break; - } - case 6: { - message.typeName = reader.string(); - break; - } - case 2: { - message.extendee = reader.string(); - break; - } - case 7: { - message.defaultValue = reader.string(); - break; - } - case 9: { - message.oneofIndex = reader.int32(); - break; - } - case 10: { - message.jsonName = reader.string(); - break; - } - case 8: { - message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); - break; - } - case 17: { - message.proto3Optional = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldDescriptorProto message. - * @function verify - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.label != null && message.hasOwnProperty("label")) - switch (message.label) { - default: - return "label: enum value expected"; - case 1: - case 3: - case 2: - break; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - break; - } - if (message.typeName != null && message.hasOwnProperty("typeName")) - if (!$util.isString(message.typeName)) - return "typeName: string expected"; - if (message.extendee != null && message.hasOwnProperty("extendee")) - if (!$util.isString(message.extendee)) - return "extendee: string expected"; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - if (!$util.isString(message.defaultValue)) - return "defaultValue: string expected"; - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - if (!$util.isInteger(message.oneofIndex)) - return "oneofIndex: integer expected"; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - if (!$util.isString(message.jsonName)) - return "jsonName: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FieldOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - if (typeof message.proto3Optional !== "boolean") - return "proto3Optional: boolean expected"; - return null; - }; - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - */ - FieldDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldDescriptorProto) - return object; - var message = new $root.google.protobuf.FieldDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - switch (object.label) { - default: - if (typeof object.label === "number") { - message.label = object.label; - break; - } - break; - case "LABEL_OPTIONAL": - case 1: - message.label = 1; - break; - case "LABEL_REPEATED": - case 3: - message.label = 3; - break; - case "LABEL_REQUIRED": - case 2: - message.label = 2; - break; - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_DOUBLE": - case 1: - message.type = 1; - break; - case "TYPE_FLOAT": - case 2: - message.type = 2; - break; - case "TYPE_INT64": - case 3: - message.type = 3; - break; - case "TYPE_UINT64": - case 4: - message.type = 4; - break; - case "TYPE_INT32": - case 5: - message.type = 5; - break; - case "TYPE_FIXED64": - case 6: - message.type = 6; - break; - case "TYPE_FIXED32": - case 7: - message.type = 7; - break; - case "TYPE_BOOL": - case 8: - message.type = 8; - break; - case "TYPE_STRING": - case 9: - message.type = 9; - break; - case "TYPE_GROUP": - case 10: - message.type = 10; - break; - case "TYPE_MESSAGE": - case 11: - message.type = 11; - break; - case "TYPE_BYTES": - case 12: - message.type = 12; - break; - case "TYPE_UINT32": - case 13: - message.type = 13; - break; - case "TYPE_ENUM": - case 14: - message.type = 14; - break; - case "TYPE_SFIXED32": - case 15: - message.type = 15; - break; - case "TYPE_SFIXED64": - case 16: - message.type = 16; - break; - case "TYPE_SINT32": - case 17: - message.type = 17; - break; - case "TYPE_SINT64": - case 18: - message.type = 18; - break; - } - if (object.typeName != null) - message.typeName = String(object.typeName); - if (object.extendee != null) - message.extendee = String(object.extendee); - if (object.defaultValue != null) - message.defaultValue = String(object.defaultValue); - if (object.oneofIndex != null) - message.oneofIndex = object.oneofIndex | 0; - if (object.jsonName != null) - message.jsonName = String(object.jsonName); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); - } - if (object.proto3Optional != null) - message.proto3Optional = Boolean(object.proto3Optional); - return message; - }; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.extendee = ""; - object.number = 0; - object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; - object.type = options.enums === String ? "TYPE_DOUBLE" : 1; - object.typeName = ""; - object.defaultValue = ""; - object.options = null; - object.oneofIndex = 0; - object.jsonName = ""; - object.proto3Optional = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.extendee != null && message.hasOwnProperty("extendee")) - object.extendee = message.extendee; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.label != null && message.hasOwnProperty("label")) - object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; - if (message.typeName != null && message.hasOwnProperty("typeName")) - object.typeName = message.typeName; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - object.defaultValue = message.defaultValue; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - object.oneofIndex = message.oneofIndex; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - object.jsonName = message.jsonName; - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - object.proto3Optional = message.proto3Optional; - return object; - }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FieldDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FieldDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; - }; - - /** - * Type enum. - * @name google.protobuf.FieldDescriptorProto.Type - * @enum {number} - * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value - * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value - * @property {number} TYPE_INT64=3 TYPE_INT64 value - * @property {number} TYPE_UINT64=4 TYPE_UINT64 value - * @property {number} TYPE_INT32=5 TYPE_INT32 value - * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value - * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value - * @property {number} TYPE_BOOL=8 TYPE_BOOL value - * @property {number} TYPE_STRING=9 TYPE_STRING value - * @property {number} TYPE_GROUP=10 TYPE_GROUP value - * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value - * @property {number} TYPE_BYTES=12 TYPE_BYTES value - * @property {number} TYPE_UINT32=13 TYPE_UINT32 value - * @property {number} TYPE_ENUM=14 TYPE_ENUM value - * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value - * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value - * @property {number} TYPE_SINT32=17 TYPE_SINT32 value - * @property {number} TYPE_SINT64=18 TYPE_SINT64 value - */ - FieldDescriptorProto.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "TYPE_DOUBLE"] = 1; - values[valuesById[2] = "TYPE_FLOAT"] = 2; - values[valuesById[3] = "TYPE_INT64"] = 3; - values[valuesById[4] = "TYPE_UINT64"] = 4; - values[valuesById[5] = "TYPE_INT32"] = 5; - values[valuesById[6] = "TYPE_FIXED64"] = 6; - values[valuesById[7] = "TYPE_FIXED32"] = 7; - values[valuesById[8] = "TYPE_BOOL"] = 8; - values[valuesById[9] = "TYPE_STRING"] = 9; - values[valuesById[10] = "TYPE_GROUP"] = 10; - values[valuesById[11] = "TYPE_MESSAGE"] = 11; - values[valuesById[12] = "TYPE_BYTES"] = 12; - values[valuesById[13] = "TYPE_UINT32"] = 13; - values[valuesById[14] = "TYPE_ENUM"] = 14; - values[valuesById[15] = "TYPE_SFIXED32"] = 15; - values[valuesById[16] = "TYPE_SFIXED64"] = 16; - values[valuesById[17] = "TYPE_SINT32"] = 17; - values[valuesById[18] = "TYPE_SINT64"] = 18; - return values; - })(); - - /** - * Label enum. - * @name google.protobuf.FieldDescriptorProto.Label - * @enum {number} - * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value - * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value - * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value - */ - FieldDescriptorProto.Label = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "LABEL_OPTIONAL"] = 1; - values[valuesById[3] = "LABEL_REPEATED"] = 3; - values[valuesById[2] = "LABEL_REQUIRED"] = 2; - return values; - })(); - - return FieldDescriptorProto; - })(); - - protobuf.OneofDescriptorProto = (function() { - - /** - * Properties of an OneofDescriptorProto. - * @memberof google.protobuf - * @interface IOneofDescriptorProto - * @property {string|null} [name] OneofDescriptorProto name - * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options - */ - - /** - * Constructs a new OneofDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an OneofDescriptorProto. - * @implements IOneofDescriptorProto - * @constructor - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - */ - function OneofDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.name = ""; - - /** - * OneofDescriptorProto options. - * @member {google.protobuf.IOneofOptions|null|undefined} options - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.options = null; - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance - */ - OneofDescriptorProto.create = function create(properties) { - return new OneofDescriptorProto(properties); - }; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofDescriptorProto message. - * @function verify - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.OneofOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - */ - OneofDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofDescriptorProto) - return object; - var message = new $root.google.protobuf.OneofDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.OneofDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - OneofDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; - }; - - return OneofDescriptorProto; - })(); - - protobuf.EnumDescriptorProto = (function() { - - /** - * Properties of an EnumDescriptorProto. - * @memberof google.protobuf - * @interface IEnumDescriptorProto - * @property {string|null} [name] EnumDescriptorProto name - * @property {Array.|null} [value] EnumDescriptorProto value - * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options - * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange - * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName - */ - - /** - * Constructs a new EnumDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumDescriptorProto. - * @implements IEnumDescriptorProto - * @constructor - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - */ - function EnumDescriptorProto(properties) { - this.value = []; - this.reservedRange = []; - this.reservedName = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.name = ""; - - /** - * EnumDescriptorProto value. - * @member {Array.} value - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.value = $util.emptyArray; - - /** - * EnumDescriptorProto options. - * @member {google.protobuf.IEnumOptions|null|undefined} options - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.options = null; - - /** - * EnumDescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * EnumDescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance - */ - EnumDescriptorProto.create = function create(properties) { - return new EnumDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.value != null && message.value.length) - for (var i = 0; i < message.value.length; ++i) - $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); - return writer; - }; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.value && message.value.length)) - message.value = []; - message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); - break; - } - case 4: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.value != null && message.hasOwnProperty("value")) { - if (!Array.isArray(message.value)) - return "value: array expected"; - for (var i = 0; i < message.value.length; ++i) { - var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); - if (error) - return "value." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - */ - EnumDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.value) { - if (!Array.isArray(object.value)) - throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); - message.value = []; - for (var i = 0; i < object.value.length; ++i) { - if (typeof object.value[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); - message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.value = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.value && message.value.length) { - object.value = []; - for (var j = 0; j < message.value.length; ++j) - object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; - }; - - EnumDescriptorProto.EnumReservedRange = (function() { - - /** - * Properties of an EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @interface IEnumReservedRange - * @property {number|null} [start] EnumReservedRange start - * @property {number|null} [end] EnumReservedRange end - */ - - /** - * Constructs a new EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @classdesc Represents an EnumReservedRange. - * @implements IEnumReservedRange - * @constructor - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - */ - function EnumReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumReservedRange start. - * @member {number} start - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.start = 0; - - /** - * EnumReservedRange end. - * @member {number} end - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.end = 0; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance - */ - EnumReservedRange.create = function create(properties) { - return new EnumReservedRange(properties); - }; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumReservedRange message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - */ - EnumReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this EnumReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - * @returns {Object.} JSON object - */ - EnumReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumReservedRange - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; - }; - - return EnumReservedRange; - })(); - - return EnumDescriptorProto; - })(); - - protobuf.EnumValueDescriptorProto = (function() { - - /** - * Properties of an EnumValueDescriptorProto. - * @memberof google.protobuf - * @interface IEnumValueDescriptorProto - * @property {string|null} [name] EnumValueDescriptorProto name - * @property {number|null} [number] EnumValueDescriptorProto number - * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options - */ - - /** - * Constructs a new EnumValueDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumValueDescriptorProto. - * @implements IEnumValueDescriptorProto - * @constructor - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - */ - function EnumValueDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.name = ""; - - /** - * EnumValueDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.number = 0; - - /** - * EnumValueDescriptorProto options. - * @member {google.protobuf.IEnumValueOptions|null|undefined} options - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.options = null; - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance - */ - EnumValueDescriptorProto.create = function create(properties) { - return new EnumValueDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.number = reader.int32(); - break; - } - case 3: { - message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumValueOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - */ - EnumValueDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumValueDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.number = 0; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumValueDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; - }; - - return EnumValueDescriptorProto; - })(); - - protobuf.ServiceDescriptorProto = (function() { - - /** - * Properties of a ServiceDescriptorProto. - * @memberof google.protobuf - * @interface IServiceDescriptorProto - * @property {string|null} [name] ServiceDescriptorProto name - * @property {Array.|null} [method] ServiceDescriptorProto method - * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options - */ - - /** - * Constructs a new ServiceDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a ServiceDescriptorProto. - * @implements IServiceDescriptorProto - * @constructor - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - */ - function ServiceDescriptorProto(properties) { - this.method = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.name = ""; - - /** - * ServiceDescriptorProto method. - * @member {Array.} method - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.method = $util.emptyArray; - - /** - * ServiceDescriptorProto options. - * @member {google.protobuf.IServiceOptions|null|undefined} options - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.options = null; - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance - */ - ServiceDescriptorProto.create = function create(properties) { - return new ServiceDescriptorProto(properties); - }; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.method != null && message.method.length) - for (var i = 0; i < message.method.length; ++i) - $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.method && message.method.length)) - message.method = []; - message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceDescriptorProto message. - * @function verify - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.method != null && message.hasOwnProperty("method")) { - if (!Array.isArray(message.method)) - return "method: array expected"; - for (var i = 0; i < message.method.length; ++i) { - var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); - if (error) - return "method." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ServiceOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - */ - ServiceDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceDescriptorProto) - return object; - var message = new $root.google.protobuf.ServiceDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.method) { - if (!Array.isArray(object.method)) - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); - message.method = []; - for (var i = 0; i < object.method.length; ++i) { - if (typeof object.method[i] !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); - message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.method = []; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.method && message.method.length) { - object.method = []; - for (var j = 0; j < message.method.length; ++j) - object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - ServiceDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; - }; - - return ServiceDescriptorProto; - })(); - - protobuf.MethodDescriptorProto = (function() { - - /** - * Properties of a MethodDescriptorProto. - * @memberof google.protobuf - * @interface IMethodDescriptorProto - * @property {string|null} [name] MethodDescriptorProto name - * @property {string|null} [inputType] MethodDescriptorProto inputType - * @property {string|null} [outputType] MethodDescriptorProto outputType - * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options - * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming - * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming - */ - - /** - * Constructs a new MethodDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a MethodDescriptorProto. - * @implements IMethodDescriptorProto - * @constructor - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - */ - function MethodDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.name = ""; - - /** - * MethodDescriptorProto inputType. - * @member {string} inputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.inputType = ""; - - /** - * MethodDescriptorProto outputType. - * @member {string} outputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.outputType = ""; - - /** - * MethodDescriptorProto options. - * @member {google.protobuf.IMethodOptions|null|undefined} options - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.options = null; - - /** - * MethodDescriptorProto clientStreaming. - * @member {boolean} clientStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.clientStreaming = false; - - /** - * MethodDescriptorProto serverStreaming. - * @member {boolean} serverStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.serverStreaming = false; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance - */ - MethodDescriptorProto.create = function create(properties) { - return new MethodDescriptorProto(properties); - }; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); - if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); - if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); - return writer; - }; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.inputType = reader.string(); - break; - } - case 3: { - message.outputType = reader.string(); - break; - } - case 4: { - message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); - break; - } - case 5: { - message.clientStreaming = reader.bool(); - break; - } - case 6: { - message.serverStreaming = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodDescriptorProto message. - * @function verify - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.inputType != null && message.hasOwnProperty("inputType")) - if (!$util.isString(message.inputType)) - return "inputType: string expected"; - if (message.outputType != null && message.hasOwnProperty("outputType")) - if (!$util.isString(message.outputType)) - return "outputType: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MethodOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - if (typeof message.clientStreaming !== "boolean") - return "clientStreaming: boolean expected"; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - if (typeof message.serverStreaming !== "boolean") - return "serverStreaming: boolean expected"; - return null; - }; - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - */ - MethodDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodDescriptorProto) - return object; - var message = new $root.google.protobuf.MethodDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.inputType != null) - message.inputType = String(object.inputType); - if (object.outputType != null) - message.outputType = String(object.outputType); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); - } - if (object.clientStreaming != null) - message.clientStreaming = Boolean(object.clientStreaming); - if (object.serverStreaming != null) - message.serverStreaming = Boolean(object.serverStreaming); - return message; - }; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.inputType = ""; - object.outputType = ""; - object.options = null; - object.clientStreaming = false; - object.serverStreaming = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.inputType != null && message.hasOwnProperty("inputType")) - object.inputType = message.inputType; - if (message.outputType != null && message.hasOwnProperty("outputType")) - object.outputType = message.outputType; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - object.clientStreaming = message.clientStreaming; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - object.serverStreaming = message.serverStreaming; - return object; - }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.MethodDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - MethodDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; - }; - - return MethodDescriptorProto; - })(); - - protobuf.FileOptions = (function() { - - /** - * Properties of a FileOptions. - * @memberof google.protobuf - * @interface IFileOptions - * @property {string|null} [javaPackage] FileOptions javaPackage - * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname - * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles - * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash - * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 - * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor - * @property {string|null} [goPackage] FileOptions goPackage - * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices - * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices - * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices - * @property {boolean|null} [deprecated] FileOptions deprecated - * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas - * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix - * @property {string|null} [csharpNamespace] FileOptions csharpNamespace - * @property {string|null} [swiftPrefix] FileOptions swiftPrefix - * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix - * @property {string|null} [phpNamespace] FileOptions phpNamespace - * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace - * @property {string|null} [rubyPackage] FileOptions rubyPackage - * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features - * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption - * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition - */ - - /** - * Constructs a new FileOptions. - * @memberof google.protobuf - * @classdesc Represents a FileOptions. - * @implements IFileOptions - * @constructor - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - */ - function FileOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.resourceDefinition"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileOptions javaPackage. - * @member {string} javaPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaPackage = ""; - - /** - * FileOptions javaOuterClassname. - * @member {string} javaOuterClassname - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaOuterClassname = ""; - - /** - * FileOptions javaMultipleFiles. - * @member {boolean} javaMultipleFiles - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaMultipleFiles = false; - - /** - * FileOptions javaGenerateEqualsAndHash. - * @member {boolean} javaGenerateEqualsAndHash - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenerateEqualsAndHash = false; - - /** - * FileOptions javaStringCheckUtf8. - * @member {boolean} javaStringCheckUtf8 - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaStringCheckUtf8 = false; - - /** - * FileOptions optimizeFor. - * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.optimizeFor = 1; - - /** - * FileOptions goPackage. - * @member {string} goPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.goPackage = ""; - - /** - * FileOptions ccGenericServices. - * @member {boolean} ccGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccGenericServices = false; - - /** - * FileOptions javaGenericServices. - * @member {boolean} javaGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenericServices = false; - - /** - * FileOptions pyGenericServices. - * @member {boolean} pyGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.pyGenericServices = false; - - /** - * FileOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.deprecated = false; - - /** - * FileOptions ccEnableArenas. - * @member {boolean} ccEnableArenas - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccEnableArenas = true; - - /** - * FileOptions objcClassPrefix. - * @member {string} objcClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.objcClassPrefix = ""; - - /** - * FileOptions csharpNamespace. - * @member {string} csharpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.csharpNamespace = ""; - - /** - * FileOptions swiftPrefix. - * @member {string} swiftPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.swiftPrefix = ""; - - /** - * FileOptions phpClassPrefix. - * @member {string} phpClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpClassPrefix = ""; - - /** - * FileOptions phpNamespace. - * @member {string} phpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpNamespace = ""; - - /** - * FileOptions phpMetadataNamespace. - * @member {string} phpMetadataNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpMetadataNamespace = ""; - - /** - * FileOptions rubyPackage. - * @member {string} rubyPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.rubyPackage = ""; - - /** - * FileOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.features = null; - - /** - * FileOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FileOptions .google.api.resourceDefinition. - * @member {Array.} .google.api.resourceDefinition - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; - - /** - * Creates a new FileOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - * @returns {google.protobuf.FileOptions} FileOptions instance - */ - FileOptions.create = function create(properties) { - return new FileOptions(properties); - }; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); - if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); - if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); - if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); - if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); - if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); - if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); - if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) - writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); - if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) - writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) - writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); - if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) - writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); - if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) - writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); - if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) - writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); - if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) - writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); - if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) - writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); - if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) - writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); - if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) - writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); - if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) - writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.javaPackage = reader.string(); - break; - } - case 8: { - message.javaOuterClassname = reader.string(); - break; - } - case 10: { - message.javaMultipleFiles = reader.bool(); - break; - } - case 20: { - message.javaGenerateEqualsAndHash = reader.bool(); - break; - } - case 27: { - message.javaStringCheckUtf8 = reader.bool(); - break; - } - case 9: { - message.optimizeFor = reader.int32(); - break; - } - case 11: { - message.goPackage = reader.string(); - break; - } - case 16: { - message.ccGenericServices = reader.bool(); - break; - } - case 17: { - message.javaGenericServices = reader.bool(); - break; - } - case 18: { - message.pyGenericServices = reader.bool(); - break; - } - case 23: { - message.deprecated = reader.bool(); - break; - } - case 31: { - message.ccEnableArenas = reader.bool(); - break; - } - case 36: { - message.objcClassPrefix = reader.string(); - break; - } - case 37: { - message.csharpNamespace = reader.string(); - break; - } - case 39: { - message.swiftPrefix = reader.string(); - break; - } - case 40: { - message.phpClassPrefix = reader.string(); - break; - } - case 41: { - message.phpNamespace = reader.string(); - break; - } - case 44: { - message.phpMetadataNamespace = reader.string(); - break; - } - case 45: { - message.rubyPackage = reader.string(); - break; - } - case 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1053: { - if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) - message[".google.api.resourceDefinition"] = []; - message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileOptions message. - * @function verify - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - if (!$util.isString(message.javaPackage)) - return "javaPackage: string expected"; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - if (!$util.isString(message.javaOuterClassname)) - return "javaOuterClassname: string expected"; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - if (typeof message.javaMultipleFiles !== "boolean") - return "javaMultipleFiles: boolean expected"; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - if (typeof message.javaGenerateEqualsAndHash !== "boolean") - return "javaGenerateEqualsAndHash: boolean expected"; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - if (typeof message.javaStringCheckUtf8 !== "boolean") - return "javaStringCheckUtf8: boolean expected"; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - switch (message.optimizeFor) { - default: - return "optimizeFor: enum value expected"; - case 1: - case 2: - case 3: - break; - } - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - if (!$util.isString(message.goPackage)) - return "goPackage: string expected"; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - if (typeof message.ccGenericServices !== "boolean") - return "ccGenericServices: boolean expected"; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - if (typeof message.javaGenericServices !== "boolean") - return "javaGenericServices: boolean expected"; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - if (typeof message.pyGenericServices !== "boolean") - return "pyGenericServices: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - if (typeof message.ccEnableArenas !== "boolean") - return "ccEnableArenas: boolean expected"; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - if (!$util.isString(message.objcClassPrefix)) - return "objcClassPrefix: string expected"; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - if (!$util.isString(message.csharpNamespace)) - return "csharpNamespace: string expected"; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - if (!$util.isString(message.swiftPrefix)) - return "swiftPrefix: string expected"; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - if (!$util.isString(message.phpClassPrefix)) - return "phpClassPrefix: string expected"; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - if (!$util.isString(message.phpNamespace)) - return "phpNamespace: string expected"; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - if (!$util.isString(message.phpMetadataNamespace)) - return "phpMetadataNamespace: string expected"; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - if (!$util.isString(message.rubyPackage)) - return "rubyPackage: string expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { - if (!Array.isArray(message[".google.api.resourceDefinition"])) - return ".google.api.resourceDefinition: array expected"; - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); - if (error) - return ".google.api.resourceDefinition." + error; - } - } - return null; - }; - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileOptions} FileOptions - */ - FileOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileOptions) - return object; - var message = new $root.google.protobuf.FileOptions(); - if (object.javaPackage != null) - message.javaPackage = String(object.javaPackage); - if (object.javaOuterClassname != null) - message.javaOuterClassname = String(object.javaOuterClassname); - if (object.javaMultipleFiles != null) - message.javaMultipleFiles = Boolean(object.javaMultipleFiles); - if (object.javaGenerateEqualsAndHash != null) - message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); - if (object.javaStringCheckUtf8 != null) - message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); - switch (object.optimizeFor) { - default: - if (typeof object.optimizeFor === "number") { - message.optimizeFor = object.optimizeFor; - break; - } - break; - case "SPEED": - case 1: - message.optimizeFor = 1; - break; - case "CODE_SIZE": - case 2: - message.optimizeFor = 2; - break; - case "LITE_RUNTIME": - case 3: - message.optimizeFor = 3; - break; - } - if (object.goPackage != null) - message.goPackage = String(object.goPackage); - if (object.ccGenericServices != null) - message.ccGenericServices = Boolean(object.ccGenericServices); - if (object.javaGenericServices != null) - message.javaGenericServices = Boolean(object.javaGenericServices); - if (object.pyGenericServices != null) - message.pyGenericServices = Boolean(object.pyGenericServices); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.ccEnableArenas != null) - message.ccEnableArenas = Boolean(object.ccEnableArenas); - if (object.objcClassPrefix != null) - message.objcClassPrefix = String(object.objcClassPrefix); - if (object.csharpNamespace != null) - message.csharpNamespace = String(object.csharpNamespace); - if (object.swiftPrefix != null) - message.swiftPrefix = String(object.swiftPrefix); - if (object.phpClassPrefix != null) - message.phpClassPrefix = String(object.phpClassPrefix); - if (object.phpNamespace != null) - message.phpNamespace = String(object.phpNamespace); - if (object.phpMetadataNamespace != null) - message.phpMetadataNamespace = String(object.phpMetadataNamespace); - if (object.rubyPackage != null) - message.rubyPackage = String(object.rubyPackage); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FileOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.resourceDefinition"]) { - if (!Array.isArray(object[".google.api.resourceDefinition"])) - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); - message[".google.api.resourceDefinition"] = []; - for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { - if (typeof object[".google.api.resourceDefinition"][i] !== "object") - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); - message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.FileOptions} message FileOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.resourceDefinition"] = []; - } - if (options.defaults) { - object.javaPackage = ""; - object.javaOuterClassname = ""; - object.optimizeFor = options.enums === String ? "SPEED" : 1; - object.javaMultipleFiles = false; - object.goPackage = ""; - object.ccGenericServices = false; - object.javaGenericServices = false; - object.pyGenericServices = false; - object.javaGenerateEqualsAndHash = false; - object.deprecated = false; - object.javaStringCheckUtf8 = false; - object.ccEnableArenas = true; - object.objcClassPrefix = ""; - object.csharpNamespace = ""; - object.swiftPrefix = ""; - object.phpClassPrefix = ""; - object.phpNamespace = ""; - object.phpMetadataNamespace = ""; - object.rubyPackage = ""; - object.features = null; - } - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - object.javaPackage = message.javaPackage; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - object.javaOuterClassname = message.javaOuterClassname; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - object.javaMultipleFiles = message.javaMultipleFiles; - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - object.goPackage = message.goPackage; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - object.ccGenericServices = message.ccGenericServices; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - object.javaGenericServices = message.javaGenericServices; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - object.pyGenericServices = message.pyGenericServices; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - object.javaStringCheckUtf8 = message.javaStringCheckUtf8; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - object.ccEnableArenas = message.ccEnableArenas; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - object.objcClassPrefix = message.objcClassPrefix; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - object.csharpNamespace = message.csharpNamespace; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - object.swiftPrefix = message.swiftPrefix; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - object.phpClassPrefix = message.phpClassPrefix; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - object.phpNamespace = message.phpNamespace; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - object.phpMetadataNamespace = message.phpMetadataNamespace; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - object.rubyPackage = message.rubyPackage; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { - object[".google.api.resourceDefinition"] = []; - for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) - object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); - } - return object; - }; - - /** - * Converts this FileOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FileOptions - * @instance - * @returns {Object.} JSON object - */ - FileOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileOptions - * @function getTypeUrl - * @memberof google.protobuf.FileOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileOptions"; - }; - - /** - * OptimizeMode enum. - * @name google.protobuf.FileOptions.OptimizeMode - * @enum {number} - * @property {number} SPEED=1 SPEED value - * @property {number} CODE_SIZE=2 CODE_SIZE value - * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value - */ - FileOptions.OptimizeMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "SPEED"] = 1; - values[valuesById[2] = "CODE_SIZE"] = 2; - values[valuesById[3] = "LITE_RUNTIME"] = 3; - return values; - })(); - - return FileOptions; - })(); - - protobuf.MessageOptions = (function() { - - /** - * Properties of a MessageOptions. - * @memberof google.protobuf - * @interface IMessageOptions - * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat - * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor - * @property {boolean|null} [deprecated] MessageOptions deprecated - * @property {boolean|null} [mapEntry] MessageOptions mapEntry - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features - * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption - * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource - */ - - /** - * Constructs a new MessageOptions. - * @memberof google.protobuf - * @classdesc Represents a MessageOptions. - * @implements IMessageOptions - * @constructor - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - */ - function MessageOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MessageOptions messageSetWireFormat. - * @member {boolean} messageSetWireFormat - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.messageSetWireFormat = false; - - /** - * MessageOptions noStandardDescriptorAccessor. - * @member {boolean} noStandardDescriptorAccessor - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.noStandardDescriptorAccessor = false; - - /** - * MessageOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecated = false; - - /** - * MessageOptions mapEntry. - * @member {boolean} mapEntry - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.mapEntry = false; - - /** - * MessageOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * MessageOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.features = null; - - /** - * MessageOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * MessageOptions .google.api.resource. - * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".google.api.resource"] = null; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - * @returns {google.protobuf.MessageOptions} MessageOptions instance - */ - MessageOptions.create = function create(properties) { - return new MessageOptions(properties); - }; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); - if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.messageSetWireFormat = reader.bool(); - break; - } - case 2: { - message.noStandardDescriptorAccessor = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 7: { - message.mapEntry = reader.bool(); - break; - } - case 11: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 12: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1053: { - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MessageOptions message. - * @function verify - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MessageOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - if (typeof message.messageSetWireFormat !== "boolean") - return "messageSetWireFormat: boolean expected"; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - if (typeof message.noStandardDescriptorAccessor !== "boolean") - return "noStandardDescriptorAccessor: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - if (typeof message.mapEntry !== "boolean") - return "mapEntry: boolean expected"; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); - if (error) - return ".google.api.resource." + error; - } - return null; - }; - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MessageOptions} MessageOptions - */ - MessageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MessageOptions) - return object; - var message = new $root.google.protobuf.MessageOptions(); - if (object.messageSetWireFormat != null) - message.messageSetWireFormat = Boolean(object.messageSetWireFormat); - if (object.noStandardDescriptorAccessor != null) - message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.mapEntry != null) - message.mapEntry = Boolean(object.mapEntry); - if (object.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MessageOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.resource"] != null) { - if (typeof object[".google.api.resource"] !== "object") - throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); - } - return message; - }; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.MessageOptions} message MessageOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MessageOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.messageSetWireFormat = false; - object.noStandardDescriptorAccessor = false; - object.deprecated = false; - object.mapEntry = false; - object.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - object[".google.api.resource"] = null; - } - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - object.messageSetWireFormat = message.messageSetWireFormat; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - object.mapEntry = message.mapEntry; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) - object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); - return object; - }; - - /** - * Converts this MessageOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MessageOptions - * @instance - * @returns {Object.} JSON object - */ - MessageOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MessageOptions - * @function getTypeUrl - * @memberof google.protobuf.MessageOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MessageOptions"; - }; - - return MessageOptions; - })(); - - protobuf.FieldOptions = (function() { - - /** - * Properties of a FieldOptions. - * @memberof google.protobuf - * @interface IFieldOptions - * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype - * @property {boolean|null} [packed] FieldOptions packed - * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype - * @property {boolean|null} [lazy] FieldOptions lazy - * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy - * @property {boolean|null} [deprecated] FieldOptions deprecated - * @property {boolean|null} [weak] FieldOptions weak - * @property {boolean|null} [debugRedact] FieldOptions debugRedact - * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention - * @property {Array.|null} [targets] FieldOptions targets - * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults - * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features - * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption - * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior - * @property {google.api.IFieldInfo|null} [".google.api.fieldInfo"] FieldOptions .google.api.fieldInfo - * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference - */ - - /** - * Constructs a new FieldOptions. - * @memberof google.protobuf - * @classdesc Represents a FieldOptions. - * @implements IFieldOptions - * @constructor - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - */ - function FieldOptions(properties) { - this.targets = []; - this.editionDefaults = []; - this.uninterpretedOption = []; - this[".google.api.fieldBehavior"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldOptions ctype. - * @member {google.protobuf.FieldOptions.CType} ctype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.ctype = 0; - - /** - * FieldOptions packed. - * @member {boolean} packed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.packed = false; - - /** - * FieldOptions jstype. - * @member {google.protobuf.FieldOptions.JSType} jstype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.jstype = 0; - - /** - * FieldOptions lazy. - * @member {boolean} lazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.lazy = false; - - /** - * FieldOptions unverifiedLazy. - * @member {boolean} unverifiedLazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.unverifiedLazy = false; - - /** - * FieldOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.deprecated = false; - - /** - * FieldOptions weak. - * @member {boolean} weak - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.weak = false; - - /** - * FieldOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.debugRedact = false; - - /** - * FieldOptions retention. - * @member {google.protobuf.FieldOptions.OptionRetention} retention - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.retention = 0; - - /** - * FieldOptions targets. - * @member {Array.} targets - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.targets = $util.emptyArray; - - /** - * FieldOptions editionDefaults. - * @member {Array.} editionDefaults - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.editionDefaults = $util.emptyArray; - - /** - * FieldOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.features = null; - - /** - * FieldOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FieldOptions .google.api.fieldBehavior. - * @member {Array.} .google.api.fieldBehavior - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; - - /** - * FieldOptions .google.api.fieldInfo. - * @member {google.api.IFieldInfo|null|undefined} .google.api.fieldInfo - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.fieldInfo"] = null; - - /** - * FieldOptions .google.api.resourceReference. - * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.resourceReference"] = null; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions} FieldOptions instance - */ - FieldOptions.create = function create(properties) { - return new FieldOptions(properties); - }; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); - if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) - writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); - if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) - writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); - if (message.targets != null && message.targets.length) - for (var i = 0; i < message.targets.length; ++i) - writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); - if (message.editionDefaults != null && message.editionDefaults.length) - for (var i = 0; i < message.editionDefaults.length; ++i) - $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); - if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) - $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); - if (message[".google.api.fieldInfo"] != null && Object.hasOwnProperty.call(message, ".google.api.fieldInfo")) - $root.google.api.FieldInfo.encode(message[".google.api.fieldInfo"], writer.uint32(/* id 291403980, wireType 2 =*/2331231842).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.ctype = reader.int32(); - break; - } - case 2: { - message.packed = reader.bool(); - break; - } - case 6: { - message.jstype = reader.int32(); - break; - } - case 5: { - message.lazy = reader.bool(); - break; - } - case 15: { - message.unverifiedLazy = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 10: { - message.weak = reader.bool(); - break; - } - case 16: { - message.debugRedact = reader.bool(); - break; - } - case 17: { - message.retention = reader.int32(); - break; - } - case 19: { - if (!(message.targets && message.targets.length)) - message.targets = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.targets.push(reader.int32()); - } else - message.targets.push(reader.int32()); - break; - } - case 20: { - if (!(message.editionDefaults && message.editionDefaults.length)) - message.editionDefaults = []; - message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); - break; - } - case 21: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1052: { - if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) - message[".google.api.fieldBehavior"] = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message[".google.api.fieldBehavior"].push(reader.int32()); - } else - message[".google.api.fieldBehavior"].push(reader.int32()); - break; - } - case 291403980: { - message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.decode(reader, reader.uint32()); - break; - } - case 1055: { - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldOptions message. - * @function verify - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ctype != null && message.hasOwnProperty("ctype")) - switch (message.ctype) { - default: - return "ctype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.packed != null && message.hasOwnProperty("packed")) - if (typeof message.packed !== "boolean") - return "packed: boolean expected"; - if (message.jstype != null && message.hasOwnProperty("jstype")) - switch (message.jstype) { - default: - return "jstype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.lazy != null && message.hasOwnProperty("lazy")) - if (typeof message.lazy !== "boolean") - return "lazy: boolean expected"; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - if (typeof message.unverifiedLazy !== "boolean") - return "unverifiedLazy: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.weak != null && message.hasOwnProperty("weak")) - if (typeof message.weak !== "boolean") - return "weak: boolean expected"; - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: boolean expected"; - if (message.retention != null && message.hasOwnProperty("retention")) - switch (message.retention) { - default: - return "retention: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.targets != null && message.hasOwnProperty("targets")) { - if (!Array.isArray(message.targets)) - return "targets: array expected"; - for (var i = 0; i < message.targets.length; ++i) - switch (message.targets[i]) { - default: - return "targets: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } - } - if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { - if (!Array.isArray(message.editionDefaults)) - return "editionDefaults: array expected"; - for (var i = 0; i < message.editionDefaults.length; ++i) { - var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); - if (error) - return "editionDefaults." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { - if (!Array.isArray(message[".google.api.fieldBehavior"])) - return ".google.api.fieldBehavior: array expected"; - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - switch (message[".google.api.fieldBehavior"][i]) { - default: - return ".google.api.fieldBehavior: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - } - if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) { - var error = $root.google.api.FieldInfo.verify(message[".google.api.fieldInfo"]); - if (error) - return ".google.api.fieldInfo." + error; - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { - var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); - if (error) - return ".google.api.resourceReference." + error; - } - return null; - }; - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions} FieldOptions - */ - FieldOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions) - return object; - var message = new $root.google.protobuf.FieldOptions(); - switch (object.ctype) { - default: - if (typeof object.ctype === "number") { - message.ctype = object.ctype; - break; - } - break; - case "STRING": - case 0: - message.ctype = 0; - break; - case "CORD": - case 1: - message.ctype = 1; - break; - case "STRING_PIECE": - case 2: - message.ctype = 2; - break; - } - if (object.packed != null) - message.packed = Boolean(object.packed); - switch (object.jstype) { - default: - if (typeof object.jstype === "number") { - message.jstype = object.jstype; - break; - } - break; - case "JS_NORMAL": - case 0: - message.jstype = 0; - break; - case "JS_STRING": - case 1: - message.jstype = 1; - break; - case "JS_NUMBER": - case 2: - message.jstype = 2; - break; - } - if (object.lazy != null) - message.lazy = Boolean(object.lazy); - if (object.unverifiedLazy != null) - message.unverifiedLazy = Boolean(object.unverifiedLazy); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.weak != null) - message.weak = Boolean(object.weak); - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - switch (object.retention) { - default: - if (typeof object.retention === "number") { - message.retention = object.retention; - break; - } - break; - case "RETENTION_UNKNOWN": - case 0: - message.retention = 0; - break; - case "RETENTION_RUNTIME": - case 1: - message.retention = 1; - break; - case "RETENTION_SOURCE": - case 2: - message.retention = 2; - break; - } - if (object.targets) { - if (!Array.isArray(object.targets)) - throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); - message.targets = []; - for (var i = 0; i < object.targets.length; ++i) - switch (object.targets[i]) { - default: - if (typeof object.targets[i] === "number") { - message.targets[i] = object.targets[i]; - break; - } - case "TARGET_TYPE_UNKNOWN": - case 0: - message.targets[i] = 0; - break; - case "TARGET_TYPE_FILE": - case 1: - message.targets[i] = 1; - break; - case "TARGET_TYPE_EXTENSION_RANGE": - case 2: - message.targets[i] = 2; - break; - case "TARGET_TYPE_MESSAGE": - case 3: - message.targets[i] = 3; - break; - case "TARGET_TYPE_FIELD": - case 4: - message.targets[i] = 4; - break; - case "TARGET_TYPE_ONEOF": - case 5: - message.targets[i] = 5; - break; - case "TARGET_TYPE_ENUM": - case 6: - message.targets[i] = 6; - break; - case "TARGET_TYPE_ENUM_ENTRY": - case 7: - message.targets[i] = 7; - break; - case "TARGET_TYPE_SERVICE": - case 8: - message.targets[i] = 8; - break; - case "TARGET_TYPE_METHOD": - case 9: - message.targets[i] = 9; - break; - } - } - if (object.editionDefaults) { - if (!Array.isArray(object.editionDefaults)) - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); - message.editionDefaults = []; - for (var i = 0; i < object.editionDefaults.length; ++i) { - if (typeof object.editionDefaults[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); - message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FieldOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.fieldBehavior"]) { - if (!Array.isArray(object[".google.api.fieldBehavior"])) - throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); - message[".google.api.fieldBehavior"] = []; - for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) - switch (object[".google.api.fieldBehavior"][i]) { - default: - if (typeof object[".google.api.fieldBehavior"][i] === "number") { - message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; - break; - } - case "FIELD_BEHAVIOR_UNSPECIFIED": - case 0: - message[".google.api.fieldBehavior"][i] = 0; - break; - case "OPTIONAL": - case 1: - message[".google.api.fieldBehavior"][i] = 1; - break; - case "REQUIRED": - case 2: - message[".google.api.fieldBehavior"][i] = 2; - break; - case "OUTPUT_ONLY": - case 3: - message[".google.api.fieldBehavior"][i] = 3; - break; - case "INPUT_ONLY": - case 4: - message[".google.api.fieldBehavior"][i] = 4; - break; - case "IMMUTABLE": - case 5: - message[".google.api.fieldBehavior"][i] = 5; - break; - case "UNORDERED_LIST": - case 6: - message[".google.api.fieldBehavior"][i] = 6; - break; - case "NON_EMPTY_DEFAULT": - case 7: - message[".google.api.fieldBehavior"][i] = 7; - break; - case "IDENTIFIER": - case 8: - message[".google.api.fieldBehavior"][i] = 8; - break; - } - } - if (object[".google.api.fieldInfo"] != null) { - if (typeof object[".google.api.fieldInfo"] !== "object") - throw TypeError(".google.protobuf.FieldOptions..google.api.fieldInfo: object expected"); - message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.fromObject(object[".google.api.fieldInfo"]); - } - if (object[".google.api.resourceReference"] != null) { - if (typeof object[".google.api.resourceReference"] !== "object") - throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); - } - return message; - }; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.FieldOptions} message FieldOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.targets = []; - object.editionDefaults = []; - object.uninterpretedOption = []; - object[".google.api.fieldBehavior"] = []; - } - if (options.defaults) { - object.ctype = options.enums === String ? "STRING" : 0; - object.packed = false; - object.deprecated = false; - object.lazy = false; - object.jstype = options.enums === String ? "JS_NORMAL" : 0; - object.weak = false; - object.unverifiedLazy = false; - object.debugRedact = false; - object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; - object.features = null; - object[".google.api.resourceReference"] = null; - object[".google.api.fieldInfo"] = null; - } - if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; - if (message.packed != null && message.hasOwnProperty("packed")) - object.packed = message.packed; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.lazy != null && message.hasOwnProperty("lazy")) - object.lazy = message.lazy; - if (message.jstype != null && message.hasOwnProperty("jstype")) - object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; - if (message.weak != null && message.hasOwnProperty("weak")) - object.weak = message.weak; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - object.unverifiedLazy = message.unverifiedLazy; - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - if (message.retention != null && message.hasOwnProperty("retention")) - object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; - if (message.targets && message.targets.length) { - object.targets = []; - for (var j = 0; j < message.targets.length; ++j) - object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; - } - if (message.editionDefaults && message.editionDefaults.length) { - object.editionDefaults = []; - for (var j = 0; j < message.editionDefaults.length; ++j) - object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); - } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { - object[".google.api.fieldBehavior"] = []; - for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) - object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) - object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); - if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) - object[".google.api.fieldInfo"] = $root.google.api.FieldInfo.toObject(message[".google.api.fieldInfo"], options); - return object; - }; - - /** - * Converts this FieldOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions - * @instance - * @returns {Object.} JSON object - */ - FieldOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldOptions - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions"; - }; - - /** - * CType enum. - * @name google.protobuf.FieldOptions.CType - * @enum {number} - * @property {number} STRING=0 STRING value - * @property {number} CORD=1 CORD value - * @property {number} STRING_PIECE=2 STRING_PIECE value - */ - FieldOptions.CType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STRING"] = 0; - values[valuesById[1] = "CORD"] = 1; - values[valuesById[2] = "STRING_PIECE"] = 2; - return values; - })(); - - /** - * JSType enum. - * @name google.protobuf.FieldOptions.JSType - * @enum {number} - * @property {number} JS_NORMAL=0 JS_NORMAL value - * @property {number} JS_STRING=1 JS_STRING value - * @property {number} JS_NUMBER=2 JS_NUMBER value - */ - FieldOptions.JSType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JS_NORMAL"] = 0; - values[valuesById[1] = "JS_STRING"] = 1; - values[valuesById[2] = "JS_NUMBER"] = 2; - return values; - })(); - - /** - * OptionRetention enum. - * @name google.protobuf.FieldOptions.OptionRetention - * @enum {number} - * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value - * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value - * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value - */ - FieldOptions.OptionRetention = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; - values[valuesById[1] = "RETENTION_RUNTIME"] = 1; - values[valuesById[2] = "RETENTION_SOURCE"] = 2; - return values; - })(); - - /** - * OptionTargetType enum. - * @name google.protobuf.FieldOptions.OptionTargetType - * @enum {number} - * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value - * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value - * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value - * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value - * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value - * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value - * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value - * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value - * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value - * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value - */ - FieldOptions.OptionTargetType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; - values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; - values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; - values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; - values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; - values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; - values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; - values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; - values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; - return values; - })(); - - FieldOptions.EditionDefault = (function() { - - /** - * Properties of an EditionDefault. - * @memberof google.protobuf.FieldOptions - * @interface IEditionDefault - * @property {google.protobuf.Edition|null} [edition] EditionDefault edition - * @property {string|null} [value] EditionDefault value - */ - - /** - * Constructs a new EditionDefault. - * @memberof google.protobuf.FieldOptions - * @classdesc Represents an EditionDefault. - * @implements IEditionDefault - * @constructor - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - */ - function EditionDefault(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.edition = 0; - - /** - * EditionDefault value. - * @member {string} value - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.value = ""; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance - */ - EditionDefault.create = function create(properties) { - return new EditionDefault(properties); - }; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.value = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EditionDefault message. - * @function verify - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - */ - EditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) - return object; - var message = new $root.google.protobuf.FieldOptions.EditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.value = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this EditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - * @returns {Object.} JSON object - */ - EditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; - }; - - return EditionDefault; - })(); - - return FieldOptions; - })(); - - protobuf.OneofOptions = (function() { - - /** - * Properties of an OneofOptions. - * @memberof google.protobuf - * @interface IOneofOptions - * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features - * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption - */ - - /** - * Constructs a new OneofOptions. - * @memberof google.protobuf - * @classdesc Represents an OneofOptions. - * @implements IOneofOptions - * @constructor - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - */ - function OneofOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.features = null; - - /** - * OneofOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - * @returns {google.protobuf.OneofOptions} OneofOptions instance - */ - OneofOptions.create = function create(properties) { - return new OneofOptions(properties); - }; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofOptions message. - * @function verify - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofOptions} OneofOptions - */ - OneofOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofOptions) - return object; - var message = new $root.google.protobuf.OneofOptions(); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.OneofOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.OneofOptions} message OneofOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) - object.features = null; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this OneofOptions to JSON. - * @function toJSON - * @memberof google.protobuf.OneofOptions - * @instance - * @returns {Object.} JSON object - */ - OneofOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofOptions - * @function getTypeUrl - * @memberof google.protobuf.OneofOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofOptions"; - }; - - return OneofOptions; - })(); - - protobuf.EnumOptions = (function() { - - /** - * Properties of an EnumOptions. - * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allowAlias] EnumOptions allowAlias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features - * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption - */ - - /** - * Constructs a new EnumOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumOptions. - * @implements IEnumOptions - * @constructor - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - */ - function EnumOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumOptions allowAlias. - * @member {boolean} allowAlias - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.allowAlias = false; - - /** - * EnumOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecated = false; - - /** - * EnumOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * EnumOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.features = null; - - /** - * EnumOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumOptions} EnumOptions instance - */ - EnumOptions.create = function create(properties) { - return new EnumOptions(properties); - }; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - message.allowAlias = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 6: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 7: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumOptions message. - * @function verify - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - if (typeof message.allowAlias !== "boolean") - return "allowAlias: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumOptions} EnumOptions - */ - EnumOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumOptions) - return object; - var message = new $root.google.protobuf.EnumOptions(); - if (object.allowAlias != null) - message.allowAlias = Boolean(object.allowAlias); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.EnumOptions} message EnumOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.allowAlias = false; - object.deprecated = false; - object.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - } - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - object.allowAlias = message.allowAlias; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumOptions - * @instance - * @returns {Object.} JSON object - */ - EnumOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumOptions"; - }; - - return EnumOptions; - })(); - - protobuf.EnumValueOptions = (function() { - - /** - * Properties of an EnumValueOptions. - * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features - * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact - * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption - */ - - /** - * Constructs a new EnumValueOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumValueOptions. - * @implements IEnumValueOptions - * @constructor - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - */ - function EnumValueOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.deprecated = false; - - /** - * EnumValueOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.features = null; - - /** - * EnumValueOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.debugRedact = false; - - /** - * EnumValueOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance - */ - EnumValueOptions.create = function create(properties) { - return new EnumValueOptions(properties); - }; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.deprecated = reader.bool(); - break; - } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.debugRedact = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueOptions message. - * @function verify - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - */ - EnumValueOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueOptions) - return object; - var message = new $root.google.protobuf.EnumValueOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.EnumValueOptions} message EnumValueOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object.features = null; - object.debugRedact = false; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumValueOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueOptions - * @instance - * @returns {Object.} JSON object - */ - EnumValueOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; - }; - - return EnumValueOptions; - })(); - - protobuf.ServiceOptions = (function() { - - /** - * Properties of a ServiceOptions. - * @memberof google.protobuf - * @interface IServiceOptions - * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features - * @property {boolean|null} [deprecated] ServiceOptions deprecated - * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption - * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost - * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes - * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion - */ - - /** - * Constructs a new ServiceOptions. - * @memberof google.protobuf - * @classdesc Represents a ServiceOptions. - * @implements IServiceOptions - * @constructor - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - */ - function ServiceOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.features = null; - - /** - * ServiceOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.deprecated = false; - - /** - * ServiceOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ServiceOptions .google.api.defaultHost. - * @member {string} .google.api.defaultHost - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.defaultHost"] = ""; - - /** - * ServiceOptions .google.api.oauthScopes. - * @member {string} .google.api.oauthScopes - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.oauthScopes"] = ""; - - /** - * ServiceOptions .google.api.apiVersion. - * @member {string} .google.api.apiVersion - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.apiVersion"] = ""; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - * @returns {google.protobuf.ServiceOptions} ServiceOptions instance - */ - ServiceOptions.create = function create(properties) { - return new ServiceOptions(properties); - }; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) - writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); - if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) - writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); - if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) - writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); - return writer; - }; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 34: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 33: { - message.deprecated = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1049: { - message[".google.api.defaultHost"] = reader.string(); - break; - } - case 1050: { - message[".google.api.oauthScopes"] = reader.string(); - break; - } - case 525000001: { - message[".google.api.apiVersion"] = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceOptions message. - * @function verify - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - if (!$util.isString(message[".google.api.defaultHost"])) - return ".google.api.defaultHost: string expected"; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - if (!$util.isString(message[".google.api.oauthScopes"])) - return ".google.api.oauthScopes: string expected"; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - if (!$util.isString(message[".google.api.apiVersion"])) - return ".google.api.apiVersion: string expected"; - return null; - }; - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceOptions} ServiceOptions - */ - ServiceOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceOptions) - return object; - var message = new $root.google.protobuf.ServiceOptions(); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.defaultHost"] != null) - message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); - if (object[".google.api.oauthScopes"] != null) - message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); - if (object[".google.api.apiVersion"] != null) - message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); - return message; - }; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.ServiceOptions} message ServiceOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object.features = null; - object[".google.api.defaultHost"] = ""; - object[".google.api.oauthScopes"] = ""; - object[".google.api.apiVersion"] = ""; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; - return object; - }; - - /** - * Converts this ServiceOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceOptions - * @instance - * @returns {Object.} JSON object - */ - ServiceOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceOptions - * @function getTypeUrl - * @memberof google.protobuf.ServiceOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceOptions"; - }; - - return ServiceOptions; - })(); - - protobuf.MethodOptions = (function() { - - /** - * Properties of a MethodOptions. - * @memberof google.protobuf - * @interface IMethodOptions - * @property {boolean|null} [deprecated] MethodOptions deprecated - * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel - * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features - * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption - * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http - * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature - * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo - */ - - /** - * Constructs a new MethodOptions. - * @memberof google.protobuf - * @classdesc Represents a MethodOptions. - * @implements IMethodOptions - * @constructor - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - */ - function MethodOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.methodSignature"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.deprecated = false; - - /** - * MethodOptions idempotencyLevel. - * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.idempotencyLevel = 0; - - /** - * MethodOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.features = null; - - /** - * MethodOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * MethodOptions .google.api.http. - * @member {google.api.IHttpRule|null|undefined} .google.api.http - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.http"] = null; - - /** - * MethodOptions .google.api.methodSignature. - * @member {Array.} .google.api.methodSignature - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; - - /** - * MethodOptions .google.longrunning.operationInfo. - * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.longrunning.operationInfo"] = null; - - /** - * Creates a new MethodOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - * @returns {google.protobuf.MethodOptions} MethodOptions instance - */ - MethodOptions.create = function create(properties) { - return new MethodOptions(properties); - }; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) - writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) - $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); - if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); - if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) - $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 33: { - message.deprecated = reader.bool(); - break; - } - case 34: { - message.idempotencyLevel = reader.int32(); - break; - } - case 35: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 72295728: { - message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); - break; - } - case 1051: { - if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) - message[".google.api.methodSignature"] = []; - message[".google.api.methodSignature"].push(reader.string()); - break; - } - case 1049: { - message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodOptions message. - * @function verify - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - switch (message.idempotencyLevel) { - default: - return "idempotencyLevel: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { - var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); - if (error) - return ".google.api.http." + error; - } - if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { - if (!Array.isArray(message[".google.api.methodSignature"])) - return ".google.api.methodSignature: array expected"; - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - if (!$util.isString(message[".google.api.methodSignature"][i])) - return ".google.api.methodSignature: string[] expected"; - } - if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { - var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); - if (error) - return ".google.longrunning.operationInfo." + error; - } - return null; - }; - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodOptions} MethodOptions - */ - MethodOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodOptions) - return object; - var message = new $root.google.protobuf.MethodOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - switch (object.idempotencyLevel) { - default: - if (typeof object.idempotencyLevel === "number") { - message.idempotencyLevel = object.idempotencyLevel; - break; - } - break; - case "IDEMPOTENCY_UNKNOWN": - case 0: - message.idempotencyLevel = 0; - break; - case "NO_SIDE_EFFECTS": - case 1: - message.idempotencyLevel = 1; - break; - case "IDEMPOTENT": - case 2: - message.idempotencyLevel = 2; - break; - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MethodOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.http"] != null) { - if (typeof object[".google.api.http"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); - message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); - } - if (object[".google.api.methodSignature"]) { - if (!Array.isArray(object[".google.api.methodSignature"])) - throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); - message[".google.api.methodSignature"] = []; - for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) - message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); - } - if (object[".google.longrunning.operationInfo"] != null) { - if (typeof object[".google.longrunning.operationInfo"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); - message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); - } - return message; - }; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.MethodOptions} message MethodOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.methodSignature"] = []; - } - if (options.defaults) { - object.deprecated = false; - object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; - object.features = null; - object[".google.longrunning.operationInfo"] = null; - object[".google.api.http"] = null; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) - object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); - if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { - object[".google.api.methodSignature"] = []; - for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) - object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) - object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); - return object; - }; - - /** - * Converts this MethodOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MethodOptions - * @instance - * @returns {Object.} JSON object - */ - MethodOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodOptions - * @function getTypeUrl - * @memberof google.protobuf.MethodOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodOptions"; - }; - - /** - * IdempotencyLevel enum. - * @name google.protobuf.MethodOptions.IdempotencyLevel - * @enum {number} - * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value - * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value - * @property {number} IDEMPOTENT=2 IDEMPOTENT value - */ - MethodOptions.IdempotencyLevel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; - values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; - values[valuesById[2] = "IDEMPOTENT"] = 2; - return values; - })(); - - return MethodOptions; - })(); - - protobuf.UninterpretedOption = (function() { - - /** - * Properties of an UninterpretedOption. - * @memberof google.protobuf - * @interface IUninterpretedOption - * @property {Array.|null} [name] UninterpretedOption name - * @property {string|null} [identifierValue] UninterpretedOption identifierValue - * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue - * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue - * @property {number|null} [doubleValue] UninterpretedOption doubleValue - * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue - * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue - */ - - /** - * Constructs a new UninterpretedOption. - * @memberof google.protobuf - * @classdesc Represents an UninterpretedOption. - * @implements IUninterpretedOption - * @constructor - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - */ - function UninterpretedOption(properties) { - this.name = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UninterpretedOption name. - * @member {Array.} name - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.name = $util.emptyArray; - - /** - * UninterpretedOption identifierValue. - * @member {string} identifierValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.identifierValue = ""; - - /** - * UninterpretedOption positiveIntValue. - * @member {number|Long} positiveIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * UninterpretedOption negativeIntValue. - * @member {number|Long} negativeIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * UninterpretedOption doubleValue. - * @member {number} doubleValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.doubleValue = 0; - - /** - * UninterpretedOption stringValue. - * @member {Uint8Array} stringValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.stringValue = $util.newBuffer([]); - - /** - * UninterpretedOption aggregateValue. - * @member {string} aggregateValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.aggregateValue = ""; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance - */ - UninterpretedOption.create = function create(properties) { - return new UninterpretedOption(properties); - }; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.name.length) - for (var i = 0; i < message.name.length; ++i) - $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); - if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); - if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); - if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) - writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); - if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); - return writer; - }; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - if (!(message.name && message.name.length)) - message.name = []; - message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); - break; - } - case 3: { - message.identifierValue = reader.string(); - break; - } - case 4: { - message.positiveIntValue = reader.uint64(); - break; - } - case 5: { - message.negativeIntValue = reader.int64(); - break; - } - case 6: { - message.doubleValue = reader.double(); - break; - } - case 7: { - message.stringValue = reader.bytes(); - break; - } - case 8: { - message.aggregateValue = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UninterpretedOption message. - * @function verify - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UninterpretedOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) { - if (!Array.isArray(message.name)) - return "name: array expected"; - for (var i = 0; i < message.name.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); - if (error) - return "name." + error; - } - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - if (!$util.isString(message.identifierValue)) - return "identifierValue: string expected"; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) - return "positiveIntValue: integer|Long expected"; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) - return "negativeIntValue: integer|Long expected"; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - if (typeof message.doubleValue !== "number") - return "doubleValue: number expected"; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) - return "stringValue: buffer expected"; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - if (!$util.isString(message.aggregateValue)) - return "aggregateValue: string expected"; - return null; - }; - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - */ - UninterpretedOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption) - return object; - var message = new $root.google.protobuf.UninterpretedOption(); - if (object.name) { - if (!Array.isArray(object.name)) - throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); - message.name = []; - for (var i = 0; i < object.name.length; ++i) { - if (typeof object.name[i] !== "object") - throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); - message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); - } - } - if (object.identifierValue != null) - message.identifierValue = String(object.identifierValue); - if (object.positiveIntValue != null) - if ($util.Long) - (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; - else if (typeof object.positiveIntValue === "string") - message.positiveIntValue = parseInt(object.positiveIntValue, 10); - else if (typeof object.positiveIntValue === "number") - message.positiveIntValue = object.positiveIntValue; - else if (typeof object.positiveIntValue === "object") - message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); - if (object.negativeIntValue != null) - if ($util.Long) - (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; - else if (typeof object.negativeIntValue === "string") - message.negativeIntValue = parseInt(object.negativeIntValue, 10); - else if (typeof object.negativeIntValue === "number") - message.negativeIntValue = object.negativeIntValue; - else if (typeof object.negativeIntValue === "object") - message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); - if (object.doubleValue != null) - message.doubleValue = Number(object.doubleValue); - if (object.stringValue != null) - if (typeof object.stringValue === "string") - $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); - else if (object.stringValue.length >= 0) - message.stringValue = object.stringValue; - if (object.aggregateValue != null) - message.aggregateValue = String(object.aggregateValue); - return message; - }; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.UninterpretedOption} message UninterpretedOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UninterpretedOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.name = []; - if (options.defaults) { - object.identifierValue = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.positiveIntValue = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.negativeIntValue = options.longs === String ? "0" : 0; - object.doubleValue = 0; - if (options.bytes === String) - object.stringValue = ""; - else { - object.stringValue = []; - if (options.bytes !== Array) - object.stringValue = $util.newBuffer(object.stringValue); - } - object.aggregateValue = ""; - } - if (message.name && message.name.length) { - object.name = []; - for (var j = 0; j < message.name.length; ++j) - object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - object.identifierValue = message.identifierValue; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (typeof message.positiveIntValue === "number") - object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; - else - object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (typeof message.negativeIntValue === "number") - object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; - else - object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - object.aggregateValue = message.aggregateValue; - return object; - }; - - /** - * Converts this UninterpretedOption to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption - * @instance - * @returns {Object.} JSON object - */ - UninterpretedOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UninterpretedOption - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; - }; - - UninterpretedOption.NamePart = (function() { - - /** - * Properties of a NamePart. - * @memberof google.protobuf.UninterpretedOption - * @interface INamePart - * @property {string} namePart NamePart namePart - * @property {boolean} isExtension NamePart isExtension - */ - - /** - * Constructs a new NamePart. - * @memberof google.protobuf.UninterpretedOption - * @classdesc Represents a NamePart. - * @implements INamePart - * @constructor - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - */ - function NamePart(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NamePart namePart. - * @member {string} namePart - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.namePart = ""; - - /** - * NamePart isExtension. - * @member {boolean} isExtension - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.isExtension = false; - - /** - * Creates a new NamePart instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance - */ - NamePart.create = function create(properties) { - return new NamePart(properties); - }; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); - return writer; - }; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.namePart = reader.string(); - break; - } - case 2: { - message.isExtension = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - if (!message.hasOwnProperty("namePart")) - throw $util.ProtocolError("missing required 'namePart'", { instance: message }); - if (!message.hasOwnProperty("isExtension")) - throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); - return message; - }; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NamePart message. - * @function verify - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NamePart.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (!$util.isString(message.namePart)) - return "namePart: string expected"; - if (typeof message.isExtension !== "boolean") - return "isExtension: boolean expected"; - return null; - }; - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - */ - NamePart.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) - return object; - var message = new $root.google.protobuf.UninterpretedOption.NamePart(); - if (object.namePart != null) - message.namePart = String(object.namePart); - if (object.isExtension != null) - message.isExtension = Boolean(object.isExtension); - return message; - }; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NamePart.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.namePart = ""; - object.isExtension = false; - } - if (message.namePart != null && message.hasOwnProperty("namePart")) - object.namePart = message.namePart; - if (message.isExtension != null && message.hasOwnProperty("isExtension")) - object.isExtension = message.isExtension; - return object; - }; - - /** - * Converts this NamePart to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - * @returns {Object.} JSON object - */ - NamePart.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NamePart - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; - }; - - return NamePart; - })(); - - return UninterpretedOption; - })(); - - protobuf.FeatureSet = (function() { - - /** - * Properties of a FeatureSet. - * @memberof google.protobuf - * @interface IFeatureSet - * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence - * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType - * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding - * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation - * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding - * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat - */ - - /** - * Constructs a new FeatureSet. - * @memberof google.protobuf - * @classdesc Represents a FeatureSet. - * @implements IFeatureSet - * @constructor - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - */ - function FeatureSet(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSet fieldPresence. - * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.fieldPresence = 0; - - /** - * FeatureSet enumType. - * @member {google.protobuf.FeatureSet.EnumType} enumType - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.enumType = 0; - - /** - * FeatureSet repeatedFieldEncoding. - * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.repeatedFieldEncoding = 0; - - /** - * FeatureSet utf8Validation. - * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.utf8Validation = 0; - - /** - * FeatureSet messageEncoding. - * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.messageEncoding = 0; - - /** - * FeatureSet jsonFormat. - * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.jsonFormat = 0; - - /** - * Creates a new FeatureSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - * @returns {google.protobuf.FeatureSet} FeatureSet instance - */ - FeatureSet.create = function create(properties) { - return new FeatureSet(properties); - }; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); - if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); - if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); - if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); - if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); - if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); - return writer; - }; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.fieldPresence = reader.int32(); - break; - } - case 2: { - message.enumType = reader.int32(); - break; - } - case 3: { - message.repeatedFieldEncoding = reader.int32(); - break; - } - case 4: { - message.utf8Validation = reader.int32(); - break; - } - case 5: { - message.messageEncoding = reader.int32(); - break; - } - case 6: { - message.jsonFormat = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSet message. - * @function verify - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - switch (message.fieldPresence) { - default: - return "fieldPresence: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.enumType != null && message.hasOwnProperty("enumType")) - switch (message.enumType) { - default: - return "enumType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - switch (message.repeatedFieldEncoding) { - default: - return "repeatedFieldEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - switch (message.utf8Validation) { - default: - return "utf8Validation: enum value expected"; - case 0: - case 2: - case 3: - break; - } - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - switch (message.messageEncoding) { - default: - return "messageEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - switch (message.jsonFormat) { - default: - return "jsonFormat: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSet} FeatureSet - */ - FeatureSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSet) - return object; - var message = new $root.google.protobuf.FeatureSet(); - switch (object.fieldPresence) { - default: - if (typeof object.fieldPresence === "number") { - message.fieldPresence = object.fieldPresence; - break; - } - break; - case "FIELD_PRESENCE_UNKNOWN": - case 0: - message.fieldPresence = 0; - break; - case "EXPLICIT": - case 1: - message.fieldPresence = 1; - break; - case "IMPLICIT": - case 2: - message.fieldPresence = 2; - break; - case "LEGACY_REQUIRED": - case 3: - message.fieldPresence = 3; - break; - } - switch (object.enumType) { - default: - if (typeof object.enumType === "number") { - message.enumType = object.enumType; - break; - } - break; - case "ENUM_TYPE_UNKNOWN": - case 0: - message.enumType = 0; - break; - case "OPEN": - case 1: - message.enumType = 1; - break; - case "CLOSED": - case 2: - message.enumType = 2; - break; - } - switch (object.repeatedFieldEncoding) { - default: - if (typeof object.repeatedFieldEncoding === "number") { - message.repeatedFieldEncoding = object.repeatedFieldEncoding; - break; - } - break; - case "REPEATED_FIELD_ENCODING_UNKNOWN": - case 0: - message.repeatedFieldEncoding = 0; - break; - case "PACKED": - case 1: - message.repeatedFieldEncoding = 1; - break; - case "EXPANDED": - case 2: - message.repeatedFieldEncoding = 2; - break; - } - switch (object.utf8Validation) { - default: - if (typeof object.utf8Validation === "number") { - message.utf8Validation = object.utf8Validation; - break; - } - break; - case "UTF8_VALIDATION_UNKNOWN": - case 0: - message.utf8Validation = 0; - break; - case "VERIFY": - case 2: - message.utf8Validation = 2; - break; - case "NONE": - case 3: - message.utf8Validation = 3; - break; - } - switch (object.messageEncoding) { - default: - if (typeof object.messageEncoding === "number") { - message.messageEncoding = object.messageEncoding; - break; - } - break; - case "MESSAGE_ENCODING_UNKNOWN": - case 0: - message.messageEncoding = 0; - break; - case "LENGTH_PREFIXED": - case 1: - message.messageEncoding = 1; - break; - case "DELIMITED": - case 2: - message.messageEncoding = 2; - break; - } - switch (object.jsonFormat) { - default: - if (typeof object.jsonFormat === "number") { - message.jsonFormat = object.jsonFormat; - break; - } - break; - case "JSON_FORMAT_UNKNOWN": - case 0: - message.jsonFormat = 0; - break; - case "ALLOW": - case 1: - message.jsonFormat = 1; - break; - case "LEGACY_BEST_EFFORT": - case 2: - message.jsonFormat = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.FeatureSet} message FeatureSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; - object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; - object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; - object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; - object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; - object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; - } - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; - if (message.enumType != null && message.hasOwnProperty("enumType")) - object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; - return object; - }; - - /** - * Converts this FeatureSet to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSet - * @instance - * @returns {Object.} JSON object - */ - FeatureSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSet - * @function getTypeUrl - * @memberof google.protobuf.FeatureSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSet"; - }; - - /** - * FieldPresence enum. - * @name google.protobuf.FeatureSet.FieldPresence - * @enum {number} - * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value - * @property {number} EXPLICIT=1 EXPLICIT value - * @property {number} IMPLICIT=2 IMPLICIT value - * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value - */ - FeatureSet.FieldPresence = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; - values[valuesById[1] = "EXPLICIT"] = 1; - values[valuesById[2] = "IMPLICIT"] = 2; - values[valuesById[3] = "LEGACY_REQUIRED"] = 3; - return values; - })(); - - /** - * EnumType enum. - * @name google.protobuf.FeatureSet.EnumType - * @enum {number} - * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value - * @property {number} OPEN=1 OPEN value - * @property {number} CLOSED=2 CLOSED value - */ - FeatureSet.EnumType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "OPEN"] = 1; - values[valuesById[2] = "CLOSED"] = 2; - return values; - })(); - - /** - * RepeatedFieldEncoding enum. - * @name google.protobuf.FeatureSet.RepeatedFieldEncoding - * @enum {number} - * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value - * @property {number} PACKED=1 PACKED value - * @property {number} EXPANDED=2 EXPANDED value - */ - FeatureSet.RepeatedFieldEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "PACKED"] = 1; - values[valuesById[2] = "EXPANDED"] = 2; - return values; - })(); - - /** - * Utf8Validation enum. - * @name google.protobuf.FeatureSet.Utf8Validation - * @enum {number} - * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value - * @property {number} VERIFY=2 VERIFY value - * @property {number} NONE=3 NONE value - */ - FeatureSet.Utf8Validation = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; - values[valuesById[2] = "VERIFY"] = 2; - values[valuesById[3] = "NONE"] = 3; - return values; - })(); - - /** - * MessageEncoding enum. - * @name google.protobuf.FeatureSet.MessageEncoding - * @enum {number} - * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value - * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value - * @property {number} DELIMITED=2 DELIMITED value - */ - FeatureSet.MessageEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "LENGTH_PREFIXED"] = 1; - values[valuesById[2] = "DELIMITED"] = 2; - return values; - })(); - - /** - * JsonFormat enum. - * @name google.protobuf.FeatureSet.JsonFormat - * @enum {number} - * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value - * @property {number} ALLOW=1 ALLOW value - * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value - */ - FeatureSet.JsonFormat = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; - values[valuesById[1] = "ALLOW"] = 1; - values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; - return values; - })(); - - return FeatureSet; - })(); - - protobuf.FeatureSetDefaults = (function() { - - /** - * Properties of a FeatureSetDefaults. - * @memberof google.protobuf - * @interface IFeatureSetDefaults - * @property {Array.|null} [defaults] FeatureSetDefaults defaults - * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition - * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition - */ - - /** - * Constructs a new FeatureSetDefaults. - * @memberof google.protobuf - * @classdesc Represents a FeatureSetDefaults. - * @implements IFeatureSetDefaults - * @constructor - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - */ - function FeatureSetDefaults(properties) { - this.defaults = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSetDefaults defaults. - * @member {Array.} defaults - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.defaults = $util.emptyArray; - - /** - * FeatureSetDefaults minimumEdition. - * @member {google.protobuf.Edition} minimumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.minimumEdition = 0; - - /** - * FeatureSetDefaults maximumEdition. - * @member {google.protobuf.Edition} maximumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.maximumEdition = 0; - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance - */ - FeatureSetDefaults.create = function create(properties) { - return new FeatureSetDefaults(properties); - }; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.defaults != null && message.defaults.length) - for (var i = 0; i < message.defaults.length; ++i) - $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); - if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); - return writer; - }; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.defaults && message.defaults.length)) - message.defaults = []; - message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); - break; - } - case 4: { - message.minimumEdition = reader.int32(); - break; - } - case 5: { - message.maximumEdition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetDefaults message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetDefaults.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.defaults != null && message.hasOwnProperty("defaults")) { - if (!Array.isArray(message.defaults)) - return "defaults: array expected"; - for (var i = 0; i < message.defaults.length; ++i) { - var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); - if (error) - return "defaults." + error; - } - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - switch (message.minimumEdition) { - default: - return "minimumEdition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - switch (message.maximumEdition) { - default: - return "maximumEdition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - */ - FeatureSetDefaults.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults(); - if (object.defaults) { - if (!Array.isArray(object.defaults)) - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); - message.defaults = []; - for (var i = 0; i < object.defaults.length; ++i) { - if (typeof object.defaults[i] !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); - message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); - } - } - switch (object.minimumEdition) { - default: - if (typeof object.minimumEdition === "number") { - message.minimumEdition = object.minimumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.minimumEdition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.minimumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.minimumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.minimumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.minimumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.minimumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.minimumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.minimumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.minimumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.minimumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.minimumEdition = 2147483647; - break; - } - switch (object.maximumEdition) { - default: - if (typeof object.maximumEdition === "number") { - message.maximumEdition = object.maximumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.maximumEdition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.maximumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.maximumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.maximumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.maximumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.maximumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.maximumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.maximumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.maximumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.maximumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.maximumEdition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetDefaults.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.defaults = []; - if (options.defaults) { - object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.defaults && message.defaults.length) { - object.defaults = []; - for (var j = 0; j < message.defaults.length; ++j) - object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; - return object; - }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults - * @instance - * @returns {Object.} JSON object - */ - FeatureSetDefaults.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetDefaults - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; - }; - - FeatureSetDefaults.FeatureSetEditionDefault = (function() { - - /** - * Properties of a FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @interface IFeatureSetEditionDefault - * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition - * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features - */ - - /** - * Constructs a new FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @classdesc Represents a FeatureSetEditionDefault. - * @implements IFeatureSetEditionDefault - * @constructor - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - */ - function FeatureSetEditionDefault(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSetEditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.edition = 0; - - /** - * FeatureSetEditionDefault features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.features = null; - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance - */ - FeatureSetEditionDefault.create = function create(properties) { - return new FeatureSetEditionDefault(properties); - }; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetEditionDefault message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetEditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - return null; - }; - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - */ - FeatureSetEditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetEditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.features = null; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - * @returns {Object.} JSON object - */ - FeatureSetEditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; - }; - - return FeatureSetEditionDefault; - })(); - - return FeatureSetDefaults; - })(); - - protobuf.SourceCodeInfo = (function() { - - /** - * Properties of a SourceCodeInfo. - * @memberof google.protobuf - * @interface ISourceCodeInfo - * @property {Array.|null} [location] SourceCodeInfo location - */ - - /** - * Constructs a new SourceCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a SourceCodeInfo. - * @implements ISourceCodeInfo - * @constructor - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - */ - function SourceCodeInfo(properties) { - this.location = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SourceCodeInfo location. - * @member {Array.} location - * @memberof google.protobuf.SourceCodeInfo - * @instance - */ - SourceCodeInfo.prototype.location = $util.emptyArray; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance - */ - SourceCodeInfo.create = function create(properties) { - return new SourceCodeInfo(properties); - }; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.location != null && message.location.length) - for (var i = 0; i < message.location.length; ++i) - $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.location && message.location.length)) - message.location = []; - message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SourceCodeInfo message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SourceCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) { - if (!Array.isArray(message.location)) - return "location: array expected"; - for (var i = 0; i < message.location.length; ++i) { - var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); - if (error) - return "location." + error; - } - } - return null; - }; - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - */ - SourceCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo) - return object; - var message = new $root.google.protobuf.SourceCodeInfo(); - if (object.location) { - if (!Array.isArray(object.location)) - throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); - message.location = []; - for (var i = 0; i < object.location.length; ++i) { - if (typeof object.location[i] !== "object") - throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); - message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SourceCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.location = []; - if (message.location && message.location.length) { - object.location = []; - for (var j = 0; j < message.location.length; ++j) - object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); - } - return object; - }; - - /** - * Converts this SourceCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo - * @instance - * @returns {Object.} JSON object - */ - SourceCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SourceCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; - }; - - SourceCodeInfo.Location = (function() { - - /** - * Properties of a Location. - * @memberof google.protobuf.SourceCodeInfo - * @interface ILocation - * @property {Array.|null} [path] Location path - * @property {Array.|null} [span] Location span - * @property {string|null} [leadingComments] Location leadingComments - * @property {string|null} [trailingComments] Location trailingComments - * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments - */ - - /** - * Constructs a new Location. - * @memberof google.protobuf.SourceCodeInfo - * @classdesc Represents a Location. - * @implements ILocation - * @constructor - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - */ - function Location(properties) { - this.path = []; - this.span = []; - this.leadingDetachedComments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Location path. - * @member {Array.} path - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.path = $util.emptyArray; - - /** - * Location span. - * @member {Array.} span - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.span = $util.emptyArray; - - /** - * Location leadingComments. - * @member {string} leadingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingComments = ""; - - /** - * Location trailingComments. - * @member {string} trailingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.trailingComments = ""; - - /** - * Location leadingDetachedComments. - * @member {Array.} leadingDetachedComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingDetachedComments = $util.emptyArray; - - /** - * Creates a new Location instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo.Location} Location instance - */ - Location.create = function create(properties) { - return new Location(properties); - }; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.span != null && message.span.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.span.length; ++i) - writer.int32(message.span[i]); - writer.ldelim(); - } - if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); - if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); - return writer; - }; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Location message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - if (!(message.span && message.span.length)) - message.span = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.span.push(reader.int32()); - } else - message.span.push(reader.int32()); - break; - } - case 3: { - message.leadingComments = reader.string(); - break; - } - case 4: { - message.trailingComments = reader.string(); - break; - } - case 6: { - if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) - message.leadingDetachedComments = []; - message.leadingDetachedComments.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Location message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Location.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.span != null && message.hasOwnProperty("span")) { - if (!Array.isArray(message.span)) - return "span: array expected"; - for (var i = 0; i < message.span.length; ++i) - if (!$util.isInteger(message.span[i])) - return "span: integer[] expected"; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - if (!$util.isString(message.leadingComments)) - return "leadingComments: string expected"; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - if (!$util.isString(message.trailingComments)) - return "trailingComments: string expected"; - if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { - if (!Array.isArray(message.leadingDetachedComments)) - return "leadingDetachedComments: array expected"; - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - if (!$util.isString(message.leadingDetachedComments[i])) - return "leadingDetachedComments: string[] expected"; - } - return null; - }; - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo.Location} Location - */ - Location.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) - return object; - var message = new $root.google.protobuf.SourceCodeInfo.Location(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.span) { - if (!Array.isArray(object.span)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); - message.span = []; - for (var i = 0; i < object.span.length; ++i) - message.span[i] = object.span[i] | 0; - } - if (object.leadingComments != null) - message.leadingComments = String(object.leadingComments); - if (object.trailingComments != null) - message.trailingComments = String(object.trailingComments); - if (object.leadingDetachedComments) { - if (!Array.isArray(object.leadingDetachedComments)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); - message.leadingDetachedComments = []; - for (var i = 0; i < object.leadingDetachedComments.length; ++i) - message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); - } - return message; - }; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.Location} message Location - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Location.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.path = []; - object.span = []; - object.leadingDetachedComments = []; - } - if (options.defaults) { - object.leadingComments = ""; - object.trailingComments = ""; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.span && message.span.length) { - object.span = []; - for (var j = 0; j < message.span.length; ++j) - object.span[j] = message.span[j]; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - object.leadingComments = message.leadingComments; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - object.trailingComments = message.trailingComments; - if (message.leadingDetachedComments && message.leadingDetachedComments.length) { - object.leadingDetachedComments = []; - for (var j = 0; j < message.leadingDetachedComments.length; ++j) - object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; - } - return object; - }; - - /** - * Converts this Location to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - * @returns {Object.} JSON object - */ - Location.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Location - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; - }; - - return Location; - })(); - - return SourceCodeInfo; - })(); - - protobuf.GeneratedCodeInfo = (function() { - - /** - * Properties of a GeneratedCodeInfo. - * @memberof google.protobuf - * @interface IGeneratedCodeInfo - * @property {Array.|null} [annotation] GeneratedCodeInfo annotation - */ - - /** - * Constructs a new GeneratedCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a GeneratedCodeInfo. - * @implements IGeneratedCodeInfo - * @constructor - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - */ - function GeneratedCodeInfo(properties) { - this.annotation = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GeneratedCodeInfo annotation. - * @member {Array.} annotation - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - */ - GeneratedCodeInfo.prototype.annotation = $util.emptyArray; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance - */ - GeneratedCodeInfo.create = function create(properties) { - return new GeneratedCodeInfo(properties); - }; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.annotation != null && message.annotation.length) - for (var i = 0; i < message.annotation.length; ++i) - $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.annotation && message.annotation.length)) - message.annotation = []; - message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GeneratedCodeInfo message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GeneratedCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.annotation != null && message.hasOwnProperty("annotation")) { - if (!Array.isArray(message.annotation)) - return "annotation: array expected"; - for (var i = 0; i < message.annotation.length; ++i) { - var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); - if (error) - return "annotation." + error; - } - } - return null; - }; - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - */ - GeneratedCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo(); - if (object.annotation) { - if (!Array.isArray(object.annotation)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); - message.annotation = []; - for (var i = 0; i < object.annotation.length; ++i) { - if (typeof object.annotation[i] !== "object") - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); - message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GeneratedCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.annotation = []; - if (message.annotation && message.annotation.length) { - object.annotation = []; - for (var j = 0; j < message.annotation.length; ++j) - object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); - } - return object; - }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - * @returns {Object.} JSON object - */ - GeneratedCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; - }; - - GeneratedCodeInfo.Annotation = (function() { - - /** - * Properties of an Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @interface IAnnotation - * @property {Array.|null} [path] Annotation path - * @property {string|null} [sourceFile] Annotation sourceFile - * @property {number|null} [begin] Annotation begin - * @property {number|null} [end] Annotation end - * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic - */ - - /** - * Constructs a new Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @classdesc Represents an Annotation. - * @implements IAnnotation - * @constructor - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - */ - function Annotation(properties) { - this.path = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Annotation path. - * @member {Array.} path - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.path = $util.emptyArray; - - /** - * Annotation sourceFile. - * @member {string} sourceFile - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.sourceFile = ""; - - /** - * Annotation begin. - * @member {number} begin - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.begin = 0; - - /** - * Annotation end. - * @member {number} end - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.end = 0; - - /** - * Annotation semantic. - * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.semantic = 0; - - /** - * Creates a new Annotation instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance - */ - Annotation.create = function create(properties) { - return new Annotation(properties); - }; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); - if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); - return writer; - }; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - message.sourceFile = reader.string(); - break; - } - case 3: { - message.begin = reader.int32(); - break; - } - case 4: { - message.end = reader.int32(); - break; - } - case 5: { - message.semantic = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Annotation message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Annotation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - if (!$util.isString(message.sourceFile)) - return "sourceFile: string expected"; - if (message.begin != null && message.hasOwnProperty("begin")) - if (!$util.isInteger(message.begin)) - return "begin: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.semantic != null && message.hasOwnProperty("semantic")) - switch (message.semantic) { - default: - return "semantic: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - */ - Annotation.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.sourceFile != null) - message.sourceFile = String(object.sourceFile); - if (object.begin != null) - message.begin = object.begin | 0; - if (object.end != null) - message.end = object.end | 0; - switch (object.semantic) { - default: - if (typeof object.semantic === "number") { - message.semantic = object.semantic; - break; - } - break; - case "NONE": - case 0: - message.semantic = 0; - break; - case "SET": - case 1: - message.semantic = 1; - break; - case "ALIAS": - case 2: - message.semantic = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Annotation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.path = []; - if (options.defaults) { - object.sourceFile = ""; - object.begin = 0; - object.end = 0; - object.semantic = options.enums === String ? "NONE" : 0; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - object.sourceFile = message.sourceFile; - if (message.begin != null && message.hasOwnProperty("begin")) - object.begin = message.begin; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.semantic != null && message.hasOwnProperty("semantic")) - object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; - return object; - }; - - /** - * Converts this Annotation to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - * @returns {Object.} JSON object - */ - Annotation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Annotation - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; - }; - - /** - * Semantic enum. - * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic - * @enum {number} - * @property {number} NONE=0 NONE value - * @property {number} SET=1 SET value - * @property {number} ALIAS=2 ALIAS value - */ - Annotation.Semantic = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NONE"] = 0; - values[valuesById[1] = "SET"] = 1; - values[valuesById[2] = "ALIAS"] = 2; - return values; - })(); - - return Annotation; - })(); - - return GeneratedCodeInfo; - })(); - - protobuf.Duration = (function() { - - /** - * Properties of a Duration. - * @memberof google.protobuf - * @interface IDuration - * @property {number|Long|null} [seconds] Duration seconds - * @property {number|null} [nanos] Duration nanos - */ - - /** - * Constructs a new Duration. - * @memberof google.protobuf - * @classdesc Represents a Duration. - * @implements IDuration - * @constructor - * @param {google.protobuf.IDuration=} [properties] Properties to set - */ - function Duration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Duration seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Duration nanos. - * @member {number} nanos - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.nanos = 0; - - /** - * Creates a new Duration instance using the specified properties. - * @function create - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration=} [properties] Properties to set - * @returns {google.protobuf.Duration} Duration instance - */ - Duration.create = function create(properties) { - return new Duration(properties); - }; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Duration message. - * @function verify - * @memberof google.protobuf.Duration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Duration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Duration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Duration} Duration - */ - Duration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Duration) - return object; - var message = new $root.google.protobuf.Duration(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.Duration} message Duration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Duration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Duration to JSON. - * @function toJSON - * @memberof google.protobuf.Duration - * @instance - * @returns {Object.} JSON object - */ - Duration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Duration - * @function getTypeUrl - * @memberof google.protobuf.Duration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Duration"; - }; - - return Duration; - })(); - - protobuf.Timestamp = (function() { - - /** - * Properties of a Timestamp. - * @memberof google.protobuf - * @interface ITimestamp - * @property {number|Long|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos - */ - - /** - * Constructs a new Timestamp. - * @memberof google.protobuf - * @classdesc Represents a Timestamp. - * @implements ITimestamp - * @constructor - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - */ - function Timestamp(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Timestamp seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Timestamp nanos. - * @member {number} nanos - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.nanos = 0; - - /** - * Creates a new Timestamp instance using the specified properties. - * @function create - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - * @returns {google.protobuf.Timestamp} Timestamp instance - */ - Timestamp.create = function create(properties) { - return new Timestamp(properties); - }; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Timestamp message. - * @function verify - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Timestamp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Timestamp} Timestamp - */ - Timestamp.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Timestamp) - return object; - var message = new $root.google.protobuf.Timestamp(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.Timestamp} message Timestamp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Timestamp.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Timestamp to JSON. - * @function toJSON - * @memberof google.protobuf.Timestamp - * @instance - * @returns {Object.} JSON object - */ - Timestamp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Timestamp - * @function getTypeUrl - * @memberof google.protobuf.Timestamp - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Timestamp"; - }; - - return Timestamp; - })(); - - protobuf.Any = (function() { - - /** - * Properties of an Any. - * @memberof google.protobuf - * @interface IAny - * @property {string|null} [type_url] Any type_url - * @property {Uint8Array|null} [value] Any value - */ - - /** - * Constructs a new Any. - * @memberof google.protobuf - * @classdesc Represents an Any. - * @implements IAny - * @constructor - * @param {google.protobuf.IAny=} [properties] Properties to set - */ - function Any(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Any type_url. - * @member {string} type_url - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.type_url = ""; - - /** - * Any value. - * @member {Uint8Array} value - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.value = $util.newBuffer([]); - - /** - * Creates a new Any instance using the specified properties. - * @function create - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny=} [properties] Properties to set - * @returns {google.protobuf.Any} Any instance - */ - Any.create = function create(properties) { - return new Any(properties); - }; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Any message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.type_url = reader.string(); - break; - } - case 2: { - message.value = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Any message. - * @function verify - * @memberof google.protobuf.Any - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Any.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type_url != null && message.hasOwnProperty("type_url")) - if (!$util.isString(message.type_url)) - return "type_url: string expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Any - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Any} Any - */ - Any.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Any) - return object; - var message = new $root.google.protobuf.Any(); - if (object.type_url != null) - message.type_url = String(object.type_url); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length >= 0) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.Any} message Any - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Any.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type_url = ""; - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - } - if (message.type_url != null && message.hasOwnProperty("type_url")) - object.type_url = message.type_url; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this Any to JSON. - * @function toJSON - * @memberof google.protobuf.Any - * @instance - * @returns {Object.} JSON object - */ - Any.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Any - * @function getTypeUrl - * @memberof google.protobuf.Any - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Any"; - }; - - return Any; - })(); - - protobuf.Empty = (function() { - - /** - * Properties of an Empty. - * @memberof google.protobuf - * @interface IEmpty - */ - - /** - * Constructs a new Empty. - * @memberof google.protobuf - * @classdesc Represents an Empty. - * @implements IEmpty - * @constructor - * @param {google.protobuf.IEmpty=} [properties] Properties to set - */ - function Empty(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Creates a new Empty instance using the specified properties. - * @function create - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty=} [properties] Properties to set - * @returns {google.protobuf.Empty} Empty instance - */ - Empty.create = function create(properties) { - return new Empty(properties); - }; - - /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Empty.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Empty.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Empty message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Empty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Empty} Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Empty.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Empty message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Empty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Empty} Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Empty.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Empty message. - * @function verify - * @memberof google.protobuf.Empty - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Empty.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Empty - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Empty} Empty - */ - Empty.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Empty) - return object; - return new $root.google.protobuf.Empty(); - }; - - /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.Empty} message Empty - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Empty.toObject = function toObject() { - return {}; - }; - - /** - * Converts this Empty to JSON. - * @function toJSON - * @memberof google.protobuf.Empty - * @instance - * @returns {Object.} JSON object - */ - Empty.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Empty - * @function getTypeUrl - * @memberof google.protobuf.Empty - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Empty"; - }; - - return Empty; - })(); - - return protobuf; - })(); - - google.longrunning = (function() { - - /** - * Namespace longrunning. - * @memberof google - * @namespace - */ - var longrunning = {}; - - longrunning.Operations = (function() { - - /** - * Constructs a new Operations service. - * @memberof google.longrunning - * @classdesc Represents an Operations - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Operations(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; - - /** - * Creates new Operations service using the specified rpc implementation. - * @function create - * @memberof google.longrunning.Operations - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. - */ - Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.longrunning.Operations|listOperations}. - * @memberof google.longrunning.Operations - * @typedef ListOperationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse - */ - - /** - * Calls ListOperations. - * @function listOperations - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object - * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { - return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); - }, "name", { value: "ListOperations" }); - - /** - * Calls ListOperations. - * @function listOperations - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|getOperation}. - * @memberof google.longrunning.Operations - * @typedef GetOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls GetOperation. - * @function getOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object - * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { - return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "GetOperation" }); - - /** - * Calls GetOperation. - * @function getOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|deleteOperation}. - * @memberof google.longrunning.Operations - * @typedef DeleteOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteOperation. - * @function deleteOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object - * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { - return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteOperation" }); - - /** - * Calls DeleteOperation. - * @function deleteOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|cancelOperation}. - * @memberof google.longrunning.Operations - * @typedef CancelOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls CancelOperation. - * @function cancelOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object - * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { - return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "CancelOperation" }); - - /** - * Calls CancelOperation. - * @function cancelOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|waitOperation}. - * @memberof google.longrunning.Operations - * @typedef WaitOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls WaitOperation. - * @function waitOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object - * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { - return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "WaitOperation" }); - - /** - * Calls WaitOperation. - * @function waitOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Operations; - })(); - - longrunning.Operation = (function() { - - /** - * Properties of an Operation. - * @memberof google.longrunning - * @interface IOperation - * @property {string|null} [name] Operation name - * @property {google.protobuf.IAny|null} [metadata] Operation metadata - * @property {boolean|null} [done] Operation done - * @property {google.rpc.IStatus|null} [error] Operation error - * @property {google.protobuf.IAny|null} [response] Operation response - */ - - /** - * Constructs a new Operation. - * @memberof google.longrunning - * @classdesc Represents an Operation. - * @implements IOperation - * @constructor - * @param {google.longrunning.IOperation=} [properties] Properties to set - */ - function Operation(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Operation name. - * @member {string} name - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.name = ""; - - /** - * Operation metadata. - * @member {google.protobuf.IAny|null|undefined} metadata - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.metadata = null; - - /** - * Operation done. - * @member {boolean} done - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.done = false; - - /** - * Operation error. - * @member {google.rpc.IStatus|null|undefined} error - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.error = null; - - /** - * Operation response. - * @member {google.protobuf.IAny|null|undefined} response - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.response = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Operation result. - * @member {"error"|"response"|undefined} result - * @memberof google.longrunning.Operation - * @instance - */ - Object.defineProperty(Operation.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["error", "response"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Operation instance using the specified properties. - * @function create - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation=} [properties] Properties to set - * @returns {google.longrunning.Operation} Operation instance - */ - Operation.create = function create(properties) { - return new Operation(properties); - }; - - /** - * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @function encode - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation} message Operation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Operation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.done != null && Object.hasOwnProperty.call(message, "done")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.response != null && Object.hasOwnProperty.call(message, "response")) - $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation} message Operation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Operation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Operation message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.Operation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.Operation} Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Operation.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - } - case 3: { - message.done = reader.bool(); - break; - } - case 4: { - message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 5: { - message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Operation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.Operation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.Operation} Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Operation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Operation message. - * @function verify - * @memberof google.longrunning.Operation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Operation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.protobuf.Any.verify(message.metadata); - if (error) - return "metadata." + error; - } - if (message.done != null && message.hasOwnProperty("done")) - if (typeof message.done !== "boolean") - return "done: boolean expected"; - if (message.error != null && message.hasOwnProperty("error")) { - properties.result = 1; - { - var error = $root.google.rpc.Status.verify(message.error); - if (error) - return "error." + error; - } - } - if (message.response != null && message.hasOwnProperty("response")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.google.protobuf.Any.verify(message.response); - if (error) - return "response." + error; - } - } - return null; - }; - - /** - * Creates an Operation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.Operation - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.Operation} Operation - */ - Operation.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.Operation) - return object; - var message = new $root.google.longrunning.Operation(); - if (object.name != null) - message.name = String(object.name); - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.longrunning.Operation.metadata: object expected"); - message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); - } - if (object.done != null) - message.done = Boolean(object.done); - if (object.error != null) { - if (typeof object.error !== "object") - throw TypeError(".google.longrunning.Operation.error: object expected"); - message.error = $root.google.rpc.Status.fromObject(object.error); - } - if (object.response != null) { - if (typeof object.response !== "object") - throw TypeError(".google.longrunning.Operation.response: object expected"); - message.response = $root.google.protobuf.Any.fromObject(object.response); - } - return message; - }; - - /** - * Creates a plain object from an Operation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.Operation} message Operation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Operation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.metadata = null; - object.done = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); - if (message.done != null && message.hasOwnProperty("done")) - object.done = message.done; - if (message.error != null && message.hasOwnProperty("error")) { - object.error = $root.google.rpc.Status.toObject(message.error, options); - if (options.oneofs) - object.result = "error"; - } - if (message.response != null && message.hasOwnProperty("response")) { - object.response = $root.google.protobuf.Any.toObject(message.response, options); - if (options.oneofs) - object.result = "response"; - } - return object; - }; - - /** - * Converts this Operation to JSON. - * @function toJSON - * @memberof google.longrunning.Operation - * @instance - * @returns {Object.} JSON object - */ - Operation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Operation - * @function getTypeUrl - * @memberof google.longrunning.Operation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.Operation"; - }; - - return Operation; - })(); - - longrunning.GetOperationRequest = (function() { - - /** - * Properties of a GetOperationRequest. - * @memberof google.longrunning - * @interface IGetOperationRequest - * @property {string|null} [name] GetOperationRequest name - */ - - /** - * Constructs a new GetOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a GetOperationRequest. - * @implements IGetOperationRequest - * @constructor - * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set - */ - function GetOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetOperationRequest name. - * @member {string} name - * @memberof google.longrunning.GetOperationRequest - * @instance - */ - GetOperationRequest.prototype.name = ""; - - /** - * Creates a new GetOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance - */ - GetOperationRequest.create = function create(properties) { - return new GetOperationRequest(properties); - }; - - /** - * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetOperationRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetOperationRequest message. - * @function verify - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - */ - GetOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.GetOperationRequest) - return object; - var message = new $root.google.longrunning.GetOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.GetOperationRequest} message GetOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this GetOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.GetOperationRequest - * @instance - * @returns {Object.} JSON object - */ - GetOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; - }; - - return GetOperationRequest; - })(); - - longrunning.ListOperationsRequest = (function() { - - /** - * Properties of a ListOperationsRequest. - * @memberof google.longrunning - * @interface IListOperationsRequest - * @property {string|null} [name] ListOperationsRequest name - * @property {string|null} [filter] ListOperationsRequest filter - * @property {number|null} [pageSize] ListOperationsRequest pageSize - * @property {string|null} [pageToken] ListOperationsRequest pageToken - */ - - /** - * Constructs a new ListOperationsRequest. - * @memberof google.longrunning - * @classdesc Represents a ListOperationsRequest. - * @implements IListOperationsRequest - * @constructor - * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set - */ - function ListOperationsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListOperationsRequest name. - * @member {string} name - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.name = ""; - - /** - * ListOperationsRequest filter. - * @member {string} filter - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.filter = ""; - - /** - * ListOperationsRequest pageSize. - * @member {number} pageSize - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.pageSize = 0; - - /** - * ListOperationsRequest pageToken. - * @member {string} pageToken - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListOperationsRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance - */ - ListOperationsRequest.create = function create(properties) { - return new ListOperationsRequest(properties); - }; - - /** - * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); - return writer; - }; - - /** - * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 4: { - message.name = reader.string(); - break; - } - case 1: { - message.filter = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListOperationsRequest message. - * @function verify - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListOperationsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - */ - ListOperationsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.ListOperationsRequest) - return object; - var message = new $root.google.longrunning.ListOperationsRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListOperationsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - object.name = ""; - } - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this ListOperationsRequest to JSON. - * @function toJSON - * @memberof google.longrunning.ListOperationsRequest - * @instance - * @returns {Object.} JSON object - */ - ListOperationsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListOperationsRequest - * @function getTypeUrl - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; - }; - - return ListOperationsRequest; - })(); - - longrunning.ListOperationsResponse = (function() { - - /** - * Properties of a ListOperationsResponse. - * @memberof google.longrunning - * @interface IListOperationsResponse - * @property {Array.|null} [operations] ListOperationsResponse operations - * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken - */ - - /** - * Constructs a new ListOperationsResponse. - * @memberof google.longrunning - * @classdesc Represents a ListOperationsResponse. - * @implements IListOperationsResponse - * @constructor - * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set - */ - function ListOperationsResponse(properties) { - this.operations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListOperationsResponse operations. - * @member {Array.} operations - * @memberof google.longrunning.ListOperationsResponse - * @instance - */ - ListOperationsResponse.prototype.operations = $util.emptyArray; - - /** - * ListOperationsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.longrunning.ListOperationsResponse - * @instance - */ - ListOperationsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListOperationsResponse instance using the specified properties. - * @function create - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance - */ - ListOperationsResponse.create = function create(properties) { - return new ListOperationsResponse(properties); - }; - - /** - * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @function encode - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.operations != null && message.operations.length) - for (var i = 0; i < message.operations.length; ++i) - $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.operations && message.operations.length)) - message.operations = []; - message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListOperationsResponse message. - * @function verify - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListOperationsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.operations != null && message.hasOwnProperty("operations")) { - if (!Array.isArray(message.operations)) - return "operations: array expected"; - for (var i = 0; i < message.operations.length; ++i) { - var error = $root.google.longrunning.Operation.verify(message.operations[i]); - if (error) - return "operations." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - */ - ListOperationsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.ListOperationsResponse) - return object; - var message = new $root.google.longrunning.ListOperationsResponse(); - if (object.operations) { - if (!Array.isArray(object.operations)) - throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); - message.operations = []; - for (var i = 0; i < object.operations.length; ++i) { - if (typeof object.operations[i] !== "object") - throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); - message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListOperationsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.operations = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.operations && message.operations.length) { - object.operations = []; - for (var j = 0; j < message.operations.length; ++j) - object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListOperationsResponse to JSON. - * @function toJSON - * @memberof google.longrunning.ListOperationsResponse - * @instance - * @returns {Object.} JSON object - */ - ListOperationsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListOperationsResponse - * @function getTypeUrl - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; - }; - - return ListOperationsResponse; - })(); - - longrunning.CancelOperationRequest = (function() { - - /** - * Properties of a CancelOperationRequest. - * @memberof google.longrunning - * @interface ICancelOperationRequest - * @property {string|null} [name] CancelOperationRequest name - */ - - /** - * Constructs a new CancelOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a CancelOperationRequest. - * @implements ICancelOperationRequest - * @constructor - * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set - */ - function CancelOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CancelOperationRequest name. - * @member {string} name - * @memberof google.longrunning.CancelOperationRequest - * @instance - */ - CancelOperationRequest.prototype.name = ""; - - /** - * Creates a new CancelOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance - */ - CancelOperationRequest.create = function create(properties) { - return new CancelOperationRequest(properties); - }; - - /** - * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelOperationRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CancelOperationRequest message. - * @function verify - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CancelOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - */ - CancelOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.CancelOperationRequest) - return object; - var message = new $root.google.longrunning.CancelOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CancelOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this CancelOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.CancelOperationRequest - * @instance - * @returns {Object.} JSON object - */ - CancelOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CancelOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; - }; - - return CancelOperationRequest; - })(); - - longrunning.DeleteOperationRequest = (function() { - - /** - * Properties of a DeleteOperationRequest. - * @memberof google.longrunning - * @interface IDeleteOperationRequest - * @property {string|null} [name] DeleteOperationRequest name - */ - - /** - * Constructs a new DeleteOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a DeleteOperationRequest. - * @implements IDeleteOperationRequest - * @constructor - * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set - */ - function DeleteOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteOperationRequest name. - * @member {string} name - * @memberof google.longrunning.DeleteOperationRequest - * @instance - */ - DeleteOperationRequest.prototype.name = ""; - - /** - * Creates a new DeleteOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance - */ - DeleteOperationRequest.create = function create(properties) { - return new DeleteOperationRequest(properties); - }; - - /** - * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteOperationRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteOperationRequest message. - * @function verify - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - */ - DeleteOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.DeleteOperationRequest) - return object; - var message = new $root.google.longrunning.DeleteOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this DeleteOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.DeleteOperationRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; - }; - - return DeleteOperationRequest; - })(); - - longrunning.WaitOperationRequest = (function() { - - /** - * Properties of a WaitOperationRequest. - * @memberof google.longrunning - * @interface IWaitOperationRequest - * @property {string|null} [name] WaitOperationRequest name - * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout - */ - - /** - * Constructs a new WaitOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a WaitOperationRequest. - * @implements IWaitOperationRequest - * @constructor - * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set - */ - function WaitOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WaitOperationRequest name. - * @member {string} name - * @memberof google.longrunning.WaitOperationRequest - * @instance - */ - WaitOperationRequest.prototype.name = ""; - - /** - * WaitOperationRequest timeout. - * @member {google.protobuf.IDuration|null|undefined} timeout - * @memberof google.longrunning.WaitOperationRequest - * @instance - */ - WaitOperationRequest.prototype.timeout = null; - - /** - * Creates a new WaitOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance - */ - WaitOperationRequest.create = function create(properties) { - return new WaitOperationRequest(properties); - }; - - /** - * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) - $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitOperationRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WaitOperationRequest message. - * @function verify - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WaitOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.timeout != null && message.hasOwnProperty("timeout")) { - var error = $root.google.protobuf.Duration.verify(message.timeout); - if (error) - return "timeout." + error; - } - return null; - }; - - /** - * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - */ - WaitOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.WaitOperationRequest) - return object; - var message = new $root.google.longrunning.WaitOperationRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.timeout != null) { - if (typeof object.timeout !== "object") - throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); - message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); - } - return message; - }; - - /** - * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WaitOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.timeout = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.timeout != null && message.hasOwnProperty("timeout")) - object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); - return object; - }; - - /** - * Converts this WaitOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.WaitOperationRequest - * @instance - * @returns {Object.} JSON object - */ - WaitOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WaitOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; - }; - - return WaitOperationRequest; - })(); - - longrunning.OperationInfo = (function() { - - /** - * Properties of an OperationInfo. - * @memberof google.longrunning - * @interface IOperationInfo - * @property {string|null} [responseType] OperationInfo responseType - * @property {string|null} [metadataType] OperationInfo metadataType - */ - - /** - * Constructs a new OperationInfo. - * @memberof google.longrunning - * @classdesc Represents an OperationInfo. - * @implements IOperationInfo - * @constructor - * @param {google.longrunning.IOperationInfo=} [properties] Properties to set - */ - function OperationInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OperationInfo responseType. - * @member {string} responseType - * @memberof google.longrunning.OperationInfo - * @instance - */ - OperationInfo.prototype.responseType = ""; - - /** - * OperationInfo metadataType. - * @member {string} metadataType - * @memberof google.longrunning.OperationInfo - * @instance - */ - OperationInfo.prototype.metadataType = ""; - - /** - * Creates a new OperationInfo instance using the specified properties. - * @function create - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo=} [properties] Properties to set - * @returns {google.longrunning.OperationInfo} OperationInfo instance - */ - OperationInfo.create = function create(properties) { - return new OperationInfo(properties); - }; - - /** - * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @function encode - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); - if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); - return writer; - }; - - /** - * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OperationInfo message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.OperationInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.OperationInfo} OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.responseType = reader.string(); - break; - } - case 2: { - message.metadataType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OperationInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.OperationInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.OperationInfo} OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OperationInfo message. - * @function verify - * @memberof google.longrunning.OperationInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OperationInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.responseType != null && message.hasOwnProperty("responseType")) - if (!$util.isString(message.responseType)) - return "responseType: string expected"; - if (message.metadataType != null && message.hasOwnProperty("metadataType")) - if (!$util.isString(message.metadataType)) - return "metadataType: string expected"; - return null; - }; - - /** - * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.OperationInfo - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.OperationInfo} OperationInfo - */ - OperationInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.OperationInfo) - return object; - var message = new $root.google.longrunning.OperationInfo(); - if (object.responseType != null) - message.responseType = String(object.responseType); - if (object.metadataType != null) - message.metadataType = String(object.metadataType); - return message; - }; - - /** - * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.OperationInfo} message OperationInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OperationInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.responseType = ""; - object.metadataType = ""; - } - if (message.responseType != null && message.hasOwnProperty("responseType")) - object.responseType = message.responseType; - if (message.metadataType != null && message.hasOwnProperty("metadataType")) - object.metadataType = message.metadataType; - return object; - }; - - /** - * Converts this OperationInfo to JSON. - * @function toJSON - * @memberof google.longrunning.OperationInfo - * @instance - * @returns {Object.} JSON object - */ - OperationInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OperationInfo - * @function getTypeUrl - * @memberof google.longrunning.OperationInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.OperationInfo"; - }; - - return OperationInfo; - })(); - - return longrunning; - })(); - - google.rpc = (function() { - - /** - * Namespace rpc. - * @memberof google - * @namespace - */ - var rpc = {}; - - rpc.Status = (function() { - - /** - * Properties of a Status. - * @memberof google.rpc - * @interface IStatus - * @property {number|null} [code] Status code - * @property {string|null} [message] Status message - * @property {Array.|null} [details] Status details - */ - - /** - * Constructs a new Status. - * @memberof google.rpc - * @classdesc Represents a Status. - * @implements IStatus - * @constructor - * @param {google.rpc.IStatus=} [properties] Properties to set - */ - function Status(properties) { - this.details = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Status code. - * @member {number} code - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.code = 0; - - /** - * Status message. - * @member {string} message - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.message = ""; - - /** - * Status details. - * @member {Array.} details - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.details = $util.emptyArray; - - /** - * Creates a new Status instance using the specified properties. - * @function create - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus=} [properties] Properties to set - * @returns {google.rpc.Status} Status instance - */ - Status.create = function create(properties) { - return new Status(properties); - }; - - /** - * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encode - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.code != null && Object.hasOwnProperty.call(message, "code")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); - if (message.details != null && message.details.length) - for (var i = 0; i < message.details.length; ++i) - $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encodeDelimited - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Status message from the specified reader or buffer. - * @function decode - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.code = reader.int32(); - break; - } - case 2: { - message.message = reader.string(); - break; - } - case 3: { - if (!(message.details && message.details.length)) - message.details = []; - message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Status message. - * @function verify - * @memberof google.rpc.Status - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Status.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.code != null && message.hasOwnProperty("code")) - if (!$util.isInteger(message.code)) - return "code: integer expected"; - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - if (message.details != null && message.hasOwnProperty("details")) { - if (!Array.isArray(message.details)) - return "details: array expected"; - for (var i = 0; i < message.details.length; ++i) { - var error = $root.google.protobuf.Any.verify(message.details[i]); - if (error) - return "details." + error; - } - } - return null; - }; - - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.rpc.Status - * @static - * @param {Object.} object Plain object - * @returns {google.rpc.Status} Status - */ - Status.fromObject = function fromObject(object) { - if (object instanceof $root.google.rpc.Status) - return object; - var message = new $root.google.rpc.Status(); - if (object.code != null) - message.code = object.code | 0; - if (object.message != null) - message.message = String(object.message); - if (object.details) { - if (!Array.isArray(object.details)) - throw TypeError(".google.rpc.Status.details: array expected"); - message.details = []; - for (var i = 0; i < object.details.length; ++i) { - if (typeof object.details[i] !== "object") - throw TypeError(".google.rpc.Status.details: object expected"); - message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @function toObject - * @memberof google.rpc.Status - * @static - * @param {google.rpc.Status} message Status - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Status.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.details = []; - if (options.defaults) { - object.code = 0; - object.message = ""; - } - if (message.code != null && message.hasOwnProperty("code")) - object.code = message.code; - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - if (message.details && message.details.length) { - object.details = []; - for (var j = 0; j < message.details.length; ++j) - object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); - } - return object; - }; - - /** - * Converts this Status to JSON. - * @function toJSON - * @memberof google.rpc.Status - * @instance - * @returns {Object.} JSON object - */ - Status.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Status - * @function getTypeUrl - * @memberof google.rpc.Status - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.rpc.Status"; - }; - - return Status; - })(); - - return rpc; - })(); - - return google; - })(); - - return $root; -}); diff --git a/owl-bot-staging/google-cloud-batch/v1/protos/protos.json b/owl-bot-staging/google-cloud-batch/v1/protos/protos.json deleted file mode 100644 index f6488c2185f..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/protos/protos.json +++ /dev/null @@ -1,3401 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "cloud": { - "nested": { - "batch": { - "nested": { - "v1": { - "options": { - "csharp_namespace": "Google.Cloud.Batch.V1", - "go_package": "cloud.google.com/go/batch/apiv1/batchpb;batchpb", - "java_multiple_files": true, - "java_outer_classname": "VolumeProto", - "java_package": "com.google.cloud.batch.v1", - "objc_class_prefix": "GCB", - "php_namespace": "Google\\Cloud\\Batch\\V1", - "ruby_package": "Google::Cloud::Batch::V1" - }, - "nested": { - "BatchService": { - "options": { - "(google.api.default_host)": "batch.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "CreateJob": { - "requestType": "CreateJobRequest", - "responseType": "Job", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/jobs", - "(google.api.http).body": "job", - "(google.api.method_signature)": "parent,job,job_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/jobs", - "body": "job" - } - }, - { - "(google.api.method_signature)": "parent,job,job_id" - } - ] - }, - "GetJob": { - "requestType": "GetJobRequest", - "responseType": "Job", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/jobs/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/jobs/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "DeleteJob": { - "requestType": "DeleteJobRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/jobs/*}", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "google.cloud.batch.v1.OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/jobs/*}" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "google.cloud.batch.v1.OperationMetadata" - } - } - ] - }, - "ListJobs": { - "requestType": "ListJobsRequest", - "responseType": "ListJobsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/jobs", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/jobs" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetTask": { - "requestType": "GetTaskRequest", - "responseType": "Task", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/jobs/*/taskGroups/*/tasks/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/jobs/*/taskGroups/*/tasks/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListTasks": { - "requestType": "ListTasksRequest", - "responseType": "ListTasksResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*/jobs/*/taskGroups/*}/tasks", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*/jobs/*/taskGroups/*}/tasks" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - } - } - }, - "CreateJobRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "batch.googleapis.com/Job" - } - }, - "jobId": { - "type": "string", - "id": 2 - }, - "job": { - "type": "Job", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GetJobRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "batch.googleapis.com/Job" - } - } - } - }, - "DeleteJobRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "reason": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListJobsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1 - }, - "filter": { - "type": "string", - "id": 4 - }, - "orderBy": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListJobsResponse": { - "fields": { - "jobs": { - "rule": "repeated", - "type": "Job", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "ListTasksRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "batch.googleapis.com/TaskGroup" - } - }, - "filter": { - "type": "string", - "id": 2 - }, - "pageSize": { - "type": "int32", - "id": 3 - }, - "pageToken": { - "type": "string", - "id": 4 - } - } - }, - "ListTasksResponse": { - "fields": { - "tasks": { - "rule": "repeated", - "type": "Task", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "GetTaskRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "batch.googleapis.com/Task" - } - } - } - }, - "OperationMetadata": { - "fields": { - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "target": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "verb": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "statusMessage": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "requestedCancellation": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "apiVersion": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "Job": { - "options": { - "(google.api.resource).type": "batch.googleapis.com/Job", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/jobs/{job}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "uid": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "priority": { - "type": "int64", - "id": 3 - }, - "taskGroups": { - "rule": "repeated", - "type": "TaskGroup", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "allocationPolicy": { - "type": "AllocationPolicy", - "id": 7 - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 8 - }, - "status": { - "type": "JobStatus", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "logsPolicy": { - "type": "LogsPolicy", - "id": 13 - }, - "notifications": { - "rule": "repeated", - "type": "JobNotification", - "id": 14 - } - } - }, - "LogsPolicy": { - "fields": { - "destination": { - "type": "Destination", - "id": 1 - }, - "logsPath": { - "type": "string", - "id": 2 - }, - "cloudLoggingOption": { - "type": "CloudLoggingOption", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "CloudLoggingOption": { - "fields": { - "useGenericTaskMonitoredResource": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Destination": { - "values": { - "DESTINATION_UNSPECIFIED": 0, - "CLOUD_LOGGING": 1, - "PATH": 2 - } - } - } - }, - "JobStatus": { - "fields": { - "state": { - "type": "State", - "id": 1 - }, - "statusEvents": { - "rule": "repeated", - "type": "StatusEvent", - "id": 2 - }, - "taskGroups": { - "keyType": "string", - "type": "TaskGroupStatus", - "id": 4 - }, - "runDuration": { - "type": "google.protobuf.Duration", - "id": 5 - } - }, - "nested": { - "InstanceStatus": { - "fields": { - "machineType": { - "type": "string", - "id": 1 - }, - "provisioningModel": { - "type": "AllocationPolicy.ProvisioningModel", - "id": 2 - }, - "taskPack": { - "type": "int64", - "id": 3 - }, - "bootDisk": { - "type": "AllocationPolicy.Disk", - "id": 4 - } - } - }, - "TaskGroupStatus": { - "fields": { - "counts": { - "keyType": "string", - "type": "int64", - "id": 1 - }, - "instances": { - "rule": "repeated", - "type": "InstanceStatus", - "id": 2 - } - } - }, - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "QUEUED": 1, - "SCHEDULED": 2, - "RUNNING": 3, - "SUCCEEDED": 4, - "FAILED": 5, - "DELETION_IN_PROGRESS": 6 - } - } - } - }, - "JobNotification": { - "fields": { - "pubsubTopic": { - "type": "string", - "id": 1 - }, - "message": { - "type": "Message", - "id": 2 - } - }, - "nested": { - "Message": { - "fields": { - "type": { - "type": "Type", - "id": 1 - }, - "newJobState": { - "type": "JobStatus.State", - "id": 2 - }, - "newTaskState": { - "type": "TaskStatus.State", - "id": 3 - } - } - }, - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "JOB_STATE_CHANGED": 1, - "TASK_STATE_CHANGED": 2 - } - } - } - }, - "AllocationPolicy": { - "fields": { - "location": { - "type": "LocationPolicy", - "id": 1 - }, - "instances": { - "rule": "repeated", - "type": "InstancePolicyOrTemplate", - "id": 8 - }, - "serviceAccount": { - "type": "ServiceAccount", - "id": 9 - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 6 - }, - "network": { - "type": "NetworkPolicy", - "id": 7 - }, - "placement": { - "type": "PlacementPolicy", - "id": 10 - }, - "tags": { - "rule": "repeated", - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "LocationPolicy": { - "fields": { - "allowedLocations": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "Disk": { - "oneofs": { - "dataSource": { - "oneof": [ - "image", - "snapshot" - ] - } - }, - "fields": { - "image": { - "type": "string", - "id": 4 - }, - "snapshot": { - "type": "string", - "id": 5 - }, - "type": { - "type": "string", - "id": 1 - }, - "sizeGb": { - "type": "int64", - "id": 2 - }, - "diskInterface": { - "type": "string", - "id": 6 - } - } - }, - "AttachedDisk": { - "oneofs": { - "attached": { - "oneof": [ - "newDisk", - "existingDisk" - ] - } - }, - "fields": { - "newDisk": { - "type": "Disk", - "id": 1 - }, - "existingDisk": { - "type": "string", - "id": 2 - }, - "deviceName": { - "type": "string", - "id": 3 - } - } - }, - "Accelerator": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "count": { - "type": "int64", - "id": 2 - }, - "installGpuDrivers": { - "type": "bool", - "id": 3, - "options": { - "deprecated": true - } - }, - "driverVersion": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "InstancePolicy": { - "fields": { - "machineType": { - "type": "string", - "id": 2 - }, - "minCpuPlatform": { - "type": "string", - "id": 3 - }, - "provisioningModel": { - "type": "ProvisioningModel", - "id": 4 - }, - "accelerators": { - "rule": "repeated", - "type": "Accelerator", - "id": 5 - }, - "bootDisk": { - "type": "Disk", - "id": 8 - }, - "disks": { - "rule": "repeated", - "type": "AttachedDisk", - "id": 6 - }, - "reservation": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "InstancePolicyOrTemplate": { - "oneofs": { - "policyTemplate": { - "oneof": [ - "policy", - "instanceTemplate" - ] - } - }, - "fields": { - "policy": { - "type": "InstancePolicy", - "id": 1 - }, - "instanceTemplate": { - "type": "string", - "id": 2 - }, - "installGpuDrivers": { - "type": "bool", - "id": 3 - }, - "installOpsAgent": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "blockProjectSshKeys": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "NetworkInterface": { - "fields": { - "network": { - "type": "string", - "id": 1 - }, - "subnetwork": { - "type": "string", - "id": 2 - }, - "noExternalIpAddress": { - "type": "bool", - "id": 3 - } - } - }, - "NetworkPolicy": { - "fields": { - "networkInterfaces": { - "rule": "repeated", - "type": "NetworkInterface", - "id": 1 - } - } - }, - "PlacementPolicy": { - "fields": { - "collocation": { - "type": "string", - "id": 1 - }, - "maxDistance": { - "type": "int64", - "id": 2 - } - } - }, - "ProvisioningModel": { - "values": { - "PROVISIONING_MODEL_UNSPECIFIED": 0, - "STANDARD": 1, - "SPOT": 2, - "PREEMPTIBLE": 3 - } - } - } - }, - "TaskGroup": { - "options": { - "(google.api.resource).type": "batch.googleapis.com/TaskGroup", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "taskSpec": { - "type": "TaskSpec", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "taskCount": { - "type": "int64", - "id": 4 - }, - "parallelism": { - "type": "int64", - "id": 5 - }, - "schedulingPolicy": { - "type": "SchedulingPolicy", - "id": 6 - }, - "taskEnvironments": { - "rule": "repeated", - "type": "Environment", - "id": 9 - }, - "taskCountPerNode": { - "type": "int64", - "id": 10 - }, - "requireHostsFile": { - "type": "bool", - "id": 11 - }, - "permissiveSsh": { - "type": "bool", - "id": 12 - }, - "runAsNonRoot": { - "type": "bool", - "id": 14, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "SchedulingPolicy": { - "values": { - "SCHEDULING_POLICY_UNSPECIFIED": 0, - "AS_SOON_AS_POSSIBLE": 1, - "IN_ORDER": 2 - } - } - } - }, - "ServiceAccount": { - "fields": { - "email": { - "type": "string", - "id": 1 - }, - "scopes": { - "rule": "repeated", - "type": "string", - "id": 2 - } - } - }, - "ComputeResource": { - "fields": { - "cpuMilli": { - "type": "int64", - "id": 1 - }, - "memoryMib": { - "type": "int64", - "id": 2 - }, - "bootDiskMib": { - "type": "int64", - "id": 4 - } - } - }, - "StatusEvent": { - "fields": { - "type": { - "type": "string", - "id": 3 - }, - "description": { - "type": "string", - "id": 1 - }, - "eventTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "taskExecution": { - "type": "TaskExecution", - "id": 4 - }, - "taskState": { - "type": "TaskStatus.State", - "id": 5 - } - } - }, - "TaskExecution": { - "fields": { - "exitCode": { - "type": "int32", - "id": 1 - } - } - }, - "TaskStatus": { - "fields": { - "state": { - "type": "State", - "id": 1 - }, - "statusEvents": { - "rule": "repeated", - "type": "StatusEvent", - "id": 2 - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "PENDING": 1, - "ASSIGNED": 2, - "RUNNING": 3, - "FAILED": 4, - "SUCCEEDED": 5, - "UNEXECUTED": 6 - } - } - } - }, - "Runnable": { - "oneofs": { - "executable": { - "oneof": [ - "container", - "script", - "barrier" - ] - } - }, - "fields": { - "container": { - "type": "Container", - "id": 1 - }, - "script": { - "type": "Script", - "id": 2 - }, - "barrier": { - "type": "Barrier", - "id": 6 - }, - "displayName": { - "type": "string", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "ignoreExitStatus": { - "type": "bool", - "id": 3 - }, - "background": { - "type": "bool", - "id": 4 - }, - "alwaysRun": { - "type": "bool", - "id": 5 - }, - "environment": { - "type": "Environment", - "id": 7 - }, - "timeout": { - "type": "google.protobuf.Duration", - "id": 8 - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 9 - } - }, - "nested": { - "Container": { - "fields": { - "imageUri": { - "type": "string", - "id": 1 - }, - "commands": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "entrypoint": { - "type": "string", - "id": 3 - }, - "volumes": { - "rule": "repeated", - "type": "string", - "id": 7 - }, - "options": { - "type": "string", - "id": 8 - }, - "blockExternalNetwork": { - "type": "bool", - "id": 9 - }, - "username": { - "type": "string", - "id": 10 - }, - "password": { - "type": "string", - "id": 11 - }, - "enableImageStreaming": { - "type": "bool", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Script": { - "oneofs": { - "command": { - "oneof": [ - "path", - "text" - ] - } - }, - "fields": { - "path": { - "type": "string", - "id": 1 - }, - "text": { - "type": "string", - "id": 2 - } - } - }, - "Barrier": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - } - } - }, - "TaskSpec": { - "fields": { - "runnables": { - "rule": "repeated", - "type": "Runnable", - "id": 8 - }, - "computeResource": { - "type": "ComputeResource", - "id": 3 - }, - "maxRunDuration": { - "type": "google.protobuf.Duration", - "id": 4 - }, - "maxRetryCount": { - "type": "int32", - "id": 5 - }, - "lifecyclePolicies": { - "rule": "repeated", - "type": "LifecyclePolicy", - "id": 9 - }, - "environments": { - "keyType": "string", - "type": "string", - "id": 6, - "options": { - "deprecated": true - } - }, - "volumes": { - "rule": "repeated", - "type": "Volume", - "id": 7 - }, - "environment": { - "type": "Environment", - "id": 10 - } - } - }, - "LifecyclePolicy": { - "fields": { - "action": { - "type": "Action", - "id": 1 - }, - "actionCondition": { - "type": "ActionCondition", - "id": 2 - } - }, - "nested": { - "ActionCondition": { - "fields": { - "exitCodes": { - "rule": "repeated", - "type": "int32", - "id": 1 - } - } - }, - "Action": { - "values": { - "ACTION_UNSPECIFIED": 0, - "RETRY_TASK": 1, - "FAIL_TASK": 2 - } - } - } - }, - "Task": { - "options": { - "(google.api.resource).type": "batch.googleapis.com/Task", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}/tasks/{task}" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "status": { - "type": "TaskStatus", - "id": 2 - } - } - }, - "Environment": { - "fields": { - "variables": { - "keyType": "string", - "type": "string", - "id": 1 - }, - "secretVariables": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "encryptedVariables": { - "type": "KMSEnvMap", - "id": 3 - } - }, - "nested": { - "KMSEnvMap": { - "fields": { - "keyName": { - "type": "string", - "id": 1 - }, - "cipherText": { - "type": "string", - "id": 2 - } - } - } - } - }, - "Volume": { - "oneofs": { - "source": { - "oneof": [ - "nfs", - "gcs", - "deviceName" - ] - } - }, - "fields": { - "nfs": { - "type": "NFS", - "id": 1 - }, - "gcs": { - "type": "GCS", - "id": 3 - }, - "deviceName": { - "type": "string", - "id": 6 - }, - "mountPath": { - "type": "string", - "id": 4 - }, - "mountOptions": { - "rule": "repeated", - "type": "string", - "id": 5 - } - } - }, - "NFS": { - "fields": { - "server": { - "type": "string", - "id": 1 - }, - "remotePath": { - "type": "string", - "id": 2 - } - } - }, - "GCS": { - "fields": { - "remotePath": { - "type": "string", - "id": 1 - } - } - } - } - } - } - } - } - }, - "api": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", - "java_multiple_files": true, - "java_outer_classname": "ResourceProto", - "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true - }, - "nested": { - "http": { - "type": "HttpRule", - "id": 72295728, - "extend": "google.protobuf.MethodOptions" - }, - "Http": { - "fields": { - "rules": { - "rule": "repeated", - "type": "HttpRule", - "id": 1 - }, - "fullyDecodeReservedExpansion": { - "type": "bool", - "id": 2 - } - } - }, - "HttpRule": { - "oneofs": { - "pattern": { - "oneof": [ - "get", - "put", - "post", - "delete", - "patch", - "custom" - ] - } - }, - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "get": { - "type": "string", - "id": 2 - }, - "put": { - "type": "string", - "id": 3 - }, - "post": { - "type": "string", - "id": 4 - }, - "delete": { - "type": "string", - "id": 5 - }, - "patch": { - "type": "string", - "id": 6 - }, - "custom": { - "type": "CustomHttpPattern", - "id": 8 - }, - "body": { - "type": "string", - "id": 7 - }, - "responseBody": { - "type": "string", - "id": 12 - }, - "additionalBindings": { - "rule": "repeated", - "type": "HttpRule", - "id": 11 - } - } - }, - "CustomHttpPattern": { - "fields": { - "kind": { - "type": "string", - "id": 1 - }, - "path": { - "type": "string", - "id": 2 - } - } - }, - "methodSignature": { - "rule": "repeated", - "type": "string", - "id": 1051, - "extend": "google.protobuf.MethodOptions" - }, - "defaultHost": { - "type": "string", - "id": 1049, - "extend": "google.protobuf.ServiceOptions" - }, - "oauthScopes": { - "type": "string", - "id": 1050, - "extend": "google.protobuf.ServiceOptions" - }, - "apiVersion": { - "type": "string", - "id": 525000001, - "extend": "google.protobuf.ServiceOptions" - }, - "CommonLanguageSettings": { - "fields": { - "referenceDocsUri": { - "type": "string", - "id": 1, - "options": { - "deprecated": true - } - }, - "destinations": { - "rule": "repeated", - "type": "ClientLibraryDestination", - "id": 2 - } - } - }, - "ClientLibrarySettings": { - "fields": { - "version": { - "type": "string", - "id": 1 - }, - "launchStage": { - "type": "LaunchStage", - "id": 2 - }, - "restNumericEnums": { - "type": "bool", - "id": 3 - }, - "javaSettings": { - "type": "JavaSettings", - "id": 21 - }, - "cppSettings": { - "type": "CppSettings", - "id": 22 - }, - "phpSettings": { - "type": "PhpSettings", - "id": 23 - }, - "pythonSettings": { - "type": "PythonSettings", - "id": 24 - }, - "nodeSettings": { - "type": "NodeSettings", - "id": 25 - }, - "dotnetSettings": { - "type": "DotnetSettings", - "id": 26 - }, - "rubySettings": { - "type": "RubySettings", - "id": 27 - }, - "goSettings": { - "type": "GoSettings", - "id": 28 - } - } - }, - "Publishing": { - "fields": { - "methodSettings": { - "rule": "repeated", - "type": "MethodSettings", - "id": 2 - }, - "newIssueUri": { - "type": "string", - "id": 101 - }, - "documentationUri": { - "type": "string", - "id": 102 - }, - "apiShortName": { - "type": "string", - "id": 103 - }, - "githubLabel": { - "type": "string", - "id": 104 - }, - "codeownerGithubTeams": { - "rule": "repeated", - "type": "string", - "id": 105 - }, - "docTagPrefix": { - "type": "string", - "id": 106 - }, - "organization": { - "type": "ClientLibraryOrganization", - "id": 107 - }, - "librarySettings": { - "rule": "repeated", - "type": "ClientLibrarySettings", - "id": 109 - }, - "protoReferenceDocumentationUri": { - "type": "string", - "id": 110 - }, - "restReferenceDocumentationUri": { - "type": "string", - "id": 111 - } - } - }, - "JavaSettings": { - "fields": { - "libraryPackage": { - "type": "string", - "id": 1 - }, - "serviceClassNames": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "common": { - "type": "CommonLanguageSettings", - "id": 3 - } - } - }, - "CppSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "PhpSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "PythonSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "NodeSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "DotnetSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - }, - "renamedServices": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "renamedResources": { - "keyType": "string", - "type": "string", - "id": 3 - }, - "ignoredResources": { - "rule": "repeated", - "type": "string", - "id": 4 - }, - "forcedNamespaceAliases": { - "rule": "repeated", - "type": "string", - "id": 5 - }, - "handwrittenSignatures": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - }, - "RubySettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "GoSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "MethodSettings": { - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "longRunning": { - "type": "LongRunning", - "id": 2 - }, - "autoPopulatedFields": { - "rule": "repeated", - "type": "string", - "id": 3 - } - }, - "nested": { - "LongRunning": { - "fields": { - "initialPollDelay": { - "type": "google.protobuf.Duration", - "id": 1 - }, - "pollDelayMultiplier": { - "type": "float", - "id": 2 - }, - "maxPollDelay": { - "type": "google.protobuf.Duration", - "id": 3 - }, - "totalPollTimeout": { - "type": "google.protobuf.Duration", - "id": 4 - } - } - } - } - }, - "ClientLibraryOrganization": { - "values": { - "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, - "CLOUD": 1, - "ADS": 2, - "PHOTOS": 3, - "STREET_VIEW": 4, - "SHOPPING": 5, - "GEO": 6, - "GENERATIVE_AI": 7 - } - }, - "ClientLibraryDestination": { - "values": { - "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, - "GITHUB": 10, - "PACKAGE_MANAGER": 20 - } - }, - "LaunchStage": { - "values": { - "LAUNCH_STAGE_UNSPECIFIED": 0, - "UNIMPLEMENTED": 6, - "PRELAUNCH": 7, - "EARLY_ACCESS": 1, - "ALPHA": 2, - "BETA": 3, - "GA": 4, - "DEPRECATED": 5 - } - }, - "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 - } - }, - "fieldInfo": { - "type": "google.api.FieldInfo", - "id": 291403980, - "extend": "google.protobuf.FieldOptions" - }, - "FieldInfo": { - "fields": { - "format": { - "type": "Format", - "id": 1 - } - }, - "nested": { - "Format": { - "values": { - "FORMAT_UNSPECIFIED": 0, - "UUID4": 1, - "IPV4": 2, - "IPV6": 3, - "IPV4_OR_IPV6": 4 - } - } - } - }, - "resourceReference": { - "type": "google.api.ResourceReference", - "id": 1055, - "extend": "google.protobuf.FieldOptions" - }, - "resourceDefinition": { - "rule": "repeated", - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.FileOptions" - }, - "resource": { - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.MessageOptions" - }, - "ResourceDescriptor": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "pattern": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "nameField": { - "type": "string", - "id": 3 - }, - "history": { - "type": "History", - "id": 4 - }, - "plural": { - "type": "string", - "id": 5 - }, - "singular": { - "type": "string", - "id": 6 - }, - "style": { - "rule": "repeated", - "type": "Style", - "id": 10 - } - }, - "nested": { - "History": { - "values": { - "HISTORY_UNSPECIFIED": 0, - "ORIGINALLY_SINGLE_PATTERN": 1, - "FUTURE_MULTI_PATTERN": 2 - } - }, - "Style": { - "values": { - "STYLE_UNSPECIFIED": 0, - "DECLARATIVE_FRIENDLY": 1 - } - } - } - }, - "ResourceReference": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "childType": { - "type": "string", - "id": 2 - } - } - } - } - }, - "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": { - "fields": { - "file": { - "rule": "repeated", - "type": "FileDescriptorProto", - "id": 1 - } - } - }, - "Edition": { - "values": { - "EDITION_UNKNOWN": 0, - "EDITION_PROTO2": 998, - "EDITION_PROTO3": 999, - "EDITION_2023": 1000, - "EDITION_2024": 1001, - "EDITION_1_TEST_ONLY": 1, - "EDITION_2_TEST_ONLY": 2, - "EDITION_99997_TEST_ONLY": 99997, - "EDITION_99998_TEST_ONLY": 99998, - "EDITION_99999_TEST_ONLY": 99999, - "EDITION_MAX": 2147483647 - } - }, - "FileDescriptorProto": { - "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, - "options": { - "packed": false - } - }, - "weakDependency": { - "rule": "repeated", - "type": "int32", - "id": 11, - "options": { - "packed": false - } - }, - "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": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "field": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 2 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 6 - }, - "nestedType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 3 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 4 - }, - "extensionRange": { - "rule": "repeated", - "type": "ExtensionRange", - "id": 5 - }, - "oneofDecl": { - "rule": "repeated", - "type": "OneofDescriptorProto", - "id": 8 - }, - "options": { - "type": "MessageOptions", - "id": 7 - }, - "reservedRange": { - "rule": "repeated", - "type": "ReservedRange", - "id": 9 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 10 - } - }, - "nested": { - "ExtensionRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "ExtensionRangeOptions", - "id": 3 - } - } - }, - "ReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "ExtensionRangeOptions": { - "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": { - "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": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "options": { - "type": "OneofOptions", - "id": 2 - } - } - }, - "EnumDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "value": { - "rule": "repeated", - "type": "EnumValueDescriptorProto", - "id": 2 - }, - "options": { - "type": "EnumOptions", - "id": 3 - }, - "reservedRange": { - "rule": "repeated", - "type": "EnumReservedRange", - "id": 4 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 5 - } - }, - "nested": { - "EnumReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "EnumValueDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "EnumValueOptions", - "id": 3 - } - } - }, - "ServiceDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "method": { - "rule": "repeated", - "type": "MethodDescriptorProto", - "id": 2 - }, - "options": { - "type": "ServiceOptions", - "id": 3 - } - } - }, - "MethodDescriptorProto": { - "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": { - "fields": { - "javaPackage": { - "type": "string", - "id": 1 - }, - "javaOuterClassname": { - "type": "string", - "id": 8 - }, - "javaMultipleFiles": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "javaGenerateEqualsAndHash": { - "type": "bool", - "id": 20, - "options": { - "deprecated": true - } - }, - "javaStringCheckUtf8": { - "type": "bool", - "id": 27, - "options": { - "default": false - } - }, - "optimizeFor": { - "type": "OptimizeMode", - "id": 9, - "options": { - "default": "SPEED" - } - }, - "goPackage": { - "type": "string", - "id": 11 - }, - "ccGenericServices": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "javaGenericServices": { - "type": "bool", - "id": 17, - "options": { - "default": false - } - }, - "pyGenericServices": { - "type": "bool", - "id": 18, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 23, - "options": { - "default": false - } - }, - "ccEnableArenas": { - "type": "bool", - "id": 31, - "options": { - "default": true - } - }, - "objcClassPrefix": { - "type": "string", - "id": 36 - }, - "csharpNamespace": { - "type": "string", - "id": 37 - }, - "swiftPrefix": { - "type": "string", - "id": 39 - }, - "phpClassPrefix": { - "type": "string", - "id": 40 - }, - "phpNamespace": { - "type": "string", - "id": 41 - }, - "phpMetadataNamespace": { - "type": "string", - "id": 44 - }, - "rubyPackage": { - "type": "string", - "id": 45 - }, - "features": { - "type": "FeatureSet", - "id": 50 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 42, - 42 - ], - [ - 38, - 38 - ] - ], - "nested": { - "OptimizeMode": { - "values": { - "SPEED": 1, - "CODE_SIZE": 2, - "LITE_RUNTIME": 3 - } - } - } - }, - "MessageOptions": { - "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": { - "fields": { - "ctype": { - "type": "CType", - "id": 1, - "options": { - "default": "STRING" - } - }, - "packed": { - "type": "bool", - "id": 2 - }, - "jstype": { - "type": "JSType", - "id": 6, - "options": { - "default": "JS_NORMAL" - } - }, - "lazy": { - "type": "bool", - "id": 5, - "options": { - "default": false - } - }, - "unverifiedLazy": { - "type": "bool", - "id": 15, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "weak": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "debugRedact": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "retention": { - "type": "OptionRetention", - "id": 17 - }, - "targets": { - "rule": "repeated", - "type": "OptionTargetType", - "id": 19, - "options": { - "packed": false - } - }, - "editionDefaults": { - "rule": "repeated", - "type": "EditionDefault", - "id": 20 - }, - "features": { - "type": "FeatureSet", - "id": 21 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 18, - 18 - ] - ], - "nested": { - "CType": { - "values": { - "STRING": 0, - "CORD": 1, - "STRING_PIECE": 2 - } - }, - "JSType": { - "values": { - "JS_NORMAL": 0, - "JS_STRING": 1, - "JS_NUMBER": 2 - } - }, - "OptionRetention": { - "values": { - "RETENTION_UNKNOWN": 0, - "RETENTION_RUNTIME": 1, - "RETENTION_SOURCE": 2 - } - }, - "OptionTargetType": { - "values": { - "TARGET_TYPE_UNKNOWN": 0, - "TARGET_TYPE_FILE": 1, - "TARGET_TYPE_EXTENSION_RANGE": 2, - "TARGET_TYPE_MESSAGE": 3, - "TARGET_TYPE_FIELD": 4, - "TARGET_TYPE_ONEOF": 5, - "TARGET_TYPE_ENUM": 6, - "TARGET_TYPE_ENUM_ENTRY": 7, - "TARGET_TYPE_SERVICE": 8, - "TARGET_TYPE_METHOD": 9 - } - }, - "EditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "value": { - "type": "string", - "id": 2 - } - } - } - } - }, - "OneofOptions": { - "fields": { - "features": { - "type": "FeatureSet", - "id": 1 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "EnumOptions": { - "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": { - "fields": { - "deprecated": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "features": { - "type": "FeatureSet", - "id": 2 - }, - "debugRedact": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "ServiceOptions": { - "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": { - "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": { - "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": { - "fields": { - "fieldPresence": { - "type": "FieldPresence", - "id": 1, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_2023", - "edition_defaults.value": "EXPLICIT" - } - }, - "enumType": { - "type": "EnumType", - "id": 2, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "OPEN" - } - }, - "repeatedFieldEncoding": { - "type": "RepeatedFieldEncoding", - "id": 3, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "PACKED" - } - }, - "utf8Validation": { - "type": "Utf8Validation", - "id": 4, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "VERIFY" - } - }, - "messageEncoding": { - "type": "MessageEncoding", - "id": 5, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO2", - "edition_defaults.value": "LENGTH_PREFIXED" - } - }, - "jsonFormat": { - "type": "JsonFormat", - "id": 6, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "ALLOW" - } - } - }, - "extensions": [ - [ - 1000, - 1000 - ], - [ - 1001, - 1001 - ], - [ - 1002, - 1002 - ], - [ - 9990, - 9990 - ], - [ - 9995, - 9999 - ], - [ - 10000, - 10000 - ] - ], - "reserved": [ - [ - 999, - 999 - ] - ], - "nested": { - "FieldPresence": { - "values": { - "FIELD_PRESENCE_UNKNOWN": 0, - "EXPLICIT": 1, - "IMPLICIT": 2, - "LEGACY_REQUIRED": 3 - } - }, - "EnumType": { - "values": { - "ENUM_TYPE_UNKNOWN": 0, - "OPEN": 1, - "CLOSED": 2 - } - }, - "RepeatedFieldEncoding": { - "values": { - "REPEATED_FIELD_ENCODING_UNKNOWN": 0, - "PACKED": 1, - "EXPANDED": 2 - } - }, - "Utf8Validation": { - "values": { - "UTF8_VALIDATION_UNKNOWN": 0, - "VERIFY": 2, - "NONE": 3 - } - }, - "MessageEncoding": { - "values": { - "MESSAGE_ENCODING_UNKNOWN": 0, - "LENGTH_PREFIXED": 1, - "DELIMITED": 2 - } - }, - "JsonFormat": { - "values": { - "JSON_FORMAT_UNKNOWN": 0, - "ALLOW": 1, - "LEGACY_BEST_EFFORT": 2 - } - } - } - }, - "FeatureSetDefaults": { - "fields": { - "defaults": { - "rule": "repeated", - "type": "FeatureSetEditionDefault", - "id": 1 - }, - "minimumEdition": { - "type": "Edition", - "id": 4 - }, - "maximumEdition": { - "type": "Edition", - "id": 5 - } - }, - "nested": { - "FeatureSetEditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "features": { - "type": "FeatureSet", - "id": 2 - } - } - } - } - }, - "SourceCodeInfo": { - "fields": { - "location": { - "rule": "repeated", - "type": "Location", - "id": 1 - } - }, - "nested": { - "Location": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1 - }, - "span": { - "rule": "repeated", - "type": "int32", - "id": 2 - }, - "leadingComments": { - "type": "string", - "id": 3 - }, - "trailingComments": { - "type": "string", - "id": 4 - }, - "leadingDetachedComments": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - } - } - }, - "GeneratedCodeInfo": { - "fields": { - "annotation": { - "rule": "repeated", - "type": "Annotation", - "id": 1 - } - }, - "nested": { - "Annotation": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1 - }, - "sourceFile": { - "type": "string", - "id": 2 - }, - "begin": { - "type": "int32", - "id": 3 - }, - "end": { - "type": "int32", - "id": 4 - }, - "semantic": { - "type": "Semantic", - "id": 5 - } - }, - "nested": { - "Semantic": { - "values": { - "NONE": 0, - "SET": 1, - "ALIAS": 2 - } - } - } - } - } - }, - "Duration": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "Timestamp": { - "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": {} - } - } - }, - "longrunning": { - "options": { - "cc_enable_arenas": true, - "csharp_namespace": "Google.LongRunning", - "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", - "java_multiple_files": true, - "java_outer_classname": "OperationsProto", - "java_package": "com.google.longrunning", - "php_namespace": "Google\\LongRunning" - }, - "nested": { - "operationInfo": { - "type": "google.longrunning.OperationInfo", - "id": 1049, - "extend": "google.protobuf.MethodOptions" - }, - "Operations": { - "options": { - "(google.api.default_host)": "longrunning.googleapis.com" - }, - "methods": { - "ListOperations": { - "requestType": "ListOperationsRequest", - "responseType": "ListOperationsResponse", - "options": { - "(google.api.http).get": "/v1/{name=operations}", - "(google.api.method_signature)": "name,filter" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=operations}" - } - }, - { - "(google.api.method_signature)": "name,filter" - } - ] - }, - "GetOperation": { - "requestType": "GetOperationRequest", - "responseType": "Operation", - "options": { - "(google.api.http).get": "/v1/{name=operations/**}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=operations/**}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "DeleteOperation": { - "requestType": "DeleteOperationRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=operations/**}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=operations/**}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CancelOperation": { - "requestType": "CancelOperationRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).post": "/v1/{name=operations/**}:cancel", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=operations/**}:cancel", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "WaitOperation": { - "requestType": "WaitOperationRequest", - "responseType": "Operation" - } - } - }, - "Operation": { - "oneofs": { - "result": { - "oneof": [ - "error", - "response" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "metadata": { - "type": "google.protobuf.Any", - "id": 2 - }, - "done": { - "type": "bool", - "id": 3 - }, - "error": { - "type": "google.rpc.Status", - "id": 4 - }, - "response": { - "type": "google.protobuf.Any", - "id": 5 - } - } - }, - "GetOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "ListOperationsRequest": { - "fields": { - "name": { - "type": "string", - "id": 4 - }, - "filter": { - "type": "string", - "id": 1 - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListOperationsResponse": { - "fields": { - "operations": { - "rule": "repeated", - "type": "Operation", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "CancelOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "DeleteOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "WaitOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "timeout": { - "type": "google.protobuf.Duration", - "id": 2 - } - } - }, - "OperationInfo": { - "fields": { - "responseType": { - "type": "string", - "id": 1 - }, - "metadataType": { - "type": "string", - "id": 2 - } - } - } - } - }, - "rpc": { - "options": { - "cc_enable_arenas": true, - "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", - "java_multiple_files": true, - "java_outer_classname": "StatusProto", - "java_package": "com.google.rpc", - "objc_class_prefix": "RPC" - }, - "nested": { - "Status": { - "fields": { - "code": { - "type": "int32", - "id": 1 - }, - "message": { - "type": "string", - "id": 2 - }, - "details": { - "rule": "repeated", - "type": "google.protobuf.Any", - "id": 3 - } - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.create_job.js b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.create_job.js deleted file mode 100644 index ceffce87c28..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.create_job.js +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, job) { - // [START batch_v1_generated_BatchService_CreateJob_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent resource name where the Job will be created. - * Pattern: "projects/{project}/locations/{location}" - */ - // const parent = 'abc123' - /** - * ID used to uniquely identify the Job within its parent scope. - * This field should contain at most 63 characters and must start with - * lowercase characters. - * Only lowercase characters, numbers and '-' are accepted. - * The '-' character cannot be the first or the last one. - * A system generated ID will be used if the field is not set. - * The job.name field in the request will be ignored and the created resource - * name of the Job will be "{parent}/jobs/{job_id}". - */ - // const jobId = 'abc123' - /** - * Required. The Job to create. - */ - // const job = {} - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callCreateJob() { - // Construct request - const request = { - parent, - job, - }; - - // Run request - const response = await batchClient.createJob(request); - console.log(response); - } - - callCreateJob(); - // [END batch_v1_generated_BatchService_CreateJob_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.delete_job.js b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.delete_job.js deleted file mode 100644 index 056a8d9bce4..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.delete_job.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START batch_v1_generated_BatchService_DeleteJob_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Job name. - */ - // const name = 'abc123' - /** - * Optional. Reason for this deletion. - */ - // const reason = 'abc123' - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callDeleteJob() { - // Construct request - const request = { - }; - - // Run request - const [operation] = await batchClient.deleteJob(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteJob(); - // [END batch_v1_generated_BatchService_DeleteJob_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.get_job.js b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.get_job.js deleted file mode 100644 index 0e68cdffae5..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.get_job.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START batch_v1_generated_BatchService_GetJob_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Job name. - */ - // const name = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callGetJob() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await batchClient.getJob(request); - console.log(response); - } - - callGetJob(); - // [END batch_v1_generated_BatchService_GetJob_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.get_task.js b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.get_task.js deleted file mode 100644 index 3b6d00367e7..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.get_task.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START batch_v1_generated_BatchService_GetTask_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Task name. - */ - // const name = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callGetTask() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await batchClient.getTask(request); - console.log(response); - } - - callGetTask(); - // [END batch_v1_generated_BatchService_GetTask_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.list_jobs.js b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.list_jobs.js deleted file mode 100644 index cfd8edc4cf8..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.list_jobs.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START batch_v1_generated_BatchService_ListJobs_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Parent path. - */ - // const parent = 'abc123' - /** - * List filter. - */ - // const filter = 'abc123' - /** - * Optional. Sort results. Supported are "name", "name desc", "create_time", - * and "create_time desc". - */ - // const orderBy = 'abc123' - /** - * Page size. - */ - // const pageSize = 1234 - /** - * Page token. - */ - // const pageToken = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callListJobs() { - // Construct request - const request = { - }; - - // Run request - const iterable = batchClient.listJobsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListJobs(); - // [END batch_v1_generated_BatchService_ListJobs_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.list_tasks.js b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.list_tasks.js deleted file mode 100644 index d0546798f89..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/batch_service.list_tasks.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START batch_v1_generated_BatchService_ListTasks_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of a TaskGroup from which Tasks are being requested. - * Pattern: - * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" - */ - // const parent = 'abc123' - /** - * Task filter, null filter matches all Tasks. - * Filter string should be of the format State=TaskStatus.State e.g. - * State=RUNNING - */ - // const filter = 'abc123' - /** - * Page size. - */ - // const pageSize = 1234 - /** - * Page token. - */ - // const pageToken = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callListTasks() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = batchClient.listTasksAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListTasks(); - // [END batch_v1_generated_BatchService_ListTasks_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/snippet_metadata_google.cloud.batch.v1.json b/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/snippet_metadata_google.cloud.batch.v1.json deleted file mode 100644 index fd2ad4716e2..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/samples/generated/v1/snippet_metadata_google.cloud.batch.v1.json +++ /dev/null @@ -1,303 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-batch", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.batch.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "regionTag": "batch_v1_generated_BatchService_CreateJob_async", - "title": "BatchService createJob Sample", - "origin": "API_DEFINITION", - "description": " Create a Job.", - "canonical": true, - "file": "batch_service.create_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 84, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateJob", - "fullName": "google.cloud.batch.v1.BatchService.CreateJob", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "job_id", - "type": "TYPE_STRING" - }, - { - "name": "job", - "type": ".google.cloud.batch.v1.Job" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.batch.v1.Job", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1.BatchServiceClient" - }, - "method": { - "shortName": "CreateJob", - "fullName": "google.cloud.batch.v1.BatchService.CreateJob", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1.BatchService" - } - } - } - }, - { - "regionTag": "batch_v1_generated_BatchService_GetJob_async", - "title": "BatchService getJob Sample", - "origin": "API_DEFINITION", - "description": " Get a Job specified by its resource name.", - "canonical": true, - "file": "batch_service.get_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetJob", - "fullName": "google.cloud.batch.v1.BatchService.GetJob", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.batch.v1.Job", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1.BatchServiceClient" - }, - "method": { - "shortName": "GetJob", - "fullName": "google.cloud.batch.v1.BatchService.GetJob", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1.BatchService" - } - } - } - }, - { - "regionTag": "batch_v1_generated_BatchService_DeleteJob_async", - "title": "BatchService deleteJob Sample", - "origin": "API_DEFINITION", - "description": " Delete a Job.", - "canonical": true, - "file": "batch_service.delete_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteJob", - "fullName": "google.cloud.batch.v1.BatchService.DeleteJob", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "reason", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1.BatchServiceClient" - }, - "method": { - "shortName": "DeleteJob", - "fullName": "google.cloud.batch.v1.BatchService.DeleteJob", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1.BatchService" - } - } - } - }, - { - "regionTag": "batch_v1_generated_BatchService_ListJobs_async", - "title": "BatchService listJobs Sample", - "origin": "API_DEFINITION", - "description": " List all Jobs for a project within a region.", - "canonical": true, - "file": "batch_service.list_jobs.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListJobs", - "fullName": "google.cloud.batch.v1.BatchService.ListJobs", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.batch.v1.ListJobsResponse", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1.BatchServiceClient" - }, - "method": { - "shortName": "ListJobs", - "fullName": "google.cloud.batch.v1.BatchService.ListJobs", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1.BatchService" - } - } - } - }, - { - "regionTag": "batch_v1_generated_BatchService_GetTask_async", - "title": "BatchService getTask Sample", - "origin": "API_DEFINITION", - "description": " Return a single Task.", - "canonical": true, - "file": "batch_service.get_task.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetTask", - "fullName": "google.cloud.batch.v1.BatchService.GetTask", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.batch.v1.Task", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1.BatchServiceClient" - }, - "method": { - "shortName": "GetTask", - "fullName": "google.cloud.batch.v1.BatchService.GetTask", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1.BatchService" - } - } - } - }, - { - "regionTag": "batch_v1_generated_BatchService_ListTasks_async", - "title": "BatchService listTasks Sample", - "origin": "API_DEFINITION", - "description": " List Tasks associated with a job.", - "canonical": true, - "file": "batch_service.list_tasks.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListTasks", - "fullName": "google.cloud.batch.v1.BatchService.ListTasks", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.batch.v1.ListTasksResponse", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1.BatchServiceClient" - }, - "method": { - "shortName": "ListTasks", - "fullName": "google.cloud.batch.v1.BatchService.ListTasks", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1.BatchService" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-cloud-batch/v1/src/index.ts b/owl-bot-staging/google-cloud-batch/v1/src/index.ts deleted file mode 100644 index 5a38d7beb99..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/src/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as v1 from './v1'; -const BatchServiceClient = v1.BatchServiceClient; -type BatchServiceClient = v1.BatchServiceClient; -export {v1, BatchServiceClient}; -export default {v1, BatchServiceClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_client.ts b/owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_client.ts deleted file mode 100644 index d858efc2bf3..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_client.ts +++ /dev/null @@ -1,1620 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); - -/** - * Client JSON configuration object, loaded from - * `src/v1/batch_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './batch_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Google Batch Service. - * The service manages user submitted batch jobs and allocates Google Compute - * Engine VM instances to run the jobs. - * @class - * @memberof v1 - */ -export class BatchServiceClient { - 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; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - locationsClient: LocationsClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - batchServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of BatchServiceClient. - * - * @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://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @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 BatchServiceClient({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 BatchServiceClient; - 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 = 'batch.' + 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; - } - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process === 'object' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - jobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - taskPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}/tasks/{task}' - ), - taskGroupPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}' - ), - }; - - // 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 = { - listJobs: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'jobs'), - listTasks: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'tasks') - }; - - const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback) { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v1/{name=projects/*/locations/*}',},{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1/{name=projects/*}/locations',},{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',body: '*',},{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/locations/*}/operations',}]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const deleteJobResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteJobMetadata = protoFilesRoot.lookup( - '.google.cloud.batch.v1.OperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - deleteJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteJobResponse.decode.bind(deleteJobResponse), - deleteJobMetadata.decode.bind(deleteJobMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.batch.v1.BatchService', 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.batchServiceStub) { - return this.batchServiceStub; - } - - // Put together the "service stub" for - // google.cloud.batch.v1.BatchService. - this.batchServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.batch.v1.BatchService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.batch.v1.BatchService, - 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 batchServiceStubMethods = - ['createJob', 'getJob', 'deleteJob', 'listJobs', 'getTask', 'listTasks']; - for (const methodName of batchServiceStubMethods) { - const callPromise = this.batchServiceStub.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.batchServiceStub; - } - - /** - * 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 'batch.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 'batch.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' - ]; - } - - 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 -- - // ------------------- -/** - * Create a Job. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name where the Job will be created. - * Pattern: "projects/{project}/locations/{location}" - * @param {string} request.jobId - * ID used to uniquely identify the Job within its parent scope. - * This field should contain at most 63 characters and must start with - * lowercase characters. - * Only lowercase characters, numbers and '-' are accepted. - * The '-' character cannot be the first or the last one. - * A system generated ID will be used if the field is not set. - * - * The job.name field in the request will be ignored and the created resource - * name of the Job will be "{parent}/jobs/{job_id}". - * @param {google.cloud.batch.v1.Job} request.job - * Required. The Job to create. - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1.Job|Job}. - * 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/batch_service.create_job.js - * region_tag:batch_v1_generated_BatchService_CreateJob_async - */ - createJob( - request?: protos.google.cloud.batch.v1.ICreateJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.batch.v1.IJob, - protos.google.cloud.batch.v1.ICreateJobRequest|undefined, {}|undefined - ]>; - createJob( - request: protos.google.cloud.batch.v1.ICreateJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.batch.v1.IJob, - protos.google.cloud.batch.v1.ICreateJobRequest|null|undefined, - {}|null|undefined>): void; - createJob( - request: protos.google.cloud.batch.v1.ICreateJobRequest, - callback: Callback< - protos.google.cloud.batch.v1.IJob, - protos.google.cloud.batch.v1.ICreateJobRequest|null|undefined, - {}|null|undefined>): void; - createJob( - request?: protos.google.cloud.batch.v1.ICreateJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.batch.v1.IJob, - protos.google.cloud.batch.v1.ICreateJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.batch.v1.IJob, - protos.google.cloud.batch.v1.ICreateJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.batch.v1.IJob, - protos.google.cloud.batch.v1.ICreateJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.createJob(request, options, callback); - } -/** - * Get a Job specified by its resource name. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Job name. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1.Job|Job}. - * 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/batch_service.get_job.js - * region_tag:batch_v1_generated_BatchService_GetJob_async - */ - getJob( - request?: protos.google.cloud.batch.v1.IGetJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.batch.v1.IJob, - protos.google.cloud.batch.v1.IGetJobRequest|undefined, {}|undefined - ]>; - getJob( - request: protos.google.cloud.batch.v1.IGetJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.batch.v1.IJob, - protos.google.cloud.batch.v1.IGetJobRequest|null|undefined, - {}|null|undefined>): void; - getJob( - request: protos.google.cloud.batch.v1.IGetJobRequest, - callback: Callback< - protos.google.cloud.batch.v1.IJob, - protos.google.cloud.batch.v1.IGetJobRequest|null|undefined, - {}|null|undefined>): void; - getJob( - request?: protos.google.cloud.batch.v1.IGetJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.batch.v1.IJob, - protos.google.cloud.batch.v1.IGetJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.batch.v1.IJob, - protos.google.cloud.batch.v1.IGetJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.batch.v1.IJob, - protos.google.cloud.batch.v1.IGetJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getJob(request, options, callback); - } -/** - * Return a single Task. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Task name. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1.Task|Task}. - * 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/batch_service.get_task.js - * region_tag:batch_v1_generated_BatchService_GetTask_async - */ - getTask( - request?: protos.google.cloud.batch.v1.IGetTaskRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.batch.v1.ITask, - protos.google.cloud.batch.v1.IGetTaskRequest|undefined, {}|undefined - ]>; - getTask( - request: protos.google.cloud.batch.v1.IGetTaskRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.batch.v1.ITask, - protos.google.cloud.batch.v1.IGetTaskRequest|null|undefined, - {}|null|undefined>): void; - getTask( - request: protos.google.cloud.batch.v1.IGetTaskRequest, - callback: Callback< - protos.google.cloud.batch.v1.ITask, - protos.google.cloud.batch.v1.IGetTaskRequest|null|undefined, - {}|null|undefined>): void; - getTask( - request?: protos.google.cloud.batch.v1.IGetTaskRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.batch.v1.ITask, - protos.google.cloud.batch.v1.IGetTaskRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.batch.v1.ITask, - protos.google.cloud.batch.v1.IGetTaskRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.batch.v1.ITask, - protos.google.cloud.batch.v1.IGetTaskRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getTask(request, options, callback); - } - -/** - * Delete a Job. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Job name. - * @param {string} [request.reason] - * Optional. Reason for this deletion. - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/batch_service.delete_job.js - * region_tag:batch_v1_generated_BatchService_DeleteJob_async - */ - deleteJob( - request?: protos.google.cloud.batch.v1.IDeleteJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteJob( - request: protos.google.cloud.batch.v1.IDeleteJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteJob( - request: protos.google.cloud.batch.v1.IDeleteJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteJob( - request?: protos.google.cloud.batch.v1.IDeleteJobRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteJob(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteJob()`. - * @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/batch_service.delete_job.js - * region_tag:batch_v1_generated_BatchService_DeleteJob_async - */ - async checkDeleteJobProgress(name: string): Promise>{ - 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.deleteJob, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * List all Jobs for a project within a region. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Parent path. - * @param {string} request.filter - * List filter. - * @param {string} [request.orderBy] - * Optional. Sort results. Supported are "name", "name desc", "create_time", - * and "create_time desc". - * @param {number} request.pageSize - * Page size. - * @param {string} request.pageToken - * Page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.batch.v1.Job|Job}. - * 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 `listJobsAsync()` - * 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. - */ - listJobs( - request?: protos.google.cloud.batch.v1.IListJobsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.batch.v1.IJob[], - protos.google.cloud.batch.v1.IListJobsRequest|null, - protos.google.cloud.batch.v1.IListJobsResponse - ]>; - listJobs( - request: protos.google.cloud.batch.v1.IListJobsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.batch.v1.IListJobsRequest, - protos.google.cloud.batch.v1.IListJobsResponse|null|undefined, - protos.google.cloud.batch.v1.IJob>): void; - listJobs( - request: protos.google.cloud.batch.v1.IListJobsRequest, - callback: PaginationCallback< - protos.google.cloud.batch.v1.IListJobsRequest, - protos.google.cloud.batch.v1.IListJobsResponse|null|undefined, - protos.google.cloud.batch.v1.IJob>): void; - listJobs( - request?: protos.google.cloud.batch.v1.IListJobsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.batch.v1.IListJobsRequest, - protos.google.cloud.batch.v1.IListJobsResponse|null|undefined, - protos.google.cloud.batch.v1.IJob>, - callback?: PaginationCallback< - protos.google.cloud.batch.v1.IListJobsRequest, - protos.google.cloud.batch.v1.IListJobsResponse|null|undefined, - protos.google.cloud.batch.v1.IJob>): - Promise<[ - protos.google.cloud.batch.v1.IJob[], - protos.google.cloud.batch.v1.IListJobsRequest|null, - protos.google.cloud.batch.v1.IListJobsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listJobs(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Parent path. - * @param {string} request.filter - * List filter. - * @param {string} [request.orderBy] - * Optional. Sort results. Supported are "name", "name desc", "create_time", - * and "create_time desc". - * @param {number} request.pageSize - * Page size. - * @param {string} request.pageToken - * Page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.batch.v1.Job|Job} 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 `listJobsAsync()` - * 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. - */ - listJobsStream( - request?: protos.google.cloud.batch.v1.IListJobsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listJobs.createStream( - this.innerApiCalls.listJobs as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listJobs`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Parent path. - * @param {string} request.filter - * List filter. - * @param {string} [request.orderBy] - * Optional. Sort results. Supported are "name", "name desc", "create_time", - * and "create_time desc". - * @param {number} request.pageSize - * Page size. - * @param {string} request.pageToken - * Page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.batch.v1.Job|Job}. 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/batch_service.list_jobs.js - * region_tag:batch_v1_generated_BatchService_ListJobs_async - */ - listJobsAsync( - request?: protos.google.cloud.batch.v1.IListJobsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listJobs.asyncIterate( - this.innerApiCalls['listJobs'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * List Tasks associated with a job. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of a TaskGroup from which Tasks are being requested. - * Pattern: - * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" - * @param {string} request.filter - * Task filter, null filter matches all Tasks. - * Filter string should be of the format State=TaskStatus.State e.g. - * State=RUNNING - * @param {number} request.pageSize - * Page size. - * @param {string} request.pageToken - * Page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.batch.v1.Task|Task}. - * 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 `listTasksAsync()` - * 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. - */ - listTasks( - request?: protos.google.cloud.batch.v1.IListTasksRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.batch.v1.ITask[], - protos.google.cloud.batch.v1.IListTasksRequest|null, - protos.google.cloud.batch.v1.IListTasksResponse - ]>; - listTasks( - request: protos.google.cloud.batch.v1.IListTasksRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.batch.v1.IListTasksRequest, - protos.google.cloud.batch.v1.IListTasksResponse|null|undefined, - protos.google.cloud.batch.v1.ITask>): void; - listTasks( - request: protos.google.cloud.batch.v1.IListTasksRequest, - callback: PaginationCallback< - protos.google.cloud.batch.v1.IListTasksRequest, - protos.google.cloud.batch.v1.IListTasksResponse|null|undefined, - protos.google.cloud.batch.v1.ITask>): void; - listTasks( - request?: protos.google.cloud.batch.v1.IListTasksRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.batch.v1.IListTasksRequest, - protos.google.cloud.batch.v1.IListTasksResponse|null|undefined, - protos.google.cloud.batch.v1.ITask>, - callback?: PaginationCallback< - protos.google.cloud.batch.v1.IListTasksRequest, - protos.google.cloud.batch.v1.IListTasksResponse|null|undefined, - protos.google.cloud.batch.v1.ITask>): - Promise<[ - protos.google.cloud.batch.v1.ITask[], - protos.google.cloud.batch.v1.IListTasksRequest|null, - protos.google.cloud.batch.v1.IListTasksResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listTasks(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of a TaskGroup from which Tasks are being requested. - * Pattern: - * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" - * @param {string} request.filter - * Task filter, null filter matches all Tasks. - * Filter string should be of the format State=TaskStatus.State e.g. - * State=RUNNING - * @param {number} request.pageSize - * Page size. - * @param {string} request.pageToken - * Page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.batch.v1.Task|Task} 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 `listTasksAsync()` - * 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. - */ - listTasksStream( - request?: protos.google.cloud.batch.v1.IListTasksRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listTasks']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTasks.createStream( - this.innerApiCalls.listTasks as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listTasks`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of a TaskGroup from which Tasks are being requested. - * Pattern: - * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" - * @param {string} request.filter - * Task filter, null filter matches all Tasks. - * Filter string should be of the format State=TaskStatus.State e.g. - * State=RUNNING - * @param {number} request.pageSize - * Page size. - * @param {string} request.pageToken - * Page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.batch.v1.Task|Task}. 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/batch_service.list_tasks.js - * region_tag:batch_v1_generated_BatchService_ListTasks_async - */ - listTasksAsync( - request?: protos.google.cloud.batch.v1.IListTasksRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listTasks']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTasks.asyncIterate( - this.innerApiCalls['listTasks'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the location. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 google.cloud.location.Location | Location}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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.name - * The resource that owns the locations collection, if applicable. - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link google.cloud.location.Location | Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * 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, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@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 { - 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, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@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, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified job resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @returns {string} Resource name string. - */ - jobPath(project:string,location:string,job:string) { - return this.pathTemplates.jobPathTemplate.render({ - project: project, - location: location, - job: job, - }); - } - - /** - * Parse the project from Job resource. - * - * @param {string} jobName - * A fully-qualified path representing Job resource. - * @returns {string} A string representing the project. - */ - matchProjectFromJobName(jobName: string) { - return this.pathTemplates.jobPathTemplate.match(jobName).project; - } - - /** - * Parse the location from Job resource. - * - * @param {string} jobName - * A fully-qualified path representing Job resource. - * @returns {string} A string representing the location. - */ - matchLocationFromJobName(jobName: string) { - return this.pathTemplates.jobPathTemplate.match(jobName).location; - } - - /** - * Parse the job from Job resource. - * - * @param {string} jobName - * A fully-qualified path representing Job resource. - * @returns {string} A string representing the job. - */ - matchJobFromJobName(jobName: string) { - return this.pathTemplates.jobPathTemplate.match(jobName).job; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified project resource name string. - * - * @param {string} project - * @returns {string} Resource name string. - */ - projectPath(project:string) { - return this.pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the project from Project resource. - * - * @param {string} projectName - * A fully-qualified path representing Project resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectName(projectName: string) { - return this.pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * Return a fully-qualified task resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @param {string} task_group - * @param {string} task - * @returns {string} Resource name string. - */ - taskPath(project:string,location:string,job:string,taskGroup:string,task:string) { - return this.pathTemplates.taskPathTemplate.render({ - project: project, - location: location, - job: job, - task_group: taskGroup, - task: task, - }); - } - - /** - * Parse the project from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).project; - } - - /** - * Parse the location from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).location; - } - - /** - * Parse the job from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the job. - */ - matchJobFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).job; - } - - /** - * Parse the task_group from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the task_group. - */ - matchTaskGroupFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).task_group; - } - - /** - * Parse the task from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the task. - */ - matchTaskFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).task; - } - - /** - * Return a fully-qualified taskGroup resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @param {string} task_group - * @returns {string} Resource name string. - */ - taskGroupPath(project:string,location:string,job:string,taskGroup:string) { - return this.pathTemplates.taskGroupPathTemplate.render({ - project: project, - location: location, - job: job, - task_group: taskGroup, - }); - } - - /** - * Parse the project from TaskGroup resource. - * - * @param {string} taskGroupName - * A fully-qualified path representing TaskGroup resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTaskGroupName(taskGroupName: string) { - return this.pathTemplates.taskGroupPathTemplate.match(taskGroupName).project; - } - - /** - * Parse the location from TaskGroup resource. - * - * @param {string} taskGroupName - * A fully-qualified path representing TaskGroup resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTaskGroupName(taskGroupName: string) { - return this.pathTemplates.taskGroupPathTemplate.match(taskGroupName).location; - } - - /** - * Parse the job from TaskGroup resource. - * - * @param {string} taskGroupName - * A fully-qualified path representing TaskGroup resource. - * @returns {string} A string representing the job. - */ - matchJobFromTaskGroupName(taskGroupName: string) { - return this.pathTemplates.taskGroupPathTemplate.match(taskGroupName).job; - } - - /** - * Parse the task_group from TaskGroup resource. - * - * @param {string} taskGroupName - * A fully-qualified path representing TaskGroup resource. - * @returns {string} A string representing the task_group. - */ - matchTaskGroupFromTaskGroupName(taskGroupName: string) { - return this.pathTemplates.taskGroupPathTemplate.match(taskGroupName).task_group; - } - - /** - * 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.batchServiceStub && !this._terminated) { - return this.batchServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.locationsClient.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_client_config.json b/owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_client_config.json deleted file mode 100644 index be602f6e2eb..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_client_config.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "interfaces": { - "google.cloud.batch.v1.BatchService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "unavailable": [ - "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 - }, - "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateJob": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetJob": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "DeleteJob": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListJobs": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "GetTask": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "ListTasks": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_proto_list.json b/owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_proto_list.json deleted file mode 100644 index d9013a506a2..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/src/v1/batch_service_proto_list.json +++ /dev/null @@ -1,6 +0,0 @@ -[ - "../../protos/google/cloud/batch/v1/batch.proto", - "../../protos/google/cloud/batch/v1/job.proto", - "../../protos/google/cloud/batch/v1/task.proto", - "../../protos/google/cloud/batch/v1/volume.proto" -] diff --git a/owl-bot-staging/google-cloud-batch/v1/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-batch/v1/src/v1/gapic_metadata.json deleted file mode 100644 index 914e910ca19..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/src/v1/gapic_metadata.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.batch.v1", - "libraryPackage": "@google-cloud/batch", - "services": { - "BatchService": { - "clients": { - "grpc": { - "libraryClient": "BatchServiceClient", - "rpcs": { - "CreateJob": { - "methods": [ - "createJob" - ] - }, - "GetJob": { - "methods": [ - "getJob" - ] - }, - "GetTask": { - "methods": [ - "getTask" - ] - }, - "DeleteJob": { - "methods": [ - "deleteJob" - ] - }, - "ListJobs": { - "methods": [ - "listJobs", - "listJobsStream", - "listJobsAsync" - ] - }, - "ListTasks": { - "methods": [ - "listTasks", - "listTasksStream", - "listTasksAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "BatchServiceClient", - "rpcs": { - "CreateJob": { - "methods": [ - "createJob" - ] - }, - "GetJob": { - "methods": [ - "getJob" - ] - }, - "GetTask": { - "methods": [ - "getTask" - ] - }, - "DeleteJob": { - "methods": [ - "deleteJob" - ] - }, - "ListJobs": { - "methods": [ - "listJobs", - "listJobsStream", - "listJobsAsync" - ] - }, - "ListTasks": { - "methods": [ - "listTasks", - "listTasksStream", - "listTasksAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-batch/v1/src/v1/index.ts b/owl-bot-staging/google-cloud-batch/v1/src/v1/index.ts deleted file mode 100644 index fb53b495001..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/src/v1/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {BatchServiceClient} from './batch_service_client'; diff --git a/owl-bot-staging/google-cloud-batch/v1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-batch/v1/system-test/fixtures/sample/src/index.js deleted file mode 100644 index b9ac0eb683e..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -/* eslint-disable node/no-missing-require, no-unused-vars */ -const batch = require('@google-cloud/batch'); - -function main() { - const batchServiceClient = new batch.BatchServiceClient(); -} - -main(); diff --git a/owl-bot-staging/google-cloud-batch/v1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-batch/v1/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index c43e51952e7..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 {BatchServiceClient} from '@google-cloud/batch'; - -// check that the client class type name can be used -function doStuffWithBatchServiceClient(client: BatchServiceClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const batchServiceClient = new BatchServiceClient(); - doStuffWithBatchServiceClient(batchServiceClient); -} - -main(); diff --git a/owl-bot-staging/google-cloud-batch/v1/system-test/install.ts b/owl-bot-staging/google-cloud-batch/v1/system-test/install.ts deleted file mode 100644 index fd5bfdc71d5..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {packNTest} from 'pack-n-play'; -import {readFileSync} from 'fs'; -import {describe, it} from 'mocha'; - -describe('📦 pack-n-play test', () => { - - it('TypeScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'TypeScript user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() - } - }; - await packNTest(options); - }); - - it('JavaScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'JavaScript user can use the library', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() - } - }; - await packNTest(options); - }); - -}); diff --git a/owl-bot-staging/google-cloud-batch/v1/test/gapic_batch_service_v1.ts b/owl-bot-staging/google-cloud-batch/v1/test/gapic_batch_service_v1.ts deleted file mode 100644 index 6ad80d6c51e..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/test/gapic_batch_service_v1.ts +++ /dev/null @@ -1,1899 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 batchserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos, LocationProtos} 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.BatchServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new batchserviceModule.v1.BatchServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'batch.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new batchserviceModule.v1.BatchServiceClient(); - 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 = batchserviceModule.v1.BatchServiceClient.servicePath; - assert.strictEqual(servicePath, 'batch.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = batchserviceModule.v1.BatchServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'batch.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new batchserviceModule.v1.BatchServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'batch.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new batchserviceModule.v1.BatchServiceClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'batch.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 batchserviceModule.v1.BatchServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'batch.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 batchserviceModule.v1.BatchServiceClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'batch.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 batchserviceModule.v1.BatchServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = batchserviceModule.v1.BatchServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new batchserviceModule.v1.BatchServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.batchServiceStub, undefined); - await client.initialize(); - assert(client.batchServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.batchServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.batchServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new batchserviceModule.v1.BatchServiceClient({ - 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 batchserviceModule.v1.BatchServiceClient({ - 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('createJob', () => { - it('invokes createJob without error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.CreateJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.CreateJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1.Job() - ); - client.innerApiCalls.createJob = stubSimpleCall(expectedResponse); - const [response] = await client.createJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createJob without error using callback', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.CreateJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.CreateJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1.Job() - ); - client.innerApiCalls.createJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createJob( - request, - (err?: Error|null, result?: protos.google.cloud.batch.v1.IJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createJob with error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.CreateJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.CreateJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createJob(request), expectedError); - const actualRequest = (client.innerApiCalls.createJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createJob with closed client', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.CreateJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.CreateJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createJob(request), expectedError); - }); - }); - - describe('getJob', () => { - it('invokes getJob without error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.GetJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.GetJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1.Job() - ); - client.innerApiCalls.getJob = stubSimpleCall(expectedResponse); - const [response] = await client.getJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getJob without error using callback', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.GetJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.GetJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1.Job() - ); - client.innerApiCalls.getJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getJob( - request, - (err?: Error|null, result?: protos.google.cloud.batch.v1.IJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getJob with error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.GetJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.GetJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getJob(request), expectedError); - const actualRequest = (client.innerApiCalls.getJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getJob with closed client', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.GetJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.GetJobRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getJob(request), expectedError); - }); - }); - - describe('getTask', () => { - it('invokes getTask without error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.GetTaskRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.GetTaskRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1.Task() - ); - client.innerApiCalls.getTask = stubSimpleCall(expectedResponse); - const [response] = await client.getTask(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getTask as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTask as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getTask without error using callback', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.GetTaskRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.GetTaskRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1.Task() - ); - client.innerApiCalls.getTask = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getTask( - request, - (err?: Error|null, result?: protos.google.cloud.batch.v1.ITask|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getTask as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTask as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getTask with error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.GetTaskRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.GetTaskRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getTask = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTask(request), expectedError); - const actualRequest = (client.innerApiCalls.getTask as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTask as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getTask with closed client', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.GetTaskRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.GetTaskRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getTask(request), expectedError); - }); - }); - - describe('deleteJob', () => { - it('invokes deleteJob without error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.DeleteJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.DeleteJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteJob(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteJob without error using callback', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.DeleteJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.DeleteJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteJob( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteJob with call error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.DeleteJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.DeleteJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteJob(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteJob with LRO error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.DeleteJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.DeleteJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteJob(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteJobProgress without error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - 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.checkDeleteJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteJobProgress with error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listJobs', () => { - it('invokes listJobs without error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.ListJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.ListJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1.Job()), - generateSampleMessage(new protos.google.cloud.batch.v1.Job()), - generateSampleMessage(new protos.google.cloud.batch.v1.Job()), - ]; - client.innerApiCalls.listJobs = stubSimpleCall(expectedResponse); - const [response] = await client.listJobs(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listJobs without error using callback', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.ListJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.ListJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1.Job()), - generateSampleMessage(new protos.google.cloud.batch.v1.Job()), - generateSampleMessage(new protos.google.cloud.batch.v1.Job()), - ]; - client.innerApiCalls.listJobs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listJobs( - request, - (err?: Error|null, result?: protos.google.cloud.batch.v1.IJob[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listJobs with error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.ListJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.ListJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listJobs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listJobs(request), expectedError); - const actualRequest = (client.innerApiCalls.listJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listJobsStream without error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.ListJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.ListJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1.Job()), - generateSampleMessage(new protos.google.cloud.batch.v1.Job()), - generateSampleMessage(new protos.google.cloud.batch.v1.Job()), - ]; - client.descriptors.page.listJobs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.batch.v1.Job[] = []; - stream.on('data', (response: protos.google.cloud.batch.v1.Job) => { - 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.listJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listJobs, request)); - assert( - (client.descriptors.page.listJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listJobsStream with error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.ListJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.ListJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listJobs.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.batch.v1.Job[] = []; - stream.on('data', (response: protos.google.cloud.batch.v1.Job) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listJobs, request)); - assert( - (client.descriptors.page.listJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listJobs without error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.ListJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.ListJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1.Job()), - generateSampleMessage(new protos.google.cloud.batch.v1.Job()), - generateSampleMessage(new protos.google.cloud.batch.v1.Job()), - ]; - client.descriptors.page.listJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.batch.v1.IJob[] = []; - const iterable = client.listJobsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listJobs with error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.ListJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.ListJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listJobsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.batch.v1.IJob[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listTasks', () => { - it('invokes listTasks without error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.ListTasksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1.Task()), - generateSampleMessage(new protos.google.cloud.batch.v1.Task()), - generateSampleMessage(new protos.google.cloud.batch.v1.Task()), - ]; - client.innerApiCalls.listTasks = stubSimpleCall(expectedResponse); - const [response] = await client.listTasks(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listTasks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTasks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listTasks without error using callback', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.ListTasksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1.Task()), - generateSampleMessage(new protos.google.cloud.batch.v1.Task()), - generateSampleMessage(new protos.google.cloud.batch.v1.Task()), - ]; - client.innerApiCalls.listTasks = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listTasks( - request, - (err?: Error|null, result?: protos.google.cloud.batch.v1.ITask[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listTasks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTasks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listTasks with error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.ListTasksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listTasks = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTasks(request), expectedError); - const actualRequest = (client.innerApiCalls.listTasks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTasks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listTasksStream without error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.ListTasksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1.Task()), - generateSampleMessage(new protos.google.cloud.batch.v1.Task()), - generateSampleMessage(new protos.google.cloud.batch.v1.Task()), - ]; - client.descriptors.page.listTasks.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listTasksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.batch.v1.Task[] = []; - stream.on('data', (response: protos.google.cloud.batch.v1.Task) => { - 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.listTasks.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTasks, request)); - assert( - (client.descriptors.page.listTasks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listTasksStream with error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.ListTasksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listTasks.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listTasksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.batch.v1.Task[] = []; - stream.on('data', (response: protos.google.cloud.batch.v1.Task) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listTasks.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTasks, request)); - assert( - (client.descriptors.page.listTasks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listTasks without error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.ListTasksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1.Task()), - generateSampleMessage(new protos.google.cloud.batch.v1.Task()), - generateSampleMessage(new protos.google.cloud.batch.v1.Task()), - ]; - client.descriptors.page.listTasks.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.batch.v1.ITask[] = []; - const iterable = client.listTasksAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listTasks.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listTasks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listTasks with error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1.ListTasksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listTasks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listTasksAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.batch.v1.ITask[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listTasks.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listTasks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation without error using callback', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.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 batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - 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 batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - 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 batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - 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 batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - describe('Path templates', () => { - - describe('job', () => { - const fakePath = "/rendered/path/job"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - }; - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.jobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.jobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('jobPath', () => { - const result = client.jobPath("projectValue", "locationValue", "jobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.jobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromJobName', () => { - const result = client.matchProjectFromJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.jobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromJobName', () => { - const result = client.matchLocationFromJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.jobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchJobFromJobName', () => { - const result = client.matchJobFromJobName(fakePath); - assert.strictEqual(result, "jobValue"); - assert((client.pathTemplates.jobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('task', () => { - const fakePath = "/rendered/path/task"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - task_group: "taskGroupValue", - task: "taskValue", - }; - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.taskPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.taskPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('taskPath', () => { - const result = client.taskPath("projectValue", "locationValue", "jobValue", "taskGroupValue", "taskValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.taskPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTaskName', () => { - const result = client.matchProjectFromTaskName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.taskPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTaskName', () => { - const result = client.matchLocationFromTaskName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.taskPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchJobFromTaskName', () => { - const result = client.matchJobFromTaskName(fakePath); - assert.strictEqual(result, "jobValue"); - assert((client.pathTemplates.taskPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTaskGroupFromTaskName', () => { - const result = client.matchTaskGroupFromTaskName(fakePath); - assert.strictEqual(result, "taskGroupValue"); - assert((client.pathTemplates.taskPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTaskFromTaskName', () => { - const result = client.matchTaskFromTaskName(fakePath); - assert.strictEqual(result, "taskValue"); - assert((client.pathTemplates.taskPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('taskGroup', () => { - const fakePath = "/rendered/path/taskGroup"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - task_group: "taskGroupValue", - }; - const client = new batchserviceModule.v1.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.taskGroupPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.taskGroupPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('taskGroupPath', () => { - const result = client.taskGroupPath("projectValue", "locationValue", "jobValue", "taskGroupValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.taskGroupPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTaskGroupName', () => { - const result = client.matchProjectFromTaskGroupName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.taskGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTaskGroupName', () => { - const result = client.matchLocationFromTaskGroupName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.taskGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchJobFromTaskGroupName', () => { - const result = client.matchJobFromTaskGroupName(fakePath); - assert.strictEqual(result, "jobValue"); - assert((client.pathTemplates.taskGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTaskGroupFromTaskGroupName', () => { - const result = client.matchTaskGroupFromTaskGroupName(fakePath); - assert.strictEqual(result, "taskGroupValue"); - assert((client.pathTemplates.taskGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-batch/v1/tsconfig.json b/owl-bot-staging/google-cloud-batch/v1/tsconfig.json deleted file mode 100644 index c78f1c884ef..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2018", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts" - ] -} diff --git a/owl-bot-staging/google-cloud-batch/v1/webpack.config.js b/owl-bot-staging/google-cloud-batch/v1/webpack.config.js deleted file mode 100644 index 04a4c53960a..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const path = require('path'); - -module.exports = { - entry: './src/index.ts', - output: { - library: 'BatchService', - filename: './batch-service.js', - }, - node: { - child_process: 'empty', - fs: 'empty', - crypto: 'empty', - }, - resolve: { - alias: { - '../../../package.json': path.resolve(__dirname, 'package.json'), - }, - extensions: ['.js', '.json', '.ts'], - }, - module: { - rules: [ - { - test: /\.tsx?$/, - use: 'ts-loader', - exclude: /node_modules/ - }, - { - test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]grpc/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]retry-request/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]gtoken/, - use: 'null-loader' - }, - ], - }, - mode: 'production', -}; diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/.eslintignore b/owl-bot-staging/google-cloud-batch/v1alpha/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/.eslintrc.json b/owl-bot-staging/google-cloud-batch/v1alpha/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/.gitignore b/owl-bot-staging/google-cloud-batch/v1alpha/.gitignore deleted file mode 100644 index d4f03a0df2e..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.log -**/node_modules -/.coverage -/coverage -/.nyc_output -/docs/ -/out/ -/build/ -system-test/secrets.js -system-test/*key.json -*.lock -.DS_Store -package-lock.json -__pycache__ diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/.jsdoc.js b/owl-bot-staging/google-cloud-batch/v1alpha/.jsdoc.js deleted file mode 100644 index f3c1e45a4fc..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -'use strict'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2024 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/batch', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/.mocharc.js b/owl-bot-staging/google-cloud-batch/v1alpha/.mocharc.js deleted file mode 100644 index 13b67c34edc..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/.prettierrc.js b/owl-bot-staging/google-cloud-batch/v1alpha/.prettierrc.js deleted file mode 100644 index 9a8fd690982..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/README.md b/owl-bot-staging/google-cloud-batch/v1alpha/README.md deleted file mode 100644 index 15b2fa3f3e4..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/README.md +++ /dev/null @@ -1 +0,0 @@ -Batch: Nodejs Client diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/package.json b/owl-bot-staging/google-cloud-batch/v1alpha/package.json deleted file mode 100644 index d27d57773ff..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "@google-cloud/batch", - "version": "0.1.0", - "description": "Batch client for Node.js", - "repository": "googleapis/nodejs-batch", - "license": "Apache-2.0", - "author": "Google LLC", - "main": "build/src/index.js", - "files": [ - "build/src", - "build/protos" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "google batch", - "batch", - "batch service" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^4.3.4" - }, - "devDependencies": { - "@types/mocha": "^10.0.6", - "@types/node": "^20.12.12", - "@types/sinon": "^10.0.20", - "c8": "^9.1.0", - "gapic-tools": "^0.4.2", - "gts": "5.3.0", - "jsdoc": "^4.0.3", - "jsdoc-fresh": "^3.0.0", - "jsdoc-region-tag": "^3.0.0", - "mocha": "^10.4.0", - "pack-n-play": "^2.0.3", - "sinon": "^15.2.0", - "typescript": "5.1.6" - }, - "engines": { - "node": ">=v14" - } -} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/batch.proto b/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/batch.proto deleted file mode 100644 index 7591e92c08e..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/batch.proto +++ /dev/null @@ -1,587 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.batch.v1alpha; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/field_info.proto"; -import "google/api/resource.proto"; -import "google/cloud/batch/v1alpha/job.proto"; -import "google/cloud/batch/v1alpha/resource_allowance.proto"; -import "google/cloud/batch/v1alpha/task.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.Batch.V1Alpha"; -option go_package = "cloud.google.com/go/batch/apiv1alpha/batchpb;batchpb"; -option java_multiple_files = true; -option java_outer_classname = "BatchProto"; -option java_package = "com.google.cloud.batch.v1alpha"; -option objc_class_prefix = "GCB"; -option php_namespace = "Google\\Cloud\\Batch\\V1alpha"; -option ruby_package = "Google::Cloud::Batch::V1alpha"; - -// Google Batch Service. -// The service manages user submitted batch jobs and allocates Google Compute -// Engine VM instances to run the jobs. -service BatchService { - option (google.api.default_host) = "batch.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Create a Job. - rpc CreateJob(CreateJobRequest) returns (Job) { - option (google.api.http) = { - post: "/v1alpha/{parent=projects/*/locations/*}/jobs" - body: "job" - }; - option (google.api.method_signature) = "parent,job,job_id"; - } - - // Get a Job specified by its resource name. - rpc GetJob(GetJobRequest) returns (Job) { - option (google.api.http) = { - get: "/v1alpha/{name=projects/*/locations/*/jobs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Delete a Job. - rpc DeleteJob(DeleteJobRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1alpha/{name=projects/*/locations/*/jobs/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "google.cloud.batch.v1alpha.OperationMetadata" - }; - } - - // Cancel a Job. - rpc CancelJob(CancelJobRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1alpha/{name=projects/*/locations/*/jobs/*}:cancel" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.cloud.batch.v1alpha.CancelJobResponse" - metadata_type: "google.cloud.batch.v1alpha.OperationMetadata" - }; - } - - // Update a Job. - rpc UpdateJob(UpdateJobRequest) returns (Job) { - option (google.api.http) = { - patch: "/v1alpha/{job.name=projects/*/locations/*/jobs/*}" - body: "job" - }; - option (google.api.method_signature) = "job,update_mask"; - } - - // List all Jobs for a project within a region. - rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) { - option (google.api.http) = { - get: "/v1alpha/{parent=projects/*/locations/*}/jobs" - }; - option (google.api.method_signature) = "parent"; - } - - // Return a single Task. - rpc GetTask(GetTaskRequest) returns (Task) { - option (google.api.http) = { - get: "/v1alpha/{name=projects/*/locations/*/jobs/*/taskGroups/*/tasks/*}" - }; - option (google.api.method_signature) = "name"; - } - - // List Tasks associated with a job. - rpc ListTasks(ListTasksRequest) returns (ListTasksResponse) { - option (google.api.http) = { - get: "/v1alpha/{parent=projects/*/locations/*/jobs/*/taskGroups/*}/tasks" - }; - option (google.api.method_signature) = "parent"; - } - - // Create a Resource Allowance. - rpc CreateResourceAllowance(CreateResourceAllowanceRequest) - returns (ResourceAllowance) { - option (google.api.http) = { - post: "/v1alpha/{parent=projects/*/locations/*}/resourceAllowances" - body: "resource_allowance" - }; - option (google.api.method_signature) = - "parent,resource_allowance,resource_allowance_id"; - } - - // Get a ResourceAllowance specified by its resource name. - rpc GetResourceAllowance(GetResourceAllowanceRequest) - returns (ResourceAllowance) { - option (google.api.http) = { - get: "/v1alpha/{name=projects/*/locations/*/resourceAllowances/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Delete a ResourceAllowance. - rpc DeleteResourceAllowance(DeleteResourceAllowanceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1alpha/{name=projects/*/locations/*/resourceAllowances/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "google.cloud.batch.v1alpha.OperationMetadata" - }; - } - - // List all ResourceAllowances for a project within a region. - rpc ListResourceAllowances(ListResourceAllowancesRequest) - returns (ListResourceAllowancesResponse) { - option (google.api.http) = { - get: "/v1alpha/{parent=projects/*/locations/*}/resourceAllowances" - }; - option (google.api.method_signature) = "parent"; - } - - // Update a Resource Allowance. - rpc UpdateResourceAllowance(UpdateResourceAllowanceRequest) - returns (ResourceAllowance) { - option (google.api.http) = { - patch: "/v1alpha/{resource_allowance.name=projects/*/locations/*/resourceAllowances/*}" - body: "resource_allowance" - }; - option (google.api.method_signature) = "resource_allowance,update_mask"; - } -} - -// CreateJob Request. -message CreateJobRequest { - // Required. The parent resource name where the Job will be created. - // Pattern: "projects/{project}/locations/{location}" - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { child_type: "batch.googleapis.com/Job" } - ]; - - // ID used to uniquely identify the Job within its parent scope. - // This field should contain at most 63 characters and must start with - // lowercase characters. - // Only lowercase characters, numbers and '-' are accepted. - // The '-' character cannot be the first or the last one. - // A system generated ID will be used if the field is not set. - // - // The job.name field in the request will be ignored and the created resource - // name of the Job will be "{parent}/jobs/{job_id}". - string job_id = 2; - - // Required. The Job to create. - Job job = 3 [(google.api.field_behavior) = REQUIRED]; - - // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// GetJob Request. -message GetJobRequest { - // Required. Job name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "batch.googleapis.com/Job" } - ]; -} - -// DeleteJob Request. -message DeleteJobRequest { - // Job name. - string name = 1; - - // Optional. Reason for this deletion. - string reason = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// CancelJob Request. -message CancelJobRequest { - // Required. Job name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "batch.googleapis.com/Job" } - ]; - - // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 4 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; -} - -// Response to the CancelJob request. -message CancelJobResponse {} - -// UpdateJob Request. -message UpdateJobRequest { - // Required. The Job to update. - // Only fields specified in `updateMask` are updated. - Job job = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Mask of fields to update. - // - // The `jobs.patch` method can only be used while a job is in the `QUEUED`, - // `SCHEDULED`, or `RUNNING` state and currently only supports increasing the - // value of the first `taskCount` field in the job's `taskGroups` field. - // Therefore, you must set the value of `updateMask` to `taskGroups`. Any - // other job fields in the update request will be ignored. - // - // For example, to update a job's `taskCount` to `2`, set `updateMask` to - // `taskGroups` and use the following request body: - // ``` - // { - // "taskGroups":[{ - // "taskCount": 2 - // }] - // } - // ``` - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 3 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; -} - -// ListJob Request. -message ListJobsRequest { - // Parent path. - string parent = 1; - - // List filter. - string filter = 4; - - // Optional. Sort results. Supported are "name", "name desc", "create_time", - // and "create_time desc". - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Page size. - int32 page_size = 2; - - // Page token. - string page_token = 3; -} - -// ListJob Response. -message ListJobsResponse { - // Jobs. - repeated Job jobs = 1; - - // Next page token. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// ListTasks Request. -message ListTasksRequest { - // Required. Name of a TaskGroup from which Tasks are being requested. - // Pattern: - // "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "batch.googleapis.com/TaskGroup" } - ]; - - // Task filter, null filter matches all Tasks. - // Filter string should be of the format State=TaskStatus.State e.g. - // State=RUNNING - string filter = 2; - - // Not implemented. - string order_by = 5; - - // Page size. - int32 page_size = 3; - - // Page token. - string page_token = 4; -} - -// ListTasks Response. -message ListTasksResponse { - // Tasks. - repeated Task tasks = 1; - - // Next page token. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// Request for a single Task by name. -message GetTaskRequest { - // Required. Task name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "batch.googleapis.com/Task" } - ]; -} - -// CreateResourceAllowance Request. -message CreateResourceAllowanceRequest { - // Required. The parent resource name where the ResourceAllowance will be - // created. Pattern: "projects/{project}/locations/{location}" - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "batch.googleapis.com/ResourceAllowance" - } - ]; - - // ID used to uniquely identify the ResourceAllowance within its parent scope. - // This field should contain at most 63 characters and must start with - // lowercase characters. - // Only lowercase characters, numbers and '-' are accepted. - // The '-' character cannot be the first or the last one. - // A system generated ID will be used if the field is not set. - // - // The resource_allowance.name field in the request will be ignored and the - // created resource name of the ResourceAllowance will be - // "{parent}/resourceAllowances/{resource_allowance_id}". - string resource_allowance_id = 2; - - // Required. The ResourceAllowance to create. - ResourceAllowance resource_allowance = 3 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 4 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; -} - -// GetResourceAllowance Request. -message GetResourceAllowanceRequest { - // Required. ResourceAllowance name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "batch.googleapis.com/ResourceAllowance" - } - ]; -} - -// DeleteResourceAllowance Request. -message DeleteResourceAllowanceRequest { - // Required. ResourceAllowance name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "batch.googleapis.com/ResourceAllowance" - } - ]; - - // Optional. Reason for this deletion. - string reason = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 4 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; -} - -// ListResourceAllowances Request. -message ListResourceAllowancesRequest { - // Required. Parent path. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "batch.googleapis.com/ResourceAllowance" - } - ]; - - // Optional. Page size. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Page token. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// ListResourceAllowances Response. -message ListResourceAllowancesResponse { - // ResourceAllowances. - repeated ResourceAllowance resource_allowances = 1; - - // Next page token. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// UpdateResourceAllowance Request. -message UpdateResourceAllowanceRequest { - // Required. The ResourceAllowance to update. - // Update description. - // Only fields specified in `update_mask` are updated. - ResourceAllowance resource_allowance = 1 - [(google.api.field_behavior) = REQUIRED]; - - // Required. Mask of fields to update. - // - // Field mask is used to specify the fields to be overwritten in the - // ResourceAllowance resource by the update. - // The fields specified in the update_mask are relative to the resource, not - // the full request. A field will be overwritten if it is in the mask. If the - // user does not provide a mask then all fields will be overwritten. - // - // UpdateResourceAllowance request now only supports update on `limit` field. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 3 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; -} - -// Represents the metadata of the long-running operation. -message OperationMetadata { - // Output only. The time the operation was created. - google.protobuf.Timestamp create_time = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time the operation finished running. - google.protobuf.Timestamp end_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Server-defined resource path for the target of the operation. - string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Name of the verb executed by the operation. - string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Human-readable status of the operation, if any. - string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Identifies whether the user has requested cancellation - // of the operation. Operations that have successfully been cancelled - // have - // [google.longrunning.Operation.error][google.longrunning.Operation.error] - // value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - // corresponding to `Code.CANCELLED`. - bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. API version used to start the operation. - string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/job.proto b/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/job.proto deleted file mode 100644 index 8ab62c01f9a..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/job.proto +++ /dev/null @@ -1,802 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.batch.v1alpha; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/batch/v1alpha/task.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.Batch.V1Alpha"; -option go_package = "cloud.google.com/go/batch/apiv1alpha/batchpb;batchpb"; -option java_multiple_files = true; -option java_outer_classname = "JobProto"; -option java_package = "com.google.cloud.batch.v1alpha"; -option objc_class_prefix = "GCB"; -option php_namespace = "Google\\Cloud\\Batch\\V1alpha"; -option ruby_package = "Google::Cloud::Batch::V1alpha"; - -// The Cloud Batch Job description. -message Job { - option (google.api.resource) = { - type: "batch.googleapis.com/Job" - pattern: "projects/{project}/locations/{location}/jobs/{job}" - }; - - // The order that TaskGroups are scheduled relative to each other. - // - // Not yet implemented. - enum SchedulingPolicy { - // Unspecified. - SCHEDULING_POLICY_UNSPECIFIED = 0; - - // Run all TaskGroups as soon as possible. - AS_SOON_AS_POSSIBLE = 1; - } - - // Output only. Job name. - // For example: "projects/123456/locations/us-central1/jobs/job01". - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A system generated unique ID for the Job. - string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Priority of the Job. - // The valid value range is [0, 100). Default value is 0. - // Higher value indicates higher priority. - // A job with higher priority value is more likely to run earlier if all other - // requirements are satisfied. - int64 priority = 3; - - // Required. TaskGroups in the Job. Only one TaskGroup is supported now. - repeated TaskGroup task_groups = 4 [(google.api.field_behavior) = REQUIRED]; - - // Scheduling policy for TaskGroups in the job. - SchedulingPolicy scheduling_policy = 5; - - // At least one of the dependencies must be satisfied before the Job is - // scheduled to run. - // Only one JobDependency is supported now. - // Not yet implemented. - repeated JobDependency dependencies = 6; - - // Compute resource allocation for all TaskGroups in the Job. - AllocationPolicy allocation_policy = 7; - - // Custom labels to apply to the job and any Cloud Logging - // [LogEntry](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry) - // that it generates. - // - // Use labels to group and describe the resources they are applied to. Batch - // automatically applies predefined labels and supports multiple `labels` - // fields for each job, which each let you apply custom labels to various - // resources. Label names that start with "goog-" or "google-" are - // reserved for predefined labels. For more information about labels with - // Batch, see - // [Organize resources using - // labels](https://cloud.google.com/batch/docs/organize-resources-using-labels). - map labels = 8; - - // Output only. Job status. It is read only for users. - JobStatus status = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Deprecated: please use notifications instead. - JobNotification notification = 10 [deprecated = true]; - - // Output only. When the Job was created. - google.protobuf.Timestamp create_time = 11 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The last time the Job was updated. - google.protobuf.Timestamp update_time = 12 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Log preservation policy for the Job. - LogsPolicy logs_policy = 13; - - // Notification configurations. - repeated JobNotification notifications = 14; -} - -// LogsPolicy describes if and how a job's logs are preserved. Logs include -// information that is automatically written by the Batch service agent and any -// information that you configured the job's runnables to write to the `stdout` -// or `stderr` streams. -message LogsPolicy { - // `CloudLoggingOption` contains additional settings for Cloud Logging logs - // generated by Batch job. - message CloudLoggingOption { - // Optional. Set this field to `true` to change the [monitored resource - // type](https://cloud.google.com/monitoring/api/resources) for - // Cloud Logging logs generated by this Batch job from - // the - // [`batch.googleapis.com/Job`](https://cloud.google.com/monitoring/api/resources#tag_batch.googleapis.com/Job) - // type to the formerly used - // [`generic_task`](https://cloud.google.com/monitoring/api/resources#tag_generic_task) - // type. - bool use_generic_task_monitored_resource = 1 - [(google.api.field_behavior) = OPTIONAL]; - } - - // The destination (if any) for logs. - enum Destination { - // (Default) Logs are not preserved. - DESTINATION_UNSPECIFIED = 0; - - // Logs are streamed to Cloud Logging. Optionally, you can configure - // additional settings in the `cloudLoggingOption` field. - CLOUD_LOGGING = 1; - - // Logs are saved to the file path specified in the `logsPath` field. - PATH = 2; - } - - // If and where logs should be saved. - Destination destination = 1; - - // When `destination` is set to `PATH`, you must set this field to the path - // where you want logs to be saved. This path can point to a local directory - // on the VM or (if congifured) a directory under the mount path of any - // Cloud Storage bucket, network file system (NFS), or writable persistent - // disk that is mounted to the job. For example, if the job has a bucket with - // `mountPath` set to `/mnt/disks/my-bucket`, you can write logs to the - // root directory of the `remotePath` of that bucket by setting this field to - // `/mnt/disks/my-bucket/`. - string logs_path = 2; - - // Optional. When `destination` is set to `CLOUD_LOGGING`, you can optionally - // set this field to configure additional settings for Cloud Logging. - CloudLoggingOption cloud_logging_option = 3 - [(google.api.field_behavior) = OPTIONAL]; -} - -// JobDependency describes the state of other Jobs that the start of this Job -// depends on. -// All dependent Jobs must have been submitted in the same region. -message JobDependency { - // Dependency type. - enum Type { - // Unspecified. - TYPE_UNSPECIFIED = 0; - - // The dependent Job has succeeded. - SUCCEEDED = 1; - - // The dependent Job has failed. - FAILED = 2; - - // SUCCEEDED or FAILED. - FINISHED = 3; - } - - // Each item maps a Job name to a Type. - // All items must be satisfied for the JobDependency to be satisfied (the AND - // operation). - // Once a condition for one item becomes true, it won't go back to false - // even the dependent Job state changes again. - map items = 1; -} - -// Job status. -message JobStatus { - // VM instance status. - message InstanceStatus { - // The Compute Engine machine type. - string machine_type = 1; - - // The VM instance provisioning model. - AllocationPolicy.ProvisioningModel provisioning_model = 2; - - // The max number of tasks can be assigned to this instance type. - int64 task_pack = 3; - - // The VM boot disk. - AllocationPolicy.Disk boot_disk = 4; - } - - // Aggregated task status for a TaskGroup. - message TaskGroupStatus { - // Count of task in each state in the TaskGroup. - // The map key is task state name. - map counts = 1; - - // Status of instances allocated for the TaskGroup. - repeated InstanceStatus instances = 2; - } - - // Valid Job states. - enum State { - // Job state unspecified. - STATE_UNSPECIFIED = 0; - - // Job is admitted (validated and persisted) and waiting for resources. - QUEUED = 1; - - // Job is scheduled to run as soon as resource allocation is ready. - // The resource allocation may happen at a later time but with a high - // chance to succeed. - SCHEDULED = 2; - - // Resource allocation has been successful. At least one Task in the Job is - // RUNNING. - RUNNING = 3; - - // All Tasks in the Job have finished successfully. - SUCCEEDED = 4; - - // At least one Task in the Job has failed. - FAILED = 5; - - // The Job will be deleted, but has not been deleted yet. Typically this is - // because resources used by the Job are still being cleaned up. - DELETION_IN_PROGRESS = 6; - - // The Job cancellation is in progress, this is because the resources used - // by the Job are still being cleaned up. - CANCELLATION_IN_PROGRESS = 7; - - // The Job has been cancelled, the task executions were stopped and the - // resources were cleaned up. - CANCELLED = 8; - } - - // Job state - State state = 1; - - // Job status events - repeated StatusEvent status_events = 2; - - // Aggregated task status for each TaskGroup in the Job. - // The map key is TaskGroup ID. - map task_groups = 4; - - // The duration of time that the Job spent in status RUNNING. - google.protobuf.Duration run_duration = 5; - - // The resource usage of the job. - ResourceUsage resource_usage = 6; -} - -// ResourceUsage describes the resource usage of the job. -message ResourceUsage { - // The CPU core hours that the job consumes. - double core_hours = 1; -} - -// Notification configurations. -message JobNotification { - // Message details. - // Describe the conditions under which messages will be sent. - // If no attribute is defined, no message will be sent by default. - // One message should specify either the job or the task level attributes, - // but not both. For example, - // job level: JOB_STATE_CHANGED and/or a specified new_job_state; - // task level: TASK_STATE_CHANGED and/or a specified new_task_state. - message Message { - // The message type. - Type type = 1; - - // The new job state. - JobStatus.State new_job_state = 2; - - // The new task state. - TaskStatus.State new_task_state = 3; - } - - // The message type. - enum Type { - // Unspecified. - TYPE_UNSPECIFIED = 0; - - // Notify users that the job state has changed. - JOB_STATE_CHANGED = 1; - - // Notify users that the task state has changed. - TASK_STATE_CHANGED = 2; - } - - // The Pub/Sub topic where notifications for the job, like state - // changes, will be published. If undefined, no Pub/Sub notifications - // are sent for this job. - // - // Specify the topic using the following format: - // `projects/{project}/topics/{topic}`. - // Notably, if you want to specify a Pub/Sub topic that is in a - // different project than the job, your administrator must grant your - // project's Batch service agent permission to publish to that topic. - // - // For more information about configuring Pub/Sub notifications for - // a job, see - // https://cloud.google.com/batch/docs/enable-notifications. - string pubsub_topic = 1; - - // The attribute requirements of messages to be sent to this Pub/Sub topic. - // Without this field, no message will be sent. - Message message = 2; -} - -// A Job's resource allocation policy describes when, where, and how compute -// resources should be allocated for the Job. -message AllocationPolicy { - message LocationPolicy { - // A list of allowed location names represented by internal URLs. - // - // Each location can be a region or a zone. - // Only one region or multiple zones in one region is supported now. - // For example, - // ["regions/us-central1"] allow VMs in any zones in region us-central1. - // ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs - // in zones us-central1-a and us-central1-c. - // - // Mixing locations from different regions would cause errors. - // For example, - // ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b", - // "zones/us-west1-a"] contains locations from two distinct regions: - // us-central1 and us-west1. This combination will trigger an error. - repeated string allowed_locations = 1; - - // A list of denied location names. - // - // Not yet implemented. - repeated string denied_locations = 2; - } - - // A new persistent disk or a local ssd. - // A VM can only have one local SSD setting but multiple local SSD partitions. - // See https://cloud.google.com/compute/docs/disks#pdspecs and - // https://cloud.google.com/compute/docs/disks#localssds. - message Disk { - // A data source from which a PD will be created. - oneof data_source { - // URL for a VM image to use as the data source for this disk. - // For example, the following are all valid URLs: - // - // * Specify the image by its family name: - // projects/{project}/global/images/family/{image_family} - // * Specify the image version: - // projects/{project}/global/images/{image_version} - // - // You can also use Batch customized image in short names. - // The following image values are supported for a boot disk: - // - // * `batch-debian`: use Batch Debian images. - // * `batch-cos`: use Batch Container-Optimized images. - // * `batch-hpc-rocky`: use Batch HPC Rocky Linux images. - string image = 4; - - // Name of a snapshot used as the data source. - // Snapshot is not supported as boot disk now. - string snapshot = 5; - } - - // Disk type as shown in `gcloud compute disk-types list`. - // For example, local SSD uses type "local-ssd". - // Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd" - // or "pd-standard". If not specified, "pd-standard" will be used as the - // default type for non-boot disks, "pd-balanced" will be used as the - // default type for boot disks. - string type = 1; - - // Disk size in GB. - // - // **Non-Boot Disk**: - // If the `type` specifies a persistent disk, this field - // is ignored if `data_source` is set as `image` or `snapshot`. - // If the `type` specifies a local SSD, this field should be a multiple of - // 375 GB, otherwise, the final size will be the next greater multiple of - // 375 GB. - // - // **Boot Disk**: - // Batch will calculate the boot disk size based on source - // image and task requirements if you do not speicify the size. - // If both this field and the `boot_disk_mib` field in task spec's - // `compute_resource` are defined, Batch will only honor this field. - // Also, this field should be no smaller than the source disk's - // size when the `data_source` is set as `snapshot` or `image`. - // For example, if you set an image as the `data_source` field and the - // image's default disk size 30 GB, you can only use this field to make the - // disk larger or equal to 30 GB. - int64 size_gb = 2; - - // Local SSDs are available through both "SCSI" and "NVMe" interfaces. - // If not indicated, "NVMe" will be the default one for local ssds. - // This field is ignored for persistent disks as the interface is chosen - // automatically. See - // https://cloud.google.com/compute/docs/disks/persistent-disks#choose_an_interface. - string disk_interface = 6; - } - - // A new or an existing persistent disk (PD) or a local ssd attached to a VM - // instance. - message AttachedDisk { - oneof attached { - Disk new_disk = 1; - - // Name of an existing PD. - string existing_disk = 2; - } - - // Device name that the guest operating system will see. - // It is used by Runnable.volumes field to mount disks. So please specify - // the device_name if you want Batch to help mount the disk, and it should - // match the device_name field in volumes. - string device_name = 3; - } - - // Accelerator describes Compute Engine accelerators to be attached to the VM. - message Accelerator { - // The accelerator type. For example, "nvidia-tesla-t4". - // See `gcloud compute accelerator-types list`. - string type = 1; - - // The number of accelerators of this type. - int64 count = 2; - - // Deprecated: please use instances[0].install_gpu_drivers instead. - bool install_gpu_drivers = 3 [deprecated = true]; - - // Optional. The NVIDIA GPU driver version that should be installed for this - // type. - // - // You can define the specific driver version such as "470.103.01", - // following the driver version requirements in - // https://cloud.google.com/compute/docs/gpus/install-drivers-gpu#minimum-driver. - // Batch will install the specific accelerator driver if qualified. - string driver_version = 4 [(google.api.field_behavior) = OPTIONAL]; - } - - // InstancePolicy describes an instance type and resources attached to each VM - // created by this InstancePolicy. - message InstancePolicy { - // Deprecated: please use machine_type instead. - repeated string allowed_machine_types = 1 [deprecated = true]; - - // The Compute Engine machine type. - string machine_type = 2; - - // The minimum CPU platform. - // See - // https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. - string min_cpu_platform = 3; - - // The provisioning model. - ProvisioningModel provisioning_model = 4; - - // The accelerators attached to each VM instance. - repeated Accelerator accelerators = 5; - - // Boot disk to be created and attached to each VM by this InstancePolicy. - // Boot disk will be deleted when the VM is deleted. - // Batch API now only supports booting from image. - Disk boot_disk = 8; - - // Non-boot disks to be attached for each VM created by this InstancePolicy. - // New disks will be deleted when the VM is deleted. - // A non-boot disk is a disk that can be of a device with a - // file system or a raw storage drive that is not ready for data - // storage and accessing. - repeated AttachedDisk disks = 6; - - // Optional. If not specified (default), VMs will consume any applicable - // reservation. If "NO_RESERVATION" is specified, VMs will not consume any - // reservation. Otherwise, if specified, VMs will consume only the specified - // reservation. - string reservation = 7 [(google.api.field_behavior) = OPTIONAL]; - } - - // InstancePolicyOrTemplate lets you define the type of resources to use for - // this job either with an InstancePolicy or an instance template. - // If undefined, Batch picks the type of VM to use and doesn't include - // optional VM resources such as GPUs and extra disks. - message InstancePolicyOrTemplate { - oneof policy_template { - // InstancePolicy. - InstancePolicy policy = 1; - - // Name of an instance template used to create VMs. - // Named the field as 'instance_template' instead of 'template' to avoid - // C++ keyword conflict. - // - // Batch only supports global instance templates from the same project as - // the job. - // You can specify the global instance template as a full or partial URL. - string instance_template = 2; - } - - // Set this field true if you want Batch to help fetch drivers from a third - // party location and install them for GPUs specified in - // `policy.accelerators` or `instance_template` on your behalf. Default is - // false. - // - // For Container-Optimized Image cases, Batch will install the - // accelerator driver following milestones of - // https://cloud.google.com/container-optimized-os/docs/release-notes. For - // non Container-Optimized Image cases, following - // https://github.com/GoogleCloudPlatform/compute-gpu-installation/blob/main/linux/install_gpu_driver.py. - bool install_gpu_drivers = 3; - - // Optional. Set this field true if you want Batch to install Ops Agent on - // your behalf. Default is false. - bool install_ops_agent = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Set this field to `true` if you want Batch to block - // project-level SSH keys from accessing this job's VMs. Alternatively, you - // can configure the job to specify a VM instance template that blocks - // project-level SSH keys. In either case, Batch blocks project-level SSH - // keys while creating the VMs for this job. - // - // Batch allows project-level SSH keys for a job's VMs only if all - // the following are true: - // - // + This field is undefined or set to `false`. - // + The job's VM instance template (if any) doesn't block project-level - // SSH keys. - // - // Notably, you can override this behavior by manually updating a VM to - // block or allow project-level SSH keys. For more information about - // blocking project-level SSH keys, see the Compute Engine documentation: - // https://cloud.google.com/compute/docs/connect/restrict-ssh-keys#block-keys - bool block_project_ssh_keys = 5 [(google.api.field_behavior) = OPTIONAL]; - } - - // A network interface. - message NetworkInterface { - // The URL of an existing network resource. - // You can specify the network as a full or partial URL. - // - // For example, the following are all valid URLs: - // - // * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network} - // * projects/{project}/global/networks/{network} - // * global/networks/{network} - string network = 1; - - // The URL of an existing subnetwork resource in the network. - // You can specify the subnetwork as a full or partial URL. - // - // For example, the following are all valid URLs: - // - // * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork} - // * projects/{project}/regions/{region}/subnetworks/{subnetwork} - // * regions/{region}/subnetworks/{subnetwork} - string subnetwork = 2; - - // Default is false (with an external IP address). Required if - // no external public IP address is attached to the VM. If no external - // public IP address, additional configuration is required to allow the VM - // to access Google Services. See - // https://cloud.google.com/vpc/docs/configure-private-google-access and - // https://cloud.google.com/nat/docs/gce-example#create-nat for more - // information. - bool no_external_ip_address = 3; - } - - // NetworkPolicy describes VM instance network configurations. - message NetworkPolicy { - // Network configurations. - repeated NetworkInterface network_interfaces = 1; - } - - // PlacementPolicy describes a group placement policy for the VMs controlled - // by this AllocationPolicy. - message PlacementPolicy { - // UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you - // want VMs to be located close to each other for low network latency - // between the VMs. No placement policy will be generated when collocation - // is UNSPECIFIED. - string collocation = 1; - - // When specified, causes the job to fail if more than max_distance logical - // switches are required between VMs. Batch uses the most compact possible - // placement of VMs even when max_distance is not specified. An explicit - // max_distance makes that level of compactness a strict requirement. - // Not yet implemented - int64 max_distance = 2; - } - - // Compute Engine VM instance provisioning model. - enum ProvisioningModel { - // Unspecified. - PROVISIONING_MODEL_UNSPECIFIED = 0; - - // Standard VM. - STANDARD = 1; - - // SPOT VM. - SPOT = 2; - - // Preemptible VM (PVM). - // - // Above SPOT VM is the preferable model for preemptible VM instances: the - // old preemptible VM model (indicated by this field) is the older model, - // and has been migrated to use the SPOT model as the underlying technology. - // This old model will still be supported. - PREEMPTIBLE = 3; - } - - // Location where compute resources should be allocated for the Job. - LocationPolicy location = 1; - - // Deprecated: please use instances[0].policy instead. - InstancePolicy instance = 2 [deprecated = true]; - - // Describe instances that can be created by this AllocationPolicy. - // Only instances[0] is supported now. - repeated InstancePolicyOrTemplate instances = 8; - - // Deprecated: please use instances[0].template instead. - repeated string instance_templates = 3 [deprecated = true]; - - // Deprecated: please use instances[0].policy.provisioning_model instead. - repeated ProvisioningModel provisioning_models = 4 [deprecated = true]; - - // Deprecated: please use service_account instead. - string service_account_email = 5 [deprecated = true]; - - // Defines the service account for Batch-created VMs. If omitted, the [default - // Compute Engine service - // account](https://cloud.google.com/compute/docs/access/service-accounts#default_service_account) - // is used. Must match the service account specified in any used instance - // template configured in the Batch job. - // - // Includes the following fields: - // * email: The service account's email address. If not set, the default - // Compute Engine service account is used. - // * scopes: Additional OAuth scopes to grant the service account, beyond the - // default cloud-platform scope. (list of strings) - ServiceAccount service_account = 9; - - // Custom labels to apply to the job and all the Compute Engine resources - // that both are created by this allocation policy and support labels. - // - // Use labels to group and describe the resources they are applied to. Batch - // automatically applies predefined labels and supports multiple `labels` - // fields for each job, which each let you apply custom labels to various - // resources. Label names that start with "goog-" or "google-" are - // reserved for predefined labels. For more information about labels with - // Batch, see - // [Organize resources using - // labels](https://cloud.google.com/batch/docs/organize-resources-using-labels). - map labels = 6; - - // The network policy. - // - // If you define an instance template in the `InstancePolicyOrTemplate` field, - // Batch will use the network settings in the instance template instead of - // this field. - NetworkPolicy network = 7; - - // The placement policy. - PlacementPolicy placement = 10; - - // Optional. Tags applied to the VM instances. - // - // The tags identify valid sources or targets for network firewalls. - // Each tag must be 1-63 characters long, and comply with - // [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). - repeated string tags = 11 [(google.api.field_behavior) = OPTIONAL]; -} - -// A TaskGroup defines one or more Tasks that all share the same TaskSpec. -message TaskGroup { - option (google.api.resource) = { - type: "batch.googleapis.com/TaskGroup" - pattern: "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" - }; - - // How Tasks in the TaskGroup should be scheduled relative to each other. - enum SchedulingPolicy { - // Unspecified. - SCHEDULING_POLICY_UNSPECIFIED = 0; - - // Run Tasks as soon as resources are available. - // - // Tasks might be executed in parallel depending on parallelism and - // task_count values. - AS_SOON_AS_POSSIBLE = 1; - - // Run Tasks sequentially with increased task index. - IN_ORDER = 2; - } - - // Output only. TaskGroup name. - // The system generates this field based on parent Job name. - // For example: - // "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01". - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. Tasks in the group share the same task spec. - TaskSpec task_spec = 3 [(google.api.field_behavior) = REQUIRED]; - - // Number of Tasks in the TaskGroup. - // Default is 1. - int64 task_count = 4; - - // Max number of tasks that can run in parallel. - // Default to min(task_count, parallel tasks per job limit). - // See: [Job Limits](https://cloud.google.com/batch/quotas#job_limits). - // Field parallelism must be 1 if the scheduling_policy is IN_ORDER. - int64 parallelism = 5; - - // Scheduling policy for Tasks in the TaskGroup. - // The default value is AS_SOON_AS_POSSIBLE. - SchedulingPolicy scheduling_policy = 6; - - // Compute resource allocation for the TaskGroup. - // If specified, it overrides resources in Job. - AllocationPolicy allocation_policy = 7; - - // Labels for the TaskGroup. - // Labels could be user provided or system generated. - // You can assign up to 64 labels. [Google Compute Engine label - // restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions) - // apply. - // Label names that start with "goog-" or "google-" are reserved. - map labels = 8; - - // An array of environment variable mappings, which are passed to Tasks with - // matching indices. If task_environments is used then task_count should - // not be specified in the request (and will be ignored). Task count will be - // the length of task_environments. - // - // Tasks get a BATCH_TASK_INDEX and BATCH_TASK_COUNT environment variable, in - // addition to any environment variables set in task_environments, specifying - // the number of Tasks in the Task's parent TaskGroup, and the specific Task's - // index in the TaskGroup (0 through BATCH_TASK_COUNT - 1). - repeated Environment task_environments = 9; - - // Max number of tasks that can be run on a VM at the same time. - // If not specified, the system will decide a value based on available - // compute resources on a VM and task requirements. - int64 task_count_per_node = 10; - - // When true, Batch will populate a file with a list of all VMs assigned to - // the TaskGroup and set the BATCH_HOSTS_FILE environment variable to the path - // of that file. Defaults to false. The host file supports up to 1000 VMs. - bool require_hosts_file = 11; - - // When true, Batch will configure SSH to allow passwordless login between - // VMs running the Batch tasks in the same TaskGroup. - bool permissive_ssh = 12; - - // Optional. If not set or set to false, Batch uses the root user to execute - // runnables. If set to true, Batch runs the runnables using a non-root user. - // Currently, the non-root user Batch used is generated by OS Login. For more - // information, see [About OS - // Login](https://cloud.google.com/compute/docs/oslogin). - bool run_as_non_root = 14 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. ServiceAccount used by tasks within the task group for the access - // to other Cloud resources. This allows tasks to operate with permissions - // distinct from the service account for the VM set at `AllocationPolicy`. Use - // this field when tasks require different access rights than those of the VM. - // - // Specify the service account's `email` field. Ensure `scopes` - // include any necessary permissions for tasks, in addition to the default - // 'cloud-platform' scope. - ServiceAccount service_account = 15 [(google.api.field_behavior) = OPTIONAL]; -} - -// Carries information about a Google Cloud service account. -message ServiceAccount { - // Email address of the service account. - string email = 1; - - // List of scopes to be enabled for this service account. - repeated string scopes = 2; -} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/notification.proto b/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/notification.proto deleted file mode 100644 index 6eedfc615c5..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/notification.proto +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.batch.v1alpha; - -import "google/api/field_behavior.proto"; - -option csharp_namespace = "Google.Cloud.Batch.V1Alpha"; -option go_package = "cloud.google.com/go/batch/apiv1alpha/batchpb;batchpb"; -option java_multiple_files = true; -option java_outer_classname = "NotificationProto"; -option java_package = "com.google.cloud.batch.v1alpha"; -option objc_class_prefix = "GCB"; -option php_namespace = "Google\\Cloud\\Batch\\V1alpha"; -option ruby_package = "Google::Cloud::Batch::V1alpha"; - -// Notification on resource state change. -message Notification { - // Required. The Pub/Sub topic where notifications like the resource allowance - // state changes will be published. The topic must exist in the same project - // as the job and billings will be charged to this project. If not specified, - // no Pub/Sub messages will be sent. Topic format: - // `projects/{project}/topics/{topic}`. - string pubsub_topic = 1 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/resource_allowance.proto b/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/resource_allowance.proto deleted file mode 100644 index 988271f5802..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/resource_allowance.proto +++ /dev/null @@ -1,208 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.batch.v1alpha; - -import "google/api/field_behavior.proto"; -import "google/api/field_info.proto"; -import "google/api/resource.proto"; -import "google/cloud/batch/v1alpha/notification.proto"; -import "google/protobuf/timestamp.proto"; -import "google/type/interval.proto"; - -option csharp_namespace = "Google.Cloud.Batch.V1Alpha"; -option go_package = "cloud.google.com/go/batch/apiv1alpha/batchpb;batchpb"; -option java_multiple_files = true; -option java_outer_classname = "ResourceAllowanceProto"; -option java_package = "com.google.cloud.batch.v1alpha"; -option objc_class_prefix = "GCB"; -option php_namespace = "Google\\Cloud\\Batch\\V1alpha"; -option ruby_package = "Google::Cloud::Batch::V1alpha"; - -// A `CalendarPeriod` represents the abstract concept of a time period that -// has a canonical start. All calendar times begin at 12 AM US and Canadian -// Pacific Time (UTC-8). -enum CalendarPeriod { - // Unspecified. - CALENDAR_PERIOD_UNSPECIFIED = 0; - - // The month starts on the first date of the month and resets at the beginning - // of each month. - MONTH = 1; - - // The quarter starts on dates January 1, April 1, July 1, and October 1 of - // each year and resets at the beginning of the next quarter. - QUARTER = 2; - - // The year starts on January 1 and resets at the beginning of the next year. - YEAR = 3; - - // The week period starts and resets every Monday. - WEEK = 4; - - // The day starts at 12:00am. - DAY = 5; -} - -// ResourceAllowance valid state. -enum ResourceAllowanceState { - // Unspecified. - RESOURCE_ALLOWANCE_STATE_UNSPECIFIED = 0; - - // ResourceAllowance is active and in use. - RESOURCE_ALLOWANCE_ACTIVE = 1; - - // ResourceAllowance limit is reached. - RESOURCE_ALLOWANCE_DEPLETED = 2; -} - -// The Resource Allowance description for Cloud Batch. -// Only one Resource Allowance is supported now under a specific location and -// project. -message ResourceAllowance { - option (google.api.resource) = { - type: "batch.googleapis.com/ResourceAllowance" - pattern: "projects/{project}/locations/{location}/resourceAllowances/{resource_allowance}" - plural: "resourceAllowances" - singular: "resourceAllowance" - }; - - // ResourceAllowance detail. - oneof resource_allowance { - // The detail of usage resource allowance. - UsageResourceAllowance usage_resource_allowance = 4; - } - - // Identifier. ResourceAllowance name. - // For example: - // "projects/123456/locations/us-central1/resourceAllowances/resource-allowance-1". - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Output only. A system generated unique ID (in UUID4 format) for the - // ResourceAllowance. - string uid = 2 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OUTPUT_ONLY - ]; - - // Output only. Time when the ResourceAllowance was created. - google.protobuf.Timestamp create_time = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Labels are attributes that can be set and used by both the - // user and by Batch. Labels must meet the following constraints: - // - // * Keys and values can contain only lowercase letters, numeric characters, - // underscores, and dashes. - // * All characters must use UTF-8 encoding, and international characters are - // allowed. - // * Keys must start with a lowercase letter or international character. - // * Each resource is limited to a maximum of 64 labels. - // - // Both keys and values are additionally constrained to be <= 128 bytes. - map labels = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Notification configurations. - repeated Notification notifications = 6 - [(google.api.field_behavior) = OPTIONAL]; -} - -// UsageResourceAllowance describes the detail of usage resource allowance. -message UsageResourceAllowance { - // Required. Spec of a usage ResourceAllowance. - UsageResourceAllowanceSpec spec = 1 [(google.api.field_behavior) = REQUIRED]; - - // Output only. Status of a usage ResourceAllowance. - UsageResourceAllowanceStatus status = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Spec of a usage ResourceAllowance. -message UsageResourceAllowanceSpec { - // UsageResourceAllowance limitation. - message Limit { - oneof duration { - // Optional. A CalendarPeriod represents the abstract concept of a time - // period that has a canonical start. - CalendarPeriod calendar_period = 1 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Required. Limit value of a UsageResourceAllowance within its one - // duration. - // - // Limit cannot be a negative value. Default is 0. - // For example, you can set `limit` as 10000.0 with duration of the current - // month by setting `calendar_period` field as monthly. That means in your - // current month, 10000.0 is the core hour limitation that your resources - // are allowed to consume. - optional double limit = 2 [(google.api.field_behavior) = REQUIRED]; - } - - // Required. Spec type is unique for each usage ResourceAllowance. - // Batch now only supports type as "cpu-core-hours" for CPU usage consumption - // tracking. - string type = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Threshold of a UsageResourceAllowance limiting how many resources - // can be consumed for each type. - Limit limit = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Status of a usage ResourceAllowance. -message UsageResourceAllowanceStatus { - // UsageResourceAllowanceStatus detail about usage consumption. - message LimitStatus { - // Output only. The consumption interval. - google.type.Interval consumption_interval = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Limit value of a UsageResourceAllowance within its one - // duration. - optional double limit = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Accumulated consumption during `consumption_interval`. - optional double consumed = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - message PeriodConsumption { - // Output only. The consumption interval. - google.type.Interval consumption_interval = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Accumulated consumption during `consumption_interval`. - optional double consumed = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // ConsumptionReport is the report of ResourceAllowance consumptions in a time - // period. - message ConsumptionReport { - // Output only. ResourceAllowance consumptions in the latest calendar - // period. Key is the calendar period in string format. Batch currently - // supports HOUR, DAY, MONTH and YEAR. - map latest_period_consumptions = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Output only. ResourceAllowance state. - ResourceAllowanceState state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. ResourceAllowance consumption status for usage resources. - LimitStatus limit_status = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The report of ResourceAllowance consumptions in a time period. - ConsumptionReport report = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/task.proto b/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/task.proto deleted file mode 100644 index 08a20f499dd..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/task.proto +++ /dev/null @@ -1,494 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.batch.v1alpha; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/batch/v1alpha/volume.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.Batch.V1Alpha"; -option go_package = "cloud.google.com/go/batch/apiv1alpha/batchpb;batchpb"; -option java_multiple_files = true; -option java_outer_classname = "TaskProto"; -option java_package = "com.google.cloud.batch.v1alpha"; -option objc_class_prefix = "GCB"; -option php_namespace = "Google\\Cloud\\Batch\\V1alpha"; -option ruby_package = "Google::Cloud::Batch::V1alpha"; - -// Compute resource requirements. -// -// ComputeResource defines the amount of resources required for each task. -// Make sure your tasks have enough resources to successfully run. -// If you also define the types of resources for a job to use with the -// [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) -// field, make sure both fields are compatible with each other. -message ComputeResource { - // The milliCPU count. - // - // `cpuMilli` defines the amount of CPU resources per task in milliCPU units. - // For example, `1000` corresponds to 1 vCPU per task. If undefined, the - // default value is `2000`. - // - // If you also define the VM's machine type using the `machineType` in - // [InstancePolicy](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicy) - // field or inside the `instanceTemplate` in the - // [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) - // field, make sure the CPU resources for both fields are compatible with each - // other and with how many tasks you want to allow to run on the same VM at - // the same time. - // - // For example, if you specify the `n2-standard-2` machine type, which has 2 - // vCPUs each, you are recommended to set `cpuMilli` no more than `2000`, or - // you are recommended to run two tasks on the same VM if you set `cpuMilli` - // to `1000` or less. - int64 cpu_milli = 1; - - // Memory in MiB. - // - // `memoryMib` defines the amount of memory per task in MiB units. - // If undefined, the default value is `2000`. - // If you also define the VM's machine type using the `machineType` in - // [InstancePolicy](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicy) - // field or inside the `instanceTemplate` in the - // [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) - // field, make sure the memory resources for both fields are compatible with - // each other and with how many tasks you want to allow to run on the same VM - // at the same time. - // - // For example, if you specify the `n2-standard-2` machine type, which has 8 - // GiB each, you are recommended to set `memoryMib` to no more than `8192`, - // or you are recommended to run two tasks on the same VM if you set - // `memoryMib` to `4096` or less. - int64 memory_mib = 2; - - // The GPU count. - // - // Not yet implemented. - int64 gpu_count = 3; - - // Extra boot disk size in MiB for each task. - int64 boot_disk_mib = 4; -} - -// Status event. -message StatusEvent { - // Type of the event. - string type = 3; - - // Description of the event. - string description = 1; - - // The time this event occurred. - google.protobuf.Timestamp event_time = 2; - - // Task Execution. - // This field is only defined for task-level status events where the task - // fails. - TaskExecution task_execution = 4; - - // Task State. - // This field is only defined for task-level status events. - TaskStatus.State task_state = 5; -} - -// This Task Execution field includes detail information for -// task execution procedures, based on StatusEvent types. -message TaskExecution { - // The exit code of a finished task. - // - // If the task succeeded, the exit code will be 0. If the task failed but not - // due to the following reasons, the exit code will be 50000. - // - // Otherwise, it can be from different sources: - // * Batch known failures: - // https://cloud.google.com/batch/docs/troubleshooting#reserved-exit-codes. - // * Batch runnable execution failures; you can rely on Batch logs to further - // diagnose: https://cloud.google.com/batch/docs/analyze-job-using-logs. If - // there are multiple runnables failures, Batch only exposes the first error. - int32 exit_code = 1; - - // Optional. The tail end of any content written to standard error by the task - // execution. This field will be populated only when the execution failed. - string stderr_snippet = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Status of a task. -message TaskStatus { - // Task states. - enum State { - // Unknown state. - STATE_UNSPECIFIED = 0; - - // The Task is created and waiting for resources. - PENDING = 1; - - // The Task is assigned to at least one VM. - ASSIGNED = 2; - - // The Task is running. - RUNNING = 3; - - // The Task has failed. - FAILED = 4; - - // The Task has succeeded. - SUCCEEDED = 5; - - // The Task has not been executed when the Job finishes. - UNEXECUTED = 6; - } - - // Task state. - State state = 1; - - // Detailed info about why the state is reached. - repeated StatusEvent status_events = 2; - - // The resource usage of the task. - TaskResourceUsage resource_usage = 3; -} - -// TaskResourceUsage describes the resource usage of the task. -message TaskResourceUsage { - // The CPU core hours the task consumes based on task requirement and run - // time. - double core_hours = 1; -} - -// Runnable describes instructions for executing a specific script or container -// as part of a Task. -message Runnable { - // Container runnable. - message Container { - // Required. The URI to pull the container image from. - string image_uri = 1; - - // Required for some container images. Overrides the `CMD` specified in the - // container. If there is an `ENTRYPOINT` (either in the container image or - // with the `entrypoint` field below) then these commands are appended as - // arguments to the `ENTRYPOINT`. - repeated string commands = 2; - - // Required for some container images. Overrides the `ENTRYPOINT` specified - // in the container. - string entrypoint = 3; - - // Volumes to mount (bind mount) from the host machine files or directories - // into the container, formatted to match `--volume` option for the - // `docker run` command—for example, `/foo:/bar` or `/foo:/bar:ro`. - // - // If the `TaskSpec.Volumes` field is specified but this field is not, Batch - // will mount each volume from the host machine to the container with the - // same mount path by default. In this case, the default mount option for - // containers will be read-only (`ro`) for existing persistent disks and - // read-write (`rw`) for other volume types, regardless of the original - // mount options specified in `TaskSpec.Volumes`. If you need different - // mount settings, you can explicitly configure them in this field. - repeated string volumes = 7; - - // Required for some container images. Arbitrary additional options to - // include in the `docker run` command when running this container—for - // example, `--network host`. For the `--volume` option, use the `volumes` - // field for the container. - string options = 8; - - // If set to true, external network access to and from container will be - // blocked, containers that are with block_external_network as true can - // still communicate with each other, network cannot be specified in the - // `container.options` field. - bool block_external_network = 9; - - // Required if the container image is from a private Docker registry. The - // username to login to the Docker registry that contains the image. - // - // You can either specify the username directly by using plain text or - // specify an encrypted username by using a Secret Manager secret: - // `projects/*/secrets/*/versions/*`. However, using a secret is - // recommended for enhanced security. - // - // Caution: If you specify the username using plain text, you risk the - // username being exposed to any users who can view the job or its logs. - // To avoid this risk, specify a secret that contains the username instead. - // - // Learn more about [Secret - // Manager](https://cloud.google.com/secret-manager/docs/) and [using - // Secret Manager with - // Batch](https://cloud.google.com/batch/docs/create-run-job-secret-manager). - string username = 10; - - // Required if the container image is from a private Docker registry. The - // password to login to the Docker registry that contains the image. - // - // For security, it is strongly recommended to specify an - // encrypted password by using a Secret Manager secret: - // `projects/*/secrets/*/versions/*`. - // - // Warning: If you specify the password using plain text, you risk the - // password being exposed to any users who can view the job or its logs. - // To avoid this risk, specify a secret that contains the password instead. - // - // Learn more about [Secret - // Manager](https://cloud.google.com/secret-manager/docs/) and [using - // Secret Manager with - // Batch](https://cloud.google.com/batch/docs/create-run-job-secret-manager). - string password = 11; - - // Optional. If set to true, this container runnable uses Image streaming. - // - // Use Image streaming to allow the runnable to initialize without - // waiting for the entire container image to download, which can - // significantly reduce startup time for large container images. - // - // When `enableImageStreaming` is set to true, the container - // runtime is [containerd](https://containerd.io/) instead of Docker. - // Additionally, this container runnable only supports the following - // `container` subfields: `imageUri`, - // `commands[]`, `entrypoint`, and - // `volumes[]`; any other `container` subfields are ignored. - // - // For more information about the requirements and limitations for using - // Image streaming with Batch, see the [`image-streaming` - // sample on - // GitHub](https://github.com/GoogleCloudPlatform/batch-samples/tree/main/api-samples/image-streaming). - bool enable_image_streaming = 12 [(google.api.field_behavior) = OPTIONAL]; - } - - // Script runnable. - message Script { - // Required. The source code for this script runnable. - oneof command { - // The path to a script file that is accessible from the host VM(s). - // - // Unless the script file supports the default `#!/bin/sh` shell - // interpreter, you must specify an interpreter by including a - // [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix) as the - // first line of the file. For example, to execute the script using bash, - // include `#!/bin/bash` as the first line of the file. Alternatively, - // to execute the script using Python3, include `#!/usr/bin/env python3` - // as the first line of the file. - string path = 1; - - // The text for a script. - // - // Unless the script text supports the default `#!/bin/sh` shell - // interpreter, you must specify an interpreter by including a - // [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix) at the - // beginning of the text. For example, to execute the script using bash, - // include `#!/bin/bash\n` at the beginning of the text. Alternatively, - // to execute the script using Python3, include `#!/usr/bin/env python3\n` - // at the beginning of the text. - string text = 2; - } - } - - // A barrier runnable automatically blocks the execution of subsequent - // runnables until all the tasks in the task group reach the barrier. - message Barrier { - // Barriers are identified by their index in runnable list. - // Names are not required, but if present should be an identifier. - string name = 1; - } - - // Required. The script, container, or barrier for this runnable to execute. - oneof executable { - // Container runnable. - Container container = 1; - - // Script runnable. - Script script = 2; - - // Barrier runnable. - Barrier barrier = 6; - } - - // Optional. DisplayName is an optional field that can be provided by the - // caller. If provided, it will be used in logs and other outputs to identify - // the script, making it easier for users to understand the logs. If not - // provided the index of the runnable will be used for outputs. - string display_name = 10 [(google.api.field_behavior) = OPTIONAL]; - - // Normally, a runnable that returns a non-zero exit status fails and causes - // the task to fail. However, you can set this field to `true` to allow the - // task to continue executing its other runnables even if this runnable - // fails. - bool ignore_exit_status = 3; - - // Normally, a runnable that doesn't exit causes its task to fail. However, - // you can set this field to `true` to configure a background runnable. - // Background runnables are allowed continue running in the background while - // the task executes subsequent runnables. For example, background runnables - // are useful for providing services to other runnables or providing - // debugging-support tools like SSH servers. - // - // Specifically, background runnables are killed automatically (if they have - // not already exited) a short time after all foreground runnables have - // completed. Even though this is likely to result in a non-zero exit status - // for the background runnable, these automatic kills are not treated as task - // failures. - bool background = 4; - - // By default, after a Runnable fails, no further Runnable are executed. This - // flag indicates that this Runnable must be run even if the Task has already - // failed. This is useful for Runnables that copy output files off of the VM - // or for debugging. - // - // The always_run flag does not override the Task's overall max_run_duration. - // If the max_run_duration has expired then no further Runnables will execute, - // not even always_run Runnables. - bool always_run = 5; - - // Environment variables for this Runnable (overrides variables set for the - // whole Task or TaskGroup). - Environment environment = 7; - - // Timeout for this Runnable. - google.protobuf.Duration timeout = 8; - - // Labels for this Runnable. - map labels = 9; -} - -// Spec of a task -message TaskSpec { - // Required. The sequence of one or more runnables (executable scripts, - // executable containers, and/or barriers) for each task in this task group to - // run. Each task runs this list of runnables in order. For a task to succeed, - // all of its script and container runnables each must meet at least one of - // the following conditions: - // - // + The runnable exited with a zero status. - // + The runnable didn't finish, but you enabled its `background` subfield. - // + The runnable exited with a non-zero status, but you enabled its - // `ignore_exit_status` subfield. - repeated Runnable runnables = 8; - - // ComputeResource requirements. - ComputeResource compute_resource = 3; - - // Maximum duration the task should run before being automatically retried - // (if enabled) or automatically failed. Format the value of this field - // as a time limit in seconds followed by `s`—for example, `3600s` - // for 1 hour. The field accepts any value between 0 and the maximum listed - // for the `Duration` field type at - // https://protobuf.dev/reference/protobuf/google.protobuf/#duration; however, - // the actual maximum run time for a job will be limited to the maximum run - // time for a job listed at - // https://cloud.google.com/batch/quotas#max-job-duration. - google.protobuf.Duration max_run_duration = 4; - - // Maximum number of retries on failures. - // The default, 0, which means never retry. - // The valid value range is [0, 10]. - int32 max_retry_count = 5; - - // Lifecycle management schema when any task in a task group is failed. - // Currently we only support one lifecycle policy. - // When the lifecycle policy condition is met, - // the action in the policy will execute. - // If task execution result does not meet with the defined lifecycle - // policy, we consider it as the default policy. - // Default policy means if the exit code is 0, exit task. - // If task ends with non-zero exit code, retry the task with max_retry_count. - repeated LifecyclePolicy lifecycle_policies = 9; - - // Deprecated: please use environment(non-plural) instead. - map environments = 6 [deprecated = true]; - - // Volumes to mount before running Tasks using this TaskSpec. - repeated Volume volumes = 7; - - // Environment variables to set before running the Task. - Environment environment = 10; -} - -// LifecyclePolicy describes how to deal with task failures -// based on different conditions. -message LifecyclePolicy { - // Conditions for actions to deal with task failures. - message ActionCondition { - // Exit codes of a task execution. - // If there are more than 1 exit codes, - // when task executes with any of the exit code in the list, - // the condition is met and the action will be executed. - repeated int32 exit_codes = 1; - } - - // Action on task failures based on different conditions. - enum Action { - // Action unspecified. - ACTION_UNSPECIFIED = 0; - - // Action that tasks in the group will be scheduled to re-execute. - RETRY_TASK = 1; - - // Action that tasks in the group will be stopped immediately. - FAIL_TASK = 2; - } - - // Action to execute when ActionCondition is true. - // When RETRY_TASK is specified, we will retry failed tasks - // if we notice any exit code match and fail tasks if no match is found. - // Likewise, when FAIL_TASK is specified, we will fail tasks - // if we notice any exit code match and retry tasks if no match is found. - Action action = 1; - - // Conditions that decide why a task failure is dealt with a specific action. - ActionCondition action_condition = 2; -} - -// A Cloud Batch task. -message Task { - option (google.api.resource) = { - type: "batch.googleapis.com/Task" - pattern: "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}/tasks/{task}" - }; - - // Task name. - // The name is generated from the parent TaskGroup name and 'id' field. - // For example: - // "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01/tasks/task01". - string name = 1; - - // Task Status. - TaskStatus status = 2; -} - -// An Environment describes a collection of environment variables to set when -// executing Tasks. -message Environment { - message KMSEnvMap { - // The name of the KMS key that will be used to decrypt the cipher text. - string key_name = 1; - - // The value of the cipherText response from the `encrypt` method. - string cipher_text = 2; - } - - // A map of environment variable names to values. - map variables = 1; - - // A map of environment variable names to Secret Manager secret names. - // The VM will access the named secrets to set the value of each environment - // variable. - map secret_variables = 2; - - // An encrypted JSON dictionary where the key/value pairs correspond to - // environment variable names and their values. - KMSEnvMap encrypted_variables = 3; -} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/volume.proto b/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/volume.proto deleted file mode 100644 index 9256ef6faa4..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/protos/google/cloud/batch/v1alpha/volume.proto +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.batch.v1alpha; - -option csharp_namespace = "Google.Cloud.Batch.V1Alpha"; -option go_package = "cloud.google.com/go/batch/apiv1alpha/batchpb;batchpb"; -option java_multiple_files = true; -option java_outer_classname = "VolumeProto"; -option java_package = "com.google.cloud.batch.v1alpha"; -option objc_class_prefix = "GCB"; -option php_namespace = "Google\\Cloud\\Batch\\V1alpha"; -option ruby_package = "Google::Cloud::Batch::V1alpha"; - -// Volume describes a volume and parameters for it to be mounted to a VM. -message Volume { - // The source for the volume. - oneof source { - // A Network File System (NFS) volume. For example, a - // Filestore file share. - NFS nfs = 1; - - // Deprecated: please use device_name instead. - PD pd = 2 [deprecated = true]; - - // A Google Cloud Storage (GCS) volume. - GCS gcs = 3; - - // Device name of an attached disk volume, which should align with a - // device_name specified by - // job.allocation_policy.instances[0].policy.disks[i].device_name or - // defined by the given instance template in - // job.allocation_policy.instances[0].instance_template. - string device_name = 6; - } - - // The mount path for the volume, e.g. /mnt/disks/share. - string mount_path = 4; - - // Mount options vary based on the type of storage volume: - // - // * For a Cloud Storage bucket, all the mount options provided - // by - // the [`gcsfuse` tool](https://cloud.google.com/storage/docs/gcsfuse-cli) - // are supported. - // * For an existing persistent disk, all mount options provided by the - // [`mount` command](https://man7.org/linux/man-pages/man8/mount.8.html) - // except writing are supported. This is due to restrictions of - // [multi-writer - // mode](https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms). - // * For any other disk or a Network File System (NFS), all the - // mount options provided by the `mount` command are supported. - repeated string mount_options = 5; -} - -// Represents an NFS volume. -message NFS { - // The IP address of the NFS. - string server = 1; - - // Remote source path exported from the NFS, e.g., "/share". - string remote_path = 2; -} - -// Deprecated: please use device_name instead. -message PD { - // PD disk name, e.g. pd-1. - string disk = 1; - - // PD device name, e.g. persistent-disk-1. - string device = 2; - - // Whether this is an existing PD. Default is false. If false, i.e., new - // PD, we will format it into ext4 and mount to the given path. If true, i.e., - // existing PD, it should be in ext4 format and we will mount it to the given - // path. - bool existing = 3 [deprecated = true]; -} - -// Represents a Google Cloud Storage volume. -message GCS { - // Remote path, either a bucket name or a subdirectory of a bucket, e.g.: - // bucket_name, bucket_name/subdirectory/ - string remote_path = 1; -} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.d.ts b/owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.d.ts deleted file mode 100644 index b3108d65ff9..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.d.ts +++ /dev/null @@ -1,16145 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import type {protobuf as $protobuf} from "google-gax"; -import Long = require("long"); -/** Namespace google. */ -export namespace google { - - /** Namespace cloud. */ - namespace cloud { - - /** Namespace batch. */ - namespace batch { - - /** Namespace v1alpha. */ - namespace v1alpha { - - /** Represents a BatchService */ - class BatchService extends $protobuf.rpc.Service { - - /** - * Constructs a new BatchService 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 BatchService 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): BatchService; - - /** - * Calls CreateJob. - * @param request CreateJobRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Job - */ - public createJob(request: google.cloud.batch.v1alpha.ICreateJobRequest, callback: google.cloud.batch.v1alpha.BatchService.CreateJobCallback): void; - - /** - * Calls CreateJob. - * @param request CreateJobRequest message or plain object - * @returns Promise - */ - public createJob(request: google.cloud.batch.v1alpha.ICreateJobRequest): Promise; - - /** - * Calls GetJob. - * @param request GetJobRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Job - */ - public getJob(request: google.cloud.batch.v1alpha.IGetJobRequest, callback: google.cloud.batch.v1alpha.BatchService.GetJobCallback): void; - - /** - * Calls GetJob. - * @param request GetJobRequest message or plain object - * @returns Promise - */ - public getJob(request: google.cloud.batch.v1alpha.IGetJobRequest): Promise; - - /** - * Calls DeleteJob. - * @param request DeleteJobRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteJob(request: google.cloud.batch.v1alpha.IDeleteJobRequest, callback: google.cloud.batch.v1alpha.BatchService.DeleteJobCallback): void; - - /** - * Calls DeleteJob. - * @param request DeleteJobRequest message or plain object - * @returns Promise - */ - public deleteJob(request: google.cloud.batch.v1alpha.IDeleteJobRequest): Promise; - - /** - * Calls CancelJob. - * @param request CancelJobRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public cancelJob(request: google.cloud.batch.v1alpha.ICancelJobRequest, callback: google.cloud.batch.v1alpha.BatchService.CancelJobCallback): void; - - /** - * Calls CancelJob. - * @param request CancelJobRequest message or plain object - * @returns Promise - */ - public cancelJob(request: google.cloud.batch.v1alpha.ICancelJobRequest): Promise; - - /** - * Calls UpdateJob. - * @param request UpdateJobRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Job - */ - public updateJob(request: google.cloud.batch.v1alpha.IUpdateJobRequest, callback: google.cloud.batch.v1alpha.BatchService.UpdateJobCallback): void; - - /** - * Calls UpdateJob. - * @param request UpdateJobRequest message or plain object - * @returns Promise - */ - public updateJob(request: google.cloud.batch.v1alpha.IUpdateJobRequest): Promise; - - /** - * Calls ListJobs. - * @param request ListJobsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListJobsResponse - */ - public listJobs(request: google.cloud.batch.v1alpha.IListJobsRequest, callback: google.cloud.batch.v1alpha.BatchService.ListJobsCallback): void; - - /** - * Calls ListJobs. - * @param request ListJobsRequest message or plain object - * @returns Promise - */ - public listJobs(request: google.cloud.batch.v1alpha.IListJobsRequest): Promise; - - /** - * Calls GetTask. - * @param request GetTaskRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Task - */ - public getTask(request: google.cloud.batch.v1alpha.IGetTaskRequest, callback: google.cloud.batch.v1alpha.BatchService.GetTaskCallback): void; - - /** - * Calls GetTask. - * @param request GetTaskRequest message or plain object - * @returns Promise - */ - public getTask(request: google.cloud.batch.v1alpha.IGetTaskRequest): Promise; - - /** - * Calls ListTasks. - * @param request ListTasksRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListTasksResponse - */ - public listTasks(request: google.cloud.batch.v1alpha.IListTasksRequest, callback: google.cloud.batch.v1alpha.BatchService.ListTasksCallback): void; - - /** - * Calls ListTasks. - * @param request ListTasksRequest message or plain object - * @returns Promise - */ - public listTasks(request: google.cloud.batch.v1alpha.IListTasksRequest): Promise; - - /** - * Calls CreateResourceAllowance. - * @param request CreateResourceAllowanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ResourceAllowance - */ - public createResourceAllowance(request: google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest, callback: google.cloud.batch.v1alpha.BatchService.CreateResourceAllowanceCallback): void; - - /** - * Calls CreateResourceAllowance. - * @param request CreateResourceAllowanceRequest message or plain object - * @returns Promise - */ - public createResourceAllowance(request: google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest): Promise; - - /** - * Calls GetResourceAllowance. - * @param request GetResourceAllowanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ResourceAllowance - */ - public getResourceAllowance(request: google.cloud.batch.v1alpha.IGetResourceAllowanceRequest, callback: google.cloud.batch.v1alpha.BatchService.GetResourceAllowanceCallback): void; - - /** - * Calls GetResourceAllowance. - * @param request GetResourceAllowanceRequest message or plain object - * @returns Promise - */ - public getResourceAllowance(request: google.cloud.batch.v1alpha.IGetResourceAllowanceRequest): Promise; - - /** - * Calls DeleteResourceAllowance. - * @param request DeleteResourceAllowanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteResourceAllowance(request: google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest, callback: google.cloud.batch.v1alpha.BatchService.DeleteResourceAllowanceCallback): void; - - /** - * Calls DeleteResourceAllowance. - * @param request DeleteResourceAllowanceRequest message or plain object - * @returns Promise - */ - public deleteResourceAllowance(request: google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest): Promise; - - /** - * Calls ListResourceAllowances. - * @param request ListResourceAllowancesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListResourceAllowancesResponse - */ - public listResourceAllowances(request: google.cloud.batch.v1alpha.IListResourceAllowancesRequest, callback: google.cloud.batch.v1alpha.BatchService.ListResourceAllowancesCallback): void; - - /** - * Calls ListResourceAllowances. - * @param request ListResourceAllowancesRequest message or plain object - * @returns Promise - */ - public listResourceAllowances(request: google.cloud.batch.v1alpha.IListResourceAllowancesRequest): Promise; - - /** - * Calls UpdateResourceAllowance. - * @param request UpdateResourceAllowanceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ResourceAllowance - */ - public updateResourceAllowance(request: google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest, callback: google.cloud.batch.v1alpha.BatchService.UpdateResourceAllowanceCallback): void; - - /** - * Calls UpdateResourceAllowance. - * @param request UpdateResourceAllowanceRequest message or plain object - * @returns Promise - */ - public updateResourceAllowance(request: google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest): Promise; - } - - namespace BatchService { - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|createJob}. - * @param error Error, if any - * @param [response] Job - */ - type CreateJobCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.Job) => void; - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|getJob}. - * @param error Error, if any - * @param [response] Job - */ - type GetJobCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.Job) => void; - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|deleteJob}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|cancelJob}. - * @param error Error, if any - * @param [response] Operation - */ - type CancelJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|updateJob}. - * @param error Error, if any - * @param [response] Job - */ - type UpdateJobCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.Job) => void; - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|listJobs}. - * @param error Error, if any - * @param [response] ListJobsResponse - */ - type ListJobsCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.ListJobsResponse) => void; - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|getTask}. - * @param error Error, if any - * @param [response] Task - */ - type GetTaskCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.Task) => void; - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|listTasks}. - * @param error Error, if any - * @param [response] ListTasksResponse - */ - type ListTasksCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.ListTasksResponse) => void; - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|createResourceAllowance}. - * @param error Error, if any - * @param [response] ResourceAllowance - */ - type CreateResourceAllowanceCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.ResourceAllowance) => void; - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|getResourceAllowance}. - * @param error Error, if any - * @param [response] ResourceAllowance - */ - type GetResourceAllowanceCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.ResourceAllowance) => void; - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|deleteResourceAllowance}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteResourceAllowanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|listResourceAllowances}. - * @param error Error, if any - * @param [response] ListResourceAllowancesResponse - */ - type ListResourceAllowancesCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.ListResourceAllowancesResponse) => void; - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|updateResourceAllowance}. - * @param error Error, if any - * @param [response] ResourceAllowance - */ - type UpdateResourceAllowanceCallback = (error: (Error|null), response?: google.cloud.batch.v1alpha.ResourceAllowance) => void; - } - - /** Properties of a CreateJobRequest. */ - interface ICreateJobRequest { - - /** CreateJobRequest parent */ - parent?: (string|null); - - /** CreateJobRequest jobId */ - jobId?: (string|null); - - /** CreateJobRequest job */ - job?: (google.cloud.batch.v1alpha.IJob|null); - - /** CreateJobRequest requestId */ - requestId?: (string|null); - } - - /** Represents a CreateJobRequest. */ - class CreateJobRequest implements ICreateJobRequest { - - /** - * Constructs a new CreateJobRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.ICreateJobRequest); - - /** CreateJobRequest parent. */ - public parent: string; - - /** CreateJobRequest jobId. */ - public jobId: string; - - /** CreateJobRequest job. */ - public job?: (google.cloud.batch.v1alpha.IJob|null); - - /** CreateJobRequest requestId. */ - public requestId: string; - - /** - * Creates a new CreateJobRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateJobRequest instance - */ - public static create(properties?: google.cloud.batch.v1alpha.ICreateJobRequest): google.cloud.batch.v1alpha.CreateJobRequest; - - /** - * Encodes the specified CreateJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.CreateJobRequest.verify|verify} messages. - * @param message CreateJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.ICreateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.CreateJobRequest.verify|verify} messages. - * @param message CreateJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.ICreateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateJobRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.CreateJobRequest; - - /** - * Decodes a CreateJobRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.CreateJobRequest; - - /** - * Verifies a CreateJobRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateJobRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateJobRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.CreateJobRequest; - - /** - * Creates a plain object from a CreateJobRequest message. Also converts values to other types if specified. - * @param message CreateJobRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.CreateJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateJobRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateJobRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetJobRequest. */ - interface IGetJobRequest { - - /** GetJobRequest name */ - name?: (string|null); - } - - /** Represents a GetJobRequest. */ - class GetJobRequest implements IGetJobRequest { - - /** - * Constructs a new GetJobRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IGetJobRequest); - - /** GetJobRequest name. */ - public name: string; - - /** - * Creates a new GetJobRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetJobRequest instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IGetJobRequest): google.cloud.batch.v1alpha.GetJobRequest; - - /** - * Encodes the specified GetJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.GetJobRequest.verify|verify} messages. - * @param message GetJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IGetJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.GetJobRequest.verify|verify} messages. - * @param message GetJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IGetJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetJobRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.GetJobRequest; - - /** - * Decodes a GetJobRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.GetJobRequest; - - /** - * Verifies a GetJobRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetJobRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetJobRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.GetJobRequest; - - /** - * Creates a plain object from a GetJobRequest message. Also converts values to other types if specified. - * @param message GetJobRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.GetJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetJobRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetJobRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteJobRequest. */ - interface IDeleteJobRequest { - - /** DeleteJobRequest name */ - name?: (string|null); - - /** DeleteJobRequest reason */ - reason?: (string|null); - - /** DeleteJobRequest requestId */ - requestId?: (string|null); - } - - /** Represents a DeleteJobRequest. */ - class DeleteJobRequest implements IDeleteJobRequest { - - /** - * Constructs a new DeleteJobRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IDeleteJobRequest); - - /** DeleteJobRequest name. */ - public name: string; - - /** DeleteJobRequest reason. */ - public reason: string; - - /** DeleteJobRequest requestId. */ - public requestId: string; - - /** - * Creates a new DeleteJobRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteJobRequest instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IDeleteJobRequest): google.cloud.batch.v1alpha.DeleteJobRequest; - - /** - * Encodes the specified DeleteJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.DeleteJobRequest.verify|verify} messages. - * @param message DeleteJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IDeleteJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.DeleteJobRequest.verify|verify} messages. - * @param message DeleteJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IDeleteJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteJobRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.DeleteJobRequest; - - /** - * Decodes a DeleteJobRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.DeleteJobRequest; - - /** - * Verifies a DeleteJobRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteJobRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteJobRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.DeleteJobRequest; - - /** - * Creates a plain object from a DeleteJobRequest message. Also converts values to other types if specified. - * @param message DeleteJobRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.DeleteJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteJobRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteJobRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CancelJobRequest. */ - interface ICancelJobRequest { - - /** CancelJobRequest name */ - name?: (string|null); - - /** CancelJobRequest requestId */ - requestId?: (string|null); - } - - /** Represents a CancelJobRequest. */ - class CancelJobRequest implements ICancelJobRequest { - - /** - * Constructs a new CancelJobRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.ICancelJobRequest); - - /** CancelJobRequest name. */ - public name: string; - - /** CancelJobRequest requestId. */ - public requestId: string; - - /** - * Creates a new CancelJobRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CancelJobRequest instance - */ - public static create(properties?: google.cloud.batch.v1alpha.ICancelJobRequest): google.cloud.batch.v1alpha.CancelJobRequest; - - /** - * Encodes the specified CancelJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.CancelJobRequest.verify|verify} messages. - * @param message CancelJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.ICancelJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CancelJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.CancelJobRequest.verify|verify} messages. - * @param message CancelJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.ICancelJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CancelJobRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CancelJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.CancelJobRequest; - - /** - * Decodes a CancelJobRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CancelJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.CancelJobRequest; - - /** - * Verifies a CancelJobRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CancelJobRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CancelJobRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.CancelJobRequest; - - /** - * Creates a plain object from a CancelJobRequest message. Also converts values to other types if specified. - * @param message CancelJobRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.CancelJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CancelJobRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CancelJobRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CancelJobResponse. */ - interface ICancelJobResponse { - } - - /** Represents a CancelJobResponse. */ - class CancelJobResponse implements ICancelJobResponse { - - /** - * Constructs a new CancelJobResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.ICancelJobResponse); - - /** - * Creates a new CancelJobResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns CancelJobResponse instance - */ - public static create(properties?: google.cloud.batch.v1alpha.ICancelJobResponse): google.cloud.batch.v1alpha.CancelJobResponse; - - /** - * Encodes the specified CancelJobResponse message. Does not implicitly {@link google.cloud.batch.v1alpha.CancelJobResponse.verify|verify} messages. - * @param message CancelJobResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.ICancelJobResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CancelJobResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.CancelJobResponse.verify|verify} messages. - * @param message CancelJobResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.ICancelJobResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CancelJobResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CancelJobResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.CancelJobResponse; - - /** - * Decodes a CancelJobResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CancelJobResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.CancelJobResponse; - - /** - * Verifies a CancelJobResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CancelJobResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CancelJobResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.CancelJobResponse; - - /** - * Creates a plain object from a CancelJobResponse message. Also converts values to other types if specified. - * @param message CancelJobResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.CancelJobResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CancelJobResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CancelJobResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateJobRequest. */ - interface IUpdateJobRequest { - - /** UpdateJobRequest job */ - job?: (google.cloud.batch.v1alpha.IJob|null); - - /** UpdateJobRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateJobRequest requestId */ - requestId?: (string|null); - } - - /** Represents an UpdateJobRequest. */ - class UpdateJobRequest implements IUpdateJobRequest { - - /** - * Constructs a new UpdateJobRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IUpdateJobRequest); - - /** UpdateJobRequest job. */ - public job?: (google.cloud.batch.v1alpha.IJob|null); - - /** UpdateJobRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateJobRequest requestId. */ - public requestId: string; - - /** - * Creates a new UpdateJobRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateJobRequest instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IUpdateJobRequest): google.cloud.batch.v1alpha.UpdateJobRequest; - - /** - * Encodes the specified UpdateJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.UpdateJobRequest.verify|verify} messages. - * @param message UpdateJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IUpdateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UpdateJobRequest.verify|verify} messages. - * @param message UpdateJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IUpdateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateJobRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.UpdateJobRequest; - - /** - * Decodes an UpdateJobRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.UpdateJobRequest; - - /** - * Verifies an UpdateJobRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateJobRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateJobRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.UpdateJobRequest; - - /** - * Creates a plain object from an UpdateJobRequest message. Also converts values to other types if specified. - * @param message UpdateJobRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.UpdateJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateJobRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateJobRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListJobsRequest. */ - interface IListJobsRequest { - - /** ListJobsRequest parent */ - parent?: (string|null); - - /** ListJobsRequest filter */ - filter?: (string|null); - - /** ListJobsRequest orderBy */ - orderBy?: (string|null); - - /** ListJobsRequest pageSize */ - pageSize?: (number|null); - - /** ListJobsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListJobsRequest. */ - class ListJobsRequest implements IListJobsRequest { - - /** - * Constructs a new ListJobsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IListJobsRequest); - - /** ListJobsRequest parent. */ - public parent: string; - - /** ListJobsRequest filter. */ - public filter: string; - - /** ListJobsRequest orderBy. */ - public orderBy: string; - - /** ListJobsRequest pageSize. */ - public pageSize: number; - - /** ListJobsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListJobsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListJobsRequest instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IListJobsRequest): google.cloud.batch.v1alpha.ListJobsRequest; - - /** - * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.ListJobsRequest.verify|verify} messages. - * @param message ListJobsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IListJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListJobsRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListJobsRequest.verify|verify} messages. - * @param message ListJobsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IListJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListJobsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListJobsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ListJobsRequest; - - /** - * Decodes a ListJobsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListJobsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ListJobsRequest; - - /** - * Verifies a ListJobsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListJobsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListJobsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ListJobsRequest; - - /** - * Creates a plain object from a ListJobsRequest message. Also converts values to other types if specified. - * @param message ListJobsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.ListJobsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListJobsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListJobsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListJobsResponse. */ - interface IListJobsResponse { - - /** ListJobsResponse jobs */ - jobs?: (google.cloud.batch.v1alpha.IJob[]|null); - - /** ListJobsResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListJobsResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListJobsResponse. */ - class ListJobsResponse implements IListJobsResponse { - - /** - * Constructs a new ListJobsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IListJobsResponse); - - /** ListJobsResponse jobs. */ - public jobs: google.cloud.batch.v1alpha.IJob[]; - - /** ListJobsResponse nextPageToken. */ - public nextPageToken: string; - - /** ListJobsResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListJobsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListJobsResponse instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IListJobsResponse): google.cloud.batch.v1alpha.ListJobsResponse; - - /** - * Encodes the specified ListJobsResponse message. Does not implicitly {@link google.cloud.batch.v1alpha.ListJobsResponse.verify|verify} messages. - * @param message ListJobsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IListJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListJobsResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListJobsResponse.verify|verify} messages. - * @param message ListJobsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IListJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListJobsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListJobsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ListJobsResponse; - - /** - * Decodes a ListJobsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListJobsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ListJobsResponse; - - /** - * Verifies a ListJobsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListJobsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListJobsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ListJobsResponse; - - /** - * Creates a plain object from a ListJobsResponse message. Also converts values to other types if specified. - * @param message ListJobsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.ListJobsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListJobsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListJobsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListTasksRequest. */ - interface IListTasksRequest { - - /** ListTasksRequest parent */ - parent?: (string|null); - - /** ListTasksRequest filter */ - filter?: (string|null); - - /** ListTasksRequest orderBy */ - orderBy?: (string|null); - - /** ListTasksRequest pageSize */ - pageSize?: (number|null); - - /** ListTasksRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListTasksRequest. */ - class ListTasksRequest implements IListTasksRequest { - - /** - * Constructs a new ListTasksRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IListTasksRequest); - - /** ListTasksRequest parent. */ - public parent: string; - - /** ListTasksRequest filter. */ - public filter: string; - - /** ListTasksRequest orderBy. */ - public orderBy: string; - - /** ListTasksRequest pageSize. */ - public pageSize: number; - - /** ListTasksRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListTasksRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListTasksRequest instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IListTasksRequest): google.cloud.batch.v1alpha.ListTasksRequest; - - /** - * Encodes the specified ListTasksRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.ListTasksRequest.verify|verify} messages. - * @param message ListTasksRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IListTasksRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListTasksRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListTasksRequest.verify|verify} messages. - * @param message ListTasksRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IListTasksRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListTasksRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListTasksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ListTasksRequest; - - /** - * Decodes a ListTasksRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListTasksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ListTasksRequest; - - /** - * Verifies a ListTasksRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListTasksRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListTasksRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ListTasksRequest; - - /** - * Creates a plain object from a ListTasksRequest message. Also converts values to other types if specified. - * @param message ListTasksRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.ListTasksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListTasksRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListTasksRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListTasksResponse. */ - interface IListTasksResponse { - - /** ListTasksResponse tasks */ - tasks?: (google.cloud.batch.v1alpha.ITask[]|null); - - /** ListTasksResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListTasksResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListTasksResponse. */ - class ListTasksResponse implements IListTasksResponse { - - /** - * Constructs a new ListTasksResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IListTasksResponse); - - /** ListTasksResponse tasks. */ - public tasks: google.cloud.batch.v1alpha.ITask[]; - - /** ListTasksResponse nextPageToken. */ - public nextPageToken: string; - - /** ListTasksResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListTasksResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListTasksResponse instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IListTasksResponse): google.cloud.batch.v1alpha.ListTasksResponse; - - /** - * Encodes the specified ListTasksResponse message. Does not implicitly {@link google.cloud.batch.v1alpha.ListTasksResponse.verify|verify} messages. - * @param message ListTasksResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IListTasksResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListTasksResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListTasksResponse.verify|verify} messages. - * @param message ListTasksResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IListTasksResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListTasksResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListTasksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ListTasksResponse; - - /** - * Decodes a ListTasksResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListTasksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ListTasksResponse; - - /** - * Verifies a ListTasksResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListTasksResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListTasksResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ListTasksResponse; - - /** - * Creates a plain object from a ListTasksResponse message. Also converts values to other types if specified. - * @param message ListTasksResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.ListTasksResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListTasksResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListTasksResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetTaskRequest. */ - interface IGetTaskRequest { - - /** GetTaskRequest name */ - name?: (string|null); - } - - /** Represents a GetTaskRequest. */ - class GetTaskRequest implements IGetTaskRequest { - - /** - * Constructs a new GetTaskRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IGetTaskRequest); - - /** GetTaskRequest name. */ - public name: string; - - /** - * Creates a new GetTaskRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetTaskRequest instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IGetTaskRequest): google.cloud.batch.v1alpha.GetTaskRequest; - - /** - * Encodes the specified GetTaskRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.GetTaskRequest.verify|verify} messages. - * @param message GetTaskRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IGetTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetTaskRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.GetTaskRequest.verify|verify} messages. - * @param message GetTaskRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IGetTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetTaskRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.GetTaskRequest; - - /** - * Decodes a GetTaskRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.GetTaskRequest; - - /** - * Verifies a GetTaskRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetTaskRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetTaskRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.GetTaskRequest; - - /** - * Creates a plain object from a GetTaskRequest message. Also converts values to other types if specified. - * @param message GetTaskRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.GetTaskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetTaskRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetTaskRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateResourceAllowanceRequest. */ - interface ICreateResourceAllowanceRequest { - - /** CreateResourceAllowanceRequest parent */ - parent?: (string|null); - - /** CreateResourceAllowanceRequest resourceAllowanceId */ - resourceAllowanceId?: (string|null); - - /** CreateResourceAllowanceRequest resourceAllowance */ - resourceAllowance?: (google.cloud.batch.v1alpha.IResourceAllowance|null); - - /** CreateResourceAllowanceRequest requestId */ - requestId?: (string|null); - } - - /** Represents a CreateResourceAllowanceRequest. */ - class CreateResourceAllowanceRequest implements ICreateResourceAllowanceRequest { - - /** - * Constructs a new CreateResourceAllowanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest); - - /** CreateResourceAllowanceRequest parent. */ - public parent: string; - - /** CreateResourceAllowanceRequest resourceAllowanceId. */ - public resourceAllowanceId: string; - - /** CreateResourceAllowanceRequest resourceAllowance. */ - public resourceAllowance?: (google.cloud.batch.v1alpha.IResourceAllowance|null); - - /** CreateResourceAllowanceRequest requestId. */ - public requestId: string; - - /** - * Creates a new CreateResourceAllowanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateResourceAllowanceRequest instance - */ - public static create(properties?: google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest): google.cloud.batch.v1alpha.CreateResourceAllowanceRequest; - - /** - * Encodes the specified CreateResourceAllowanceRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.CreateResourceAllowanceRequest.verify|verify} messages. - * @param message CreateResourceAllowanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateResourceAllowanceRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.CreateResourceAllowanceRequest.verify|verify} messages. - * @param message CreateResourceAllowanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateResourceAllowanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateResourceAllowanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.CreateResourceAllowanceRequest; - - /** - * Decodes a CreateResourceAllowanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateResourceAllowanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.CreateResourceAllowanceRequest; - - /** - * Verifies a CreateResourceAllowanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateResourceAllowanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateResourceAllowanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.CreateResourceAllowanceRequest; - - /** - * Creates a plain object from a CreateResourceAllowanceRequest message. Also converts values to other types if specified. - * @param message CreateResourceAllowanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.CreateResourceAllowanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateResourceAllowanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateResourceAllowanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetResourceAllowanceRequest. */ - interface IGetResourceAllowanceRequest { - - /** GetResourceAllowanceRequest name */ - name?: (string|null); - } - - /** Represents a GetResourceAllowanceRequest. */ - class GetResourceAllowanceRequest implements IGetResourceAllowanceRequest { - - /** - * Constructs a new GetResourceAllowanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IGetResourceAllowanceRequest); - - /** GetResourceAllowanceRequest name. */ - public name: string; - - /** - * Creates a new GetResourceAllowanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetResourceAllowanceRequest instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IGetResourceAllowanceRequest): google.cloud.batch.v1alpha.GetResourceAllowanceRequest; - - /** - * Encodes the specified GetResourceAllowanceRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.GetResourceAllowanceRequest.verify|verify} messages. - * @param message GetResourceAllowanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IGetResourceAllowanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetResourceAllowanceRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.GetResourceAllowanceRequest.verify|verify} messages. - * @param message GetResourceAllowanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IGetResourceAllowanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetResourceAllowanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetResourceAllowanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.GetResourceAllowanceRequest; - - /** - * Decodes a GetResourceAllowanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetResourceAllowanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.GetResourceAllowanceRequest; - - /** - * Verifies a GetResourceAllowanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetResourceAllowanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetResourceAllowanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.GetResourceAllowanceRequest; - - /** - * Creates a plain object from a GetResourceAllowanceRequest message. Also converts values to other types if specified. - * @param message GetResourceAllowanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.GetResourceAllowanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetResourceAllowanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetResourceAllowanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteResourceAllowanceRequest. */ - interface IDeleteResourceAllowanceRequest { - - /** DeleteResourceAllowanceRequest name */ - name?: (string|null); - - /** DeleteResourceAllowanceRequest reason */ - reason?: (string|null); - - /** DeleteResourceAllowanceRequest requestId */ - requestId?: (string|null); - } - - /** Represents a DeleteResourceAllowanceRequest. */ - class DeleteResourceAllowanceRequest implements IDeleteResourceAllowanceRequest { - - /** - * Constructs a new DeleteResourceAllowanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest); - - /** DeleteResourceAllowanceRequest name. */ - public name: string; - - /** DeleteResourceAllowanceRequest reason. */ - public reason: string; - - /** DeleteResourceAllowanceRequest requestId. */ - public requestId: string; - - /** - * Creates a new DeleteResourceAllowanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteResourceAllowanceRequest instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest): google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest; - - /** - * Encodes the specified DeleteResourceAllowanceRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest.verify|verify} messages. - * @param message DeleteResourceAllowanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteResourceAllowanceRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest.verify|verify} messages. - * @param message DeleteResourceAllowanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteResourceAllowanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteResourceAllowanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest; - - /** - * Decodes a DeleteResourceAllowanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteResourceAllowanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest; - - /** - * Verifies a DeleteResourceAllowanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteResourceAllowanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteResourceAllowanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest; - - /** - * Creates a plain object from a DeleteResourceAllowanceRequest message. Also converts values to other types if specified. - * @param message DeleteResourceAllowanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteResourceAllowanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteResourceAllowanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListResourceAllowancesRequest. */ - interface IListResourceAllowancesRequest { - - /** ListResourceAllowancesRequest parent */ - parent?: (string|null); - - /** ListResourceAllowancesRequest pageSize */ - pageSize?: (number|null); - - /** ListResourceAllowancesRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListResourceAllowancesRequest. */ - class ListResourceAllowancesRequest implements IListResourceAllowancesRequest { - - /** - * Constructs a new ListResourceAllowancesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IListResourceAllowancesRequest); - - /** ListResourceAllowancesRequest parent. */ - public parent: string; - - /** ListResourceAllowancesRequest pageSize. */ - public pageSize: number; - - /** ListResourceAllowancesRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListResourceAllowancesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListResourceAllowancesRequest instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IListResourceAllowancesRequest): google.cloud.batch.v1alpha.ListResourceAllowancesRequest; - - /** - * Encodes the specified ListResourceAllowancesRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.ListResourceAllowancesRequest.verify|verify} messages. - * @param message ListResourceAllowancesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IListResourceAllowancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListResourceAllowancesRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListResourceAllowancesRequest.verify|verify} messages. - * @param message ListResourceAllowancesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IListResourceAllowancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListResourceAllowancesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListResourceAllowancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ListResourceAllowancesRequest; - - /** - * Decodes a ListResourceAllowancesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListResourceAllowancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ListResourceAllowancesRequest; - - /** - * Verifies a ListResourceAllowancesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListResourceAllowancesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListResourceAllowancesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ListResourceAllowancesRequest; - - /** - * Creates a plain object from a ListResourceAllowancesRequest message. Also converts values to other types if specified. - * @param message ListResourceAllowancesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.ListResourceAllowancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListResourceAllowancesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListResourceAllowancesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListResourceAllowancesResponse. */ - interface IListResourceAllowancesResponse { - - /** ListResourceAllowancesResponse resourceAllowances */ - resourceAllowances?: (google.cloud.batch.v1alpha.IResourceAllowance[]|null); - - /** ListResourceAllowancesResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListResourceAllowancesResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListResourceAllowancesResponse. */ - class ListResourceAllowancesResponse implements IListResourceAllowancesResponse { - - /** - * Constructs a new ListResourceAllowancesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IListResourceAllowancesResponse); - - /** ListResourceAllowancesResponse resourceAllowances. */ - public resourceAllowances: google.cloud.batch.v1alpha.IResourceAllowance[]; - - /** ListResourceAllowancesResponse nextPageToken. */ - public nextPageToken: string; - - /** ListResourceAllowancesResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListResourceAllowancesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListResourceAllowancesResponse instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IListResourceAllowancesResponse): google.cloud.batch.v1alpha.ListResourceAllowancesResponse; - - /** - * Encodes the specified ListResourceAllowancesResponse message. Does not implicitly {@link google.cloud.batch.v1alpha.ListResourceAllowancesResponse.verify|verify} messages. - * @param message ListResourceAllowancesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IListResourceAllowancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListResourceAllowancesResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListResourceAllowancesResponse.verify|verify} messages. - * @param message ListResourceAllowancesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IListResourceAllowancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListResourceAllowancesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListResourceAllowancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ListResourceAllowancesResponse; - - /** - * Decodes a ListResourceAllowancesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListResourceAllowancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ListResourceAllowancesResponse; - - /** - * Verifies a ListResourceAllowancesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListResourceAllowancesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListResourceAllowancesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ListResourceAllowancesResponse; - - /** - * Creates a plain object from a ListResourceAllowancesResponse message. Also converts values to other types if specified. - * @param message ListResourceAllowancesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.ListResourceAllowancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListResourceAllowancesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListResourceAllowancesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateResourceAllowanceRequest. */ - interface IUpdateResourceAllowanceRequest { - - /** UpdateResourceAllowanceRequest resourceAllowance */ - resourceAllowance?: (google.cloud.batch.v1alpha.IResourceAllowance|null); - - /** UpdateResourceAllowanceRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateResourceAllowanceRequest requestId */ - requestId?: (string|null); - } - - /** Represents an UpdateResourceAllowanceRequest. */ - class UpdateResourceAllowanceRequest implements IUpdateResourceAllowanceRequest { - - /** - * Constructs a new UpdateResourceAllowanceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest); - - /** UpdateResourceAllowanceRequest resourceAllowance. */ - public resourceAllowance?: (google.cloud.batch.v1alpha.IResourceAllowance|null); - - /** UpdateResourceAllowanceRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateResourceAllowanceRequest requestId. */ - public requestId: string; - - /** - * Creates a new UpdateResourceAllowanceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateResourceAllowanceRequest instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest): google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest; - - /** - * Encodes the specified UpdateResourceAllowanceRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest.verify|verify} messages. - * @param message UpdateResourceAllowanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateResourceAllowanceRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest.verify|verify} messages. - * @param message UpdateResourceAllowanceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateResourceAllowanceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateResourceAllowanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest; - - /** - * Decodes an UpdateResourceAllowanceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateResourceAllowanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest; - - /** - * Verifies an UpdateResourceAllowanceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateResourceAllowanceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateResourceAllowanceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest; - - /** - * Creates a plain object from an UpdateResourceAllowanceRequest message. Also converts values to other types if specified. - * @param message UpdateResourceAllowanceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateResourceAllowanceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateResourceAllowanceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OperationMetadata. */ - interface IOperationMetadata { - - /** OperationMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata target */ - target?: (string|null); - - /** OperationMetadata verb */ - verb?: (string|null); - - /** OperationMetadata statusMessage */ - statusMessage?: (string|null); - - /** OperationMetadata requestedCancellation */ - requestedCancellation?: (boolean|null); - - /** OperationMetadata apiVersion */ - apiVersion?: (string|null); - } - - /** Represents an OperationMetadata. */ - class OperationMetadata implements IOperationMetadata { - - /** - * Constructs a new OperationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IOperationMetadata); - - /** OperationMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata target. */ - public target: string; - - /** OperationMetadata verb. */ - public verb: string; - - /** OperationMetadata statusMessage. */ - public statusMessage: string; - - /** OperationMetadata requestedCancellation. */ - public requestedCancellation: boolean; - - /** OperationMetadata apiVersion. */ - public apiVersion: string; - - /** - * Creates a new OperationMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns OperationMetadata instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IOperationMetadata): google.cloud.batch.v1alpha.OperationMetadata; - - /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.batch.v1alpha.OperationMetadata.verify|verify} messages. - * @param message OperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.OperationMetadata.verify|verify} messages. - * @param message OperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.OperationMetadata; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.OperationMetadata; - - /** - * Verifies an OperationMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OperationMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.OperationMetadata; - - /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. - * @param message OperationMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OperationMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OperationMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Job. */ - interface IJob { - - /** Job name */ - name?: (string|null); - - /** Job uid */ - uid?: (string|null); - - /** Job priority */ - priority?: (number|Long|string|null); - - /** Job taskGroups */ - taskGroups?: (google.cloud.batch.v1alpha.ITaskGroup[]|null); - - /** Job schedulingPolicy */ - schedulingPolicy?: (google.cloud.batch.v1alpha.Job.SchedulingPolicy|keyof typeof google.cloud.batch.v1alpha.Job.SchedulingPolicy|null); - - /** Job dependencies */ - dependencies?: (google.cloud.batch.v1alpha.IJobDependency[]|null); - - /** Job allocationPolicy */ - allocationPolicy?: (google.cloud.batch.v1alpha.IAllocationPolicy|null); - - /** Job labels */ - labels?: ({ [k: string]: string }|null); - - /** Job status */ - status?: (google.cloud.batch.v1alpha.IJobStatus|null); - - /** Job notification */ - notification?: (google.cloud.batch.v1alpha.IJobNotification|null); - - /** Job createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Job updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Job logsPolicy */ - logsPolicy?: (google.cloud.batch.v1alpha.ILogsPolicy|null); - - /** Job notifications */ - notifications?: (google.cloud.batch.v1alpha.IJobNotification[]|null); - } - - /** Represents a Job. */ - class Job implements IJob { - - /** - * Constructs a new Job. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IJob); - - /** Job name. */ - public name: string; - - /** Job uid. */ - public uid: string; - - /** Job priority. */ - public priority: (number|Long|string); - - /** Job taskGroups. */ - public taskGroups: google.cloud.batch.v1alpha.ITaskGroup[]; - - /** Job schedulingPolicy. */ - public schedulingPolicy: (google.cloud.batch.v1alpha.Job.SchedulingPolicy|keyof typeof google.cloud.batch.v1alpha.Job.SchedulingPolicy); - - /** Job dependencies. */ - public dependencies: google.cloud.batch.v1alpha.IJobDependency[]; - - /** Job allocationPolicy. */ - public allocationPolicy?: (google.cloud.batch.v1alpha.IAllocationPolicy|null); - - /** Job labels. */ - public labels: { [k: string]: string }; - - /** Job status. */ - public status?: (google.cloud.batch.v1alpha.IJobStatus|null); - - /** Job notification. */ - public notification?: (google.cloud.batch.v1alpha.IJobNotification|null); - - /** Job createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Job updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Job logsPolicy. */ - public logsPolicy?: (google.cloud.batch.v1alpha.ILogsPolicy|null); - - /** Job notifications. */ - public notifications: google.cloud.batch.v1alpha.IJobNotification[]; - - /** - * Creates a new Job instance using the specified properties. - * @param [properties] Properties to set - * @returns Job instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IJob): google.cloud.batch.v1alpha.Job; - - /** - * Encodes the specified Job message. Does not implicitly {@link google.cloud.batch.v1alpha.Job.verify|verify} messages. - * @param message Job message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IJob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Job.verify|verify} messages. - * @param message Job message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IJob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Job message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Job - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Job; - - /** - * Decodes a Job message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Job - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Job; - - /** - * Verifies a Job message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Job message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Job - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Job; - - /** - * Creates a plain object from a Job message. Also converts values to other types if specified. - * @param message Job - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.Job, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Job to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Job - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Job { - - /** SchedulingPolicy enum. */ - enum SchedulingPolicy { - SCHEDULING_POLICY_UNSPECIFIED = 0, - AS_SOON_AS_POSSIBLE = 1 - } - } - - /** Properties of a LogsPolicy. */ - interface ILogsPolicy { - - /** LogsPolicy destination */ - destination?: (google.cloud.batch.v1alpha.LogsPolicy.Destination|keyof typeof google.cloud.batch.v1alpha.LogsPolicy.Destination|null); - - /** LogsPolicy logsPath */ - logsPath?: (string|null); - - /** LogsPolicy cloudLoggingOption */ - cloudLoggingOption?: (google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption|null); - } - - /** Represents a LogsPolicy. */ - class LogsPolicy implements ILogsPolicy { - - /** - * Constructs a new LogsPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.ILogsPolicy); - - /** LogsPolicy destination. */ - public destination: (google.cloud.batch.v1alpha.LogsPolicy.Destination|keyof typeof google.cloud.batch.v1alpha.LogsPolicy.Destination); - - /** LogsPolicy logsPath. */ - public logsPath: string; - - /** LogsPolicy cloudLoggingOption. */ - public cloudLoggingOption?: (google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption|null); - - /** - * Creates a new LogsPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns LogsPolicy instance - */ - public static create(properties?: google.cloud.batch.v1alpha.ILogsPolicy): google.cloud.batch.v1alpha.LogsPolicy; - - /** - * Encodes the specified LogsPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.LogsPolicy.verify|verify} messages. - * @param message LogsPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.ILogsPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LogsPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.LogsPolicy.verify|verify} messages. - * @param message LogsPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.ILogsPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LogsPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LogsPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.LogsPolicy; - - /** - * Decodes a LogsPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LogsPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.LogsPolicy; - - /** - * Verifies a LogsPolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LogsPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LogsPolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.LogsPolicy; - - /** - * Creates a plain object from a LogsPolicy message. Also converts values to other types if specified. - * @param message LogsPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.LogsPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LogsPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LogsPolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace LogsPolicy { - - /** Properties of a CloudLoggingOption. */ - interface ICloudLoggingOption { - - /** CloudLoggingOption useGenericTaskMonitoredResource */ - useGenericTaskMonitoredResource?: (boolean|null); - } - - /** Represents a CloudLoggingOption. */ - class CloudLoggingOption implements ICloudLoggingOption { - - /** - * Constructs a new CloudLoggingOption. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption); - - /** CloudLoggingOption useGenericTaskMonitoredResource. */ - public useGenericTaskMonitoredResource: boolean; - - /** - * Creates a new CloudLoggingOption instance using the specified properties. - * @param [properties] Properties to set - * @returns CloudLoggingOption instance - */ - public static create(properties?: google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption): google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption; - - /** - * Encodes the specified CloudLoggingOption message. Does not implicitly {@link google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption.verify|verify} messages. - * @param message CloudLoggingOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CloudLoggingOption message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption.verify|verify} messages. - * @param message CloudLoggingOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CloudLoggingOption message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CloudLoggingOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption; - - /** - * Decodes a CloudLoggingOption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CloudLoggingOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption; - - /** - * Verifies a CloudLoggingOption message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CloudLoggingOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CloudLoggingOption - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption; - - /** - * Creates a plain object from a CloudLoggingOption message. Also converts values to other types if specified. - * @param message CloudLoggingOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CloudLoggingOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CloudLoggingOption - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Destination enum. */ - enum Destination { - DESTINATION_UNSPECIFIED = 0, - CLOUD_LOGGING = 1, - PATH = 2 - } - } - - /** Properties of a JobDependency. */ - interface IJobDependency { - - /** JobDependency items */ - items?: ({ [k: string]: google.cloud.batch.v1alpha.JobDependency.Type }|null); - } - - /** Represents a JobDependency. */ - class JobDependency implements IJobDependency { - - /** - * Constructs a new JobDependency. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IJobDependency); - - /** JobDependency items. */ - public items: { [k: string]: google.cloud.batch.v1alpha.JobDependency.Type }; - - /** - * Creates a new JobDependency instance using the specified properties. - * @param [properties] Properties to set - * @returns JobDependency instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IJobDependency): google.cloud.batch.v1alpha.JobDependency; - - /** - * Encodes the specified JobDependency message. Does not implicitly {@link google.cloud.batch.v1alpha.JobDependency.verify|verify} messages. - * @param message JobDependency message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IJobDependency, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified JobDependency message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobDependency.verify|verify} messages. - * @param message JobDependency message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IJobDependency, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a JobDependency message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns JobDependency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.JobDependency; - - /** - * Decodes a JobDependency message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns JobDependency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.JobDependency; - - /** - * Verifies a JobDependency message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a JobDependency message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns JobDependency - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.JobDependency; - - /** - * Creates a plain object from a JobDependency message. Also converts values to other types if specified. - * @param message JobDependency - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.JobDependency, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this JobDependency to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for JobDependency - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace JobDependency { - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - SUCCEEDED = 1, - FAILED = 2, - FINISHED = 3 - } - } - - /** Properties of a JobStatus. */ - interface IJobStatus { - - /** JobStatus state */ - state?: (google.cloud.batch.v1alpha.JobStatus.State|keyof typeof google.cloud.batch.v1alpha.JobStatus.State|null); - - /** JobStatus statusEvents */ - statusEvents?: (google.cloud.batch.v1alpha.IStatusEvent[]|null); - - /** JobStatus taskGroups */ - taskGroups?: ({ [k: string]: google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus }|null); - - /** JobStatus runDuration */ - runDuration?: (google.protobuf.IDuration|null); - - /** JobStatus resourceUsage */ - resourceUsage?: (google.cloud.batch.v1alpha.IResourceUsage|null); - } - - /** Represents a JobStatus. */ - class JobStatus implements IJobStatus { - - /** - * Constructs a new JobStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IJobStatus); - - /** JobStatus state. */ - public state: (google.cloud.batch.v1alpha.JobStatus.State|keyof typeof google.cloud.batch.v1alpha.JobStatus.State); - - /** JobStatus statusEvents. */ - public statusEvents: google.cloud.batch.v1alpha.IStatusEvent[]; - - /** JobStatus taskGroups. */ - public taskGroups: { [k: string]: google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus }; - - /** JobStatus runDuration. */ - public runDuration?: (google.protobuf.IDuration|null); - - /** JobStatus resourceUsage. */ - public resourceUsage?: (google.cloud.batch.v1alpha.IResourceUsage|null); - - /** - * Creates a new JobStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns JobStatus instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IJobStatus): google.cloud.batch.v1alpha.JobStatus; - - /** - * Encodes the specified JobStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.verify|verify} messages. - * @param message JobStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IJobStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified JobStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.verify|verify} messages. - * @param message JobStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IJobStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a JobStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns JobStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.JobStatus; - - /** - * Decodes a JobStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns JobStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.JobStatus; - - /** - * Verifies a JobStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a JobStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns JobStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.JobStatus; - - /** - * Creates a plain object from a JobStatus message. Also converts values to other types if specified. - * @param message JobStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.JobStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this JobStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for JobStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace JobStatus { - - /** Properties of an InstanceStatus. */ - interface IInstanceStatus { - - /** InstanceStatus machineType */ - machineType?: (string|null); - - /** InstanceStatus provisioningModel */ - provisioningModel?: (google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel|keyof typeof google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel|null); - - /** InstanceStatus taskPack */ - taskPack?: (number|Long|string|null); - - /** InstanceStatus bootDisk */ - bootDisk?: (google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null); - } - - /** Represents an InstanceStatus. */ - class InstanceStatus implements IInstanceStatus { - - /** - * Constructs a new InstanceStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.JobStatus.IInstanceStatus); - - /** InstanceStatus machineType. */ - public machineType: string; - - /** InstanceStatus provisioningModel. */ - public provisioningModel: (google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel|keyof typeof google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel); - - /** InstanceStatus taskPack. */ - public taskPack: (number|Long|string); - - /** InstanceStatus bootDisk. */ - public bootDisk?: (google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null); - - /** - * Creates a new InstanceStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns InstanceStatus instance - */ - public static create(properties?: google.cloud.batch.v1alpha.JobStatus.IInstanceStatus): google.cloud.batch.v1alpha.JobStatus.InstanceStatus; - - /** - * Encodes the specified InstanceStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.InstanceStatus.verify|verify} messages. - * @param message InstanceStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.JobStatus.IInstanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InstanceStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.InstanceStatus.verify|verify} messages. - * @param message InstanceStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.JobStatus.IInstanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InstanceStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InstanceStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.JobStatus.InstanceStatus; - - /** - * Decodes an InstanceStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InstanceStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.JobStatus.InstanceStatus; - - /** - * Verifies an InstanceStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InstanceStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InstanceStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.JobStatus.InstanceStatus; - - /** - * Creates a plain object from an InstanceStatus message. Also converts values to other types if specified. - * @param message InstanceStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.JobStatus.InstanceStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InstanceStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InstanceStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TaskGroupStatus. */ - interface ITaskGroupStatus { - - /** TaskGroupStatus counts */ - counts?: ({ [k: string]: (number|Long|string) }|null); - - /** TaskGroupStatus instances */ - instances?: (google.cloud.batch.v1alpha.JobStatus.IInstanceStatus[]|null); - } - - /** Represents a TaskGroupStatus. */ - class TaskGroupStatus implements ITaskGroupStatus { - - /** - * Constructs a new TaskGroupStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus); - - /** TaskGroupStatus counts. */ - public counts: { [k: string]: (number|Long|string) }; - - /** TaskGroupStatus instances. */ - public instances: google.cloud.batch.v1alpha.JobStatus.IInstanceStatus[]; - - /** - * Creates a new TaskGroupStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns TaskGroupStatus instance - */ - public static create(properties?: google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus): google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus; - - /** - * Encodes the specified TaskGroupStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.verify|verify} messages. - * @param message TaskGroupStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TaskGroupStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.verify|verify} messages. - * @param message TaskGroupStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TaskGroupStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TaskGroupStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus; - - /** - * Decodes a TaskGroupStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TaskGroupStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus; - - /** - * Verifies a TaskGroupStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TaskGroupStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TaskGroupStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus; - - /** - * Creates a plain object from a TaskGroupStatus message. Also converts values to other types if specified. - * @param message TaskGroupStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TaskGroupStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TaskGroupStatus - * @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, - QUEUED = 1, - SCHEDULED = 2, - RUNNING = 3, - SUCCEEDED = 4, - FAILED = 5, - DELETION_IN_PROGRESS = 6, - CANCELLATION_IN_PROGRESS = 7, - CANCELLED = 8 - } - } - - /** Properties of a ResourceUsage. */ - interface IResourceUsage { - - /** ResourceUsage coreHours */ - coreHours?: (number|null); - } - - /** Represents a ResourceUsage. */ - class ResourceUsage implements IResourceUsage { - - /** - * Constructs a new ResourceUsage. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IResourceUsage); - - /** ResourceUsage coreHours. */ - public coreHours: number; - - /** - * Creates a new ResourceUsage instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceUsage instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IResourceUsage): google.cloud.batch.v1alpha.ResourceUsage; - - /** - * Encodes the specified ResourceUsage message. Does not implicitly {@link google.cloud.batch.v1alpha.ResourceUsage.verify|verify} messages. - * @param message ResourceUsage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IResourceUsage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceUsage message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ResourceUsage.verify|verify} messages. - * @param message ResourceUsage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IResourceUsage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceUsage message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceUsage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ResourceUsage; - - /** - * Decodes a ResourceUsage message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceUsage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ResourceUsage; - - /** - * Verifies a ResourceUsage message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceUsage message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceUsage - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ResourceUsage; - - /** - * Creates a plain object from a ResourceUsage message. Also converts values to other types if specified. - * @param message ResourceUsage - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.ResourceUsage, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceUsage to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceUsage - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a JobNotification. */ - interface IJobNotification { - - /** JobNotification pubsubTopic */ - pubsubTopic?: (string|null); - - /** JobNotification message */ - message?: (google.cloud.batch.v1alpha.JobNotification.IMessage|null); - } - - /** Represents a JobNotification. */ - class JobNotification implements IJobNotification { - - /** - * Constructs a new JobNotification. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IJobNotification); - - /** JobNotification pubsubTopic. */ - public pubsubTopic: string; - - /** JobNotification message. */ - public message?: (google.cloud.batch.v1alpha.JobNotification.IMessage|null); - - /** - * Creates a new JobNotification instance using the specified properties. - * @param [properties] Properties to set - * @returns JobNotification instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IJobNotification): google.cloud.batch.v1alpha.JobNotification; - - /** - * Encodes the specified JobNotification message. Does not implicitly {@link google.cloud.batch.v1alpha.JobNotification.verify|verify} messages. - * @param message JobNotification message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IJobNotification, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified JobNotification message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobNotification.verify|verify} messages. - * @param message JobNotification message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IJobNotification, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a JobNotification message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns JobNotification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.JobNotification; - - /** - * Decodes a JobNotification message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns JobNotification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.JobNotification; - - /** - * Verifies a JobNotification message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a JobNotification message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns JobNotification - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.JobNotification; - - /** - * Creates a plain object from a JobNotification message. Also converts values to other types if specified. - * @param message JobNotification - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.JobNotification, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this JobNotification to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for JobNotification - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace JobNotification { - - /** Properties of a Message. */ - interface IMessage { - - /** Message type */ - type?: (google.cloud.batch.v1alpha.JobNotification.Type|keyof typeof google.cloud.batch.v1alpha.JobNotification.Type|null); - - /** Message newJobState */ - newJobState?: (google.cloud.batch.v1alpha.JobStatus.State|keyof typeof google.cloud.batch.v1alpha.JobStatus.State|null); - - /** Message newTaskState */ - newTaskState?: (google.cloud.batch.v1alpha.TaskStatus.State|keyof typeof google.cloud.batch.v1alpha.TaskStatus.State|null); - } - - /** Represents a Message. */ - class Message implements IMessage { - - /** - * Constructs a new Message. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.JobNotification.IMessage); - - /** Message type. */ - public type: (google.cloud.batch.v1alpha.JobNotification.Type|keyof typeof google.cloud.batch.v1alpha.JobNotification.Type); - - /** Message newJobState. */ - public newJobState: (google.cloud.batch.v1alpha.JobStatus.State|keyof typeof google.cloud.batch.v1alpha.JobStatus.State); - - /** Message newTaskState. */ - public newTaskState: (google.cloud.batch.v1alpha.TaskStatus.State|keyof typeof google.cloud.batch.v1alpha.TaskStatus.State); - - /** - * Creates a new Message instance using the specified properties. - * @param [properties] Properties to set - * @returns Message instance - */ - public static create(properties?: google.cloud.batch.v1alpha.JobNotification.IMessage): google.cloud.batch.v1alpha.JobNotification.Message; - - /** - * Encodes the specified Message message. Does not implicitly {@link google.cloud.batch.v1alpha.JobNotification.Message.verify|verify} messages. - * @param message Message message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.JobNotification.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobNotification.Message.verify|verify} messages. - * @param message Message message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.JobNotification.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Message message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.JobNotification.Message; - - /** - * Decodes a Message message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.JobNotification.Message; - - /** - * Verifies a Message message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Message message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Message - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.JobNotification.Message; - - /** - * Creates a plain object from a Message message. Also converts values to other types if specified. - * @param message Message - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.JobNotification.Message, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Message to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Message - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - JOB_STATE_CHANGED = 1, - TASK_STATE_CHANGED = 2 - } - } - - /** Properties of an AllocationPolicy. */ - interface IAllocationPolicy { - - /** AllocationPolicy location */ - location?: (google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy|null); - - /** AllocationPolicy instance */ - instance?: (google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy|null); - - /** AllocationPolicy instances */ - instances?: (google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate[]|null); - - /** AllocationPolicy instanceTemplates */ - instanceTemplates?: (string[]|null); - - /** AllocationPolicy provisioningModels */ - provisioningModels?: (google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel[]|null); - - /** AllocationPolicy serviceAccountEmail */ - serviceAccountEmail?: (string|null); - - /** AllocationPolicy serviceAccount */ - serviceAccount?: (google.cloud.batch.v1alpha.IServiceAccount|null); - - /** AllocationPolicy labels */ - labels?: ({ [k: string]: string }|null); - - /** AllocationPolicy network */ - network?: (google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy|null); - - /** AllocationPolicy placement */ - placement?: (google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy|null); - - /** AllocationPolicy tags */ - tags?: (string[]|null); - } - - /** Represents an AllocationPolicy. */ - class AllocationPolicy implements IAllocationPolicy { - - /** - * Constructs a new AllocationPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IAllocationPolicy); - - /** AllocationPolicy location. */ - public location?: (google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy|null); - - /** AllocationPolicy instance. */ - public instance?: (google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy|null); - - /** AllocationPolicy instances. */ - public instances: google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate[]; - - /** AllocationPolicy instanceTemplates. */ - public instanceTemplates: string[]; - - /** AllocationPolicy provisioningModels. */ - public provisioningModels: google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel[]; - - /** AllocationPolicy serviceAccountEmail. */ - public serviceAccountEmail: string; - - /** AllocationPolicy serviceAccount. */ - public serviceAccount?: (google.cloud.batch.v1alpha.IServiceAccount|null); - - /** AllocationPolicy labels. */ - public labels: { [k: string]: string }; - - /** AllocationPolicy network. */ - public network?: (google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy|null); - - /** AllocationPolicy placement. */ - public placement?: (google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy|null); - - /** AllocationPolicy tags. */ - public tags: string[]; - - /** - * Creates a new AllocationPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns AllocationPolicy instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IAllocationPolicy): google.cloud.batch.v1alpha.AllocationPolicy; - - /** - * Encodes the specified AllocationPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.verify|verify} messages. - * @param message AllocationPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IAllocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AllocationPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.verify|verify} messages. - * @param message AllocationPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IAllocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AllocationPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AllocationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy; - - /** - * Decodes an AllocationPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AllocationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy; - - /** - * Verifies an AllocationPolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AllocationPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AllocationPolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy; - - /** - * Creates a plain object from an AllocationPolicy message. Also converts values to other types if specified. - * @param message AllocationPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AllocationPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AllocationPolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AllocationPolicy { - - /** Properties of a LocationPolicy. */ - interface ILocationPolicy { - - /** LocationPolicy allowedLocations */ - allowedLocations?: (string[]|null); - - /** LocationPolicy deniedLocations */ - deniedLocations?: (string[]|null); - } - - /** Represents a LocationPolicy. */ - class LocationPolicy implements ILocationPolicy { - - /** - * Constructs a new LocationPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy); - - /** LocationPolicy allowedLocations. */ - public allowedLocations: string[]; - - /** LocationPolicy deniedLocations. */ - public deniedLocations: string[]; - - /** - * Creates a new LocationPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns LocationPolicy instance - */ - public static create(properties?: google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy): google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy; - - /** - * Encodes the specified LocationPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.verify|verify} messages. - * @param message LocationPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LocationPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.verify|verify} messages. - * @param message LocationPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LocationPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LocationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy; - - /** - * Decodes a LocationPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LocationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy; - - /** - * Verifies a LocationPolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LocationPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LocationPolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy; - - /** - * Creates a plain object from a LocationPolicy message. Also converts values to other types if specified. - * @param message LocationPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LocationPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LocationPolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Disk. */ - interface IDisk { - - /** Disk image */ - image?: (string|null); - - /** Disk snapshot */ - snapshot?: (string|null); - - /** Disk type */ - type?: (string|null); - - /** Disk sizeGb */ - sizeGb?: (number|Long|string|null); - - /** Disk diskInterface */ - diskInterface?: (string|null); - } - - /** Represents a Disk. */ - class Disk implements IDisk { - - /** - * Constructs a new Disk. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IDisk); - - /** Disk image. */ - public image?: (string|null); - - /** Disk snapshot. */ - public snapshot?: (string|null); - - /** Disk type. */ - public type: string; - - /** Disk sizeGb. */ - public sizeGb: (number|Long|string); - - /** Disk diskInterface. */ - public diskInterface: string; - - /** Disk dataSource. */ - public dataSource?: ("image"|"snapshot"); - - /** - * Creates a new Disk instance using the specified properties. - * @param [properties] Properties to set - * @returns Disk instance - */ - public static create(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IDisk): google.cloud.batch.v1alpha.AllocationPolicy.Disk; - - /** - * Encodes the specified Disk message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.Disk.verify|verify} messages. - * @param message Disk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.AllocationPolicy.IDisk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Disk message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.Disk.verify|verify} messages. - * @param message Disk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.AllocationPolicy.IDisk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Disk message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Disk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy.Disk; - - /** - * Decodes a Disk message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Disk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy.Disk; - - /** - * Verifies a Disk message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Disk message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Disk - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy.Disk; - - /** - * Creates a plain object from a Disk message. Also converts values to other types if specified. - * @param message Disk - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy.Disk, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Disk to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Disk - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AttachedDisk. */ - interface IAttachedDisk { - - /** AttachedDisk newDisk */ - newDisk?: (google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null); - - /** AttachedDisk existingDisk */ - existingDisk?: (string|null); - - /** AttachedDisk deviceName */ - deviceName?: (string|null); - } - - /** Represents an AttachedDisk. */ - class AttachedDisk implements IAttachedDisk { - - /** - * Constructs a new AttachedDisk. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk); - - /** AttachedDisk newDisk. */ - public newDisk?: (google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null); - - /** AttachedDisk existingDisk. */ - public existingDisk?: (string|null); - - /** AttachedDisk deviceName. */ - public deviceName: string; - - /** AttachedDisk attached. */ - public attached?: ("newDisk"|"existingDisk"); - - /** - * Creates a new AttachedDisk instance using the specified properties. - * @param [properties] Properties to set - * @returns AttachedDisk instance - */ - public static create(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk): google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk; - - /** - * Encodes the specified AttachedDisk message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.verify|verify} messages. - * @param message AttachedDisk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AttachedDisk message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.verify|verify} messages. - * @param message AttachedDisk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AttachedDisk message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AttachedDisk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk; - - /** - * Decodes an AttachedDisk message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AttachedDisk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk; - - /** - * Verifies an AttachedDisk message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AttachedDisk message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AttachedDisk - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk; - - /** - * Creates a plain object from an AttachedDisk message. Also converts values to other types if specified. - * @param message AttachedDisk - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AttachedDisk to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AttachedDisk - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Accelerator. */ - interface IAccelerator { - - /** Accelerator type */ - type?: (string|null); - - /** Accelerator count */ - count?: (number|Long|string|null); - - /** Accelerator installGpuDrivers */ - installGpuDrivers?: (boolean|null); - - /** Accelerator driverVersion */ - driverVersion?: (string|null); - } - - /** Represents an Accelerator. */ - class Accelerator implements IAccelerator { - - /** - * Constructs a new Accelerator. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator); - - /** Accelerator type. */ - public type: string; - - /** Accelerator count. */ - public count: (number|Long|string); - - /** Accelerator installGpuDrivers. */ - public installGpuDrivers: boolean; - - /** Accelerator driverVersion. */ - public driverVersion: string; - - /** - * Creates a new Accelerator instance using the specified properties. - * @param [properties] Properties to set - * @returns Accelerator instance - */ - public static create(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator): google.cloud.batch.v1alpha.AllocationPolicy.Accelerator; - - /** - * Encodes the specified Accelerator message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.verify|verify} messages. - * @param message Accelerator message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Accelerator message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.verify|verify} messages. - * @param message Accelerator message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Accelerator message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Accelerator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy.Accelerator; - - /** - * Decodes an Accelerator message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Accelerator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy.Accelerator; - - /** - * Verifies an Accelerator message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Accelerator message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Accelerator - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy.Accelerator; - - /** - * Creates a plain object from an Accelerator message. Also converts values to other types if specified. - * @param message Accelerator - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy.Accelerator, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Accelerator to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Accelerator - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InstancePolicy. */ - interface IInstancePolicy { - - /** InstancePolicy allowedMachineTypes */ - allowedMachineTypes?: (string[]|null); - - /** InstancePolicy machineType */ - machineType?: (string|null); - - /** InstancePolicy minCpuPlatform */ - minCpuPlatform?: (string|null); - - /** InstancePolicy provisioningModel */ - provisioningModel?: (google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel|keyof typeof google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel|null); - - /** InstancePolicy accelerators */ - accelerators?: (google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator[]|null); - - /** InstancePolicy bootDisk */ - bootDisk?: (google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null); - - /** InstancePolicy disks */ - disks?: (google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk[]|null); - - /** InstancePolicy reservation */ - reservation?: (string|null); - } - - /** Represents an InstancePolicy. */ - class InstancePolicy implements IInstancePolicy { - - /** - * Constructs a new InstancePolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy); - - /** InstancePolicy allowedMachineTypes. */ - public allowedMachineTypes: string[]; - - /** InstancePolicy machineType. */ - public machineType: string; - - /** InstancePolicy minCpuPlatform. */ - public minCpuPlatform: string; - - /** InstancePolicy provisioningModel. */ - public provisioningModel: (google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel|keyof typeof google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel); - - /** InstancePolicy accelerators. */ - public accelerators: google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator[]; - - /** InstancePolicy bootDisk. */ - public bootDisk?: (google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null); - - /** InstancePolicy disks. */ - public disks: google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk[]; - - /** InstancePolicy reservation. */ - public reservation: string; - - /** - * Creates a new InstancePolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns InstancePolicy instance - */ - public static create(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy): google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy; - - /** - * Encodes the specified InstancePolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.verify|verify} messages. - * @param message InstancePolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InstancePolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.verify|verify} messages. - * @param message InstancePolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InstancePolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InstancePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy; - - /** - * Decodes an InstancePolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InstancePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy; - - /** - * Verifies an InstancePolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InstancePolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InstancePolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy; - - /** - * Creates a plain object from an InstancePolicy message. Also converts values to other types if specified. - * @param message InstancePolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InstancePolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InstancePolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InstancePolicyOrTemplate. */ - interface IInstancePolicyOrTemplate { - - /** InstancePolicyOrTemplate policy */ - policy?: (google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy|null); - - /** InstancePolicyOrTemplate instanceTemplate */ - instanceTemplate?: (string|null); - - /** InstancePolicyOrTemplate installGpuDrivers */ - installGpuDrivers?: (boolean|null); - - /** InstancePolicyOrTemplate installOpsAgent */ - installOpsAgent?: (boolean|null); - - /** InstancePolicyOrTemplate blockProjectSshKeys */ - blockProjectSshKeys?: (boolean|null); - } - - /** Represents an InstancePolicyOrTemplate. */ - class InstancePolicyOrTemplate implements IInstancePolicyOrTemplate { - - /** - * Constructs a new InstancePolicyOrTemplate. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate); - - /** InstancePolicyOrTemplate policy. */ - public policy?: (google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy|null); - - /** InstancePolicyOrTemplate instanceTemplate. */ - public instanceTemplate?: (string|null); - - /** InstancePolicyOrTemplate installGpuDrivers. */ - public installGpuDrivers: boolean; - - /** InstancePolicyOrTemplate installOpsAgent. */ - public installOpsAgent: boolean; - - /** InstancePolicyOrTemplate blockProjectSshKeys. */ - public blockProjectSshKeys: boolean; - - /** InstancePolicyOrTemplate policyTemplate. */ - public policyTemplate?: ("policy"|"instanceTemplate"); - - /** - * Creates a new InstancePolicyOrTemplate instance using the specified properties. - * @param [properties] Properties to set - * @returns InstancePolicyOrTemplate instance - */ - public static create(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate): google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate; - - /** - * Encodes the specified InstancePolicyOrTemplate message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.verify|verify} messages. - * @param message InstancePolicyOrTemplate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InstancePolicyOrTemplate message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.verify|verify} messages. - * @param message InstancePolicyOrTemplate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InstancePolicyOrTemplate message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InstancePolicyOrTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate; - - /** - * Decodes an InstancePolicyOrTemplate message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InstancePolicyOrTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate; - - /** - * Verifies an InstancePolicyOrTemplate message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InstancePolicyOrTemplate message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InstancePolicyOrTemplate - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate; - - /** - * Creates a plain object from an InstancePolicyOrTemplate message. Also converts values to other types if specified. - * @param message InstancePolicyOrTemplate - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InstancePolicyOrTemplate to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InstancePolicyOrTemplate - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a NetworkInterface. */ - interface INetworkInterface { - - /** NetworkInterface network */ - network?: (string|null); - - /** NetworkInterface subnetwork */ - subnetwork?: (string|null); - - /** NetworkInterface noExternalIpAddress */ - noExternalIpAddress?: (boolean|null); - } - - /** Represents a NetworkInterface. */ - class NetworkInterface implements INetworkInterface { - - /** - * Constructs a new NetworkInterface. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface); - - /** NetworkInterface network. */ - public network: string; - - /** NetworkInterface subnetwork. */ - public subnetwork: string; - - /** NetworkInterface noExternalIpAddress. */ - public noExternalIpAddress: boolean; - - /** - * Creates a new NetworkInterface instance using the specified properties. - * @param [properties] Properties to set - * @returns NetworkInterface instance - */ - public static create(properties?: google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface): google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface; - - /** - * Encodes the specified NetworkInterface message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.verify|verify} messages. - * @param message NetworkInterface message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NetworkInterface message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.verify|verify} messages. - * @param message NetworkInterface message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NetworkInterface message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NetworkInterface - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface; - - /** - * Decodes a NetworkInterface message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NetworkInterface - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface; - - /** - * Verifies a NetworkInterface message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NetworkInterface message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NetworkInterface - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface; - - /** - * Creates a plain object from a NetworkInterface message. Also converts values to other types if specified. - * @param message NetworkInterface - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NetworkInterface to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NetworkInterface - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a NetworkPolicy. */ - interface INetworkPolicy { - - /** NetworkPolicy networkInterfaces */ - networkInterfaces?: (google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface[]|null); - } - - /** Represents a NetworkPolicy. */ - class NetworkPolicy implements INetworkPolicy { - - /** - * Constructs a new NetworkPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy); - - /** NetworkPolicy networkInterfaces. */ - public networkInterfaces: google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface[]; - - /** - * Creates a new NetworkPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns NetworkPolicy instance - */ - public static create(properties?: google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy): google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy; - - /** - * Encodes the specified NetworkPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.verify|verify} messages. - * @param message NetworkPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NetworkPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.verify|verify} messages. - * @param message NetworkPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NetworkPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NetworkPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy; - - /** - * Decodes a NetworkPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NetworkPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy; - - /** - * Verifies a NetworkPolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NetworkPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NetworkPolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy; - - /** - * Creates a plain object from a NetworkPolicy message. Also converts values to other types if specified. - * @param message NetworkPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NetworkPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NetworkPolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PlacementPolicy. */ - interface IPlacementPolicy { - - /** PlacementPolicy collocation */ - collocation?: (string|null); - - /** PlacementPolicy maxDistance */ - maxDistance?: (number|Long|string|null); - } - - /** Represents a PlacementPolicy. */ - class PlacementPolicy implements IPlacementPolicy { - - /** - * Constructs a new PlacementPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy); - - /** PlacementPolicy collocation. */ - public collocation: string; - - /** PlacementPolicy maxDistance. */ - public maxDistance: (number|Long|string); - - /** - * Creates a new PlacementPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns PlacementPolicy instance - */ - public static create(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy): google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy; - - /** - * Encodes the specified PlacementPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.verify|verify} messages. - * @param message PlacementPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PlacementPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.verify|verify} messages. - * @param message PlacementPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PlacementPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PlacementPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy; - - /** - * Decodes a PlacementPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PlacementPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy; - - /** - * Verifies a PlacementPolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PlacementPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PlacementPolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy; - - /** - * Creates a plain object from a PlacementPolicy message. Also converts values to other types if specified. - * @param message PlacementPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PlacementPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PlacementPolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** ProvisioningModel enum. */ - enum ProvisioningModel { - PROVISIONING_MODEL_UNSPECIFIED = 0, - STANDARD = 1, - SPOT = 2, - PREEMPTIBLE = 3 - } - } - - /** Properties of a TaskGroup. */ - interface ITaskGroup { - - /** TaskGroup name */ - name?: (string|null); - - /** TaskGroup taskSpec */ - taskSpec?: (google.cloud.batch.v1alpha.ITaskSpec|null); - - /** TaskGroup taskCount */ - taskCount?: (number|Long|string|null); - - /** TaskGroup parallelism */ - parallelism?: (number|Long|string|null); - - /** TaskGroup schedulingPolicy */ - schedulingPolicy?: (google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy|keyof typeof google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy|null); - - /** TaskGroup allocationPolicy */ - allocationPolicy?: (google.cloud.batch.v1alpha.IAllocationPolicy|null); - - /** TaskGroup labels */ - labels?: ({ [k: string]: string }|null); - - /** TaskGroup taskEnvironments */ - taskEnvironments?: (google.cloud.batch.v1alpha.IEnvironment[]|null); - - /** TaskGroup taskCountPerNode */ - taskCountPerNode?: (number|Long|string|null); - - /** TaskGroup requireHostsFile */ - requireHostsFile?: (boolean|null); - - /** TaskGroup permissiveSsh */ - permissiveSsh?: (boolean|null); - - /** TaskGroup runAsNonRoot */ - runAsNonRoot?: (boolean|null); - - /** TaskGroup serviceAccount */ - serviceAccount?: (google.cloud.batch.v1alpha.IServiceAccount|null); - } - - /** Represents a TaskGroup. */ - class TaskGroup implements ITaskGroup { - - /** - * Constructs a new TaskGroup. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.ITaskGroup); - - /** TaskGroup name. */ - public name: string; - - /** TaskGroup taskSpec. */ - public taskSpec?: (google.cloud.batch.v1alpha.ITaskSpec|null); - - /** TaskGroup taskCount. */ - public taskCount: (number|Long|string); - - /** TaskGroup parallelism. */ - public parallelism: (number|Long|string); - - /** TaskGroup schedulingPolicy. */ - public schedulingPolicy: (google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy|keyof typeof google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy); - - /** TaskGroup allocationPolicy. */ - public allocationPolicy?: (google.cloud.batch.v1alpha.IAllocationPolicy|null); - - /** TaskGroup labels. */ - public labels: { [k: string]: string }; - - /** TaskGroup taskEnvironments. */ - public taskEnvironments: google.cloud.batch.v1alpha.IEnvironment[]; - - /** TaskGroup taskCountPerNode. */ - public taskCountPerNode: (number|Long|string); - - /** TaskGroup requireHostsFile. */ - public requireHostsFile: boolean; - - /** TaskGroup permissiveSsh. */ - public permissiveSsh: boolean; - - /** TaskGroup runAsNonRoot. */ - public runAsNonRoot: boolean; - - /** TaskGroup serviceAccount. */ - public serviceAccount?: (google.cloud.batch.v1alpha.IServiceAccount|null); - - /** - * Creates a new TaskGroup instance using the specified properties. - * @param [properties] Properties to set - * @returns TaskGroup instance - */ - public static create(properties?: google.cloud.batch.v1alpha.ITaskGroup): google.cloud.batch.v1alpha.TaskGroup; - - /** - * Encodes the specified TaskGroup message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskGroup.verify|verify} messages. - * @param message TaskGroup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.ITaskGroup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TaskGroup message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskGroup.verify|verify} messages. - * @param message TaskGroup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.ITaskGroup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TaskGroup message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TaskGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.TaskGroup; - - /** - * Decodes a TaskGroup message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TaskGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.TaskGroup; - - /** - * Verifies a TaskGroup message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TaskGroup message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TaskGroup - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.TaskGroup; - - /** - * Creates a plain object from a TaskGroup message. Also converts values to other types if specified. - * @param message TaskGroup - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.TaskGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TaskGroup to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TaskGroup - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace TaskGroup { - - /** SchedulingPolicy enum. */ - enum SchedulingPolicy { - SCHEDULING_POLICY_UNSPECIFIED = 0, - AS_SOON_AS_POSSIBLE = 1, - IN_ORDER = 2 - } - } - - /** Properties of a ServiceAccount. */ - interface IServiceAccount { - - /** ServiceAccount email */ - email?: (string|null); - - /** ServiceAccount scopes */ - scopes?: (string[]|null); - } - - /** Represents a ServiceAccount. */ - class ServiceAccount implements IServiceAccount { - - /** - * Constructs a new ServiceAccount. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IServiceAccount); - - /** ServiceAccount email. */ - public email: string; - - /** ServiceAccount scopes. */ - public scopes: string[]; - - /** - * Creates a new ServiceAccount instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceAccount instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IServiceAccount): google.cloud.batch.v1alpha.ServiceAccount; - - /** - * Encodes the specified ServiceAccount message. Does not implicitly {@link google.cloud.batch.v1alpha.ServiceAccount.verify|verify} messages. - * @param message ServiceAccount message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IServiceAccount, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceAccount message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ServiceAccount.verify|verify} messages. - * @param message ServiceAccount message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IServiceAccount, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceAccount message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ServiceAccount; - - /** - * Decodes a ServiceAccount message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ServiceAccount; - - /** - * Verifies a ServiceAccount message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceAccount message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceAccount - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ServiceAccount; - - /** - * Creates a plain object from a ServiceAccount message. Also converts values to other types if specified. - * @param message ServiceAccount - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.ServiceAccount, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceAccount to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceAccount - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ComputeResource. */ - interface IComputeResource { - - /** ComputeResource cpuMilli */ - cpuMilli?: (number|Long|string|null); - - /** ComputeResource memoryMib */ - memoryMib?: (number|Long|string|null); - - /** ComputeResource gpuCount */ - gpuCount?: (number|Long|string|null); - - /** ComputeResource bootDiskMib */ - bootDiskMib?: (number|Long|string|null); - } - - /** Represents a ComputeResource. */ - class ComputeResource implements IComputeResource { - - /** - * Constructs a new ComputeResource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IComputeResource); - - /** ComputeResource cpuMilli. */ - public cpuMilli: (number|Long|string); - - /** ComputeResource memoryMib. */ - public memoryMib: (number|Long|string); - - /** ComputeResource gpuCount. */ - public gpuCount: (number|Long|string); - - /** ComputeResource bootDiskMib. */ - public bootDiskMib: (number|Long|string); - - /** - * Creates a new ComputeResource instance using the specified properties. - * @param [properties] Properties to set - * @returns ComputeResource instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IComputeResource): google.cloud.batch.v1alpha.ComputeResource; - - /** - * Encodes the specified ComputeResource message. Does not implicitly {@link google.cloud.batch.v1alpha.ComputeResource.verify|verify} messages. - * @param message ComputeResource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IComputeResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ComputeResource message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ComputeResource.verify|verify} messages. - * @param message ComputeResource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IComputeResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ComputeResource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ComputeResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ComputeResource; - - /** - * Decodes a ComputeResource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ComputeResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ComputeResource; - - /** - * Verifies a ComputeResource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ComputeResource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ComputeResource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ComputeResource; - - /** - * Creates a plain object from a ComputeResource message. Also converts values to other types if specified. - * @param message ComputeResource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.ComputeResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ComputeResource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ComputeResource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a StatusEvent. */ - interface IStatusEvent { - - /** StatusEvent type */ - type?: (string|null); - - /** StatusEvent description */ - description?: (string|null); - - /** StatusEvent eventTime */ - eventTime?: (google.protobuf.ITimestamp|null); - - /** StatusEvent taskExecution */ - taskExecution?: (google.cloud.batch.v1alpha.ITaskExecution|null); - - /** StatusEvent taskState */ - taskState?: (google.cloud.batch.v1alpha.TaskStatus.State|keyof typeof google.cloud.batch.v1alpha.TaskStatus.State|null); - } - - /** Represents a StatusEvent. */ - class StatusEvent implements IStatusEvent { - - /** - * Constructs a new StatusEvent. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IStatusEvent); - - /** StatusEvent type. */ - public type: string; - - /** StatusEvent description. */ - public description: string; - - /** StatusEvent eventTime. */ - public eventTime?: (google.protobuf.ITimestamp|null); - - /** StatusEvent taskExecution. */ - public taskExecution?: (google.cloud.batch.v1alpha.ITaskExecution|null); - - /** StatusEvent taskState. */ - public taskState: (google.cloud.batch.v1alpha.TaskStatus.State|keyof typeof google.cloud.batch.v1alpha.TaskStatus.State); - - /** - * Creates a new StatusEvent instance using the specified properties. - * @param [properties] Properties to set - * @returns StatusEvent instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IStatusEvent): google.cloud.batch.v1alpha.StatusEvent; - - /** - * Encodes the specified StatusEvent message. Does not implicitly {@link google.cloud.batch.v1alpha.StatusEvent.verify|verify} messages. - * @param message StatusEvent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IStatusEvent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StatusEvent message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.StatusEvent.verify|verify} messages. - * @param message StatusEvent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IStatusEvent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StatusEvent message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StatusEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.StatusEvent; - - /** - * Decodes a StatusEvent message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StatusEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.StatusEvent; - - /** - * Verifies a StatusEvent message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StatusEvent message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StatusEvent - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.StatusEvent; - - /** - * Creates a plain object from a StatusEvent message. Also converts values to other types if specified. - * @param message StatusEvent - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.StatusEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StatusEvent to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StatusEvent - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TaskExecution. */ - interface ITaskExecution { - - /** TaskExecution exitCode */ - exitCode?: (number|null); - - /** TaskExecution stderrSnippet */ - stderrSnippet?: (string|null); - } - - /** Represents a TaskExecution. */ - class TaskExecution implements ITaskExecution { - - /** - * Constructs a new TaskExecution. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.ITaskExecution); - - /** TaskExecution exitCode. */ - public exitCode: number; - - /** TaskExecution stderrSnippet. */ - public stderrSnippet: string; - - /** - * Creates a new TaskExecution instance using the specified properties. - * @param [properties] Properties to set - * @returns TaskExecution instance - */ - public static create(properties?: google.cloud.batch.v1alpha.ITaskExecution): google.cloud.batch.v1alpha.TaskExecution; - - /** - * Encodes the specified TaskExecution message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskExecution.verify|verify} messages. - * @param message TaskExecution message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.ITaskExecution, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TaskExecution message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskExecution.verify|verify} messages. - * @param message TaskExecution message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.ITaskExecution, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TaskExecution message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TaskExecution - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.TaskExecution; - - /** - * Decodes a TaskExecution message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TaskExecution - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.TaskExecution; - - /** - * Verifies a TaskExecution message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TaskExecution message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TaskExecution - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.TaskExecution; - - /** - * Creates a plain object from a TaskExecution message. Also converts values to other types if specified. - * @param message TaskExecution - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.TaskExecution, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TaskExecution to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TaskExecution - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TaskStatus. */ - interface ITaskStatus { - - /** TaskStatus state */ - state?: (google.cloud.batch.v1alpha.TaskStatus.State|keyof typeof google.cloud.batch.v1alpha.TaskStatus.State|null); - - /** TaskStatus statusEvents */ - statusEvents?: (google.cloud.batch.v1alpha.IStatusEvent[]|null); - - /** TaskStatus resourceUsage */ - resourceUsage?: (google.cloud.batch.v1alpha.ITaskResourceUsage|null); - } - - /** Represents a TaskStatus. */ - class TaskStatus implements ITaskStatus { - - /** - * Constructs a new TaskStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.ITaskStatus); - - /** TaskStatus state. */ - public state: (google.cloud.batch.v1alpha.TaskStatus.State|keyof typeof google.cloud.batch.v1alpha.TaskStatus.State); - - /** TaskStatus statusEvents. */ - public statusEvents: google.cloud.batch.v1alpha.IStatusEvent[]; - - /** TaskStatus resourceUsage. */ - public resourceUsage?: (google.cloud.batch.v1alpha.ITaskResourceUsage|null); - - /** - * Creates a new TaskStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns TaskStatus instance - */ - public static create(properties?: google.cloud.batch.v1alpha.ITaskStatus): google.cloud.batch.v1alpha.TaskStatus; - - /** - * Encodes the specified TaskStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskStatus.verify|verify} messages. - * @param message TaskStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.ITaskStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TaskStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskStatus.verify|verify} messages. - * @param message TaskStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.ITaskStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TaskStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TaskStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.TaskStatus; - - /** - * Decodes a TaskStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TaskStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.TaskStatus; - - /** - * Verifies a TaskStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TaskStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TaskStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.TaskStatus; - - /** - * Creates a plain object from a TaskStatus message. Also converts values to other types if specified. - * @param message TaskStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.TaskStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TaskStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TaskStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace TaskStatus { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - PENDING = 1, - ASSIGNED = 2, - RUNNING = 3, - FAILED = 4, - SUCCEEDED = 5, - UNEXECUTED = 6 - } - } - - /** Properties of a TaskResourceUsage. */ - interface ITaskResourceUsage { - - /** TaskResourceUsage coreHours */ - coreHours?: (number|null); - } - - /** Represents a TaskResourceUsage. */ - class TaskResourceUsage implements ITaskResourceUsage { - - /** - * Constructs a new TaskResourceUsage. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.ITaskResourceUsage); - - /** TaskResourceUsage coreHours. */ - public coreHours: number; - - /** - * Creates a new TaskResourceUsage instance using the specified properties. - * @param [properties] Properties to set - * @returns TaskResourceUsage instance - */ - public static create(properties?: google.cloud.batch.v1alpha.ITaskResourceUsage): google.cloud.batch.v1alpha.TaskResourceUsage; - - /** - * Encodes the specified TaskResourceUsage message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskResourceUsage.verify|verify} messages. - * @param message TaskResourceUsage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.ITaskResourceUsage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TaskResourceUsage message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskResourceUsage.verify|verify} messages. - * @param message TaskResourceUsage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.ITaskResourceUsage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TaskResourceUsage message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TaskResourceUsage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.TaskResourceUsage; - - /** - * Decodes a TaskResourceUsage message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TaskResourceUsage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.TaskResourceUsage; - - /** - * Verifies a TaskResourceUsage message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TaskResourceUsage message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TaskResourceUsage - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.TaskResourceUsage; - - /** - * Creates a plain object from a TaskResourceUsage message. Also converts values to other types if specified. - * @param message TaskResourceUsage - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.TaskResourceUsage, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TaskResourceUsage to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TaskResourceUsage - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Runnable. */ - interface IRunnable { - - /** Runnable container */ - container?: (google.cloud.batch.v1alpha.Runnable.IContainer|null); - - /** Runnable script */ - script?: (google.cloud.batch.v1alpha.Runnable.IScript|null); - - /** Runnable barrier */ - barrier?: (google.cloud.batch.v1alpha.Runnable.IBarrier|null); - - /** Runnable displayName */ - displayName?: (string|null); - - /** Runnable ignoreExitStatus */ - ignoreExitStatus?: (boolean|null); - - /** Runnable background */ - background?: (boolean|null); - - /** Runnable alwaysRun */ - alwaysRun?: (boolean|null); - - /** Runnable environment */ - environment?: (google.cloud.batch.v1alpha.IEnvironment|null); - - /** Runnable timeout */ - timeout?: (google.protobuf.IDuration|null); - - /** Runnable labels */ - labels?: ({ [k: string]: string }|null); - } - - /** Represents a Runnable. */ - class Runnable implements IRunnable { - - /** - * Constructs a new Runnable. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IRunnable); - - /** Runnable container. */ - public container?: (google.cloud.batch.v1alpha.Runnable.IContainer|null); - - /** Runnable script. */ - public script?: (google.cloud.batch.v1alpha.Runnable.IScript|null); - - /** Runnable barrier. */ - public barrier?: (google.cloud.batch.v1alpha.Runnable.IBarrier|null); - - /** Runnable displayName. */ - public displayName: string; - - /** Runnable ignoreExitStatus. */ - public ignoreExitStatus: boolean; - - /** Runnable background. */ - public background: boolean; - - /** Runnable alwaysRun. */ - public alwaysRun: boolean; - - /** Runnable environment. */ - public environment?: (google.cloud.batch.v1alpha.IEnvironment|null); - - /** Runnable timeout. */ - public timeout?: (google.protobuf.IDuration|null); - - /** Runnable labels. */ - public labels: { [k: string]: string }; - - /** Runnable executable. */ - public executable?: ("container"|"script"|"barrier"); - - /** - * Creates a new Runnable instance using the specified properties. - * @param [properties] Properties to set - * @returns Runnable instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IRunnable): google.cloud.batch.v1alpha.Runnable; - - /** - * Encodes the specified Runnable message. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.verify|verify} messages. - * @param message Runnable message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IRunnable, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Runnable message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.verify|verify} messages. - * @param message Runnable message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IRunnable, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Runnable message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Runnable - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Runnable; - - /** - * Decodes a Runnable message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Runnable - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Runnable; - - /** - * Verifies a Runnable message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Runnable message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Runnable - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Runnable; - - /** - * Creates a plain object from a Runnable message. Also converts values to other types if specified. - * @param message Runnable - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.Runnable, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Runnable to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Runnable - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Runnable { - - /** Properties of a Container. */ - interface IContainer { - - /** Container imageUri */ - imageUri?: (string|null); - - /** Container commands */ - commands?: (string[]|null); - - /** Container entrypoint */ - entrypoint?: (string|null); - - /** Container volumes */ - volumes?: (string[]|null); - - /** Container options */ - options?: (string|null); - - /** Container blockExternalNetwork */ - blockExternalNetwork?: (boolean|null); - - /** Container username */ - username?: (string|null); - - /** Container password */ - password?: (string|null); - - /** Container enableImageStreaming */ - enableImageStreaming?: (boolean|null); - } - - /** Represents a Container. */ - class Container implements IContainer { - - /** - * Constructs a new Container. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.Runnable.IContainer); - - /** Container imageUri. */ - public imageUri: string; - - /** Container commands. */ - public commands: string[]; - - /** Container entrypoint. */ - public entrypoint: string; - - /** Container volumes. */ - public volumes: string[]; - - /** Container options. */ - public options: string; - - /** Container blockExternalNetwork. */ - public blockExternalNetwork: boolean; - - /** Container username. */ - public username: string; - - /** Container password. */ - public password: string; - - /** Container enableImageStreaming. */ - public enableImageStreaming: boolean; - - /** - * Creates a new Container instance using the specified properties. - * @param [properties] Properties to set - * @returns Container instance - */ - public static create(properties?: google.cloud.batch.v1alpha.Runnable.IContainer): google.cloud.batch.v1alpha.Runnable.Container; - - /** - * Encodes the specified Container message. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Container.verify|verify} messages. - * @param message Container message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.Runnable.IContainer, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Container message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Container.verify|verify} messages. - * @param message Container message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.Runnable.IContainer, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Container message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Container - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Runnable.Container; - - /** - * Decodes a Container message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Container - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Runnable.Container; - - /** - * Verifies a Container message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Container message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Container - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Runnable.Container; - - /** - * Creates a plain object from a Container message. Also converts values to other types if specified. - * @param message Container - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.Runnable.Container, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Container to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Container - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Script. */ - interface IScript { - - /** Script path */ - path?: (string|null); - - /** Script text */ - text?: (string|null); - } - - /** Represents a Script. */ - class Script implements IScript { - - /** - * Constructs a new Script. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.Runnable.IScript); - - /** Script path. */ - public path?: (string|null); - - /** Script text. */ - public text?: (string|null); - - /** Script command. */ - public command?: ("path"|"text"); - - /** - * Creates a new Script instance using the specified properties. - * @param [properties] Properties to set - * @returns Script instance - */ - public static create(properties?: google.cloud.batch.v1alpha.Runnable.IScript): google.cloud.batch.v1alpha.Runnable.Script; - - /** - * Encodes the specified Script message. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Script.verify|verify} messages. - * @param message Script message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.Runnable.IScript, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Script message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Script.verify|verify} messages. - * @param message Script message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.Runnable.IScript, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Script message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Script - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Runnable.Script; - - /** - * Decodes a Script message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Script - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Runnable.Script; - - /** - * Verifies a Script message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Script message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Script - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Runnable.Script; - - /** - * Creates a plain object from a Script message. Also converts values to other types if specified. - * @param message Script - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.Runnable.Script, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Script to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Script - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Barrier. */ - interface IBarrier { - - /** Barrier name */ - name?: (string|null); - } - - /** Represents a Barrier. */ - class Barrier implements IBarrier { - - /** - * Constructs a new Barrier. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.Runnable.IBarrier); - - /** Barrier name. */ - public name: string; - - /** - * Creates a new Barrier instance using the specified properties. - * @param [properties] Properties to set - * @returns Barrier instance - */ - public static create(properties?: google.cloud.batch.v1alpha.Runnable.IBarrier): google.cloud.batch.v1alpha.Runnable.Barrier; - - /** - * Encodes the specified Barrier message. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Barrier.verify|verify} messages. - * @param message Barrier message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.Runnable.IBarrier, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Barrier message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Barrier.verify|verify} messages. - * @param message Barrier message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.Runnable.IBarrier, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Barrier message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Barrier - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Runnable.Barrier; - - /** - * Decodes a Barrier message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Barrier - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Runnable.Barrier; - - /** - * Verifies a Barrier message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Barrier message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Barrier - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Runnable.Barrier; - - /** - * Creates a plain object from a Barrier message. Also converts values to other types if specified. - * @param message Barrier - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.Runnable.Barrier, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Barrier to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Barrier - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a TaskSpec. */ - interface ITaskSpec { - - /** TaskSpec runnables */ - runnables?: (google.cloud.batch.v1alpha.IRunnable[]|null); - - /** TaskSpec computeResource */ - computeResource?: (google.cloud.batch.v1alpha.IComputeResource|null); - - /** TaskSpec maxRunDuration */ - maxRunDuration?: (google.protobuf.IDuration|null); - - /** TaskSpec maxRetryCount */ - maxRetryCount?: (number|null); - - /** TaskSpec lifecyclePolicies */ - lifecyclePolicies?: (google.cloud.batch.v1alpha.ILifecyclePolicy[]|null); - - /** TaskSpec environments */ - environments?: ({ [k: string]: string }|null); - - /** TaskSpec volumes */ - volumes?: (google.cloud.batch.v1alpha.IVolume[]|null); - - /** TaskSpec environment */ - environment?: (google.cloud.batch.v1alpha.IEnvironment|null); - } - - /** Represents a TaskSpec. */ - class TaskSpec implements ITaskSpec { - - /** - * Constructs a new TaskSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.ITaskSpec); - - /** TaskSpec runnables. */ - public runnables: google.cloud.batch.v1alpha.IRunnable[]; - - /** TaskSpec computeResource. */ - public computeResource?: (google.cloud.batch.v1alpha.IComputeResource|null); - - /** TaskSpec maxRunDuration. */ - public maxRunDuration?: (google.protobuf.IDuration|null); - - /** TaskSpec maxRetryCount. */ - public maxRetryCount: number; - - /** TaskSpec lifecyclePolicies. */ - public lifecyclePolicies: google.cloud.batch.v1alpha.ILifecyclePolicy[]; - - /** TaskSpec environments. */ - public environments: { [k: string]: string }; - - /** TaskSpec volumes. */ - public volumes: google.cloud.batch.v1alpha.IVolume[]; - - /** TaskSpec environment. */ - public environment?: (google.cloud.batch.v1alpha.IEnvironment|null); - - /** - * Creates a new TaskSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns TaskSpec instance - */ - public static create(properties?: google.cloud.batch.v1alpha.ITaskSpec): google.cloud.batch.v1alpha.TaskSpec; - - /** - * Encodes the specified TaskSpec message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskSpec.verify|verify} messages. - * @param message TaskSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.ITaskSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TaskSpec message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskSpec.verify|verify} messages. - * @param message TaskSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.ITaskSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TaskSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TaskSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.TaskSpec; - - /** - * Decodes a TaskSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TaskSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.TaskSpec; - - /** - * Verifies a TaskSpec message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TaskSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TaskSpec - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.TaskSpec; - - /** - * Creates a plain object from a TaskSpec message. Also converts values to other types if specified. - * @param message TaskSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.TaskSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TaskSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TaskSpec - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a LifecyclePolicy. */ - interface ILifecyclePolicy { - - /** LifecyclePolicy action */ - action?: (google.cloud.batch.v1alpha.LifecyclePolicy.Action|keyof typeof google.cloud.batch.v1alpha.LifecyclePolicy.Action|null); - - /** LifecyclePolicy actionCondition */ - actionCondition?: (google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition|null); - } - - /** Represents a LifecyclePolicy. */ - class LifecyclePolicy implements ILifecyclePolicy { - - /** - * Constructs a new LifecyclePolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.ILifecyclePolicy); - - /** LifecyclePolicy action. */ - public action: (google.cloud.batch.v1alpha.LifecyclePolicy.Action|keyof typeof google.cloud.batch.v1alpha.LifecyclePolicy.Action); - - /** LifecyclePolicy actionCondition. */ - public actionCondition?: (google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition|null); - - /** - * Creates a new LifecyclePolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns LifecyclePolicy instance - */ - public static create(properties?: google.cloud.batch.v1alpha.ILifecyclePolicy): google.cloud.batch.v1alpha.LifecyclePolicy; - - /** - * Encodes the specified LifecyclePolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.LifecyclePolicy.verify|verify} messages. - * @param message LifecyclePolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.ILifecyclePolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LifecyclePolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.LifecyclePolicy.verify|verify} messages. - * @param message LifecyclePolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.ILifecyclePolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LifecyclePolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LifecyclePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.LifecyclePolicy; - - /** - * Decodes a LifecyclePolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LifecyclePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.LifecyclePolicy; - - /** - * Verifies a LifecyclePolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LifecyclePolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LifecyclePolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.LifecyclePolicy; - - /** - * Creates a plain object from a LifecyclePolicy message. Also converts values to other types if specified. - * @param message LifecyclePolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.LifecyclePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LifecyclePolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LifecyclePolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace LifecyclePolicy { - - /** Properties of an ActionCondition. */ - interface IActionCondition { - - /** ActionCondition exitCodes */ - exitCodes?: (number[]|null); - } - - /** Represents an ActionCondition. */ - class ActionCondition implements IActionCondition { - - /** - * Constructs a new ActionCondition. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition); - - /** ActionCondition exitCodes. */ - public exitCodes: number[]; - - /** - * Creates a new ActionCondition instance using the specified properties. - * @param [properties] Properties to set - * @returns ActionCondition instance - */ - public static create(properties?: google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition): google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition; - - /** - * Encodes the specified ActionCondition message. Does not implicitly {@link google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.verify|verify} messages. - * @param message ActionCondition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ActionCondition message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.verify|verify} messages. - * @param message ActionCondition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ActionCondition message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ActionCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition; - - /** - * Decodes an ActionCondition message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ActionCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition; - - /** - * Verifies an ActionCondition message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ActionCondition message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ActionCondition - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition; - - /** - * Creates a plain object from an ActionCondition message. Also converts values to other types if specified. - * @param message ActionCondition - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ActionCondition to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ActionCondition - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Action enum. */ - enum Action { - ACTION_UNSPECIFIED = 0, - RETRY_TASK = 1, - FAIL_TASK = 2 - } - } - - /** Properties of a Task. */ - interface ITask { - - /** Task name */ - name?: (string|null); - - /** Task status */ - status?: (google.cloud.batch.v1alpha.ITaskStatus|null); - } - - /** Represents a Task. */ - class Task implements ITask { - - /** - * Constructs a new Task. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.ITask); - - /** Task name. */ - public name: string; - - /** Task status. */ - public status?: (google.cloud.batch.v1alpha.ITaskStatus|null); - - /** - * Creates a new Task instance using the specified properties. - * @param [properties] Properties to set - * @returns Task instance - */ - public static create(properties?: google.cloud.batch.v1alpha.ITask): google.cloud.batch.v1alpha.Task; - - /** - * Encodes the specified Task message. Does not implicitly {@link google.cloud.batch.v1alpha.Task.verify|verify} messages. - * @param message Task message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.ITask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Task message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Task.verify|verify} messages. - * @param message Task message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.ITask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Task message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Task - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Task; - - /** - * Decodes a Task message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Task - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Task; - - /** - * Verifies a Task message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Task message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Task - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Task; - - /** - * Creates a plain object from a Task message. Also converts values to other types if specified. - * @param message Task - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.Task, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Task to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Task - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Environment. */ - interface IEnvironment { - - /** Environment variables */ - variables?: ({ [k: string]: string }|null); - - /** Environment secretVariables */ - secretVariables?: ({ [k: string]: string }|null); - - /** Environment encryptedVariables */ - encryptedVariables?: (google.cloud.batch.v1alpha.Environment.IKMSEnvMap|null); - } - - /** Represents an Environment. */ - class Environment implements IEnvironment { - - /** - * Constructs a new Environment. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IEnvironment); - - /** Environment variables. */ - public variables: { [k: string]: string }; - - /** Environment secretVariables. */ - public secretVariables: { [k: string]: string }; - - /** Environment encryptedVariables. */ - public encryptedVariables?: (google.cloud.batch.v1alpha.Environment.IKMSEnvMap|null); - - /** - * Creates a new Environment instance using the specified properties. - * @param [properties] Properties to set - * @returns Environment instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IEnvironment): google.cloud.batch.v1alpha.Environment; - - /** - * Encodes the specified Environment message. Does not implicitly {@link google.cloud.batch.v1alpha.Environment.verify|verify} messages. - * @param message Environment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Environment.verify|verify} messages. - * @param message Environment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Environment message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Environment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Environment; - - /** - * Decodes an Environment message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Environment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Environment; - - /** - * Verifies an Environment message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Environment message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Environment - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Environment; - - /** - * Creates a plain object from an Environment message. Also converts values to other types if specified. - * @param message Environment - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.Environment, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Environment to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Environment - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Environment { - - /** Properties of a KMSEnvMap. */ - interface IKMSEnvMap { - - /** KMSEnvMap keyName */ - keyName?: (string|null); - - /** KMSEnvMap cipherText */ - cipherText?: (string|null); - } - - /** Represents a KMSEnvMap. */ - class KMSEnvMap implements IKMSEnvMap { - - /** - * Constructs a new KMSEnvMap. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.Environment.IKMSEnvMap); - - /** KMSEnvMap keyName. */ - public keyName: string; - - /** KMSEnvMap cipherText. */ - public cipherText: string; - - /** - * Creates a new KMSEnvMap instance using the specified properties. - * @param [properties] Properties to set - * @returns KMSEnvMap instance - */ - public static create(properties?: google.cloud.batch.v1alpha.Environment.IKMSEnvMap): google.cloud.batch.v1alpha.Environment.KMSEnvMap; - - /** - * Encodes the specified KMSEnvMap message. Does not implicitly {@link google.cloud.batch.v1alpha.Environment.KMSEnvMap.verify|verify} messages. - * @param message KMSEnvMap message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.Environment.IKMSEnvMap, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified KMSEnvMap message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Environment.KMSEnvMap.verify|verify} messages. - * @param message KMSEnvMap message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.Environment.IKMSEnvMap, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a KMSEnvMap message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns KMSEnvMap - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Environment.KMSEnvMap; - - /** - * Decodes a KMSEnvMap message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns KMSEnvMap - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Environment.KMSEnvMap; - - /** - * Verifies a KMSEnvMap message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a KMSEnvMap message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns KMSEnvMap - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Environment.KMSEnvMap; - - /** - * Creates a plain object from a KMSEnvMap message. Also converts values to other types if specified. - * @param message KMSEnvMap - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.Environment.KMSEnvMap, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this KMSEnvMap to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for KMSEnvMap - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a Volume. */ - interface IVolume { - - /** Volume nfs */ - nfs?: (google.cloud.batch.v1alpha.INFS|null); - - /** Volume pd */ - pd?: (google.cloud.batch.v1alpha.IPD|null); - - /** Volume gcs */ - gcs?: (google.cloud.batch.v1alpha.IGCS|null); - - /** Volume deviceName */ - deviceName?: (string|null); - - /** Volume mountPath */ - mountPath?: (string|null); - - /** Volume mountOptions */ - mountOptions?: (string[]|null); - } - - /** Represents a Volume. */ - class Volume implements IVolume { - - /** - * Constructs a new Volume. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IVolume); - - /** Volume nfs. */ - public nfs?: (google.cloud.batch.v1alpha.INFS|null); - - /** Volume pd. */ - public pd?: (google.cloud.batch.v1alpha.IPD|null); - - /** Volume gcs. */ - public gcs?: (google.cloud.batch.v1alpha.IGCS|null); - - /** Volume deviceName. */ - public deviceName?: (string|null); - - /** Volume mountPath. */ - public mountPath: string; - - /** Volume mountOptions. */ - public mountOptions: string[]; - - /** Volume source. */ - public source?: ("nfs"|"pd"|"gcs"|"deviceName"); - - /** - * Creates a new Volume instance using the specified properties. - * @param [properties] Properties to set - * @returns Volume instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IVolume): google.cloud.batch.v1alpha.Volume; - - /** - * Encodes the specified Volume message. Does not implicitly {@link google.cloud.batch.v1alpha.Volume.verify|verify} messages. - * @param message Volume message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IVolume, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Volume message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Volume.verify|verify} messages. - * @param message Volume message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IVolume, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Volume message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Volume - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Volume; - - /** - * Decodes a Volume message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Volume - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Volume; - - /** - * Verifies a Volume message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Volume message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Volume - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Volume; - - /** - * Creates a plain object from a Volume message. Also converts values to other types if specified. - * @param message Volume - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.Volume, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Volume to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Volume - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a NFS. */ - interface INFS { - - /** NFS server */ - server?: (string|null); - - /** NFS remotePath */ - remotePath?: (string|null); - } - - /** Represents a NFS. */ - class NFS implements INFS { - - /** - * Constructs a new NFS. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.INFS); - - /** NFS server. */ - public server: string; - - /** NFS remotePath. */ - public remotePath: string; - - /** - * Creates a new NFS instance using the specified properties. - * @param [properties] Properties to set - * @returns NFS instance - */ - public static create(properties?: google.cloud.batch.v1alpha.INFS): google.cloud.batch.v1alpha.NFS; - - /** - * Encodes the specified NFS message. Does not implicitly {@link google.cloud.batch.v1alpha.NFS.verify|verify} messages. - * @param message NFS message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.INFS, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NFS message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.NFS.verify|verify} messages. - * @param message NFS message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.INFS, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NFS message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NFS - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.NFS; - - /** - * Decodes a NFS message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NFS - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.NFS; - - /** - * Verifies a NFS message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NFS message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NFS - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.NFS; - - /** - * Creates a plain object from a NFS message. Also converts values to other types if specified. - * @param message NFS - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.NFS, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NFS to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NFS - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PD. */ - interface IPD { - - /** PD disk */ - disk?: (string|null); - - /** PD device */ - device?: (string|null); - - /** PD existing */ - existing?: (boolean|null); - } - - /** Represents a PD. */ - class PD implements IPD { - - /** - * Constructs a new PD. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IPD); - - /** PD disk. */ - public disk: string; - - /** PD device. */ - public device: string; - - /** PD existing. */ - public existing: boolean; - - /** - * Creates a new PD instance using the specified properties. - * @param [properties] Properties to set - * @returns PD instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IPD): google.cloud.batch.v1alpha.PD; - - /** - * Encodes the specified PD message. Does not implicitly {@link google.cloud.batch.v1alpha.PD.verify|verify} messages. - * @param message PD message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IPD, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PD message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.PD.verify|verify} messages. - * @param message PD message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IPD, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PD message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PD - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.PD; - - /** - * Decodes a PD message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PD - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.PD; - - /** - * Verifies a PD message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PD message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PD - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.PD; - - /** - * Creates a plain object from a PD message. Also converts values to other types if specified. - * @param message PD - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.PD, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PD to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PD - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GCS. */ - interface IGCS { - - /** GCS remotePath */ - remotePath?: (string|null); - } - - /** Represents a GCS. */ - class GCS implements IGCS { - - /** - * Constructs a new GCS. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IGCS); - - /** GCS remotePath. */ - public remotePath: string; - - /** - * Creates a new GCS instance using the specified properties. - * @param [properties] Properties to set - * @returns GCS instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IGCS): google.cloud.batch.v1alpha.GCS; - - /** - * Encodes the specified GCS message. Does not implicitly {@link google.cloud.batch.v1alpha.GCS.verify|verify} messages. - * @param message GCS message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IGCS, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GCS message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.GCS.verify|verify} messages. - * @param message GCS message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IGCS, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GCS message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GCS - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.GCS; - - /** - * Decodes a GCS message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GCS - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.GCS; - - /** - * Verifies a GCS message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GCS message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GCS - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.GCS; - - /** - * Creates a plain object from a GCS message. Also converts values to other types if specified. - * @param message GCS - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.GCS, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GCS to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GCS - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** CalendarPeriod enum. */ - enum CalendarPeriod { - CALENDAR_PERIOD_UNSPECIFIED = 0, - MONTH = 1, - QUARTER = 2, - YEAR = 3, - WEEK = 4, - DAY = 5 - } - - /** ResourceAllowanceState enum. */ - enum ResourceAllowanceState { - RESOURCE_ALLOWANCE_STATE_UNSPECIFIED = 0, - RESOURCE_ALLOWANCE_ACTIVE = 1, - RESOURCE_ALLOWANCE_DEPLETED = 2 - } - - /** Properties of a ResourceAllowance. */ - interface IResourceAllowance { - - /** ResourceAllowance usageResourceAllowance */ - usageResourceAllowance?: (google.cloud.batch.v1alpha.IUsageResourceAllowance|null); - - /** ResourceAllowance name */ - name?: (string|null); - - /** ResourceAllowance uid */ - uid?: (string|null); - - /** ResourceAllowance createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** ResourceAllowance labels */ - labels?: ({ [k: string]: string }|null); - - /** ResourceAllowance notifications */ - notifications?: (google.cloud.batch.v1alpha.INotification[]|null); - } - - /** Represents a ResourceAllowance. */ - class ResourceAllowance implements IResourceAllowance { - - /** - * Constructs a new ResourceAllowance. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IResourceAllowance); - - /** ResourceAllowance usageResourceAllowance. */ - public usageResourceAllowance?: (google.cloud.batch.v1alpha.IUsageResourceAllowance|null); - - /** ResourceAllowance name. */ - public name: string; - - /** ResourceAllowance uid. */ - public uid: string; - - /** ResourceAllowance createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** ResourceAllowance labels. */ - public labels: { [k: string]: string }; - - /** ResourceAllowance notifications. */ - public notifications: google.cloud.batch.v1alpha.INotification[]; - - /** ResourceAllowance resourceAllowance. */ - public resourceAllowance?: "usageResourceAllowance"; - - /** - * Creates a new ResourceAllowance instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceAllowance instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IResourceAllowance): google.cloud.batch.v1alpha.ResourceAllowance; - - /** - * Encodes the specified ResourceAllowance message. Does not implicitly {@link google.cloud.batch.v1alpha.ResourceAllowance.verify|verify} messages. - * @param message ResourceAllowance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IResourceAllowance, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceAllowance message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ResourceAllowance.verify|verify} messages. - * @param message ResourceAllowance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IResourceAllowance, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceAllowance message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceAllowance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.ResourceAllowance; - - /** - * Decodes a ResourceAllowance message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceAllowance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.ResourceAllowance; - - /** - * Verifies a ResourceAllowance message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceAllowance message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceAllowance - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.ResourceAllowance; - - /** - * Creates a plain object from a ResourceAllowance message. Also converts values to other types if specified. - * @param message ResourceAllowance - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.ResourceAllowance, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceAllowance to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceAllowance - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a UsageResourceAllowance. */ - interface IUsageResourceAllowance { - - /** UsageResourceAllowance spec */ - spec?: (google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec|null); - - /** UsageResourceAllowance status */ - status?: (google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus|null); - } - - /** Represents a UsageResourceAllowance. */ - class UsageResourceAllowance implements IUsageResourceAllowance { - - /** - * Constructs a new UsageResourceAllowance. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IUsageResourceAllowance); - - /** UsageResourceAllowance spec. */ - public spec?: (google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec|null); - - /** UsageResourceAllowance status. */ - public status?: (google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus|null); - - /** - * Creates a new UsageResourceAllowance instance using the specified properties. - * @param [properties] Properties to set - * @returns UsageResourceAllowance instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IUsageResourceAllowance): google.cloud.batch.v1alpha.UsageResourceAllowance; - - /** - * Encodes the specified UsageResourceAllowance message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowance.verify|verify} messages. - * @param message UsageResourceAllowance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IUsageResourceAllowance, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UsageResourceAllowance message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowance.verify|verify} messages. - * @param message UsageResourceAllowance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IUsageResourceAllowance, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a UsageResourceAllowance message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UsageResourceAllowance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.UsageResourceAllowance; - - /** - * Decodes a UsageResourceAllowance message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UsageResourceAllowance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.UsageResourceAllowance; - - /** - * Verifies a UsageResourceAllowance message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a UsageResourceAllowance message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UsageResourceAllowance - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.UsageResourceAllowance; - - /** - * Creates a plain object from a UsageResourceAllowance message. Also converts values to other types if specified. - * @param message UsageResourceAllowance - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.UsageResourceAllowance, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UsageResourceAllowance to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UsageResourceAllowance - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a UsageResourceAllowanceSpec. */ - interface IUsageResourceAllowanceSpec { - - /** UsageResourceAllowanceSpec type */ - type?: (string|null); - - /** UsageResourceAllowanceSpec limit */ - limit?: (google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit|null); - } - - /** Represents a UsageResourceAllowanceSpec. */ - class UsageResourceAllowanceSpec implements IUsageResourceAllowanceSpec { - - /** - * Constructs a new UsageResourceAllowanceSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec); - - /** UsageResourceAllowanceSpec type. */ - public type: string; - - /** UsageResourceAllowanceSpec limit. */ - public limit?: (google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit|null); - - /** - * Creates a new UsageResourceAllowanceSpec instance using the specified properties. - * @param [properties] Properties to set - * @returns UsageResourceAllowanceSpec instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec): google.cloud.batch.v1alpha.UsageResourceAllowanceSpec; - - /** - * Encodes the specified UsageResourceAllowanceSpec message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.verify|verify} messages. - * @param message UsageResourceAllowanceSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UsageResourceAllowanceSpec message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.verify|verify} messages. - * @param message UsageResourceAllowanceSpec message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a UsageResourceAllowanceSpec message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UsageResourceAllowanceSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.UsageResourceAllowanceSpec; - - /** - * Decodes a UsageResourceAllowanceSpec message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UsageResourceAllowanceSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.UsageResourceAllowanceSpec; - - /** - * Verifies a UsageResourceAllowanceSpec message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a UsageResourceAllowanceSpec message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UsageResourceAllowanceSpec - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.UsageResourceAllowanceSpec; - - /** - * Creates a plain object from a UsageResourceAllowanceSpec message. Also converts values to other types if specified. - * @param message UsageResourceAllowanceSpec - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.UsageResourceAllowanceSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UsageResourceAllowanceSpec to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UsageResourceAllowanceSpec - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace UsageResourceAllowanceSpec { - - /** Properties of a Limit. */ - interface ILimit { - - /** Limit calendarPeriod */ - calendarPeriod?: (google.cloud.batch.v1alpha.CalendarPeriod|keyof typeof google.cloud.batch.v1alpha.CalendarPeriod|null); - - /** Limit limit */ - limit?: (number|null); - } - - /** Represents a Limit. */ - class Limit implements ILimit { - - /** - * Constructs a new Limit. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit); - - /** Limit calendarPeriod. */ - public calendarPeriod?: (google.cloud.batch.v1alpha.CalendarPeriod|keyof typeof google.cloud.batch.v1alpha.CalendarPeriod|null); - - /** Limit limit. */ - public limit?: (number|null); - - /** Limit duration. */ - public duration?: "calendarPeriod"; - - /** Limit _limit. */ - public _limit?: "limit"; - - /** - * Creates a new Limit instance using the specified properties. - * @param [properties] Properties to set - * @returns Limit instance - */ - public static create(properties?: google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit): google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit; - - /** - * Encodes the specified Limit message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit.verify|verify} messages. - * @param message Limit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Limit message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit.verify|verify} messages. - * @param message Limit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Limit message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Limit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit; - - /** - * Decodes a Limit message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Limit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit; - - /** - * Verifies a Limit message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Limit message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Limit - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit; - - /** - * Creates a plain object from a Limit message. Also converts values to other types if specified. - * @param message Limit - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Limit to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Limit - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a UsageResourceAllowanceStatus. */ - interface IUsageResourceAllowanceStatus { - - /** UsageResourceAllowanceStatus state */ - state?: (google.cloud.batch.v1alpha.ResourceAllowanceState|keyof typeof google.cloud.batch.v1alpha.ResourceAllowanceState|null); - - /** UsageResourceAllowanceStatus limitStatus */ - limitStatus?: (google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus|null); - - /** UsageResourceAllowanceStatus report */ - report?: (google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport|null); - } - - /** Represents a UsageResourceAllowanceStatus. */ - class UsageResourceAllowanceStatus implements IUsageResourceAllowanceStatus { - - /** - * Constructs a new UsageResourceAllowanceStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus); - - /** UsageResourceAllowanceStatus state. */ - public state: (google.cloud.batch.v1alpha.ResourceAllowanceState|keyof typeof google.cloud.batch.v1alpha.ResourceAllowanceState); - - /** UsageResourceAllowanceStatus limitStatus. */ - public limitStatus?: (google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus|null); - - /** UsageResourceAllowanceStatus report. */ - public report?: (google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport|null); - - /** - * Creates a new UsageResourceAllowanceStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns UsageResourceAllowanceStatus instance - */ - public static create(properties?: google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus; - - /** - * Encodes the specified UsageResourceAllowanceStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.verify|verify} messages. - * @param message UsageResourceAllowanceStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UsageResourceAllowanceStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.verify|verify} messages. - * @param message UsageResourceAllowanceStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a UsageResourceAllowanceStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UsageResourceAllowanceStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus; - - /** - * Decodes a UsageResourceAllowanceStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UsageResourceAllowanceStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus; - - /** - * Verifies a UsageResourceAllowanceStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a UsageResourceAllowanceStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UsageResourceAllowanceStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus; - - /** - * Creates a plain object from a UsageResourceAllowanceStatus message. Also converts values to other types if specified. - * @param message UsageResourceAllowanceStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UsageResourceAllowanceStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UsageResourceAllowanceStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace UsageResourceAllowanceStatus { - - /** Properties of a LimitStatus. */ - interface ILimitStatus { - - /** LimitStatus consumptionInterval */ - consumptionInterval?: (google.type.IInterval|null); - - /** LimitStatus limit */ - limit?: (number|null); - - /** LimitStatus consumed */ - consumed?: (number|null); - } - - /** Represents a LimitStatus. */ - class LimitStatus implements ILimitStatus { - - /** - * Constructs a new LimitStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus); - - /** LimitStatus consumptionInterval. */ - public consumptionInterval?: (google.type.IInterval|null); - - /** LimitStatus limit. */ - public limit?: (number|null); - - /** LimitStatus consumed. */ - public consumed?: (number|null); - - /** LimitStatus _limit. */ - public _limit?: "limit"; - - /** LimitStatus _consumed. */ - public _consumed?: "consumed"; - - /** - * Creates a new LimitStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns LimitStatus instance - */ - public static create(properties?: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus; - - /** - * Encodes the specified LimitStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.verify|verify} messages. - * @param message LimitStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LimitStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.verify|verify} messages. - * @param message LimitStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LimitStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LimitStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus; - - /** - * Decodes a LimitStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LimitStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus; - - /** - * Verifies a LimitStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LimitStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LimitStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus; - - /** - * Creates a plain object from a LimitStatus message. Also converts values to other types if specified. - * @param message LimitStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LimitStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LimitStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PeriodConsumption. */ - interface IPeriodConsumption { - - /** PeriodConsumption consumptionInterval */ - consumptionInterval?: (google.type.IInterval|null); - - /** PeriodConsumption consumed */ - consumed?: (number|null); - } - - /** Represents a PeriodConsumption. */ - class PeriodConsumption implements IPeriodConsumption { - - /** - * Constructs a new PeriodConsumption. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption); - - /** PeriodConsumption consumptionInterval. */ - public consumptionInterval?: (google.type.IInterval|null); - - /** PeriodConsumption consumed. */ - public consumed?: (number|null); - - /** PeriodConsumption _consumed. */ - public _consumed?: "consumed"; - - /** - * Creates a new PeriodConsumption instance using the specified properties. - * @param [properties] Properties to set - * @returns PeriodConsumption instance - */ - public static create(properties?: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption; - - /** - * Encodes the specified PeriodConsumption message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.verify|verify} messages. - * @param message PeriodConsumption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PeriodConsumption message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.verify|verify} messages. - * @param message PeriodConsumption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PeriodConsumption message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PeriodConsumption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption; - - /** - * Decodes a PeriodConsumption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PeriodConsumption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption; - - /** - * Verifies a PeriodConsumption message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PeriodConsumption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PeriodConsumption - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption; - - /** - * Creates a plain object from a PeriodConsumption message. Also converts values to other types if specified. - * @param message PeriodConsumption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PeriodConsumption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PeriodConsumption - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ConsumptionReport. */ - interface IConsumptionReport { - - /** ConsumptionReport latestPeriodConsumptions */ - latestPeriodConsumptions?: ({ [k: string]: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption }|null); - } - - /** Represents a ConsumptionReport. */ - class ConsumptionReport implements IConsumptionReport { - - /** - * Constructs a new ConsumptionReport. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport); - - /** ConsumptionReport latestPeriodConsumptions. */ - public latestPeriodConsumptions: { [k: string]: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption }; - - /** - * Creates a new ConsumptionReport instance using the specified properties. - * @param [properties] Properties to set - * @returns ConsumptionReport instance - */ - public static create(properties?: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport; - - /** - * Encodes the specified ConsumptionReport message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.verify|verify} messages. - * @param message ConsumptionReport message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ConsumptionReport message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.verify|verify} messages. - * @param message ConsumptionReport message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConsumptionReport message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConsumptionReport - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport; - - /** - * Decodes a ConsumptionReport message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConsumptionReport - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport; - - /** - * Verifies a ConsumptionReport message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ConsumptionReport message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConsumptionReport - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport; - - /** - * Creates a plain object from a ConsumptionReport message. Also converts values to other types if specified. - * @param message ConsumptionReport - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ConsumptionReport to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ConsumptionReport - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a Notification. */ - interface INotification { - - /** Notification pubsubTopic */ - pubsubTopic?: (string|null); - } - - /** Represents a Notification. */ - class Notification implements INotification { - - /** - * Constructs a new Notification. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.batch.v1alpha.INotification); - - /** Notification pubsubTopic. */ - public pubsubTopic: string; - - /** - * Creates a new Notification instance using the specified properties. - * @param [properties] Properties to set - * @returns Notification instance - */ - public static create(properties?: google.cloud.batch.v1alpha.INotification): google.cloud.batch.v1alpha.Notification; - - /** - * Encodes the specified Notification message. Does not implicitly {@link google.cloud.batch.v1alpha.Notification.verify|verify} messages. - * @param message Notification message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.batch.v1alpha.INotification, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Notification message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Notification.verify|verify} messages. - * @param message Notification message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.batch.v1alpha.INotification, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Notification message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Notification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.Notification; - - /** - * Decodes a Notification message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Notification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.Notification; - - /** - * Verifies a Notification message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Notification message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Notification - */ - public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.Notification; - - /** - * Creates a plain object from a Notification message. Also converts values to other types if specified. - * @param message Notification - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.batch.v1alpha.Notification, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Notification to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Notification - * @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); - } - - /** Represents a CommonLanguageSettings. */ - class CommonLanguageSettings implements ICommonLanguageSettings { - - /** - * Constructs a new CommonLanguageSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICommonLanguageSettings); - - /** CommonLanguageSettings referenceDocsUri. */ - public referenceDocsUri: string; - - /** CommonLanguageSettings destinations. */ - public destinations: google.api.ClientLibraryDestination[]; - - /** - * Creates a new CommonLanguageSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns CommonLanguageSettings instance - */ - public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; - - /** - * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @param message CommonLanguageSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @param message CommonLanguageSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; - - /** - * Verifies a CommonLanguageSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CommonLanguageSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; - - /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. - * @param message CommonLanguageSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CommonLanguageSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CommonLanguageSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ClientLibrarySettings. */ - interface IClientLibrarySettings { - - /** ClientLibrarySettings version */ - version?: (string|null); - - /** ClientLibrarySettings launchStage */ - launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); - - /** ClientLibrarySettings restNumericEnums */ - restNumericEnums?: (boolean|null); - - /** ClientLibrarySettings javaSettings */ - javaSettings?: (google.api.IJavaSettings|null); - - /** ClientLibrarySettings cppSettings */ - cppSettings?: (google.api.ICppSettings|null); - - /** ClientLibrarySettings phpSettings */ - phpSettings?: (google.api.IPhpSettings|null); - - /** ClientLibrarySettings pythonSettings */ - pythonSettings?: (google.api.IPythonSettings|null); - - /** ClientLibrarySettings nodeSettings */ - nodeSettings?: (google.api.INodeSettings|null); - - /** ClientLibrarySettings dotnetSettings */ - dotnetSettings?: (google.api.IDotnetSettings|null); - - /** ClientLibrarySettings rubySettings */ - rubySettings?: (google.api.IRubySettings|null); - - /** ClientLibrarySettings goSettings */ - goSettings?: (google.api.IGoSettings|null); - } - - /** Represents a ClientLibrarySettings. */ - class ClientLibrarySettings implements IClientLibrarySettings { - - /** - * Constructs a new ClientLibrarySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IClientLibrarySettings); - - /** ClientLibrarySettings version. */ - public version: string; - - /** ClientLibrarySettings launchStage. */ - public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); - - /** ClientLibrarySettings restNumericEnums. */ - public restNumericEnums: boolean; - - /** ClientLibrarySettings javaSettings. */ - public javaSettings?: (google.api.IJavaSettings|null); - - /** ClientLibrarySettings cppSettings. */ - public cppSettings?: (google.api.ICppSettings|null); - - /** ClientLibrarySettings phpSettings. */ - public phpSettings?: (google.api.IPhpSettings|null); - - /** ClientLibrarySettings pythonSettings. */ - public pythonSettings?: (google.api.IPythonSettings|null); - - /** ClientLibrarySettings nodeSettings. */ - public nodeSettings?: (google.api.INodeSettings|null); - - /** ClientLibrarySettings dotnetSettings. */ - public dotnetSettings?: (google.api.IDotnetSettings|null); - - /** ClientLibrarySettings rubySettings. */ - public rubySettings?: (google.api.IRubySettings|null); - - /** ClientLibrarySettings goSettings. */ - public goSettings?: (google.api.IGoSettings|null); - - /** - * Creates a new ClientLibrarySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns ClientLibrarySettings instance - */ - public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; - - /** - * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @param message ClientLibrarySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @param message ClientLibrarySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; - - /** - * Verifies a ClientLibrarySettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClientLibrarySettings - */ - public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; - - /** - * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. - * @param message ClientLibrarySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClientLibrarySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ClientLibrarySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Publishing. */ - interface IPublishing { - - /** Publishing methodSettings */ - methodSettings?: (google.api.IMethodSettings[]|null); - - /** Publishing newIssueUri */ - newIssueUri?: (string|null); - - /** Publishing documentationUri */ - documentationUri?: (string|null); - - /** Publishing apiShortName */ - apiShortName?: (string|null); - - /** Publishing githubLabel */ - githubLabel?: (string|null); - - /** Publishing codeownerGithubTeams */ - codeownerGithubTeams?: (string[]|null); - - /** Publishing docTagPrefix */ - docTagPrefix?: (string|null); - - /** Publishing organization */ - organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); - - /** Publishing librarySettings */ - librarySettings?: (google.api.IClientLibrarySettings[]|null); - - /** Publishing protoReferenceDocumentationUri */ - protoReferenceDocumentationUri?: (string|null); - - /** Publishing restReferenceDocumentationUri */ - restReferenceDocumentationUri?: (string|null); - } - - /** Represents a Publishing. */ - class Publishing implements IPublishing { - - /** - * Constructs a new Publishing. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPublishing); - - /** Publishing methodSettings. */ - public methodSettings: google.api.IMethodSettings[]; - - /** Publishing newIssueUri. */ - public newIssueUri: string; - - /** Publishing documentationUri. */ - public documentationUri: string; - - /** Publishing apiShortName. */ - public apiShortName: string; - - /** Publishing githubLabel. */ - public githubLabel: string; - - /** Publishing codeownerGithubTeams. */ - public codeownerGithubTeams: string[]; - - /** Publishing docTagPrefix. */ - public docTagPrefix: string; - - /** Publishing organization. */ - public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); - - /** Publishing librarySettings. */ - public librarySettings: google.api.IClientLibrarySettings[]; - - /** Publishing protoReferenceDocumentationUri. */ - public protoReferenceDocumentationUri: string; - - /** Publishing restReferenceDocumentationUri. */ - public restReferenceDocumentationUri: string; - - /** - * Creates a new Publishing instance using the specified properties. - * @param [properties] Properties to set - * @returns Publishing instance - */ - public static create(properties?: google.api.IPublishing): google.api.Publishing; - - /** - * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @param message Publishing message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @param message Publishing message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Publishing message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; - - /** - * Decodes a Publishing message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; - - /** - * Verifies a Publishing message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Publishing message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Publishing - */ - public static fromObject(object: { [k: string]: any }): google.api.Publishing; - - /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @param message Publishing - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Publishing to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Publishing - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a JavaSettings. */ - interface IJavaSettings { - - /** JavaSettings libraryPackage */ - libraryPackage?: (string|null); - - /** JavaSettings serviceClassNames */ - serviceClassNames?: ({ [k: string]: string }|null); - - /** JavaSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a JavaSettings. */ - class JavaSettings implements IJavaSettings { - - /** - * Constructs a new JavaSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IJavaSettings); - - /** JavaSettings libraryPackage. */ - public libraryPackage: string; - - /** JavaSettings serviceClassNames. */ - public serviceClassNames: { [k: string]: string }; - - /** JavaSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new JavaSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns JavaSettings instance - */ - public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; - - /** - * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @param message JavaSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @param message JavaSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a JavaSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; - - /** - * Decodes a JavaSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; - - /** - * Verifies a JavaSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns JavaSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; - - /** - * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. - * @param message JavaSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this JavaSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for JavaSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CppSettings. */ - interface ICppSettings { - - /** CppSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a CppSettings. */ - class CppSettings implements ICppSettings { - - /** - * Constructs a new CppSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICppSettings); - - /** CppSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new CppSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns CppSettings instance - */ - public static create(properties?: google.api.ICppSettings): google.api.CppSettings; - - /** - * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @param message CppSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @param message CppSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CppSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; - - /** - * Decodes a CppSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; - - /** - * Verifies a CppSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CppSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.CppSettings; - - /** - * Creates a plain object from a CppSettings message. Also converts values to other types if specified. - * @param message CppSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CppSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CppSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PhpSettings. */ - interface IPhpSettings { - - /** PhpSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a PhpSettings. */ - class PhpSettings implements IPhpSettings { - - /** - * Constructs a new PhpSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPhpSettings); - - /** PhpSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new PhpSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns PhpSettings instance - */ - public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; - - /** - * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @param message PhpSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @param message PhpSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PhpSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; - - /** - * Decodes a PhpSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; - - /** - * Verifies a PhpSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PhpSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; - - /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @param message PhpSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PhpSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PhpSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PythonSettings. */ - interface IPythonSettings { - - /** PythonSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a PythonSettings. */ - class PythonSettings implements IPythonSettings { - - /** - * Constructs a new PythonSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPythonSettings); - - /** PythonSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new PythonSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns PythonSettings instance - */ - public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; - - /** - * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @param message PythonSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @param message PythonSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PythonSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; - - /** - * Decodes a PythonSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; - - /** - * Verifies a PythonSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PythonSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; - - /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. - * @param message PythonSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PythonSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PythonSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a NodeSettings. */ - interface INodeSettings { - - /** NodeSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a NodeSettings. */ - class NodeSettings implements INodeSettings { - - /** - * Constructs a new NodeSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.INodeSettings); - - /** NodeSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new NodeSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns NodeSettings instance - */ - public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; - - /** - * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @param message NodeSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @param message NodeSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NodeSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; - - /** - * Decodes a NodeSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; - - /** - * Verifies a NodeSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NodeSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; - - /** - * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. - * @param message NodeSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NodeSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NodeSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DotnetSettings. */ - interface IDotnetSettings { - - /** DotnetSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - - /** DotnetSettings renamedServices */ - renamedServices?: ({ [k: string]: string }|null); - - /** DotnetSettings renamedResources */ - renamedResources?: ({ [k: string]: string }|null); - - /** DotnetSettings ignoredResources */ - ignoredResources?: (string[]|null); - - /** DotnetSettings forcedNamespaceAliases */ - forcedNamespaceAliases?: (string[]|null); - - /** DotnetSettings handwrittenSignatures */ - handwrittenSignatures?: (string[]|null); - } - - /** Represents a DotnetSettings. */ - class DotnetSettings implements IDotnetSettings { - - /** - * Constructs a new DotnetSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IDotnetSettings); - - /** DotnetSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** DotnetSettings renamedServices. */ - public renamedServices: { [k: string]: string }; - - /** DotnetSettings renamedResources. */ - public renamedResources: { [k: string]: string }; - - /** DotnetSettings ignoredResources. */ - public ignoredResources: string[]; - - /** DotnetSettings forcedNamespaceAliases. */ - public forcedNamespaceAliases: string[]; - - /** DotnetSettings handwrittenSignatures. */ - public handwrittenSignatures: string[]; - - /** - * Creates a new DotnetSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns DotnetSettings instance - */ - public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; - - /** - * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @param message DotnetSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @param message DotnetSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; - - /** - * Verifies a DotnetSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DotnetSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; - - /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @param message DotnetSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DotnetSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DotnetSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RubySettings. */ - interface IRubySettings { - - /** RubySettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a RubySettings. */ - class RubySettings implements IRubySettings { - - /** - * Constructs a new RubySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IRubySettings); - - /** RubySettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new RubySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns RubySettings instance - */ - public static create(properties?: google.api.IRubySettings): google.api.RubySettings; - - /** - * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @param message RubySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @param message RubySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RubySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; - - /** - * Decodes a RubySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; - - /** - * Verifies a RubySettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RubySettings - */ - public static fromObject(object: { [k: string]: any }): google.api.RubySettings; - - /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @param message RubySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RubySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RubySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GoSettings. */ - interface IGoSettings { - - /** GoSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a GoSettings. */ - class GoSettings implements IGoSettings { - - /** - * Constructs a new GoSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IGoSettings); - - /** GoSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new GoSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns GoSettings instance - */ - public static create(properties?: google.api.IGoSettings): google.api.GoSettings; - - /** - * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @param message GoSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @param message GoSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GoSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; - - /** - * Decodes a GoSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; - - /** - * Verifies a GoSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GoSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.GoSettings; - - /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. - * @param message GoSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GoSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GoSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodSettings. */ - interface IMethodSettings { - - /** MethodSettings selector */ - selector?: (string|null); - - /** MethodSettings longRunning */ - longRunning?: (google.api.MethodSettings.ILongRunning|null); - - /** MethodSettings autoPopulatedFields */ - autoPopulatedFields?: (string[]|null); - } - - /** Represents a MethodSettings. */ - class MethodSettings implements IMethodSettings { - - /** - * Constructs a new MethodSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IMethodSettings); - - /** MethodSettings selector. */ - public selector: string; - - /** MethodSettings longRunning. */ - public longRunning?: (google.api.MethodSettings.ILongRunning|null); - - /** MethodSettings autoPopulatedFields. */ - public autoPopulatedFields: string[]; - - /** - * Creates a new MethodSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodSettings instance - */ - public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; - - /** - * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @param message MethodSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @param message MethodSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; - - /** - * Decodes a MethodSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; - - /** - * Verifies a MethodSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; - - /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @param message MethodSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MethodSettings { - - /** Properties of a LongRunning. */ - interface ILongRunning { - - /** LongRunning initialPollDelay */ - initialPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning pollDelayMultiplier */ - pollDelayMultiplier?: (number|null); - - /** LongRunning maxPollDelay */ - maxPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning totalPollTimeout */ - totalPollTimeout?: (google.protobuf.IDuration|null); - } - - /** Represents a LongRunning. */ - class LongRunning implements ILongRunning { - - /** - * Constructs a new LongRunning. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.MethodSettings.ILongRunning); - - /** LongRunning initialPollDelay. */ - public initialPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning pollDelayMultiplier. */ - public pollDelayMultiplier: number; - - /** LongRunning maxPollDelay. */ - public maxPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning totalPollTimeout. */ - public totalPollTimeout?: (google.protobuf.IDuration|null); - - /** - * Creates a new LongRunning instance using the specified properties. - * @param [properties] Properties to set - * @returns LongRunning instance - */ - public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; - - /** - * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @param message LongRunning message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @param message LongRunning message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LongRunning message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; - - /** - * Decodes a LongRunning message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; - - /** - * Verifies a LongRunning message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LongRunning - */ - public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; - - /** - * Creates a plain object from a LongRunning message. Also converts values to other types if specified. - * @param message LongRunning - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LongRunning to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LongRunning - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** ClientLibraryOrganization enum. */ - enum ClientLibraryOrganization { - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, - CLOUD = 1, - ADS = 2, - PHOTOS = 3, - STREET_VIEW = 4, - SHOPPING = 5, - GEO = 6, - GENERATIVE_AI = 7 - } - - /** ClientLibraryDestination enum. */ - enum ClientLibraryDestination { - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, - GITHUB = 10, - PACKAGE_MANAGER = 20 - } - - /** LaunchStage enum. */ - enum LaunchStage { - LAUNCH_STAGE_UNSPECIFIED = 0, - UNIMPLEMENTED = 6, - PRELAUNCH = 7, - EARLY_ACCESS = 1, - ALPHA = 2, - BETA = 3, - GA = 4, - DEPRECATED = 5 - } - - /** 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 FieldInfo. */ - interface IFieldInfo { - - /** FieldInfo format */ - format?: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format|null); - } - - /** Represents a FieldInfo. */ - class FieldInfo implements IFieldInfo { - - /** - * Constructs a new FieldInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IFieldInfo); - - /** FieldInfo format. */ - public format: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format); - - /** - * Creates a new FieldInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldInfo instance - */ - public static create(properties?: google.api.IFieldInfo): google.api.FieldInfo; - - /** - * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @param message FieldInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @param message FieldInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldInfo - * @throws {Error} If the payload is not 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.FieldInfo; - - /** - * Decodes a FieldInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldInfo - * @throws {Error} If the payload 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.FieldInfo; - - /** - * Verifies a FieldInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldInfo - */ - public static fromObject(object: { [k: string]: any }): google.api.FieldInfo; - - /** - * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. - * @param message FieldInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.FieldInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldInfo { - - /** Format enum. */ - enum Format { - FORMAT_UNSPECIFIED = 0, - UUID4 = 1, - IPV4 = 2, - IPV6 = 3, - IPV4_OR_IPV6 = 4 - } - } - - /** Properties of a ResourceDescriptor. */ - interface IResourceDescriptor { - - /** ResourceDescriptor type */ - type?: (string|null); - - /** ResourceDescriptor pattern */ - pattern?: (string[]|null); - - /** ResourceDescriptor nameField */ - nameField?: (string|null); - - /** ResourceDescriptor history */ - history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); - - /** ResourceDescriptor plural */ - plural?: (string|null); - - /** ResourceDescriptor singular */ - singular?: (string|null); - - /** ResourceDescriptor style */ - style?: (google.api.ResourceDescriptor.Style[]|null); - } - - /** Represents a ResourceDescriptor. */ - class ResourceDescriptor implements IResourceDescriptor { - - /** - * Constructs a new ResourceDescriptor. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceDescriptor); - - /** ResourceDescriptor type. */ - public type: string; - - /** ResourceDescriptor pattern. */ - public pattern: string[]; - - /** ResourceDescriptor nameField. */ - public nameField: string; - - /** ResourceDescriptor history. */ - public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); - - /** ResourceDescriptor plural. */ - public plural: string; - - /** ResourceDescriptor singular. */ - public singular: string; - - /** ResourceDescriptor style. */ - public style: google.api.ResourceDescriptor.Style[]; - - /** - * Creates a new ResourceDescriptor instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceDescriptor instance - */ - public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; - - /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; - - /** - * Verifies a ResourceDescriptor message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceDescriptor - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; - - /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @param message ResourceDescriptor - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceDescriptor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceDescriptor - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ResourceDescriptor { - - /** History enum. */ - enum History { - HISTORY_UNSPECIFIED = 0, - ORIGINALLY_SINGLE_PATTERN = 1, - FUTURE_MULTI_PATTERN = 2 - } - - /** Style enum. */ - enum Style { - STYLE_UNSPECIFIED = 0, - DECLARATIVE_FRIENDLY = 1 - } - } - - /** Properties of a ResourceReference. */ - interface IResourceReference { - - /** ResourceReference type */ - type?: (string|null); - - /** ResourceReference childType */ - childType?: (string|null); - } - - /** Represents a ResourceReference. */ - class ResourceReference implements IResourceReference { - - /** - * Constructs a new ResourceReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceReference); - - /** ResourceReference type. */ - public type: string; - - /** ResourceReference childType. */ - public childType: string; - - /** - * Creates a new ResourceReference instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceReference instance - */ - public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; - - /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceReference message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; - - /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; - - /** - * Verifies a ResourceReference message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceReference - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; - - /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @param message ResourceReference - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceReference - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace protobuf. */ - namespace protobuf { - - /** Properties of a FileDescriptorSet. */ - interface IFileDescriptorSet { - - /** FileDescriptorSet file */ - file?: (google.protobuf.IFileDescriptorProto[]|null); - } - - /** Represents a FileDescriptorSet. */ - class FileDescriptorSet implements IFileDescriptorSet { - - /** - * Constructs a new FileDescriptorSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorSet); - - /** FileDescriptorSet file. */ - public file: google.protobuf.IFileDescriptorProto[]; - - /** - * Creates a new FileDescriptorSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorSet instance - */ - public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; - - /** - * Verifies a FileDescriptorSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @param message FileDescriptorSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileDescriptorSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Edition enum. */ - enum Edition { - EDITION_UNKNOWN = 0, - EDITION_PROTO2 = 998, - EDITION_PROTO3 = 999, - EDITION_2023 = 1000, - EDITION_2024 = 1001, - EDITION_1_TEST_ONLY = 1, - EDITION_2_TEST_ONLY = 2, - EDITION_99997_TEST_ONLY = 99997, - EDITION_99998_TEST_ONLY = 99998, - EDITION_99999_TEST_ONLY = 99999, - EDITION_MAX = 2147483647 - } - - /** Properties of a FileDescriptorProto. */ - interface IFileDescriptorProto { - - /** FileDescriptorProto name */ - name?: (string|null); - - /** FileDescriptorProto package */ - "package"?: (string|null); - - /** FileDescriptorProto dependency */ - dependency?: (string[]|null); - - /** FileDescriptorProto publicDependency */ - publicDependency?: (number[]|null); - - /** FileDescriptorProto weakDependency */ - weakDependency?: (number[]|null); - - /** FileDescriptorProto messageType */ - messageType?: (google.protobuf.IDescriptorProto[]|null); - - /** FileDescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** FileDescriptorProto service */ - service?: (google.protobuf.IServiceDescriptorProto[]|null); - - /** FileDescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** FileDescriptorProto options */ - options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo */ - sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax */ - syntax?: (string|null); - - /** FileDescriptorProto edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FileDescriptorProto. */ - class FileDescriptorProto implements IFileDescriptorProto { - - /** - * Constructs a new FileDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorProto); - - /** FileDescriptorProto name. */ - public name: string; - - /** FileDescriptorProto package. */ - public package: string; - - /** FileDescriptorProto dependency. */ - public dependency: string[]; - - /** FileDescriptorProto publicDependency. */ - public publicDependency: number[]; - - /** FileDescriptorProto weakDependency. */ - public weakDependency: number[]; - - /** FileDescriptorProto messageType. */ - public messageType: google.protobuf.IDescriptorProto[]; - - /** FileDescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** FileDescriptorProto service. */ - public service: google.protobuf.IServiceDescriptorProto[]; - - /** FileDescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** FileDescriptorProto options. */ - public options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo. */ - public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax. */ - public syntax: string; - - /** FileDescriptorProto edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; - - /** - * Verifies a FileDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @param message FileDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DescriptorProto. */ - interface IDescriptorProto { - - /** DescriptorProto name */ - name?: (string|null); - - /** DescriptorProto field */ - field?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto nestedType */ - nestedType?: (google.protobuf.IDescriptorProto[]|null); - - /** DescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** DescriptorProto extensionRange */ - extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); - - /** DescriptorProto oneofDecl */ - oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); - - /** DescriptorProto options */ - options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange */ - reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); - - /** DescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents a DescriptorProto. */ - class DescriptorProto implements IDescriptorProto { - - /** - * Constructs a new DescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDescriptorProto); - - /** DescriptorProto name. */ - public name: string; - - /** DescriptorProto field. */ - public field: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto nestedType. */ - public nestedType: google.protobuf.IDescriptorProto[]; - - /** DescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** DescriptorProto extensionRange. */ - public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; - - /** DescriptorProto oneofDecl. */ - public oneofDecl: google.protobuf.IOneofDescriptorProto[]; - - /** DescriptorProto options. */ - public options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange. */ - public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; - - /** DescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns DescriptorProto instance - */ - public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; - - /** - * Verifies a DescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @param message DescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DescriptorProto { - - /** Properties of an ExtensionRange. */ - interface IExtensionRange { - - /** ExtensionRange start */ - start?: (number|null); - - /** ExtensionRange end */ - end?: (number|null); - - /** ExtensionRange options */ - options?: (google.protobuf.IExtensionRangeOptions|null); - } - - /** Represents an ExtensionRange. */ - class ExtensionRange implements IExtensionRange { - - /** - * Constructs a new ExtensionRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); - - /** ExtensionRange start. */ - public start: number; - - /** ExtensionRange end. */ - public end: number; - - /** ExtensionRange options. */ - public options?: (google.protobuf.IExtensionRangeOptions|null); - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Verifies an ExtensionRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @param message ExtensionRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtensionRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ReservedRange. */ - interface IReservedRange { - - /** ReservedRange start */ - start?: (number|null); - - /** ReservedRange end */ - end?: (number|null); - } - - /** Represents a ReservedRange. */ - class ReservedRange implements IReservedRange { - - /** - * Constructs a new ReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); - - /** ReservedRange start. */ - public start: number; - - /** ReservedRange end. */ - public end: number; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ReservedRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Verifies a ReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @param message ReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ExtensionRangeOptions. */ - interface IExtensionRangeOptions { - - /** ExtensionRangeOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ExtensionRangeOptions declaration */ - declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); - - /** ExtensionRangeOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification */ - verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); - } - - /** Represents an ExtensionRangeOptions. */ - class ExtensionRangeOptions implements IExtensionRangeOptions { - - /** - * Constructs a new ExtensionRangeOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IExtensionRangeOptions); - - /** ExtensionRangeOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** ExtensionRangeOptions declaration. */ - public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; - - /** ExtensionRangeOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification. */ - public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRangeOptions instance - */ - public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; - - /** - * Verifies an ExtensionRangeOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRangeOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @param message ExtensionRangeOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ExtensionRangeOptions { - - /** Properties of a Declaration. */ - interface IDeclaration { - - /** Declaration number */ - number?: (number|null); - - /** Declaration fullName */ - fullName?: (string|null); - - /** Declaration type */ - type?: (string|null); - - /** Declaration reserved */ - reserved?: (boolean|null); - - /** Declaration repeated */ - repeated?: (boolean|null); - } - - /** Represents a Declaration. */ - class Declaration implements IDeclaration { - - /** - * Constructs a new Declaration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); - - /** Declaration number. */ - public number: number; - - /** Declaration fullName. */ - public fullName: string; - - /** Declaration type. */ - public type: string; - - /** Declaration reserved. */ - public reserved: boolean; - - /** Declaration repeated. */ - public repeated: boolean; - - /** - * Creates a new Declaration instance using the specified properties. - * @param [properties] Properties to set - * @returns Declaration instance - */ - public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Verifies a Declaration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Declaration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Declaration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @param message Declaration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Declaration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Declaration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** VerificationState enum. */ - enum VerificationState { - DECLARATION = 0, - UNVERIFIED = 1 - } - } - - /** Properties of a FieldDescriptorProto. */ - interface IFieldDescriptorProto { - - /** FieldDescriptorProto name */ - name?: (string|null); - - /** FieldDescriptorProto number */ - number?: (number|null); - - /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); - - /** FieldDescriptorProto type */ - type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); - - /** FieldDescriptorProto typeName */ - typeName?: (string|null); - - /** FieldDescriptorProto extendee */ - extendee?: (string|null); - - /** FieldDescriptorProto defaultValue */ - defaultValue?: (string|null); - - /** FieldDescriptorProto oneofIndex */ - oneofIndex?: (number|null); - - /** FieldDescriptorProto jsonName */ - jsonName?: (string|null); - - /** FieldDescriptorProto options */ - options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional */ - proto3Optional?: (boolean|null); - } - - /** Represents a FieldDescriptorProto. */ - class FieldDescriptorProto implements IFieldDescriptorProto { - - /** - * Constructs a new FieldDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldDescriptorProto); - - /** FieldDescriptorProto name. */ - public name: string; - - /** FieldDescriptorProto number. */ - public number: number; - - /** FieldDescriptorProto label. */ - public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); - - /** FieldDescriptorProto type. */ - public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); - - /** FieldDescriptorProto typeName. */ - public typeName: string; - - /** FieldDescriptorProto extendee. */ - public extendee: string; - - /** FieldDescriptorProto defaultValue. */ - public defaultValue: string; - - /** FieldDescriptorProto oneofIndex. */ - public oneofIndex: number; - - /** FieldDescriptorProto jsonName. */ - public jsonName: string; - - /** FieldDescriptorProto options. */ - public options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional. */ - public proto3Optional: boolean; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; - - /** - * Verifies a FieldDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @param message FieldDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldDescriptorProto { - - /** Type enum. */ - enum Type { - TYPE_DOUBLE = 1, - TYPE_FLOAT = 2, - TYPE_INT64 = 3, - TYPE_UINT64 = 4, - TYPE_INT32 = 5, - TYPE_FIXED64 = 6, - TYPE_FIXED32 = 7, - TYPE_BOOL = 8, - TYPE_STRING = 9, - TYPE_GROUP = 10, - TYPE_MESSAGE = 11, - TYPE_BYTES = 12, - TYPE_UINT32 = 13, - TYPE_ENUM = 14, - TYPE_SFIXED32 = 15, - TYPE_SFIXED64 = 16, - TYPE_SINT32 = 17, - TYPE_SINT64 = 18 - } - - /** Label enum. */ - enum Label { - LABEL_OPTIONAL = 1, - LABEL_REPEATED = 3, - LABEL_REQUIRED = 2 - } - } - - /** Properties of an OneofDescriptorProto. */ - interface IOneofDescriptorProto { - - /** OneofDescriptorProto name */ - name?: (string|null); - - /** OneofDescriptorProto options */ - options?: (google.protobuf.IOneofOptions|null); - } - - /** Represents an OneofDescriptorProto. */ - class OneofDescriptorProto implements IOneofDescriptorProto { - - /** - * Constructs a new OneofDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofDescriptorProto); - - /** OneofDescriptorProto name. */ - public name: string; - - /** OneofDescriptorProto options. */ - public options?: (google.protobuf.IOneofOptions|null); - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofDescriptorProto instance - */ - public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; - - /** - * Verifies an OneofDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @param message OneofDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OneofDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumDescriptorProto. */ - interface IEnumDescriptorProto { - - /** EnumDescriptorProto name */ - name?: (string|null); - - /** EnumDescriptorProto value */ - value?: (google.protobuf.IEnumValueDescriptorProto[]|null); - - /** EnumDescriptorProto options */ - options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange */ - reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); - - /** EnumDescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents an EnumDescriptorProto. */ - class EnumDescriptorProto implements IEnumDescriptorProto { - - /** - * Constructs a new EnumDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumDescriptorProto); - - /** EnumDescriptorProto name. */ - public name: string; - - /** EnumDescriptorProto value. */ - public value: google.protobuf.IEnumValueDescriptorProto[]; - - /** EnumDescriptorProto options. */ - public options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange. */ - public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; - - /** EnumDescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; - - /** - * Verifies an EnumDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @param message EnumDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EnumDescriptorProto { - - /** Properties of an EnumReservedRange. */ - interface IEnumReservedRange { - - /** EnumReservedRange start */ - start?: (number|null); - - /** EnumReservedRange end */ - end?: (number|null); - } - - /** Represents an EnumReservedRange. */ - class EnumReservedRange implements IEnumReservedRange { - - /** - * Constructs a new EnumReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); - - /** EnumReservedRange start. */ - public start: number; - - /** EnumReservedRange end. */ - public end: number; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumReservedRange instance - */ - public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Verifies an EnumReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @param message EnumReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an EnumValueDescriptorProto. */ - interface IEnumValueDescriptorProto { - - /** EnumValueDescriptorProto name */ - name?: (string|null); - - /** EnumValueDescriptorProto number */ - number?: (number|null); - - /** EnumValueDescriptorProto options */ - options?: (google.protobuf.IEnumValueOptions|null); - } - - /** Represents an EnumValueDescriptorProto. */ - class EnumValueDescriptorProto implements IEnumValueDescriptorProto { - - /** - * Constructs a new EnumValueDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueDescriptorProto); - - /** EnumValueDescriptorProto name. */ - public name: string; - - /** EnumValueDescriptorProto number. */ - public number: number; - - /** EnumValueDescriptorProto options. */ - public options?: (google.protobuf.IEnumValueOptions|null); - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; - - /** - * Verifies an EnumValueDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @param message EnumValueDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceDescriptorProto. */ - interface IServiceDescriptorProto { - - /** ServiceDescriptorProto name */ - name?: (string|null); - - /** ServiceDescriptorProto method */ - method?: (google.protobuf.IMethodDescriptorProto[]|null); - - /** ServiceDescriptorProto options */ - options?: (google.protobuf.IServiceOptions|null); - } - - /** Represents a ServiceDescriptorProto. */ - class ServiceDescriptorProto implements IServiceDescriptorProto { - - /** - * Constructs a new ServiceDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceDescriptorProto); - - /** ServiceDescriptorProto name. */ - public name: string; - - /** ServiceDescriptorProto method. */ - public method: google.protobuf.IMethodDescriptorProto[]; - - /** ServiceDescriptorProto options. */ - public options?: (google.protobuf.IServiceOptions|null); - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceDescriptorProto instance - */ - public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; - - /** - * Verifies a ServiceDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @param message ServiceDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodDescriptorProto. */ - interface IMethodDescriptorProto { - - /** MethodDescriptorProto name */ - name?: (string|null); - - /** MethodDescriptorProto inputType */ - inputType?: (string|null); - - /** MethodDescriptorProto outputType */ - outputType?: (string|null); - - /** MethodDescriptorProto options */ - options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming */ - clientStreaming?: (boolean|null); - - /** MethodDescriptorProto serverStreaming */ - serverStreaming?: (boolean|null); - } - - /** Represents a MethodDescriptorProto. */ - class MethodDescriptorProto implements IMethodDescriptorProto { - - /** - * Constructs a new MethodDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodDescriptorProto); - - /** MethodDescriptorProto name. */ - public name: string; - - /** MethodDescriptorProto inputType. */ - public inputType: string; - - /** MethodDescriptorProto outputType. */ - public outputType: string; - - /** MethodDescriptorProto options. */ - public options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming. */ - public clientStreaming: boolean; - - /** MethodDescriptorProto serverStreaming. */ - public serverStreaming: boolean; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodDescriptorProto instance - */ - public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; - - /** - * Verifies a MethodDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @param message MethodDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FileOptions. */ - interface IFileOptions { - - /** FileOptions javaPackage */ - javaPackage?: (string|null); - - /** FileOptions javaOuterClassname */ - javaOuterClassname?: (string|null); - - /** FileOptions javaMultipleFiles */ - javaMultipleFiles?: (boolean|null); - - /** FileOptions javaGenerateEqualsAndHash */ - javaGenerateEqualsAndHash?: (boolean|null); - - /** FileOptions javaStringCheckUtf8 */ - javaStringCheckUtf8?: (boolean|null); - - /** FileOptions optimizeFor */ - optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); - - /** FileOptions goPackage */ - goPackage?: (string|null); - - /** FileOptions ccGenericServices */ - ccGenericServices?: (boolean|null); - - /** FileOptions javaGenericServices */ - javaGenericServices?: (boolean|null); - - /** FileOptions pyGenericServices */ - pyGenericServices?: (boolean|null); - - /** FileOptions deprecated */ - deprecated?: (boolean|null); - - /** FileOptions ccEnableArenas */ - ccEnableArenas?: (boolean|null); - - /** FileOptions objcClassPrefix */ - objcClassPrefix?: (string|null); - - /** FileOptions csharpNamespace */ - csharpNamespace?: (string|null); - - /** FileOptions swiftPrefix */ - swiftPrefix?: (string|null); - - /** FileOptions phpClassPrefix */ - phpClassPrefix?: (string|null); - - /** FileOptions phpNamespace */ - phpNamespace?: (string|null); - - /** FileOptions phpMetadataNamespace */ - phpMetadataNamespace?: (string|null); - - /** FileOptions rubyPackage */ - rubyPackage?: (string|null); - - /** FileOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** FileOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FileOptions .google.api.resourceDefinition */ - ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); - } - - /** Represents a FileOptions. */ - class FileOptions implements IFileOptions { - - /** - * Constructs a new FileOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileOptions); - - /** FileOptions javaPackage. */ - public javaPackage: string; - - /** FileOptions javaOuterClassname. */ - public javaOuterClassname: string; - - /** FileOptions javaMultipleFiles. */ - public javaMultipleFiles: boolean; - - /** FileOptions javaGenerateEqualsAndHash. */ - public javaGenerateEqualsAndHash: boolean; - - /** FileOptions javaStringCheckUtf8. */ - public javaStringCheckUtf8: boolean; - - /** FileOptions optimizeFor. */ - public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); - - /** FileOptions goPackage. */ - public goPackage: string; - - /** FileOptions ccGenericServices. */ - public ccGenericServices: boolean; - - /** FileOptions javaGenericServices. */ - public javaGenericServices: boolean; - - /** FileOptions pyGenericServices. */ - public pyGenericServices: boolean; - - /** FileOptions deprecated. */ - public deprecated: boolean; - - /** FileOptions ccEnableArenas. */ - public ccEnableArenas: boolean; - - /** FileOptions objcClassPrefix. */ - public objcClassPrefix: string; - - /** FileOptions csharpNamespace. */ - public csharpNamespace: string; - - /** FileOptions swiftPrefix. */ - public swiftPrefix: string; - - /** FileOptions phpClassPrefix. */ - public phpClassPrefix: string; - - /** FileOptions phpNamespace. */ - public phpNamespace: string; - - /** FileOptions phpMetadataNamespace. */ - public phpMetadataNamespace: string; - - /** FileOptions rubyPackage. */ - public rubyPackage: string; - - /** FileOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** FileOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FileOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FileOptions instance - */ - public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; - - /** - * Verifies a FileOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @param message FileOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FileOptions { - - /** OptimizeMode enum. */ - enum OptimizeMode { - SPEED = 1, - CODE_SIZE = 2, - LITE_RUNTIME = 3 - } - } - - /** Properties of a MessageOptions. */ - interface IMessageOptions { - - /** MessageOptions messageSetWireFormat */ - messageSetWireFormat?: (boolean|null); - - /** MessageOptions noStandardDescriptorAccessor */ - noStandardDescriptorAccessor?: (boolean|null); - - /** MessageOptions deprecated */ - deprecated?: (boolean|null); - - /** MessageOptions mapEntry */ - mapEntry?: (boolean|null); - - /** MessageOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** MessageOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** MessageOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MessageOptions .google.api.resource */ - ".google.api.resource"?: (google.api.IResourceDescriptor|null); - } - - /** Represents a MessageOptions. */ - class MessageOptions implements IMessageOptions { - - /** - * Constructs a new MessageOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMessageOptions); - - /** MessageOptions messageSetWireFormat. */ - public messageSetWireFormat: boolean; - - /** MessageOptions noStandardDescriptorAccessor. */ - public noStandardDescriptorAccessor: boolean; - - /** MessageOptions deprecated. */ - public deprecated: boolean; - - /** MessageOptions mapEntry. */ - public mapEntry: boolean; - - /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; - - /** MessageOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** MessageOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MessageOptions instance - */ - public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; - - /** - * Verifies a MessageOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MessageOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @param message MessageOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MessageOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MessageOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FieldOptions. */ - interface IFieldOptions { - - /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); - - /** FieldOptions packed */ - packed?: (boolean|null); - - /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); - - /** FieldOptions lazy */ - lazy?: (boolean|null); - - /** FieldOptions unverifiedLazy */ - unverifiedLazy?: (boolean|null); - - /** FieldOptions deprecated */ - deprecated?: (boolean|null); - - /** FieldOptions weak */ - weak?: (boolean|null); - - /** FieldOptions debugRedact */ - debugRedact?: (boolean|null); - - /** FieldOptions retention */ - retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); - - /** FieldOptions targets */ - targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); - - /** FieldOptions editionDefaults */ - editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); - - /** FieldOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** FieldOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FieldOptions .google.api.fieldBehavior */ - ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); - - /** FieldOptions .google.api.fieldInfo */ - ".google.api.fieldInfo"?: (google.api.IFieldInfo|null); - - /** FieldOptions .google.api.resourceReference */ - ".google.api.resourceReference"?: (google.api.IResourceReference|null); - } - - /** Represents a FieldOptions. */ - class FieldOptions implements IFieldOptions { - - /** - * Constructs a new FieldOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldOptions); - - /** FieldOptions ctype. */ - public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); - - /** FieldOptions packed. */ - public packed: boolean; - - /** FieldOptions jstype. */ - public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); - - /** FieldOptions lazy. */ - public lazy: boolean; - - /** FieldOptions unverifiedLazy. */ - public unverifiedLazy: boolean; - - /** FieldOptions deprecated. */ - public deprecated: boolean; - - /** FieldOptions weak. */ - public weak: boolean; - - /** FieldOptions debugRedact. */ - public debugRedact: boolean; - - /** FieldOptions retention. */ - public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); - - /** FieldOptions targets. */ - public targets: google.protobuf.FieldOptions.OptionTargetType[]; - - /** FieldOptions editionDefaults. */ - public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; - - /** FieldOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** FieldOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldOptions instance - */ - public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; - - /** - * Verifies a FieldOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @param message FieldOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldOptions { - - /** CType enum. */ - enum CType { - STRING = 0, - CORD = 1, - STRING_PIECE = 2 - } - - /** JSType enum. */ - enum JSType { - JS_NORMAL = 0, - JS_STRING = 1, - JS_NUMBER = 2 - } - - /** OptionRetention enum. */ - enum OptionRetention { - RETENTION_UNKNOWN = 0, - RETENTION_RUNTIME = 1, - RETENTION_SOURCE = 2 - } - - /** OptionTargetType enum. */ - enum OptionTargetType { - TARGET_TYPE_UNKNOWN = 0, - TARGET_TYPE_FILE = 1, - TARGET_TYPE_EXTENSION_RANGE = 2, - TARGET_TYPE_MESSAGE = 3, - TARGET_TYPE_FIELD = 4, - TARGET_TYPE_ONEOF = 5, - TARGET_TYPE_ENUM = 6, - TARGET_TYPE_ENUM_ENTRY = 7, - TARGET_TYPE_SERVICE = 8, - TARGET_TYPE_METHOD = 9 - } - - /** Properties of an EditionDefault. */ - interface IEditionDefault { - - /** EditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** EditionDefault value */ - value?: (string|null); - } - - /** Represents an EditionDefault. */ - class EditionDefault implements IEditionDefault { - - /** - * Constructs a new EditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); - - /** EditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** EditionDefault value. */ - public value: string; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns EditionDefault instance - */ - public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; - - /** - * Verifies an EditionDefault message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @param message EditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an OneofOptions. */ - interface IOneofOptions { - - /** OneofOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** OneofOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an OneofOptions. */ - class OneofOptions implements IOneofOptions { - - /** - * Constructs a new OneofOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofOptions); - - /** OneofOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** OneofOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofOptions instance - */ - public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; - - /** - * Verifies an OneofOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @param message OneofOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OneofOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumOptions. */ - interface IEnumOptions { - - /** EnumOptions allowAlias */ - allowAlias?: (boolean|null); - - /** EnumOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** EnumOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** EnumOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumOptions. */ - class EnumOptions implements IEnumOptions { - - /** - * Constructs a new EnumOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumOptions); - - /** EnumOptions allowAlias. */ - public allowAlias: boolean; - - /** EnumOptions deprecated. */ - public deprecated: boolean; - - /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; - - /** EnumOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** EnumOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumOptions instance - */ - public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; - - /** - * Verifies an EnumOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @param message EnumOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumValueOptions. */ - interface IEnumValueOptions { - - /** EnumValueOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumValueOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact */ - debugRedact?: (boolean|null); - - /** EnumValueOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumValueOptions. */ - class EnumValueOptions implements IEnumValueOptions { - - /** - * Constructs a new EnumValueOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueOptions); - - /** EnumValueOptions deprecated. */ - public deprecated: boolean; - - /** EnumValueOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact. */ - public debugRedact: boolean; - - /** EnumValueOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueOptions instance - */ - public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; - - /** - * Verifies an EnumValueOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @param message EnumValueOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceOptions. */ - interface IServiceOptions { - - /** ServiceOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** ServiceOptions deprecated */ - deprecated?: (boolean|null); - - /** ServiceOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ServiceOptions .google.api.defaultHost */ - ".google.api.defaultHost"?: (string|null); - - /** ServiceOptions .google.api.oauthScopes */ - ".google.api.oauthScopes"?: (string|null); - - /** ServiceOptions .google.api.apiVersion */ - ".google.api.apiVersion"?: (string|null); - } - - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { - - /** - * Constructs a new ServiceOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceOptions); - - /** ServiceOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** ServiceOptions deprecated. */ - public deprecated: boolean; - - /** ServiceOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceOptions instance - */ - public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; - - /** - * Verifies a ServiceOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @param message ServiceOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodOptions. */ - interface IMethodOptions { - - /** MethodOptions deprecated */ - deprecated?: (boolean|null); - - /** MethodOptions idempotencyLevel */ - idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); - - /** MethodOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** MethodOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MethodOptions .google.api.http */ - ".google.api.http"?: (google.api.IHttpRule|null); - - /** MethodOptions .google.api.methodSignature */ - ".google.api.methodSignature"?: (string[]|null); - - /** MethodOptions .google.longrunning.operationInfo */ - ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); - } - - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { - - /** - * Constructs a new MethodOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodOptions); - - /** MethodOptions deprecated. */ - public deprecated: boolean; - - /** MethodOptions idempotencyLevel. */ - public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); - - /** MethodOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** MethodOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MethodOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodOptions instance - */ - public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; - - /** - * Verifies a MethodOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @param message MethodOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MethodOptions { - - /** IdempotencyLevel enum. */ - enum IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0, - NO_SIDE_EFFECTS = 1, - IDEMPOTENT = 2 - } - } - - /** Properties of an UninterpretedOption. */ - interface IUninterpretedOption { - - /** UninterpretedOption name */ - name?: (google.protobuf.UninterpretedOption.INamePart[]|null); - - /** UninterpretedOption identifierValue */ - identifierValue?: (string|null); - - /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|Long|string|null); - - /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|Long|string|null); - - /** UninterpretedOption doubleValue */ - doubleValue?: (number|null); - - /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|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|string); - - /** UninterpretedOption aggregateValue. */ - public aggregateValue: string; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @param [properties] Properties to set - * @returns UninterpretedOption instance - */ - public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; - - /** - * Verifies an UninterpretedOption message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UninterpretedOption - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @param message UninterpretedOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UninterpretedOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UninterpretedOption - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace UninterpretedOption { - - /** Properties of a NamePart. */ - interface INamePart { - - /** NamePart namePart */ - namePart: string; - - /** NamePart isExtension */ - isExtension: boolean; - } - - /** Represents a NamePart. */ - class NamePart implements INamePart { - - /** - * Constructs a new NamePart. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.UninterpretedOption.INamePart); - - /** NamePart namePart. */ - public namePart: string; - - /** NamePart isExtension. */ - public isExtension: boolean; - - /** - * Creates a new NamePart instance using the specified properties. - * @param [properties] Properties to set - * @returns NamePart instance - */ - public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; - - /** - * Verifies a NamePart message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NamePart - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @param message NamePart - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NamePart to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NamePart - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a FeatureSet. */ - interface IFeatureSet { - - /** FeatureSet fieldPresence */ - fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); - - /** FeatureSet enumType */ - enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); - - /** FeatureSet repeatedFieldEncoding */ - repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); - - /** FeatureSet utf8Validation */ - utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); - - /** FeatureSet messageEncoding */ - messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); - - /** FeatureSet jsonFormat */ - jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); - } - - /** Represents a FeatureSet. */ - class FeatureSet implements IFeatureSet { - - /** - * Constructs a new FeatureSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSet); - - /** FeatureSet fieldPresence. */ - public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); - - /** FeatureSet enumType. */ - public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); - - /** FeatureSet repeatedFieldEncoding. */ - public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); - - /** FeatureSet utf8Validation. */ - public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); - - /** FeatureSet messageEncoding. */ - public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); - - /** FeatureSet jsonFormat. */ - public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); - - /** - * Creates a new FeatureSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSet instance - */ - public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; - - /** - * Verifies a FeatureSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @param message FeatureSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSet { - - /** FieldPresence enum. */ - enum FieldPresence { - FIELD_PRESENCE_UNKNOWN = 0, - EXPLICIT = 1, - IMPLICIT = 2, - LEGACY_REQUIRED = 3 - } - - /** EnumType enum. */ - enum EnumType { - ENUM_TYPE_UNKNOWN = 0, - OPEN = 1, - CLOSED = 2 - } - - /** RepeatedFieldEncoding enum. */ - enum RepeatedFieldEncoding { - REPEATED_FIELD_ENCODING_UNKNOWN = 0, - PACKED = 1, - EXPANDED = 2 - } - - /** Utf8Validation enum. */ - enum Utf8Validation { - UTF8_VALIDATION_UNKNOWN = 0, - VERIFY = 2, - NONE = 3 - } - - /** MessageEncoding enum. */ - enum MessageEncoding { - MESSAGE_ENCODING_UNKNOWN = 0, - LENGTH_PREFIXED = 1, - DELIMITED = 2 - } - - /** JsonFormat enum. */ - enum JsonFormat { - JSON_FORMAT_UNKNOWN = 0, - ALLOW = 1, - LEGACY_BEST_EFFORT = 2 - } - } - - /** Properties of a FeatureSetDefaults. */ - interface IFeatureSetDefaults { - - /** FeatureSetDefaults defaults */ - defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); - - /** FeatureSetDefaults minimumEdition */ - minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetDefaults maximumEdition */ - maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FeatureSetDefaults. */ - class FeatureSetDefaults implements IFeatureSetDefaults { - - /** - * Constructs a new FeatureSetDefaults. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSetDefaults); - - /** FeatureSetDefaults defaults. */ - public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; - - /** FeatureSetDefaults minimumEdition. */ - public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetDefaults maximumEdition. */ - public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetDefaults instance - */ - public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; - - /** - * Verifies a FeatureSetDefaults message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetDefaults - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @param message FeatureSetDefaults - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetDefaults - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSetDefaults { - - /** Properties of a FeatureSetEditionDefault. */ - interface IFeatureSetEditionDefault { - - /** FeatureSetEditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetEditionDefault features */ - features?: (google.protobuf.IFeatureSet|null); - } - - /** Represents a FeatureSetEditionDefault. */ - class FeatureSetEditionDefault implements IFeatureSetEditionDefault { - - /** - * Constructs a new FeatureSetEditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); - - /** FeatureSetEditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetEditionDefault features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetEditionDefault instance - */ - public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Verifies a FeatureSetEditionDefault message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetEditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @param message FeatureSetEditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a SourceCodeInfo. */ - interface ISourceCodeInfo { - - /** SourceCodeInfo location */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); - } - - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { - - /** - * Constructs a new SourceCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ISourceCodeInfo); - - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns SourceCodeInfo instance - */ - public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; - - /** - * Verifies a SourceCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SourceCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @param message SourceCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SourceCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SourceCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SourceCodeInfo { - - /** Properties of a Location. */ - interface ILocation { - - /** Location path */ - path?: (number[]|null); - - /** Location span */ - span?: (number[]|null); - - /** Location leadingComments */ - leadingComments?: (string|null); - - /** Location trailingComments */ - trailingComments?: (string|null); - - /** Location leadingDetachedComments */ - leadingDetachedComments?: (string[]|null); - } - - /** Represents a Location. */ - class Location implements ILocation { - - /** - * Constructs a new Location. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); - - /** Location path. */ - public path: number[]; - - /** Location span. */ - public span: number[]; - - /** Location leadingComments. */ - public leadingComments: string; - - /** Location trailingComments. */ - public trailingComments: string; - - /** Location leadingDetachedComments. */ - public leadingDetachedComments: string[]; - - /** - * Creates a new Location instance using the specified properties. - * @param [properties] Properties to set - * @returns Location instance - */ - public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Location message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; - - /** - * Verifies a Location message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Location - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @param message Location - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Location to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Location - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a GeneratedCodeInfo. */ - interface IGeneratedCodeInfo { - - /** GeneratedCodeInfo annotation */ - annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); - } - - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { - - /** - * Constructs a new GeneratedCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IGeneratedCodeInfo); - - /** GeneratedCodeInfo annotation. */ - public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns GeneratedCodeInfo instance - */ - public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; - - /** - * Verifies a GeneratedCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GeneratedCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @param message GeneratedCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace GeneratedCodeInfo { - - /** Properties of an Annotation. */ - interface IAnnotation { - - /** Annotation path */ - path?: (number[]|null); - - /** Annotation sourceFile */ - sourceFile?: (string|null); - - /** Annotation begin */ - begin?: (number|null); - - /** Annotation end */ - end?: (number|null); - - /** Annotation semantic */ - semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); - } - - /** Represents an Annotation. */ - class Annotation implements IAnnotation { - - /** - * Constructs a new Annotation. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); - - /** Annotation path. */ - public path: number[]; - - /** Annotation sourceFile. */ - public sourceFile: string; - - /** Annotation begin. */ - public begin: number; - - /** Annotation end. */ - public end: number; - - /** Annotation semantic. */ - public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); - - /** - * Creates a new Annotation instance using the specified properties. - * @param [properties] Properties to set - * @returns Annotation instance - */ - public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Verifies an Annotation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Annotation - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @param message Annotation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Annotation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Annotation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Annotation { - - /** Semantic enum. */ - enum Semantic { - NONE = 0, - SET = 1, - ALIAS = 2 - } - } - } - - /** Properties of a Duration. */ - interface IDuration { - - /** Duration seconds */ - seconds?: (number|Long|string|null); - - /** Duration nanos */ - nanos?: (number|null); - } - - /** Represents a Duration. */ - class Duration implements IDuration { - - /** - * Constructs a new Duration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDuration); - - /** Duration seconds. */ - public seconds: (number|Long|string); - - /** Duration nanos. */ - public nanos: number; - - /** - * Creates a new Duration instance using the specified properties. - * @param [properties] Properties to set - * @returns Duration instance - */ - public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; - - /** - * Verifies a Duration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Duration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @param message Duration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Duration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Duration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of 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 an Any. */ - interface IAny { - - /** Any type_url */ - type_url?: (string|null); - - /** Any value */ - value?: (Uint8Array|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|string); - - /** - * Creates a new Any instance using the specified properties. - * @param [properties] Properties to set - * @returns Any instance - */ - public static create(properties?: google.protobuf.IAny): google.protobuf.Any; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Any message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; - - /** - * Verifies an Any message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Any - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Any; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @param message Any - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Any to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Any - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Empty. */ - interface IEmpty { - } - - /** Represents an Empty. */ - class Empty implements IEmpty { - - /** - * Constructs a new Empty. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEmpty); - - /** - * Creates a new Empty instance using the specified properties. - * @param [properties] Properties to set - * @returns Empty instance - */ - public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; - - /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Empty message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; - - /** - * Decodes an Empty message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; - - /** - * Verifies an Empty message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Empty - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; - - /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @param message Empty - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Empty to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Empty - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FieldMask. */ - interface IFieldMask { - - /** FieldMask paths */ - paths?: (string[]|null); - } - - /** Represents a FieldMask. */ - class FieldMask implements IFieldMask { - - /** - * Constructs a new FieldMask. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldMask); - - /** FieldMask paths. */ - public paths: string[]; - - /** - * Creates a new FieldMask instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldMask instance - */ - public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; - - /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @param message FieldMask message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @param message FieldMask message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldMask message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; - - /** - * Decodes a FieldMask message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; - - /** - * Verifies a FieldMask message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldMask - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; - - /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. - * @param message FieldMask - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldMask to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldMask - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace type. */ - namespace type { - - /** Properties of an Interval. */ - interface IInterval { - - /** Interval startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** Interval endTime */ - endTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents an Interval. */ - class Interval implements IInterval { - - /** - * Constructs a new Interval. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.IInterval); - - /** Interval startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** Interval endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new Interval instance using the specified properties. - * @param [properties] Properties to set - * @returns Interval instance - */ - public static create(properties?: google.type.IInterval): google.type.Interval; - - /** - * Encodes the specified Interval message. Does not implicitly {@link google.type.Interval.verify|verify} messages. - * @param message Interval message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.type.IInterval, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Interval message, length delimited. Does not implicitly {@link google.type.Interval.verify|verify} messages. - * @param message Interval message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.type.IInterval, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Interval message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Interval - * @throws {Error} If the payload is not 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.Interval; - - /** - * Decodes an Interval message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Interval - * @throws {Error} If the payload 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.Interval; - - /** - * Verifies an Interval message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Interval message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Interval - */ - public static fromObject(object: { [k: string]: any }): google.type.Interval; - - /** - * Creates a plain object from an Interval message. Also converts values to other types if specified. - * @param message Interval - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.type.Interval, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Interval to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Interval - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace longrunning. */ - namespace longrunning { - - /** Represents an Operations */ - class Operations extends $protobuf.rpc.Service { - - /** - * Constructs a new Operations service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new Operations service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; - - /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListOperationsResponse - */ - public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; - - /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @returns Promise - */ - public listOperations(request: google.longrunning.IListOperationsRequest): Promise; - - /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; - - /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @returns Promise - */ - public getOperation(request: google.longrunning.IGetOperationRequest): Promise; - - /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; - - /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @returns Promise - */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; - - /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; - - /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @returns Promise - */ - public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; - - /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; - - /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @returns Promise - */ - public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; - } - - namespace Operations { - - /** - * Callback as used by {@link google.longrunning.Operations|listOperations}. - * @param error Error, if any - * @param [response] ListOperationsResponse - */ - type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|getOperation}. - * @param error Error, if any - * @param [response] Operation - */ - type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|deleteOperation}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|cancelOperation}. - * @param error Error, if any - * @param [response] Empty - */ - type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|waitOperation}. - * @param error Error, if any - * @param [response] Operation - */ - type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of an Operation. */ - interface IOperation { - - /** Operation name */ - name?: (string|null); - - /** Operation metadata */ - metadata?: (google.protobuf.IAny|null); - - /** Operation done */ - done?: (boolean|null); - - /** Operation error */ - error?: (google.rpc.IStatus|null); - - /** Operation response */ - response?: (google.protobuf.IAny|null); - } - - /** Represents an Operation. */ - class Operation implements IOperation { - - /** - * Constructs a new Operation. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IOperation); - - /** Operation name. */ - public name: string; - - /** Operation metadata. */ - public metadata?: (google.protobuf.IAny|null); - - /** Operation done. */ - public done: boolean; - - /** Operation error. */ - public error?: (google.rpc.IStatus|null); - - /** Operation response. */ - public response?: (google.protobuf.IAny|null); - - /** Operation result. */ - public result?: ("error"|"response"); - - /** - * Creates a new Operation instance using the specified properties. - * @param [properties] Properties to set - * @returns Operation instance - */ - public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; - - /** - * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @param message Operation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @param message Operation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Operation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; - - /** - * Decodes an Operation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; - - /** - * Verifies an Operation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Operation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Operation - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; - - /** - * Creates a plain object from an Operation message. Also converts values to other types if specified. - * @param message Operation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Operation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Operation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetOperationRequest. */ - interface IGetOperationRequest { - - /** GetOperationRequest name */ - name?: (string|null); - } - - /** Represents a GetOperationRequest. */ - class GetOperationRequest implements IGetOperationRequest { - - /** - * Constructs a new GetOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IGetOperationRequest); - - /** GetOperationRequest name. */ - public name: string; - - /** - * Creates a new GetOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetOperationRequest instance - */ - public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; - - /** - * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @param message GetOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @param message GetOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; - - /** - * Verifies a GetOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; - - /** - * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. - * @param message GetOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListOperationsRequest. */ - interface IListOperationsRequest { - - /** ListOperationsRequest name */ - name?: (string|null); - - /** ListOperationsRequest filter */ - filter?: (string|null); - - /** ListOperationsRequest pageSize */ - pageSize?: (number|null); - - /** ListOperationsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListOperationsRequest. */ - class ListOperationsRequest implements IListOperationsRequest { - - /** - * Constructs a new ListOperationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IListOperationsRequest); - - /** ListOperationsRequest name. */ - public name: string; - - /** ListOperationsRequest filter. */ - public filter: string; - - /** ListOperationsRequest pageSize. */ - public pageSize: number; - - /** ListOperationsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListOperationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListOperationsRequest instance - */ - public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; - - /** - * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @param message ListOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @param message ListOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; - - /** - * Verifies a ListOperationsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListOperationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; - - /** - * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. - * @param message ListOperationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListOperationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListOperationsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListOperationsResponse. */ - interface IListOperationsResponse { - - /** ListOperationsResponse operations */ - operations?: (google.longrunning.IOperation[]|null); - - /** ListOperationsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListOperationsResponse. */ - class ListOperationsResponse implements IListOperationsResponse { - - /** - * Constructs a new ListOperationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IListOperationsResponse); - - /** ListOperationsResponse operations. */ - public operations: google.longrunning.IOperation[]; - - /** ListOperationsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListOperationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListOperationsResponse instance - */ - public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; - - /** - * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @param message ListOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @param message ListOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; - - /** - * Verifies a ListOperationsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListOperationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; - - /** - * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. - * @param message ListOperationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListOperationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListOperationsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CancelOperationRequest. */ - interface ICancelOperationRequest { - - /** CancelOperationRequest name */ - name?: (string|null); - } - - /** Represents a CancelOperationRequest. */ - class CancelOperationRequest implements ICancelOperationRequest { - - /** - * Constructs a new CancelOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.ICancelOperationRequest); - - /** CancelOperationRequest name. */ - public name: string; - - /** - * Creates a new CancelOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CancelOperationRequest instance - */ - public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; - - /** - * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @param message CancelOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @param message CancelOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; - - /** - * Verifies a CancelOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CancelOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; - - /** - * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. - * @param message CancelOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CancelOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CancelOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteOperationRequest. */ - interface IDeleteOperationRequest { - - /** DeleteOperationRequest name */ - name?: (string|null); - } - - /** Represents a DeleteOperationRequest. */ - class DeleteOperationRequest implements IDeleteOperationRequest { - - /** - * Constructs a new DeleteOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IDeleteOperationRequest); - - /** DeleteOperationRequest name. */ - public name: string; - - /** - * Creates a new DeleteOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteOperationRequest instance - */ - public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; - - /** - * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @param message DeleteOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @param message DeleteOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; - - /** - * Verifies a DeleteOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; - - /** - * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. - * @param message DeleteOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a WaitOperationRequest. */ - interface IWaitOperationRequest { - - /** WaitOperationRequest name */ - name?: (string|null); - - /** WaitOperationRequest timeout */ - timeout?: (google.protobuf.IDuration|null); - } - - /** Represents a WaitOperationRequest. */ - class WaitOperationRequest implements IWaitOperationRequest { - - /** - * Constructs a new WaitOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IWaitOperationRequest); - - /** WaitOperationRequest name. */ - public name: string; - - /** WaitOperationRequest timeout. */ - public timeout?: (google.protobuf.IDuration|null); - - /** - * Creates a new WaitOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns WaitOperationRequest instance - */ - public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; - - /** - * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @param message WaitOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @param message WaitOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; - - /** - * Verifies a WaitOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WaitOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; - - /** - * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. - * @param message WaitOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WaitOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WaitOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OperationInfo. */ - interface IOperationInfo { - - /** OperationInfo responseType */ - responseType?: (string|null); - - /** OperationInfo metadataType */ - metadataType?: (string|null); - } - - /** Represents an OperationInfo. */ - class OperationInfo implements IOperationInfo { - - /** - * Constructs a new OperationInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IOperationInfo); - - /** OperationInfo responseType. */ - public responseType: string; - - /** OperationInfo metadataType. */ - public metadataType: string; - - /** - * Creates a new OperationInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns OperationInfo instance - */ - public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; - - /** - * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @param message OperationInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @param message OperationInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OperationInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; - - /** - * Decodes an OperationInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; - - /** - * Verifies an OperationInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OperationInfo - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; - - /** - * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. - * @param message OperationInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OperationInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OperationInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace rpc. */ - namespace rpc { - - /** Properties of a Status. */ - interface IStatus { - - /** Status code */ - code?: (number|null); - - /** Status message */ - message?: (string|null); - - /** Status details */ - details?: (google.protobuf.IAny[]|null); - } - - /** Represents a Status. */ - class Status implements IStatus { - - /** - * Constructs a new Status. - * @param [properties] Properties to set - */ - constructor(properties?: google.rpc.IStatus); - - /** Status code. */ - public code: number; - - /** Status message. */ - public message: string; - - /** Status details. */ - public details: google.protobuf.IAny[]; - - /** - * Creates a new Status instance using the specified properties. - * @param [properties] Properties to set - * @returns Status instance - */ - public static create(properties?: google.rpc.IStatus): google.rpc.Status; - - /** - * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @param message Status message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @param message Status message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Status message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; - - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; - - /** - * Verifies a Status message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Status - */ - public static fromObject(object: { [k: string]: any }): google.rpc.Status; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @param message Status - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Status to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Status - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } -} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.js b/owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.js deleted file mode 100644 index a1f625acff8..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.js +++ /dev/null @@ -1,42614 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*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_batch_protos || ($protobuf.roots._google_cloud_batch_protos = {}); - - $root.google = (function() { - - /** - * Namespace google. - * @exports google - * @namespace - */ - var google = {}; - - google.cloud = (function() { - - /** - * Namespace cloud. - * @memberof google - * @namespace - */ - var cloud = {}; - - cloud.batch = (function() { - - /** - * Namespace batch. - * @memberof google.cloud - * @namespace - */ - var batch = {}; - - batch.v1alpha = (function() { - - /** - * Namespace v1alpha. - * @memberof google.cloud.batch - * @namespace - */ - var v1alpha = {}; - - v1alpha.BatchService = (function() { - - /** - * Constructs a new BatchService service. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a BatchService - * @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 BatchService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (BatchService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = BatchService; - - /** - * Creates new BatchService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.batch.v1alpha.BatchService - * @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 {BatchService} RPC service. Useful where requests and/or responses are streamed. - */ - BatchService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|createJob}. - * @memberof google.cloud.batch.v1alpha.BatchService - * @typedef CreateJobCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.batch.v1alpha.Job} [response] Job - */ - - /** - * Calls CreateJob. - * @function createJob - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.ICreateJobRequest} request CreateJobRequest message or plain object - * @param {google.cloud.batch.v1alpha.BatchService.CreateJobCallback} callback Node-style callback called with the error, if any, and Job - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.createJob = function createJob(request, callback) { - return this.rpcCall(createJob, $root.google.cloud.batch.v1alpha.CreateJobRequest, $root.google.cloud.batch.v1alpha.Job, request, callback); - }, "name", { value: "CreateJob" }); - - /** - * Calls CreateJob. - * @function createJob - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.ICreateJobRequest} request CreateJobRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|getJob}. - * @memberof google.cloud.batch.v1alpha.BatchService - * @typedef GetJobCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.batch.v1alpha.Job} [response] Job - */ - - /** - * Calls GetJob. - * @function getJob - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IGetJobRequest} request GetJobRequest message or plain object - * @param {google.cloud.batch.v1alpha.BatchService.GetJobCallback} callback Node-style callback called with the error, if any, and Job - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.getJob = function getJob(request, callback) { - return this.rpcCall(getJob, $root.google.cloud.batch.v1alpha.GetJobRequest, $root.google.cloud.batch.v1alpha.Job, request, callback); - }, "name", { value: "GetJob" }); - - /** - * Calls GetJob. - * @function getJob - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IGetJobRequest} request GetJobRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|deleteJob}. - * @memberof google.cloud.batch.v1alpha.BatchService - * @typedef DeleteJobCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteJob. - * @function deleteJob - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IDeleteJobRequest} request DeleteJobRequest message or plain object - * @param {google.cloud.batch.v1alpha.BatchService.DeleteJobCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.deleteJob = function deleteJob(request, callback) { - return this.rpcCall(deleteJob, $root.google.cloud.batch.v1alpha.DeleteJobRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteJob" }); - - /** - * Calls DeleteJob. - * @function deleteJob - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IDeleteJobRequest} request DeleteJobRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|cancelJob}. - * @memberof google.cloud.batch.v1alpha.BatchService - * @typedef CancelJobCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CancelJob. - * @function cancelJob - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.ICancelJobRequest} request CancelJobRequest message or plain object - * @param {google.cloud.batch.v1alpha.BatchService.CancelJobCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.cancelJob = function cancelJob(request, callback) { - return this.rpcCall(cancelJob, $root.google.cloud.batch.v1alpha.CancelJobRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CancelJob" }); - - /** - * Calls CancelJob. - * @function cancelJob - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.ICancelJobRequest} request CancelJobRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|updateJob}. - * @memberof google.cloud.batch.v1alpha.BatchService - * @typedef UpdateJobCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.batch.v1alpha.Job} [response] Job - */ - - /** - * Calls UpdateJob. - * @function updateJob - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IUpdateJobRequest} request UpdateJobRequest message or plain object - * @param {google.cloud.batch.v1alpha.BatchService.UpdateJobCallback} callback Node-style callback called with the error, if any, and Job - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.updateJob = function updateJob(request, callback) { - return this.rpcCall(updateJob, $root.google.cloud.batch.v1alpha.UpdateJobRequest, $root.google.cloud.batch.v1alpha.Job, request, callback); - }, "name", { value: "UpdateJob" }); - - /** - * Calls UpdateJob. - * @function updateJob - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IUpdateJobRequest} request UpdateJobRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|listJobs}. - * @memberof google.cloud.batch.v1alpha.BatchService - * @typedef ListJobsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.batch.v1alpha.ListJobsResponse} [response] ListJobsResponse - */ - - /** - * Calls ListJobs. - * @function listJobs - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IListJobsRequest} request ListJobsRequest message or plain object - * @param {google.cloud.batch.v1alpha.BatchService.ListJobsCallback} callback Node-style callback called with the error, if any, and ListJobsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.listJobs = function listJobs(request, callback) { - return this.rpcCall(listJobs, $root.google.cloud.batch.v1alpha.ListJobsRequest, $root.google.cloud.batch.v1alpha.ListJobsResponse, request, callback); - }, "name", { value: "ListJobs" }); - - /** - * Calls ListJobs. - * @function listJobs - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IListJobsRequest} request ListJobsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|getTask}. - * @memberof google.cloud.batch.v1alpha.BatchService - * @typedef GetTaskCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.batch.v1alpha.Task} [response] Task - */ - - /** - * Calls GetTask. - * @function getTask - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IGetTaskRequest} request GetTaskRequest message or plain object - * @param {google.cloud.batch.v1alpha.BatchService.GetTaskCallback} callback Node-style callback called with the error, if any, and Task - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.getTask = function getTask(request, callback) { - return this.rpcCall(getTask, $root.google.cloud.batch.v1alpha.GetTaskRequest, $root.google.cloud.batch.v1alpha.Task, request, callback); - }, "name", { value: "GetTask" }); - - /** - * Calls GetTask. - * @function getTask - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IGetTaskRequest} request GetTaskRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|listTasks}. - * @memberof google.cloud.batch.v1alpha.BatchService - * @typedef ListTasksCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.batch.v1alpha.ListTasksResponse} [response] ListTasksResponse - */ - - /** - * Calls ListTasks. - * @function listTasks - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IListTasksRequest} request ListTasksRequest message or plain object - * @param {google.cloud.batch.v1alpha.BatchService.ListTasksCallback} callback Node-style callback called with the error, if any, and ListTasksResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.listTasks = function listTasks(request, callback) { - return this.rpcCall(listTasks, $root.google.cloud.batch.v1alpha.ListTasksRequest, $root.google.cloud.batch.v1alpha.ListTasksResponse, request, callback); - }, "name", { value: "ListTasks" }); - - /** - * Calls ListTasks. - * @function listTasks - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IListTasksRequest} request ListTasksRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|createResourceAllowance}. - * @memberof google.cloud.batch.v1alpha.BatchService - * @typedef CreateResourceAllowanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.batch.v1alpha.ResourceAllowance} [response] ResourceAllowance - */ - - /** - * Calls CreateResourceAllowance. - * @function createResourceAllowance - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest} request CreateResourceAllowanceRequest message or plain object - * @param {google.cloud.batch.v1alpha.BatchService.CreateResourceAllowanceCallback} callback Node-style callback called with the error, if any, and ResourceAllowance - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.createResourceAllowance = function createResourceAllowance(request, callback) { - return this.rpcCall(createResourceAllowance, $root.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest, $root.google.cloud.batch.v1alpha.ResourceAllowance, request, callback); - }, "name", { value: "CreateResourceAllowance" }); - - /** - * Calls CreateResourceAllowance. - * @function createResourceAllowance - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest} request CreateResourceAllowanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|getResourceAllowance}. - * @memberof google.cloud.batch.v1alpha.BatchService - * @typedef GetResourceAllowanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.batch.v1alpha.ResourceAllowance} [response] ResourceAllowance - */ - - /** - * Calls GetResourceAllowance. - * @function getResourceAllowance - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IGetResourceAllowanceRequest} request GetResourceAllowanceRequest message or plain object - * @param {google.cloud.batch.v1alpha.BatchService.GetResourceAllowanceCallback} callback Node-style callback called with the error, if any, and ResourceAllowance - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.getResourceAllowance = function getResourceAllowance(request, callback) { - return this.rpcCall(getResourceAllowance, $root.google.cloud.batch.v1alpha.GetResourceAllowanceRequest, $root.google.cloud.batch.v1alpha.ResourceAllowance, request, callback); - }, "name", { value: "GetResourceAllowance" }); - - /** - * Calls GetResourceAllowance. - * @function getResourceAllowance - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IGetResourceAllowanceRequest} request GetResourceAllowanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|deleteResourceAllowance}. - * @memberof google.cloud.batch.v1alpha.BatchService - * @typedef DeleteResourceAllowanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteResourceAllowance. - * @function deleteResourceAllowance - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest} request DeleteResourceAllowanceRequest message or plain object - * @param {google.cloud.batch.v1alpha.BatchService.DeleteResourceAllowanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.deleteResourceAllowance = function deleteResourceAllowance(request, callback) { - return this.rpcCall(deleteResourceAllowance, $root.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteResourceAllowance" }); - - /** - * Calls DeleteResourceAllowance. - * @function deleteResourceAllowance - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest} request DeleteResourceAllowanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|listResourceAllowances}. - * @memberof google.cloud.batch.v1alpha.BatchService - * @typedef ListResourceAllowancesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.batch.v1alpha.ListResourceAllowancesResponse} [response] ListResourceAllowancesResponse - */ - - /** - * Calls ListResourceAllowances. - * @function listResourceAllowances - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IListResourceAllowancesRequest} request ListResourceAllowancesRequest message or plain object - * @param {google.cloud.batch.v1alpha.BatchService.ListResourceAllowancesCallback} callback Node-style callback called with the error, if any, and ListResourceAllowancesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.listResourceAllowances = function listResourceAllowances(request, callback) { - return this.rpcCall(listResourceAllowances, $root.google.cloud.batch.v1alpha.ListResourceAllowancesRequest, $root.google.cloud.batch.v1alpha.ListResourceAllowancesResponse, request, callback); - }, "name", { value: "ListResourceAllowances" }); - - /** - * Calls ListResourceAllowances. - * @function listResourceAllowances - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IListResourceAllowancesRequest} request ListResourceAllowancesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.batch.v1alpha.BatchService|updateResourceAllowance}. - * @memberof google.cloud.batch.v1alpha.BatchService - * @typedef UpdateResourceAllowanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.batch.v1alpha.ResourceAllowance} [response] ResourceAllowance - */ - - /** - * Calls UpdateResourceAllowance. - * @function updateResourceAllowance - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest} request UpdateResourceAllowanceRequest message or plain object - * @param {google.cloud.batch.v1alpha.BatchService.UpdateResourceAllowanceCallback} callback Node-style callback called with the error, if any, and ResourceAllowance - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchService.prototype.updateResourceAllowance = function updateResourceAllowance(request, callback) { - return this.rpcCall(updateResourceAllowance, $root.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest, $root.google.cloud.batch.v1alpha.ResourceAllowance, request, callback); - }, "name", { value: "UpdateResourceAllowance" }); - - /** - * Calls UpdateResourceAllowance. - * @function updateResourceAllowance - * @memberof google.cloud.batch.v1alpha.BatchService - * @instance - * @param {google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest} request UpdateResourceAllowanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return BatchService; - })(); - - v1alpha.CreateJobRequest = (function() { - - /** - * Properties of a CreateJobRequest. - * @memberof google.cloud.batch.v1alpha - * @interface ICreateJobRequest - * @property {string|null} [parent] CreateJobRequest parent - * @property {string|null} [jobId] CreateJobRequest jobId - * @property {google.cloud.batch.v1alpha.IJob|null} [job] CreateJobRequest job - * @property {string|null} [requestId] CreateJobRequest requestId - */ - - /** - * Constructs a new CreateJobRequest. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a CreateJobRequest. - * @implements ICreateJobRequest - * @constructor - * @param {google.cloud.batch.v1alpha.ICreateJobRequest=} [properties] Properties to set - */ - function CreateJobRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateJobRequest parent. - * @member {string} parent - * @memberof google.cloud.batch.v1alpha.CreateJobRequest - * @instance - */ - CreateJobRequest.prototype.parent = ""; - - /** - * CreateJobRequest jobId. - * @member {string} jobId - * @memberof google.cloud.batch.v1alpha.CreateJobRequest - * @instance - */ - CreateJobRequest.prototype.jobId = ""; - - /** - * CreateJobRequest job. - * @member {google.cloud.batch.v1alpha.IJob|null|undefined} job - * @memberof google.cloud.batch.v1alpha.CreateJobRequest - * @instance - */ - CreateJobRequest.prototype.job = null; - - /** - * CreateJobRequest requestId. - * @member {string} requestId - * @memberof google.cloud.batch.v1alpha.CreateJobRequest - * @instance - */ - CreateJobRequest.prototype.requestId = ""; - - /** - * Creates a new CreateJobRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.CreateJobRequest - * @static - * @param {google.cloud.batch.v1alpha.ICreateJobRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.CreateJobRequest} CreateJobRequest instance - */ - CreateJobRequest.create = function create(properties) { - return new CreateJobRequest(properties); - }; - - /** - * Encodes the specified CreateJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.CreateJobRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.CreateJobRequest - * @static - * @param {google.cloud.batch.v1alpha.ICreateJobRequest} message CreateJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateJobRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.jobId); - if (message.job != null && Object.hasOwnProperty.call(message, "job")) - $root.google.cloud.batch.v1alpha.Job.encode(message.job, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified CreateJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.CreateJobRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.CreateJobRequest - * @static - * @param {google.cloud.batch.v1alpha.ICreateJobRequest} message CreateJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateJobRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateJobRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.CreateJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.CreateJobRequest} CreateJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateJobRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.CreateJobRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.jobId = reader.string(); - break; - } - case 3: { - message.job = $root.google.cloud.batch.v1alpha.Job.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateJobRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.CreateJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.CreateJobRequest} CreateJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateJobRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateJobRequest message. - * @function verify - * @memberof google.cloud.batch.v1alpha.CreateJobRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateJobRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.jobId != null && message.hasOwnProperty("jobId")) - if (!$util.isString(message.jobId)) - return "jobId: string expected"; - if (message.job != null && message.hasOwnProperty("job")) { - var error = $root.google.cloud.batch.v1alpha.Job.verify(message.job); - if (error) - return "job." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a CreateJobRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.CreateJobRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.CreateJobRequest} CreateJobRequest - */ - CreateJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.CreateJobRequest) - return object; - var message = new $root.google.cloud.batch.v1alpha.CreateJobRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.jobId != null) - message.jobId = String(object.jobId); - if (object.job != null) { - if (typeof object.job !== "object") - throw TypeError(".google.cloud.batch.v1alpha.CreateJobRequest.job: object expected"); - message.job = $root.google.cloud.batch.v1alpha.Job.fromObject(object.job); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a CreateJobRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.CreateJobRequest - * @static - * @param {google.cloud.batch.v1alpha.CreateJobRequest} message CreateJobRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateJobRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.jobId = ""; - object.job = null; - object.requestId = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.jobId != null && message.hasOwnProperty("jobId")) - object.jobId = message.jobId; - if (message.job != null && message.hasOwnProperty("job")) - object.job = $root.google.cloud.batch.v1alpha.Job.toObject(message.job, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this CreateJobRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.CreateJobRequest - * @instance - * @returns {Object.} JSON object - */ - CreateJobRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateJobRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.CreateJobRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.CreateJobRequest"; - }; - - return CreateJobRequest; - })(); - - v1alpha.GetJobRequest = (function() { - - /** - * Properties of a GetJobRequest. - * @memberof google.cloud.batch.v1alpha - * @interface IGetJobRequest - * @property {string|null} [name] GetJobRequest name - */ - - /** - * Constructs a new GetJobRequest. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a GetJobRequest. - * @implements IGetJobRequest - * @constructor - * @param {google.cloud.batch.v1alpha.IGetJobRequest=} [properties] Properties to set - */ - function GetJobRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetJobRequest name. - * @member {string} name - * @memberof google.cloud.batch.v1alpha.GetJobRequest - * @instance - */ - GetJobRequest.prototype.name = ""; - - /** - * Creates a new GetJobRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.GetJobRequest - * @static - * @param {google.cloud.batch.v1alpha.IGetJobRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.GetJobRequest} GetJobRequest instance - */ - GetJobRequest.create = function create(properties) { - return new GetJobRequest(properties); - }; - - /** - * Encodes the specified GetJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.GetJobRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.GetJobRequest - * @static - * @param {google.cloud.batch.v1alpha.IGetJobRequest} message GetJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetJobRequest.encode = function encode(message, writer) { - 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 GetJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.GetJobRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.GetJobRequest - * @static - * @param {google.cloud.batch.v1alpha.IGetJobRequest} message GetJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetJobRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetJobRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.GetJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.GetJobRequest} GetJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetJobRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.GetJobRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetJobRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.GetJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.GetJobRequest} GetJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetJobRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetJobRequest message. - * @function verify - * @memberof google.cloud.batch.v1alpha.GetJobRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetJobRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetJobRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.GetJobRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.GetJobRequest} GetJobRequest - */ - GetJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.GetJobRequest) - return object; - var message = new $root.google.cloud.batch.v1alpha.GetJobRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetJobRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.GetJobRequest - * @static - * @param {google.cloud.batch.v1alpha.GetJobRequest} message GetJobRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetJobRequest.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 GetJobRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.GetJobRequest - * @instance - * @returns {Object.} JSON object - */ - GetJobRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetJobRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.GetJobRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.GetJobRequest"; - }; - - return GetJobRequest; - })(); - - v1alpha.DeleteJobRequest = (function() { - - /** - * Properties of a DeleteJobRequest. - * @memberof google.cloud.batch.v1alpha - * @interface IDeleteJobRequest - * @property {string|null} [name] DeleteJobRequest name - * @property {string|null} [reason] DeleteJobRequest reason - * @property {string|null} [requestId] DeleteJobRequest requestId - */ - - /** - * Constructs a new DeleteJobRequest. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a DeleteJobRequest. - * @implements IDeleteJobRequest - * @constructor - * @param {google.cloud.batch.v1alpha.IDeleteJobRequest=} [properties] Properties to set - */ - function DeleteJobRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteJobRequest name. - * @member {string} name - * @memberof google.cloud.batch.v1alpha.DeleteJobRequest - * @instance - */ - DeleteJobRequest.prototype.name = ""; - - /** - * DeleteJobRequest reason. - * @member {string} reason - * @memberof google.cloud.batch.v1alpha.DeleteJobRequest - * @instance - */ - DeleteJobRequest.prototype.reason = ""; - - /** - * DeleteJobRequest requestId. - * @member {string} requestId - * @memberof google.cloud.batch.v1alpha.DeleteJobRequest - * @instance - */ - DeleteJobRequest.prototype.requestId = ""; - - /** - * Creates a new DeleteJobRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.DeleteJobRequest - * @static - * @param {google.cloud.batch.v1alpha.IDeleteJobRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.DeleteJobRequest} DeleteJobRequest instance - */ - DeleteJobRequest.create = function create(properties) { - return new DeleteJobRequest(properties); - }; - - /** - * Encodes the specified DeleteJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.DeleteJobRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.DeleteJobRequest - * @static - * @param {google.cloud.batch.v1alpha.IDeleteJobRequest} message DeleteJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteJobRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.reason); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified DeleteJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.DeleteJobRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.DeleteJobRequest - * @static - * @param {google.cloud.batch.v1alpha.IDeleteJobRequest} message DeleteJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteJobRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteJobRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.DeleteJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.DeleteJobRequest} DeleteJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteJobRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.DeleteJobRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.reason = reader.string(); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteJobRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.DeleteJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.DeleteJobRequest} DeleteJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteJobRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteJobRequest message. - * @function verify - * @memberof google.cloud.batch.v1alpha.DeleteJobRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteJobRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.reason != null && message.hasOwnProperty("reason")) - if (!$util.isString(message.reason)) - return "reason: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a DeleteJobRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.DeleteJobRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.DeleteJobRequest} DeleteJobRequest - */ - DeleteJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.DeleteJobRequest) - return object; - var message = new $root.google.cloud.batch.v1alpha.DeleteJobRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.reason != null) - message.reason = String(object.reason); - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a DeleteJobRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.DeleteJobRequest - * @static - * @param {google.cloud.batch.v1alpha.DeleteJobRequest} message DeleteJobRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteJobRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.reason = ""; - object.requestId = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.reason != null && message.hasOwnProperty("reason")) - object.reason = message.reason; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this DeleteJobRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.DeleteJobRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteJobRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteJobRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.DeleteJobRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.DeleteJobRequest"; - }; - - return DeleteJobRequest; - })(); - - v1alpha.CancelJobRequest = (function() { - - /** - * Properties of a CancelJobRequest. - * @memberof google.cloud.batch.v1alpha - * @interface ICancelJobRequest - * @property {string|null} [name] CancelJobRequest name - * @property {string|null} [requestId] CancelJobRequest requestId - */ - - /** - * Constructs a new CancelJobRequest. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a CancelJobRequest. - * @implements ICancelJobRequest - * @constructor - * @param {google.cloud.batch.v1alpha.ICancelJobRequest=} [properties] Properties to set - */ - function CancelJobRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CancelJobRequest name. - * @member {string} name - * @memberof google.cloud.batch.v1alpha.CancelJobRequest - * @instance - */ - CancelJobRequest.prototype.name = ""; - - /** - * CancelJobRequest requestId. - * @member {string} requestId - * @memberof google.cloud.batch.v1alpha.CancelJobRequest - * @instance - */ - CancelJobRequest.prototype.requestId = ""; - - /** - * Creates a new CancelJobRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.CancelJobRequest - * @static - * @param {google.cloud.batch.v1alpha.ICancelJobRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.CancelJobRequest} CancelJobRequest instance - */ - CancelJobRequest.create = function create(properties) { - return new CancelJobRequest(properties); - }; - - /** - * Encodes the specified CancelJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.CancelJobRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.CancelJobRequest - * @static - * @param {google.cloud.batch.v1alpha.ICancelJobRequest} message CancelJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelJobRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified CancelJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.CancelJobRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.CancelJobRequest - * @static - * @param {google.cloud.batch.v1alpha.ICancelJobRequest} message CancelJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelJobRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CancelJobRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.CancelJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.CancelJobRequest} CancelJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelJobRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.CancelJobRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CancelJobRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.CancelJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.CancelJobRequest} CancelJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelJobRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CancelJobRequest message. - * @function verify - * @memberof google.cloud.batch.v1alpha.CancelJobRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CancelJobRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a CancelJobRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.CancelJobRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.CancelJobRequest} CancelJobRequest - */ - CancelJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.CancelJobRequest) - return object; - var message = new $root.google.cloud.batch.v1alpha.CancelJobRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a CancelJobRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.CancelJobRequest - * @static - * @param {google.cloud.batch.v1alpha.CancelJobRequest} message CancelJobRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CancelJobRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this CancelJobRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.CancelJobRequest - * @instance - * @returns {Object.} JSON object - */ - CancelJobRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CancelJobRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.CancelJobRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CancelJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.CancelJobRequest"; - }; - - return CancelJobRequest; - })(); - - v1alpha.CancelJobResponse = (function() { - - /** - * Properties of a CancelJobResponse. - * @memberof google.cloud.batch.v1alpha - * @interface ICancelJobResponse - */ - - /** - * Constructs a new CancelJobResponse. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a CancelJobResponse. - * @implements ICancelJobResponse - * @constructor - * @param {google.cloud.batch.v1alpha.ICancelJobResponse=} [properties] Properties to set - */ - function CancelJobResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Creates a new CancelJobResponse instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.CancelJobResponse - * @static - * @param {google.cloud.batch.v1alpha.ICancelJobResponse=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.CancelJobResponse} CancelJobResponse instance - */ - CancelJobResponse.create = function create(properties) { - return new CancelJobResponse(properties); - }; - - /** - * Encodes the specified CancelJobResponse message. Does not implicitly {@link google.cloud.batch.v1alpha.CancelJobResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.CancelJobResponse - * @static - * @param {google.cloud.batch.v1alpha.ICancelJobResponse} message CancelJobResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelJobResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified CancelJobResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.CancelJobResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.CancelJobResponse - * @static - * @param {google.cloud.batch.v1alpha.ICancelJobResponse} message CancelJobResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelJobResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CancelJobResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.CancelJobResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.CancelJobResponse} CancelJobResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelJobResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.CancelJobResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CancelJobResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.CancelJobResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.CancelJobResponse} CancelJobResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelJobResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CancelJobResponse message. - * @function verify - * @memberof google.cloud.batch.v1alpha.CancelJobResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CancelJobResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a CancelJobResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.CancelJobResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.CancelJobResponse} CancelJobResponse - */ - CancelJobResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.CancelJobResponse) - return object; - return new $root.google.cloud.batch.v1alpha.CancelJobResponse(); - }; - - /** - * Creates a plain object from a CancelJobResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.CancelJobResponse - * @static - * @param {google.cloud.batch.v1alpha.CancelJobResponse} message CancelJobResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CancelJobResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this CancelJobResponse to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.CancelJobResponse - * @instance - * @returns {Object.} JSON object - */ - CancelJobResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CancelJobResponse - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.CancelJobResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CancelJobResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.CancelJobResponse"; - }; - - return CancelJobResponse; - })(); - - v1alpha.UpdateJobRequest = (function() { - - /** - * Properties of an UpdateJobRequest. - * @memberof google.cloud.batch.v1alpha - * @interface IUpdateJobRequest - * @property {google.cloud.batch.v1alpha.IJob|null} [job] UpdateJobRequest job - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateJobRequest updateMask - * @property {string|null} [requestId] UpdateJobRequest requestId - */ - - /** - * Constructs a new UpdateJobRequest. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents an UpdateJobRequest. - * @implements IUpdateJobRequest - * @constructor - * @param {google.cloud.batch.v1alpha.IUpdateJobRequest=} [properties] Properties to set - */ - function UpdateJobRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateJobRequest job. - * @member {google.cloud.batch.v1alpha.IJob|null|undefined} job - * @memberof google.cloud.batch.v1alpha.UpdateJobRequest - * @instance - */ - UpdateJobRequest.prototype.job = null; - - /** - * UpdateJobRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.batch.v1alpha.UpdateJobRequest - * @instance - */ - UpdateJobRequest.prototype.updateMask = null; - - /** - * UpdateJobRequest requestId. - * @member {string} requestId - * @memberof google.cloud.batch.v1alpha.UpdateJobRequest - * @instance - */ - UpdateJobRequest.prototype.requestId = ""; - - /** - * Creates a new UpdateJobRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.UpdateJobRequest - * @static - * @param {google.cloud.batch.v1alpha.IUpdateJobRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.UpdateJobRequest} UpdateJobRequest instance - */ - UpdateJobRequest.create = function create(properties) { - return new UpdateJobRequest(properties); - }; - - /** - * Encodes the specified UpdateJobRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.UpdateJobRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.UpdateJobRequest - * @static - * @param {google.cloud.batch.v1alpha.IUpdateJobRequest} message UpdateJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateJobRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.job != null && Object.hasOwnProperty.call(message, "job")) - $root.google.cloud.batch.v1alpha.Job.encode(message.job, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified UpdateJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UpdateJobRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.UpdateJobRequest - * @static - * @param {google.cloud.batch.v1alpha.IUpdateJobRequest} message UpdateJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateJobRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateJobRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.UpdateJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.UpdateJobRequest} UpdateJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateJobRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.UpdateJobRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.job = $root.google.cloud.batch.v1alpha.Job.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateJobRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.UpdateJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.UpdateJobRequest} UpdateJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateJobRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateJobRequest message. - * @function verify - * @memberof google.cloud.batch.v1alpha.UpdateJobRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateJobRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.job != null && message.hasOwnProperty("job")) { - var error = $root.google.cloud.batch.v1alpha.Job.verify(message.job); - if (error) - return "job." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates an UpdateJobRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.UpdateJobRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.UpdateJobRequest} UpdateJobRequest - */ - UpdateJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.UpdateJobRequest) - return object; - var message = new $root.google.cloud.batch.v1alpha.UpdateJobRequest(); - if (object.job != null) { - if (typeof object.job !== "object") - throw TypeError(".google.cloud.batch.v1alpha.UpdateJobRequest.job: object expected"); - message.job = $root.google.cloud.batch.v1alpha.Job.fromObject(object.job); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.batch.v1alpha.UpdateJobRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from an UpdateJobRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.UpdateJobRequest - * @static - * @param {google.cloud.batch.v1alpha.UpdateJobRequest} message UpdateJobRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateJobRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.job = null; - object.updateMask = null; - object.requestId = ""; - } - if (message.job != null && message.hasOwnProperty("job")) - object.job = $root.google.cloud.batch.v1alpha.Job.toObject(message.job, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this UpdateJobRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.UpdateJobRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateJobRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateJobRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.UpdateJobRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.UpdateJobRequest"; - }; - - return UpdateJobRequest; - })(); - - v1alpha.ListJobsRequest = (function() { - - /** - * Properties of a ListJobsRequest. - * @memberof google.cloud.batch.v1alpha - * @interface IListJobsRequest - * @property {string|null} [parent] ListJobsRequest parent - * @property {string|null} [filter] ListJobsRequest filter - * @property {string|null} [orderBy] ListJobsRequest orderBy - * @property {number|null} [pageSize] ListJobsRequest pageSize - * @property {string|null} [pageToken] ListJobsRequest pageToken - */ - - /** - * Constructs a new ListJobsRequest. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a ListJobsRequest. - * @implements IListJobsRequest - * @constructor - * @param {google.cloud.batch.v1alpha.IListJobsRequest=} [properties] Properties to set - */ - function ListJobsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListJobsRequest parent. - * @member {string} parent - * @memberof google.cloud.batch.v1alpha.ListJobsRequest - * @instance - */ - ListJobsRequest.prototype.parent = ""; - - /** - * ListJobsRequest filter. - * @member {string} filter - * @memberof google.cloud.batch.v1alpha.ListJobsRequest - * @instance - */ - ListJobsRequest.prototype.filter = ""; - - /** - * ListJobsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.batch.v1alpha.ListJobsRequest - * @instance - */ - ListJobsRequest.prototype.orderBy = ""; - - /** - * ListJobsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.batch.v1alpha.ListJobsRequest - * @instance - */ - ListJobsRequest.prototype.pageSize = 0; - - /** - * ListJobsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.batch.v1alpha.ListJobsRequest - * @instance - */ - ListJobsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListJobsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.ListJobsRequest - * @static - * @param {google.cloud.batch.v1alpha.IListJobsRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.ListJobsRequest} ListJobsRequest instance - */ - ListJobsRequest.create = function create(properties) { - return new ListJobsRequest(properties); - }; - - /** - * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.ListJobsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.ListJobsRequest - * @static - * @param {google.cloud.batch.v1alpha.IListJobsRequest} message ListJobsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListJobsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; - - /** - * Encodes the specified ListJobsRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListJobsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.ListJobsRequest - * @static - * @param {google.cloud.batch.v1alpha.IListJobsRequest} message ListJobsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListJobsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.ListJobsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.ListJobsRequest} ListJobsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListJobsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ListJobsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListJobsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.ListJobsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.ListJobsRequest} ListJobsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListJobsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListJobsRequest message. - * @function verify - * @memberof google.cloud.batch.v1alpha.ListJobsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListJobsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListJobsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.ListJobsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.ListJobsRequest} ListJobsRequest - */ - ListJobsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.ListJobsRequest) - return object; - var message = new $root.google.cloud.batch.v1alpha.ListJobsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListJobsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.ListJobsRequest - * @static - * @param {google.cloud.batch.v1alpha.ListJobsRequest} message ListJobsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListJobsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; - - /** - * Converts this ListJobsRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.ListJobsRequest - * @instance - * @returns {Object.} JSON object - */ - ListJobsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListJobsRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.ListJobsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListJobsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.ListJobsRequest"; - }; - - return ListJobsRequest; - })(); - - v1alpha.ListJobsResponse = (function() { - - /** - * Properties of a ListJobsResponse. - * @memberof google.cloud.batch.v1alpha - * @interface IListJobsResponse - * @property {Array.|null} [jobs] ListJobsResponse jobs - * @property {string|null} [nextPageToken] ListJobsResponse nextPageToken - * @property {Array.|null} [unreachable] ListJobsResponse unreachable - */ - - /** - * Constructs a new ListJobsResponse. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a ListJobsResponse. - * @implements IListJobsResponse - * @constructor - * @param {google.cloud.batch.v1alpha.IListJobsResponse=} [properties] Properties to set - */ - function ListJobsResponse(properties) { - this.jobs = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListJobsResponse jobs. - * @member {Array.} jobs - * @memberof google.cloud.batch.v1alpha.ListJobsResponse - * @instance - */ - ListJobsResponse.prototype.jobs = $util.emptyArray; - - /** - * ListJobsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.batch.v1alpha.ListJobsResponse - * @instance - */ - ListJobsResponse.prototype.nextPageToken = ""; - - /** - * ListJobsResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.batch.v1alpha.ListJobsResponse - * @instance - */ - ListJobsResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListJobsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.ListJobsResponse - * @static - * @param {google.cloud.batch.v1alpha.IListJobsResponse=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.ListJobsResponse} ListJobsResponse instance - */ - ListJobsResponse.create = function create(properties) { - return new ListJobsResponse(properties); - }; - - /** - * Encodes the specified ListJobsResponse message. Does not implicitly {@link google.cloud.batch.v1alpha.ListJobsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.ListJobsResponse - * @static - * @param {google.cloud.batch.v1alpha.IListJobsResponse} message ListJobsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListJobsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.jobs != null && message.jobs.length) - for (var i = 0; i < message.jobs.length; ++i) - $root.google.cloud.batch.v1alpha.Job.encode(message.jobs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; - - /** - * Encodes the specified ListJobsResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListJobsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.ListJobsResponse - * @static - * @param {google.cloud.batch.v1alpha.IListJobsResponse} message ListJobsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListJobsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListJobsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.ListJobsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.ListJobsResponse} ListJobsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListJobsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ListJobsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.jobs && message.jobs.length)) - message.jobs = []; - message.jobs.push($root.google.cloud.batch.v1alpha.Job.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListJobsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.ListJobsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.ListJobsResponse} ListJobsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListJobsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListJobsResponse message. - * @function verify - * @memberof google.cloud.batch.v1alpha.ListJobsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListJobsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.jobs != null && message.hasOwnProperty("jobs")) { - if (!Array.isArray(message.jobs)) - return "jobs: array expected"; - for (var i = 0; i < message.jobs.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.Job.verify(message.jobs[i]); - if (error) - return "jobs." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; - - /** - * Creates a ListJobsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.ListJobsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.ListJobsResponse} ListJobsResponse - */ - ListJobsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.ListJobsResponse) - return object; - var message = new $root.google.cloud.batch.v1alpha.ListJobsResponse(); - if (object.jobs) { - if (!Array.isArray(object.jobs)) - throw TypeError(".google.cloud.batch.v1alpha.ListJobsResponse.jobs: array expected"); - message.jobs = []; - for (var i = 0; i < object.jobs.length; ++i) { - if (typeof object.jobs[i] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.ListJobsResponse.jobs: object expected"); - message.jobs[i] = $root.google.cloud.batch.v1alpha.Job.fromObject(object.jobs[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.batch.v1alpha.ListJobsResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListJobsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.ListJobsResponse - * @static - * @param {google.cloud.batch.v1alpha.ListJobsResponse} message ListJobsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListJobsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.jobs = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.jobs && message.jobs.length) { - object.jobs = []; - for (var j = 0; j < message.jobs.length; ++j) - object.jobs[j] = $root.google.cloud.batch.v1alpha.Job.toObject(message.jobs[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; - - /** - * Converts this ListJobsResponse to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.ListJobsResponse - * @instance - * @returns {Object.} JSON object - */ - ListJobsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListJobsResponse - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.ListJobsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListJobsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.ListJobsResponse"; - }; - - return ListJobsResponse; - })(); - - v1alpha.ListTasksRequest = (function() { - - /** - * Properties of a ListTasksRequest. - * @memberof google.cloud.batch.v1alpha - * @interface IListTasksRequest - * @property {string|null} [parent] ListTasksRequest parent - * @property {string|null} [filter] ListTasksRequest filter - * @property {string|null} [orderBy] ListTasksRequest orderBy - * @property {number|null} [pageSize] ListTasksRequest pageSize - * @property {string|null} [pageToken] ListTasksRequest pageToken - */ - - /** - * Constructs a new ListTasksRequest. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a ListTasksRequest. - * @implements IListTasksRequest - * @constructor - * @param {google.cloud.batch.v1alpha.IListTasksRequest=} [properties] Properties to set - */ - function ListTasksRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListTasksRequest parent. - * @member {string} parent - * @memberof google.cloud.batch.v1alpha.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.parent = ""; - - /** - * ListTasksRequest filter. - * @member {string} filter - * @memberof google.cloud.batch.v1alpha.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.filter = ""; - - /** - * ListTasksRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.batch.v1alpha.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.orderBy = ""; - - /** - * ListTasksRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.batch.v1alpha.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.pageSize = 0; - - /** - * ListTasksRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.batch.v1alpha.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.pageToken = ""; - - /** - * Creates a new ListTasksRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.ListTasksRequest - * @static - * @param {google.cloud.batch.v1alpha.IListTasksRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.ListTasksRequest} ListTasksRequest instance - */ - ListTasksRequest.create = function create(properties) { - return new ListTasksRequest(properties); - }; - - /** - * Encodes the specified ListTasksRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.ListTasksRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.ListTasksRequest - * @static - * @param {google.cloud.batch.v1alpha.IListTasksRequest} message ListTasksRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTasksRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; - - /** - * Encodes the specified ListTasksRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListTasksRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.ListTasksRequest - * @static - * @param {google.cloud.batch.v1alpha.IListTasksRequest} message ListTasksRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTasksRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListTasksRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.ListTasksRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.ListTasksRequest} ListTasksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTasksRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ListTasksRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListTasksRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.ListTasksRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.ListTasksRequest} ListTasksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTasksRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListTasksRequest message. - * @function verify - * @memberof google.cloud.batch.v1alpha.ListTasksRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListTasksRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListTasksRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.ListTasksRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.ListTasksRequest} ListTasksRequest - */ - ListTasksRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.ListTasksRequest) - return object; - var message = new $root.google.cloud.batch.v1alpha.ListTasksRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListTasksRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.ListTasksRequest - * @static - * @param {google.cloud.batch.v1alpha.ListTasksRequest} message ListTasksRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListTasksRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; - - /** - * Converts this ListTasksRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.ListTasksRequest - * @instance - * @returns {Object.} JSON object - */ - ListTasksRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListTasksRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.ListTasksRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListTasksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.ListTasksRequest"; - }; - - return ListTasksRequest; - })(); - - v1alpha.ListTasksResponse = (function() { - - /** - * Properties of a ListTasksResponse. - * @memberof google.cloud.batch.v1alpha - * @interface IListTasksResponse - * @property {Array.|null} [tasks] ListTasksResponse tasks - * @property {string|null} [nextPageToken] ListTasksResponse nextPageToken - * @property {Array.|null} [unreachable] ListTasksResponse unreachable - */ - - /** - * Constructs a new ListTasksResponse. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a ListTasksResponse. - * @implements IListTasksResponse - * @constructor - * @param {google.cloud.batch.v1alpha.IListTasksResponse=} [properties] Properties to set - */ - function ListTasksResponse(properties) { - this.tasks = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListTasksResponse tasks. - * @member {Array.} tasks - * @memberof google.cloud.batch.v1alpha.ListTasksResponse - * @instance - */ - ListTasksResponse.prototype.tasks = $util.emptyArray; - - /** - * ListTasksResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.batch.v1alpha.ListTasksResponse - * @instance - */ - ListTasksResponse.prototype.nextPageToken = ""; - - /** - * ListTasksResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.batch.v1alpha.ListTasksResponse - * @instance - */ - ListTasksResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListTasksResponse instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.ListTasksResponse - * @static - * @param {google.cloud.batch.v1alpha.IListTasksResponse=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.ListTasksResponse} ListTasksResponse instance - */ - ListTasksResponse.create = function create(properties) { - return new ListTasksResponse(properties); - }; - - /** - * Encodes the specified ListTasksResponse message. Does not implicitly {@link google.cloud.batch.v1alpha.ListTasksResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.ListTasksResponse - * @static - * @param {google.cloud.batch.v1alpha.IListTasksResponse} message ListTasksResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTasksResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tasks != null && message.tasks.length) - for (var i = 0; i < message.tasks.length; ++i) - $root.google.cloud.batch.v1alpha.Task.encode(message.tasks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; - - /** - * Encodes the specified ListTasksResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListTasksResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.ListTasksResponse - * @static - * @param {google.cloud.batch.v1alpha.IListTasksResponse} message ListTasksResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTasksResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListTasksResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.ListTasksResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.ListTasksResponse} ListTasksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTasksResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ListTasksResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.tasks && message.tasks.length)) - message.tasks = []; - message.tasks.push($root.google.cloud.batch.v1alpha.Task.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListTasksResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.ListTasksResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.ListTasksResponse} ListTasksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTasksResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListTasksResponse message. - * @function verify - * @memberof google.cloud.batch.v1alpha.ListTasksResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListTasksResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tasks != null && message.hasOwnProperty("tasks")) { - if (!Array.isArray(message.tasks)) - return "tasks: array expected"; - for (var i = 0; i < message.tasks.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.Task.verify(message.tasks[i]); - if (error) - return "tasks." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; - - /** - * Creates a ListTasksResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.ListTasksResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.ListTasksResponse} ListTasksResponse - */ - ListTasksResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.ListTasksResponse) - return object; - var message = new $root.google.cloud.batch.v1alpha.ListTasksResponse(); - if (object.tasks) { - if (!Array.isArray(object.tasks)) - throw TypeError(".google.cloud.batch.v1alpha.ListTasksResponse.tasks: array expected"); - message.tasks = []; - for (var i = 0; i < object.tasks.length; ++i) { - if (typeof object.tasks[i] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.ListTasksResponse.tasks: object expected"); - message.tasks[i] = $root.google.cloud.batch.v1alpha.Task.fromObject(object.tasks[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.batch.v1alpha.ListTasksResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListTasksResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.ListTasksResponse - * @static - * @param {google.cloud.batch.v1alpha.ListTasksResponse} message ListTasksResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListTasksResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.tasks = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.tasks && message.tasks.length) { - object.tasks = []; - for (var j = 0; j < message.tasks.length; ++j) - object.tasks[j] = $root.google.cloud.batch.v1alpha.Task.toObject(message.tasks[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; - - /** - * Converts this ListTasksResponse to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.ListTasksResponse - * @instance - * @returns {Object.} JSON object - */ - ListTasksResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListTasksResponse - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.ListTasksResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListTasksResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.ListTasksResponse"; - }; - - return ListTasksResponse; - })(); - - v1alpha.GetTaskRequest = (function() { - - /** - * Properties of a GetTaskRequest. - * @memberof google.cloud.batch.v1alpha - * @interface IGetTaskRequest - * @property {string|null} [name] GetTaskRequest name - */ - - /** - * Constructs a new GetTaskRequest. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a GetTaskRequest. - * @implements IGetTaskRequest - * @constructor - * @param {google.cloud.batch.v1alpha.IGetTaskRequest=} [properties] Properties to set - */ - function GetTaskRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTaskRequest name. - * @member {string} name - * @memberof google.cloud.batch.v1alpha.GetTaskRequest - * @instance - */ - GetTaskRequest.prototype.name = ""; - - /** - * Creates a new GetTaskRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.GetTaskRequest - * @static - * @param {google.cloud.batch.v1alpha.IGetTaskRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.GetTaskRequest} GetTaskRequest instance - */ - GetTaskRequest.create = function create(properties) { - return new GetTaskRequest(properties); - }; - - /** - * Encodes the specified GetTaskRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.GetTaskRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.GetTaskRequest - * @static - * @param {google.cloud.batch.v1alpha.IGetTaskRequest} message GetTaskRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTaskRequest.encode = function encode(message, writer) { - 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 GetTaskRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.GetTaskRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.GetTaskRequest - * @static - * @param {google.cloud.batch.v1alpha.IGetTaskRequest} message GetTaskRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTaskRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTaskRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.GetTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.GetTaskRequest} GetTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTaskRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.GetTaskRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTaskRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.GetTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.GetTaskRequest} GetTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTaskRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTaskRequest message. - * @function verify - * @memberof google.cloud.batch.v1alpha.GetTaskRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTaskRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetTaskRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.GetTaskRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.GetTaskRequest} GetTaskRequest - */ - GetTaskRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.GetTaskRequest) - return object; - var message = new $root.google.cloud.batch.v1alpha.GetTaskRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetTaskRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.GetTaskRequest - * @static - * @param {google.cloud.batch.v1alpha.GetTaskRequest} message GetTaskRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTaskRequest.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 GetTaskRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.GetTaskRequest - * @instance - * @returns {Object.} JSON object - */ - GetTaskRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetTaskRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.GetTaskRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetTaskRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.GetTaskRequest"; - }; - - return GetTaskRequest; - })(); - - v1alpha.CreateResourceAllowanceRequest = (function() { - - /** - * Properties of a CreateResourceAllowanceRequest. - * @memberof google.cloud.batch.v1alpha - * @interface ICreateResourceAllowanceRequest - * @property {string|null} [parent] CreateResourceAllowanceRequest parent - * @property {string|null} [resourceAllowanceId] CreateResourceAllowanceRequest resourceAllowanceId - * @property {google.cloud.batch.v1alpha.IResourceAllowance|null} [resourceAllowance] CreateResourceAllowanceRequest resourceAllowance - * @property {string|null} [requestId] CreateResourceAllowanceRequest requestId - */ - - /** - * Constructs a new CreateResourceAllowanceRequest. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a CreateResourceAllowanceRequest. - * @implements ICreateResourceAllowanceRequest - * @constructor - * @param {google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest=} [properties] Properties to set - */ - function CreateResourceAllowanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateResourceAllowanceRequest parent. - * @member {string} parent - * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest - * @instance - */ - CreateResourceAllowanceRequest.prototype.parent = ""; - - /** - * CreateResourceAllowanceRequest resourceAllowanceId. - * @member {string} resourceAllowanceId - * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest - * @instance - */ - CreateResourceAllowanceRequest.prototype.resourceAllowanceId = ""; - - /** - * CreateResourceAllowanceRequest resourceAllowance. - * @member {google.cloud.batch.v1alpha.IResourceAllowance|null|undefined} resourceAllowance - * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest - * @instance - */ - CreateResourceAllowanceRequest.prototype.resourceAllowance = null; - - /** - * CreateResourceAllowanceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest - * @instance - */ - CreateResourceAllowanceRequest.prototype.requestId = ""; - - /** - * Creates a new CreateResourceAllowanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest - * @static - * @param {google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.CreateResourceAllowanceRequest} CreateResourceAllowanceRequest instance - */ - CreateResourceAllowanceRequest.create = function create(properties) { - return new CreateResourceAllowanceRequest(properties); - }; - - /** - * Encodes the specified CreateResourceAllowanceRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.CreateResourceAllowanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest - * @static - * @param {google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest} message CreateResourceAllowanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateResourceAllowanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.resourceAllowanceId != null && Object.hasOwnProperty.call(message, "resourceAllowanceId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceAllowanceId); - if (message.resourceAllowance != null && Object.hasOwnProperty.call(message, "resourceAllowance")) - $root.google.cloud.batch.v1alpha.ResourceAllowance.encode(message.resourceAllowance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified CreateResourceAllowanceRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.CreateResourceAllowanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest - * @static - * @param {google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest} message CreateResourceAllowanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateResourceAllowanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateResourceAllowanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.CreateResourceAllowanceRequest} CreateResourceAllowanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateResourceAllowanceRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.resourceAllowanceId = reader.string(); - break; - } - case 3: { - message.resourceAllowance = $root.google.cloud.batch.v1alpha.ResourceAllowance.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateResourceAllowanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.CreateResourceAllowanceRequest} CreateResourceAllowanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateResourceAllowanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateResourceAllowanceRequest message. - * @function verify - * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateResourceAllowanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.resourceAllowanceId != null && message.hasOwnProperty("resourceAllowanceId")) - if (!$util.isString(message.resourceAllowanceId)) - return "resourceAllowanceId: string expected"; - if (message.resourceAllowance != null && message.hasOwnProperty("resourceAllowance")) { - var error = $root.google.cloud.batch.v1alpha.ResourceAllowance.verify(message.resourceAllowance); - if (error) - return "resourceAllowance." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a CreateResourceAllowanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.CreateResourceAllowanceRequest} CreateResourceAllowanceRequest - */ - CreateResourceAllowanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest) - return object; - var message = new $root.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.resourceAllowanceId != null) - message.resourceAllowanceId = String(object.resourceAllowanceId); - if (object.resourceAllowance != null) { - if (typeof object.resourceAllowance !== "object") - throw TypeError(".google.cloud.batch.v1alpha.CreateResourceAllowanceRequest.resourceAllowance: object expected"); - message.resourceAllowance = $root.google.cloud.batch.v1alpha.ResourceAllowance.fromObject(object.resourceAllowance); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a CreateResourceAllowanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest - * @static - * @param {google.cloud.batch.v1alpha.CreateResourceAllowanceRequest} message CreateResourceAllowanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateResourceAllowanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.resourceAllowanceId = ""; - object.resourceAllowance = null; - object.requestId = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.resourceAllowanceId != null && message.hasOwnProperty("resourceAllowanceId")) - object.resourceAllowanceId = message.resourceAllowanceId; - if (message.resourceAllowance != null && message.hasOwnProperty("resourceAllowance")) - object.resourceAllowance = $root.google.cloud.batch.v1alpha.ResourceAllowance.toObject(message.resourceAllowance, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this CreateResourceAllowanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest - * @instance - * @returns {Object.} JSON object - */ - CreateResourceAllowanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateResourceAllowanceRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.CreateResourceAllowanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateResourceAllowanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.CreateResourceAllowanceRequest"; - }; - - return CreateResourceAllowanceRequest; - })(); - - v1alpha.GetResourceAllowanceRequest = (function() { - - /** - * Properties of a GetResourceAllowanceRequest. - * @memberof google.cloud.batch.v1alpha - * @interface IGetResourceAllowanceRequest - * @property {string|null} [name] GetResourceAllowanceRequest name - */ - - /** - * Constructs a new GetResourceAllowanceRequest. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a GetResourceAllowanceRequest. - * @implements IGetResourceAllowanceRequest - * @constructor - * @param {google.cloud.batch.v1alpha.IGetResourceAllowanceRequest=} [properties] Properties to set - */ - function GetResourceAllowanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetResourceAllowanceRequest name. - * @member {string} name - * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest - * @instance - */ - GetResourceAllowanceRequest.prototype.name = ""; - - /** - * Creates a new GetResourceAllowanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest - * @static - * @param {google.cloud.batch.v1alpha.IGetResourceAllowanceRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.GetResourceAllowanceRequest} GetResourceAllowanceRequest instance - */ - GetResourceAllowanceRequest.create = function create(properties) { - return new GetResourceAllowanceRequest(properties); - }; - - /** - * Encodes the specified GetResourceAllowanceRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.GetResourceAllowanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest - * @static - * @param {google.cloud.batch.v1alpha.IGetResourceAllowanceRequest} message GetResourceAllowanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetResourceAllowanceRequest.encode = function encode(message, writer) { - 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 GetResourceAllowanceRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.GetResourceAllowanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest - * @static - * @param {google.cloud.batch.v1alpha.IGetResourceAllowanceRequest} message GetResourceAllowanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetResourceAllowanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetResourceAllowanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.GetResourceAllowanceRequest} GetResourceAllowanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetResourceAllowanceRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.GetResourceAllowanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetResourceAllowanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.GetResourceAllowanceRequest} GetResourceAllowanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetResourceAllowanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetResourceAllowanceRequest message. - * @function verify - * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetResourceAllowanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetResourceAllowanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.GetResourceAllowanceRequest} GetResourceAllowanceRequest - */ - GetResourceAllowanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.GetResourceAllowanceRequest) - return object; - var message = new $root.google.cloud.batch.v1alpha.GetResourceAllowanceRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetResourceAllowanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest - * @static - * @param {google.cloud.batch.v1alpha.GetResourceAllowanceRequest} message GetResourceAllowanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetResourceAllowanceRequest.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 GetResourceAllowanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest - * @instance - * @returns {Object.} JSON object - */ - GetResourceAllowanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetResourceAllowanceRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.GetResourceAllowanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetResourceAllowanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.GetResourceAllowanceRequest"; - }; - - return GetResourceAllowanceRequest; - })(); - - v1alpha.DeleteResourceAllowanceRequest = (function() { - - /** - * Properties of a DeleteResourceAllowanceRequest. - * @memberof google.cloud.batch.v1alpha - * @interface IDeleteResourceAllowanceRequest - * @property {string|null} [name] DeleteResourceAllowanceRequest name - * @property {string|null} [reason] DeleteResourceAllowanceRequest reason - * @property {string|null} [requestId] DeleteResourceAllowanceRequest requestId - */ - - /** - * Constructs a new DeleteResourceAllowanceRequest. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a DeleteResourceAllowanceRequest. - * @implements IDeleteResourceAllowanceRequest - * @constructor - * @param {google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest=} [properties] Properties to set - */ - function DeleteResourceAllowanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteResourceAllowanceRequest name. - * @member {string} name - * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest - * @instance - */ - DeleteResourceAllowanceRequest.prototype.name = ""; - - /** - * DeleteResourceAllowanceRequest reason. - * @member {string} reason - * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest - * @instance - */ - DeleteResourceAllowanceRequest.prototype.reason = ""; - - /** - * DeleteResourceAllowanceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest - * @instance - */ - DeleteResourceAllowanceRequest.prototype.requestId = ""; - - /** - * Creates a new DeleteResourceAllowanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest - * @static - * @param {google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest} DeleteResourceAllowanceRequest instance - */ - DeleteResourceAllowanceRequest.create = function create(properties) { - return new DeleteResourceAllowanceRequest(properties); - }; - - /** - * Encodes the specified DeleteResourceAllowanceRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest - * @static - * @param {google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest} message DeleteResourceAllowanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteResourceAllowanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.reason); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified DeleteResourceAllowanceRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest - * @static - * @param {google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest} message DeleteResourceAllowanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteResourceAllowanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteResourceAllowanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest} DeleteResourceAllowanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteResourceAllowanceRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.reason = reader.string(); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteResourceAllowanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest} DeleteResourceAllowanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteResourceAllowanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteResourceAllowanceRequest message. - * @function verify - * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteResourceAllowanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.reason != null && message.hasOwnProperty("reason")) - if (!$util.isString(message.reason)) - return "reason: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a DeleteResourceAllowanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest} DeleteResourceAllowanceRequest - */ - DeleteResourceAllowanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest) - return object; - var message = new $root.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.reason != null) - message.reason = String(object.reason); - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a DeleteResourceAllowanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest - * @static - * @param {google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest} message DeleteResourceAllowanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteResourceAllowanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.reason = ""; - object.requestId = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.reason != null && message.hasOwnProperty("reason")) - object.reason = message.reason; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this DeleteResourceAllowanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteResourceAllowanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteResourceAllowanceRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteResourceAllowanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest"; - }; - - return DeleteResourceAllowanceRequest; - })(); - - v1alpha.ListResourceAllowancesRequest = (function() { - - /** - * Properties of a ListResourceAllowancesRequest. - * @memberof google.cloud.batch.v1alpha - * @interface IListResourceAllowancesRequest - * @property {string|null} [parent] ListResourceAllowancesRequest parent - * @property {number|null} [pageSize] ListResourceAllowancesRequest pageSize - * @property {string|null} [pageToken] ListResourceAllowancesRequest pageToken - */ - - /** - * Constructs a new ListResourceAllowancesRequest. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a ListResourceAllowancesRequest. - * @implements IListResourceAllowancesRequest - * @constructor - * @param {google.cloud.batch.v1alpha.IListResourceAllowancesRequest=} [properties] Properties to set - */ - function ListResourceAllowancesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListResourceAllowancesRequest parent. - * @member {string} parent - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest - * @instance - */ - ListResourceAllowancesRequest.prototype.parent = ""; - - /** - * ListResourceAllowancesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest - * @instance - */ - ListResourceAllowancesRequest.prototype.pageSize = 0; - - /** - * ListResourceAllowancesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest - * @instance - */ - ListResourceAllowancesRequest.prototype.pageToken = ""; - - /** - * Creates a new ListResourceAllowancesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest - * @static - * @param {google.cloud.batch.v1alpha.IListResourceAllowancesRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.ListResourceAllowancesRequest} ListResourceAllowancesRequest instance - */ - ListResourceAllowancesRequest.create = function create(properties) { - return new ListResourceAllowancesRequest(properties); - }; - - /** - * Encodes the specified ListResourceAllowancesRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.ListResourceAllowancesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest - * @static - * @param {google.cloud.batch.v1alpha.IListResourceAllowancesRequest} message ListResourceAllowancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListResourceAllowancesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListResourceAllowancesRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListResourceAllowancesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest - * @static - * @param {google.cloud.batch.v1alpha.IListResourceAllowancesRequest} message ListResourceAllowancesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListResourceAllowancesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListResourceAllowancesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.ListResourceAllowancesRequest} ListResourceAllowancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListResourceAllowancesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ListResourceAllowancesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListResourceAllowancesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.ListResourceAllowancesRequest} ListResourceAllowancesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListResourceAllowancesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListResourceAllowancesRequest message. - * @function verify - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListResourceAllowancesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListResourceAllowancesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.ListResourceAllowancesRequest} ListResourceAllowancesRequest - */ - ListResourceAllowancesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.ListResourceAllowancesRequest) - return object; - var message = new $root.google.cloud.batch.v1alpha.ListResourceAllowancesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListResourceAllowancesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest - * @static - * @param {google.cloud.batch.v1alpha.ListResourceAllowancesRequest} message ListResourceAllowancesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListResourceAllowancesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListResourceAllowancesRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest - * @instance - * @returns {Object.} JSON object - */ - ListResourceAllowancesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListResourceAllowancesRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListResourceAllowancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.ListResourceAllowancesRequest"; - }; - - return ListResourceAllowancesRequest; - })(); - - v1alpha.ListResourceAllowancesResponse = (function() { - - /** - * Properties of a ListResourceAllowancesResponse. - * @memberof google.cloud.batch.v1alpha - * @interface IListResourceAllowancesResponse - * @property {Array.|null} [resourceAllowances] ListResourceAllowancesResponse resourceAllowances - * @property {string|null} [nextPageToken] ListResourceAllowancesResponse nextPageToken - * @property {Array.|null} [unreachable] ListResourceAllowancesResponse unreachable - */ - - /** - * Constructs a new ListResourceAllowancesResponse. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a ListResourceAllowancesResponse. - * @implements IListResourceAllowancesResponse - * @constructor - * @param {google.cloud.batch.v1alpha.IListResourceAllowancesResponse=} [properties] Properties to set - */ - function ListResourceAllowancesResponse(properties) { - this.resourceAllowances = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListResourceAllowancesResponse resourceAllowances. - * @member {Array.} resourceAllowances - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse - * @instance - */ - ListResourceAllowancesResponse.prototype.resourceAllowances = $util.emptyArray; - - /** - * ListResourceAllowancesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse - * @instance - */ - ListResourceAllowancesResponse.prototype.nextPageToken = ""; - - /** - * ListResourceAllowancesResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse - * @instance - */ - ListResourceAllowancesResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListResourceAllowancesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse - * @static - * @param {google.cloud.batch.v1alpha.IListResourceAllowancesResponse=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.ListResourceAllowancesResponse} ListResourceAllowancesResponse instance - */ - ListResourceAllowancesResponse.create = function create(properties) { - return new ListResourceAllowancesResponse(properties); - }; - - /** - * Encodes the specified ListResourceAllowancesResponse message. Does not implicitly {@link google.cloud.batch.v1alpha.ListResourceAllowancesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse - * @static - * @param {google.cloud.batch.v1alpha.IListResourceAllowancesResponse} message ListResourceAllowancesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListResourceAllowancesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resourceAllowances != null && message.resourceAllowances.length) - for (var i = 0; i < message.resourceAllowances.length; ++i) - $root.google.cloud.batch.v1alpha.ResourceAllowance.encode(message.resourceAllowances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; - - /** - * Encodes the specified ListResourceAllowancesResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ListResourceAllowancesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse - * @static - * @param {google.cloud.batch.v1alpha.IListResourceAllowancesResponse} message ListResourceAllowancesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListResourceAllowancesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListResourceAllowancesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.ListResourceAllowancesResponse} ListResourceAllowancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListResourceAllowancesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ListResourceAllowancesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.resourceAllowances && message.resourceAllowances.length)) - message.resourceAllowances = []; - message.resourceAllowances.push($root.google.cloud.batch.v1alpha.ResourceAllowance.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListResourceAllowancesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.ListResourceAllowancesResponse} ListResourceAllowancesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListResourceAllowancesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListResourceAllowancesResponse message. - * @function verify - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListResourceAllowancesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resourceAllowances != null && message.hasOwnProperty("resourceAllowances")) { - if (!Array.isArray(message.resourceAllowances)) - return "resourceAllowances: array expected"; - for (var i = 0; i < message.resourceAllowances.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.ResourceAllowance.verify(message.resourceAllowances[i]); - if (error) - return "resourceAllowances." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; - - /** - * Creates a ListResourceAllowancesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.ListResourceAllowancesResponse} ListResourceAllowancesResponse - */ - ListResourceAllowancesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.ListResourceAllowancesResponse) - return object; - var message = new $root.google.cloud.batch.v1alpha.ListResourceAllowancesResponse(); - if (object.resourceAllowances) { - if (!Array.isArray(object.resourceAllowances)) - throw TypeError(".google.cloud.batch.v1alpha.ListResourceAllowancesResponse.resourceAllowances: array expected"); - message.resourceAllowances = []; - for (var i = 0; i < object.resourceAllowances.length; ++i) { - if (typeof object.resourceAllowances[i] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.ListResourceAllowancesResponse.resourceAllowances: object expected"); - message.resourceAllowances[i] = $root.google.cloud.batch.v1alpha.ResourceAllowance.fromObject(object.resourceAllowances[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.batch.v1alpha.ListResourceAllowancesResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListResourceAllowancesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse - * @static - * @param {google.cloud.batch.v1alpha.ListResourceAllowancesResponse} message ListResourceAllowancesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListResourceAllowancesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.resourceAllowances = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.resourceAllowances && message.resourceAllowances.length) { - object.resourceAllowances = []; - for (var j = 0; j < message.resourceAllowances.length; ++j) - object.resourceAllowances[j] = $root.google.cloud.batch.v1alpha.ResourceAllowance.toObject(message.resourceAllowances[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; - - /** - * Converts this ListResourceAllowancesResponse to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse - * @instance - * @returns {Object.} JSON object - */ - ListResourceAllowancesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListResourceAllowancesResponse - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.ListResourceAllowancesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListResourceAllowancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.ListResourceAllowancesResponse"; - }; - - return ListResourceAllowancesResponse; - })(); - - v1alpha.UpdateResourceAllowanceRequest = (function() { - - /** - * Properties of an UpdateResourceAllowanceRequest. - * @memberof google.cloud.batch.v1alpha - * @interface IUpdateResourceAllowanceRequest - * @property {google.cloud.batch.v1alpha.IResourceAllowance|null} [resourceAllowance] UpdateResourceAllowanceRequest resourceAllowance - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateResourceAllowanceRequest updateMask - * @property {string|null} [requestId] UpdateResourceAllowanceRequest requestId - */ - - /** - * Constructs a new UpdateResourceAllowanceRequest. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents an UpdateResourceAllowanceRequest. - * @implements IUpdateResourceAllowanceRequest - * @constructor - * @param {google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest=} [properties] Properties to set - */ - function UpdateResourceAllowanceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateResourceAllowanceRequest resourceAllowance. - * @member {google.cloud.batch.v1alpha.IResourceAllowance|null|undefined} resourceAllowance - * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest - * @instance - */ - UpdateResourceAllowanceRequest.prototype.resourceAllowance = null; - - /** - * UpdateResourceAllowanceRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest - * @instance - */ - UpdateResourceAllowanceRequest.prototype.updateMask = null; - - /** - * UpdateResourceAllowanceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest - * @instance - */ - UpdateResourceAllowanceRequest.prototype.requestId = ""; - - /** - * Creates a new UpdateResourceAllowanceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest - * @static - * @param {google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest} UpdateResourceAllowanceRequest instance - */ - UpdateResourceAllowanceRequest.create = function create(properties) { - return new UpdateResourceAllowanceRequest(properties); - }; - - /** - * Encodes the specified UpdateResourceAllowanceRequest message. Does not implicitly {@link google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest - * @static - * @param {google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest} message UpdateResourceAllowanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateResourceAllowanceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resourceAllowance != null && Object.hasOwnProperty.call(message, "resourceAllowance")) - $root.google.cloud.batch.v1alpha.ResourceAllowance.encode(message.resourceAllowance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified UpdateResourceAllowanceRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest - * @static - * @param {google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest} message UpdateResourceAllowanceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateResourceAllowanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateResourceAllowanceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest} UpdateResourceAllowanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateResourceAllowanceRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.resourceAllowance = $root.google.cloud.batch.v1alpha.ResourceAllowance.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateResourceAllowanceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest} UpdateResourceAllowanceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateResourceAllowanceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateResourceAllowanceRequest message. - * @function verify - * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateResourceAllowanceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resourceAllowance != null && message.hasOwnProperty("resourceAllowance")) { - var error = $root.google.cloud.batch.v1alpha.ResourceAllowance.verify(message.resourceAllowance); - if (error) - return "resourceAllowance." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates an UpdateResourceAllowanceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest} UpdateResourceAllowanceRequest - */ - UpdateResourceAllowanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest) - return object; - var message = new $root.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest(); - if (object.resourceAllowance != null) { - if (typeof object.resourceAllowance !== "object") - throw TypeError(".google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest.resourceAllowance: object expected"); - message.resourceAllowance = $root.google.cloud.batch.v1alpha.ResourceAllowance.fromObject(object.resourceAllowance); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from an UpdateResourceAllowanceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest - * @static - * @param {google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest} message UpdateResourceAllowanceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateResourceAllowanceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.resourceAllowance = null; - object.updateMask = null; - object.requestId = ""; - } - if (message.resourceAllowance != null && message.hasOwnProperty("resourceAllowance")) - object.resourceAllowance = $root.google.cloud.batch.v1alpha.ResourceAllowance.toObject(message.resourceAllowance, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this UpdateResourceAllowanceRequest to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateResourceAllowanceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateResourceAllowanceRequest - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateResourceAllowanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest"; - }; - - return UpdateResourceAllowanceRequest; - })(); - - v1alpha.OperationMetadata = (function() { - - /** - * Properties of an OperationMetadata. - * @memberof google.cloud.batch.v1alpha - * @interface IOperationMetadata - * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime - * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime - * @property {string|null} [target] OperationMetadata target - * @property {string|null} [verb] OperationMetadata verb - * @property {string|null} [statusMessage] OperationMetadata statusMessage - * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation - * @property {string|null} [apiVersion] OperationMetadata apiVersion - */ - - /** - * Constructs a new OperationMetadata. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents an OperationMetadata. - * @implements IOperationMetadata - * @constructor - * @param {google.cloud.batch.v1alpha.IOperationMetadata=} [properties] Properties to set - */ - function OperationMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OperationMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.batch.v1alpha.OperationMetadata - * @instance - */ - OperationMetadata.prototype.createTime = null; - - /** - * OperationMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.batch.v1alpha.OperationMetadata - * @instance - */ - OperationMetadata.prototype.endTime = null; - - /** - * OperationMetadata target. - * @member {string} target - * @memberof google.cloud.batch.v1alpha.OperationMetadata - * @instance - */ - OperationMetadata.prototype.target = ""; - - /** - * OperationMetadata verb. - * @member {string} verb - * @memberof google.cloud.batch.v1alpha.OperationMetadata - * @instance - */ - OperationMetadata.prototype.verb = ""; - - /** - * OperationMetadata statusMessage. - * @member {string} statusMessage - * @memberof google.cloud.batch.v1alpha.OperationMetadata - * @instance - */ - OperationMetadata.prototype.statusMessage = ""; - - /** - * OperationMetadata requestedCancellation. - * @member {boolean} requestedCancellation - * @memberof google.cloud.batch.v1alpha.OperationMetadata - * @instance - */ - OperationMetadata.prototype.requestedCancellation = false; - - /** - * OperationMetadata apiVersion. - * @member {string} apiVersion - * @memberof google.cloud.batch.v1alpha.OperationMetadata - * @instance - */ - OperationMetadata.prototype.apiVersion = ""; - - /** - * Creates a new OperationMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.OperationMetadata - * @static - * @param {google.cloud.batch.v1alpha.IOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.OperationMetadata} OperationMetadata instance - */ - OperationMetadata.create = function create(properties) { - return new OperationMetadata(properties); - }; - - /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.batch.v1alpha.OperationMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.OperationMetadata - * @static - * @param {google.cloud.batch.v1alpha.IOperationMetadata} message OperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, 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.target != null && Object.hasOwnProperty.call(message, "target")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); - if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); - if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); - if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); - if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); - return writer; - }; - - /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.OperationMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.OperationMetadata - * @static - * @param {google.cloud.batch.v1alpha.IOperationMetadata} message OperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.OperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.OperationMetadata} OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationMetadata.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.OperationMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.target = reader.string(); - break; - } - case 4: { - message.verb = reader.string(); - break; - } - case 5: { - message.statusMessage = reader.string(); - break; - } - case 6: { - message.requestedCancellation = reader.bool(); - break; - } - case 7: { - message.apiVersion = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.OperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.OperationMetadata} OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OperationMetadata message. - * @function verify - * @memberof google.cloud.batch.v1alpha.OperationMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OperationMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - if (message.target != null && message.hasOwnProperty("target")) - if (!$util.isString(message.target)) - return "target: string expected"; - if (message.verb != null && message.hasOwnProperty("verb")) - if (!$util.isString(message.verb)) - return "verb: string expected"; - if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) - if (!$util.isString(message.statusMessage)) - return "statusMessage: string expected"; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - if (typeof message.requestedCancellation !== "boolean") - return "requestedCancellation: boolean expected"; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - if (!$util.isString(message.apiVersion)) - return "apiVersion: string expected"; - return null; - }; - - /** - * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.OperationMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.OperationMetadata} OperationMetadata - */ - OperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.OperationMetadata) - return object; - var message = new $root.google.cloud.batch.v1alpha.OperationMetadata(); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.batch.v1alpha.OperationMetadata.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.batch.v1alpha.OperationMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.target != null) - message.target = String(object.target); - if (object.verb != null) - message.verb = String(object.verb); - if (object.statusMessage != null) - message.statusMessage = String(object.statusMessage); - if (object.requestedCancellation != null) - message.requestedCancellation = Boolean(object.requestedCancellation); - if (object.apiVersion != null) - message.apiVersion = String(object.apiVersion); - return message; - }; - - /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.OperationMetadata - * @static - * @param {google.cloud.batch.v1alpha.OperationMetadata} message OperationMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OperationMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.createTime = null; - object.endTime = null; - object.target = ""; - object.verb = ""; - object.statusMessage = ""; - object.requestedCancellation = false; - object.apiVersion = ""; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.target != null && message.hasOwnProperty("target")) - object.target = message.target; - if (message.verb != null && message.hasOwnProperty("verb")) - object.verb = message.verb; - if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) - object.statusMessage = message.statusMessage; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - object.requestedCancellation = message.requestedCancellation; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - object.apiVersion = message.apiVersion; - return object; - }; - - /** - * Converts this OperationMetadata to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.OperationMetadata - * @instance - * @returns {Object.} JSON object - */ - OperationMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OperationMetadata - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.OperationMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.OperationMetadata"; - }; - - return OperationMetadata; - })(); - - v1alpha.Job = (function() { - - /** - * Properties of a Job. - * @memberof google.cloud.batch.v1alpha - * @interface IJob - * @property {string|null} [name] Job name - * @property {string|null} [uid] Job uid - * @property {number|Long|null} [priority] Job priority - * @property {Array.|null} [taskGroups] Job taskGroups - * @property {google.cloud.batch.v1alpha.Job.SchedulingPolicy|null} [schedulingPolicy] Job schedulingPolicy - * @property {Array.|null} [dependencies] Job dependencies - * @property {google.cloud.batch.v1alpha.IAllocationPolicy|null} [allocationPolicy] Job allocationPolicy - * @property {Object.|null} [labels] Job labels - * @property {google.cloud.batch.v1alpha.IJobStatus|null} [status] Job status - * @property {google.cloud.batch.v1alpha.IJobNotification|null} [notification] Job notification - * @property {google.protobuf.ITimestamp|null} [createTime] Job createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Job updateTime - * @property {google.cloud.batch.v1alpha.ILogsPolicy|null} [logsPolicy] Job logsPolicy - * @property {Array.|null} [notifications] Job notifications - */ - - /** - * Constructs a new Job. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a Job. - * @implements IJob - * @constructor - * @param {google.cloud.batch.v1alpha.IJob=} [properties] Properties to set - */ - function Job(properties) { - this.taskGroups = []; - this.dependencies = []; - this.labels = {}; - this.notifications = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Job name. - * @member {string} name - * @memberof google.cloud.batch.v1alpha.Job - * @instance - */ - Job.prototype.name = ""; - - /** - * Job uid. - * @member {string} uid - * @memberof google.cloud.batch.v1alpha.Job - * @instance - */ - Job.prototype.uid = ""; - - /** - * Job priority. - * @member {number|Long} priority - * @memberof google.cloud.batch.v1alpha.Job - * @instance - */ - Job.prototype.priority = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Job taskGroups. - * @member {Array.} taskGroups - * @memberof google.cloud.batch.v1alpha.Job - * @instance - */ - Job.prototype.taskGroups = $util.emptyArray; - - /** - * Job schedulingPolicy. - * @member {google.cloud.batch.v1alpha.Job.SchedulingPolicy} schedulingPolicy - * @memberof google.cloud.batch.v1alpha.Job - * @instance - */ - Job.prototype.schedulingPolicy = 0; - - /** - * Job dependencies. - * @member {Array.} dependencies - * @memberof google.cloud.batch.v1alpha.Job - * @instance - */ - Job.prototype.dependencies = $util.emptyArray; - - /** - * Job allocationPolicy. - * @member {google.cloud.batch.v1alpha.IAllocationPolicy|null|undefined} allocationPolicy - * @memberof google.cloud.batch.v1alpha.Job - * @instance - */ - Job.prototype.allocationPolicy = null; - - /** - * Job labels. - * @member {Object.} labels - * @memberof google.cloud.batch.v1alpha.Job - * @instance - */ - Job.prototype.labels = $util.emptyObject; - - /** - * Job status. - * @member {google.cloud.batch.v1alpha.IJobStatus|null|undefined} status - * @memberof google.cloud.batch.v1alpha.Job - * @instance - */ - Job.prototype.status = null; - - /** - * Job notification. - * @member {google.cloud.batch.v1alpha.IJobNotification|null|undefined} notification - * @memberof google.cloud.batch.v1alpha.Job - * @instance - */ - Job.prototype.notification = null; - - /** - * Job createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.batch.v1alpha.Job - * @instance - */ - Job.prototype.createTime = null; - - /** - * Job updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.batch.v1alpha.Job - * @instance - */ - Job.prototype.updateTime = null; - - /** - * Job logsPolicy. - * @member {google.cloud.batch.v1alpha.ILogsPolicy|null|undefined} logsPolicy - * @memberof google.cloud.batch.v1alpha.Job - * @instance - */ - Job.prototype.logsPolicy = null; - - /** - * Job notifications. - * @member {Array.} notifications - * @memberof google.cloud.batch.v1alpha.Job - * @instance - */ - Job.prototype.notifications = $util.emptyArray; - - /** - * Creates a new Job instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.Job - * @static - * @param {google.cloud.batch.v1alpha.IJob=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.Job} Job instance - */ - Job.create = function create(properties) { - return new Job(properties); - }; - - /** - * Encodes the specified Job message. Does not implicitly {@link google.cloud.batch.v1alpha.Job.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.Job - * @static - * @param {google.cloud.batch.v1alpha.IJob} message Job message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Job.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); - if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.priority); - if (message.taskGroups != null && message.taskGroups.length) - for (var i = 0; i < message.taskGroups.length; ++i) - $root.google.cloud.batch.v1alpha.TaskGroup.encode(message.taskGroups[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.schedulingPolicy != null && Object.hasOwnProperty.call(message, "schedulingPolicy")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.schedulingPolicy); - if (message.dependencies != null && message.dependencies.length) - for (var i = 0; i < message.dependencies.length; ++i) - $root.google.cloud.batch.v1alpha.JobDependency.encode(message.dependencies[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.allocationPolicy != null && Object.hasOwnProperty.call(message, "allocationPolicy")) - $root.google.cloud.batch.v1alpha.AllocationPolicy.encode(message.allocationPolicy, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.cloud.batch.v1alpha.JobStatus.encode(message.status, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.notification != null && Object.hasOwnProperty.call(message, "notification")) - $root.google.cloud.batch.v1alpha.JobNotification.encode(message.notification, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.logsPolicy != null && Object.hasOwnProperty.call(message, "logsPolicy")) - $root.google.cloud.batch.v1alpha.LogsPolicy.encode(message.logsPolicy, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.notifications != null && message.notifications.length) - for (var i = 0; i < message.notifications.length; ++i) - $root.google.cloud.batch.v1alpha.JobNotification.encode(message.notifications[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Job.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.Job - * @static - * @param {google.cloud.batch.v1alpha.IJob} message Job message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Job.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Job message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.Job - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.Job} Job - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Job.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Job(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.uid = reader.string(); - break; - } - case 3: { - message.priority = reader.int64(); - break; - } - case 4: { - if (!(message.taskGroups && message.taskGroups.length)) - message.taskGroups = []; - message.taskGroups.push($root.google.cloud.batch.v1alpha.TaskGroup.decode(reader, reader.uint32())); - break; - } - case 5: { - message.schedulingPolicy = reader.int32(); - break; - } - case 6: { - if (!(message.dependencies && message.dependencies.length)) - message.dependencies = []; - message.dependencies.push($root.google.cloud.batch.v1alpha.JobDependency.decode(reader, reader.uint32())); - break; - } - case 7: { - message.allocationPolicy = $root.google.cloud.batch.v1alpha.AllocationPolicy.decode(reader, reader.uint32()); - break; - } - case 8: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 9: { - message.status = $root.google.cloud.batch.v1alpha.JobStatus.decode(reader, reader.uint32()); - break; - } - case 10: { - message.notification = $root.google.cloud.batch.v1alpha.JobNotification.decode(reader, reader.uint32()); - break; - } - case 11: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 12: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 13: { - message.logsPolicy = $root.google.cloud.batch.v1alpha.LogsPolicy.decode(reader, reader.uint32()); - break; - } - case 14: { - if (!(message.notifications && message.notifications.length)) - message.notifications = []; - message.notifications.push($root.google.cloud.batch.v1alpha.JobNotification.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Job message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.Job - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.Job} Job - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Job.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Job message. - * @function verify - * @memberof google.cloud.batch.v1alpha.Job - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Job.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.uid != null && message.hasOwnProperty("uid")) - if (!$util.isString(message.uid)) - return "uid: string expected"; - if (message.priority != null && message.hasOwnProperty("priority")) - if (!$util.isInteger(message.priority) && !(message.priority && $util.isInteger(message.priority.low) && $util.isInteger(message.priority.high))) - return "priority: integer|Long expected"; - if (message.taskGroups != null && message.hasOwnProperty("taskGroups")) { - if (!Array.isArray(message.taskGroups)) - return "taskGroups: array expected"; - for (var i = 0; i < message.taskGroups.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.TaskGroup.verify(message.taskGroups[i]); - if (error) - return "taskGroups." + error; - } - } - if (message.schedulingPolicy != null && message.hasOwnProperty("schedulingPolicy")) - switch (message.schedulingPolicy) { - default: - return "schedulingPolicy: enum value expected"; - case 0: - case 1: - break; - } - if (message.dependencies != null && message.hasOwnProperty("dependencies")) { - if (!Array.isArray(message.dependencies)) - return "dependencies: array expected"; - for (var i = 0; i < message.dependencies.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.JobDependency.verify(message.dependencies[i]); - if (error) - return "dependencies." + error; - } - } - if (message.allocationPolicy != null && message.hasOwnProperty("allocationPolicy")) { - var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.verify(message.allocationPolicy); - if (error) - return "allocationPolicy." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.status != null && message.hasOwnProperty("status")) { - var error = $root.google.cloud.batch.v1alpha.JobStatus.verify(message.status); - if (error) - return "status." + error; - } - if (message.notification != null && message.hasOwnProperty("notification")) { - var error = $root.google.cloud.batch.v1alpha.JobNotification.verify(message.notification); - if (error) - return "notification." + error; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.logsPolicy != null && message.hasOwnProperty("logsPolicy")) { - var error = $root.google.cloud.batch.v1alpha.LogsPolicy.verify(message.logsPolicy); - if (error) - return "logsPolicy." + error; - } - if (message.notifications != null && message.hasOwnProperty("notifications")) { - if (!Array.isArray(message.notifications)) - return "notifications: array expected"; - for (var i = 0; i < message.notifications.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.JobNotification.verify(message.notifications[i]); - if (error) - return "notifications." + error; - } - } - return null; - }; - - /** - * Creates a Job message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.Job - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.Job} Job - */ - Job.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.Job) - return object; - var message = new $root.google.cloud.batch.v1alpha.Job(); - if (object.name != null) - message.name = String(object.name); - if (object.uid != null) - message.uid = String(object.uid); - if (object.priority != null) - if ($util.Long) - (message.priority = $util.Long.fromValue(object.priority)).unsigned = false; - else if (typeof object.priority === "string") - message.priority = parseInt(object.priority, 10); - else if (typeof object.priority === "number") - message.priority = object.priority; - else if (typeof object.priority === "object") - message.priority = new $util.LongBits(object.priority.low >>> 0, object.priority.high >>> 0).toNumber(); - if (object.taskGroups) { - if (!Array.isArray(object.taskGroups)) - throw TypeError(".google.cloud.batch.v1alpha.Job.taskGroups: array expected"); - message.taskGroups = []; - for (var i = 0; i < object.taskGroups.length; ++i) { - if (typeof object.taskGroups[i] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Job.taskGroups: object expected"); - message.taskGroups[i] = $root.google.cloud.batch.v1alpha.TaskGroup.fromObject(object.taskGroups[i]); - } - } - switch (object.schedulingPolicy) { - default: - if (typeof object.schedulingPolicy === "number") { - message.schedulingPolicy = object.schedulingPolicy; - break; - } - break; - case "SCHEDULING_POLICY_UNSPECIFIED": - case 0: - message.schedulingPolicy = 0; - break; - case "AS_SOON_AS_POSSIBLE": - case 1: - message.schedulingPolicy = 1; - break; - } - if (object.dependencies) { - if (!Array.isArray(object.dependencies)) - throw TypeError(".google.cloud.batch.v1alpha.Job.dependencies: array expected"); - message.dependencies = []; - for (var i = 0; i < object.dependencies.length; ++i) { - if (typeof object.dependencies[i] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Job.dependencies: object expected"); - message.dependencies[i] = $root.google.cloud.batch.v1alpha.JobDependency.fromObject(object.dependencies[i]); - } - } - if (object.allocationPolicy != null) { - if (typeof object.allocationPolicy !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Job.allocationPolicy: object expected"); - message.allocationPolicy = $root.google.cloud.batch.v1alpha.AllocationPolicy.fromObject(object.allocationPolicy); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Job.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - if (object.status != null) { - if (typeof object.status !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Job.status: object expected"); - message.status = $root.google.cloud.batch.v1alpha.JobStatus.fromObject(object.status); - } - if (object.notification != null) { - if (typeof object.notification !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Job.notification: object expected"); - message.notification = $root.google.cloud.batch.v1alpha.JobNotification.fromObject(object.notification); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Job.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Job.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.logsPolicy != null) { - if (typeof object.logsPolicy !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Job.logsPolicy: object expected"); - message.logsPolicy = $root.google.cloud.batch.v1alpha.LogsPolicy.fromObject(object.logsPolicy); - } - if (object.notifications) { - if (!Array.isArray(object.notifications)) - throw TypeError(".google.cloud.batch.v1alpha.Job.notifications: array expected"); - message.notifications = []; - for (var i = 0; i < object.notifications.length; ++i) { - if (typeof object.notifications[i] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Job.notifications: object expected"); - message.notifications[i] = $root.google.cloud.batch.v1alpha.JobNotification.fromObject(object.notifications[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Job message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.Job - * @static - * @param {google.cloud.batch.v1alpha.Job} message Job - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Job.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.taskGroups = []; - object.dependencies = []; - object.notifications = []; - } - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.uid = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.priority = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.priority = options.longs === String ? "0" : 0; - object.schedulingPolicy = options.enums === String ? "SCHEDULING_POLICY_UNSPECIFIED" : 0; - object.allocationPolicy = null; - object.status = null; - object.notification = null; - object.createTime = null; - object.updateTime = null; - object.logsPolicy = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - if (message.priority != null && message.hasOwnProperty("priority")) - if (typeof message.priority === "number") - object.priority = options.longs === String ? String(message.priority) : message.priority; - else - object.priority = options.longs === String ? $util.Long.prototype.toString.call(message.priority) : options.longs === Number ? new $util.LongBits(message.priority.low >>> 0, message.priority.high >>> 0).toNumber() : message.priority; - if (message.taskGroups && message.taskGroups.length) { - object.taskGroups = []; - for (var j = 0; j < message.taskGroups.length; ++j) - object.taskGroups[j] = $root.google.cloud.batch.v1alpha.TaskGroup.toObject(message.taskGroups[j], options); - } - if (message.schedulingPolicy != null && message.hasOwnProperty("schedulingPolicy")) - object.schedulingPolicy = options.enums === String ? $root.google.cloud.batch.v1alpha.Job.SchedulingPolicy[message.schedulingPolicy] === undefined ? message.schedulingPolicy : $root.google.cloud.batch.v1alpha.Job.SchedulingPolicy[message.schedulingPolicy] : message.schedulingPolicy; - if (message.dependencies && message.dependencies.length) { - object.dependencies = []; - for (var j = 0; j < message.dependencies.length; ++j) - object.dependencies[j] = $root.google.cloud.batch.v1alpha.JobDependency.toObject(message.dependencies[j], options); - } - if (message.allocationPolicy != null && message.hasOwnProperty("allocationPolicy")) - object.allocationPolicy = $root.google.cloud.batch.v1alpha.AllocationPolicy.toObject(message.allocationPolicy, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.cloud.batch.v1alpha.JobStatus.toObject(message.status, options); - if (message.notification != null && message.hasOwnProperty("notification")) - object.notification = $root.google.cloud.batch.v1alpha.JobNotification.toObject(message.notification, options); - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.logsPolicy != null && message.hasOwnProperty("logsPolicy")) - object.logsPolicy = $root.google.cloud.batch.v1alpha.LogsPolicy.toObject(message.logsPolicy, options); - if (message.notifications && message.notifications.length) { - object.notifications = []; - for (var j = 0; j < message.notifications.length; ++j) - object.notifications[j] = $root.google.cloud.batch.v1alpha.JobNotification.toObject(message.notifications[j], options); - } - return object; - }; - - /** - * Converts this Job to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.Job - * @instance - * @returns {Object.} JSON object - */ - Job.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Job - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.Job - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Job.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.Job"; - }; - - /** - * SchedulingPolicy enum. - * @name google.cloud.batch.v1alpha.Job.SchedulingPolicy - * @enum {number} - * @property {number} SCHEDULING_POLICY_UNSPECIFIED=0 SCHEDULING_POLICY_UNSPECIFIED value - * @property {number} AS_SOON_AS_POSSIBLE=1 AS_SOON_AS_POSSIBLE value - */ - Job.SchedulingPolicy = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SCHEDULING_POLICY_UNSPECIFIED"] = 0; - values[valuesById[1] = "AS_SOON_AS_POSSIBLE"] = 1; - return values; - })(); - - return Job; - })(); - - v1alpha.LogsPolicy = (function() { - - /** - * Properties of a LogsPolicy. - * @memberof google.cloud.batch.v1alpha - * @interface ILogsPolicy - * @property {google.cloud.batch.v1alpha.LogsPolicy.Destination|null} [destination] LogsPolicy destination - * @property {string|null} [logsPath] LogsPolicy logsPath - * @property {google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption|null} [cloudLoggingOption] LogsPolicy cloudLoggingOption - */ - - /** - * Constructs a new LogsPolicy. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a LogsPolicy. - * @implements ILogsPolicy - * @constructor - * @param {google.cloud.batch.v1alpha.ILogsPolicy=} [properties] Properties to set - */ - function LogsPolicy(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LogsPolicy destination. - * @member {google.cloud.batch.v1alpha.LogsPolicy.Destination} destination - * @memberof google.cloud.batch.v1alpha.LogsPolicy - * @instance - */ - LogsPolicy.prototype.destination = 0; - - /** - * LogsPolicy logsPath. - * @member {string} logsPath - * @memberof google.cloud.batch.v1alpha.LogsPolicy - * @instance - */ - LogsPolicy.prototype.logsPath = ""; - - /** - * LogsPolicy cloudLoggingOption. - * @member {google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption|null|undefined} cloudLoggingOption - * @memberof google.cloud.batch.v1alpha.LogsPolicy - * @instance - */ - LogsPolicy.prototype.cloudLoggingOption = null; - - /** - * Creates a new LogsPolicy instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.LogsPolicy - * @static - * @param {google.cloud.batch.v1alpha.ILogsPolicy=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.LogsPolicy} LogsPolicy instance - */ - LogsPolicy.create = function create(properties) { - return new LogsPolicy(properties); - }; - - /** - * Encodes the specified LogsPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.LogsPolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.LogsPolicy - * @static - * @param {google.cloud.batch.v1alpha.ILogsPolicy} message LogsPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LogsPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.destination); - if (message.logsPath != null && Object.hasOwnProperty.call(message, "logsPath")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.logsPath); - if (message.cloudLoggingOption != null && Object.hasOwnProperty.call(message, "cloudLoggingOption")) - $root.google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption.encode(message.cloudLoggingOption, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LogsPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.LogsPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.LogsPolicy - * @static - * @param {google.cloud.batch.v1alpha.ILogsPolicy} message LogsPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LogsPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LogsPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.LogsPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.LogsPolicy} LogsPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LogsPolicy.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.LogsPolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.destination = reader.int32(); - break; - } - case 2: { - message.logsPath = reader.string(); - break; - } - case 3: { - message.cloudLoggingOption = $root.google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LogsPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.LogsPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.LogsPolicy} LogsPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LogsPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LogsPolicy message. - * @function verify - * @memberof google.cloud.batch.v1alpha.LogsPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LogsPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.destination != null && message.hasOwnProperty("destination")) - switch (message.destination) { - default: - return "destination: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.logsPath != null && message.hasOwnProperty("logsPath")) - if (!$util.isString(message.logsPath)) - return "logsPath: string expected"; - if (message.cloudLoggingOption != null && message.hasOwnProperty("cloudLoggingOption")) { - var error = $root.google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption.verify(message.cloudLoggingOption); - if (error) - return "cloudLoggingOption." + error; - } - return null; - }; - - /** - * Creates a LogsPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.LogsPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.LogsPolicy} LogsPolicy - */ - LogsPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.LogsPolicy) - return object; - var message = new $root.google.cloud.batch.v1alpha.LogsPolicy(); - switch (object.destination) { - default: - if (typeof object.destination === "number") { - message.destination = object.destination; - break; - } - break; - case "DESTINATION_UNSPECIFIED": - case 0: - message.destination = 0; - break; - case "CLOUD_LOGGING": - case 1: - message.destination = 1; - break; - case "PATH": - case 2: - message.destination = 2; - break; - } - if (object.logsPath != null) - message.logsPath = String(object.logsPath); - if (object.cloudLoggingOption != null) { - if (typeof object.cloudLoggingOption !== "object") - throw TypeError(".google.cloud.batch.v1alpha.LogsPolicy.cloudLoggingOption: object expected"); - message.cloudLoggingOption = $root.google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption.fromObject(object.cloudLoggingOption); - } - return message; - }; - - /** - * Creates a plain object from a LogsPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.LogsPolicy - * @static - * @param {google.cloud.batch.v1alpha.LogsPolicy} message LogsPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LogsPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.destination = options.enums === String ? "DESTINATION_UNSPECIFIED" : 0; - object.logsPath = ""; - object.cloudLoggingOption = null; - } - if (message.destination != null && message.hasOwnProperty("destination")) - object.destination = options.enums === String ? $root.google.cloud.batch.v1alpha.LogsPolicy.Destination[message.destination] === undefined ? message.destination : $root.google.cloud.batch.v1alpha.LogsPolicy.Destination[message.destination] : message.destination; - if (message.logsPath != null && message.hasOwnProperty("logsPath")) - object.logsPath = message.logsPath; - if (message.cloudLoggingOption != null && message.hasOwnProperty("cloudLoggingOption")) - object.cloudLoggingOption = $root.google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption.toObject(message.cloudLoggingOption, options); - return object; - }; - - /** - * Converts this LogsPolicy to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.LogsPolicy - * @instance - * @returns {Object.} JSON object - */ - LogsPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LogsPolicy - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.LogsPolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LogsPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.LogsPolicy"; - }; - - LogsPolicy.CloudLoggingOption = (function() { - - /** - * Properties of a CloudLoggingOption. - * @memberof google.cloud.batch.v1alpha.LogsPolicy - * @interface ICloudLoggingOption - * @property {boolean|null} [useGenericTaskMonitoredResource] CloudLoggingOption useGenericTaskMonitoredResource - */ - - /** - * Constructs a new CloudLoggingOption. - * @memberof google.cloud.batch.v1alpha.LogsPolicy - * @classdesc Represents a CloudLoggingOption. - * @implements ICloudLoggingOption - * @constructor - * @param {google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption=} [properties] Properties to set - */ - function CloudLoggingOption(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CloudLoggingOption useGenericTaskMonitoredResource. - * @member {boolean} useGenericTaskMonitoredResource - * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption - * @instance - */ - CloudLoggingOption.prototype.useGenericTaskMonitoredResource = false; - - /** - * Creates a new CloudLoggingOption instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption - * @static - * @param {google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption} CloudLoggingOption instance - */ - CloudLoggingOption.create = function create(properties) { - return new CloudLoggingOption(properties); - }; - - /** - * Encodes the specified CloudLoggingOption message. Does not implicitly {@link google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption - * @static - * @param {google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption} message CloudLoggingOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudLoggingOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.useGenericTaskMonitoredResource != null && Object.hasOwnProperty.call(message, "useGenericTaskMonitoredResource")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.useGenericTaskMonitoredResource); - return writer; - }; - - /** - * Encodes the specified CloudLoggingOption message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption - * @static - * @param {google.cloud.batch.v1alpha.LogsPolicy.ICloudLoggingOption} message CloudLoggingOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudLoggingOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CloudLoggingOption message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption} CloudLoggingOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudLoggingOption.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.useGenericTaskMonitoredResource = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CloudLoggingOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption} CloudLoggingOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudLoggingOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CloudLoggingOption message. - * @function verify - * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CloudLoggingOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.useGenericTaskMonitoredResource != null && message.hasOwnProperty("useGenericTaskMonitoredResource")) - if (typeof message.useGenericTaskMonitoredResource !== "boolean") - return "useGenericTaskMonitoredResource: boolean expected"; - return null; - }; - - /** - * Creates a CloudLoggingOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption} CloudLoggingOption - */ - CloudLoggingOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption) - return object; - var message = new $root.google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption(); - if (object.useGenericTaskMonitoredResource != null) - message.useGenericTaskMonitoredResource = Boolean(object.useGenericTaskMonitoredResource); - return message; - }; - - /** - * Creates a plain object from a CloudLoggingOption message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption - * @static - * @param {google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption} message CloudLoggingOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CloudLoggingOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.useGenericTaskMonitoredResource = false; - if (message.useGenericTaskMonitoredResource != null && message.hasOwnProperty("useGenericTaskMonitoredResource")) - object.useGenericTaskMonitoredResource = message.useGenericTaskMonitoredResource; - return object; - }; - - /** - * Converts this CloudLoggingOption to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption - * @instance - * @returns {Object.} JSON object - */ - CloudLoggingOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CloudLoggingOption - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CloudLoggingOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.LogsPolicy.CloudLoggingOption"; - }; - - return CloudLoggingOption; - })(); - - /** - * Destination enum. - * @name google.cloud.batch.v1alpha.LogsPolicy.Destination - * @enum {number} - * @property {number} DESTINATION_UNSPECIFIED=0 DESTINATION_UNSPECIFIED value - * @property {number} CLOUD_LOGGING=1 CLOUD_LOGGING value - * @property {number} PATH=2 PATH value - */ - LogsPolicy.Destination = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DESTINATION_UNSPECIFIED"] = 0; - values[valuesById[1] = "CLOUD_LOGGING"] = 1; - values[valuesById[2] = "PATH"] = 2; - return values; - })(); - - return LogsPolicy; - })(); - - v1alpha.JobDependency = (function() { - - /** - * Properties of a JobDependency. - * @memberof google.cloud.batch.v1alpha - * @interface IJobDependency - * @property {Object.|null} [items] JobDependency items - */ - - /** - * Constructs a new JobDependency. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a JobDependency. - * @implements IJobDependency - * @constructor - * @param {google.cloud.batch.v1alpha.IJobDependency=} [properties] Properties to set - */ - function JobDependency(properties) { - this.items = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * JobDependency items. - * @member {Object.} items - * @memberof google.cloud.batch.v1alpha.JobDependency - * @instance - */ - JobDependency.prototype.items = $util.emptyObject; - - /** - * Creates a new JobDependency instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.JobDependency - * @static - * @param {google.cloud.batch.v1alpha.IJobDependency=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.JobDependency} JobDependency instance - */ - JobDependency.create = function create(properties) { - return new JobDependency(properties); - }; - - /** - * Encodes the specified JobDependency message. Does not implicitly {@link google.cloud.batch.v1alpha.JobDependency.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.JobDependency - * @static - * @param {google.cloud.batch.v1alpha.IJobDependency} message JobDependency message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JobDependency.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.items != null && Object.hasOwnProperty.call(message, "items")) - for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.items[keys[i]]).ldelim(); - return writer; - }; - - /** - * Encodes the specified JobDependency message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobDependency.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.JobDependency - * @static - * @param {google.cloud.batch.v1alpha.IJobDependency} message JobDependency message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JobDependency.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a JobDependency message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.JobDependency - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.JobDependency} JobDependency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JobDependency.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.JobDependency(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (message.items === $util.emptyObject) - message.items = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = 0; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.int32(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.items[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a JobDependency message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.JobDependency - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.JobDependency} JobDependency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JobDependency.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a JobDependency message. - * @function verify - * @memberof google.cloud.batch.v1alpha.JobDependency - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - JobDependency.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.items != null && message.hasOwnProperty("items")) { - if (!$util.isObject(message.items)) - return "items: object expected"; - var key = Object.keys(message.items); - for (var i = 0; i < key.length; ++i) - switch (message.items[key[i]]) { - default: - return "items: enum value{k:string} expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - } - return null; - }; - - /** - * Creates a JobDependency message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.JobDependency - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.JobDependency} JobDependency - */ - JobDependency.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.JobDependency) - return object; - var message = new $root.google.cloud.batch.v1alpha.JobDependency(); - if (object.items) { - if (typeof object.items !== "object") - throw TypeError(".google.cloud.batch.v1alpha.JobDependency.items: object expected"); - message.items = {}; - for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) - switch (object.items[keys[i]]) { - default: - if (typeof object.items[keys[i]] === "number") { - message.items[keys[i]] = object.items[keys[i]]; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.items[keys[i]] = 0; - break; - case "SUCCEEDED": - case 1: - message.items[keys[i]] = 1; - break; - case "FAILED": - case 2: - message.items[keys[i]] = 2; - break; - case "FINISHED": - case 3: - message.items[keys[i]] = 3; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a JobDependency message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.JobDependency - * @static - * @param {google.cloud.batch.v1alpha.JobDependency} message JobDependency - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - JobDependency.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.items = {}; - var keys2; - if (message.items && (keys2 = Object.keys(message.items)).length) { - object.items = {}; - for (var j = 0; j < keys2.length; ++j) - object.items[keys2[j]] = options.enums === String ? $root.google.cloud.batch.v1alpha.JobDependency.Type[message.items[keys2[j]]] === undefined ? message.items[keys2[j]] : $root.google.cloud.batch.v1alpha.JobDependency.Type[message.items[keys2[j]]] : message.items[keys2[j]]; - } - return object; - }; - - /** - * Converts this JobDependency to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.JobDependency - * @instance - * @returns {Object.} JSON object - */ - JobDependency.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for JobDependency - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.JobDependency - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - JobDependency.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.JobDependency"; - }; - - /** - * Type enum. - * @name google.cloud.batch.v1alpha.JobDependency.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} SUCCEEDED=1 SUCCEEDED value - * @property {number} FAILED=2 FAILED value - * @property {number} FINISHED=3 FINISHED value - */ - JobDependency.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SUCCEEDED"] = 1; - values[valuesById[2] = "FAILED"] = 2; - values[valuesById[3] = "FINISHED"] = 3; - return values; - })(); - - return JobDependency; - })(); - - v1alpha.JobStatus = (function() { - - /** - * Properties of a JobStatus. - * @memberof google.cloud.batch.v1alpha - * @interface IJobStatus - * @property {google.cloud.batch.v1alpha.JobStatus.State|null} [state] JobStatus state - * @property {Array.|null} [statusEvents] JobStatus statusEvents - * @property {Object.|null} [taskGroups] JobStatus taskGroups - * @property {google.protobuf.IDuration|null} [runDuration] JobStatus runDuration - * @property {google.cloud.batch.v1alpha.IResourceUsage|null} [resourceUsage] JobStatus resourceUsage - */ - - /** - * Constructs a new JobStatus. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a JobStatus. - * @implements IJobStatus - * @constructor - * @param {google.cloud.batch.v1alpha.IJobStatus=} [properties] Properties to set - */ - function JobStatus(properties) { - this.statusEvents = []; - this.taskGroups = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * JobStatus state. - * @member {google.cloud.batch.v1alpha.JobStatus.State} state - * @memberof google.cloud.batch.v1alpha.JobStatus - * @instance - */ - JobStatus.prototype.state = 0; - - /** - * JobStatus statusEvents. - * @member {Array.} statusEvents - * @memberof google.cloud.batch.v1alpha.JobStatus - * @instance - */ - JobStatus.prototype.statusEvents = $util.emptyArray; - - /** - * JobStatus taskGroups. - * @member {Object.} taskGroups - * @memberof google.cloud.batch.v1alpha.JobStatus - * @instance - */ - JobStatus.prototype.taskGroups = $util.emptyObject; - - /** - * JobStatus runDuration. - * @member {google.protobuf.IDuration|null|undefined} runDuration - * @memberof google.cloud.batch.v1alpha.JobStatus - * @instance - */ - JobStatus.prototype.runDuration = null; - - /** - * JobStatus resourceUsage. - * @member {google.cloud.batch.v1alpha.IResourceUsage|null|undefined} resourceUsage - * @memberof google.cloud.batch.v1alpha.JobStatus - * @instance - */ - JobStatus.prototype.resourceUsage = null; - - /** - * Creates a new JobStatus instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.JobStatus - * @static - * @param {google.cloud.batch.v1alpha.IJobStatus=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.JobStatus} JobStatus instance - */ - JobStatus.create = function create(properties) { - return new JobStatus(properties); - }; - - /** - * Encodes the specified JobStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.JobStatus - * @static - * @param {google.cloud.batch.v1alpha.IJobStatus} message JobStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JobStatus.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); - if (message.statusEvents != null && message.statusEvents.length) - for (var i = 0; i < message.statusEvents.length; ++i) - $root.google.cloud.batch.v1alpha.StatusEvent.encode(message.statusEvents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.taskGroups != null && Object.hasOwnProperty.call(message, "taskGroups")) - for (var keys = Object.keys(message.taskGroups), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.encode(message.taskGroups[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.runDuration != null && Object.hasOwnProperty.call(message, "runDuration")) - $root.google.protobuf.Duration.encode(message.runDuration, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.resourceUsage != null && Object.hasOwnProperty.call(message, "resourceUsage")) - $root.google.cloud.batch.v1alpha.ResourceUsage.encode(message.resourceUsage, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified JobStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.JobStatus - * @static - * @param {google.cloud.batch.v1alpha.IJobStatus} message JobStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JobStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a JobStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.JobStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.JobStatus} JobStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JobStatus.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.JobStatus(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.state = reader.int32(); - break; - } - case 2: { - if (!(message.statusEvents && message.statusEvents.length)) - message.statusEvents = []; - message.statusEvents.push($root.google.cloud.batch.v1alpha.StatusEvent.decode(reader, reader.uint32())); - break; - } - case 4: { - if (message.taskGroups === $util.emptyObject) - message.taskGroups = {}; - 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.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.taskGroups[key] = value; - break; - } - case 5: { - message.runDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 6: { - message.resourceUsage = $root.google.cloud.batch.v1alpha.ResourceUsage.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a JobStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.JobStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.JobStatus} JobStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JobStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a JobStatus message. - * @function verify - * @memberof google.cloud.batch.v1alpha.JobStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - JobStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - if (message.statusEvents != null && message.hasOwnProperty("statusEvents")) { - if (!Array.isArray(message.statusEvents)) - return "statusEvents: array expected"; - for (var i = 0; i < message.statusEvents.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.StatusEvent.verify(message.statusEvents[i]); - if (error) - return "statusEvents." + error; - } - } - if (message.taskGroups != null && message.hasOwnProperty("taskGroups")) { - if (!$util.isObject(message.taskGroups)) - return "taskGroups: object expected"; - var key = Object.keys(message.taskGroups); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.verify(message.taskGroups[key[i]]); - if (error) - return "taskGroups." + error; - } - } - if (message.runDuration != null && message.hasOwnProperty("runDuration")) { - var error = $root.google.protobuf.Duration.verify(message.runDuration); - if (error) - return "runDuration." + error; - } - if (message.resourceUsage != null && message.hasOwnProperty("resourceUsage")) { - var error = $root.google.cloud.batch.v1alpha.ResourceUsage.verify(message.resourceUsage); - if (error) - return "resourceUsage." + error; - } - return null; - }; - - /** - * Creates a JobStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.JobStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.JobStatus} JobStatus - */ - JobStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.JobStatus) - return object; - var message = new $root.google.cloud.batch.v1alpha.JobStatus(); - 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 "QUEUED": - case 1: - message.state = 1; - break; - case "SCHEDULED": - case 2: - message.state = 2; - break; - case "RUNNING": - case 3: - message.state = 3; - break; - case "SUCCEEDED": - case 4: - message.state = 4; - break; - case "FAILED": - case 5: - message.state = 5; - break; - case "DELETION_IN_PROGRESS": - case 6: - message.state = 6; - break; - case "CANCELLATION_IN_PROGRESS": - case 7: - message.state = 7; - break; - case "CANCELLED": - case 8: - message.state = 8; - break; - } - if (object.statusEvents) { - if (!Array.isArray(object.statusEvents)) - throw TypeError(".google.cloud.batch.v1alpha.JobStatus.statusEvents: array expected"); - message.statusEvents = []; - for (var i = 0; i < object.statusEvents.length; ++i) { - if (typeof object.statusEvents[i] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.JobStatus.statusEvents: object expected"); - message.statusEvents[i] = $root.google.cloud.batch.v1alpha.StatusEvent.fromObject(object.statusEvents[i]); - } - } - if (object.taskGroups) { - if (typeof object.taskGroups !== "object") - throw TypeError(".google.cloud.batch.v1alpha.JobStatus.taskGroups: object expected"); - message.taskGroups = {}; - for (var keys = Object.keys(object.taskGroups), i = 0; i < keys.length; ++i) { - if (typeof object.taskGroups[keys[i]] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.JobStatus.taskGroups: object expected"); - message.taskGroups[keys[i]] = $root.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.fromObject(object.taskGroups[keys[i]]); - } - } - if (object.runDuration != null) { - if (typeof object.runDuration !== "object") - throw TypeError(".google.cloud.batch.v1alpha.JobStatus.runDuration: object expected"); - message.runDuration = $root.google.protobuf.Duration.fromObject(object.runDuration); - } - if (object.resourceUsage != null) { - if (typeof object.resourceUsage !== "object") - throw TypeError(".google.cloud.batch.v1alpha.JobStatus.resourceUsage: object expected"); - message.resourceUsage = $root.google.cloud.batch.v1alpha.ResourceUsage.fromObject(object.resourceUsage); - } - return message; - }; - - /** - * Creates a plain object from a JobStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.JobStatus - * @static - * @param {google.cloud.batch.v1alpha.JobStatus} message JobStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - JobStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.statusEvents = []; - if (options.objects || options.defaults) - object.taskGroups = {}; - if (options.defaults) { - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.runDuration = null; - object.resourceUsage = null; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.batch.v1alpha.JobStatus.State[message.state] === undefined ? message.state : $root.google.cloud.batch.v1alpha.JobStatus.State[message.state] : message.state; - if (message.statusEvents && message.statusEvents.length) { - object.statusEvents = []; - for (var j = 0; j < message.statusEvents.length; ++j) - object.statusEvents[j] = $root.google.cloud.batch.v1alpha.StatusEvent.toObject(message.statusEvents[j], options); - } - var keys2; - if (message.taskGroups && (keys2 = Object.keys(message.taskGroups)).length) { - object.taskGroups = {}; - for (var j = 0; j < keys2.length; ++j) - object.taskGroups[keys2[j]] = $root.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.toObject(message.taskGroups[keys2[j]], options); - } - if (message.runDuration != null && message.hasOwnProperty("runDuration")) - object.runDuration = $root.google.protobuf.Duration.toObject(message.runDuration, options); - if (message.resourceUsage != null && message.hasOwnProperty("resourceUsage")) - object.resourceUsage = $root.google.cloud.batch.v1alpha.ResourceUsage.toObject(message.resourceUsage, options); - return object; - }; - - /** - * Converts this JobStatus to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.JobStatus - * @instance - * @returns {Object.} JSON object - */ - JobStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for JobStatus - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.JobStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - JobStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.JobStatus"; - }; - - JobStatus.InstanceStatus = (function() { - - /** - * Properties of an InstanceStatus. - * @memberof google.cloud.batch.v1alpha.JobStatus - * @interface IInstanceStatus - * @property {string|null} [machineType] InstanceStatus machineType - * @property {google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel|null} [provisioningModel] InstanceStatus provisioningModel - * @property {number|Long|null} [taskPack] InstanceStatus taskPack - * @property {google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null} [bootDisk] InstanceStatus bootDisk - */ - - /** - * Constructs a new InstanceStatus. - * @memberof google.cloud.batch.v1alpha.JobStatus - * @classdesc Represents an InstanceStatus. - * @implements IInstanceStatus - * @constructor - * @param {google.cloud.batch.v1alpha.JobStatus.IInstanceStatus=} [properties] Properties to set - */ - function InstanceStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InstanceStatus machineType. - * @member {string} machineType - * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus - * @instance - */ - InstanceStatus.prototype.machineType = ""; - - /** - * InstanceStatus provisioningModel. - * @member {google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel} provisioningModel - * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus - * @instance - */ - InstanceStatus.prototype.provisioningModel = 0; - - /** - * InstanceStatus taskPack. - * @member {number|Long} taskPack - * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus - * @instance - */ - InstanceStatus.prototype.taskPack = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * InstanceStatus bootDisk. - * @member {google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null|undefined} bootDisk - * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus - * @instance - */ - InstanceStatus.prototype.bootDisk = null; - - /** - * Creates a new InstanceStatus instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus - * @static - * @param {google.cloud.batch.v1alpha.JobStatus.IInstanceStatus=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.JobStatus.InstanceStatus} InstanceStatus instance - */ - InstanceStatus.create = function create(properties) { - return new InstanceStatus(properties); - }; - - /** - * Encodes the specified InstanceStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.InstanceStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus - * @static - * @param {google.cloud.batch.v1alpha.JobStatus.IInstanceStatus} message InstanceStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.machineType); - if (message.provisioningModel != null && Object.hasOwnProperty.call(message, "provisioningModel")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.provisioningModel); - if (message.taskPack != null && Object.hasOwnProperty.call(message, "taskPack")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.taskPack); - if (message.bootDisk != null && Object.hasOwnProperty.call(message, "bootDisk")) - $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.encode(message.bootDisk, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified InstanceStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.InstanceStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus - * @static - * @param {google.cloud.batch.v1alpha.JobStatus.IInstanceStatus} message InstanceStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InstanceStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.JobStatus.InstanceStatus} InstanceStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceStatus.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.JobStatus.InstanceStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.machineType = reader.string(); - break; - } - case 2: { - message.provisioningModel = reader.int32(); - break; - } - case 3: { - message.taskPack = reader.int64(); - break; - } - case 4: { - message.bootDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InstanceStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.JobStatus.InstanceStatus} InstanceStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InstanceStatus message. - * @function verify - * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstanceStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.machineType != null && message.hasOwnProperty("machineType")) - if (!$util.isString(message.machineType)) - return "machineType: string expected"; - if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) - switch (message.provisioningModel) { - default: - return "provisioningModel: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.taskPack != null && message.hasOwnProperty("taskPack")) - if (!$util.isInteger(message.taskPack) && !(message.taskPack && $util.isInteger(message.taskPack.low) && $util.isInteger(message.taskPack.high))) - return "taskPack: integer|Long expected"; - if (message.bootDisk != null && message.hasOwnProperty("bootDisk")) { - var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.verify(message.bootDisk); - if (error) - return "bootDisk." + error; - } - return null; - }; - - /** - * Creates an InstanceStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.JobStatus.InstanceStatus} InstanceStatus - */ - InstanceStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.JobStatus.InstanceStatus) - return object; - var message = new $root.google.cloud.batch.v1alpha.JobStatus.InstanceStatus(); - if (object.machineType != null) - message.machineType = String(object.machineType); - switch (object.provisioningModel) { - default: - if (typeof object.provisioningModel === "number") { - message.provisioningModel = object.provisioningModel; - break; - } - break; - case "PROVISIONING_MODEL_UNSPECIFIED": - case 0: - message.provisioningModel = 0; - break; - case "STANDARD": - case 1: - message.provisioningModel = 1; - break; - case "SPOT": - case 2: - message.provisioningModel = 2; - break; - case "PREEMPTIBLE": - case 3: - message.provisioningModel = 3; - break; - } - if (object.taskPack != null) - if ($util.Long) - (message.taskPack = $util.Long.fromValue(object.taskPack)).unsigned = false; - else if (typeof object.taskPack === "string") - message.taskPack = parseInt(object.taskPack, 10); - else if (typeof object.taskPack === "number") - message.taskPack = object.taskPack; - else if (typeof object.taskPack === "object") - message.taskPack = new $util.LongBits(object.taskPack.low >>> 0, object.taskPack.high >>> 0).toNumber(); - if (object.bootDisk != null) { - if (typeof object.bootDisk !== "object") - throw TypeError(".google.cloud.batch.v1alpha.JobStatus.InstanceStatus.bootDisk: object expected"); - message.bootDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.fromObject(object.bootDisk); - } - return message; - }; - - /** - * Creates a plain object from an InstanceStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus - * @static - * @param {google.cloud.batch.v1alpha.JobStatus.InstanceStatus} message InstanceStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstanceStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.machineType = ""; - object.provisioningModel = options.enums === String ? "PROVISIONING_MODEL_UNSPECIFIED" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.taskPack = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.taskPack = options.longs === String ? "0" : 0; - object.bootDisk = null; - } - if (message.machineType != null && message.hasOwnProperty("machineType")) - object.machineType = message.machineType; - if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) - object.provisioningModel = options.enums === String ? $root.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel[message.provisioningModel] === undefined ? message.provisioningModel : $root.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel[message.provisioningModel] : message.provisioningModel; - if (message.taskPack != null && message.hasOwnProperty("taskPack")) - if (typeof message.taskPack === "number") - object.taskPack = options.longs === String ? String(message.taskPack) : message.taskPack; - else - object.taskPack = options.longs === String ? $util.Long.prototype.toString.call(message.taskPack) : options.longs === Number ? new $util.LongBits(message.taskPack.low >>> 0, message.taskPack.high >>> 0).toNumber() : message.taskPack; - if (message.bootDisk != null && message.hasOwnProperty("bootDisk")) - object.bootDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.toObject(message.bootDisk, options); - return object; - }; - - /** - * Converts this InstanceStatus to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus - * @instance - * @returns {Object.} JSON object - */ - InstanceStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InstanceStatus - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.JobStatus.InstanceStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstanceStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.JobStatus.InstanceStatus"; - }; - - return InstanceStatus; - })(); - - JobStatus.TaskGroupStatus = (function() { - - /** - * Properties of a TaskGroupStatus. - * @memberof google.cloud.batch.v1alpha.JobStatus - * @interface ITaskGroupStatus - * @property {Object.|null} [counts] TaskGroupStatus counts - * @property {Array.|null} [instances] TaskGroupStatus instances - */ - - /** - * Constructs a new TaskGroupStatus. - * @memberof google.cloud.batch.v1alpha.JobStatus - * @classdesc Represents a TaskGroupStatus. - * @implements ITaskGroupStatus - * @constructor - * @param {google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus=} [properties] Properties to set - */ - function TaskGroupStatus(properties) { - this.counts = {}; - this.instances = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TaskGroupStatus counts. - * @member {Object.} counts - * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus - * @instance - */ - TaskGroupStatus.prototype.counts = $util.emptyObject; - - /** - * TaskGroupStatus instances. - * @member {Array.} instances - * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus - * @instance - */ - TaskGroupStatus.prototype.instances = $util.emptyArray; - - /** - * Creates a new TaskGroupStatus instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus - * @static - * @param {google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus} TaskGroupStatus instance - */ - TaskGroupStatus.create = function create(properties) { - return new TaskGroupStatus(properties); - }; - - /** - * Encodes the specified TaskGroupStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus - * @static - * @param {google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus} message TaskGroupStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskGroupStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.counts != null && Object.hasOwnProperty.call(message, "counts")) - for (var keys = Object.keys(message.counts), i = 0; i < keys.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int64(message.counts[keys[i]]).ldelim(); - if (message.instances != null && message.instances.length) - for (var i = 0; i < message.instances.length; ++i) - $root.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.encode(message.instances[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TaskGroupStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus - * @static - * @param {google.cloud.batch.v1alpha.JobStatus.ITaskGroupStatus} message TaskGroupStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskGroupStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TaskGroupStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus} TaskGroupStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskGroupStatus.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (message.counts === $util.emptyObject) - message.counts = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = 0; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.int64(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.counts[key] = value; - break; - } - case 2: { - if (!(message.instances && message.instances.length)) - message.instances = []; - message.instances.push($root.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TaskGroupStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus} TaskGroupStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskGroupStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TaskGroupStatus message. - * @function verify - * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TaskGroupStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.counts != null && message.hasOwnProperty("counts")) { - if (!$util.isObject(message.counts)) - return "counts: object expected"; - var key = Object.keys(message.counts); - for (var i = 0; i < key.length; ++i) - if (!$util.isInteger(message.counts[key[i]]) && !(message.counts[key[i]] && $util.isInteger(message.counts[key[i]].low) && $util.isInteger(message.counts[key[i]].high))) - return "counts: integer|Long{k:string} expected"; - } - if (message.instances != null && message.hasOwnProperty("instances")) { - if (!Array.isArray(message.instances)) - return "instances: array expected"; - for (var i = 0; i < message.instances.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.verify(message.instances[i]); - if (error) - return "instances." + error; - } - } - return null; - }; - - /** - * Creates a TaskGroupStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus} TaskGroupStatus - */ - TaskGroupStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus) - return object; - var message = new $root.google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus(); - if (object.counts) { - if (typeof object.counts !== "object") - throw TypeError(".google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.counts: object expected"); - message.counts = {}; - for (var keys = Object.keys(object.counts), i = 0; i < keys.length; ++i) - if ($util.Long) - (message.counts[keys[i]] = $util.Long.fromValue(object.counts[keys[i]])).unsigned = false; - else if (typeof object.counts[keys[i]] === "string") - message.counts[keys[i]] = parseInt(object.counts[keys[i]], 10); - else if (typeof object.counts[keys[i]] === "number") - message.counts[keys[i]] = object.counts[keys[i]]; - else if (typeof object.counts[keys[i]] === "object") - message.counts[keys[i]] = new $util.LongBits(object.counts[keys[i]].low >>> 0, object.counts[keys[i]].high >>> 0).toNumber(); - } - if (object.instances) { - if (!Array.isArray(object.instances)) - throw TypeError(".google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.instances: array expected"); - message.instances = []; - for (var i = 0; i < object.instances.length; ++i) { - if (typeof object.instances[i] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus.instances: object expected"); - message.instances[i] = $root.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.fromObject(object.instances[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a TaskGroupStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus - * @static - * @param {google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus} message TaskGroupStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TaskGroupStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.instances = []; - if (options.objects || options.defaults) - object.counts = {}; - var keys2; - if (message.counts && (keys2 = Object.keys(message.counts)).length) { - object.counts = {}; - for (var j = 0; j < keys2.length; ++j) - if (typeof message.counts[keys2[j]] === "number") - object.counts[keys2[j]] = options.longs === String ? String(message.counts[keys2[j]]) : message.counts[keys2[j]]; - else - object.counts[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.counts[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.counts[keys2[j]].low >>> 0, message.counts[keys2[j]].high >>> 0).toNumber() : message.counts[keys2[j]]; - } - if (message.instances && message.instances.length) { - object.instances = []; - for (var j = 0; j < message.instances.length; ++j) - object.instances[j] = $root.google.cloud.batch.v1alpha.JobStatus.InstanceStatus.toObject(message.instances[j], options); - } - return object; - }; - - /** - * Converts this TaskGroupStatus to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus - * @instance - * @returns {Object.} JSON object - */ - TaskGroupStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TaskGroupStatus - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TaskGroupStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.JobStatus.TaskGroupStatus"; - }; - - return TaskGroupStatus; - })(); - - /** - * State enum. - * @name google.cloud.batch.v1alpha.JobStatus.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} QUEUED=1 QUEUED value - * @property {number} SCHEDULED=2 SCHEDULED value - * @property {number} RUNNING=3 RUNNING value - * @property {number} SUCCEEDED=4 SUCCEEDED value - * @property {number} FAILED=5 FAILED value - * @property {number} DELETION_IN_PROGRESS=6 DELETION_IN_PROGRESS value - * @property {number} CANCELLATION_IN_PROGRESS=7 CANCELLATION_IN_PROGRESS value - * @property {number} CANCELLED=8 CANCELLED value - */ - JobStatus.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "QUEUED"] = 1; - values[valuesById[2] = "SCHEDULED"] = 2; - values[valuesById[3] = "RUNNING"] = 3; - values[valuesById[4] = "SUCCEEDED"] = 4; - values[valuesById[5] = "FAILED"] = 5; - values[valuesById[6] = "DELETION_IN_PROGRESS"] = 6; - values[valuesById[7] = "CANCELLATION_IN_PROGRESS"] = 7; - values[valuesById[8] = "CANCELLED"] = 8; - return values; - })(); - - return JobStatus; - })(); - - v1alpha.ResourceUsage = (function() { - - /** - * Properties of a ResourceUsage. - * @memberof google.cloud.batch.v1alpha - * @interface IResourceUsage - * @property {number|null} [coreHours] ResourceUsage coreHours - */ - - /** - * Constructs a new ResourceUsage. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a ResourceUsage. - * @implements IResourceUsage - * @constructor - * @param {google.cloud.batch.v1alpha.IResourceUsage=} [properties] Properties to set - */ - function ResourceUsage(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceUsage coreHours. - * @member {number} coreHours - * @memberof google.cloud.batch.v1alpha.ResourceUsage - * @instance - */ - ResourceUsage.prototype.coreHours = 0; - - /** - * Creates a new ResourceUsage instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.ResourceUsage - * @static - * @param {google.cloud.batch.v1alpha.IResourceUsage=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.ResourceUsage} ResourceUsage instance - */ - ResourceUsage.create = function create(properties) { - return new ResourceUsage(properties); - }; - - /** - * Encodes the specified ResourceUsage message. Does not implicitly {@link google.cloud.batch.v1alpha.ResourceUsage.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.ResourceUsage - * @static - * @param {google.cloud.batch.v1alpha.IResourceUsage} message ResourceUsage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceUsage.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.coreHours != null && Object.hasOwnProperty.call(message, "coreHours")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.coreHours); - return writer; - }; - - /** - * Encodes the specified ResourceUsage message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ResourceUsage.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.ResourceUsage - * @static - * @param {google.cloud.batch.v1alpha.IResourceUsage} message ResourceUsage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceUsage.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceUsage message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.ResourceUsage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.ResourceUsage} ResourceUsage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceUsage.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ResourceUsage(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.coreHours = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceUsage message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.ResourceUsage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.ResourceUsage} ResourceUsage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceUsage.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceUsage message. - * @function verify - * @memberof google.cloud.batch.v1alpha.ResourceUsage - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceUsage.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.coreHours != null && message.hasOwnProperty("coreHours")) - if (typeof message.coreHours !== "number") - return "coreHours: number expected"; - return null; - }; - - /** - * Creates a ResourceUsage message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.ResourceUsage - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.ResourceUsage} ResourceUsage - */ - ResourceUsage.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.ResourceUsage) - return object; - var message = new $root.google.cloud.batch.v1alpha.ResourceUsage(); - if (object.coreHours != null) - message.coreHours = Number(object.coreHours); - return message; - }; - - /** - * Creates a plain object from a ResourceUsage message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.ResourceUsage - * @static - * @param {google.cloud.batch.v1alpha.ResourceUsage} message ResourceUsage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceUsage.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.coreHours = 0; - if (message.coreHours != null && message.hasOwnProperty("coreHours")) - object.coreHours = options.json && !isFinite(message.coreHours) ? String(message.coreHours) : message.coreHours; - return object; - }; - - /** - * Converts this ResourceUsage to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.ResourceUsage - * @instance - * @returns {Object.} JSON object - */ - ResourceUsage.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceUsage - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.ResourceUsage - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceUsage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.ResourceUsage"; - }; - - return ResourceUsage; - })(); - - v1alpha.JobNotification = (function() { - - /** - * Properties of a JobNotification. - * @memberof google.cloud.batch.v1alpha - * @interface IJobNotification - * @property {string|null} [pubsubTopic] JobNotification pubsubTopic - * @property {google.cloud.batch.v1alpha.JobNotification.IMessage|null} [message] JobNotification message - */ - - /** - * Constructs a new JobNotification. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a JobNotification. - * @implements IJobNotification - * @constructor - * @param {google.cloud.batch.v1alpha.IJobNotification=} [properties] Properties to set - */ - function JobNotification(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * JobNotification pubsubTopic. - * @member {string} pubsubTopic - * @memberof google.cloud.batch.v1alpha.JobNotification - * @instance - */ - JobNotification.prototype.pubsubTopic = ""; - - /** - * JobNotification message. - * @member {google.cloud.batch.v1alpha.JobNotification.IMessage|null|undefined} message - * @memberof google.cloud.batch.v1alpha.JobNotification - * @instance - */ - JobNotification.prototype.message = null; - - /** - * Creates a new JobNotification instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.JobNotification - * @static - * @param {google.cloud.batch.v1alpha.IJobNotification=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.JobNotification} JobNotification instance - */ - JobNotification.create = function create(properties) { - return new JobNotification(properties); - }; - - /** - * Encodes the specified JobNotification message. Does not implicitly {@link google.cloud.batch.v1alpha.JobNotification.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.JobNotification - * @static - * @param {google.cloud.batch.v1alpha.IJobNotification} message JobNotification message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JobNotification.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pubsubTopic != null && Object.hasOwnProperty.call(message, "pubsubTopic")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.pubsubTopic); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - $root.google.cloud.batch.v1alpha.JobNotification.Message.encode(message.message, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified JobNotification message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobNotification.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.JobNotification - * @static - * @param {google.cloud.batch.v1alpha.IJobNotification} message JobNotification message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JobNotification.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a JobNotification message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.JobNotification - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.JobNotification} JobNotification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JobNotification.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.JobNotification(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.pubsubTopic = reader.string(); - break; - } - case 2: { - message.message = $root.google.cloud.batch.v1alpha.JobNotification.Message.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a JobNotification message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.JobNotification - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.JobNotification} JobNotification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JobNotification.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a JobNotification message. - * @function verify - * @memberof google.cloud.batch.v1alpha.JobNotification - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - JobNotification.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) - if (!$util.isString(message.pubsubTopic)) - return "pubsubTopic: string expected"; - if (message.message != null && message.hasOwnProperty("message")) { - var error = $root.google.cloud.batch.v1alpha.JobNotification.Message.verify(message.message); - if (error) - return "message." + error; - } - return null; - }; - - /** - * Creates a JobNotification message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.JobNotification - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.JobNotification} JobNotification - */ - JobNotification.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.JobNotification) - return object; - var message = new $root.google.cloud.batch.v1alpha.JobNotification(); - if (object.pubsubTopic != null) - message.pubsubTopic = String(object.pubsubTopic); - if (object.message != null) { - if (typeof object.message !== "object") - throw TypeError(".google.cloud.batch.v1alpha.JobNotification.message: object expected"); - message.message = $root.google.cloud.batch.v1alpha.JobNotification.Message.fromObject(object.message); - } - return message; - }; - - /** - * Creates a plain object from a JobNotification message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.JobNotification - * @static - * @param {google.cloud.batch.v1alpha.JobNotification} message JobNotification - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - JobNotification.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.pubsubTopic = ""; - object.message = null; - } - if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) - object.pubsubTopic = message.pubsubTopic; - if (message.message != null && message.hasOwnProperty("message")) - object.message = $root.google.cloud.batch.v1alpha.JobNotification.Message.toObject(message.message, options); - return object; - }; - - /** - * Converts this JobNotification to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.JobNotification - * @instance - * @returns {Object.} JSON object - */ - JobNotification.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for JobNotification - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.JobNotification - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - JobNotification.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.JobNotification"; - }; - - JobNotification.Message = (function() { - - /** - * Properties of a Message. - * @memberof google.cloud.batch.v1alpha.JobNotification - * @interface IMessage - * @property {google.cloud.batch.v1alpha.JobNotification.Type|null} [type] Message type - * @property {google.cloud.batch.v1alpha.JobStatus.State|null} [newJobState] Message newJobState - * @property {google.cloud.batch.v1alpha.TaskStatus.State|null} [newTaskState] Message newTaskState - */ - - /** - * Constructs a new Message. - * @memberof google.cloud.batch.v1alpha.JobNotification - * @classdesc Represents a Message. - * @implements IMessage - * @constructor - * @param {google.cloud.batch.v1alpha.JobNotification.IMessage=} [properties] Properties to set - */ - function Message(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Message type. - * @member {google.cloud.batch.v1alpha.JobNotification.Type} type - * @memberof google.cloud.batch.v1alpha.JobNotification.Message - * @instance - */ - Message.prototype.type = 0; - - /** - * Message newJobState. - * @member {google.cloud.batch.v1alpha.JobStatus.State} newJobState - * @memberof google.cloud.batch.v1alpha.JobNotification.Message - * @instance - */ - Message.prototype.newJobState = 0; - - /** - * Message newTaskState. - * @member {google.cloud.batch.v1alpha.TaskStatus.State} newTaskState - * @memberof google.cloud.batch.v1alpha.JobNotification.Message - * @instance - */ - Message.prototype.newTaskState = 0; - - /** - * Creates a new Message instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.JobNotification.Message - * @static - * @param {google.cloud.batch.v1alpha.JobNotification.IMessage=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.JobNotification.Message} Message instance - */ - Message.create = function create(properties) { - return new Message(properties); - }; - - /** - * Encodes the specified Message message. Does not implicitly {@link google.cloud.batch.v1alpha.JobNotification.Message.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.JobNotification.Message - * @static - * @param {google.cloud.batch.v1alpha.JobNotification.IMessage} message Message message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Message.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); - if (message.newJobState != null && Object.hasOwnProperty.call(message, "newJobState")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.newJobState); - if (message.newTaskState != null && Object.hasOwnProperty.call(message, "newTaskState")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.newTaskState); - return writer; - }; - - /** - * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.JobNotification.Message.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.JobNotification.Message - * @static - * @param {google.cloud.batch.v1alpha.JobNotification.IMessage} message Message message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Message.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Message message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.JobNotification.Message - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.JobNotification.Message} Message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Message.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.JobNotification.Message(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.type = reader.int32(); - break; - } - case 2: { - message.newJobState = reader.int32(); - break; - } - case 3: { - message.newTaskState = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Message message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.JobNotification.Message - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.JobNotification.Message} Message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Message.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Message message. - * @function verify - * @memberof google.cloud.batch.v1alpha.JobNotification.Message - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Message.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.newJobState != null && message.hasOwnProperty("newJobState")) - switch (message.newJobState) { - default: - return "newJobState: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - if (message.newTaskState != null && message.hasOwnProperty("newTaskState")) - switch (message.newTaskState) { - default: - return "newTaskState: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - return null; - }; - - /** - * Creates a Message message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.JobNotification.Message - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.JobNotification.Message} Message - */ - Message.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.JobNotification.Message) - return object; - var message = new $root.google.cloud.batch.v1alpha.JobNotification.Message(); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "JOB_STATE_CHANGED": - case 1: - message.type = 1; - break; - case "TASK_STATE_CHANGED": - case 2: - message.type = 2; - break; - } - switch (object.newJobState) { - default: - if (typeof object.newJobState === "number") { - message.newJobState = object.newJobState; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.newJobState = 0; - break; - case "QUEUED": - case 1: - message.newJobState = 1; - break; - case "SCHEDULED": - case 2: - message.newJobState = 2; - break; - case "RUNNING": - case 3: - message.newJobState = 3; - break; - case "SUCCEEDED": - case 4: - message.newJobState = 4; - break; - case "FAILED": - case 5: - message.newJobState = 5; - break; - case "DELETION_IN_PROGRESS": - case 6: - message.newJobState = 6; - break; - case "CANCELLATION_IN_PROGRESS": - case 7: - message.newJobState = 7; - break; - case "CANCELLED": - case 8: - message.newJobState = 8; - break; - } - switch (object.newTaskState) { - default: - if (typeof object.newTaskState === "number") { - message.newTaskState = object.newTaskState; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.newTaskState = 0; - break; - case "PENDING": - case 1: - message.newTaskState = 1; - break; - case "ASSIGNED": - case 2: - message.newTaskState = 2; - break; - case "RUNNING": - case 3: - message.newTaskState = 3; - break; - case "FAILED": - case 4: - message.newTaskState = 4; - break; - case "SUCCEEDED": - case 5: - message.newTaskState = 5; - break; - case "UNEXECUTED": - case 6: - message.newTaskState = 6; - break; - } - return message; - }; - - /** - * Creates a plain object from a Message message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.JobNotification.Message - * @static - * @param {google.cloud.batch.v1alpha.JobNotification.Message} message Message - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Message.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.newJobState = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.newTaskState = options.enums === String ? "STATE_UNSPECIFIED" : 0; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.batch.v1alpha.JobNotification.Type[message.type] === undefined ? message.type : $root.google.cloud.batch.v1alpha.JobNotification.Type[message.type] : message.type; - if (message.newJobState != null && message.hasOwnProperty("newJobState")) - object.newJobState = options.enums === String ? $root.google.cloud.batch.v1alpha.JobStatus.State[message.newJobState] === undefined ? message.newJobState : $root.google.cloud.batch.v1alpha.JobStatus.State[message.newJobState] : message.newJobState; - if (message.newTaskState != null && message.hasOwnProperty("newTaskState")) - object.newTaskState = options.enums === String ? $root.google.cloud.batch.v1alpha.TaskStatus.State[message.newTaskState] === undefined ? message.newTaskState : $root.google.cloud.batch.v1alpha.TaskStatus.State[message.newTaskState] : message.newTaskState; - return object; - }; - - /** - * Converts this Message to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.JobNotification.Message - * @instance - * @returns {Object.} JSON object - */ - Message.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Message - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.JobNotification.Message - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Message.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.JobNotification.Message"; - }; - - return Message; - })(); - - /** - * Type enum. - * @name google.cloud.batch.v1alpha.JobNotification.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} JOB_STATE_CHANGED=1 JOB_STATE_CHANGED value - * @property {number} TASK_STATE_CHANGED=2 TASK_STATE_CHANGED value - */ - JobNotification.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "JOB_STATE_CHANGED"] = 1; - values[valuesById[2] = "TASK_STATE_CHANGED"] = 2; - return values; - })(); - - return JobNotification; - })(); - - v1alpha.AllocationPolicy = (function() { - - /** - * Properties of an AllocationPolicy. - * @memberof google.cloud.batch.v1alpha - * @interface IAllocationPolicy - * @property {google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy|null} [location] AllocationPolicy location - * @property {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy|null} [instance] AllocationPolicy instance - * @property {Array.|null} [instances] AllocationPolicy instances - * @property {Array.|null} [instanceTemplates] AllocationPolicy instanceTemplates - * @property {Array.|null} [provisioningModels] AllocationPolicy provisioningModels - * @property {string|null} [serviceAccountEmail] AllocationPolicy serviceAccountEmail - * @property {google.cloud.batch.v1alpha.IServiceAccount|null} [serviceAccount] AllocationPolicy serviceAccount - * @property {Object.|null} [labels] AllocationPolicy labels - * @property {google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy|null} [network] AllocationPolicy network - * @property {google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy|null} [placement] AllocationPolicy placement - * @property {Array.|null} [tags] AllocationPolicy tags - */ - - /** - * Constructs a new AllocationPolicy. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents an AllocationPolicy. - * @implements IAllocationPolicy - * @constructor - * @param {google.cloud.batch.v1alpha.IAllocationPolicy=} [properties] Properties to set - */ - function AllocationPolicy(properties) { - this.instances = []; - this.instanceTemplates = []; - this.provisioningModels = []; - this.labels = {}; - this.tags = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AllocationPolicy location. - * @member {google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy|null|undefined} location - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @instance - */ - AllocationPolicy.prototype.location = null; - - /** - * AllocationPolicy instance. - * @member {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy|null|undefined} instance - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @instance - */ - AllocationPolicy.prototype.instance = null; - - /** - * AllocationPolicy instances. - * @member {Array.} instances - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @instance - */ - AllocationPolicy.prototype.instances = $util.emptyArray; - - /** - * AllocationPolicy instanceTemplates. - * @member {Array.} instanceTemplates - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @instance - */ - AllocationPolicy.prototype.instanceTemplates = $util.emptyArray; - - /** - * AllocationPolicy provisioningModels. - * @member {Array.} provisioningModels - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @instance - */ - AllocationPolicy.prototype.provisioningModels = $util.emptyArray; - - /** - * AllocationPolicy serviceAccountEmail. - * @member {string} serviceAccountEmail - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @instance - */ - AllocationPolicy.prototype.serviceAccountEmail = ""; - - /** - * AllocationPolicy serviceAccount. - * @member {google.cloud.batch.v1alpha.IServiceAccount|null|undefined} serviceAccount - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @instance - */ - AllocationPolicy.prototype.serviceAccount = null; - - /** - * AllocationPolicy labels. - * @member {Object.} labels - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @instance - */ - AllocationPolicy.prototype.labels = $util.emptyObject; - - /** - * AllocationPolicy network. - * @member {google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy|null|undefined} network - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @instance - */ - AllocationPolicy.prototype.network = null; - - /** - * AllocationPolicy placement. - * @member {google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy|null|undefined} placement - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @instance - */ - AllocationPolicy.prototype.placement = null; - - /** - * AllocationPolicy tags. - * @member {Array.} tags - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @instance - */ - AllocationPolicy.prototype.tags = $util.emptyArray; - - /** - * Creates a new AllocationPolicy instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @static - * @param {google.cloud.batch.v1alpha.IAllocationPolicy=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.AllocationPolicy} AllocationPolicy instance - */ - AllocationPolicy.create = function create(properties) { - return new AllocationPolicy(properties); - }; - - /** - * Encodes the specified AllocationPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @static - * @param {google.cloud.batch.v1alpha.IAllocationPolicy} message AllocationPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AllocationPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - $root.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.encode(message.location, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.encode(message.instance, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.instanceTemplates != null && message.instanceTemplates.length) - for (var i = 0; i < message.instanceTemplates.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.instanceTemplates[i]); - if (message.provisioningModels != null && message.provisioningModels.length) { - writer.uint32(/* id 4, wireType 2 =*/34).fork(); - for (var i = 0; i < message.provisioningModels.length; ++i) - writer.int32(message.provisioningModels[i]); - writer.ldelim(); - } - if (message.serviceAccountEmail != null && Object.hasOwnProperty.call(message, "serviceAccountEmail")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.serviceAccountEmail); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.network != null && Object.hasOwnProperty.call(message, "network")) - $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.encode(message.network, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.instances != null && message.instances.length) - for (var i = 0; i < message.instances.length; ++i) - $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.encode(message.instances[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) - $root.google.cloud.batch.v1alpha.ServiceAccount.encode(message.serviceAccount, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.placement != null && Object.hasOwnProperty.call(message, "placement")) - $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.encode(message.placement, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.tags != null && message.tags.length) - for (var i = 0; i < message.tags.length; ++i) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.tags[i]); - return writer; - }; - - /** - * Encodes the specified AllocationPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @static - * @param {google.cloud.batch.v1alpha.IAllocationPolicy} message AllocationPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AllocationPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AllocationPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.AllocationPolicy} AllocationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AllocationPolicy.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.location = $root.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.decode(reader, reader.uint32()); - break; - } - case 2: { - message.instance = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.decode(reader, reader.uint32()); - break; - } - case 8: { - if (!(message.instances && message.instances.length)) - message.instances = []; - message.instances.push($root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.instanceTemplates && message.instanceTemplates.length)) - message.instanceTemplates = []; - message.instanceTemplates.push(reader.string()); - break; - } - case 4: { - if (!(message.provisioningModels && message.provisioningModels.length)) - message.provisioningModels = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.provisioningModels.push(reader.int32()); - } else - message.provisioningModels.push(reader.int32()); - break; - } - case 5: { - message.serviceAccountEmail = reader.string(); - break; - } - case 9: { - message.serviceAccount = $root.google.cloud.batch.v1alpha.ServiceAccount.decode(reader, reader.uint32()); - break; - } - case 6: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 7: { - message.network = $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.decode(reader, reader.uint32()); - break; - } - case 10: { - message.placement = $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.decode(reader, reader.uint32()); - break; - } - case 11: { - if (!(message.tags && message.tags.length)) - message.tags = []; - message.tags.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AllocationPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.AllocationPolicy} AllocationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AllocationPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AllocationPolicy message. - * @function verify - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AllocationPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) { - var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.verify(message.location); - if (error) - return "location." + error; - } - if (message.instance != null && message.hasOwnProperty("instance")) { - var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.verify(message.instance); - if (error) - return "instance." + error; - } - if (message.instances != null && message.hasOwnProperty("instances")) { - if (!Array.isArray(message.instances)) - return "instances: array expected"; - for (var i = 0; i < message.instances.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.verify(message.instances[i]); - if (error) - return "instances." + error; - } - } - if (message.instanceTemplates != null && message.hasOwnProperty("instanceTemplates")) { - if (!Array.isArray(message.instanceTemplates)) - return "instanceTemplates: array expected"; - for (var i = 0; i < message.instanceTemplates.length; ++i) - if (!$util.isString(message.instanceTemplates[i])) - return "instanceTemplates: string[] expected"; - } - if (message.provisioningModels != null && message.hasOwnProperty("provisioningModels")) { - if (!Array.isArray(message.provisioningModels)) - return "provisioningModels: array expected"; - for (var i = 0; i < message.provisioningModels.length; ++i) - switch (message.provisioningModels[i]) { - default: - return "provisioningModels: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - } - if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) - if (!$util.isString(message.serviceAccountEmail)) - return "serviceAccountEmail: string expected"; - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) { - var error = $root.google.cloud.batch.v1alpha.ServiceAccount.verify(message.serviceAccount); - if (error) - return "serviceAccount." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.network != null && message.hasOwnProperty("network")) { - var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.verify(message.network); - if (error) - return "network." + error; - } - if (message.placement != null && message.hasOwnProperty("placement")) { - var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.verify(message.placement); - if (error) - return "placement." + error; - } - if (message.tags != null && message.hasOwnProperty("tags")) { - if (!Array.isArray(message.tags)) - return "tags: array expected"; - for (var i = 0; i < message.tags.length; ++i) - if (!$util.isString(message.tags[i])) - return "tags: string[] expected"; - } - return null; - }; - - /** - * Creates an AllocationPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.AllocationPolicy} AllocationPolicy - */ - AllocationPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy) - return object; - var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy(); - if (object.location != null) { - if (typeof object.location !== "object") - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.location: object expected"); - message.location = $root.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.fromObject(object.location); - } - if (object.instance != null) { - if (typeof object.instance !== "object") - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.instance: object expected"); - message.instance = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.fromObject(object.instance); - } - if (object.instances) { - if (!Array.isArray(object.instances)) - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.instances: array expected"); - message.instances = []; - for (var i = 0; i < object.instances.length; ++i) { - if (typeof object.instances[i] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.instances: object expected"); - message.instances[i] = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.fromObject(object.instances[i]); - } - } - if (object.instanceTemplates) { - if (!Array.isArray(object.instanceTemplates)) - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.instanceTemplates: array expected"); - message.instanceTemplates = []; - for (var i = 0; i < object.instanceTemplates.length; ++i) - message.instanceTemplates[i] = String(object.instanceTemplates[i]); - } - if (object.provisioningModels) { - if (!Array.isArray(object.provisioningModels)) - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.provisioningModels: array expected"); - message.provisioningModels = []; - for (var i = 0; i < object.provisioningModels.length; ++i) - switch (object.provisioningModels[i]) { - default: - if (typeof object.provisioningModels[i] === "number") { - message.provisioningModels[i] = object.provisioningModels[i]; - break; - } - case "PROVISIONING_MODEL_UNSPECIFIED": - case 0: - message.provisioningModels[i] = 0; - break; - case "STANDARD": - case 1: - message.provisioningModels[i] = 1; - break; - case "SPOT": - case 2: - message.provisioningModels[i] = 2; - break; - case "PREEMPTIBLE": - case 3: - message.provisioningModels[i] = 3; - break; - } - } - if (object.serviceAccountEmail != null) - message.serviceAccountEmail = String(object.serviceAccountEmail); - if (object.serviceAccount != null) { - if (typeof object.serviceAccount !== "object") - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.serviceAccount: object expected"); - message.serviceAccount = $root.google.cloud.batch.v1alpha.ServiceAccount.fromObject(object.serviceAccount); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - if (object.network != null) { - if (typeof object.network !== "object") - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.network: object expected"); - message.network = $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.fromObject(object.network); - } - if (object.placement != null) { - if (typeof object.placement !== "object") - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.placement: object expected"); - message.placement = $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.fromObject(object.placement); - } - if (object.tags) { - if (!Array.isArray(object.tags)) - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.tags: array expected"); - message.tags = []; - for (var i = 0; i < object.tags.length; ++i) - message.tags[i] = String(object.tags[i]); - } - return message; - }; - - /** - * Creates a plain object from an AllocationPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy} message AllocationPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AllocationPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.instanceTemplates = []; - object.provisioningModels = []; - object.instances = []; - object.tags = []; - } - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.location = null; - object.instance = null; - object.serviceAccountEmail = ""; - object.network = null; - object.serviceAccount = null; - object.placement = null; - } - if (message.location != null && message.hasOwnProperty("location")) - object.location = $root.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.toObject(message.location, options); - if (message.instance != null && message.hasOwnProperty("instance")) - object.instance = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.toObject(message.instance, options); - if (message.instanceTemplates && message.instanceTemplates.length) { - object.instanceTemplates = []; - for (var j = 0; j < message.instanceTemplates.length; ++j) - object.instanceTemplates[j] = message.instanceTemplates[j]; - } - if (message.provisioningModels && message.provisioningModels.length) { - object.provisioningModels = []; - for (var j = 0; j < message.provisioningModels.length; ++j) - object.provisioningModels[j] = options.enums === String ? $root.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel[message.provisioningModels[j]] === undefined ? message.provisioningModels[j] : $root.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel[message.provisioningModels[j]] : message.provisioningModels[j]; - } - if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) - object.serviceAccountEmail = message.serviceAccountEmail; - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.network != null && message.hasOwnProperty("network")) - object.network = $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.toObject(message.network, options); - if (message.instances && message.instances.length) { - object.instances = []; - for (var j = 0; j < message.instances.length; ++j) - object.instances[j] = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.toObject(message.instances[j], options); - } - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - object.serviceAccount = $root.google.cloud.batch.v1alpha.ServiceAccount.toObject(message.serviceAccount, options); - if (message.placement != null && message.hasOwnProperty("placement")) - object.placement = $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.toObject(message.placement, options); - if (message.tags && message.tags.length) { - object.tags = []; - for (var j = 0; j < message.tags.length; ++j) - object.tags[j] = message.tags[j]; - } - return object; - }; - - /** - * Converts this AllocationPolicy to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @instance - * @returns {Object.} JSON object - */ - AllocationPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AllocationPolicy - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AllocationPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy"; - }; - - AllocationPolicy.LocationPolicy = (function() { - - /** - * Properties of a LocationPolicy. - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @interface ILocationPolicy - * @property {Array.|null} [allowedLocations] LocationPolicy allowedLocations - * @property {Array.|null} [deniedLocations] LocationPolicy deniedLocations - */ - - /** - * Constructs a new LocationPolicy. - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @classdesc Represents a LocationPolicy. - * @implements ILocationPolicy - * @constructor - * @param {google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy=} [properties] Properties to set - */ - function LocationPolicy(properties) { - this.allowedLocations = []; - this.deniedLocations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LocationPolicy allowedLocations. - * @member {Array.} allowedLocations - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy - * @instance - */ - LocationPolicy.prototype.allowedLocations = $util.emptyArray; - - /** - * LocationPolicy deniedLocations. - * @member {Array.} deniedLocations - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy - * @instance - */ - LocationPolicy.prototype.deniedLocations = $util.emptyArray; - - /** - * Creates a new LocationPolicy instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy} LocationPolicy instance - */ - LocationPolicy.create = function create(properties) { - return new LocationPolicy(properties); - }; - - /** - * Encodes the specified LocationPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy} message LocationPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LocationPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowedLocations != null && message.allowedLocations.length) - for (var i = 0; i < message.allowedLocations.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedLocations[i]); - if (message.deniedLocations != null && message.deniedLocations.length) - for (var i = 0; i < message.deniedLocations.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.deniedLocations[i]); - return writer; - }; - - /** - * Encodes the specified LocationPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.ILocationPolicy} message LocationPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LocationPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LocationPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy} LocationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LocationPolicy.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.allowedLocations && message.allowedLocations.length)) - message.allowedLocations = []; - message.allowedLocations.push(reader.string()); - break; - } - case 2: { - if (!(message.deniedLocations && message.deniedLocations.length)) - message.deniedLocations = []; - message.deniedLocations.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LocationPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy} LocationPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LocationPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LocationPolicy message. - * @function verify - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LocationPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowedLocations != null && message.hasOwnProperty("allowedLocations")) { - if (!Array.isArray(message.allowedLocations)) - return "allowedLocations: array expected"; - for (var i = 0; i < message.allowedLocations.length; ++i) - if (!$util.isString(message.allowedLocations[i])) - return "allowedLocations: string[] expected"; - } - if (message.deniedLocations != null && message.hasOwnProperty("deniedLocations")) { - if (!Array.isArray(message.deniedLocations)) - return "deniedLocations: array expected"; - for (var i = 0; i < message.deniedLocations.length; ++i) - if (!$util.isString(message.deniedLocations[i])) - return "deniedLocations: string[] expected"; - } - return null; - }; - - /** - * Creates a LocationPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy} LocationPolicy - */ - LocationPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy) - return object; - var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy(); - if (object.allowedLocations) { - if (!Array.isArray(object.allowedLocations)) - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.allowedLocations: array expected"); - message.allowedLocations = []; - for (var i = 0; i < object.allowedLocations.length; ++i) - message.allowedLocations[i] = String(object.allowedLocations[i]); - } - if (object.deniedLocations) { - if (!Array.isArray(object.deniedLocations)) - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.deniedLocations: array expected"); - message.deniedLocations = []; - for (var i = 0; i < object.deniedLocations.length; ++i) - message.deniedLocations[i] = String(object.deniedLocations[i]); - } - return message; - }; - - /** - * Creates a plain object from a LocationPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy} message LocationPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LocationPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.allowedLocations = []; - object.deniedLocations = []; - } - if (message.allowedLocations && message.allowedLocations.length) { - object.allowedLocations = []; - for (var j = 0; j < message.allowedLocations.length; ++j) - object.allowedLocations[j] = message.allowedLocations[j]; - } - if (message.deniedLocations && message.deniedLocations.length) { - object.deniedLocations = []; - for (var j = 0; j < message.deniedLocations.length; ++j) - object.deniedLocations[j] = message.deniedLocations[j]; - } - return object; - }; - - /** - * Converts this LocationPolicy to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy - * @instance - * @returns {Object.} JSON object - */ - LocationPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LocationPolicy - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LocationPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy"; - }; - - return LocationPolicy; - })(); - - AllocationPolicy.Disk = (function() { - - /** - * Properties of a Disk. - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @interface IDisk - * @property {string|null} [image] Disk image - * @property {string|null} [snapshot] Disk snapshot - * @property {string|null} [type] Disk type - * @property {number|Long|null} [sizeGb] Disk sizeGb - * @property {string|null} [diskInterface] Disk diskInterface - */ - - /** - * Constructs a new Disk. - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @classdesc Represents a Disk. - * @implements IDisk - * @constructor - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IDisk=} [properties] Properties to set - */ - function Disk(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Disk image. - * @member {string|null|undefined} image - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk - * @instance - */ - Disk.prototype.image = null; - - /** - * Disk snapshot. - * @member {string|null|undefined} snapshot - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk - * @instance - */ - Disk.prototype.snapshot = null; - - /** - * Disk type. - * @member {string} type - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk - * @instance - */ - Disk.prototype.type = ""; - - /** - * Disk sizeGb. - * @member {number|Long} sizeGb - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk - * @instance - */ - Disk.prototype.sizeGb = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Disk diskInterface. - * @member {string} diskInterface - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk - * @instance - */ - Disk.prototype.diskInterface = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Disk dataSource. - * @member {"image"|"snapshot"|undefined} dataSource - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk - * @instance - */ - Object.defineProperty(Disk.prototype, "dataSource", { - get: $util.oneOfGetter($oneOfFields = ["image", "snapshot"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Disk instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IDisk=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.Disk} Disk instance - */ - Disk.create = function create(properties) { - return new Disk(properties); - }; - - /** - * Encodes the specified Disk message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.Disk.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IDisk} message Disk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Disk.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.sizeGb != null && Object.hasOwnProperty.call(message, "sizeGb")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.sizeGb); - if (message.image != null && Object.hasOwnProperty.call(message, "image")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.image); - if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.snapshot); - if (message.diskInterface != null && Object.hasOwnProperty.call(message, "diskInterface")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.diskInterface); - return writer; - }; - - /** - * Encodes the specified Disk message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.Disk.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IDisk} message Disk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Disk.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Disk message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.Disk} Disk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Disk.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 4: { - message.image = reader.string(); - break; - } - case 5: { - message.snapshot = reader.string(); - break; - } - case 1: { - message.type = reader.string(); - break; - } - case 2: { - message.sizeGb = reader.int64(); - break; - } - case 6: { - message.diskInterface = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Disk message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.Disk} Disk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Disk.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Disk message. - * @function verify - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Disk.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.image != null && message.hasOwnProperty("image")) { - properties.dataSource = 1; - if (!$util.isString(message.image)) - return "image: string expected"; - } - if (message.snapshot != null && message.hasOwnProperty("snapshot")) { - if (properties.dataSource === 1) - return "dataSource: multiple values"; - properties.dataSource = 1; - if (!$util.isString(message.snapshot)) - return "snapshot: string expected"; - } - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) - if (!$util.isInteger(message.sizeGb) && !(message.sizeGb && $util.isInteger(message.sizeGb.low) && $util.isInteger(message.sizeGb.high))) - return "sizeGb: integer|Long expected"; - if (message.diskInterface != null && message.hasOwnProperty("diskInterface")) - if (!$util.isString(message.diskInterface)) - return "diskInterface: string expected"; - return null; - }; - - /** - * Creates a Disk message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.Disk} Disk - */ - Disk.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk) - return object; - var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk(); - if (object.image != null) - message.image = String(object.image); - if (object.snapshot != null) - message.snapshot = String(object.snapshot); - if (object.type != null) - message.type = String(object.type); - if (object.sizeGb != null) - if ($util.Long) - (message.sizeGb = $util.Long.fromValue(object.sizeGb)).unsigned = false; - else if (typeof object.sizeGb === "string") - message.sizeGb = parseInt(object.sizeGb, 10); - else if (typeof object.sizeGb === "number") - message.sizeGb = object.sizeGb; - else if (typeof object.sizeGb === "object") - message.sizeGb = new $util.LongBits(object.sizeGb.low >>> 0, object.sizeGb.high >>> 0).toNumber(); - if (object.diskInterface != null) - message.diskInterface = String(object.diskInterface); - return message; - }; - - /** - * Creates a plain object from a Disk message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.Disk} message Disk - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Disk.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.sizeGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sizeGb = options.longs === String ? "0" : 0; - object.diskInterface = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) - if (typeof message.sizeGb === "number") - object.sizeGb = options.longs === String ? String(message.sizeGb) : message.sizeGb; - else - object.sizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.sizeGb) : options.longs === Number ? new $util.LongBits(message.sizeGb.low >>> 0, message.sizeGb.high >>> 0).toNumber() : message.sizeGb; - if (message.image != null && message.hasOwnProperty("image")) { - object.image = message.image; - if (options.oneofs) - object.dataSource = "image"; - } - if (message.snapshot != null && message.hasOwnProperty("snapshot")) { - object.snapshot = message.snapshot; - if (options.oneofs) - object.dataSource = "snapshot"; - } - if (message.diskInterface != null && message.hasOwnProperty("diskInterface")) - object.diskInterface = message.diskInterface; - return object; - }; - - /** - * Converts this Disk to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk - * @instance - * @returns {Object.} JSON object - */ - Disk.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Disk - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Disk - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Disk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy.Disk"; - }; - - return Disk; - })(); - - AllocationPolicy.AttachedDisk = (function() { - - /** - * Properties of an AttachedDisk. - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @interface IAttachedDisk - * @property {google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null} [newDisk] AttachedDisk newDisk - * @property {string|null} [existingDisk] AttachedDisk existingDisk - * @property {string|null} [deviceName] AttachedDisk deviceName - */ - - /** - * Constructs a new AttachedDisk. - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @classdesc Represents an AttachedDisk. - * @implements IAttachedDisk - * @constructor - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk=} [properties] Properties to set - */ - function AttachedDisk(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AttachedDisk newDisk. - * @member {google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null|undefined} newDisk - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk - * @instance - */ - AttachedDisk.prototype.newDisk = null; - - /** - * AttachedDisk existingDisk. - * @member {string|null|undefined} existingDisk - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk - * @instance - */ - AttachedDisk.prototype.existingDisk = null; - - /** - * AttachedDisk deviceName. - * @member {string} deviceName - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk - * @instance - */ - AttachedDisk.prototype.deviceName = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * AttachedDisk attached. - * @member {"newDisk"|"existingDisk"|undefined} attached - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk - * @instance - */ - Object.defineProperty(AttachedDisk.prototype, "attached", { - get: $util.oneOfGetter($oneOfFields = ["newDisk", "existingDisk"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new AttachedDisk instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk} AttachedDisk instance - */ - AttachedDisk.create = function create(properties) { - return new AttachedDisk(properties); - }; - - /** - * Encodes the specified AttachedDisk message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk} message AttachedDisk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttachedDisk.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.newDisk != null && Object.hasOwnProperty.call(message, "newDisk")) - $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.encode(message.newDisk, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.existingDisk != null && Object.hasOwnProperty.call(message, "existingDisk")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.existingDisk); - if (message.deviceName != null && Object.hasOwnProperty.call(message, "deviceName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.deviceName); - return writer; - }; - - /** - * Encodes the specified AttachedDisk message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk} message AttachedDisk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttachedDisk.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AttachedDisk message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk} AttachedDisk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttachedDisk.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.newDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.decode(reader, reader.uint32()); - break; - } - case 2: { - message.existingDisk = reader.string(); - break; - } - case 3: { - message.deviceName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AttachedDisk message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk} AttachedDisk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttachedDisk.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AttachedDisk message. - * @function verify - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AttachedDisk.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.newDisk != null && message.hasOwnProperty("newDisk")) { - properties.attached = 1; - { - var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.verify(message.newDisk); - if (error) - return "newDisk." + error; - } - } - if (message.existingDisk != null && message.hasOwnProperty("existingDisk")) { - if (properties.attached === 1) - return "attached: multiple values"; - properties.attached = 1; - if (!$util.isString(message.existingDisk)) - return "existingDisk: string expected"; - } - if (message.deviceName != null && message.hasOwnProperty("deviceName")) - if (!$util.isString(message.deviceName)) - return "deviceName: string expected"; - return null; - }; - - /** - * Creates an AttachedDisk message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk} AttachedDisk - */ - AttachedDisk.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk) - return object; - var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk(); - if (object.newDisk != null) { - if (typeof object.newDisk !== "object") - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.newDisk: object expected"); - message.newDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.fromObject(object.newDisk); - } - if (object.existingDisk != null) - message.existingDisk = String(object.existingDisk); - if (object.deviceName != null) - message.deviceName = String(object.deviceName); - return message; - }; - - /** - * Creates a plain object from an AttachedDisk message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk} message AttachedDisk - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AttachedDisk.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.deviceName = ""; - if (message.newDisk != null && message.hasOwnProperty("newDisk")) { - object.newDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.toObject(message.newDisk, options); - if (options.oneofs) - object.attached = "newDisk"; - } - if (message.existingDisk != null && message.hasOwnProperty("existingDisk")) { - object.existingDisk = message.existingDisk; - if (options.oneofs) - object.attached = "existingDisk"; - } - if (message.deviceName != null && message.hasOwnProperty("deviceName")) - object.deviceName = message.deviceName; - return object; - }; - - /** - * Converts this AttachedDisk to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk - * @instance - * @returns {Object.} JSON object - */ - AttachedDisk.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AttachedDisk - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AttachedDisk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk"; - }; - - return AttachedDisk; - })(); - - AllocationPolicy.Accelerator = (function() { - - /** - * Properties of an Accelerator. - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @interface IAccelerator - * @property {string|null} [type] Accelerator type - * @property {number|Long|null} [count] Accelerator count - * @property {boolean|null} [installGpuDrivers] Accelerator installGpuDrivers - * @property {string|null} [driverVersion] Accelerator driverVersion - */ - - /** - * Constructs a new Accelerator. - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @classdesc Represents an Accelerator. - * @implements IAccelerator - * @constructor - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator=} [properties] Properties to set - */ - function Accelerator(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Accelerator type. - * @member {string} type - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator - * @instance - */ - Accelerator.prototype.type = ""; - - /** - * Accelerator count. - * @member {number|Long} count - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator - * @instance - */ - Accelerator.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Accelerator installGpuDrivers. - * @member {boolean} installGpuDrivers - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator - * @instance - */ - Accelerator.prototype.installGpuDrivers = false; - - /** - * Accelerator driverVersion. - * @member {string} driverVersion - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator - * @instance - */ - Accelerator.prototype.driverVersion = ""; - - /** - * Creates a new Accelerator instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.Accelerator} Accelerator instance - */ - Accelerator.create = function create(properties) { - return new Accelerator(properties); - }; - - /** - * Encodes the specified Accelerator message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator} message Accelerator message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Accelerator.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); - if (message.installGpuDrivers != null && Object.hasOwnProperty.call(message, "installGpuDrivers")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.installGpuDrivers); - if (message.driverVersion != null && Object.hasOwnProperty.call(message, "driverVersion")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.driverVersion); - return writer; - }; - - /** - * Encodes the specified Accelerator message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator} message Accelerator message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Accelerator.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Accelerator message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.Accelerator} Accelerator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Accelerator.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - message.count = reader.int64(); - break; - } - case 3: { - message.installGpuDrivers = reader.bool(); - break; - } - case 4: { - message.driverVersion = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Accelerator message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.Accelerator} Accelerator - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Accelerator.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Accelerator message. - * @function verify - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Accelerator.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) - return "count: integer|Long expected"; - if (message.installGpuDrivers != null && message.hasOwnProperty("installGpuDrivers")) - if (typeof message.installGpuDrivers !== "boolean") - return "installGpuDrivers: boolean expected"; - if (message.driverVersion != null && message.hasOwnProperty("driverVersion")) - if (!$util.isString(message.driverVersion)) - return "driverVersion: string expected"; - return null; - }; - - /** - * Creates an Accelerator message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.Accelerator} Accelerator - */ - Accelerator.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator) - return object; - var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator(); - if (object.type != null) - message.type = String(object.type); - if (object.count != null) - if ($util.Long) - (message.count = $util.Long.fromValue(object.count)).unsigned = false; - else if (typeof object.count === "string") - message.count = parseInt(object.count, 10); - else if (typeof object.count === "number") - message.count = object.count; - else if (typeof object.count === "object") - message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); - if (object.installGpuDrivers != null) - message.installGpuDrivers = Boolean(object.installGpuDrivers); - if (object.driverVersion != null) - message.driverVersion = String(object.driverVersion); - return message; - }; - - /** - * Creates a plain object from an Accelerator message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.Accelerator} message Accelerator - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Accelerator.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.count = options.longs === String ? "0" : 0; - object.installGpuDrivers = false; - object.driverVersion = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.count != null && message.hasOwnProperty("count")) - if (typeof message.count === "number") - object.count = options.longs === String ? String(message.count) : message.count; - else - object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; - if (message.installGpuDrivers != null && message.hasOwnProperty("installGpuDrivers")) - object.installGpuDrivers = message.installGpuDrivers; - if (message.driverVersion != null && message.hasOwnProperty("driverVersion")) - object.driverVersion = message.driverVersion; - return object; - }; - - /** - * Converts this Accelerator to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator - * @instance - * @returns {Object.} JSON object - */ - Accelerator.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Accelerator - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.Accelerator - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Accelerator.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy.Accelerator"; - }; - - return Accelerator; - })(); - - AllocationPolicy.InstancePolicy = (function() { - - /** - * Properties of an InstancePolicy. - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @interface IInstancePolicy - * @property {Array.|null} [allowedMachineTypes] InstancePolicy allowedMachineTypes - * @property {string|null} [machineType] InstancePolicy machineType - * @property {string|null} [minCpuPlatform] InstancePolicy minCpuPlatform - * @property {google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel|null} [provisioningModel] InstancePolicy provisioningModel - * @property {Array.|null} [accelerators] InstancePolicy accelerators - * @property {google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null} [bootDisk] InstancePolicy bootDisk - * @property {Array.|null} [disks] InstancePolicy disks - * @property {string|null} [reservation] InstancePolicy reservation - */ - - /** - * Constructs a new InstancePolicy. - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @classdesc Represents an InstancePolicy. - * @implements IInstancePolicy - * @constructor - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy=} [properties] Properties to set - */ - function InstancePolicy(properties) { - this.allowedMachineTypes = []; - this.accelerators = []; - this.disks = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InstancePolicy allowedMachineTypes. - * @member {Array.} allowedMachineTypes - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy - * @instance - */ - InstancePolicy.prototype.allowedMachineTypes = $util.emptyArray; - - /** - * InstancePolicy machineType. - * @member {string} machineType - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy - * @instance - */ - InstancePolicy.prototype.machineType = ""; - - /** - * InstancePolicy minCpuPlatform. - * @member {string} minCpuPlatform - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy - * @instance - */ - InstancePolicy.prototype.minCpuPlatform = ""; - - /** - * InstancePolicy provisioningModel. - * @member {google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel} provisioningModel - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy - * @instance - */ - InstancePolicy.prototype.provisioningModel = 0; - - /** - * InstancePolicy accelerators. - * @member {Array.} accelerators - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy - * @instance - */ - InstancePolicy.prototype.accelerators = $util.emptyArray; - - /** - * InstancePolicy bootDisk. - * @member {google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null|undefined} bootDisk - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy - * @instance - */ - InstancePolicy.prototype.bootDisk = null; - - /** - * InstancePolicy disks. - * @member {Array.} disks - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy - * @instance - */ - InstancePolicy.prototype.disks = $util.emptyArray; - - /** - * InstancePolicy reservation. - * @member {string} reservation - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy - * @instance - */ - InstancePolicy.prototype.reservation = ""; - - /** - * Creates a new InstancePolicy instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy} InstancePolicy instance - */ - InstancePolicy.create = function create(properties) { - return new InstancePolicy(properties); - }; - - /** - * Encodes the specified InstancePolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy} message InstancePolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstancePolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowedMachineTypes != null && message.allowedMachineTypes.length) - for (var i = 0; i < message.allowedMachineTypes.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedMachineTypes[i]); - if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.machineType); - if (message.minCpuPlatform != null && Object.hasOwnProperty.call(message, "minCpuPlatform")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.minCpuPlatform); - if (message.provisioningModel != null && Object.hasOwnProperty.call(message, "provisioningModel")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.provisioningModel); - if (message.accelerators != null && message.accelerators.length) - for (var i = 0; i < message.accelerators.length; ++i) - $root.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.encode(message.accelerators[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.disks != null && message.disks.length) - for (var i = 0; i < message.disks.length; ++i) - $root.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.encode(message.disks[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.reservation != null && Object.hasOwnProperty.call(message, "reservation")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.reservation); - if (message.bootDisk != null && Object.hasOwnProperty.call(message, "bootDisk")) - $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.encode(message.bootDisk, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified InstancePolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy} message InstancePolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstancePolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InstancePolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy} InstancePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstancePolicy.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.allowedMachineTypes && message.allowedMachineTypes.length)) - message.allowedMachineTypes = []; - message.allowedMachineTypes.push(reader.string()); - break; - } - case 2: { - message.machineType = reader.string(); - break; - } - case 3: { - message.minCpuPlatform = reader.string(); - break; - } - case 4: { - message.provisioningModel = reader.int32(); - break; - } - case 5: { - if (!(message.accelerators && message.accelerators.length)) - message.accelerators = []; - message.accelerators.push($root.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.decode(reader, reader.uint32())); - break; - } - case 8: { - message.bootDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.decode(reader, reader.uint32()); - break; - } - case 6: { - if (!(message.disks && message.disks.length)) - message.disks = []; - message.disks.push($root.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.decode(reader, reader.uint32())); - break; - } - case 7: { - message.reservation = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InstancePolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy} InstancePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstancePolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InstancePolicy message. - * @function verify - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstancePolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowedMachineTypes != null && message.hasOwnProperty("allowedMachineTypes")) { - if (!Array.isArray(message.allowedMachineTypes)) - return "allowedMachineTypes: array expected"; - for (var i = 0; i < message.allowedMachineTypes.length; ++i) - if (!$util.isString(message.allowedMachineTypes[i])) - return "allowedMachineTypes: string[] expected"; - } - if (message.machineType != null && message.hasOwnProperty("machineType")) - if (!$util.isString(message.machineType)) - return "machineType: string expected"; - if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) - if (!$util.isString(message.minCpuPlatform)) - return "minCpuPlatform: string expected"; - if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) - switch (message.provisioningModel) { - default: - return "provisioningModel: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.accelerators != null && message.hasOwnProperty("accelerators")) { - if (!Array.isArray(message.accelerators)) - return "accelerators: array expected"; - for (var i = 0; i < message.accelerators.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.verify(message.accelerators[i]); - if (error) - return "accelerators." + error; - } - } - if (message.bootDisk != null && message.hasOwnProperty("bootDisk")) { - var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.verify(message.bootDisk); - if (error) - return "bootDisk." + error; - } - if (message.disks != null && message.hasOwnProperty("disks")) { - if (!Array.isArray(message.disks)) - return "disks: array expected"; - for (var i = 0; i < message.disks.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.verify(message.disks[i]); - if (error) - return "disks." + error; - } - } - if (message.reservation != null && message.hasOwnProperty("reservation")) - if (!$util.isString(message.reservation)) - return "reservation: string expected"; - return null; - }; - - /** - * Creates an InstancePolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy} InstancePolicy - */ - InstancePolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy) - return object; - var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy(); - if (object.allowedMachineTypes) { - if (!Array.isArray(object.allowedMachineTypes)) - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.allowedMachineTypes: array expected"); - message.allowedMachineTypes = []; - for (var i = 0; i < object.allowedMachineTypes.length; ++i) - message.allowedMachineTypes[i] = String(object.allowedMachineTypes[i]); - } - if (object.machineType != null) - message.machineType = String(object.machineType); - if (object.minCpuPlatform != null) - message.minCpuPlatform = String(object.minCpuPlatform); - switch (object.provisioningModel) { - default: - if (typeof object.provisioningModel === "number") { - message.provisioningModel = object.provisioningModel; - break; - } - break; - case "PROVISIONING_MODEL_UNSPECIFIED": - case 0: - message.provisioningModel = 0; - break; - case "STANDARD": - case 1: - message.provisioningModel = 1; - break; - case "SPOT": - case 2: - message.provisioningModel = 2; - break; - case "PREEMPTIBLE": - case 3: - message.provisioningModel = 3; - break; - } - if (object.accelerators) { - if (!Array.isArray(object.accelerators)) - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.accelerators: array expected"); - message.accelerators = []; - for (var i = 0; i < object.accelerators.length; ++i) { - if (typeof object.accelerators[i] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.accelerators: object expected"); - message.accelerators[i] = $root.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.fromObject(object.accelerators[i]); - } - } - if (object.bootDisk != null) { - if (typeof object.bootDisk !== "object") - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.bootDisk: object expected"); - message.bootDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.fromObject(object.bootDisk); - } - if (object.disks) { - if (!Array.isArray(object.disks)) - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.disks: array expected"); - message.disks = []; - for (var i = 0; i < object.disks.length; ++i) { - if (typeof object.disks[i] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.disks: object expected"); - message.disks[i] = $root.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.fromObject(object.disks[i]); - } - } - if (object.reservation != null) - message.reservation = String(object.reservation); - return message; - }; - - /** - * Creates a plain object from an InstancePolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy} message InstancePolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstancePolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.allowedMachineTypes = []; - object.accelerators = []; - object.disks = []; - } - if (options.defaults) { - object.machineType = ""; - object.minCpuPlatform = ""; - object.provisioningModel = options.enums === String ? "PROVISIONING_MODEL_UNSPECIFIED" : 0; - object.reservation = ""; - object.bootDisk = null; - } - if (message.allowedMachineTypes && message.allowedMachineTypes.length) { - object.allowedMachineTypes = []; - for (var j = 0; j < message.allowedMachineTypes.length; ++j) - object.allowedMachineTypes[j] = message.allowedMachineTypes[j]; - } - if (message.machineType != null && message.hasOwnProperty("machineType")) - object.machineType = message.machineType; - if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) - object.minCpuPlatform = message.minCpuPlatform; - if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) - object.provisioningModel = options.enums === String ? $root.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel[message.provisioningModel] === undefined ? message.provisioningModel : $root.google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel[message.provisioningModel] : message.provisioningModel; - if (message.accelerators && message.accelerators.length) { - object.accelerators = []; - for (var j = 0; j < message.accelerators.length; ++j) - object.accelerators[j] = $root.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.toObject(message.accelerators[j], options); - } - if (message.disks && message.disks.length) { - object.disks = []; - for (var j = 0; j < message.disks.length; ++j) - object.disks[j] = $root.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.toObject(message.disks[j], options); - } - if (message.reservation != null && message.hasOwnProperty("reservation")) - object.reservation = message.reservation; - if (message.bootDisk != null && message.hasOwnProperty("bootDisk")) - object.bootDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.toObject(message.bootDisk, options); - return object; - }; - - /** - * Converts this InstancePolicy to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy - * @instance - * @returns {Object.} JSON object - */ - InstancePolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InstancePolicy - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstancePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy"; - }; - - return InstancePolicy; - })(); - - AllocationPolicy.InstancePolicyOrTemplate = (function() { - - /** - * Properties of an InstancePolicyOrTemplate. - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @interface IInstancePolicyOrTemplate - * @property {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy|null} [policy] InstancePolicyOrTemplate policy - * @property {string|null} [instanceTemplate] InstancePolicyOrTemplate instanceTemplate - * @property {boolean|null} [installGpuDrivers] InstancePolicyOrTemplate installGpuDrivers - * @property {boolean|null} [installOpsAgent] InstancePolicyOrTemplate installOpsAgent - * @property {boolean|null} [blockProjectSshKeys] InstancePolicyOrTemplate blockProjectSshKeys - */ - - /** - * Constructs a new InstancePolicyOrTemplate. - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @classdesc Represents an InstancePolicyOrTemplate. - * @implements IInstancePolicyOrTemplate - * @constructor - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate=} [properties] Properties to set - */ - function InstancePolicyOrTemplate(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InstancePolicyOrTemplate policy. - * @member {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicy|null|undefined} policy - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate - * @instance - */ - InstancePolicyOrTemplate.prototype.policy = null; - - /** - * InstancePolicyOrTemplate instanceTemplate. - * @member {string|null|undefined} instanceTemplate - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate - * @instance - */ - InstancePolicyOrTemplate.prototype.instanceTemplate = null; - - /** - * InstancePolicyOrTemplate installGpuDrivers. - * @member {boolean} installGpuDrivers - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate - * @instance - */ - InstancePolicyOrTemplate.prototype.installGpuDrivers = false; - - /** - * InstancePolicyOrTemplate installOpsAgent. - * @member {boolean} installOpsAgent - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate - * @instance - */ - InstancePolicyOrTemplate.prototype.installOpsAgent = false; - - /** - * InstancePolicyOrTemplate blockProjectSshKeys. - * @member {boolean} blockProjectSshKeys - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate - * @instance - */ - InstancePolicyOrTemplate.prototype.blockProjectSshKeys = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * InstancePolicyOrTemplate policyTemplate. - * @member {"policy"|"instanceTemplate"|undefined} policyTemplate - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate - * @instance - */ - Object.defineProperty(InstancePolicyOrTemplate.prototype, "policyTemplate", { - get: $util.oneOfGetter($oneOfFields = ["policy", "instanceTemplate"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new InstancePolicyOrTemplate instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate} InstancePolicyOrTemplate instance - */ - InstancePolicyOrTemplate.create = function create(properties) { - return new InstancePolicyOrTemplate(properties); - }; - - /** - * Encodes the specified InstancePolicyOrTemplate message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate} message InstancePolicyOrTemplate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstancePolicyOrTemplate.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) - $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.encode(message.policy, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.instanceTemplate != null && Object.hasOwnProperty.call(message, "instanceTemplate")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceTemplate); - if (message.installGpuDrivers != null && Object.hasOwnProperty.call(message, "installGpuDrivers")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.installGpuDrivers); - if (message.installOpsAgent != null && Object.hasOwnProperty.call(message, "installOpsAgent")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.installOpsAgent); - if (message.blockProjectSshKeys != null && Object.hasOwnProperty.call(message, "blockProjectSshKeys")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.blockProjectSshKeys); - return writer; - }; - - /** - * Encodes the specified InstancePolicyOrTemplate message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IInstancePolicyOrTemplate} message InstancePolicyOrTemplate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstancePolicyOrTemplate.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InstancePolicyOrTemplate message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate} InstancePolicyOrTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstancePolicyOrTemplate.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.policy = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.decode(reader, reader.uint32()); - break; - } - case 2: { - message.instanceTemplate = reader.string(); - break; - } - case 3: { - message.installGpuDrivers = reader.bool(); - break; - } - case 4: { - message.installOpsAgent = reader.bool(); - break; - } - case 5: { - message.blockProjectSshKeys = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InstancePolicyOrTemplate message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate} InstancePolicyOrTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstancePolicyOrTemplate.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InstancePolicyOrTemplate message. - * @function verify - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstancePolicyOrTemplate.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.policy != null && message.hasOwnProperty("policy")) { - properties.policyTemplate = 1; - { - var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.verify(message.policy); - if (error) - return "policy." + error; - } - } - if (message.instanceTemplate != null && message.hasOwnProperty("instanceTemplate")) { - if (properties.policyTemplate === 1) - return "policyTemplate: multiple values"; - properties.policyTemplate = 1; - if (!$util.isString(message.instanceTemplate)) - return "instanceTemplate: string expected"; - } - if (message.installGpuDrivers != null && message.hasOwnProperty("installGpuDrivers")) - if (typeof message.installGpuDrivers !== "boolean") - return "installGpuDrivers: boolean expected"; - if (message.installOpsAgent != null && message.hasOwnProperty("installOpsAgent")) - if (typeof message.installOpsAgent !== "boolean") - return "installOpsAgent: boolean expected"; - if (message.blockProjectSshKeys != null && message.hasOwnProperty("blockProjectSshKeys")) - if (typeof message.blockProjectSshKeys !== "boolean") - return "blockProjectSshKeys: boolean expected"; - return null; - }; - - /** - * Creates an InstancePolicyOrTemplate message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate} InstancePolicyOrTemplate - */ - InstancePolicyOrTemplate.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate) - return object; - var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate(); - if (object.policy != null) { - if (typeof object.policy !== "object") - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.policy: object expected"); - message.policy = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.fromObject(object.policy); - } - if (object.instanceTemplate != null) - message.instanceTemplate = String(object.instanceTemplate); - if (object.installGpuDrivers != null) - message.installGpuDrivers = Boolean(object.installGpuDrivers); - if (object.installOpsAgent != null) - message.installOpsAgent = Boolean(object.installOpsAgent); - if (object.blockProjectSshKeys != null) - message.blockProjectSshKeys = Boolean(object.blockProjectSshKeys); - return message; - }; - - /** - * Creates a plain object from an InstancePolicyOrTemplate message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate} message InstancePolicyOrTemplate - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstancePolicyOrTemplate.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.installGpuDrivers = false; - object.installOpsAgent = false; - object.blockProjectSshKeys = false; - } - if (message.policy != null && message.hasOwnProperty("policy")) { - object.policy = $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.toObject(message.policy, options); - if (options.oneofs) - object.policyTemplate = "policy"; - } - if (message.instanceTemplate != null && message.hasOwnProperty("instanceTemplate")) { - object.instanceTemplate = message.instanceTemplate; - if (options.oneofs) - object.policyTemplate = "instanceTemplate"; - } - if (message.installGpuDrivers != null && message.hasOwnProperty("installGpuDrivers")) - object.installGpuDrivers = message.installGpuDrivers; - if (message.installOpsAgent != null && message.hasOwnProperty("installOpsAgent")) - object.installOpsAgent = message.installOpsAgent; - if (message.blockProjectSshKeys != null && message.hasOwnProperty("blockProjectSshKeys")) - object.blockProjectSshKeys = message.blockProjectSshKeys; - return object; - }; - - /** - * Converts this InstancePolicyOrTemplate to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate - * @instance - * @returns {Object.} JSON object - */ - InstancePolicyOrTemplate.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InstancePolicyOrTemplate - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstancePolicyOrTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate"; - }; - - return InstancePolicyOrTemplate; - })(); - - AllocationPolicy.NetworkInterface = (function() { - - /** - * Properties of a NetworkInterface. - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @interface INetworkInterface - * @property {string|null} [network] NetworkInterface network - * @property {string|null} [subnetwork] NetworkInterface subnetwork - * @property {boolean|null} [noExternalIpAddress] NetworkInterface noExternalIpAddress - */ - - /** - * Constructs a new NetworkInterface. - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @classdesc Represents a NetworkInterface. - * @implements INetworkInterface - * @constructor - * @param {google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface=} [properties] Properties to set - */ - function NetworkInterface(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NetworkInterface network. - * @member {string} network - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface - * @instance - */ - NetworkInterface.prototype.network = ""; - - /** - * NetworkInterface subnetwork. - * @member {string} subnetwork - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface - * @instance - */ - NetworkInterface.prototype.subnetwork = ""; - - /** - * NetworkInterface noExternalIpAddress. - * @member {boolean} noExternalIpAddress - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface - * @instance - */ - NetworkInterface.prototype.noExternalIpAddress = false; - - /** - * Creates a new NetworkInterface instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface} NetworkInterface instance - */ - NetworkInterface.create = function create(properties) { - return new NetworkInterface(properties); - }; - - /** - * Encodes the specified NetworkInterface message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface} message NetworkInterface message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NetworkInterface.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.network != null && Object.hasOwnProperty.call(message, "network")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.network); - if (message.subnetwork != null && Object.hasOwnProperty.call(message, "subnetwork")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.subnetwork); - if (message.noExternalIpAddress != null && Object.hasOwnProperty.call(message, "noExternalIpAddress")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.noExternalIpAddress); - return writer; - }; - - /** - * Encodes the specified NetworkInterface message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.INetworkInterface} message NetworkInterface message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NetworkInterface.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NetworkInterface message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface} NetworkInterface - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NetworkInterface.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.network = reader.string(); - break; - } - case 2: { - message.subnetwork = reader.string(); - break; - } - case 3: { - message.noExternalIpAddress = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NetworkInterface message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface} NetworkInterface - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NetworkInterface.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NetworkInterface message. - * @function verify - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NetworkInterface.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.network != null && message.hasOwnProperty("network")) - if (!$util.isString(message.network)) - return "network: string expected"; - if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) - if (!$util.isString(message.subnetwork)) - return "subnetwork: string expected"; - if (message.noExternalIpAddress != null && message.hasOwnProperty("noExternalIpAddress")) - if (typeof message.noExternalIpAddress !== "boolean") - return "noExternalIpAddress: boolean expected"; - return null; - }; - - /** - * Creates a NetworkInterface message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface} NetworkInterface - */ - NetworkInterface.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface) - return object; - var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface(); - if (object.network != null) - message.network = String(object.network); - if (object.subnetwork != null) - message.subnetwork = String(object.subnetwork); - if (object.noExternalIpAddress != null) - message.noExternalIpAddress = Boolean(object.noExternalIpAddress); - return message; - }; - - /** - * Creates a plain object from a NetworkInterface message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface} message NetworkInterface - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NetworkInterface.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.network = ""; - object.subnetwork = ""; - object.noExternalIpAddress = false; - } - if (message.network != null && message.hasOwnProperty("network")) - object.network = message.network; - if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) - object.subnetwork = message.subnetwork; - if (message.noExternalIpAddress != null && message.hasOwnProperty("noExternalIpAddress")) - object.noExternalIpAddress = message.noExternalIpAddress; - return object; - }; - - /** - * Converts this NetworkInterface to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface - * @instance - * @returns {Object.} JSON object - */ - NetworkInterface.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NetworkInterface - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NetworkInterface.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface"; - }; - - return NetworkInterface; - })(); - - AllocationPolicy.NetworkPolicy = (function() { - - /** - * Properties of a NetworkPolicy. - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @interface INetworkPolicy - * @property {Array.|null} [networkInterfaces] NetworkPolicy networkInterfaces - */ - - /** - * Constructs a new NetworkPolicy. - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @classdesc Represents a NetworkPolicy. - * @implements INetworkPolicy - * @constructor - * @param {google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy=} [properties] Properties to set - */ - function NetworkPolicy(properties) { - this.networkInterfaces = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NetworkPolicy networkInterfaces. - * @member {Array.} networkInterfaces - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy - * @instance - */ - NetworkPolicy.prototype.networkInterfaces = $util.emptyArray; - - /** - * Creates a new NetworkPolicy instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy} NetworkPolicy instance - */ - NetworkPolicy.create = function create(properties) { - return new NetworkPolicy(properties); - }; - - /** - * Encodes the specified NetworkPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy} message NetworkPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NetworkPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.networkInterfaces != null && message.networkInterfaces.length) - for (var i = 0; i < message.networkInterfaces.length; ++i) - $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.encode(message.networkInterfaces[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified NetworkPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy} message NetworkPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NetworkPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NetworkPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy} NetworkPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NetworkPolicy.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.networkInterfaces && message.networkInterfaces.length)) - message.networkInterfaces = []; - message.networkInterfaces.push($root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NetworkPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy} NetworkPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NetworkPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NetworkPolicy message. - * @function verify - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NetworkPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.networkInterfaces != null && message.hasOwnProperty("networkInterfaces")) { - if (!Array.isArray(message.networkInterfaces)) - return "networkInterfaces: array expected"; - for (var i = 0; i < message.networkInterfaces.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.verify(message.networkInterfaces[i]); - if (error) - return "networkInterfaces." + error; - } - } - return null; - }; - - /** - * Creates a NetworkPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy} NetworkPolicy - */ - NetworkPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy) - return object; - var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy(); - if (object.networkInterfaces) { - if (!Array.isArray(object.networkInterfaces)) - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.networkInterfaces: array expected"); - message.networkInterfaces = []; - for (var i = 0; i < object.networkInterfaces.length; ++i) { - if (typeof object.networkInterfaces[i] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.networkInterfaces: object expected"); - message.networkInterfaces[i] = $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.fromObject(object.networkInterfaces[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a NetworkPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy} message NetworkPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NetworkPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.networkInterfaces = []; - if (message.networkInterfaces && message.networkInterfaces.length) { - object.networkInterfaces = []; - for (var j = 0; j < message.networkInterfaces.length; ++j) - object.networkInterfaces[j] = $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkInterface.toObject(message.networkInterfaces[j], options); - } - return object; - }; - - /** - * Converts this NetworkPolicy to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy - * @instance - * @returns {Object.} JSON object - */ - NetworkPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NetworkPolicy - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NetworkPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy"; - }; - - return NetworkPolicy; - })(); - - AllocationPolicy.PlacementPolicy = (function() { - - /** - * Properties of a PlacementPolicy. - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @interface IPlacementPolicy - * @property {string|null} [collocation] PlacementPolicy collocation - * @property {number|Long|null} [maxDistance] PlacementPolicy maxDistance - */ - - /** - * Constructs a new PlacementPolicy. - * @memberof google.cloud.batch.v1alpha.AllocationPolicy - * @classdesc Represents a PlacementPolicy. - * @implements IPlacementPolicy - * @constructor - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy=} [properties] Properties to set - */ - function PlacementPolicy(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PlacementPolicy collocation. - * @member {string} collocation - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy - * @instance - */ - PlacementPolicy.prototype.collocation = ""; - - /** - * PlacementPolicy maxDistance. - * @member {number|Long} maxDistance - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy - * @instance - */ - PlacementPolicy.prototype.maxDistance = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new PlacementPolicy instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy} PlacementPolicy instance - */ - PlacementPolicy.create = function create(properties) { - return new PlacementPolicy(properties); - }; - - /** - * Encodes the specified PlacementPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy} message PlacementPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PlacementPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.collocation != null && Object.hasOwnProperty.call(message, "collocation")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.collocation); - if (message.maxDistance != null && Object.hasOwnProperty.call(message, "maxDistance")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.maxDistance); - return writer; - }; - - /** - * Encodes the specified PlacementPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy} message PlacementPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PlacementPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PlacementPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy} PlacementPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PlacementPolicy.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.collocation = reader.string(); - break; - } - case 2: { - message.maxDistance = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PlacementPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy} PlacementPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PlacementPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PlacementPolicy message. - * @function verify - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PlacementPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.collocation != null && message.hasOwnProperty("collocation")) - if (!$util.isString(message.collocation)) - return "collocation: string expected"; - if (message.maxDistance != null && message.hasOwnProperty("maxDistance")) - if (!$util.isInteger(message.maxDistance) && !(message.maxDistance && $util.isInteger(message.maxDistance.low) && $util.isInteger(message.maxDistance.high))) - return "maxDistance: integer|Long expected"; - return null; - }; - - /** - * Creates a PlacementPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy} PlacementPolicy - */ - PlacementPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy) - return object; - var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy(); - if (object.collocation != null) - message.collocation = String(object.collocation); - if (object.maxDistance != null) - if ($util.Long) - (message.maxDistance = $util.Long.fromValue(object.maxDistance)).unsigned = false; - else if (typeof object.maxDistance === "string") - message.maxDistance = parseInt(object.maxDistance, 10); - else if (typeof object.maxDistance === "number") - message.maxDistance = object.maxDistance; - else if (typeof object.maxDistance === "object") - message.maxDistance = new $util.LongBits(object.maxDistance.low >>> 0, object.maxDistance.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a PlacementPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy - * @static - * @param {google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy} message PlacementPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PlacementPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.collocation = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.maxDistance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.maxDistance = options.longs === String ? "0" : 0; - } - if (message.collocation != null && message.hasOwnProperty("collocation")) - object.collocation = message.collocation; - if (message.maxDistance != null && message.hasOwnProperty("maxDistance")) - if (typeof message.maxDistance === "number") - object.maxDistance = options.longs === String ? String(message.maxDistance) : message.maxDistance; - else - object.maxDistance = options.longs === String ? $util.Long.prototype.toString.call(message.maxDistance) : options.longs === Number ? new $util.LongBits(message.maxDistance.low >>> 0, message.maxDistance.high >>> 0).toNumber() : message.maxDistance; - return object; - }; - - /** - * Converts this PlacementPolicy to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy - * @instance - * @returns {Object.} JSON object - */ - PlacementPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PlacementPolicy - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PlacementPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy"; - }; - - return PlacementPolicy; - })(); - - /** - * ProvisioningModel enum. - * @name google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel - * @enum {number} - * @property {number} PROVISIONING_MODEL_UNSPECIFIED=0 PROVISIONING_MODEL_UNSPECIFIED value - * @property {number} STANDARD=1 STANDARD value - * @property {number} SPOT=2 SPOT value - * @property {number} PREEMPTIBLE=3 PREEMPTIBLE value - */ - AllocationPolicy.ProvisioningModel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PROVISIONING_MODEL_UNSPECIFIED"] = 0; - values[valuesById[1] = "STANDARD"] = 1; - values[valuesById[2] = "SPOT"] = 2; - values[valuesById[3] = "PREEMPTIBLE"] = 3; - return values; - })(); - - return AllocationPolicy; - })(); - - v1alpha.TaskGroup = (function() { - - /** - * Properties of a TaskGroup. - * @memberof google.cloud.batch.v1alpha - * @interface ITaskGroup - * @property {string|null} [name] TaskGroup name - * @property {google.cloud.batch.v1alpha.ITaskSpec|null} [taskSpec] TaskGroup taskSpec - * @property {number|Long|null} [taskCount] TaskGroup taskCount - * @property {number|Long|null} [parallelism] TaskGroup parallelism - * @property {google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy|null} [schedulingPolicy] TaskGroup schedulingPolicy - * @property {google.cloud.batch.v1alpha.IAllocationPolicy|null} [allocationPolicy] TaskGroup allocationPolicy - * @property {Object.|null} [labels] TaskGroup labels - * @property {Array.|null} [taskEnvironments] TaskGroup taskEnvironments - * @property {number|Long|null} [taskCountPerNode] TaskGroup taskCountPerNode - * @property {boolean|null} [requireHostsFile] TaskGroup requireHostsFile - * @property {boolean|null} [permissiveSsh] TaskGroup permissiveSsh - * @property {boolean|null} [runAsNonRoot] TaskGroup runAsNonRoot - * @property {google.cloud.batch.v1alpha.IServiceAccount|null} [serviceAccount] TaskGroup serviceAccount - */ - - /** - * Constructs a new TaskGroup. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a TaskGroup. - * @implements ITaskGroup - * @constructor - * @param {google.cloud.batch.v1alpha.ITaskGroup=} [properties] Properties to set - */ - function TaskGroup(properties) { - this.labels = {}; - this.taskEnvironments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TaskGroup name. - * @member {string} name - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @instance - */ - TaskGroup.prototype.name = ""; - - /** - * TaskGroup taskSpec. - * @member {google.cloud.batch.v1alpha.ITaskSpec|null|undefined} taskSpec - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @instance - */ - TaskGroup.prototype.taskSpec = null; - - /** - * TaskGroup taskCount. - * @member {number|Long} taskCount - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @instance - */ - TaskGroup.prototype.taskCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * TaskGroup parallelism. - * @member {number|Long} parallelism - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @instance - */ - TaskGroup.prototype.parallelism = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * TaskGroup schedulingPolicy. - * @member {google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy} schedulingPolicy - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @instance - */ - TaskGroup.prototype.schedulingPolicy = 0; - - /** - * TaskGroup allocationPolicy. - * @member {google.cloud.batch.v1alpha.IAllocationPolicy|null|undefined} allocationPolicy - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @instance - */ - TaskGroup.prototype.allocationPolicy = null; - - /** - * TaskGroup labels. - * @member {Object.} labels - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @instance - */ - TaskGroup.prototype.labels = $util.emptyObject; - - /** - * TaskGroup taskEnvironments. - * @member {Array.} taskEnvironments - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @instance - */ - TaskGroup.prototype.taskEnvironments = $util.emptyArray; - - /** - * TaskGroup taskCountPerNode. - * @member {number|Long} taskCountPerNode - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @instance - */ - TaskGroup.prototype.taskCountPerNode = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * TaskGroup requireHostsFile. - * @member {boolean} requireHostsFile - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @instance - */ - TaskGroup.prototype.requireHostsFile = false; - - /** - * TaskGroup permissiveSsh. - * @member {boolean} permissiveSsh - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @instance - */ - TaskGroup.prototype.permissiveSsh = false; - - /** - * TaskGroup runAsNonRoot. - * @member {boolean} runAsNonRoot - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @instance - */ - TaskGroup.prototype.runAsNonRoot = false; - - /** - * TaskGroup serviceAccount. - * @member {google.cloud.batch.v1alpha.IServiceAccount|null|undefined} serviceAccount - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @instance - */ - TaskGroup.prototype.serviceAccount = null; - - /** - * Creates a new TaskGroup instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @static - * @param {google.cloud.batch.v1alpha.ITaskGroup=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.TaskGroup} TaskGroup instance - */ - TaskGroup.create = function create(properties) { - return new TaskGroup(properties); - }; - - /** - * Encodes the specified TaskGroup message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskGroup.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @static - * @param {google.cloud.batch.v1alpha.ITaskGroup} message TaskGroup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskGroup.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.taskSpec != null && Object.hasOwnProperty.call(message, "taskSpec")) - $root.google.cloud.batch.v1alpha.TaskSpec.encode(message.taskSpec, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.taskCount != null && Object.hasOwnProperty.call(message, "taskCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.taskCount); - if (message.parallelism != null && Object.hasOwnProperty.call(message, "parallelism")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.parallelism); - if (message.schedulingPolicy != null && Object.hasOwnProperty.call(message, "schedulingPolicy")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.schedulingPolicy); - if (message.allocationPolicy != null && Object.hasOwnProperty.call(message, "allocationPolicy")) - $root.google.cloud.batch.v1alpha.AllocationPolicy.encode(message.allocationPolicy, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.taskEnvironments != null && message.taskEnvironments.length) - for (var i = 0; i < message.taskEnvironments.length; ++i) - $root.google.cloud.batch.v1alpha.Environment.encode(message.taskEnvironments[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.taskCountPerNode != null && Object.hasOwnProperty.call(message, "taskCountPerNode")) - writer.uint32(/* id 10, wireType 0 =*/80).int64(message.taskCountPerNode); - if (message.requireHostsFile != null && Object.hasOwnProperty.call(message, "requireHostsFile")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.requireHostsFile); - if (message.permissiveSsh != null && Object.hasOwnProperty.call(message, "permissiveSsh")) - writer.uint32(/* id 12, wireType 0 =*/96).bool(message.permissiveSsh); - if (message.runAsNonRoot != null && Object.hasOwnProperty.call(message, "runAsNonRoot")) - writer.uint32(/* id 14, wireType 0 =*/112).bool(message.runAsNonRoot); - if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) - $root.google.cloud.batch.v1alpha.ServiceAccount.encode(message.serviceAccount, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TaskGroup message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskGroup.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @static - * @param {google.cloud.batch.v1alpha.ITaskGroup} message TaskGroup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskGroup.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TaskGroup message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.TaskGroup} TaskGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskGroup.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.TaskGroup(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.taskSpec = $root.google.cloud.batch.v1alpha.TaskSpec.decode(reader, reader.uint32()); - break; - } - case 4: { - message.taskCount = reader.int64(); - break; - } - case 5: { - message.parallelism = reader.int64(); - break; - } - case 6: { - message.schedulingPolicy = reader.int32(); - break; - } - case 7: { - message.allocationPolicy = $root.google.cloud.batch.v1alpha.AllocationPolicy.decode(reader, reader.uint32()); - break; - } - case 8: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 9: { - if (!(message.taskEnvironments && message.taskEnvironments.length)) - message.taskEnvironments = []; - message.taskEnvironments.push($root.google.cloud.batch.v1alpha.Environment.decode(reader, reader.uint32())); - break; - } - case 10: { - message.taskCountPerNode = reader.int64(); - break; - } - case 11: { - message.requireHostsFile = reader.bool(); - break; - } - case 12: { - message.permissiveSsh = reader.bool(); - break; - } - case 14: { - message.runAsNonRoot = reader.bool(); - break; - } - case 15: { - message.serviceAccount = $root.google.cloud.batch.v1alpha.ServiceAccount.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TaskGroup message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.TaskGroup} TaskGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskGroup.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TaskGroup message. - * @function verify - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TaskGroup.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.taskSpec != null && message.hasOwnProperty("taskSpec")) { - var error = $root.google.cloud.batch.v1alpha.TaskSpec.verify(message.taskSpec); - if (error) - return "taskSpec." + error; - } - if (message.taskCount != null && message.hasOwnProperty("taskCount")) - if (!$util.isInteger(message.taskCount) && !(message.taskCount && $util.isInteger(message.taskCount.low) && $util.isInteger(message.taskCount.high))) - return "taskCount: integer|Long expected"; - if (message.parallelism != null && message.hasOwnProperty("parallelism")) - if (!$util.isInteger(message.parallelism) && !(message.parallelism && $util.isInteger(message.parallelism.low) && $util.isInteger(message.parallelism.high))) - return "parallelism: integer|Long expected"; - if (message.schedulingPolicy != null && message.hasOwnProperty("schedulingPolicy")) - switch (message.schedulingPolicy) { - default: - return "schedulingPolicy: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.allocationPolicy != null && message.hasOwnProperty("allocationPolicy")) { - var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.verify(message.allocationPolicy); - if (error) - return "allocationPolicy." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.taskEnvironments != null && message.hasOwnProperty("taskEnvironments")) { - if (!Array.isArray(message.taskEnvironments)) - return "taskEnvironments: array expected"; - for (var i = 0; i < message.taskEnvironments.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.Environment.verify(message.taskEnvironments[i]); - if (error) - return "taskEnvironments." + error; - } - } - if (message.taskCountPerNode != null && message.hasOwnProperty("taskCountPerNode")) - if (!$util.isInteger(message.taskCountPerNode) && !(message.taskCountPerNode && $util.isInteger(message.taskCountPerNode.low) && $util.isInteger(message.taskCountPerNode.high))) - return "taskCountPerNode: integer|Long expected"; - if (message.requireHostsFile != null && message.hasOwnProperty("requireHostsFile")) - if (typeof message.requireHostsFile !== "boolean") - return "requireHostsFile: boolean expected"; - if (message.permissiveSsh != null && message.hasOwnProperty("permissiveSsh")) - if (typeof message.permissiveSsh !== "boolean") - return "permissiveSsh: boolean expected"; - if (message.runAsNonRoot != null && message.hasOwnProperty("runAsNonRoot")) - if (typeof message.runAsNonRoot !== "boolean") - return "runAsNonRoot: boolean expected"; - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) { - var error = $root.google.cloud.batch.v1alpha.ServiceAccount.verify(message.serviceAccount); - if (error) - return "serviceAccount." + error; - } - return null; - }; - - /** - * Creates a TaskGroup message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.TaskGroup} TaskGroup - */ - TaskGroup.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.TaskGroup) - return object; - var message = new $root.google.cloud.batch.v1alpha.TaskGroup(); - if (object.name != null) - message.name = String(object.name); - if (object.taskSpec != null) { - if (typeof object.taskSpec !== "object") - throw TypeError(".google.cloud.batch.v1alpha.TaskGroup.taskSpec: object expected"); - message.taskSpec = $root.google.cloud.batch.v1alpha.TaskSpec.fromObject(object.taskSpec); - } - if (object.taskCount != null) - if ($util.Long) - (message.taskCount = $util.Long.fromValue(object.taskCount)).unsigned = false; - else if (typeof object.taskCount === "string") - message.taskCount = parseInt(object.taskCount, 10); - else if (typeof object.taskCount === "number") - message.taskCount = object.taskCount; - else if (typeof object.taskCount === "object") - message.taskCount = new $util.LongBits(object.taskCount.low >>> 0, object.taskCount.high >>> 0).toNumber(); - if (object.parallelism != null) - if ($util.Long) - (message.parallelism = $util.Long.fromValue(object.parallelism)).unsigned = false; - else if (typeof object.parallelism === "string") - message.parallelism = parseInt(object.parallelism, 10); - else if (typeof object.parallelism === "number") - message.parallelism = object.parallelism; - else if (typeof object.parallelism === "object") - message.parallelism = new $util.LongBits(object.parallelism.low >>> 0, object.parallelism.high >>> 0).toNumber(); - switch (object.schedulingPolicy) { - default: - if (typeof object.schedulingPolicy === "number") { - message.schedulingPolicy = object.schedulingPolicy; - break; - } - break; - case "SCHEDULING_POLICY_UNSPECIFIED": - case 0: - message.schedulingPolicy = 0; - break; - case "AS_SOON_AS_POSSIBLE": - case 1: - message.schedulingPolicy = 1; - break; - case "IN_ORDER": - case 2: - message.schedulingPolicy = 2; - break; - } - if (object.allocationPolicy != null) { - if (typeof object.allocationPolicy !== "object") - throw TypeError(".google.cloud.batch.v1alpha.TaskGroup.allocationPolicy: object expected"); - message.allocationPolicy = $root.google.cloud.batch.v1alpha.AllocationPolicy.fromObject(object.allocationPolicy); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.batch.v1alpha.TaskGroup.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - if (object.taskEnvironments) { - if (!Array.isArray(object.taskEnvironments)) - throw TypeError(".google.cloud.batch.v1alpha.TaskGroup.taskEnvironments: array expected"); - message.taskEnvironments = []; - for (var i = 0; i < object.taskEnvironments.length; ++i) { - if (typeof object.taskEnvironments[i] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.TaskGroup.taskEnvironments: object expected"); - message.taskEnvironments[i] = $root.google.cloud.batch.v1alpha.Environment.fromObject(object.taskEnvironments[i]); - } - } - if (object.taskCountPerNode != null) - if ($util.Long) - (message.taskCountPerNode = $util.Long.fromValue(object.taskCountPerNode)).unsigned = false; - else if (typeof object.taskCountPerNode === "string") - message.taskCountPerNode = parseInt(object.taskCountPerNode, 10); - else if (typeof object.taskCountPerNode === "number") - message.taskCountPerNode = object.taskCountPerNode; - else if (typeof object.taskCountPerNode === "object") - message.taskCountPerNode = new $util.LongBits(object.taskCountPerNode.low >>> 0, object.taskCountPerNode.high >>> 0).toNumber(); - if (object.requireHostsFile != null) - message.requireHostsFile = Boolean(object.requireHostsFile); - if (object.permissiveSsh != null) - message.permissiveSsh = Boolean(object.permissiveSsh); - if (object.runAsNonRoot != null) - message.runAsNonRoot = Boolean(object.runAsNonRoot); - if (object.serviceAccount != null) { - if (typeof object.serviceAccount !== "object") - throw TypeError(".google.cloud.batch.v1alpha.TaskGroup.serviceAccount: object expected"); - message.serviceAccount = $root.google.cloud.batch.v1alpha.ServiceAccount.fromObject(object.serviceAccount); - } - return message; - }; - - /** - * Creates a plain object from a TaskGroup message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @static - * @param {google.cloud.batch.v1alpha.TaskGroup} message TaskGroup - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TaskGroup.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.taskEnvironments = []; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.taskSpec = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.taskCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.taskCount = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.parallelism = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.parallelism = options.longs === String ? "0" : 0; - object.schedulingPolicy = options.enums === String ? "SCHEDULING_POLICY_UNSPECIFIED" : 0; - object.allocationPolicy = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.taskCountPerNode = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.taskCountPerNode = options.longs === String ? "0" : 0; - object.requireHostsFile = false; - object.permissiveSsh = false; - object.runAsNonRoot = false; - object.serviceAccount = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.taskSpec != null && message.hasOwnProperty("taskSpec")) - object.taskSpec = $root.google.cloud.batch.v1alpha.TaskSpec.toObject(message.taskSpec, options); - if (message.taskCount != null && message.hasOwnProperty("taskCount")) - if (typeof message.taskCount === "number") - object.taskCount = options.longs === String ? String(message.taskCount) : message.taskCount; - else - object.taskCount = options.longs === String ? $util.Long.prototype.toString.call(message.taskCount) : options.longs === Number ? new $util.LongBits(message.taskCount.low >>> 0, message.taskCount.high >>> 0).toNumber() : message.taskCount; - if (message.parallelism != null && message.hasOwnProperty("parallelism")) - if (typeof message.parallelism === "number") - object.parallelism = options.longs === String ? String(message.parallelism) : message.parallelism; - else - object.parallelism = options.longs === String ? $util.Long.prototype.toString.call(message.parallelism) : options.longs === Number ? new $util.LongBits(message.parallelism.low >>> 0, message.parallelism.high >>> 0).toNumber() : message.parallelism; - if (message.schedulingPolicy != null && message.hasOwnProperty("schedulingPolicy")) - object.schedulingPolicy = options.enums === String ? $root.google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy[message.schedulingPolicy] === undefined ? message.schedulingPolicy : $root.google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy[message.schedulingPolicy] : message.schedulingPolicy; - if (message.allocationPolicy != null && message.hasOwnProperty("allocationPolicy")) - object.allocationPolicy = $root.google.cloud.batch.v1alpha.AllocationPolicy.toObject(message.allocationPolicy, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.taskEnvironments && message.taskEnvironments.length) { - object.taskEnvironments = []; - for (var j = 0; j < message.taskEnvironments.length; ++j) - object.taskEnvironments[j] = $root.google.cloud.batch.v1alpha.Environment.toObject(message.taskEnvironments[j], options); - } - if (message.taskCountPerNode != null && message.hasOwnProperty("taskCountPerNode")) - if (typeof message.taskCountPerNode === "number") - object.taskCountPerNode = options.longs === String ? String(message.taskCountPerNode) : message.taskCountPerNode; - else - object.taskCountPerNode = options.longs === String ? $util.Long.prototype.toString.call(message.taskCountPerNode) : options.longs === Number ? new $util.LongBits(message.taskCountPerNode.low >>> 0, message.taskCountPerNode.high >>> 0).toNumber() : message.taskCountPerNode; - if (message.requireHostsFile != null && message.hasOwnProperty("requireHostsFile")) - object.requireHostsFile = message.requireHostsFile; - if (message.permissiveSsh != null && message.hasOwnProperty("permissiveSsh")) - object.permissiveSsh = message.permissiveSsh; - if (message.runAsNonRoot != null && message.hasOwnProperty("runAsNonRoot")) - object.runAsNonRoot = message.runAsNonRoot; - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - object.serviceAccount = $root.google.cloud.batch.v1alpha.ServiceAccount.toObject(message.serviceAccount, options); - return object; - }; - - /** - * Converts this TaskGroup to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @instance - * @returns {Object.} JSON object - */ - TaskGroup.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TaskGroup - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.TaskGroup - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TaskGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.TaskGroup"; - }; - - /** - * SchedulingPolicy enum. - * @name google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy - * @enum {number} - * @property {number} SCHEDULING_POLICY_UNSPECIFIED=0 SCHEDULING_POLICY_UNSPECIFIED value - * @property {number} AS_SOON_AS_POSSIBLE=1 AS_SOON_AS_POSSIBLE value - * @property {number} IN_ORDER=2 IN_ORDER value - */ - TaskGroup.SchedulingPolicy = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SCHEDULING_POLICY_UNSPECIFIED"] = 0; - values[valuesById[1] = "AS_SOON_AS_POSSIBLE"] = 1; - values[valuesById[2] = "IN_ORDER"] = 2; - return values; - })(); - - return TaskGroup; - })(); - - v1alpha.ServiceAccount = (function() { - - /** - * Properties of a ServiceAccount. - * @memberof google.cloud.batch.v1alpha - * @interface IServiceAccount - * @property {string|null} [email] ServiceAccount email - * @property {Array.|null} [scopes] ServiceAccount scopes - */ - - /** - * Constructs a new ServiceAccount. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a ServiceAccount. - * @implements IServiceAccount - * @constructor - * @param {google.cloud.batch.v1alpha.IServiceAccount=} [properties] Properties to set - */ - function ServiceAccount(properties) { - this.scopes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceAccount email. - * @member {string} email - * @memberof google.cloud.batch.v1alpha.ServiceAccount - * @instance - */ - ServiceAccount.prototype.email = ""; - - /** - * ServiceAccount scopes. - * @member {Array.} scopes - * @memberof google.cloud.batch.v1alpha.ServiceAccount - * @instance - */ - ServiceAccount.prototype.scopes = $util.emptyArray; - - /** - * Creates a new ServiceAccount instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.ServiceAccount - * @static - * @param {google.cloud.batch.v1alpha.IServiceAccount=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.ServiceAccount} ServiceAccount instance - */ - ServiceAccount.create = function create(properties) { - return new ServiceAccount(properties); - }; - - /** - * Encodes the specified ServiceAccount message. Does not implicitly {@link google.cloud.batch.v1alpha.ServiceAccount.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.ServiceAccount - * @static - * @param {google.cloud.batch.v1alpha.IServiceAccount} message ServiceAccount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceAccount.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.email != null && Object.hasOwnProperty.call(message, "email")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.email); - if (message.scopes != null && message.scopes.length) - for (var i = 0; i < message.scopes.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.scopes[i]); - return writer; - }; - - /** - * Encodes the specified ServiceAccount message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ServiceAccount.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.ServiceAccount - * @static - * @param {google.cloud.batch.v1alpha.IServiceAccount} message ServiceAccount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceAccount.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceAccount message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.ServiceAccount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.ServiceAccount} ServiceAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceAccount.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ServiceAccount(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.email = reader.string(); - break; - } - case 2: { - if (!(message.scopes && message.scopes.length)) - message.scopes = []; - message.scopes.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceAccount message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.ServiceAccount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.ServiceAccount} ServiceAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceAccount.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceAccount message. - * @function verify - * @memberof google.cloud.batch.v1alpha.ServiceAccount - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceAccount.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.email != null && message.hasOwnProperty("email")) - if (!$util.isString(message.email)) - return "email: string expected"; - if (message.scopes != null && message.hasOwnProperty("scopes")) { - if (!Array.isArray(message.scopes)) - return "scopes: array expected"; - for (var i = 0; i < message.scopes.length; ++i) - if (!$util.isString(message.scopes[i])) - return "scopes: string[] expected"; - } - return null; - }; - - /** - * Creates a ServiceAccount message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.ServiceAccount - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.ServiceAccount} ServiceAccount - */ - ServiceAccount.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.ServiceAccount) - return object; - var message = new $root.google.cloud.batch.v1alpha.ServiceAccount(); - if (object.email != null) - message.email = String(object.email); - if (object.scopes) { - if (!Array.isArray(object.scopes)) - throw TypeError(".google.cloud.batch.v1alpha.ServiceAccount.scopes: array expected"); - message.scopes = []; - for (var i = 0; i < object.scopes.length; ++i) - message.scopes[i] = String(object.scopes[i]); - } - return message; - }; - - /** - * Creates a plain object from a ServiceAccount message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.ServiceAccount - * @static - * @param {google.cloud.batch.v1alpha.ServiceAccount} message ServiceAccount - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceAccount.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.scopes = []; - if (options.defaults) - object.email = ""; - if (message.email != null && message.hasOwnProperty("email")) - object.email = message.email; - if (message.scopes && message.scopes.length) { - object.scopes = []; - for (var j = 0; j < message.scopes.length; ++j) - object.scopes[j] = message.scopes[j]; - } - return object; - }; - - /** - * Converts this ServiceAccount to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.ServiceAccount - * @instance - * @returns {Object.} JSON object - */ - ServiceAccount.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceAccount - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.ServiceAccount - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceAccount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.ServiceAccount"; - }; - - return ServiceAccount; - })(); - - v1alpha.ComputeResource = (function() { - - /** - * Properties of a ComputeResource. - * @memberof google.cloud.batch.v1alpha - * @interface IComputeResource - * @property {number|Long|null} [cpuMilli] ComputeResource cpuMilli - * @property {number|Long|null} [memoryMib] ComputeResource memoryMib - * @property {number|Long|null} [gpuCount] ComputeResource gpuCount - * @property {number|Long|null} [bootDiskMib] ComputeResource bootDiskMib - */ - - /** - * Constructs a new ComputeResource. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a ComputeResource. - * @implements IComputeResource - * @constructor - * @param {google.cloud.batch.v1alpha.IComputeResource=} [properties] Properties to set - */ - function ComputeResource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ComputeResource cpuMilli. - * @member {number|Long} cpuMilli - * @memberof google.cloud.batch.v1alpha.ComputeResource - * @instance - */ - ComputeResource.prototype.cpuMilli = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ComputeResource memoryMib. - * @member {number|Long} memoryMib - * @memberof google.cloud.batch.v1alpha.ComputeResource - * @instance - */ - ComputeResource.prototype.memoryMib = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ComputeResource gpuCount. - * @member {number|Long} gpuCount - * @memberof google.cloud.batch.v1alpha.ComputeResource - * @instance - */ - ComputeResource.prototype.gpuCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ComputeResource bootDiskMib. - * @member {number|Long} bootDiskMib - * @memberof google.cloud.batch.v1alpha.ComputeResource - * @instance - */ - ComputeResource.prototype.bootDiskMib = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new ComputeResource instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.ComputeResource - * @static - * @param {google.cloud.batch.v1alpha.IComputeResource=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.ComputeResource} ComputeResource instance - */ - ComputeResource.create = function create(properties) { - return new ComputeResource(properties); - }; - - /** - * Encodes the specified ComputeResource message. Does not implicitly {@link google.cloud.batch.v1alpha.ComputeResource.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.ComputeResource - * @static - * @param {google.cloud.batch.v1alpha.IComputeResource} message ComputeResource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ComputeResource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cpuMilli != null && Object.hasOwnProperty.call(message, "cpuMilli")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.cpuMilli); - if (message.memoryMib != null && Object.hasOwnProperty.call(message, "memoryMib")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.memoryMib); - if (message.gpuCount != null && Object.hasOwnProperty.call(message, "gpuCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.gpuCount); - if (message.bootDiskMib != null && Object.hasOwnProperty.call(message, "bootDiskMib")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.bootDiskMib); - return writer; - }; - - /** - * Encodes the specified ComputeResource message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ComputeResource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.ComputeResource - * @static - * @param {google.cloud.batch.v1alpha.IComputeResource} message ComputeResource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ComputeResource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ComputeResource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.ComputeResource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.ComputeResource} ComputeResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ComputeResource.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ComputeResource(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.cpuMilli = reader.int64(); - break; - } - case 2: { - message.memoryMib = reader.int64(); - break; - } - case 3: { - message.gpuCount = reader.int64(); - break; - } - case 4: { - message.bootDiskMib = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ComputeResource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.ComputeResource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.ComputeResource} ComputeResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ComputeResource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ComputeResource message. - * @function verify - * @memberof google.cloud.batch.v1alpha.ComputeResource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ComputeResource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.cpuMilli != null && message.hasOwnProperty("cpuMilli")) - if (!$util.isInteger(message.cpuMilli) && !(message.cpuMilli && $util.isInteger(message.cpuMilli.low) && $util.isInteger(message.cpuMilli.high))) - return "cpuMilli: integer|Long expected"; - if (message.memoryMib != null && message.hasOwnProperty("memoryMib")) - if (!$util.isInteger(message.memoryMib) && !(message.memoryMib && $util.isInteger(message.memoryMib.low) && $util.isInteger(message.memoryMib.high))) - return "memoryMib: integer|Long expected"; - if (message.gpuCount != null && message.hasOwnProperty("gpuCount")) - if (!$util.isInteger(message.gpuCount) && !(message.gpuCount && $util.isInteger(message.gpuCount.low) && $util.isInteger(message.gpuCount.high))) - return "gpuCount: integer|Long expected"; - if (message.bootDiskMib != null && message.hasOwnProperty("bootDiskMib")) - if (!$util.isInteger(message.bootDiskMib) && !(message.bootDiskMib && $util.isInteger(message.bootDiskMib.low) && $util.isInteger(message.bootDiskMib.high))) - return "bootDiskMib: integer|Long expected"; - return null; - }; - - /** - * Creates a ComputeResource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.ComputeResource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.ComputeResource} ComputeResource - */ - ComputeResource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.ComputeResource) - return object; - var message = new $root.google.cloud.batch.v1alpha.ComputeResource(); - if (object.cpuMilli != null) - if ($util.Long) - (message.cpuMilli = $util.Long.fromValue(object.cpuMilli)).unsigned = false; - else if (typeof object.cpuMilli === "string") - message.cpuMilli = parseInt(object.cpuMilli, 10); - else if (typeof object.cpuMilli === "number") - message.cpuMilli = object.cpuMilli; - else if (typeof object.cpuMilli === "object") - message.cpuMilli = new $util.LongBits(object.cpuMilli.low >>> 0, object.cpuMilli.high >>> 0).toNumber(); - if (object.memoryMib != null) - if ($util.Long) - (message.memoryMib = $util.Long.fromValue(object.memoryMib)).unsigned = false; - else if (typeof object.memoryMib === "string") - message.memoryMib = parseInt(object.memoryMib, 10); - else if (typeof object.memoryMib === "number") - message.memoryMib = object.memoryMib; - else if (typeof object.memoryMib === "object") - message.memoryMib = new $util.LongBits(object.memoryMib.low >>> 0, object.memoryMib.high >>> 0).toNumber(); - if (object.gpuCount != null) - if ($util.Long) - (message.gpuCount = $util.Long.fromValue(object.gpuCount)).unsigned = false; - else if (typeof object.gpuCount === "string") - message.gpuCount = parseInt(object.gpuCount, 10); - else if (typeof object.gpuCount === "number") - message.gpuCount = object.gpuCount; - else if (typeof object.gpuCount === "object") - message.gpuCount = new $util.LongBits(object.gpuCount.low >>> 0, object.gpuCount.high >>> 0).toNumber(); - if (object.bootDiskMib != null) - if ($util.Long) - (message.bootDiskMib = $util.Long.fromValue(object.bootDiskMib)).unsigned = false; - else if (typeof object.bootDiskMib === "string") - message.bootDiskMib = parseInt(object.bootDiskMib, 10); - else if (typeof object.bootDiskMib === "number") - message.bootDiskMib = object.bootDiskMib; - else if (typeof object.bootDiskMib === "object") - message.bootDiskMib = new $util.LongBits(object.bootDiskMib.low >>> 0, object.bootDiskMib.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a ComputeResource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.ComputeResource - * @static - * @param {google.cloud.batch.v1alpha.ComputeResource} message ComputeResource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ComputeResource.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.cpuMilli = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.cpuMilli = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.memoryMib = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.memoryMib = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.gpuCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.gpuCount = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.bootDiskMib = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.bootDiskMib = options.longs === String ? "0" : 0; - } - if (message.cpuMilli != null && message.hasOwnProperty("cpuMilli")) - if (typeof message.cpuMilli === "number") - object.cpuMilli = options.longs === String ? String(message.cpuMilli) : message.cpuMilli; - else - object.cpuMilli = options.longs === String ? $util.Long.prototype.toString.call(message.cpuMilli) : options.longs === Number ? new $util.LongBits(message.cpuMilli.low >>> 0, message.cpuMilli.high >>> 0).toNumber() : message.cpuMilli; - if (message.memoryMib != null && message.hasOwnProperty("memoryMib")) - if (typeof message.memoryMib === "number") - object.memoryMib = options.longs === String ? String(message.memoryMib) : message.memoryMib; - else - object.memoryMib = options.longs === String ? $util.Long.prototype.toString.call(message.memoryMib) : options.longs === Number ? new $util.LongBits(message.memoryMib.low >>> 0, message.memoryMib.high >>> 0).toNumber() : message.memoryMib; - if (message.gpuCount != null && message.hasOwnProperty("gpuCount")) - if (typeof message.gpuCount === "number") - object.gpuCount = options.longs === String ? String(message.gpuCount) : message.gpuCount; - else - object.gpuCount = options.longs === String ? $util.Long.prototype.toString.call(message.gpuCount) : options.longs === Number ? new $util.LongBits(message.gpuCount.low >>> 0, message.gpuCount.high >>> 0).toNumber() : message.gpuCount; - if (message.bootDiskMib != null && message.hasOwnProperty("bootDiskMib")) - if (typeof message.bootDiskMib === "number") - object.bootDiskMib = options.longs === String ? String(message.bootDiskMib) : message.bootDiskMib; - else - object.bootDiskMib = options.longs === String ? $util.Long.prototype.toString.call(message.bootDiskMib) : options.longs === Number ? new $util.LongBits(message.bootDiskMib.low >>> 0, message.bootDiskMib.high >>> 0).toNumber() : message.bootDiskMib; - return object; - }; - - /** - * Converts this ComputeResource to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.ComputeResource - * @instance - * @returns {Object.} JSON object - */ - ComputeResource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ComputeResource - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.ComputeResource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ComputeResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.ComputeResource"; - }; - - return ComputeResource; - })(); - - v1alpha.StatusEvent = (function() { - - /** - * Properties of a StatusEvent. - * @memberof google.cloud.batch.v1alpha - * @interface IStatusEvent - * @property {string|null} [type] StatusEvent type - * @property {string|null} [description] StatusEvent description - * @property {google.protobuf.ITimestamp|null} [eventTime] StatusEvent eventTime - * @property {google.cloud.batch.v1alpha.ITaskExecution|null} [taskExecution] StatusEvent taskExecution - * @property {google.cloud.batch.v1alpha.TaskStatus.State|null} [taskState] StatusEvent taskState - */ - - /** - * Constructs a new StatusEvent. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a StatusEvent. - * @implements IStatusEvent - * @constructor - * @param {google.cloud.batch.v1alpha.IStatusEvent=} [properties] Properties to set - */ - function StatusEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StatusEvent type. - * @member {string} type - * @memberof google.cloud.batch.v1alpha.StatusEvent - * @instance - */ - StatusEvent.prototype.type = ""; - - /** - * StatusEvent description. - * @member {string} description - * @memberof google.cloud.batch.v1alpha.StatusEvent - * @instance - */ - StatusEvent.prototype.description = ""; - - /** - * StatusEvent eventTime. - * @member {google.protobuf.ITimestamp|null|undefined} eventTime - * @memberof google.cloud.batch.v1alpha.StatusEvent - * @instance - */ - StatusEvent.prototype.eventTime = null; - - /** - * StatusEvent taskExecution. - * @member {google.cloud.batch.v1alpha.ITaskExecution|null|undefined} taskExecution - * @memberof google.cloud.batch.v1alpha.StatusEvent - * @instance - */ - StatusEvent.prototype.taskExecution = null; - - /** - * StatusEvent taskState. - * @member {google.cloud.batch.v1alpha.TaskStatus.State} taskState - * @memberof google.cloud.batch.v1alpha.StatusEvent - * @instance - */ - StatusEvent.prototype.taskState = 0; - - /** - * Creates a new StatusEvent instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.StatusEvent - * @static - * @param {google.cloud.batch.v1alpha.IStatusEvent=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.StatusEvent} StatusEvent instance - */ - StatusEvent.create = function create(properties) { - return new StatusEvent(properties); - }; - - /** - * Encodes the specified StatusEvent message. Does not implicitly {@link google.cloud.batch.v1alpha.StatusEvent.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.StatusEvent - * @static - * @param {google.cloud.batch.v1alpha.IStatusEvent} message StatusEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StatusEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); - if (message.eventTime != null && Object.hasOwnProperty.call(message, "eventTime")) - $root.google.protobuf.Timestamp.encode(message.eventTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); - if (message.taskExecution != null && Object.hasOwnProperty.call(message, "taskExecution")) - $root.google.cloud.batch.v1alpha.TaskExecution.encode(message.taskExecution, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.taskState != null && Object.hasOwnProperty.call(message, "taskState")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.taskState); - return writer; - }; - - /** - * Encodes the specified StatusEvent message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.StatusEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.StatusEvent - * @static - * @param {google.cloud.batch.v1alpha.IStatusEvent} message StatusEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StatusEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StatusEvent message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.StatusEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.StatusEvent} StatusEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StatusEvent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.StatusEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 3: { - message.type = reader.string(); - break; - } - case 1: { - message.description = reader.string(); - break; - } - case 2: { - message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.taskExecution = $root.google.cloud.batch.v1alpha.TaskExecution.decode(reader, reader.uint32()); - break; - } - case 5: { - message.taskState = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StatusEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.StatusEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.StatusEvent} StatusEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StatusEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StatusEvent message. - * @function verify - * @memberof google.cloud.batch.v1alpha.StatusEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StatusEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.eventTime != null && message.hasOwnProperty("eventTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.eventTime); - if (error) - return "eventTime." + error; - } - if (message.taskExecution != null && message.hasOwnProperty("taskExecution")) { - var error = $root.google.cloud.batch.v1alpha.TaskExecution.verify(message.taskExecution); - if (error) - return "taskExecution." + error; - } - if (message.taskState != null && message.hasOwnProperty("taskState")) - switch (message.taskState) { - default: - return "taskState: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - return null; - }; - - /** - * Creates a StatusEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.StatusEvent - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.StatusEvent} StatusEvent - */ - StatusEvent.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.StatusEvent) - return object; - var message = new $root.google.cloud.batch.v1alpha.StatusEvent(); - if (object.type != null) - message.type = String(object.type); - if (object.description != null) - message.description = String(object.description); - if (object.eventTime != null) { - if (typeof object.eventTime !== "object") - throw TypeError(".google.cloud.batch.v1alpha.StatusEvent.eventTime: object expected"); - message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); - } - if (object.taskExecution != null) { - if (typeof object.taskExecution !== "object") - throw TypeError(".google.cloud.batch.v1alpha.StatusEvent.taskExecution: object expected"); - message.taskExecution = $root.google.cloud.batch.v1alpha.TaskExecution.fromObject(object.taskExecution); - } - switch (object.taskState) { - default: - if (typeof object.taskState === "number") { - message.taskState = object.taskState; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.taskState = 0; - break; - case "PENDING": - case 1: - message.taskState = 1; - break; - case "ASSIGNED": - case 2: - message.taskState = 2; - break; - case "RUNNING": - case 3: - message.taskState = 3; - break; - case "FAILED": - case 4: - message.taskState = 4; - break; - case "SUCCEEDED": - case 5: - message.taskState = 5; - break; - case "UNEXECUTED": - case 6: - message.taskState = 6; - break; - } - return message; - }; - - /** - * Creates a plain object from a StatusEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.StatusEvent - * @static - * @param {google.cloud.batch.v1alpha.StatusEvent} message StatusEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StatusEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.description = ""; - object.eventTime = null; - object.type = ""; - object.taskExecution = null; - object.taskState = options.enums === String ? "STATE_UNSPECIFIED" : 0; - } - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.eventTime != null && message.hasOwnProperty("eventTime")) - object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.taskExecution != null && message.hasOwnProperty("taskExecution")) - object.taskExecution = $root.google.cloud.batch.v1alpha.TaskExecution.toObject(message.taskExecution, options); - if (message.taskState != null && message.hasOwnProperty("taskState")) - object.taskState = options.enums === String ? $root.google.cloud.batch.v1alpha.TaskStatus.State[message.taskState] === undefined ? message.taskState : $root.google.cloud.batch.v1alpha.TaskStatus.State[message.taskState] : message.taskState; - return object; - }; - - /** - * Converts this StatusEvent to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.StatusEvent - * @instance - * @returns {Object.} JSON object - */ - StatusEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StatusEvent - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.StatusEvent - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StatusEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.StatusEvent"; - }; - - return StatusEvent; - })(); - - v1alpha.TaskExecution = (function() { - - /** - * Properties of a TaskExecution. - * @memberof google.cloud.batch.v1alpha - * @interface ITaskExecution - * @property {number|null} [exitCode] TaskExecution exitCode - * @property {string|null} [stderrSnippet] TaskExecution stderrSnippet - */ - - /** - * Constructs a new TaskExecution. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a TaskExecution. - * @implements ITaskExecution - * @constructor - * @param {google.cloud.batch.v1alpha.ITaskExecution=} [properties] Properties to set - */ - function TaskExecution(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TaskExecution exitCode. - * @member {number} exitCode - * @memberof google.cloud.batch.v1alpha.TaskExecution - * @instance - */ - TaskExecution.prototype.exitCode = 0; - - /** - * TaskExecution stderrSnippet. - * @member {string} stderrSnippet - * @memberof google.cloud.batch.v1alpha.TaskExecution - * @instance - */ - TaskExecution.prototype.stderrSnippet = ""; - - /** - * Creates a new TaskExecution instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.TaskExecution - * @static - * @param {google.cloud.batch.v1alpha.ITaskExecution=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.TaskExecution} TaskExecution instance - */ - TaskExecution.create = function create(properties) { - return new TaskExecution(properties); - }; - - /** - * Encodes the specified TaskExecution message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskExecution.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.TaskExecution - * @static - * @param {google.cloud.batch.v1alpha.ITaskExecution} message TaskExecution message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskExecution.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.exitCode != null && Object.hasOwnProperty.call(message, "exitCode")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.exitCode); - if (message.stderrSnippet != null && Object.hasOwnProperty.call(message, "stderrSnippet")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.stderrSnippet); - return writer; - }; - - /** - * Encodes the specified TaskExecution message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskExecution.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.TaskExecution - * @static - * @param {google.cloud.batch.v1alpha.ITaskExecution} message TaskExecution message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskExecution.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TaskExecution message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.TaskExecution - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.TaskExecution} TaskExecution - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskExecution.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.TaskExecution(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.exitCode = reader.int32(); - break; - } - case 2: { - message.stderrSnippet = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TaskExecution message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.TaskExecution - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.TaskExecution} TaskExecution - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskExecution.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TaskExecution message. - * @function verify - * @memberof google.cloud.batch.v1alpha.TaskExecution - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TaskExecution.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.exitCode != null && message.hasOwnProperty("exitCode")) - if (!$util.isInteger(message.exitCode)) - return "exitCode: integer expected"; - if (message.stderrSnippet != null && message.hasOwnProperty("stderrSnippet")) - if (!$util.isString(message.stderrSnippet)) - return "stderrSnippet: string expected"; - return null; - }; - - /** - * Creates a TaskExecution message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.TaskExecution - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.TaskExecution} TaskExecution - */ - TaskExecution.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.TaskExecution) - return object; - var message = new $root.google.cloud.batch.v1alpha.TaskExecution(); - if (object.exitCode != null) - message.exitCode = object.exitCode | 0; - if (object.stderrSnippet != null) - message.stderrSnippet = String(object.stderrSnippet); - return message; - }; - - /** - * Creates a plain object from a TaskExecution message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.TaskExecution - * @static - * @param {google.cloud.batch.v1alpha.TaskExecution} message TaskExecution - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TaskExecution.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.exitCode = 0; - object.stderrSnippet = ""; - } - if (message.exitCode != null && message.hasOwnProperty("exitCode")) - object.exitCode = message.exitCode; - if (message.stderrSnippet != null && message.hasOwnProperty("stderrSnippet")) - object.stderrSnippet = message.stderrSnippet; - return object; - }; - - /** - * Converts this TaskExecution to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.TaskExecution - * @instance - * @returns {Object.} JSON object - */ - TaskExecution.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TaskExecution - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.TaskExecution - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TaskExecution.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.TaskExecution"; - }; - - return TaskExecution; - })(); - - v1alpha.TaskStatus = (function() { - - /** - * Properties of a TaskStatus. - * @memberof google.cloud.batch.v1alpha - * @interface ITaskStatus - * @property {google.cloud.batch.v1alpha.TaskStatus.State|null} [state] TaskStatus state - * @property {Array.|null} [statusEvents] TaskStatus statusEvents - * @property {google.cloud.batch.v1alpha.ITaskResourceUsage|null} [resourceUsage] TaskStatus resourceUsage - */ - - /** - * Constructs a new TaskStatus. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a TaskStatus. - * @implements ITaskStatus - * @constructor - * @param {google.cloud.batch.v1alpha.ITaskStatus=} [properties] Properties to set - */ - function TaskStatus(properties) { - this.statusEvents = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TaskStatus state. - * @member {google.cloud.batch.v1alpha.TaskStatus.State} state - * @memberof google.cloud.batch.v1alpha.TaskStatus - * @instance - */ - TaskStatus.prototype.state = 0; - - /** - * TaskStatus statusEvents. - * @member {Array.} statusEvents - * @memberof google.cloud.batch.v1alpha.TaskStatus - * @instance - */ - TaskStatus.prototype.statusEvents = $util.emptyArray; - - /** - * TaskStatus resourceUsage. - * @member {google.cloud.batch.v1alpha.ITaskResourceUsage|null|undefined} resourceUsage - * @memberof google.cloud.batch.v1alpha.TaskStatus - * @instance - */ - TaskStatus.prototype.resourceUsage = null; - - /** - * Creates a new TaskStatus instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.TaskStatus - * @static - * @param {google.cloud.batch.v1alpha.ITaskStatus=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.TaskStatus} TaskStatus instance - */ - TaskStatus.create = function create(properties) { - return new TaskStatus(properties); - }; - - /** - * Encodes the specified TaskStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.TaskStatus - * @static - * @param {google.cloud.batch.v1alpha.ITaskStatus} message TaskStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskStatus.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); - if (message.statusEvents != null && message.statusEvents.length) - for (var i = 0; i < message.statusEvents.length; ++i) - $root.google.cloud.batch.v1alpha.StatusEvent.encode(message.statusEvents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.resourceUsage != null && Object.hasOwnProperty.call(message, "resourceUsage")) - $root.google.cloud.batch.v1alpha.TaskResourceUsage.encode(message.resourceUsage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TaskStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.TaskStatus - * @static - * @param {google.cloud.batch.v1alpha.ITaskStatus} message TaskStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TaskStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.TaskStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.TaskStatus} TaskStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskStatus.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.TaskStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.state = reader.int32(); - break; - } - case 2: { - if (!(message.statusEvents && message.statusEvents.length)) - message.statusEvents = []; - message.statusEvents.push($root.google.cloud.batch.v1alpha.StatusEvent.decode(reader, reader.uint32())); - break; - } - case 3: { - message.resourceUsage = $root.google.cloud.batch.v1alpha.TaskResourceUsage.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TaskStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.TaskStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.TaskStatus} TaskStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TaskStatus message. - * @function verify - * @memberof google.cloud.batch.v1alpha.TaskStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TaskStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.statusEvents != null && message.hasOwnProperty("statusEvents")) { - if (!Array.isArray(message.statusEvents)) - return "statusEvents: array expected"; - for (var i = 0; i < message.statusEvents.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.StatusEvent.verify(message.statusEvents[i]); - if (error) - return "statusEvents." + error; - } - } - if (message.resourceUsage != null && message.hasOwnProperty("resourceUsage")) { - var error = $root.google.cloud.batch.v1alpha.TaskResourceUsage.verify(message.resourceUsage); - if (error) - return "resourceUsage." + error; - } - return null; - }; - - /** - * Creates a TaskStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.TaskStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.TaskStatus} TaskStatus - */ - TaskStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.TaskStatus) - return object; - var message = new $root.google.cloud.batch.v1alpha.TaskStatus(); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "PENDING": - case 1: - message.state = 1; - break; - case "ASSIGNED": - case 2: - message.state = 2; - break; - case "RUNNING": - case 3: - message.state = 3; - break; - case "FAILED": - case 4: - message.state = 4; - break; - case "SUCCEEDED": - case 5: - message.state = 5; - break; - case "UNEXECUTED": - case 6: - message.state = 6; - break; - } - if (object.statusEvents) { - if (!Array.isArray(object.statusEvents)) - throw TypeError(".google.cloud.batch.v1alpha.TaskStatus.statusEvents: array expected"); - message.statusEvents = []; - for (var i = 0; i < object.statusEvents.length; ++i) { - if (typeof object.statusEvents[i] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.TaskStatus.statusEvents: object expected"); - message.statusEvents[i] = $root.google.cloud.batch.v1alpha.StatusEvent.fromObject(object.statusEvents[i]); - } - } - if (object.resourceUsage != null) { - if (typeof object.resourceUsage !== "object") - throw TypeError(".google.cloud.batch.v1alpha.TaskStatus.resourceUsage: object expected"); - message.resourceUsage = $root.google.cloud.batch.v1alpha.TaskResourceUsage.fromObject(object.resourceUsage); - } - return message; - }; - - /** - * Creates a plain object from a TaskStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.TaskStatus - * @static - * @param {google.cloud.batch.v1alpha.TaskStatus} message TaskStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TaskStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.statusEvents = []; - if (options.defaults) { - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.resourceUsage = null; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.batch.v1alpha.TaskStatus.State[message.state] === undefined ? message.state : $root.google.cloud.batch.v1alpha.TaskStatus.State[message.state] : message.state; - if (message.statusEvents && message.statusEvents.length) { - object.statusEvents = []; - for (var j = 0; j < message.statusEvents.length; ++j) - object.statusEvents[j] = $root.google.cloud.batch.v1alpha.StatusEvent.toObject(message.statusEvents[j], options); - } - if (message.resourceUsage != null && message.hasOwnProperty("resourceUsage")) - object.resourceUsage = $root.google.cloud.batch.v1alpha.TaskResourceUsage.toObject(message.resourceUsage, options); - return object; - }; - - /** - * Converts this TaskStatus to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.TaskStatus - * @instance - * @returns {Object.} JSON object - */ - TaskStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TaskStatus - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.TaskStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TaskStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.TaskStatus"; - }; - - /** - * State enum. - * @name google.cloud.batch.v1alpha.TaskStatus.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} PENDING=1 PENDING value - * @property {number} ASSIGNED=2 ASSIGNED value - * @property {number} RUNNING=3 RUNNING value - * @property {number} FAILED=4 FAILED value - * @property {number} SUCCEEDED=5 SUCCEEDED value - * @property {number} UNEXECUTED=6 UNEXECUTED value - */ - TaskStatus.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PENDING"] = 1; - values[valuesById[2] = "ASSIGNED"] = 2; - values[valuesById[3] = "RUNNING"] = 3; - values[valuesById[4] = "FAILED"] = 4; - values[valuesById[5] = "SUCCEEDED"] = 5; - values[valuesById[6] = "UNEXECUTED"] = 6; - return values; - })(); - - return TaskStatus; - })(); - - v1alpha.TaskResourceUsage = (function() { - - /** - * Properties of a TaskResourceUsage. - * @memberof google.cloud.batch.v1alpha - * @interface ITaskResourceUsage - * @property {number|null} [coreHours] TaskResourceUsage coreHours - */ - - /** - * Constructs a new TaskResourceUsage. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a TaskResourceUsage. - * @implements ITaskResourceUsage - * @constructor - * @param {google.cloud.batch.v1alpha.ITaskResourceUsage=} [properties] Properties to set - */ - function TaskResourceUsage(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TaskResourceUsage coreHours. - * @member {number} coreHours - * @memberof google.cloud.batch.v1alpha.TaskResourceUsage - * @instance - */ - TaskResourceUsage.prototype.coreHours = 0; - - /** - * Creates a new TaskResourceUsage instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.TaskResourceUsage - * @static - * @param {google.cloud.batch.v1alpha.ITaskResourceUsage=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.TaskResourceUsage} TaskResourceUsage instance - */ - TaskResourceUsage.create = function create(properties) { - return new TaskResourceUsage(properties); - }; - - /** - * Encodes the specified TaskResourceUsage message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskResourceUsage.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.TaskResourceUsage - * @static - * @param {google.cloud.batch.v1alpha.ITaskResourceUsage} message TaskResourceUsage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskResourceUsage.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.coreHours != null && Object.hasOwnProperty.call(message, "coreHours")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.coreHours); - return writer; - }; - - /** - * Encodes the specified TaskResourceUsage message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskResourceUsage.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.TaskResourceUsage - * @static - * @param {google.cloud.batch.v1alpha.ITaskResourceUsage} message TaskResourceUsage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskResourceUsage.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TaskResourceUsage message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.TaskResourceUsage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.TaskResourceUsage} TaskResourceUsage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskResourceUsage.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.TaskResourceUsage(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.coreHours = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TaskResourceUsage message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.TaskResourceUsage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.TaskResourceUsage} TaskResourceUsage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskResourceUsage.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TaskResourceUsage message. - * @function verify - * @memberof google.cloud.batch.v1alpha.TaskResourceUsage - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TaskResourceUsage.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.coreHours != null && message.hasOwnProperty("coreHours")) - if (typeof message.coreHours !== "number") - return "coreHours: number expected"; - return null; - }; - - /** - * Creates a TaskResourceUsage message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.TaskResourceUsage - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.TaskResourceUsage} TaskResourceUsage - */ - TaskResourceUsage.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.TaskResourceUsage) - return object; - var message = new $root.google.cloud.batch.v1alpha.TaskResourceUsage(); - if (object.coreHours != null) - message.coreHours = Number(object.coreHours); - return message; - }; - - /** - * Creates a plain object from a TaskResourceUsage message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.TaskResourceUsage - * @static - * @param {google.cloud.batch.v1alpha.TaskResourceUsage} message TaskResourceUsage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TaskResourceUsage.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.coreHours = 0; - if (message.coreHours != null && message.hasOwnProperty("coreHours")) - object.coreHours = options.json && !isFinite(message.coreHours) ? String(message.coreHours) : message.coreHours; - return object; - }; - - /** - * Converts this TaskResourceUsage to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.TaskResourceUsage - * @instance - * @returns {Object.} JSON object - */ - TaskResourceUsage.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TaskResourceUsage - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.TaskResourceUsage - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TaskResourceUsage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.TaskResourceUsage"; - }; - - return TaskResourceUsage; - })(); - - v1alpha.Runnable = (function() { - - /** - * Properties of a Runnable. - * @memberof google.cloud.batch.v1alpha - * @interface IRunnable - * @property {google.cloud.batch.v1alpha.Runnable.IContainer|null} [container] Runnable container - * @property {google.cloud.batch.v1alpha.Runnable.IScript|null} [script] Runnable script - * @property {google.cloud.batch.v1alpha.Runnable.IBarrier|null} [barrier] Runnable barrier - * @property {string|null} [displayName] Runnable displayName - * @property {boolean|null} [ignoreExitStatus] Runnable ignoreExitStatus - * @property {boolean|null} [background] Runnable background - * @property {boolean|null} [alwaysRun] Runnable alwaysRun - * @property {google.cloud.batch.v1alpha.IEnvironment|null} [environment] Runnable environment - * @property {google.protobuf.IDuration|null} [timeout] Runnable timeout - * @property {Object.|null} [labels] Runnable labels - */ - - /** - * Constructs a new Runnable. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a Runnable. - * @implements IRunnable - * @constructor - * @param {google.cloud.batch.v1alpha.IRunnable=} [properties] Properties to set - */ - function Runnable(properties) { - this.labels = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Runnable container. - * @member {google.cloud.batch.v1alpha.Runnable.IContainer|null|undefined} container - * @memberof google.cloud.batch.v1alpha.Runnable - * @instance - */ - Runnable.prototype.container = null; - - /** - * Runnable script. - * @member {google.cloud.batch.v1alpha.Runnable.IScript|null|undefined} script - * @memberof google.cloud.batch.v1alpha.Runnable - * @instance - */ - Runnable.prototype.script = null; - - /** - * Runnable barrier. - * @member {google.cloud.batch.v1alpha.Runnable.IBarrier|null|undefined} barrier - * @memberof google.cloud.batch.v1alpha.Runnable - * @instance - */ - Runnable.prototype.barrier = null; - - /** - * Runnable displayName. - * @member {string} displayName - * @memberof google.cloud.batch.v1alpha.Runnable - * @instance - */ - Runnable.prototype.displayName = ""; - - /** - * Runnable ignoreExitStatus. - * @member {boolean} ignoreExitStatus - * @memberof google.cloud.batch.v1alpha.Runnable - * @instance - */ - Runnable.prototype.ignoreExitStatus = false; - - /** - * Runnable background. - * @member {boolean} background - * @memberof google.cloud.batch.v1alpha.Runnable - * @instance - */ - Runnable.prototype.background = false; - - /** - * Runnable alwaysRun. - * @member {boolean} alwaysRun - * @memberof google.cloud.batch.v1alpha.Runnable - * @instance - */ - Runnable.prototype.alwaysRun = false; - - /** - * Runnable environment. - * @member {google.cloud.batch.v1alpha.IEnvironment|null|undefined} environment - * @memberof google.cloud.batch.v1alpha.Runnable - * @instance - */ - Runnable.prototype.environment = null; - - /** - * Runnable timeout. - * @member {google.protobuf.IDuration|null|undefined} timeout - * @memberof google.cloud.batch.v1alpha.Runnable - * @instance - */ - Runnable.prototype.timeout = null; - - /** - * Runnable labels. - * @member {Object.} labels - * @memberof google.cloud.batch.v1alpha.Runnable - * @instance - */ - Runnable.prototype.labels = $util.emptyObject; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Runnable executable. - * @member {"container"|"script"|"barrier"|undefined} executable - * @memberof google.cloud.batch.v1alpha.Runnable - * @instance - */ - Object.defineProperty(Runnable.prototype, "executable", { - get: $util.oneOfGetter($oneOfFields = ["container", "script", "barrier"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Runnable instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.Runnable - * @static - * @param {google.cloud.batch.v1alpha.IRunnable=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.Runnable} Runnable instance - */ - Runnable.create = function create(properties) { - return new Runnable(properties); - }; - - /** - * Encodes the specified Runnable message. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.Runnable - * @static - * @param {google.cloud.batch.v1alpha.IRunnable} message Runnable message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Runnable.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.container != null && Object.hasOwnProperty.call(message, "container")) - $root.google.cloud.batch.v1alpha.Runnable.Container.encode(message.container, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.script != null && Object.hasOwnProperty.call(message, "script")) - $root.google.cloud.batch.v1alpha.Runnable.Script.encode(message.script, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.ignoreExitStatus != null && Object.hasOwnProperty.call(message, "ignoreExitStatus")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.ignoreExitStatus); - if (message.background != null && Object.hasOwnProperty.call(message, "background")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.background); - if (message.alwaysRun != null && Object.hasOwnProperty.call(message, "alwaysRun")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.alwaysRun); - if (message.barrier != null && Object.hasOwnProperty.call(message, "barrier")) - $root.google.cloud.batch.v1alpha.Runnable.Barrier.encode(message.barrier, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) - $root.google.cloud.batch.v1alpha.Environment.encode(message.environment, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) - $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - 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 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.displayName); - return writer; - }; - - /** - * Encodes the specified Runnable message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.Runnable - * @static - * @param {google.cloud.batch.v1alpha.IRunnable} message Runnable message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Runnable.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Runnable message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.Runnable - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.Runnable} Runnable - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Runnable.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Runnable(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.container = $root.google.cloud.batch.v1alpha.Runnable.Container.decode(reader, reader.uint32()); - break; - } - case 2: { - message.script = $root.google.cloud.batch.v1alpha.Runnable.Script.decode(reader, reader.uint32()); - break; - } - case 6: { - message.barrier = $root.google.cloud.batch.v1alpha.Runnable.Barrier.decode(reader, reader.uint32()); - break; - } - case 10: { - message.displayName = reader.string(); - break; - } - case 3: { - message.ignoreExitStatus = reader.bool(); - break; - } - case 4: { - message.background = reader.bool(); - break; - } - case 5: { - message.alwaysRun = reader.bool(); - break; - } - case 7: { - message.environment = $root.google.cloud.batch.v1alpha.Environment.decode(reader, reader.uint32()); - break; - } - case 8: { - message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 9: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Runnable message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.Runnable - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.Runnable} Runnable - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Runnable.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Runnable message. - * @function verify - * @memberof google.cloud.batch.v1alpha.Runnable - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Runnable.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.container != null && message.hasOwnProperty("container")) { - properties.executable = 1; - { - var error = $root.google.cloud.batch.v1alpha.Runnable.Container.verify(message.container); - if (error) - return "container." + error; - } - } - if (message.script != null && message.hasOwnProperty("script")) { - if (properties.executable === 1) - return "executable: multiple values"; - properties.executable = 1; - { - var error = $root.google.cloud.batch.v1alpha.Runnable.Script.verify(message.script); - if (error) - return "script." + error; - } - } - if (message.barrier != null && message.hasOwnProperty("barrier")) { - if (properties.executable === 1) - return "executable: multiple values"; - properties.executable = 1; - { - var error = $root.google.cloud.batch.v1alpha.Runnable.Barrier.verify(message.barrier); - if (error) - return "barrier." + error; - } - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.ignoreExitStatus != null && message.hasOwnProperty("ignoreExitStatus")) - if (typeof message.ignoreExitStatus !== "boolean") - return "ignoreExitStatus: boolean expected"; - if (message.background != null && message.hasOwnProperty("background")) - if (typeof message.background !== "boolean") - return "background: boolean expected"; - if (message.alwaysRun != null && message.hasOwnProperty("alwaysRun")) - if (typeof message.alwaysRun !== "boolean") - return "alwaysRun: boolean expected"; - if (message.environment != null && message.hasOwnProperty("environment")) { - var error = $root.google.cloud.batch.v1alpha.Environment.verify(message.environment); - if (error) - return "environment." + error; - } - if (message.timeout != null && message.hasOwnProperty("timeout")) { - var error = $root.google.protobuf.Duration.verify(message.timeout); - if (error) - return "timeout." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - return null; - }; - - /** - * Creates a Runnable message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.Runnable - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.Runnable} Runnable - */ - Runnable.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.Runnable) - return object; - var message = new $root.google.cloud.batch.v1alpha.Runnable(); - if (object.container != null) { - if (typeof object.container !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Runnable.container: object expected"); - message.container = $root.google.cloud.batch.v1alpha.Runnable.Container.fromObject(object.container); - } - if (object.script != null) { - if (typeof object.script !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Runnable.script: object expected"); - message.script = $root.google.cloud.batch.v1alpha.Runnable.Script.fromObject(object.script); - } - if (object.barrier != null) { - if (typeof object.barrier !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Runnable.barrier: object expected"); - message.barrier = $root.google.cloud.batch.v1alpha.Runnable.Barrier.fromObject(object.barrier); - } - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.ignoreExitStatus != null) - message.ignoreExitStatus = Boolean(object.ignoreExitStatus); - if (object.background != null) - message.background = Boolean(object.background); - if (object.alwaysRun != null) - message.alwaysRun = Boolean(object.alwaysRun); - if (object.environment != null) { - if (typeof object.environment !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Runnable.environment: object expected"); - message.environment = $root.google.cloud.batch.v1alpha.Environment.fromObject(object.environment); - } - if (object.timeout != null) { - if (typeof object.timeout !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Runnable.timeout: object expected"); - message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Runnable.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - return message; - }; - - /** - * Creates a plain object from a Runnable message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.Runnable - * @static - * @param {google.cloud.batch.v1alpha.Runnable} message Runnable - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Runnable.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.ignoreExitStatus = false; - object.background = false; - object.alwaysRun = false; - object.environment = null; - object.timeout = null; - object.displayName = ""; - } - if (message.container != null && message.hasOwnProperty("container")) { - object.container = $root.google.cloud.batch.v1alpha.Runnable.Container.toObject(message.container, options); - if (options.oneofs) - object.executable = "container"; - } - if (message.script != null && message.hasOwnProperty("script")) { - object.script = $root.google.cloud.batch.v1alpha.Runnable.Script.toObject(message.script, options); - if (options.oneofs) - object.executable = "script"; - } - if (message.ignoreExitStatus != null && message.hasOwnProperty("ignoreExitStatus")) - object.ignoreExitStatus = message.ignoreExitStatus; - if (message.background != null && message.hasOwnProperty("background")) - object.background = message.background; - if (message.alwaysRun != null && message.hasOwnProperty("alwaysRun")) - object.alwaysRun = message.alwaysRun; - if (message.barrier != null && message.hasOwnProperty("barrier")) { - object.barrier = $root.google.cloud.batch.v1alpha.Runnable.Barrier.toObject(message.barrier, options); - if (options.oneofs) - object.executable = "barrier"; - } - if (message.environment != null && message.hasOwnProperty("environment")) - object.environment = $root.google.cloud.batch.v1alpha.Environment.toObject(message.environment, options); - if (message.timeout != null && message.hasOwnProperty("timeout")) - object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - return object; - }; - - /** - * Converts this Runnable to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.Runnable - * @instance - * @returns {Object.} JSON object - */ - Runnable.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Runnable - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.Runnable - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Runnable.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.Runnable"; - }; - - Runnable.Container = (function() { - - /** - * Properties of a Container. - * @memberof google.cloud.batch.v1alpha.Runnable - * @interface IContainer - * @property {string|null} [imageUri] Container imageUri - * @property {Array.|null} [commands] Container commands - * @property {string|null} [entrypoint] Container entrypoint - * @property {Array.|null} [volumes] Container volumes - * @property {string|null} [options] Container options - * @property {boolean|null} [blockExternalNetwork] Container blockExternalNetwork - * @property {string|null} [username] Container username - * @property {string|null} [password] Container password - * @property {boolean|null} [enableImageStreaming] Container enableImageStreaming - */ - - /** - * Constructs a new Container. - * @memberof google.cloud.batch.v1alpha.Runnable - * @classdesc Represents a Container. - * @implements IContainer - * @constructor - * @param {google.cloud.batch.v1alpha.Runnable.IContainer=} [properties] Properties to set - */ - function Container(properties) { - this.commands = []; - this.volumes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Container imageUri. - * @member {string} imageUri - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @instance - */ - Container.prototype.imageUri = ""; - - /** - * Container commands. - * @member {Array.} commands - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @instance - */ - Container.prototype.commands = $util.emptyArray; - - /** - * Container entrypoint. - * @member {string} entrypoint - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @instance - */ - Container.prototype.entrypoint = ""; - - /** - * Container volumes. - * @member {Array.} volumes - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @instance - */ - Container.prototype.volumes = $util.emptyArray; - - /** - * Container options. - * @member {string} options - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @instance - */ - Container.prototype.options = ""; - - /** - * Container blockExternalNetwork. - * @member {boolean} blockExternalNetwork - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @instance - */ - Container.prototype.blockExternalNetwork = false; - - /** - * Container username. - * @member {string} username - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @instance - */ - Container.prototype.username = ""; - - /** - * Container password. - * @member {string} password - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @instance - */ - Container.prototype.password = ""; - - /** - * Container enableImageStreaming. - * @member {boolean} enableImageStreaming - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @instance - */ - Container.prototype.enableImageStreaming = false; - - /** - * Creates a new Container instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @static - * @param {google.cloud.batch.v1alpha.Runnable.IContainer=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.Runnable.Container} Container instance - */ - Container.create = function create(properties) { - return new Container(properties); - }; - - /** - * Encodes the specified Container message. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Container.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @static - * @param {google.cloud.batch.v1alpha.Runnable.IContainer} message Container message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Container.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.imageUri != null && Object.hasOwnProperty.call(message, "imageUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.imageUri); - if (message.commands != null && message.commands.length) - for (var i = 0; i < message.commands.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.commands[i]); - if (message.entrypoint != null && Object.hasOwnProperty.call(message, "entrypoint")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.entrypoint); - if (message.volumes != null && message.volumes.length) - for (var i = 0; i < message.volumes.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.volumes[i]); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.options); - if (message.blockExternalNetwork != null && Object.hasOwnProperty.call(message, "blockExternalNetwork")) - writer.uint32(/* id 9, wireType 0 =*/72).bool(message.blockExternalNetwork); - if (message.username != null && Object.hasOwnProperty.call(message, "username")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.username); - if (message.password != null && Object.hasOwnProperty.call(message, "password")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.password); - if (message.enableImageStreaming != null && Object.hasOwnProperty.call(message, "enableImageStreaming")) - writer.uint32(/* id 12, wireType 0 =*/96).bool(message.enableImageStreaming); - return writer; - }; - - /** - * Encodes the specified Container message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Container.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @static - * @param {google.cloud.batch.v1alpha.Runnable.IContainer} message Container message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Container.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Container message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.Runnable.Container} Container - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Container.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Runnable.Container(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.imageUri = reader.string(); - break; - } - case 2: { - if (!(message.commands && message.commands.length)) - message.commands = []; - message.commands.push(reader.string()); - break; - } - case 3: { - message.entrypoint = reader.string(); - break; - } - case 7: { - if (!(message.volumes && message.volumes.length)) - message.volumes = []; - message.volumes.push(reader.string()); - break; - } - case 8: { - message.options = reader.string(); - break; - } - case 9: { - message.blockExternalNetwork = reader.bool(); - break; - } - case 10: { - message.username = reader.string(); - break; - } - case 11: { - message.password = reader.string(); - break; - } - case 12: { - message.enableImageStreaming = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Container message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.Runnable.Container} Container - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Container.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Container message. - * @function verify - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Container.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.imageUri != null && message.hasOwnProperty("imageUri")) - if (!$util.isString(message.imageUri)) - return "imageUri: string expected"; - if (message.commands != null && message.hasOwnProperty("commands")) { - if (!Array.isArray(message.commands)) - return "commands: array expected"; - for (var i = 0; i < message.commands.length; ++i) - if (!$util.isString(message.commands[i])) - return "commands: string[] expected"; - } - if (message.entrypoint != null && message.hasOwnProperty("entrypoint")) - if (!$util.isString(message.entrypoint)) - return "entrypoint: string expected"; - if (message.volumes != null && message.hasOwnProperty("volumes")) { - if (!Array.isArray(message.volumes)) - return "volumes: array expected"; - for (var i = 0; i < message.volumes.length; ++i) - if (!$util.isString(message.volumes[i])) - return "volumes: string[] expected"; - } - if (message.options != null && message.hasOwnProperty("options")) - if (!$util.isString(message.options)) - return "options: string expected"; - if (message.blockExternalNetwork != null && message.hasOwnProperty("blockExternalNetwork")) - if (typeof message.blockExternalNetwork !== "boolean") - return "blockExternalNetwork: boolean expected"; - if (message.username != null && message.hasOwnProperty("username")) - if (!$util.isString(message.username)) - return "username: string expected"; - if (message.password != null && message.hasOwnProperty("password")) - if (!$util.isString(message.password)) - return "password: string expected"; - if (message.enableImageStreaming != null && message.hasOwnProperty("enableImageStreaming")) - if (typeof message.enableImageStreaming !== "boolean") - return "enableImageStreaming: boolean expected"; - return null; - }; - - /** - * Creates a Container message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.Runnable.Container} Container - */ - Container.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.Runnable.Container) - return object; - var message = new $root.google.cloud.batch.v1alpha.Runnable.Container(); - if (object.imageUri != null) - message.imageUri = String(object.imageUri); - if (object.commands) { - if (!Array.isArray(object.commands)) - throw TypeError(".google.cloud.batch.v1alpha.Runnable.Container.commands: array expected"); - message.commands = []; - for (var i = 0; i < object.commands.length; ++i) - message.commands[i] = String(object.commands[i]); - } - if (object.entrypoint != null) - message.entrypoint = String(object.entrypoint); - if (object.volumes) { - if (!Array.isArray(object.volumes)) - throw TypeError(".google.cloud.batch.v1alpha.Runnable.Container.volumes: array expected"); - message.volumes = []; - for (var i = 0; i < object.volumes.length; ++i) - message.volumes[i] = String(object.volumes[i]); - } - if (object.options != null) - message.options = String(object.options); - if (object.blockExternalNetwork != null) - message.blockExternalNetwork = Boolean(object.blockExternalNetwork); - if (object.username != null) - message.username = String(object.username); - if (object.password != null) - message.password = String(object.password); - if (object.enableImageStreaming != null) - message.enableImageStreaming = Boolean(object.enableImageStreaming); - return message; - }; - - /** - * Creates a plain object from a Container message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @static - * @param {google.cloud.batch.v1alpha.Runnable.Container} message Container - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Container.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.commands = []; - object.volumes = []; - } - if (options.defaults) { - object.imageUri = ""; - object.entrypoint = ""; - object.options = ""; - object.blockExternalNetwork = false; - object.username = ""; - object.password = ""; - object.enableImageStreaming = false; - } - if (message.imageUri != null && message.hasOwnProperty("imageUri")) - object.imageUri = message.imageUri; - if (message.commands && message.commands.length) { - object.commands = []; - for (var j = 0; j < message.commands.length; ++j) - object.commands[j] = message.commands[j]; - } - if (message.entrypoint != null && message.hasOwnProperty("entrypoint")) - object.entrypoint = message.entrypoint; - if (message.volumes && message.volumes.length) { - object.volumes = []; - for (var j = 0; j < message.volumes.length; ++j) - object.volumes[j] = message.volumes[j]; - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = message.options; - if (message.blockExternalNetwork != null && message.hasOwnProperty("blockExternalNetwork")) - object.blockExternalNetwork = message.blockExternalNetwork; - if (message.username != null && message.hasOwnProperty("username")) - object.username = message.username; - if (message.password != null && message.hasOwnProperty("password")) - object.password = message.password; - if (message.enableImageStreaming != null && message.hasOwnProperty("enableImageStreaming")) - object.enableImageStreaming = message.enableImageStreaming; - return object; - }; - - /** - * Converts this Container to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @instance - * @returns {Object.} JSON object - */ - Container.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Container - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.Runnable.Container - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Container.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.Runnable.Container"; - }; - - return Container; - })(); - - Runnable.Script = (function() { - - /** - * Properties of a Script. - * @memberof google.cloud.batch.v1alpha.Runnable - * @interface IScript - * @property {string|null} [path] Script path - * @property {string|null} [text] Script text - */ - - /** - * Constructs a new Script. - * @memberof google.cloud.batch.v1alpha.Runnable - * @classdesc Represents a Script. - * @implements IScript - * @constructor - * @param {google.cloud.batch.v1alpha.Runnable.IScript=} [properties] Properties to set - */ - function Script(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Script path. - * @member {string|null|undefined} path - * @memberof google.cloud.batch.v1alpha.Runnable.Script - * @instance - */ - Script.prototype.path = null; - - /** - * Script text. - * @member {string|null|undefined} text - * @memberof google.cloud.batch.v1alpha.Runnable.Script - * @instance - */ - Script.prototype.text = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Script command. - * @member {"path"|"text"|undefined} command - * @memberof google.cloud.batch.v1alpha.Runnable.Script - * @instance - */ - Object.defineProperty(Script.prototype, "command", { - get: $util.oneOfGetter($oneOfFields = ["path", "text"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Script instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.Runnable.Script - * @static - * @param {google.cloud.batch.v1alpha.Runnable.IScript=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.Runnable.Script} Script instance - */ - Script.create = function create(properties) { - return new Script(properties); - }; - - /** - * Encodes the specified Script message. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Script.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.Runnable.Script - * @static - * @param {google.cloud.batch.v1alpha.Runnable.IScript} message Script message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Script.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.path); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.text); - return writer; - }; - - /** - * Encodes the specified Script message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Script.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.Runnable.Script - * @static - * @param {google.cloud.batch.v1alpha.Runnable.IScript} message Script message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Script.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Script message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.Runnable.Script - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.Runnable.Script} Script - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Script.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Runnable.Script(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.path = reader.string(); - break; - } - case 2: { - message.text = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Script message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.Runnable.Script - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.Runnable.Script} Script - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Script.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Script message. - * @function verify - * @memberof google.cloud.batch.v1alpha.Runnable.Script - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Script.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.path != null && message.hasOwnProperty("path")) { - properties.command = 1; - if (!$util.isString(message.path)) - return "path: string expected"; - } - if (message.text != null && message.hasOwnProperty("text")) { - if (properties.command === 1) - return "command: multiple values"; - properties.command = 1; - if (!$util.isString(message.text)) - return "text: string expected"; - } - return null; - }; - - /** - * Creates a Script message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.Runnable.Script - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.Runnable.Script} Script - */ - Script.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.Runnable.Script) - return object; - var message = new $root.google.cloud.batch.v1alpha.Runnable.Script(); - if (object.path != null) - message.path = String(object.path); - if (object.text != null) - message.text = String(object.text); - return message; - }; - - /** - * Creates a plain object from a Script message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.Runnable.Script - * @static - * @param {google.cloud.batch.v1alpha.Runnable.Script} message Script - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Script.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.path != null && message.hasOwnProperty("path")) { - object.path = message.path; - if (options.oneofs) - object.command = "path"; - } - if (message.text != null && message.hasOwnProperty("text")) { - object.text = message.text; - if (options.oneofs) - object.command = "text"; - } - return object; - }; - - /** - * Converts this Script to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.Runnable.Script - * @instance - * @returns {Object.} JSON object - */ - Script.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Script - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.Runnable.Script - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Script.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.Runnable.Script"; - }; - - return Script; - })(); - - Runnable.Barrier = (function() { - - /** - * Properties of a Barrier. - * @memberof google.cloud.batch.v1alpha.Runnable - * @interface IBarrier - * @property {string|null} [name] Barrier name - */ - - /** - * Constructs a new Barrier. - * @memberof google.cloud.batch.v1alpha.Runnable - * @classdesc Represents a Barrier. - * @implements IBarrier - * @constructor - * @param {google.cloud.batch.v1alpha.Runnable.IBarrier=} [properties] Properties to set - */ - function Barrier(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Barrier name. - * @member {string} name - * @memberof google.cloud.batch.v1alpha.Runnable.Barrier - * @instance - */ - Barrier.prototype.name = ""; - - /** - * Creates a new Barrier instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.Runnable.Barrier - * @static - * @param {google.cloud.batch.v1alpha.Runnable.IBarrier=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.Runnable.Barrier} Barrier instance - */ - Barrier.create = function create(properties) { - return new Barrier(properties); - }; - - /** - * Encodes the specified Barrier message. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Barrier.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.Runnable.Barrier - * @static - * @param {google.cloud.batch.v1alpha.Runnable.IBarrier} message Barrier message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Barrier.encode = function encode(message, writer) { - 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 Barrier message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Runnable.Barrier.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.Runnable.Barrier - * @static - * @param {google.cloud.batch.v1alpha.Runnable.IBarrier} message Barrier message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Barrier.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Barrier message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.Runnable.Barrier - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.Runnable.Barrier} Barrier - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Barrier.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Runnable.Barrier(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Barrier message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.Runnable.Barrier - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.Runnable.Barrier} Barrier - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Barrier.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Barrier message. - * @function verify - * @memberof google.cloud.batch.v1alpha.Runnable.Barrier - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Barrier.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a Barrier message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.Runnable.Barrier - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.Runnable.Barrier} Barrier - */ - Barrier.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.Runnable.Barrier) - return object; - var message = new $root.google.cloud.batch.v1alpha.Runnable.Barrier(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a Barrier message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.Runnable.Barrier - * @static - * @param {google.cloud.batch.v1alpha.Runnable.Barrier} message Barrier - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Barrier.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 Barrier to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.Runnable.Barrier - * @instance - * @returns {Object.} JSON object - */ - Barrier.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Barrier - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.Runnable.Barrier - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Barrier.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.Runnable.Barrier"; - }; - - return Barrier; - })(); - - return Runnable; - })(); - - v1alpha.TaskSpec = (function() { - - /** - * Properties of a TaskSpec. - * @memberof google.cloud.batch.v1alpha - * @interface ITaskSpec - * @property {Array.|null} [runnables] TaskSpec runnables - * @property {google.cloud.batch.v1alpha.IComputeResource|null} [computeResource] TaskSpec computeResource - * @property {google.protobuf.IDuration|null} [maxRunDuration] TaskSpec maxRunDuration - * @property {number|null} [maxRetryCount] TaskSpec maxRetryCount - * @property {Array.|null} [lifecyclePolicies] TaskSpec lifecyclePolicies - * @property {Object.|null} [environments] TaskSpec environments - * @property {Array.|null} [volumes] TaskSpec volumes - * @property {google.cloud.batch.v1alpha.IEnvironment|null} [environment] TaskSpec environment - */ - - /** - * Constructs a new TaskSpec. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a TaskSpec. - * @implements ITaskSpec - * @constructor - * @param {google.cloud.batch.v1alpha.ITaskSpec=} [properties] Properties to set - */ - function TaskSpec(properties) { - this.runnables = []; - this.lifecyclePolicies = []; - this.environments = {}; - this.volumes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TaskSpec runnables. - * @member {Array.} runnables - * @memberof google.cloud.batch.v1alpha.TaskSpec - * @instance - */ - TaskSpec.prototype.runnables = $util.emptyArray; - - /** - * TaskSpec computeResource. - * @member {google.cloud.batch.v1alpha.IComputeResource|null|undefined} computeResource - * @memberof google.cloud.batch.v1alpha.TaskSpec - * @instance - */ - TaskSpec.prototype.computeResource = null; - - /** - * TaskSpec maxRunDuration. - * @member {google.protobuf.IDuration|null|undefined} maxRunDuration - * @memberof google.cloud.batch.v1alpha.TaskSpec - * @instance - */ - TaskSpec.prototype.maxRunDuration = null; - - /** - * TaskSpec maxRetryCount. - * @member {number} maxRetryCount - * @memberof google.cloud.batch.v1alpha.TaskSpec - * @instance - */ - TaskSpec.prototype.maxRetryCount = 0; - - /** - * TaskSpec lifecyclePolicies. - * @member {Array.} lifecyclePolicies - * @memberof google.cloud.batch.v1alpha.TaskSpec - * @instance - */ - TaskSpec.prototype.lifecyclePolicies = $util.emptyArray; - - /** - * TaskSpec environments. - * @member {Object.} environments - * @memberof google.cloud.batch.v1alpha.TaskSpec - * @instance - */ - TaskSpec.prototype.environments = $util.emptyObject; - - /** - * TaskSpec volumes. - * @member {Array.} volumes - * @memberof google.cloud.batch.v1alpha.TaskSpec - * @instance - */ - TaskSpec.prototype.volumes = $util.emptyArray; - - /** - * TaskSpec environment. - * @member {google.cloud.batch.v1alpha.IEnvironment|null|undefined} environment - * @memberof google.cloud.batch.v1alpha.TaskSpec - * @instance - */ - TaskSpec.prototype.environment = null; - - /** - * Creates a new TaskSpec instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.TaskSpec - * @static - * @param {google.cloud.batch.v1alpha.ITaskSpec=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.TaskSpec} TaskSpec instance - */ - TaskSpec.create = function create(properties) { - return new TaskSpec(properties); - }; - - /** - * Encodes the specified TaskSpec message. Does not implicitly {@link google.cloud.batch.v1alpha.TaskSpec.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.TaskSpec - * @static - * @param {google.cloud.batch.v1alpha.ITaskSpec} message TaskSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.computeResource != null && Object.hasOwnProperty.call(message, "computeResource")) - $root.google.cloud.batch.v1alpha.ComputeResource.encode(message.computeResource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.maxRunDuration != null && Object.hasOwnProperty.call(message, "maxRunDuration")) - $root.google.protobuf.Duration.encode(message.maxRunDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.maxRetryCount != null && Object.hasOwnProperty.call(message, "maxRetryCount")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxRetryCount); - if (message.environments != null && Object.hasOwnProperty.call(message, "environments")) - for (var keys = Object.keys(message.environments), i = 0; i < keys.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.environments[keys[i]]).ldelim(); - if (message.volumes != null && message.volumes.length) - for (var i = 0; i < message.volumes.length; ++i) - $root.google.cloud.batch.v1alpha.Volume.encode(message.volumes[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.runnables != null && message.runnables.length) - for (var i = 0; i < message.runnables.length; ++i) - $root.google.cloud.batch.v1alpha.Runnable.encode(message.runnables[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.lifecyclePolicies != null && message.lifecyclePolicies.length) - for (var i = 0; i < message.lifecyclePolicies.length; ++i) - $root.google.cloud.batch.v1alpha.LifecyclePolicy.encode(message.lifecyclePolicies[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) - $root.google.cloud.batch.v1alpha.Environment.encode(message.environment, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TaskSpec message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.TaskSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.TaskSpec - * @static - * @param {google.cloud.batch.v1alpha.ITaskSpec} message TaskSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TaskSpec message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.TaskSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.TaskSpec} TaskSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskSpec.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.TaskSpec(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 8: { - if (!(message.runnables && message.runnables.length)) - message.runnables = []; - message.runnables.push($root.google.cloud.batch.v1alpha.Runnable.decode(reader, reader.uint32())); - break; - } - case 3: { - message.computeResource = $root.google.cloud.batch.v1alpha.ComputeResource.decode(reader, reader.uint32()); - break; - } - case 4: { - message.maxRunDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 5: { - message.maxRetryCount = reader.int32(); - break; - } - case 9: { - if (!(message.lifecyclePolicies && message.lifecyclePolicies.length)) - message.lifecyclePolicies = []; - message.lifecyclePolicies.push($root.google.cloud.batch.v1alpha.LifecyclePolicy.decode(reader, reader.uint32())); - break; - } - case 6: { - if (message.environments === $util.emptyObject) - message.environments = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.environments[key] = value; - break; - } - case 7: { - if (!(message.volumes && message.volumes.length)) - message.volumes = []; - message.volumes.push($root.google.cloud.batch.v1alpha.Volume.decode(reader, reader.uint32())); - break; - } - case 10: { - message.environment = $root.google.cloud.batch.v1alpha.Environment.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TaskSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.TaskSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.TaskSpec} TaskSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TaskSpec message. - * @function verify - * @memberof google.cloud.batch.v1alpha.TaskSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TaskSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.runnables != null && message.hasOwnProperty("runnables")) { - if (!Array.isArray(message.runnables)) - return "runnables: array expected"; - for (var i = 0; i < message.runnables.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.Runnable.verify(message.runnables[i]); - if (error) - return "runnables." + error; - } - } - if (message.computeResource != null && message.hasOwnProperty("computeResource")) { - var error = $root.google.cloud.batch.v1alpha.ComputeResource.verify(message.computeResource); - if (error) - return "computeResource." + error; - } - if (message.maxRunDuration != null && message.hasOwnProperty("maxRunDuration")) { - var error = $root.google.protobuf.Duration.verify(message.maxRunDuration); - if (error) - return "maxRunDuration." + error; - } - if (message.maxRetryCount != null && message.hasOwnProperty("maxRetryCount")) - if (!$util.isInteger(message.maxRetryCount)) - return "maxRetryCount: integer expected"; - if (message.lifecyclePolicies != null && message.hasOwnProperty("lifecyclePolicies")) { - if (!Array.isArray(message.lifecyclePolicies)) - return "lifecyclePolicies: array expected"; - for (var i = 0; i < message.lifecyclePolicies.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.LifecyclePolicy.verify(message.lifecyclePolicies[i]); - if (error) - return "lifecyclePolicies." + error; - } - } - if (message.environments != null && message.hasOwnProperty("environments")) { - if (!$util.isObject(message.environments)) - return "environments: object expected"; - var key = Object.keys(message.environments); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.environments[key[i]])) - return "environments: string{k:string} expected"; - } - if (message.volumes != null && message.hasOwnProperty("volumes")) { - if (!Array.isArray(message.volumes)) - return "volumes: array expected"; - for (var i = 0; i < message.volumes.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.Volume.verify(message.volumes[i]); - if (error) - return "volumes." + error; - } - } - if (message.environment != null && message.hasOwnProperty("environment")) { - var error = $root.google.cloud.batch.v1alpha.Environment.verify(message.environment); - if (error) - return "environment." + error; - } - return null; - }; - - /** - * Creates a TaskSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.TaskSpec - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.TaskSpec} TaskSpec - */ - TaskSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.TaskSpec) - return object; - var message = new $root.google.cloud.batch.v1alpha.TaskSpec(); - if (object.runnables) { - if (!Array.isArray(object.runnables)) - throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.runnables: array expected"); - message.runnables = []; - for (var i = 0; i < object.runnables.length; ++i) { - if (typeof object.runnables[i] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.runnables: object expected"); - message.runnables[i] = $root.google.cloud.batch.v1alpha.Runnable.fromObject(object.runnables[i]); - } - } - if (object.computeResource != null) { - if (typeof object.computeResource !== "object") - throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.computeResource: object expected"); - message.computeResource = $root.google.cloud.batch.v1alpha.ComputeResource.fromObject(object.computeResource); - } - if (object.maxRunDuration != null) { - if (typeof object.maxRunDuration !== "object") - throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.maxRunDuration: object expected"); - message.maxRunDuration = $root.google.protobuf.Duration.fromObject(object.maxRunDuration); - } - if (object.maxRetryCount != null) - message.maxRetryCount = object.maxRetryCount | 0; - if (object.lifecyclePolicies) { - if (!Array.isArray(object.lifecyclePolicies)) - throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.lifecyclePolicies: array expected"); - message.lifecyclePolicies = []; - for (var i = 0; i < object.lifecyclePolicies.length; ++i) { - if (typeof object.lifecyclePolicies[i] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.lifecyclePolicies: object expected"); - message.lifecyclePolicies[i] = $root.google.cloud.batch.v1alpha.LifecyclePolicy.fromObject(object.lifecyclePolicies[i]); - } - } - if (object.environments) { - if (typeof object.environments !== "object") - throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.environments: object expected"); - message.environments = {}; - for (var keys = Object.keys(object.environments), i = 0; i < keys.length; ++i) - message.environments[keys[i]] = String(object.environments[keys[i]]); - } - if (object.volumes) { - if (!Array.isArray(object.volumes)) - throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.volumes: array expected"); - message.volumes = []; - for (var i = 0; i < object.volumes.length; ++i) { - if (typeof object.volumes[i] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.volumes: object expected"); - message.volumes[i] = $root.google.cloud.batch.v1alpha.Volume.fromObject(object.volumes[i]); - } - } - if (object.environment != null) { - if (typeof object.environment !== "object") - throw TypeError(".google.cloud.batch.v1alpha.TaskSpec.environment: object expected"); - message.environment = $root.google.cloud.batch.v1alpha.Environment.fromObject(object.environment); - } - return message; - }; - - /** - * Creates a plain object from a TaskSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.TaskSpec - * @static - * @param {google.cloud.batch.v1alpha.TaskSpec} message TaskSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TaskSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.volumes = []; - object.runnables = []; - object.lifecyclePolicies = []; - } - if (options.objects || options.defaults) - object.environments = {}; - if (options.defaults) { - object.computeResource = null; - object.maxRunDuration = null; - object.maxRetryCount = 0; - object.environment = null; - } - if (message.computeResource != null && message.hasOwnProperty("computeResource")) - object.computeResource = $root.google.cloud.batch.v1alpha.ComputeResource.toObject(message.computeResource, options); - if (message.maxRunDuration != null && message.hasOwnProperty("maxRunDuration")) - object.maxRunDuration = $root.google.protobuf.Duration.toObject(message.maxRunDuration, options); - if (message.maxRetryCount != null && message.hasOwnProperty("maxRetryCount")) - object.maxRetryCount = message.maxRetryCount; - var keys2; - if (message.environments && (keys2 = Object.keys(message.environments)).length) { - object.environments = {}; - for (var j = 0; j < keys2.length; ++j) - object.environments[keys2[j]] = message.environments[keys2[j]]; - } - if (message.volumes && message.volumes.length) { - object.volumes = []; - for (var j = 0; j < message.volumes.length; ++j) - object.volumes[j] = $root.google.cloud.batch.v1alpha.Volume.toObject(message.volumes[j], options); - } - if (message.runnables && message.runnables.length) { - object.runnables = []; - for (var j = 0; j < message.runnables.length; ++j) - object.runnables[j] = $root.google.cloud.batch.v1alpha.Runnable.toObject(message.runnables[j], options); - } - if (message.lifecyclePolicies && message.lifecyclePolicies.length) { - object.lifecyclePolicies = []; - for (var j = 0; j < message.lifecyclePolicies.length; ++j) - object.lifecyclePolicies[j] = $root.google.cloud.batch.v1alpha.LifecyclePolicy.toObject(message.lifecyclePolicies[j], options); - } - if (message.environment != null && message.hasOwnProperty("environment")) - object.environment = $root.google.cloud.batch.v1alpha.Environment.toObject(message.environment, options); - return object; - }; - - /** - * Converts this TaskSpec to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.TaskSpec - * @instance - * @returns {Object.} JSON object - */ - TaskSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TaskSpec - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.TaskSpec - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TaskSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.TaskSpec"; - }; - - return TaskSpec; - })(); - - v1alpha.LifecyclePolicy = (function() { - - /** - * Properties of a LifecyclePolicy. - * @memberof google.cloud.batch.v1alpha - * @interface ILifecyclePolicy - * @property {google.cloud.batch.v1alpha.LifecyclePolicy.Action|null} [action] LifecyclePolicy action - * @property {google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition|null} [actionCondition] LifecyclePolicy actionCondition - */ - - /** - * Constructs a new LifecyclePolicy. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a LifecyclePolicy. - * @implements ILifecyclePolicy - * @constructor - * @param {google.cloud.batch.v1alpha.ILifecyclePolicy=} [properties] Properties to set - */ - function LifecyclePolicy(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LifecyclePolicy action. - * @member {google.cloud.batch.v1alpha.LifecyclePolicy.Action} action - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy - * @instance - */ - LifecyclePolicy.prototype.action = 0; - - /** - * LifecyclePolicy actionCondition. - * @member {google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition|null|undefined} actionCondition - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy - * @instance - */ - LifecyclePolicy.prototype.actionCondition = null; - - /** - * Creates a new LifecyclePolicy instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy - * @static - * @param {google.cloud.batch.v1alpha.ILifecyclePolicy=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.LifecyclePolicy} LifecyclePolicy instance - */ - LifecyclePolicy.create = function create(properties) { - return new LifecyclePolicy(properties); - }; - - /** - * Encodes the specified LifecyclePolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.LifecyclePolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy - * @static - * @param {google.cloud.batch.v1alpha.ILifecyclePolicy} message LifecyclePolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LifecyclePolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); - if (message.actionCondition != null && Object.hasOwnProperty.call(message, "actionCondition")) - $root.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.encode(message.actionCondition, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LifecyclePolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.LifecyclePolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy - * @static - * @param {google.cloud.batch.v1alpha.ILifecyclePolicy} message LifecyclePolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LifecyclePolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LifecyclePolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.LifecyclePolicy} LifecyclePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LifecyclePolicy.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.LifecyclePolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.action = reader.int32(); - break; - } - case 2: { - message.actionCondition = $root.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LifecyclePolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.LifecyclePolicy} LifecyclePolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LifecyclePolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LifecyclePolicy message. - * @function verify - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LifecyclePolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.action != null && message.hasOwnProperty("action")) - switch (message.action) { - default: - return "action: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.actionCondition != null && message.hasOwnProperty("actionCondition")) { - var error = $root.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.verify(message.actionCondition); - if (error) - return "actionCondition." + error; - } - return null; - }; - - /** - * Creates a LifecyclePolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.LifecyclePolicy} LifecyclePolicy - */ - LifecyclePolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.LifecyclePolicy) - return object; - var message = new $root.google.cloud.batch.v1alpha.LifecyclePolicy(); - switch (object.action) { - default: - if (typeof object.action === "number") { - message.action = object.action; - break; - } - break; - case "ACTION_UNSPECIFIED": - case 0: - message.action = 0; - break; - case "RETRY_TASK": - case 1: - message.action = 1; - break; - case "FAIL_TASK": - case 2: - message.action = 2; - break; - } - if (object.actionCondition != null) { - if (typeof object.actionCondition !== "object") - throw TypeError(".google.cloud.batch.v1alpha.LifecyclePolicy.actionCondition: object expected"); - message.actionCondition = $root.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.fromObject(object.actionCondition); - } - return message; - }; - - /** - * Creates a plain object from a LifecyclePolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy - * @static - * @param {google.cloud.batch.v1alpha.LifecyclePolicy} message LifecyclePolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LifecyclePolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; - object.actionCondition = null; - } - if (message.action != null && message.hasOwnProperty("action")) - object.action = options.enums === String ? $root.google.cloud.batch.v1alpha.LifecyclePolicy.Action[message.action] === undefined ? message.action : $root.google.cloud.batch.v1alpha.LifecyclePolicy.Action[message.action] : message.action; - if (message.actionCondition != null && message.hasOwnProperty("actionCondition")) - object.actionCondition = $root.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.toObject(message.actionCondition, options); - return object; - }; - - /** - * Converts this LifecyclePolicy to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy - * @instance - * @returns {Object.} JSON object - */ - LifecyclePolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LifecyclePolicy - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LifecyclePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.LifecyclePolicy"; - }; - - LifecyclePolicy.ActionCondition = (function() { - - /** - * Properties of an ActionCondition. - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy - * @interface IActionCondition - * @property {Array.|null} [exitCodes] ActionCondition exitCodes - */ - - /** - * Constructs a new ActionCondition. - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy - * @classdesc Represents an ActionCondition. - * @implements IActionCondition - * @constructor - * @param {google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition=} [properties] Properties to set - */ - function ActionCondition(properties) { - this.exitCodes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ActionCondition exitCodes. - * @member {Array.} exitCodes - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition - * @instance - */ - ActionCondition.prototype.exitCodes = $util.emptyArray; - - /** - * Creates a new ActionCondition instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition - * @static - * @param {google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition} ActionCondition instance - */ - ActionCondition.create = function create(properties) { - return new ActionCondition(properties); - }; - - /** - * Encodes the specified ActionCondition message. Does not implicitly {@link google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition - * @static - * @param {google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition} message ActionCondition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ActionCondition.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.exitCodes != null && message.exitCodes.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.exitCodes.length; ++i) - writer.int32(message.exitCodes[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified ActionCondition message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition - * @static - * @param {google.cloud.batch.v1alpha.LifecyclePolicy.IActionCondition} message ActionCondition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ActionCondition.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ActionCondition message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition} ActionCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ActionCondition.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.exitCodes && message.exitCodes.length)) - message.exitCodes = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.exitCodes.push(reader.int32()); - } else - message.exitCodes.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ActionCondition message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition} ActionCondition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ActionCondition.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ActionCondition message. - * @function verify - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ActionCondition.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.exitCodes != null && message.hasOwnProperty("exitCodes")) { - if (!Array.isArray(message.exitCodes)) - return "exitCodes: array expected"; - for (var i = 0; i < message.exitCodes.length; ++i) - if (!$util.isInteger(message.exitCodes[i])) - return "exitCodes: integer[] expected"; - } - return null; - }; - - /** - * Creates an ActionCondition message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition} ActionCondition - */ - ActionCondition.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition) - return object; - var message = new $root.google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition(); - if (object.exitCodes) { - if (!Array.isArray(object.exitCodes)) - throw TypeError(".google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition.exitCodes: array expected"); - message.exitCodes = []; - for (var i = 0; i < object.exitCodes.length; ++i) - message.exitCodes[i] = object.exitCodes[i] | 0; - } - return message; - }; - - /** - * Creates a plain object from an ActionCondition message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition - * @static - * @param {google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition} message ActionCondition - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ActionCondition.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.exitCodes = []; - if (message.exitCodes && message.exitCodes.length) { - object.exitCodes = []; - for (var j = 0; j < message.exitCodes.length; ++j) - object.exitCodes[j] = message.exitCodes[j]; - } - return object; - }; - - /** - * Converts this ActionCondition to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition - * @instance - * @returns {Object.} JSON object - */ - ActionCondition.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ActionCondition - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ActionCondition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.LifecyclePolicy.ActionCondition"; - }; - - return ActionCondition; - })(); - - /** - * Action enum. - * @name google.cloud.batch.v1alpha.LifecyclePolicy.Action - * @enum {number} - * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value - * @property {number} RETRY_TASK=1 RETRY_TASK value - * @property {number} FAIL_TASK=2 FAIL_TASK value - */ - LifecyclePolicy.Action = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "RETRY_TASK"] = 1; - values[valuesById[2] = "FAIL_TASK"] = 2; - return values; - })(); - - return LifecyclePolicy; - })(); - - v1alpha.Task = (function() { - - /** - * Properties of a Task. - * @memberof google.cloud.batch.v1alpha - * @interface ITask - * @property {string|null} [name] Task name - * @property {google.cloud.batch.v1alpha.ITaskStatus|null} [status] Task status - */ - - /** - * Constructs a new Task. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a Task. - * @implements ITask - * @constructor - * @param {google.cloud.batch.v1alpha.ITask=} [properties] Properties to set - */ - function Task(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Task name. - * @member {string} name - * @memberof google.cloud.batch.v1alpha.Task - * @instance - */ - Task.prototype.name = ""; - - /** - * Task status. - * @member {google.cloud.batch.v1alpha.ITaskStatus|null|undefined} status - * @memberof google.cloud.batch.v1alpha.Task - * @instance - */ - Task.prototype.status = null; - - /** - * Creates a new Task instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.Task - * @static - * @param {google.cloud.batch.v1alpha.ITask=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.Task} Task instance - */ - Task.create = function create(properties) { - return new Task(properties); - }; - - /** - * Encodes the specified Task message. Does not implicitly {@link google.cloud.batch.v1alpha.Task.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.Task - * @static - * @param {google.cloud.batch.v1alpha.ITask} message Task message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Task.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.cloud.batch.v1alpha.TaskStatus.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Task message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Task.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.Task - * @static - * @param {google.cloud.batch.v1alpha.ITask} message Task message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Task.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Task message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.Task - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.Task} Task - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Task.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Task(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.status = $root.google.cloud.batch.v1alpha.TaskStatus.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Task message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.Task - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.Task} Task - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Task.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Task message. - * @function verify - * @memberof google.cloud.batch.v1alpha.Task - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Task.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.status != null && message.hasOwnProperty("status")) { - var error = $root.google.cloud.batch.v1alpha.TaskStatus.verify(message.status); - if (error) - return "status." + error; - } - return null; - }; - - /** - * Creates a Task message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.Task - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.Task} Task - */ - Task.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.Task) - return object; - var message = new $root.google.cloud.batch.v1alpha.Task(); - if (object.name != null) - message.name = String(object.name); - if (object.status != null) { - if (typeof object.status !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Task.status: object expected"); - message.status = $root.google.cloud.batch.v1alpha.TaskStatus.fromObject(object.status); - } - return message; - }; - - /** - * Creates a plain object from a Task message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.Task - * @static - * @param {google.cloud.batch.v1alpha.Task} message Task - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Task.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.status = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.cloud.batch.v1alpha.TaskStatus.toObject(message.status, options); - return object; - }; - - /** - * Converts this Task to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.Task - * @instance - * @returns {Object.} JSON object - */ - Task.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Task - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.Task - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Task.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.Task"; - }; - - return Task; - })(); - - v1alpha.Environment = (function() { - - /** - * Properties of an Environment. - * @memberof google.cloud.batch.v1alpha - * @interface IEnvironment - * @property {Object.|null} [variables] Environment variables - * @property {Object.|null} [secretVariables] Environment secretVariables - * @property {google.cloud.batch.v1alpha.Environment.IKMSEnvMap|null} [encryptedVariables] Environment encryptedVariables - */ - - /** - * Constructs a new Environment. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents an Environment. - * @implements IEnvironment - * @constructor - * @param {google.cloud.batch.v1alpha.IEnvironment=} [properties] Properties to set - */ - function Environment(properties) { - this.variables = {}; - this.secretVariables = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Environment variables. - * @member {Object.} variables - * @memberof google.cloud.batch.v1alpha.Environment - * @instance - */ - Environment.prototype.variables = $util.emptyObject; - - /** - * Environment secretVariables. - * @member {Object.} secretVariables - * @memberof google.cloud.batch.v1alpha.Environment - * @instance - */ - Environment.prototype.secretVariables = $util.emptyObject; - - /** - * Environment encryptedVariables. - * @member {google.cloud.batch.v1alpha.Environment.IKMSEnvMap|null|undefined} encryptedVariables - * @memberof google.cloud.batch.v1alpha.Environment - * @instance - */ - Environment.prototype.encryptedVariables = null; - - /** - * Creates a new Environment instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.Environment - * @static - * @param {google.cloud.batch.v1alpha.IEnvironment=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.Environment} Environment instance - */ - Environment.create = function create(properties) { - return new Environment(properties); - }; - - /** - * Encodes the specified Environment message. Does not implicitly {@link google.cloud.batch.v1alpha.Environment.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.Environment - * @static - * @param {google.cloud.batch.v1alpha.IEnvironment} message Environment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Environment.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.variables != null && Object.hasOwnProperty.call(message, "variables")) - for (var keys = Object.keys(message.variables), i = 0; i < keys.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.variables[keys[i]]).ldelim(); - if (message.secretVariables != null && Object.hasOwnProperty.call(message, "secretVariables")) - for (var keys = Object.keys(message.secretVariables), 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.secretVariables[keys[i]]).ldelim(); - if (message.encryptedVariables != null && Object.hasOwnProperty.call(message, "encryptedVariables")) - $root.google.cloud.batch.v1alpha.Environment.KMSEnvMap.encode(message.encryptedVariables, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Environment.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.Environment - * @static - * @param {google.cloud.batch.v1alpha.IEnvironment} message Environment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Environment.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Environment message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.Environment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.Environment} Environment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Environment.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Environment(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (message.variables === $util.emptyObject) - message.variables = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.variables[key] = value; - break; - } - case 2: { - if (message.secretVariables === $util.emptyObject) - message.secretVariables = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.secretVariables[key] = value; - break; - } - case 3: { - message.encryptedVariables = $root.google.cloud.batch.v1alpha.Environment.KMSEnvMap.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Environment message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.Environment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.Environment} Environment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Environment.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Environment message. - * @function verify - * @memberof google.cloud.batch.v1alpha.Environment - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Environment.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.variables != null && message.hasOwnProperty("variables")) { - if (!$util.isObject(message.variables)) - return "variables: object expected"; - var key = Object.keys(message.variables); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.variables[key[i]])) - return "variables: string{k:string} expected"; - } - if (message.secretVariables != null && message.hasOwnProperty("secretVariables")) { - if (!$util.isObject(message.secretVariables)) - return "secretVariables: object expected"; - var key = Object.keys(message.secretVariables); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.secretVariables[key[i]])) - return "secretVariables: string{k:string} expected"; - } - if (message.encryptedVariables != null && message.hasOwnProperty("encryptedVariables")) { - var error = $root.google.cloud.batch.v1alpha.Environment.KMSEnvMap.verify(message.encryptedVariables); - if (error) - return "encryptedVariables." + error; - } - return null; - }; - - /** - * Creates an Environment message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.Environment - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.Environment} Environment - */ - Environment.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.Environment) - return object; - var message = new $root.google.cloud.batch.v1alpha.Environment(); - if (object.variables) { - if (typeof object.variables !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Environment.variables: object expected"); - message.variables = {}; - for (var keys = Object.keys(object.variables), i = 0; i < keys.length; ++i) - message.variables[keys[i]] = String(object.variables[keys[i]]); - } - if (object.secretVariables) { - if (typeof object.secretVariables !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Environment.secretVariables: object expected"); - message.secretVariables = {}; - for (var keys = Object.keys(object.secretVariables), i = 0; i < keys.length; ++i) - message.secretVariables[keys[i]] = String(object.secretVariables[keys[i]]); - } - if (object.encryptedVariables != null) { - if (typeof object.encryptedVariables !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Environment.encryptedVariables: object expected"); - message.encryptedVariables = $root.google.cloud.batch.v1alpha.Environment.KMSEnvMap.fromObject(object.encryptedVariables); - } - return message; - }; - - /** - * Creates a plain object from an Environment message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.Environment - * @static - * @param {google.cloud.batch.v1alpha.Environment} message Environment - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Environment.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) { - object.variables = {}; - object.secretVariables = {}; - } - if (options.defaults) - object.encryptedVariables = null; - var keys2; - if (message.variables && (keys2 = Object.keys(message.variables)).length) { - object.variables = {}; - for (var j = 0; j < keys2.length; ++j) - object.variables[keys2[j]] = message.variables[keys2[j]]; - } - if (message.secretVariables && (keys2 = Object.keys(message.secretVariables)).length) { - object.secretVariables = {}; - for (var j = 0; j < keys2.length; ++j) - object.secretVariables[keys2[j]] = message.secretVariables[keys2[j]]; - } - if (message.encryptedVariables != null && message.hasOwnProperty("encryptedVariables")) - object.encryptedVariables = $root.google.cloud.batch.v1alpha.Environment.KMSEnvMap.toObject(message.encryptedVariables, options); - return object; - }; - - /** - * Converts this Environment to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.Environment - * @instance - * @returns {Object.} JSON object - */ - Environment.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Environment - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.Environment - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Environment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.Environment"; - }; - - Environment.KMSEnvMap = (function() { - - /** - * Properties of a KMSEnvMap. - * @memberof google.cloud.batch.v1alpha.Environment - * @interface IKMSEnvMap - * @property {string|null} [keyName] KMSEnvMap keyName - * @property {string|null} [cipherText] KMSEnvMap cipherText - */ - - /** - * Constructs a new KMSEnvMap. - * @memberof google.cloud.batch.v1alpha.Environment - * @classdesc Represents a KMSEnvMap. - * @implements IKMSEnvMap - * @constructor - * @param {google.cloud.batch.v1alpha.Environment.IKMSEnvMap=} [properties] Properties to set - */ - function KMSEnvMap(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * KMSEnvMap keyName. - * @member {string} keyName - * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap - * @instance - */ - KMSEnvMap.prototype.keyName = ""; - - /** - * KMSEnvMap cipherText. - * @member {string} cipherText - * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap - * @instance - */ - KMSEnvMap.prototype.cipherText = ""; - - /** - * Creates a new KMSEnvMap instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap - * @static - * @param {google.cloud.batch.v1alpha.Environment.IKMSEnvMap=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.Environment.KMSEnvMap} KMSEnvMap instance - */ - KMSEnvMap.create = function create(properties) { - return new KMSEnvMap(properties); - }; - - /** - * Encodes the specified KMSEnvMap message. Does not implicitly {@link google.cloud.batch.v1alpha.Environment.KMSEnvMap.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap - * @static - * @param {google.cloud.batch.v1alpha.Environment.IKMSEnvMap} message KMSEnvMap message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KMSEnvMap.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.keyName != null && Object.hasOwnProperty.call(message, "keyName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.keyName); - if (message.cipherText != null && Object.hasOwnProperty.call(message, "cipherText")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.cipherText); - return writer; - }; - - /** - * Encodes the specified KMSEnvMap message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Environment.KMSEnvMap.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap - * @static - * @param {google.cloud.batch.v1alpha.Environment.IKMSEnvMap} message KMSEnvMap message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KMSEnvMap.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a KMSEnvMap message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.Environment.KMSEnvMap} KMSEnvMap - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KMSEnvMap.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Environment.KMSEnvMap(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.keyName = reader.string(); - break; - } - case 2: { - message.cipherText = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a KMSEnvMap message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.Environment.KMSEnvMap} KMSEnvMap - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KMSEnvMap.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a KMSEnvMap message. - * @function verify - * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KMSEnvMap.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.keyName != null && message.hasOwnProperty("keyName")) - if (!$util.isString(message.keyName)) - return "keyName: string expected"; - if (message.cipherText != null && message.hasOwnProperty("cipherText")) - if (!$util.isString(message.cipherText)) - return "cipherText: string expected"; - return null; - }; - - /** - * Creates a KMSEnvMap message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.Environment.KMSEnvMap} KMSEnvMap - */ - KMSEnvMap.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.Environment.KMSEnvMap) - return object; - var message = new $root.google.cloud.batch.v1alpha.Environment.KMSEnvMap(); - if (object.keyName != null) - message.keyName = String(object.keyName); - if (object.cipherText != null) - message.cipherText = String(object.cipherText); - return message; - }; - - /** - * Creates a plain object from a KMSEnvMap message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap - * @static - * @param {google.cloud.batch.v1alpha.Environment.KMSEnvMap} message KMSEnvMap - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KMSEnvMap.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.keyName = ""; - object.cipherText = ""; - } - if (message.keyName != null && message.hasOwnProperty("keyName")) - object.keyName = message.keyName; - if (message.cipherText != null && message.hasOwnProperty("cipherText")) - object.cipherText = message.cipherText; - return object; - }; - - /** - * Converts this KMSEnvMap to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap - * @instance - * @returns {Object.} JSON object - */ - KMSEnvMap.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for KMSEnvMap - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.Environment.KMSEnvMap - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - KMSEnvMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.Environment.KMSEnvMap"; - }; - - return KMSEnvMap; - })(); - - return Environment; - })(); - - v1alpha.Volume = (function() { - - /** - * Properties of a Volume. - * @memberof google.cloud.batch.v1alpha - * @interface IVolume - * @property {google.cloud.batch.v1alpha.INFS|null} [nfs] Volume nfs - * @property {google.cloud.batch.v1alpha.IPD|null} [pd] Volume pd - * @property {google.cloud.batch.v1alpha.IGCS|null} [gcs] Volume gcs - * @property {string|null} [deviceName] Volume deviceName - * @property {string|null} [mountPath] Volume mountPath - * @property {Array.|null} [mountOptions] Volume mountOptions - */ - - /** - * Constructs a new Volume. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a Volume. - * @implements IVolume - * @constructor - * @param {google.cloud.batch.v1alpha.IVolume=} [properties] Properties to set - */ - function Volume(properties) { - this.mountOptions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Volume nfs. - * @member {google.cloud.batch.v1alpha.INFS|null|undefined} nfs - * @memberof google.cloud.batch.v1alpha.Volume - * @instance - */ - Volume.prototype.nfs = null; - - /** - * Volume pd. - * @member {google.cloud.batch.v1alpha.IPD|null|undefined} pd - * @memberof google.cloud.batch.v1alpha.Volume - * @instance - */ - Volume.prototype.pd = null; - - /** - * Volume gcs. - * @member {google.cloud.batch.v1alpha.IGCS|null|undefined} gcs - * @memberof google.cloud.batch.v1alpha.Volume - * @instance - */ - Volume.prototype.gcs = null; - - /** - * Volume deviceName. - * @member {string|null|undefined} deviceName - * @memberof google.cloud.batch.v1alpha.Volume - * @instance - */ - Volume.prototype.deviceName = null; - - /** - * Volume mountPath. - * @member {string} mountPath - * @memberof google.cloud.batch.v1alpha.Volume - * @instance - */ - Volume.prototype.mountPath = ""; - - /** - * Volume mountOptions. - * @member {Array.} mountOptions - * @memberof google.cloud.batch.v1alpha.Volume - * @instance - */ - Volume.prototype.mountOptions = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Volume source. - * @member {"nfs"|"pd"|"gcs"|"deviceName"|undefined} source - * @memberof google.cloud.batch.v1alpha.Volume - * @instance - */ - Object.defineProperty(Volume.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["nfs", "pd", "gcs", "deviceName"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Volume instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.Volume - * @static - * @param {google.cloud.batch.v1alpha.IVolume=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.Volume} Volume instance - */ - Volume.create = function create(properties) { - return new Volume(properties); - }; - - /** - * Encodes the specified Volume message. Does not implicitly {@link google.cloud.batch.v1alpha.Volume.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.Volume - * @static - * @param {google.cloud.batch.v1alpha.IVolume} message Volume message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Volume.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nfs != null && Object.hasOwnProperty.call(message, "nfs")) - $root.google.cloud.batch.v1alpha.NFS.encode(message.nfs, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pd != null && Object.hasOwnProperty.call(message, "pd")) - $root.google.cloud.batch.v1alpha.PD.encode(message.pd, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.gcs != null && Object.hasOwnProperty.call(message, "gcs")) - $root.google.cloud.batch.v1alpha.GCS.encode(message.gcs, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.mountPath != null && Object.hasOwnProperty.call(message, "mountPath")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.mountPath); - if (message.mountOptions != null && message.mountOptions.length) - for (var i = 0; i < message.mountOptions.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.mountOptions[i]); - if (message.deviceName != null && Object.hasOwnProperty.call(message, "deviceName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.deviceName); - return writer; - }; - - /** - * Encodes the specified Volume message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Volume.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.Volume - * @static - * @param {google.cloud.batch.v1alpha.IVolume} message Volume message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Volume.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Volume message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.Volume - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.Volume} Volume - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Volume.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Volume(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.nfs = $root.google.cloud.batch.v1alpha.NFS.decode(reader, reader.uint32()); - break; - } - case 2: { - message.pd = $root.google.cloud.batch.v1alpha.PD.decode(reader, reader.uint32()); - break; - } - case 3: { - message.gcs = $root.google.cloud.batch.v1alpha.GCS.decode(reader, reader.uint32()); - break; - } - case 6: { - message.deviceName = reader.string(); - break; - } - case 4: { - message.mountPath = reader.string(); - break; - } - case 5: { - if (!(message.mountOptions && message.mountOptions.length)) - message.mountOptions = []; - message.mountOptions.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Volume message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.Volume - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.Volume} Volume - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Volume.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Volume message. - * @function verify - * @memberof google.cloud.batch.v1alpha.Volume - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Volume.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.nfs != null && message.hasOwnProperty("nfs")) { - properties.source = 1; - { - var error = $root.google.cloud.batch.v1alpha.NFS.verify(message.nfs); - if (error) - return "nfs." + error; - } - } - if (message.pd != null && message.hasOwnProperty("pd")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.batch.v1alpha.PD.verify(message.pd); - if (error) - return "pd." + error; - } - } - if (message.gcs != null && message.hasOwnProperty("gcs")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.batch.v1alpha.GCS.verify(message.gcs); - if (error) - return "gcs." + error; - } - } - if (message.deviceName != null && message.hasOwnProperty("deviceName")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - if (!$util.isString(message.deviceName)) - return "deviceName: string expected"; - } - if (message.mountPath != null && message.hasOwnProperty("mountPath")) - if (!$util.isString(message.mountPath)) - return "mountPath: string expected"; - if (message.mountOptions != null && message.hasOwnProperty("mountOptions")) { - if (!Array.isArray(message.mountOptions)) - return "mountOptions: array expected"; - for (var i = 0; i < message.mountOptions.length; ++i) - if (!$util.isString(message.mountOptions[i])) - return "mountOptions: string[] expected"; - } - return null; - }; - - /** - * Creates a Volume message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.Volume - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.Volume} Volume - */ - Volume.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.Volume) - return object; - var message = new $root.google.cloud.batch.v1alpha.Volume(); - if (object.nfs != null) { - if (typeof object.nfs !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Volume.nfs: object expected"); - message.nfs = $root.google.cloud.batch.v1alpha.NFS.fromObject(object.nfs); - } - if (object.pd != null) { - if (typeof object.pd !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Volume.pd: object expected"); - message.pd = $root.google.cloud.batch.v1alpha.PD.fromObject(object.pd); - } - if (object.gcs != null) { - if (typeof object.gcs !== "object") - throw TypeError(".google.cloud.batch.v1alpha.Volume.gcs: object expected"); - message.gcs = $root.google.cloud.batch.v1alpha.GCS.fromObject(object.gcs); - } - if (object.deviceName != null) - message.deviceName = String(object.deviceName); - if (object.mountPath != null) - message.mountPath = String(object.mountPath); - if (object.mountOptions) { - if (!Array.isArray(object.mountOptions)) - throw TypeError(".google.cloud.batch.v1alpha.Volume.mountOptions: array expected"); - message.mountOptions = []; - for (var i = 0; i < object.mountOptions.length; ++i) - message.mountOptions[i] = String(object.mountOptions[i]); - } - return message; - }; - - /** - * Creates a plain object from a Volume message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.Volume - * @static - * @param {google.cloud.batch.v1alpha.Volume} message Volume - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Volume.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.mountOptions = []; - if (options.defaults) - object.mountPath = ""; - if (message.nfs != null && message.hasOwnProperty("nfs")) { - object.nfs = $root.google.cloud.batch.v1alpha.NFS.toObject(message.nfs, options); - if (options.oneofs) - object.source = "nfs"; - } - if (message.pd != null && message.hasOwnProperty("pd")) { - object.pd = $root.google.cloud.batch.v1alpha.PD.toObject(message.pd, options); - if (options.oneofs) - object.source = "pd"; - } - if (message.gcs != null && message.hasOwnProperty("gcs")) { - object.gcs = $root.google.cloud.batch.v1alpha.GCS.toObject(message.gcs, options); - if (options.oneofs) - object.source = "gcs"; - } - if (message.mountPath != null && message.hasOwnProperty("mountPath")) - object.mountPath = message.mountPath; - if (message.mountOptions && message.mountOptions.length) { - object.mountOptions = []; - for (var j = 0; j < message.mountOptions.length; ++j) - object.mountOptions[j] = message.mountOptions[j]; - } - if (message.deviceName != null && message.hasOwnProperty("deviceName")) { - object.deviceName = message.deviceName; - if (options.oneofs) - object.source = "deviceName"; - } - return object; - }; - - /** - * Converts this Volume to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.Volume - * @instance - * @returns {Object.} JSON object - */ - Volume.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Volume - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.Volume - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Volume.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.Volume"; - }; - - return Volume; - })(); - - v1alpha.NFS = (function() { - - /** - * Properties of a NFS. - * @memberof google.cloud.batch.v1alpha - * @interface INFS - * @property {string|null} [server] NFS server - * @property {string|null} [remotePath] NFS remotePath - */ - - /** - * Constructs a new NFS. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a NFS. - * @implements INFS - * @constructor - * @param {google.cloud.batch.v1alpha.INFS=} [properties] Properties to set - */ - function NFS(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NFS server. - * @member {string} server - * @memberof google.cloud.batch.v1alpha.NFS - * @instance - */ - NFS.prototype.server = ""; - - /** - * NFS remotePath. - * @member {string} remotePath - * @memberof google.cloud.batch.v1alpha.NFS - * @instance - */ - NFS.prototype.remotePath = ""; - - /** - * Creates a new NFS instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.NFS - * @static - * @param {google.cloud.batch.v1alpha.INFS=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.NFS} NFS instance - */ - NFS.create = function create(properties) { - return new NFS(properties); - }; - - /** - * Encodes the specified NFS message. Does not implicitly {@link google.cloud.batch.v1alpha.NFS.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.NFS - * @static - * @param {google.cloud.batch.v1alpha.INFS} message NFS message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NFS.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.server != null && Object.hasOwnProperty.call(message, "server")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.server); - if (message.remotePath != null && Object.hasOwnProperty.call(message, "remotePath")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.remotePath); - return writer; - }; - - /** - * Encodes the specified NFS message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.NFS.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.NFS - * @static - * @param {google.cloud.batch.v1alpha.INFS} message NFS message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NFS.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NFS message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.NFS - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.NFS} NFS - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NFS.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.NFS(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.server = reader.string(); - break; - } - case 2: { - message.remotePath = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NFS message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.NFS - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.NFS} NFS - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NFS.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NFS message. - * @function verify - * @memberof google.cloud.batch.v1alpha.NFS - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NFS.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.server != null && message.hasOwnProperty("server")) - if (!$util.isString(message.server)) - return "server: string expected"; - if (message.remotePath != null && message.hasOwnProperty("remotePath")) - if (!$util.isString(message.remotePath)) - return "remotePath: string expected"; - return null; - }; - - /** - * Creates a NFS message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.NFS - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.NFS} NFS - */ - NFS.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.NFS) - return object; - var message = new $root.google.cloud.batch.v1alpha.NFS(); - if (object.server != null) - message.server = String(object.server); - if (object.remotePath != null) - message.remotePath = String(object.remotePath); - return message; - }; - - /** - * Creates a plain object from a NFS message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.NFS - * @static - * @param {google.cloud.batch.v1alpha.NFS} message NFS - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NFS.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.server = ""; - object.remotePath = ""; - } - if (message.server != null && message.hasOwnProperty("server")) - object.server = message.server; - if (message.remotePath != null && message.hasOwnProperty("remotePath")) - object.remotePath = message.remotePath; - return object; - }; - - /** - * Converts this NFS to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.NFS - * @instance - * @returns {Object.} JSON object - */ - NFS.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NFS - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.NFS - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NFS.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.NFS"; - }; - - return NFS; - })(); - - v1alpha.PD = (function() { - - /** - * Properties of a PD. - * @memberof google.cloud.batch.v1alpha - * @interface IPD - * @property {string|null} [disk] PD disk - * @property {string|null} [device] PD device - * @property {boolean|null} [existing] PD existing - */ - - /** - * Constructs a new PD. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a PD. - * @implements IPD - * @constructor - * @param {google.cloud.batch.v1alpha.IPD=} [properties] Properties to set - */ - function PD(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PD disk. - * @member {string} disk - * @memberof google.cloud.batch.v1alpha.PD - * @instance - */ - PD.prototype.disk = ""; - - /** - * PD device. - * @member {string} device - * @memberof google.cloud.batch.v1alpha.PD - * @instance - */ - PD.prototype.device = ""; - - /** - * PD existing. - * @member {boolean} existing - * @memberof google.cloud.batch.v1alpha.PD - * @instance - */ - PD.prototype.existing = false; - - /** - * Creates a new PD instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.PD - * @static - * @param {google.cloud.batch.v1alpha.IPD=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.PD} PD instance - */ - PD.create = function create(properties) { - return new PD(properties); - }; - - /** - * Encodes the specified PD message. Does not implicitly {@link google.cloud.batch.v1alpha.PD.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.PD - * @static - * @param {google.cloud.batch.v1alpha.IPD} message PD message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PD.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.disk != null && Object.hasOwnProperty.call(message, "disk")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.disk); - if (message.device != null && Object.hasOwnProperty.call(message, "device")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.device); - if (message.existing != null && Object.hasOwnProperty.call(message, "existing")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.existing); - return writer; - }; - - /** - * Encodes the specified PD message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.PD.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.PD - * @static - * @param {google.cloud.batch.v1alpha.IPD} message PD message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PD.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PD message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.PD - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.PD} PD - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PD.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.PD(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.disk = reader.string(); - break; - } - case 2: { - message.device = reader.string(); - break; - } - case 3: { - message.existing = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PD message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.PD - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.PD} PD - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PD.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PD message. - * @function verify - * @memberof google.cloud.batch.v1alpha.PD - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PD.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.disk != null && message.hasOwnProperty("disk")) - if (!$util.isString(message.disk)) - return "disk: string expected"; - if (message.device != null && message.hasOwnProperty("device")) - if (!$util.isString(message.device)) - return "device: string expected"; - if (message.existing != null && message.hasOwnProperty("existing")) - if (typeof message.existing !== "boolean") - return "existing: boolean expected"; - return null; - }; - - /** - * Creates a PD message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.PD - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.PD} PD - */ - PD.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.PD) - return object; - var message = new $root.google.cloud.batch.v1alpha.PD(); - if (object.disk != null) - message.disk = String(object.disk); - if (object.device != null) - message.device = String(object.device); - if (object.existing != null) - message.existing = Boolean(object.existing); - return message; - }; - - /** - * Creates a plain object from a PD message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.PD - * @static - * @param {google.cloud.batch.v1alpha.PD} message PD - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PD.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.disk = ""; - object.device = ""; - object.existing = false; - } - if (message.disk != null && message.hasOwnProperty("disk")) - object.disk = message.disk; - if (message.device != null && message.hasOwnProperty("device")) - object.device = message.device; - if (message.existing != null && message.hasOwnProperty("existing")) - object.existing = message.existing; - return object; - }; - - /** - * Converts this PD to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.PD - * @instance - * @returns {Object.} JSON object - */ - PD.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PD - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.PD - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PD.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.PD"; - }; - - return PD; - })(); - - v1alpha.GCS = (function() { - - /** - * Properties of a GCS. - * @memberof google.cloud.batch.v1alpha - * @interface IGCS - * @property {string|null} [remotePath] GCS remotePath - */ - - /** - * Constructs a new GCS. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a GCS. - * @implements IGCS - * @constructor - * @param {google.cloud.batch.v1alpha.IGCS=} [properties] Properties to set - */ - function GCS(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GCS remotePath. - * @member {string} remotePath - * @memberof google.cloud.batch.v1alpha.GCS - * @instance - */ - GCS.prototype.remotePath = ""; - - /** - * Creates a new GCS instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.GCS - * @static - * @param {google.cloud.batch.v1alpha.IGCS=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.GCS} GCS instance - */ - GCS.create = function create(properties) { - return new GCS(properties); - }; - - /** - * Encodes the specified GCS message. Does not implicitly {@link google.cloud.batch.v1alpha.GCS.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.GCS - * @static - * @param {google.cloud.batch.v1alpha.IGCS} message GCS message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GCS.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.remotePath != null && Object.hasOwnProperty.call(message, "remotePath")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.remotePath); - return writer; - }; - - /** - * Encodes the specified GCS message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.GCS.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.GCS - * @static - * @param {google.cloud.batch.v1alpha.IGCS} message GCS message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GCS.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GCS message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.GCS - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.GCS} GCS - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GCS.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.GCS(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.remotePath = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GCS message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.GCS - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.GCS} GCS - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GCS.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GCS message. - * @function verify - * @memberof google.cloud.batch.v1alpha.GCS - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GCS.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.remotePath != null && message.hasOwnProperty("remotePath")) - if (!$util.isString(message.remotePath)) - return "remotePath: string expected"; - return null; - }; - - /** - * Creates a GCS message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.GCS - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.GCS} GCS - */ - GCS.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.GCS) - return object; - var message = new $root.google.cloud.batch.v1alpha.GCS(); - if (object.remotePath != null) - message.remotePath = String(object.remotePath); - return message; - }; - - /** - * Creates a plain object from a GCS message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.GCS - * @static - * @param {google.cloud.batch.v1alpha.GCS} message GCS - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GCS.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.remotePath = ""; - if (message.remotePath != null && message.hasOwnProperty("remotePath")) - object.remotePath = message.remotePath; - return object; - }; - - /** - * Converts this GCS to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.GCS - * @instance - * @returns {Object.} JSON object - */ - GCS.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GCS - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.GCS - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GCS.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.GCS"; - }; - - return GCS; - })(); - - /** - * CalendarPeriod enum. - * @name google.cloud.batch.v1alpha.CalendarPeriod - * @enum {number} - * @property {number} CALENDAR_PERIOD_UNSPECIFIED=0 CALENDAR_PERIOD_UNSPECIFIED value - * @property {number} MONTH=1 MONTH value - * @property {number} QUARTER=2 QUARTER value - * @property {number} YEAR=3 YEAR value - * @property {number} WEEK=4 WEEK value - * @property {number} DAY=5 DAY value - */ - v1alpha.CalendarPeriod = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CALENDAR_PERIOD_UNSPECIFIED"] = 0; - values[valuesById[1] = "MONTH"] = 1; - values[valuesById[2] = "QUARTER"] = 2; - values[valuesById[3] = "YEAR"] = 3; - values[valuesById[4] = "WEEK"] = 4; - values[valuesById[5] = "DAY"] = 5; - return values; - })(); - - /** - * ResourceAllowanceState enum. - * @name google.cloud.batch.v1alpha.ResourceAllowanceState - * @enum {number} - * @property {number} RESOURCE_ALLOWANCE_STATE_UNSPECIFIED=0 RESOURCE_ALLOWANCE_STATE_UNSPECIFIED value - * @property {number} RESOURCE_ALLOWANCE_ACTIVE=1 RESOURCE_ALLOWANCE_ACTIVE value - * @property {number} RESOURCE_ALLOWANCE_DEPLETED=2 RESOURCE_ALLOWANCE_DEPLETED value - */ - v1alpha.ResourceAllowanceState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RESOURCE_ALLOWANCE_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RESOURCE_ALLOWANCE_ACTIVE"] = 1; - values[valuesById[2] = "RESOURCE_ALLOWANCE_DEPLETED"] = 2; - return values; - })(); - - v1alpha.ResourceAllowance = (function() { - - /** - * Properties of a ResourceAllowance. - * @memberof google.cloud.batch.v1alpha - * @interface IResourceAllowance - * @property {google.cloud.batch.v1alpha.IUsageResourceAllowance|null} [usageResourceAllowance] ResourceAllowance usageResourceAllowance - * @property {string|null} [name] ResourceAllowance name - * @property {string|null} [uid] ResourceAllowance uid - * @property {google.protobuf.ITimestamp|null} [createTime] ResourceAllowance createTime - * @property {Object.|null} [labels] ResourceAllowance labels - * @property {Array.|null} [notifications] ResourceAllowance notifications - */ - - /** - * Constructs a new ResourceAllowance. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a ResourceAllowance. - * @implements IResourceAllowance - * @constructor - * @param {google.cloud.batch.v1alpha.IResourceAllowance=} [properties] Properties to set - */ - function ResourceAllowance(properties) { - this.labels = {}; - this.notifications = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceAllowance usageResourceAllowance. - * @member {google.cloud.batch.v1alpha.IUsageResourceAllowance|null|undefined} usageResourceAllowance - * @memberof google.cloud.batch.v1alpha.ResourceAllowance - * @instance - */ - ResourceAllowance.prototype.usageResourceAllowance = null; - - /** - * ResourceAllowance name. - * @member {string} name - * @memberof google.cloud.batch.v1alpha.ResourceAllowance - * @instance - */ - ResourceAllowance.prototype.name = ""; - - /** - * ResourceAllowance uid. - * @member {string} uid - * @memberof google.cloud.batch.v1alpha.ResourceAllowance - * @instance - */ - ResourceAllowance.prototype.uid = ""; - - /** - * ResourceAllowance createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.batch.v1alpha.ResourceAllowance - * @instance - */ - ResourceAllowance.prototype.createTime = null; - - /** - * ResourceAllowance labels. - * @member {Object.} labels - * @memberof google.cloud.batch.v1alpha.ResourceAllowance - * @instance - */ - ResourceAllowance.prototype.labels = $util.emptyObject; - - /** - * ResourceAllowance notifications. - * @member {Array.} notifications - * @memberof google.cloud.batch.v1alpha.ResourceAllowance - * @instance - */ - ResourceAllowance.prototype.notifications = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ResourceAllowance resourceAllowance. - * @member {"usageResourceAllowance"|undefined} resourceAllowance - * @memberof google.cloud.batch.v1alpha.ResourceAllowance - * @instance - */ - Object.defineProperty(ResourceAllowance.prototype, "resourceAllowance", { - get: $util.oneOfGetter($oneOfFields = ["usageResourceAllowance"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ResourceAllowance instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.ResourceAllowance - * @static - * @param {google.cloud.batch.v1alpha.IResourceAllowance=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.ResourceAllowance} ResourceAllowance instance - */ - ResourceAllowance.create = function create(properties) { - return new ResourceAllowance(properties); - }; - - /** - * Encodes the specified ResourceAllowance message. Does not implicitly {@link google.cloud.batch.v1alpha.ResourceAllowance.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.ResourceAllowance - * @static - * @param {google.cloud.batch.v1alpha.IResourceAllowance} message ResourceAllowance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceAllowance.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.usageResourceAllowance != null && Object.hasOwnProperty.call(message, "usageResourceAllowance")) - $root.google.cloud.batch.v1alpha.UsageResourceAllowance.encode(message.usageResourceAllowance, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.notifications != null && message.notifications.length) - for (var i = 0; i < message.notifications.length; ++i) - $root.google.cloud.batch.v1alpha.Notification.encode(message.notifications[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ResourceAllowance message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.ResourceAllowance.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.ResourceAllowance - * @static - * @param {google.cloud.batch.v1alpha.IResourceAllowance} message ResourceAllowance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceAllowance.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceAllowance message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.ResourceAllowance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.ResourceAllowance} ResourceAllowance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceAllowance.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.ResourceAllowance(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 4: { - message.usageResourceAllowance = $root.google.cloud.batch.v1alpha.UsageResourceAllowance.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.uid = reader.string(); - break; - } - case 3: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 6: { - if (!(message.notifications && message.notifications.length)) - message.notifications = []; - message.notifications.push($root.google.cloud.batch.v1alpha.Notification.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceAllowance message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.ResourceAllowance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.ResourceAllowance} ResourceAllowance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceAllowance.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceAllowance message. - * @function verify - * @memberof google.cloud.batch.v1alpha.ResourceAllowance - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceAllowance.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.usageResourceAllowance != null && message.hasOwnProperty("usageResourceAllowance")) { - properties.resourceAllowance = 1; - { - var error = $root.google.cloud.batch.v1alpha.UsageResourceAllowance.verify(message.usageResourceAllowance); - if (error) - return "usageResourceAllowance." + error; - } - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.uid != null && message.hasOwnProperty("uid")) - if (!$util.isString(message.uid)) - return "uid: string expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.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.notifications != null && message.hasOwnProperty("notifications")) { - if (!Array.isArray(message.notifications)) - return "notifications: array expected"; - for (var i = 0; i < message.notifications.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.Notification.verify(message.notifications[i]); - if (error) - return "notifications." + error; - } - } - return null; - }; - - /** - * Creates a ResourceAllowance message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.ResourceAllowance - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.ResourceAllowance} ResourceAllowance - */ - ResourceAllowance.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.ResourceAllowance) - return object; - var message = new $root.google.cloud.batch.v1alpha.ResourceAllowance(); - if (object.usageResourceAllowance != null) { - if (typeof object.usageResourceAllowance !== "object") - throw TypeError(".google.cloud.batch.v1alpha.ResourceAllowance.usageResourceAllowance: object expected"); - message.usageResourceAllowance = $root.google.cloud.batch.v1alpha.UsageResourceAllowance.fromObject(object.usageResourceAllowance); - } - if (object.name != null) - message.name = String(object.name); - if (object.uid != null) - message.uid = String(object.uid); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.batch.v1alpha.ResourceAllowance.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.batch.v1alpha.ResourceAllowance.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - if (object.notifications) { - if (!Array.isArray(object.notifications)) - throw TypeError(".google.cloud.batch.v1alpha.ResourceAllowance.notifications: array expected"); - message.notifications = []; - for (var i = 0; i < object.notifications.length; ++i) { - if (typeof object.notifications[i] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.ResourceAllowance.notifications: object expected"); - message.notifications[i] = $root.google.cloud.batch.v1alpha.Notification.fromObject(object.notifications[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ResourceAllowance message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.ResourceAllowance - * @static - * @param {google.cloud.batch.v1alpha.ResourceAllowance} message ResourceAllowance - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceAllowance.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.notifications = []; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.uid = ""; - object.createTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.usageResourceAllowance != null && message.hasOwnProperty("usageResourceAllowance")) { - object.usageResourceAllowance = $root.google.cloud.batch.v1alpha.UsageResourceAllowance.toObject(message.usageResourceAllowance, options); - if (options.oneofs) - object.resourceAllowance = "usageResourceAllowance"; - } - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.notifications && message.notifications.length) { - object.notifications = []; - for (var j = 0; j < message.notifications.length; ++j) - object.notifications[j] = $root.google.cloud.batch.v1alpha.Notification.toObject(message.notifications[j], options); - } - return object; - }; - - /** - * Converts this ResourceAllowance to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.ResourceAllowance - * @instance - * @returns {Object.} JSON object - */ - ResourceAllowance.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceAllowance - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.ResourceAllowance - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceAllowance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.ResourceAllowance"; - }; - - return ResourceAllowance; - })(); - - v1alpha.UsageResourceAllowance = (function() { - - /** - * Properties of a UsageResourceAllowance. - * @memberof google.cloud.batch.v1alpha - * @interface IUsageResourceAllowance - * @property {google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec|null} [spec] UsageResourceAllowance spec - * @property {google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus|null} [status] UsageResourceAllowance status - */ - - /** - * Constructs a new UsageResourceAllowance. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a UsageResourceAllowance. - * @implements IUsageResourceAllowance - * @constructor - * @param {google.cloud.batch.v1alpha.IUsageResourceAllowance=} [properties] Properties to set - */ - function UsageResourceAllowance(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UsageResourceAllowance spec. - * @member {google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec|null|undefined} spec - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance - * @instance - */ - UsageResourceAllowance.prototype.spec = null; - - /** - * UsageResourceAllowance status. - * @member {google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus|null|undefined} status - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance - * @instance - */ - UsageResourceAllowance.prototype.status = null; - - /** - * Creates a new UsageResourceAllowance instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance - * @static - * @param {google.cloud.batch.v1alpha.IUsageResourceAllowance=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowance} UsageResourceAllowance instance - */ - UsageResourceAllowance.create = function create(properties) { - return new UsageResourceAllowance(properties); - }; - - /** - * Encodes the specified UsageResourceAllowance message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowance.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance - * @static - * @param {google.cloud.batch.v1alpha.IUsageResourceAllowance} message UsageResourceAllowance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UsageResourceAllowance.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.spec != null && Object.hasOwnProperty.call(message, "spec")) - $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.encode(message.spec, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UsageResourceAllowance message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowance.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance - * @static - * @param {google.cloud.batch.v1alpha.IUsageResourceAllowance} message UsageResourceAllowance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UsageResourceAllowance.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a UsageResourceAllowance message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowance} UsageResourceAllowance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UsageResourceAllowance.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowance(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.spec = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.decode(reader, reader.uint32()); - break; - } - case 2: { - message.status = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a UsageResourceAllowance message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowance} UsageResourceAllowance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UsageResourceAllowance.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a UsageResourceAllowance message. - * @function verify - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UsageResourceAllowance.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.spec != null && message.hasOwnProperty("spec")) { - var error = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.verify(message.spec); - if (error) - return "spec." + error; - } - if (message.status != null && message.hasOwnProperty("status")) { - var error = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.verify(message.status); - if (error) - return "status." + error; - } - return null; - }; - - /** - * Creates a UsageResourceAllowance message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowance} UsageResourceAllowance - */ - UsageResourceAllowance.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.UsageResourceAllowance) - return object; - var message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowance(); - if (object.spec != null) { - if (typeof object.spec !== "object") - throw TypeError(".google.cloud.batch.v1alpha.UsageResourceAllowance.spec: object expected"); - message.spec = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.fromObject(object.spec); - } - if (object.status != null) { - if (typeof object.status !== "object") - throw TypeError(".google.cloud.batch.v1alpha.UsageResourceAllowance.status: object expected"); - message.status = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.fromObject(object.status); - } - return message; - }; - - /** - * Creates a plain object from a UsageResourceAllowance message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowance} message UsageResourceAllowance - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UsageResourceAllowance.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.spec = null; - object.status = null; - } - if (message.spec != null && message.hasOwnProperty("spec")) - object.spec = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.toObject(message.spec, options); - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.toObject(message.status, options); - return object; - }; - - /** - * Converts this UsageResourceAllowance to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance - * @instance - * @returns {Object.} JSON object - */ - UsageResourceAllowance.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UsageResourceAllowance - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowance - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UsageResourceAllowance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.UsageResourceAllowance"; - }; - - return UsageResourceAllowance; - })(); - - v1alpha.UsageResourceAllowanceSpec = (function() { - - /** - * Properties of a UsageResourceAllowanceSpec. - * @memberof google.cloud.batch.v1alpha - * @interface IUsageResourceAllowanceSpec - * @property {string|null} [type] UsageResourceAllowanceSpec type - * @property {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit|null} [limit] UsageResourceAllowanceSpec limit - */ - - /** - * Constructs a new UsageResourceAllowanceSpec. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a UsageResourceAllowanceSpec. - * @implements IUsageResourceAllowanceSpec - * @constructor - * @param {google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec=} [properties] Properties to set - */ - function UsageResourceAllowanceSpec(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UsageResourceAllowanceSpec type. - * @member {string} type - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec - * @instance - */ - UsageResourceAllowanceSpec.prototype.type = ""; - - /** - * UsageResourceAllowanceSpec limit. - * @member {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit|null|undefined} limit - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec - * @instance - */ - UsageResourceAllowanceSpec.prototype.limit = null; - - /** - * Creates a new UsageResourceAllowanceSpec instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec - * @static - * @param {google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec} UsageResourceAllowanceSpec instance - */ - UsageResourceAllowanceSpec.create = function create(properties) { - return new UsageResourceAllowanceSpec(properties); - }; - - /** - * Encodes the specified UsageResourceAllowanceSpec message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec - * @static - * @param {google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec} message UsageResourceAllowanceSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UsageResourceAllowanceSpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit.encode(message.limit, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UsageResourceAllowanceSpec message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec - * @static - * @param {google.cloud.batch.v1alpha.IUsageResourceAllowanceSpec} message UsageResourceAllowanceSpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UsageResourceAllowanceSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a UsageResourceAllowanceSpec message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec} UsageResourceAllowanceSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UsageResourceAllowanceSpec.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - message.limit = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a UsageResourceAllowanceSpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec} UsageResourceAllowanceSpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UsageResourceAllowanceSpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a UsageResourceAllowanceSpec message. - * @function verify - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UsageResourceAllowanceSpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.limit != null && message.hasOwnProperty("limit")) { - var error = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit.verify(message.limit); - if (error) - return "limit." + error; - } - return null; - }; - - /** - * Creates a UsageResourceAllowanceSpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec} UsageResourceAllowanceSpec - */ - UsageResourceAllowanceSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec) - return object; - var message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec(); - if (object.type != null) - message.type = String(object.type); - if (object.limit != null) { - if (typeof object.limit !== "object") - throw TypeError(".google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.limit: object expected"); - message.limit = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit.fromObject(object.limit); - } - return message; - }; - - /** - * Creates a plain object from a UsageResourceAllowanceSpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec} message UsageResourceAllowanceSpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UsageResourceAllowanceSpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = ""; - object.limit = null; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.limit != null && message.hasOwnProperty("limit")) - object.limit = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit.toObject(message.limit, options); - return object; - }; - - /** - * Converts this UsageResourceAllowanceSpec to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec - * @instance - * @returns {Object.} JSON object - */ - UsageResourceAllowanceSpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UsageResourceAllowanceSpec - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UsageResourceAllowanceSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.UsageResourceAllowanceSpec"; - }; - - UsageResourceAllowanceSpec.Limit = (function() { - - /** - * Properties of a Limit. - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec - * @interface ILimit - * @property {google.cloud.batch.v1alpha.CalendarPeriod|null} [calendarPeriod] Limit calendarPeriod - * @property {number|null} [limit] Limit limit - */ - - /** - * Constructs a new Limit. - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec - * @classdesc Represents a Limit. - * @implements ILimit - * @constructor - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit=} [properties] Properties to set - */ - function Limit(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Limit calendarPeriod. - * @member {google.cloud.batch.v1alpha.CalendarPeriod|null|undefined} calendarPeriod - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit - * @instance - */ - Limit.prototype.calendarPeriod = null; - - /** - * Limit limit. - * @member {number|null|undefined} limit - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit - * @instance - */ - Limit.prototype.limit = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Limit duration. - * @member {"calendarPeriod"|undefined} duration - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit - * @instance - */ - Object.defineProperty(Limit.prototype, "duration", { - get: $util.oneOfGetter($oneOfFields = ["calendarPeriod"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Limit _limit. - * @member {"limit"|undefined} _limit - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit - * @instance - */ - Object.defineProperty(Limit.prototype, "_limit", { - get: $util.oneOfGetter($oneOfFields = ["limit"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Limit instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit} Limit instance - */ - Limit.create = function create(properties) { - return new Limit(properties); - }; - - /** - * Encodes the specified Limit message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit} message Limit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Limit.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.calendarPeriod != null && Object.hasOwnProperty.call(message, "calendarPeriod")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.calendarPeriod); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.limit); - return writer; - }; - - /** - * Encodes the specified Limit message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.ILimit} message Limit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Limit.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Limit message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit} Limit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Limit.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.calendarPeriod = reader.int32(); - break; - } - case 2: { - message.limit = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Limit message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit} Limit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Limit.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Limit message. - * @function verify - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Limit.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.calendarPeriod != null && message.hasOwnProperty("calendarPeriod")) { - properties.duration = 1; - switch (message.calendarPeriod) { - default: - return "calendarPeriod: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - } - if (message.limit != null && message.hasOwnProperty("limit")) { - properties._limit = 1; - if (typeof message.limit !== "number") - return "limit: number expected"; - } - return null; - }; - - /** - * Creates a Limit message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit} Limit - */ - Limit.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit) - return object; - var message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit(); - switch (object.calendarPeriod) { - default: - if (typeof object.calendarPeriod === "number") { - message.calendarPeriod = object.calendarPeriod; - break; - } - break; - case "CALENDAR_PERIOD_UNSPECIFIED": - case 0: - message.calendarPeriod = 0; - break; - case "MONTH": - case 1: - message.calendarPeriod = 1; - break; - case "QUARTER": - case 2: - message.calendarPeriod = 2; - break; - case "YEAR": - case 3: - message.calendarPeriod = 3; - break; - case "WEEK": - case 4: - message.calendarPeriod = 4; - break; - case "DAY": - case 5: - message.calendarPeriod = 5; - break; - } - if (object.limit != null) - message.limit = Number(object.limit); - return message; - }; - - /** - * Creates a plain object from a Limit message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit} message Limit - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Limit.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.calendarPeriod != null && message.hasOwnProperty("calendarPeriod")) { - object.calendarPeriod = options.enums === String ? $root.google.cloud.batch.v1alpha.CalendarPeriod[message.calendarPeriod] === undefined ? message.calendarPeriod : $root.google.cloud.batch.v1alpha.CalendarPeriod[message.calendarPeriod] : message.calendarPeriod; - if (options.oneofs) - object.duration = "calendarPeriod"; - } - if (message.limit != null && message.hasOwnProperty("limit")) { - object.limit = options.json && !isFinite(message.limit) ? String(message.limit) : message.limit; - if (options.oneofs) - object._limit = "limit"; - } - return object; - }; - - /** - * Converts this Limit to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit - * @instance - * @returns {Object.} JSON object - */ - Limit.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Limit - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Limit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.UsageResourceAllowanceSpec.Limit"; - }; - - return Limit; - })(); - - return UsageResourceAllowanceSpec; - })(); - - v1alpha.UsageResourceAllowanceStatus = (function() { - - /** - * Properties of a UsageResourceAllowanceStatus. - * @memberof google.cloud.batch.v1alpha - * @interface IUsageResourceAllowanceStatus - * @property {google.cloud.batch.v1alpha.ResourceAllowanceState|null} [state] UsageResourceAllowanceStatus state - * @property {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus|null} [limitStatus] UsageResourceAllowanceStatus limitStatus - * @property {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport|null} [report] UsageResourceAllowanceStatus report - */ - - /** - * Constructs a new UsageResourceAllowanceStatus. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a UsageResourceAllowanceStatus. - * @implements IUsageResourceAllowanceStatus - * @constructor - * @param {google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus=} [properties] Properties to set - */ - function UsageResourceAllowanceStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UsageResourceAllowanceStatus state. - * @member {google.cloud.batch.v1alpha.ResourceAllowanceState} state - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @instance - */ - UsageResourceAllowanceStatus.prototype.state = 0; - - /** - * UsageResourceAllowanceStatus limitStatus. - * @member {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus|null|undefined} limitStatus - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @instance - */ - UsageResourceAllowanceStatus.prototype.limitStatus = null; - - /** - * UsageResourceAllowanceStatus report. - * @member {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport|null|undefined} report - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @instance - */ - UsageResourceAllowanceStatus.prototype.report = null; - - /** - * Creates a new UsageResourceAllowanceStatus instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @static - * @param {google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus} UsageResourceAllowanceStatus instance - */ - UsageResourceAllowanceStatus.create = function create(properties) { - return new UsageResourceAllowanceStatus(properties); - }; - - /** - * Encodes the specified UsageResourceAllowanceStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @static - * @param {google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus} message UsageResourceAllowanceStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UsageResourceAllowanceStatus.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); - if (message.limitStatus != null && Object.hasOwnProperty.call(message, "limitStatus")) - $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.encode(message.limitStatus, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.report != null && Object.hasOwnProperty.call(message, "report")) - $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.encode(message.report, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UsageResourceAllowanceStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @static - * @param {google.cloud.batch.v1alpha.IUsageResourceAllowanceStatus} message UsageResourceAllowanceStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UsageResourceAllowanceStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a UsageResourceAllowanceStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus} UsageResourceAllowanceStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UsageResourceAllowanceStatus.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.state = reader.int32(); - break; - } - case 2: { - message.limitStatus = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.decode(reader, reader.uint32()); - break; - } - case 3: { - message.report = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a UsageResourceAllowanceStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus} UsageResourceAllowanceStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UsageResourceAllowanceStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a UsageResourceAllowanceStatus message. - * @function verify - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UsageResourceAllowanceStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.limitStatus != null && message.hasOwnProperty("limitStatus")) { - var error = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.verify(message.limitStatus); - if (error) - return "limitStatus." + error; - } - if (message.report != null && message.hasOwnProperty("report")) { - var error = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.verify(message.report); - if (error) - return "report." + error; - } - return null; - }; - - /** - * Creates a UsageResourceAllowanceStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus} UsageResourceAllowanceStatus - */ - UsageResourceAllowanceStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus) - return object; - var message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus(); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "RESOURCE_ALLOWANCE_STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "RESOURCE_ALLOWANCE_ACTIVE": - case 1: - message.state = 1; - break; - case "RESOURCE_ALLOWANCE_DEPLETED": - case 2: - message.state = 2; - break; - } - if (object.limitStatus != null) { - if (typeof object.limitStatus !== "object") - throw TypeError(".google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.limitStatus: object expected"); - message.limitStatus = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.fromObject(object.limitStatus); - } - if (object.report != null) { - if (typeof object.report !== "object") - throw TypeError(".google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.report: object expected"); - message.report = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.fromObject(object.report); - } - return message; - }; - - /** - * Creates a plain object from a UsageResourceAllowanceStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus} message UsageResourceAllowanceStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UsageResourceAllowanceStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.state = options.enums === String ? "RESOURCE_ALLOWANCE_STATE_UNSPECIFIED" : 0; - object.limitStatus = null; - object.report = null; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.batch.v1alpha.ResourceAllowanceState[message.state] === undefined ? message.state : $root.google.cloud.batch.v1alpha.ResourceAllowanceState[message.state] : message.state; - if (message.limitStatus != null && message.hasOwnProperty("limitStatus")) - object.limitStatus = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.toObject(message.limitStatus, options); - if (message.report != null && message.hasOwnProperty("report")) - object.report = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.toObject(message.report, options); - return object; - }; - - /** - * Converts this UsageResourceAllowanceStatus to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @instance - * @returns {Object.} JSON object - */ - UsageResourceAllowanceStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UsageResourceAllowanceStatus - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UsageResourceAllowanceStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.UsageResourceAllowanceStatus"; - }; - - UsageResourceAllowanceStatus.LimitStatus = (function() { - - /** - * Properties of a LimitStatus. - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @interface ILimitStatus - * @property {google.type.IInterval|null} [consumptionInterval] LimitStatus consumptionInterval - * @property {number|null} [limit] LimitStatus limit - * @property {number|null} [consumed] LimitStatus consumed - */ - - /** - * Constructs a new LimitStatus. - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @classdesc Represents a LimitStatus. - * @implements ILimitStatus - * @constructor - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus=} [properties] Properties to set - */ - function LimitStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LimitStatus consumptionInterval. - * @member {google.type.IInterval|null|undefined} consumptionInterval - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus - * @instance - */ - LimitStatus.prototype.consumptionInterval = null; - - /** - * LimitStatus limit. - * @member {number|null|undefined} limit - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus - * @instance - */ - LimitStatus.prototype.limit = null; - - /** - * LimitStatus consumed. - * @member {number|null|undefined} consumed - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus - * @instance - */ - LimitStatus.prototype.consumed = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * LimitStatus _limit. - * @member {"limit"|undefined} _limit - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus - * @instance - */ - Object.defineProperty(LimitStatus.prototype, "_limit", { - get: $util.oneOfGetter($oneOfFields = ["limit"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * LimitStatus _consumed. - * @member {"consumed"|undefined} _consumed - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus - * @instance - */ - Object.defineProperty(LimitStatus.prototype, "_consumed", { - get: $util.oneOfGetter($oneOfFields = ["consumed"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new LimitStatus instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus} LimitStatus instance - */ - LimitStatus.create = function create(properties) { - return new LimitStatus(properties); - }; - - /** - * Encodes the specified LimitStatus message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus} message LimitStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LimitStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.consumptionInterval != null && Object.hasOwnProperty.call(message, "consumptionInterval")) - $root.google.type.Interval.encode(message.consumptionInterval, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.limit); - if (message.consumed != null && Object.hasOwnProperty.call(message, "consumed")) - writer.uint32(/* id 3, wireType 1 =*/25).double(message.consumed); - return writer; - }; - - /** - * Encodes the specified LimitStatus message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ILimitStatus} message LimitStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LimitStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LimitStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus} LimitStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LimitStatus.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.consumptionInterval = $root.google.type.Interval.decode(reader, reader.uint32()); - break; - } - case 2: { - message.limit = reader.double(); - break; - } - case 3: { - message.consumed = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LimitStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus} LimitStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LimitStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LimitStatus message. - * @function verify - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LimitStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.consumptionInterval != null && message.hasOwnProperty("consumptionInterval")) { - var error = $root.google.type.Interval.verify(message.consumptionInterval); - if (error) - return "consumptionInterval." + error; - } - if (message.limit != null && message.hasOwnProperty("limit")) { - properties._limit = 1; - if (typeof message.limit !== "number") - return "limit: number expected"; - } - if (message.consumed != null && message.hasOwnProperty("consumed")) { - properties._consumed = 1; - if (typeof message.consumed !== "number") - return "consumed: number expected"; - } - return null; - }; - - /** - * Creates a LimitStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus} LimitStatus - */ - LimitStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus) - return object; - var message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus(); - if (object.consumptionInterval != null) { - if (typeof object.consumptionInterval !== "object") - throw TypeError(".google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus.consumptionInterval: object expected"); - message.consumptionInterval = $root.google.type.Interval.fromObject(object.consumptionInterval); - } - if (object.limit != null) - message.limit = Number(object.limit); - if (object.consumed != null) - message.consumed = Number(object.consumed); - return message; - }; - - /** - * Creates a plain object from a LimitStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus} message LimitStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LimitStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.consumptionInterval = null; - if (message.consumptionInterval != null && message.hasOwnProperty("consumptionInterval")) - object.consumptionInterval = $root.google.type.Interval.toObject(message.consumptionInterval, options); - if (message.limit != null && message.hasOwnProperty("limit")) { - object.limit = options.json && !isFinite(message.limit) ? String(message.limit) : message.limit; - if (options.oneofs) - object._limit = "limit"; - } - if (message.consumed != null && message.hasOwnProperty("consumed")) { - object.consumed = options.json && !isFinite(message.consumed) ? String(message.consumed) : message.consumed; - if (options.oneofs) - object._consumed = "consumed"; - } - return object; - }; - - /** - * Converts this LimitStatus to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus - * @instance - * @returns {Object.} JSON object - */ - LimitStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LimitStatus - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LimitStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.LimitStatus"; - }; - - return LimitStatus; - })(); - - UsageResourceAllowanceStatus.PeriodConsumption = (function() { - - /** - * Properties of a PeriodConsumption. - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @interface IPeriodConsumption - * @property {google.type.IInterval|null} [consumptionInterval] PeriodConsumption consumptionInterval - * @property {number|null} [consumed] PeriodConsumption consumed - */ - - /** - * Constructs a new PeriodConsumption. - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @classdesc Represents a PeriodConsumption. - * @implements IPeriodConsumption - * @constructor - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption=} [properties] Properties to set - */ - function PeriodConsumption(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PeriodConsumption consumptionInterval. - * @member {google.type.IInterval|null|undefined} consumptionInterval - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption - * @instance - */ - PeriodConsumption.prototype.consumptionInterval = null; - - /** - * PeriodConsumption consumed. - * @member {number|null|undefined} consumed - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption - * @instance - */ - PeriodConsumption.prototype.consumed = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * PeriodConsumption _consumed. - * @member {"consumed"|undefined} _consumed - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption - * @instance - */ - Object.defineProperty(PeriodConsumption.prototype, "_consumed", { - get: $util.oneOfGetter($oneOfFields = ["consumed"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new PeriodConsumption instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption} PeriodConsumption instance - */ - PeriodConsumption.create = function create(properties) { - return new PeriodConsumption(properties); - }; - - /** - * Encodes the specified PeriodConsumption message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption} message PeriodConsumption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PeriodConsumption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.consumptionInterval != null && Object.hasOwnProperty.call(message, "consumptionInterval")) - $root.google.type.Interval.encode(message.consumptionInterval, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.consumed != null && Object.hasOwnProperty.call(message, "consumed")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.consumed); - return writer; - }; - - /** - * Encodes the specified PeriodConsumption message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IPeriodConsumption} message PeriodConsumption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PeriodConsumption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PeriodConsumption message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption} PeriodConsumption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PeriodConsumption.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.consumptionInterval = $root.google.type.Interval.decode(reader, reader.uint32()); - break; - } - case 2: { - message.consumed = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PeriodConsumption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption} PeriodConsumption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PeriodConsumption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PeriodConsumption message. - * @function verify - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PeriodConsumption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.consumptionInterval != null && message.hasOwnProperty("consumptionInterval")) { - var error = $root.google.type.Interval.verify(message.consumptionInterval); - if (error) - return "consumptionInterval." + error; - } - if (message.consumed != null && message.hasOwnProperty("consumed")) { - properties._consumed = 1; - if (typeof message.consumed !== "number") - return "consumed: number expected"; - } - return null; - }; - - /** - * Creates a PeriodConsumption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption} PeriodConsumption - */ - PeriodConsumption.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption) - return object; - var message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption(); - if (object.consumptionInterval != null) { - if (typeof object.consumptionInterval !== "object") - throw TypeError(".google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.consumptionInterval: object expected"); - message.consumptionInterval = $root.google.type.Interval.fromObject(object.consumptionInterval); - } - if (object.consumed != null) - message.consumed = Number(object.consumed); - return message; - }; - - /** - * Creates a plain object from a PeriodConsumption message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption} message PeriodConsumption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PeriodConsumption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.consumptionInterval = null; - if (message.consumptionInterval != null && message.hasOwnProperty("consumptionInterval")) - object.consumptionInterval = $root.google.type.Interval.toObject(message.consumptionInterval, options); - if (message.consumed != null && message.hasOwnProperty("consumed")) { - object.consumed = options.json && !isFinite(message.consumed) ? String(message.consumed) : message.consumed; - if (options.oneofs) - object._consumed = "consumed"; - } - return object; - }; - - /** - * Converts this PeriodConsumption to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption - * @instance - * @returns {Object.} JSON object - */ - PeriodConsumption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PeriodConsumption - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PeriodConsumption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption"; - }; - - return PeriodConsumption; - })(); - - UsageResourceAllowanceStatus.ConsumptionReport = (function() { - - /** - * Properties of a ConsumptionReport. - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @interface IConsumptionReport - * @property {Object.|null} [latestPeriodConsumptions] ConsumptionReport latestPeriodConsumptions - */ - - /** - * Constructs a new ConsumptionReport. - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus - * @classdesc Represents a ConsumptionReport. - * @implements IConsumptionReport - * @constructor - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport=} [properties] Properties to set - */ - function ConsumptionReport(properties) { - this.latestPeriodConsumptions = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConsumptionReport latestPeriodConsumptions. - * @member {Object.} latestPeriodConsumptions - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport - * @instance - */ - ConsumptionReport.prototype.latestPeriodConsumptions = $util.emptyObject; - - /** - * Creates a new ConsumptionReport instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport} ConsumptionReport instance - */ - ConsumptionReport.create = function create(properties) { - return new ConsumptionReport(properties); - }; - - /** - * Encodes the specified ConsumptionReport message. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport} message ConsumptionReport message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsumptionReport.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.latestPeriodConsumptions != null && Object.hasOwnProperty.call(message, "latestPeriodConsumptions")) - for (var keys = Object.keys(message.latestPeriodConsumptions), 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.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.encode(message.latestPeriodConsumptions[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - return writer; - }; - - /** - * Encodes the specified ConsumptionReport message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.IConsumptionReport} message ConsumptionReport message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConsumptionReport.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConsumptionReport message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport} ConsumptionReport - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsumptionReport.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (message.latestPeriodConsumptions === $util.emptyObject) - message.latestPeriodConsumptions = {}; - 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.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.latestPeriodConsumptions[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConsumptionReport message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport} ConsumptionReport - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConsumptionReport.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConsumptionReport message. - * @function verify - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConsumptionReport.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.latestPeriodConsumptions != null && message.hasOwnProperty("latestPeriodConsumptions")) { - if (!$util.isObject(message.latestPeriodConsumptions)) - return "latestPeriodConsumptions: object expected"; - var key = Object.keys(message.latestPeriodConsumptions); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.verify(message.latestPeriodConsumptions[key[i]]); - if (error) - return "latestPeriodConsumptions." + error; - } - } - return null; - }; - - /** - * Creates a ConsumptionReport message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport} ConsumptionReport - */ - ConsumptionReport.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport) - return object; - var message = new $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport(); - if (object.latestPeriodConsumptions) { - if (typeof object.latestPeriodConsumptions !== "object") - throw TypeError(".google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.latestPeriodConsumptions: object expected"); - message.latestPeriodConsumptions = {}; - for (var keys = Object.keys(object.latestPeriodConsumptions), i = 0; i < keys.length; ++i) { - if (typeof object.latestPeriodConsumptions[keys[i]] !== "object") - throw TypeError(".google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport.latestPeriodConsumptions: object expected"); - message.latestPeriodConsumptions[keys[i]] = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.fromObject(object.latestPeriodConsumptions[keys[i]]); - } - } - return message; - }; - - /** - * Creates a plain object from a ConsumptionReport message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport - * @static - * @param {google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport} message ConsumptionReport - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConsumptionReport.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.latestPeriodConsumptions = {}; - var keys2; - if (message.latestPeriodConsumptions && (keys2 = Object.keys(message.latestPeriodConsumptions)).length) { - object.latestPeriodConsumptions = {}; - for (var j = 0; j < keys2.length; ++j) - object.latestPeriodConsumptions[keys2[j]] = $root.google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.PeriodConsumption.toObject(message.latestPeriodConsumptions[keys2[j]], options); - } - return object; - }; - - /** - * Converts this ConsumptionReport to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport - * @instance - * @returns {Object.} JSON object - */ - ConsumptionReport.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ConsumptionReport - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ConsumptionReport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.UsageResourceAllowanceStatus.ConsumptionReport"; - }; - - return ConsumptionReport; - })(); - - return UsageResourceAllowanceStatus; - })(); - - v1alpha.Notification = (function() { - - /** - * Properties of a Notification. - * @memberof google.cloud.batch.v1alpha - * @interface INotification - * @property {string|null} [pubsubTopic] Notification pubsubTopic - */ - - /** - * Constructs a new Notification. - * @memberof google.cloud.batch.v1alpha - * @classdesc Represents a Notification. - * @implements INotification - * @constructor - * @param {google.cloud.batch.v1alpha.INotification=} [properties] Properties to set - */ - function Notification(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Notification pubsubTopic. - * @member {string} pubsubTopic - * @memberof google.cloud.batch.v1alpha.Notification - * @instance - */ - Notification.prototype.pubsubTopic = ""; - - /** - * Creates a new Notification instance using the specified properties. - * @function create - * @memberof google.cloud.batch.v1alpha.Notification - * @static - * @param {google.cloud.batch.v1alpha.INotification=} [properties] Properties to set - * @returns {google.cloud.batch.v1alpha.Notification} Notification instance - */ - Notification.create = function create(properties) { - return new Notification(properties); - }; - - /** - * Encodes the specified Notification message. Does not implicitly {@link google.cloud.batch.v1alpha.Notification.verify|verify} messages. - * @function encode - * @memberof google.cloud.batch.v1alpha.Notification - * @static - * @param {google.cloud.batch.v1alpha.INotification} message Notification message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Notification.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pubsubTopic != null && Object.hasOwnProperty.call(message, "pubsubTopic")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.pubsubTopic); - return writer; - }; - - /** - * Encodes the specified Notification message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.Notification.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.batch.v1alpha.Notification - * @static - * @param {google.cloud.batch.v1alpha.INotification} message Notification message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Notification.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Notification message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.batch.v1alpha.Notification - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.batch.v1alpha.Notification} Notification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Notification.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.Notification(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.pubsubTopic = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Notification message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.batch.v1alpha.Notification - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.batch.v1alpha.Notification} Notification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Notification.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Notification message. - * @function verify - * @memberof google.cloud.batch.v1alpha.Notification - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Notification.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) - if (!$util.isString(message.pubsubTopic)) - return "pubsubTopic: string expected"; - return null; - }; - - /** - * Creates a Notification message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.batch.v1alpha.Notification - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.batch.v1alpha.Notification} Notification - */ - Notification.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.batch.v1alpha.Notification) - return object; - var message = new $root.google.cloud.batch.v1alpha.Notification(); - if (object.pubsubTopic != null) - message.pubsubTopic = String(object.pubsubTopic); - return message; - }; - - /** - * Creates a plain object from a Notification message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.batch.v1alpha.Notification - * @static - * @param {google.cloud.batch.v1alpha.Notification} message Notification - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Notification.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.pubsubTopic = ""; - if (message.pubsubTopic != null && message.hasOwnProperty("pubsubTopic")) - object.pubsubTopic = message.pubsubTopic; - return object; - }; - - /** - * Converts this Notification to JSON. - * @function toJSON - * @memberof google.cloud.batch.v1alpha.Notification - * @instance - * @returns {Object.} JSON object - */ - Notification.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Notification - * @function getTypeUrl - * @memberof google.cloud.batch.v1alpha.Notification - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Notification.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.batch.v1alpha.Notification"; - }; - - return Notification; - })(); - - return v1alpha; - })(); - - return batch; - })(); - - return cloud; - })(); - - google.api = (function() { - - /** - * Namespace api. - * @memberof google - * @namespace - */ - var api = {}; - - api.Http = (function() { - - /** - * Properties of a Http. - * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion - */ - - /** - * Constructs a new Http. - * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp - * @constructor - * @param {google.api.IHttp=} [properties] Properties to set - */ - function Http(properties) { - this.rules = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http - * @instance - */ - Http.prototype.rules = $util.emptyArray; - - /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http - * @instance - */ - Http.prototype.fullyDecodeReservedExpansion = false; - - /** - * Creates a new Http instance using the specified properties. - * @function create - * @memberof google.api.Http - * @static - * @param {google.api.IHttp=} [properties] Properties to set - * @returns {google.api.Http} Http instance - */ - Http.create = function create(properties) { - return new Http(properties); - }; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encode - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rules != null && message.rules.length) - for (var i = 0; i < message.rules.length; ++i) - $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); - return writer; - }; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Http message from the specified reader or buffer. - * @function decode - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - } - case 2: { - message.fullyDecodeReservedExpansion = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Http message. - * @function verify - * @memberof google.api.Http - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Http.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.rules != null && message.hasOwnProperty("rules")) { - if (!Array.isArray(message.rules)) - return "rules: array expected"; - for (var i = 0; i < message.rules.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.rules[i]); - if (error) - return "rules." + error; - } - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - if (typeof message.fullyDecodeReservedExpansion !== "boolean") - return "fullyDecodeReservedExpansion: boolean expected"; - return null; - }; - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Http - * @static - * @param {Object.} object Plain object - * @returns {google.api.Http} Http - */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) - return object; - var message = new $root.google.api.Http(); - if (object.rules) { - if (!Array.isArray(object.rules)) - throw TypeError(".google.api.Http.rules: array expected"); - message.rules = []; - for (var i = 0; i < object.rules.length; ++i) { - if (typeof object.rules[i] !== "object") - throw TypeError(".google.api.Http.rules: object expected"); - message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); - } - } - if (object.fullyDecodeReservedExpansion != null) - message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); - return message; - }; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Http - * @static - * @param {google.api.Http} message Http - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Http.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.rules = []; - if (options.defaults) - object.fullyDecodeReservedExpansion = false; - if (message.rules && message.rules.length) { - object.rules = []; - for (var j = 0; j < message.rules.length; ++j) - object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; - return object; - }; - - /** - * Converts this Http to JSON. - * @function toJSON - * @memberof google.api.Http - * @instance - * @returns {Object.} JSON object - */ - Http.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Http - * @function getTypeUrl - * @memberof google.api.Http - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Http"; - }; - - return Http; - })(); - - api.HttpRule = (function() { - - /** - * Properties of a HttpRule. - * @memberof google.api - * @interface IHttpRule - * @property {string|null} [selector] HttpRule selector - * @property {string|null} [get] HttpRule get - * @property {string|null} [put] HttpRule put - * @property {string|null} [post] HttpRule post - * @property {string|null} ["delete"] HttpRule delete - * @property {string|null} [patch] HttpRule patch - * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom - * @property {string|null} [body] HttpRule body - * @property {string|null} [responseBody] HttpRule responseBody - * @property {Array.|null} [additionalBindings] HttpRule additionalBindings - */ - - /** - * Constructs a new HttpRule. - * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule - * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set - */ - function HttpRule(properties) { - this.additionalBindings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; - - /** - * HttpRule get. - * @member {string|null|undefined} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = null; - - /** - * HttpRule put. - * @member {string|null|undefined} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = null; - - /** - * HttpRule post. - * @member {string|null|undefined} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = null; - - /** - * HttpRule delete. - * @member {string|null|undefined} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = null; - - /** - * HttpRule patch. - * @member {string|null|undefined} patch - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.patch = null; - - /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.custom = null; - - /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.body = ""; - - /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.responseBody = ""; - - /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule - * @instance - */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new HttpRule instance using the specified properties. - * @function create - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance - */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); - }; - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encode - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && Object.hasOwnProperty.call(message, "get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && Object.hasOwnProperty.call(message, "put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && Object.hasOwnProperty.call(message, "post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) - $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.additionalBindings != null && message.additionalBindings.length) - for (var i = 0; i < message.additionalBindings.length; ++i) - $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); - return writer; - }; - - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @function decode - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.selector = reader.string(); - break; - } - case 2: { - message.get = reader.string(); - break; - } - case 3: { - message.put = reader.string(); - break; - } - case 4: { - message.post = reader.string(); - break; - } - case 5: { - message["delete"] = reader.string(); - break; - } - case 6: { - message.patch = reader.string(); - break; - } - case 8: { - message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); - break; - } - case 7: { - message.body = reader.string(); - break; - } - case 12: { - message.responseBody = reader.string(); - break; - } - case 11: { - if (!(message.additionalBindings && message.additionalBindings.length)) - message.additionalBindings = []; - message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HttpRule message. - * @function verify - * @memberof google.api.HttpRule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HttpRule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.get != null && message.hasOwnProperty("get")) { - properties.pattern = 1; - if (!$util.isString(message.get)) - return "get: string expected"; - } - if (message.put != null && message.hasOwnProperty("put")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.put)) - return "put: string expected"; - } - if (message.post != null && message.hasOwnProperty("post")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.post)) - return "post: string expected"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message["delete"])) - return "delete: string expected"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.patch)) - return "patch: string expected"; - } - if (message.custom != null && message.hasOwnProperty("custom")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - { - var error = $root.google.api.CustomHttpPattern.verify(message.custom); - if (error) - return "custom." + error; - } - } - if (message.body != null && message.hasOwnProperty("body")) - if (!$util.isString(message.body)) - return "body: string expected"; - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - if (!$util.isString(message.responseBody)) - return "responseBody: string expected"; - if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { - if (!Array.isArray(message.additionalBindings)) - return "additionalBindings: array expected"; - for (var i = 0; i < message.additionalBindings.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); - if (error) - return "additionalBindings." + error; - } - } - return null; - }; - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.HttpRule - * @static - * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule - */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) - return object; - var message = new $root.google.api.HttpRule(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.get != null) - message.get = String(object.get); - if (object.put != null) - message.put = String(object.put); - if (object.post != null) - message.post = String(object.post); - if (object["delete"] != null) - message["delete"] = String(object["delete"]); - if (object.patch != null) - message.patch = String(object.patch); - if (object.custom != null) { - if (typeof object.custom !== "object") - throw TypeError(".google.api.HttpRule.custom: object expected"); - message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); - } - if (object.body != null) - message.body = String(object.body); - if (object.responseBody != null) - message.responseBody = String(object.responseBody); - if (object.additionalBindings) { - if (!Array.isArray(object.additionalBindings)) - throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); - message.additionalBindings = []; - for (var i = 0; i < object.additionalBindings.length; ++i) { - if (typeof object.additionalBindings[i] !== "object") - throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); - message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.HttpRule - * @static - * @param {google.api.HttpRule} message HttpRule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HttpRule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.additionalBindings = []; - if (options.defaults) { - object.selector = ""; - object.body = ""; - object.responseBody = ""; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.get != null && message.hasOwnProperty("get")) { - object.get = message.get; - if (options.oneofs) - object.pattern = "get"; - } - if (message.put != null && message.hasOwnProperty("put")) { - object.put = message.put; - if (options.oneofs) - object.pattern = "put"; - } - if (message.post != null && message.hasOwnProperty("post")) { - object.post = message.post; - if (options.oneofs) - object.pattern = "post"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - object["delete"] = message["delete"]; - if (options.oneofs) - object.pattern = "delete"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - object.patch = message.patch; - if (options.oneofs) - object.pattern = "patch"; - } - if (message.body != null && message.hasOwnProperty("body")) - object.body = message.body; - if (message.custom != null && message.hasOwnProperty("custom")) { - object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); - if (options.oneofs) - object.pattern = "custom"; - } - if (message.additionalBindings && message.additionalBindings.length) { - object.additionalBindings = []; - for (var j = 0; j < message.additionalBindings.length; ++j) - object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); - } - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; - return object; - }; - - /** - * Converts this HttpRule to JSON. - * @function toJSON - * @memberof google.api.HttpRule - * @instance - * @returns {Object.} JSON object - */ - HttpRule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HttpRule - * @function getTypeUrl - * @memberof google.api.HttpRule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.HttpRule"; - }; - - return HttpRule; - })(); - - api.CustomHttpPattern = (function() { - - /** - * Properties of a CustomHttpPattern. - * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path - */ - - /** - * Constructs a new CustomHttpPattern. - * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern - * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - */ - function CustomHttpPattern(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.kind = ""; - - /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.path = ""; - - /** - * Creates a new CustomHttpPattern instance using the specified properties. - * @function create - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance - */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); - }; - - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encode - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); - return writer; - }; - - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @function decode - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.kind = reader.string(); - break; - } - case 2: { - message.path = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CustomHttpPattern message. - * @function verify - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CustomHttpPattern.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - if (!$util.isString(message.kind)) - return "kind: string expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; - return null; - }; - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) - return object; - var message = new $root.google.api.CustomHttpPattern(); - if (object.kind != null) - message.kind = String(object.kind); - if (object.path != null) - message.path = String(object.path); - return message; - }; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomHttpPattern.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.kind = ""; - object.path = ""; - } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - return object; - }; - - /** - * Converts this CustomHttpPattern to JSON. - * @function toJSON - * @memberof google.api.CustomHttpPattern - * @instance - * @returns {Object.} JSON object - */ - CustomHttpPattern.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CustomHttpPattern - * @function getTypeUrl - * @memberof google.api.CustomHttpPattern - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CustomHttpPattern"; - }; - - return CustomHttpPattern; - })(); - - api.CommonLanguageSettings = (function() { - - /** - * Properties of a CommonLanguageSettings. - * @memberof google.api - * @interface ICommonLanguageSettings - * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri - * @property {Array.|null} [destinations] CommonLanguageSettings destinations - */ - - /** - * Constructs a new CommonLanguageSettings. - * @memberof google.api - * @classdesc Represents a CommonLanguageSettings. - * @implements ICommonLanguageSettings - * @constructor - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set - */ - function CommonLanguageSettings(properties) { - this.destinations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CommonLanguageSettings referenceDocsUri. - * @member {string} referenceDocsUri - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.referenceDocsUri = ""; - - /** - * CommonLanguageSettings destinations. - * @member {Array.} destinations - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.destinations = $util.emptyArray; - - /** - * Creates a new CommonLanguageSettings instance using the specified properties. - * @function create - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance - */ - CommonLanguageSettings.create = function create(properties) { - return new CommonLanguageSettings(properties); - }; - - /** - * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @function encode - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonLanguageSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); - if (message.destinations != null && message.destinations.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.destinations.length; ++i) - writer.int32(message.destinations[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.CommonLanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonLanguageSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.referenceDocsUri = reader.string(); - break; - } - case 2: { - if (!(message.destinations && message.destinations.length)) - message.destinations = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.destinations.push(reader.int32()); - } else - message.destinations.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CommonLanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CommonLanguageSettings message. - * @function verify - * @memberof google.api.CommonLanguageSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CommonLanguageSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) - if (!$util.isString(message.referenceDocsUri)) - return "referenceDocsUri: string expected"; - if (message.destinations != null && message.hasOwnProperty("destinations")) { - if (!Array.isArray(message.destinations)) - return "destinations: array expected"; - for (var i = 0; i < message.destinations.length; ++i) - switch (message.destinations[i]) { - default: - return "destinations: enum value[] expected"; - case 0: - case 10: - case 20: - break; - } - } - return null; - }; - - /** - * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CommonLanguageSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - */ - CommonLanguageSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CommonLanguageSettings) - return object; - var message = new $root.google.api.CommonLanguageSettings(); - if (object.referenceDocsUri != null) - message.referenceDocsUri = String(object.referenceDocsUri); - if (object.destinations) { - if (!Array.isArray(object.destinations)) - throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); - message.destinations = []; - for (var i = 0; i < object.destinations.length; ++i) - switch (object.destinations[i]) { - default: - if (typeof object.destinations[i] === "number") { - message.destinations[i] = object.destinations[i]; - break; - } - case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": - case 0: - message.destinations[i] = 0; - break; - case "GITHUB": - case 10: - message.destinations[i] = 10; - break; - case "PACKAGE_MANAGER": - case 20: - message.destinations[i] = 20; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CommonLanguageSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.destinations = []; - if (options.defaults) - object.referenceDocsUri = ""; - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) - object.referenceDocsUri = message.referenceDocsUri; - if (message.destinations && message.destinations.length) { - object.destinations = []; - for (var j = 0; j < message.destinations.length; ++j) - object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; - } - return object; - }; - - /** - * Converts this CommonLanguageSettings to JSON. - * @function toJSON - * @memberof google.api.CommonLanguageSettings - * @instance - * @returns {Object.} JSON object - */ - CommonLanguageSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CommonLanguageSettings - * @function getTypeUrl - * @memberof google.api.CommonLanguageSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CommonLanguageSettings"; - }; - - return CommonLanguageSettings; - })(); - - api.ClientLibrarySettings = (function() { - - /** - * Properties of a ClientLibrarySettings. - * @memberof google.api - * @interface IClientLibrarySettings - * @property {string|null} [version] ClientLibrarySettings version - * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage - * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums - * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings - * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings - * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings - * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings - * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings - * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings - * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings - * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings - */ - - /** - * Constructs a new ClientLibrarySettings. - * @memberof google.api - * @classdesc Represents a ClientLibrarySettings. - * @implements IClientLibrarySettings - * @constructor - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - */ - function ClientLibrarySettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientLibrarySettings version. - * @member {string} version - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.version = ""; - - /** - * ClientLibrarySettings launchStage. - * @member {google.api.LaunchStage} launchStage - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.launchStage = 0; - - /** - * ClientLibrarySettings restNumericEnums. - * @member {boolean} restNumericEnums - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.restNumericEnums = false; - - /** - * ClientLibrarySettings javaSettings. - * @member {google.api.IJavaSettings|null|undefined} javaSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.javaSettings = null; - - /** - * ClientLibrarySettings cppSettings. - * @member {google.api.ICppSettings|null|undefined} cppSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.cppSettings = null; - - /** - * ClientLibrarySettings phpSettings. - * @member {google.api.IPhpSettings|null|undefined} phpSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.phpSettings = null; - - /** - * ClientLibrarySettings pythonSettings. - * @member {google.api.IPythonSettings|null|undefined} pythonSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.pythonSettings = null; - - /** - * ClientLibrarySettings nodeSettings. - * @member {google.api.INodeSettings|null|undefined} nodeSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.nodeSettings = null; - - /** - * ClientLibrarySettings dotnetSettings. - * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.dotnetSettings = null; - - /** - * ClientLibrarySettings rubySettings. - * @member {google.api.IRubySettings|null|undefined} rubySettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.rubySettings = null; - - /** - * ClientLibrarySettings goSettings. - * @member {google.api.IGoSettings|null|undefined} goSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.goSettings = null; - - /** - * Creates a new ClientLibrarySettings instance using the specified properties. - * @function create - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance - */ - ClientLibrarySettings.create = function create(properties) { - return new ClientLibrarySettings(properties); - }; - - /** - * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @function encode - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientLibrarySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); - if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); - if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) - $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) - $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) - $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) - $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) - $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); - if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) - $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) - $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) - $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.ClientLibrarySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientLibrarySettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.version = reader.string(); - break; - } - case 2: { - message.launchStage = reader.int32(); - break; - } - case 3: { - message.restNumericEnums = reader.bool(); - break; - } - case 21: { - message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); - break; - } - case 22: { - message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); - break; - } - case 23: { - message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); - break; - } - case 24: { - message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); - break; - } - case 25: { - message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); - break; - } - case 26: { - message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); - break; - } - case 27: { - message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); - break; - } - case 28: { - message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ClientLibrarySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientLibrarySettings message. - * @function verify - * @memberof google.api.ClientLibrarySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientLibrarySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - switch (message.launchStage) { - default: - return "launchStage: enum value expected"; - case 0: - case 6: - case 7: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) - if (typeof message.restNumericEnums !== "boolean") - return "restNumericEnums: boolean expected"; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { - var error = $root.google.api.JavaSettings.verify(message.javaSettings); - if (error) - return "javaSettings." + error; - } - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { - var error = $root.google.api.CppSettings.verify(message.cppSettings); - if (error) - return "cppSettings." + error; - } - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { - var error = $root.google.api.PhpSettings.verify(message.phpSettings); - if (error) - return "phpSettings." + error; - } - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { - var error = $root.google.api.PythonSettings.verify(message.pythonSettings); - if (error) - return "pythonSettings." + error; - } - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { - var error = $root.google.api.NodeSettings.verify(message.nodeSettings); - if (error) - return "nodeSettings." + error; - } - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { - var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); - if (error) - return "dotnetSettings." + error; - } - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { - var error = $root.google.api.RubySettings.verify(message.rubySettings); - if (error) - return "rubySettings." + error; - } - if (message.goSettings != null && message.hasOwnProperty("goSettings")) { - var error = $root.google.api.GoSettings.verify(message.goSettings); - if (error) - return "goSettings." + error; - } - return null; - }; - - /** - * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ClientLibrarySettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - */ - ClientLibrarySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ClientLibrarySettings) - return object; - var message = new $root.google.api.ClientLibrarySettings(); - if (object.version != null) - message.version = String(object.version); - switch (object.launchStage) { - default: - if (typeof object.launchStage === "number") { - message.launchStage = object.launchStage; - break; - } - break; - case "LAUNCH_STAGE_UNSPECIFIED": - case 0: - message.launchStage = 0; - break; - case "UNIMPLEMENTED": - case 6: - message.launchStage = 6; - break; - case "PRELAUNCH": - case 7: - message.launchStage = 7; - break; - case "EARLY_ACCESS": - case 1: - message.launchStage = 1; - break; - case "ALPHA": - case 2: - message.launchStage = 2; - break; - case "BETA": - case 3: - message.launchStage = 3; - break; - case "GA": - case 4: - message.launchStage = 4; - break; - case "DEPRECATED": - case 5: - message.launchStage = 5; - break; - } - if (object.restNumericEnums != null) - message.restNumericEnums = Boolean(object.restNumericEnums); - if (object.javaSettings != null) { - if (typeof object.javaSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); - message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); - } - if (object.cppSettings != null) { - if (typeof object.cppSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); - message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); - } - if (object.phpSettings != null) { - if (typeof object.phpSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); - message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); - } - if (object.pythonSettings != null) { - if (typeof object.pythonSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); - message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); - } - if (object.nodeSettings != null) { - if (typeof object.nodeSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); - message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); - } - if (object.dotnetSettings != null) { - if (typeof object.dotnetSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); - message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); - } - if (object.rubySettings != null) { - if (typeof object.rubySettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); - message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); - } - if (object.goSettings != null) { - if (typeof object.goSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); - message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); - } - return message; - }; - - /** - * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientLibrarySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.version = ""; - object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - object.restNumericEnums = false; - object.javaSettings = null; - object.cppSettings = null; - object.phpSettings = null; - object.pythonSettings = null; - object.nodeSettings = null; - object.dotnetSettings = null; - object.rubySettings = null; - object.goSettings = null; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) - object.restNumericEnums = message.restNumericEnums; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) - object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) - object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) - object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) - object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) - object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) - object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) - object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); - if (message.goSettings != null && message.hasOwnProperty("goSettings")) - object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); - return object; - }; - - /** - * Converts this ClientLibrarySettings to JSON. - * @function toJSON - * @memberof google.api.ClientLibrarySettings - * @instance - * @returns {Object.} JSON object - */ - ClientLibrarySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClientLibrarySettings - * @function getTypeUrl - * @memberof google.api.ClientLibrarySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ClientLibrarySettings"; - }; - - return ClientLibrarySettings; - })(); - - api.Publishing = (function() { - - /** - * Properties of a Publishing. - * @memberof google.api - * @interface IPublishing - * @property {Array.|null} [methodSettings] Publishing methodSettings - * @property {string|null} [newIssueUri] Publishing newIssueUri - * @property {string|null} [documentationUri] Publishing documentationUri - * @property {string|null} [apiShortName] Publishing apiShortName - * @property {string|null} [githubLabel] Publishing githubLabel - * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams - * @property {string|null} [docTagPrefix] Publishing docTagPrefix - * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization - * @property {Array.|null} [librarySettings] Publishing librarySettings - * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri - * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri - */ - - /** - * Constructs a new Publishing. - * @memberof google.api - * @classdesc Represents a Publishing. - * @implements IPublishing - * @constructor - * @param {google.api.IPublishing=} [properties] Properties to set - */ - function Publishing(properties) { - this.methodSettings = []; - this.codeownerGithubTeams = []; - this.librarySettings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Publishing methodSettings. - * @member {Array.} methodSettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.methodSettings = $util.emptyArray; - - /** - * Publishing newIssueUri. - * @member {string} newIssueUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.newIssueUri = ""; - - /** - * Publishing documentationUri. - * @member {string} documentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.documentationUri = ""; - - /** - * Publishing apiShortName. - * @member {string} apiShortName - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.apiShortName = ""; - - /** - * Publishing githubLabel. - * @member {string} githubLabel - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.githubLabel = ""; - - /** - * Publishing codeownerGithubTeams. - * @member {Array.} codeownerGithubTeams - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.codeownerGithubTeams = $util.emptyArray; - - /** - * Publishing docTagPrefix. - * @member {string} docTagPrefix - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.docTagPrefix = ""; - - /** - * Publishing organization. - * @member {google.api.ClientLibraryOrganization} organization - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.organization = 0; - - /** - * Publishing librarySettings. - * @member {Array.} librarySettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.librarySettings = $util.emptyArray; - - /** - * Publishing protoReferenceDocumentationUri. - * @member {string} protoReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.protoReferenceDocumentationUri = ""; - - /** - * Publishing restReferenceDocumentationUri. - * @member {string} restReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.restReferenceDocumentationUri = ""; - - /** - * Creates a new Publishing instance using the specified properties. - * @function create - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing=} [properties] Properties to set - * @returns {google.api.Publishing} Publishing instance - */ - Publishing.create = function create(properties) { - return new Publishing(properties); - }; - - /** - * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @function encode - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing} message Publishing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Publishing.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.methodSettings != null && message.methodSettings.length) - for (var i = 0; i < message.methodSettings.length; ++i) - $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) - writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); - if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) - writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); - if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) - writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); - if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) - writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); - if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) - for (var i = 0; i < message.codeownerGithubTeams.length; ++i) - writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); - if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) - writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); - if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) - writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); - if (message.librarySettings != null && message.librarySettings.length) - for (var i = 0; i < message.librarySettings.length; ++i) - $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); - if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) - writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); - if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) - writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); - return writer; - }; - - /** - * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing} message Publishing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Publishing.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Publishing message from the specified reader or buffer. - * @function decode - * @memberof google.api.Publishing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Publishing} Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Publishing.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - if (!(message.methodSettings && message.methodSettings.length)) - message.methodSettings = []; - message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); - break; - } - case 101: { - message.newIssueUri = reader.string(); - break; - } - case 102: { - message.documentationUri = reader.string(); - break; - } - case 103: { - message.apiShortName = reader.string(); - break; - } - case 104: { - message.githubLabel = reader.string(); - break; - } - case 105: { - if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) - message.codeownerGithubTeams = []; - message.codeownerGithubTeams.push(reader.string()); - break; - } - case 106: { - message.docTagPrefix = reader.string(); - break; - } - case 107: { - message.organization = reader.int32(); - break; - } - case 109: { - if (!(message.librarySettings && message.librarySettings.length)) - message.librarySettings = []; - message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); - break; - } - case 110: { - message.protoReferenceDocumentationUri = reader.string(); - break; - } - case 111: { - message.restReferenceDocumentationUri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Publishing message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Publishing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Publishing} Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Publishing.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Publishing message. - * @function verify - * @memberof google.api.Publishing - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Publishing.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { - if (!Array.isArray(message.methodSettings)) - return "methodSettings: array expected"; - for (var i = 0; i < message.methodSettings.length; ++i) { - var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); - if (error) - return "methodSettings." + error; - } - } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) - if (!$util.isString(message.newIssueUri)) - return "newIssueUri: string expected"; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - if (!$util.isString(message.documentationUri)) - return "documentationUri: string expected"; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) - if (!$util.isString(message.apiShortName)) - return "apiShortName: string expected"; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) - if (!$util.isString(message.githubLabel)) - return "githubLabel: string expected"; - if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { - if (!Array.isArray(message.codeownerGithubTeams)) - return "codeownerGithubTeams: array expected"; - for (var i = 0; i < message.codeownerGithubTeams.length; ++i) - if (!$util.isString(message.codeownerGithubTeams[i])) - return "codeownerGithubTeams: string[] expected"; - } - if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) - if (!$util.isString(message.docTagPrefix)) - return "docTagPrefix: string expected"; - if (message.organization != null && message.hasOwnProperty("organization")) - switch (message.organization) { - default: - return "organization: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { - if (!Array.isArray(message.librarySettings)) - return "librarySettings: array expected"; - for (var i = 0; i < message.librarySettings.length; ++i) { - var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); - if (error) - return "librarySettings." + error; - } - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - if (!$util.isString(message.protoReferenceDocumentationUri)) - return "protoReferenceDocumentationUri: string expected"; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - if (!$util.isString(message.restReferenceDocumentationUri)) - return "restReferenceDocumentationUri: string expected"; - return null; - }; - - /** - * Creates a Publishing message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Publishing - * @static - * @param {Object.} object Plain object - * @returns {google.api.Publishing} Publishing - */ - Publishing.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Publishing) - return object; - var message = new $root.google.api.Publishing(); - if (object.methodSettings) { - if (!Array.isArray(object.methodSettings)) - throw TypeError(".google.api.Publishing.methodSettings: array expected"); - message.methodSettings = []; - for (var i = 0; i < object.methodSettings.length; ++i) { - if (typeof object.methodSettings[i] !== "object") - throw TypeError(".google.api.Publishing.methodSettings: object expected"); - message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); - } - } - if (object.newIssueUri != null) - message.newIssueUri = String(object.newIssueUri); - if (object.documentationUri != null) - message.documentationUri = String(object.documentationUri); - if (object.apiShortName != null) - message.apiShortName = String(object.apiShortName); - if (object.githubLabel != null) - message.githubLabel = String(object.githubLabel); - if (object.codeownerGithubTeams) { - if (!Array.isArray(object.codeownerGithubTeams)) - throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); - message.codeownerGithubTeams = []; - for (var i = 0; i < object.codeownerGithubTeams.length; ++i) - message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); - } - if (object.docTagPrefix != null) - message.docTagPrefix = String(object.docTagPrefix); - switch (object.organization) { - default: - if (typeof object.organization === "number") { - message.organization = object.organization; - break; - } - break; - case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": - case 0: - message.organization = 0; - break; - case "CLOUD": - case 1: - message.organization = 1; - break; - case "ADS": - case 2: - message.organization = 2; - break; - case "PHOTOS": - case 3: - message.organization = 3; - break; - case "STREET_VIEW": - case 4: - message.organization = 4; - break; - case "SHOPPING": - case 5: - message.organization = 5; - break; - case "GEO": - case 6: - message.organization = 6; - break; - case "GENERATIVE_AI": - case 7: - message.organization = 7; - break; - } - if (object.librarySettings) { - if (!Array.isArray(object.librarySettings)) - throw TypeError(".google.api.Publishing.librarySettings: array expected"); - message.librarySettings = []; - for (var i = 0; i < object.librarySettings.length; ++i) { - if (typeof object.librarySettings[i] !== "object") - throw TypeError(".google.api.Publishing.librarySettings: object expected"); - message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); - } - } - if (object.protoReferenceDocumentationUri != null) - message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); - if (object.restReferenceDocumentationUri != null) - message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); - return message; - }; - - /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Publishing - * @static - * @param {google.api.Publishing} message Publishing - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Publishing.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.methodSettings = []; - object.codeownerGithubTeams = []; - object.librarySettings = []; - } - if (options.defaults) { - object.newIssueUri = ""; - object.documentationUri = ""; - object.apiShortName = ""; - object.githubLabel = ""; - object.docTagPrefix = ""; - object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; - object.protoReferenceDocumentationUri = ""; - object.restReferenceDocumentationUri = ""; - } - if (message.methodSettings && message.methodSettings.length) { - object.methodSettings = []; - for (var j = 0; j < message.methodSettings.length; ++j) - object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); - } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) - object.newIssueUri = message.newIssueUri; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - object.documentationUri = message.documentationUri; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) - object.apiShortName = message.apiShortName; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) - object.githubLabel = message.githubLabel; - if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { - object.codeownerGithubTeams = []; - for (var j = 0; j < message.codeownerGithubTeams.length; ++j) - object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; - } - if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) - object.docTagPrefix = message.docTagPrefix; - if (message.organization != null && message.hasOwnProperty("organization")) - object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; - if (message.librarySettings && message.librarySettings.length) { - object.librarySettings = []; - for (var j = 0; j < message.librarySettings.length; ++j) - object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; - return object; - }; - - /** - * Converts this Publishing to JSON. - * @function toJSON - * @memberof google.api.Publishing - * @instance - * @returns {Object.} JSON object - */ - Publishing.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Publishing - * @function getTypeUrl - * @memberof google.api.Publishing - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Publishing"; - }; - - return Publishing; - })(); - - api.JavaSettings = (function() { - - /** - * Properties of a JavaSettings. - * @memberof google.api - * @interface IJavaSettings - * @property {string|null} [libraryPackage] JavaSettings libraryPackage - * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames - * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common - */ - - /** - * Constructs a new JavaSettings. - * @memberof google.api - * @classdesc Represents a JavaSettings. - * @implements IJavaSettings - * @constructor - * @param {google.api.IJavaSettings=} [properties] Properties to set - */ - function JavaSettings(properties) { - this.serviceClassNames = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * JavaSettings libraryPackage. - * @member {string} libraryPackage - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.libraryPackage = ""; - - /** - * JavaSettings serviceClassNames. - * @member {Object.} serviceClassNames - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.serviceClassNames = $util.emptyObject; - - /** - * JavaSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.common = null; - - /** - * Creates a new JavaSettings instance using the specified properties. - * @function create - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings=} [properties] Properties to set - * @returns {google.api.JavaSettings} JavaSettings instance - */ - JavaSettings.create = function create(properties) { - return new JavaSettings(properties); - }; - - /** - * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @function encode - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JavaSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); - if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) - for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a JavaSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.JavaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.JavaSettings} JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JavaSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.libraryPackage = reader.string(); - break; - } - case 2: { - if (message.serviceClassNames === $util.emptyObject) - message.serviceClassNames = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.serviceClassNames[key] = value; - break; - } - case 3: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a JavaSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.JavaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.JavaSettings} JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JavaSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a JavaSettings message. - * @function verify - * @memberof google.api.JavaSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - JavaSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) - if (!$util.isString(message.libraryPackage)) - return "libraryPackage: string expected"; - if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { - if (!$util.isObject(message.serviceClassNames)) - return "serviceClassNames: object expected"; - var key = Object.keys(message.serviceClassNames); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.serviceClassNames[key[i]])) - return "serviceClassNames: string{k:string} expected"; - } - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.JavaSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.JavaSettings} JavaSettings - */ - JavaSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.JavaSettings) - return object; - var message = new $root.google.api.JavaSettings(); - if (object.libraryPackage != null) - message.libraryPackage = String(object.libraryPackage); - if (object.serviceClassNames) { - if (typeof object.serviceClassNames !== "object") - throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); - message.serviceClassNames = {}; - for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) - message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); - } - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.JavaSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.JavaSettings - * @static - * @param {google.api.JavaSettings} message JavaSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - JavaSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.serviceClassNames = {}; - if (options.defaults) { - object.libraryPackage = ""; - object.common = null; - } - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) - object.libraryPackage = message.libraryPackage; - var keys2; - if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { - object.serviceClassNames = {}; - for (var j = 0; j < keys2.length; ++j) - object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; - } - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this JavaSettings to JSON. - * @function toJSON - * @memberof google.api.JavaSettings - * @instance - * @returns {Object.} JSON object - */ - JavaSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for JavaSettings - * @function getTypeUrl - * @memberof google.api.JavaSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.JavaSettings"; - }; - - return JavaSettings; - })(); - - api.CppSettings = (function() { - - /** - * Properties of a CppSettings. - * @memberof google.api - * @interface ICppSettings - * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common - */ - - /** - * Constructs a new CppSettings. - * @memberof google.api - * @classdesc Represents a CppSettings. - * @implements ICppSettings - * @constructor - * @param {google.api.ICppSettings=} [properties] Properties to set - */ - function CppSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CppSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.CppSettings - * @instance - */ - CppSettings.prototype.common = null; - - /** - * Creates a new CppSettings instance using the specified properties. - * @function create - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings=} [properties] Properties to set - * @returns {google.api.CppSettings} CppSettings instance - */ - CppSettings.create = function create(properties) { - return new CppSettings(properties); - }; - - /** - * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @function encode - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings} message CppSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CppSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings} message CppSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CppSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CppSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.CppSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CppSettings} CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CppSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CppSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CppSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CppSettings} CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CppSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CppSettings message. - * @function verify - * @memberof google.api.CppSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CppSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CppSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CppSettings} CppSettings - */ - CppSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CppSettings) - return object; - var message = new $root.google.api.CppSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.CppSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a CppSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CppSettings - * @static - * @param {google.api.CppSettings} message CppSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CppSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this CppSettings to JSON. - * @function toJSON - * @memberof google.api.CppSettings - * @instance - * @returns {Object.} JSON object - */ - CppSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CppSettings - * @function getTypeUrl - * @memberof google.api.CppSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CppSettings"; - }; - - return CppSettings; - })(); - - api.PhpSettings = (function() { - - /** - * Properties of a PhpSettings. - * @memberof google.api - * @interface IPhpSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common - */ - - /** - * Constructs a new PhpSettings. - * @memberof google.api - * @classdesc Represents a PhpSettings. - * @implements IPhpSettings - * @constructor - * @param {google.api.IPhpSettings=} [properties] Properties to set - */ - function PhpSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PhpSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PhpSettings - * @instance - */ - PhpSettings.prototype.common = null; - - /** - * Creates a new PhpSettings instance using the specified properties. - * @function create - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings=} [properties] Properties to set - * @returns {google.api.PhpSettings} PhpSettings instance - */ - PhpSettings.create = function create(properties) { - return new PhpSettings(properties); - }; - - /** - * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @function encode - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhpSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PhpSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.PhpSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PhpSettings} PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhpSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PhpSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PhpSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PhpSettings} PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhpSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PhpSettings message. - * @function verify - * @memberof google.api.PhpSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PhpSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PhpSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PhpSettings} PhpSettings - */ - PhpSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PhpSettings) - return object; - var message = new $root.google.api.PhpSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PhpSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PhpSettings - * @static - * @param {google.api.PhpSettings} message PhpSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PhpSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this PhpSettings to JSON. - * @function toJSON - * @memberof google.api.PhpSettings - * @instance - * @returns {Object.} JSON object - */ - PhpSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PhpSettings - * @function getTypeUrl - * @memberof google.api.PhpSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PhpSettings"; - }; - - return PhpSettings; - })(); - - api.PythonSettings = (function() { - - /** - * Properties of a PythonSettings. - * @memberof google.api - * @interface IPythonSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common - */ - - /** - * Constructs a new PythonSettings. - * @memberof google.api - * @classdesc Represents a PythonSettings. - * @implements IPythonSettings - * @constructor - * @param {google.api.IPythonSettings=} [properties] Properties to set - */ - function PythonSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PythonSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PythonSettings - * @instance - */ - PythonSettings.prototype.common = null; - - /** - * Creates a new PythonSettings instance using the specified properties. - * @function create - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings=} [properties] Properties to set - * @returns {google.api.PythonSettings} PythonSettings instance - */ - PythonSettings.create = function create(properties) { - return new PythonSettings(properties); - }; - - /** - * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @function encode - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PythonSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.PythonSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PythonSettings} PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PythonSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PythonSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PythonSettings} PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PythonSettings message. - * @function verify - * @memberof google.api.PythonSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PythonSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PythonSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PythonSettings} PythonSettings - */ - PythonSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PythonSettings) - return object; - var message = new $root.google.api.PythonSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PythonSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PythonSettings - * @static - * @param {google.api.PythonSettings} message PythonSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PythonSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this PythonSettings to JSON. - * @function toJSON - * @memberof google.api.PythonSettings - * @instance - * @returns {Object.} JSON object - */ - PythonSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PythonSettings - * @function getTypeUrl - * @memberof google.api.PythonSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PythonSettings"; - }; - - return PythonSettings; - })(); - - api.NodeSettings = (function() { - - /** - * Properties of a NodeSettings. - * @memberof google.api - * @interface INodeSettings - * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common - */ - - /** - * Constructs a new NodeSettings. - * @memberof google.api - * @classdesc Represents a NodeSettings. - * @implements INodeSettings - * @constructor - * @param {google.api.INodeSettings=} [properties] Properties to set - */ - function NodeSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NodeSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.NodeSettings - * @instance - */ - NodeSettings.prototype.common = null; - - /** - * Creates a new NodeSettings instance using the specified properties. - * @function create - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings=} [properties] Properties to set - * @returns {google.api.NodeSettings} NodeSettings instance - */ - NodeSettings.create = function create(properties) { - return new NodeSettings(properties); - }; - - /** - * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @function encode - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NodeSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.NodeSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.NodeSettings} NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NodeSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.NodeSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.NodeSettings} NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NodeSettings message. - * @function verify - * @memberof google.api.NodeSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NodeSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.NodeSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.NodeSettings} NodeSettings - */ - NodeSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.NodeSettings) - return object; - var message = new $root.google.api.NodeSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.NodeSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.NodeSettings - * @static - * @param {google.api.NodeSettings} message NodeSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NodeSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this NodeSettings to JSON. - * @function toJSON - * @memberof google.api.NodeSettings - * @instance - * @returns {Object.} JSON object - */ - NodeSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NodeSettings - * @function getTypeUrl - * @memberof google.api.NodeSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.NodeSettings"; - }; - - return NodeSettings; - })(); - - api.DotnetSettings = (function() { - - /** - * Properties of a DotnetSettings. - * @memberof google.api - * @interface IDotnetSettings - * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common - * @property {Object.|null} [renamedServices] DotnetSettings renamedServices - * @property {Object.|null} [renamedResources] DotnetSettings renamedResources - * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources - * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases - * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures - */ - - /** - * Constructs a new DotnetSettings. - * @memberof google.api - * @classdesc Represents a DotnetSettings. - * @implements IDotnetSettings - * @constructor - * @param {google.api.IDotnetSettings=} [properties] Properties to set - */ - function DotnetSettings(properties) { - this.renamedServices = {}; - this.renamedResources = {}; - this.ignoredResources = []; - this.forcedNamespaceAliases = []; - this.handwrittenSignatures = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DotnetSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.common = null; - - /** - * DotnetSettings renamedServices. - * @member {Object.} renamedServices - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedServices = $util.emptyObject; - - /** - * DotnetSettings renamedResources. - * @member {Object.} renamedResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedResources = $util.emptyObject; - - /** - * DotnetSettings ignoredResources. - * @member {Array.} ignoredResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.ignoredResources = $util.emptyArray; - - /** - * DotnetSettings forcedNamespaceAliases. - * @member {Array.} forcedNamespaceAliases - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; - - /** - * DotnetSettings handwrittenSignatures. - * @member {Array.} handwrittenSignatures - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; - - /** - * Creates a new DotnetSettings instance using the specified properties. - * @function create - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings=} [properties] Properties to set - * @returns {google.api.DotnetSettings} DotnetSettings instance - */ - DotnetSettings.create = function create(properties) { - return new DotnetSettings(properties); - }; - - /** - * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @function encode - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DotnetSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) - for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); - if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) - for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); - if (message.ignoredResources != null && message.ignoredResources.length) - for (var i = 0; i < message.ignoredResources.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); - if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); - if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); - return writer; - }; - - /** - * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.DotnetSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.DotnetSettings} DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DotnetSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - case 2: { - if (message.renamedServices === $util.emptyObject) - message.renamedServices = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.renamedServices[key] = value; - break; - } - case 3: { - if (message.renamedResources === $util.emptyObject) - message.renamedResources = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.renamedResources[key] = value; - break; - } - case 4: { - if (!(message.ignoredResources && message.ignoredResources.length)) - message.ignoredResources = []; - message.ignoredResources.push(reader.string()); - break; - } - case 5: { - if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) - message.forcedNamespaceAliases = []; - message.forcedNamespaceAliases.push(reader.string()); - break; - } - case 6: { - if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) - message.handwrittenSignatures = []; - message.handwrittenSignatures.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.DotnetSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.DotnetSettings} DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DotnetSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DotnetSettings message. - * @function verify - * @memberof google.api.DotnetSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DotnetSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { - if (!$util.isObject(message.renamedServices)) - return "renamedServices: object expected"; - var key = Object.keys(message.renamedServices); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedServices[key[i]])) - return "renamedServices: string{k:string} expected"; - } - if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { - if (!$util.isObject(message.renamedResources)) - return "renamedResources: object expected"; - var key = Object.keys(message.renamedResources); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedResources[key[i]])) - return "renamedResources: string{k:string} expected"; - } - if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { - if (!Array.isArray(message.ignoredResources)) - return "ignoredResources: array expected"; - for (var i = 0; i < message.ignoredResources.length; ++i) - if (!$util.isString(message.ignoredResources[i])) - return "ignoredResources: string[] expected"; - } - if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { - if (!Array.isArray(message.forcedNamespaceAliases)) - return "forcedNamespaceAliases: array expected"; - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - if (!$util.isString(message.forcedNamespaceAliases[i])) - return "forcedNamespaceAliases: string[] expected"; - } - if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { - if (!Array.isArray(message.handwrittenSignatures)) - return "handwrittenSignatures: array expected"; - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - if (!$util.isString(message.handwrittenSignatures[i])) - return "handwrittenSignatures: string[] expected"; - } - return null; - }; - - /** - * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.DotnetSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.DotnetSettings} DotnetSettings - */ - DotnetSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.DotnetSettings) - return object; - var message = new $root.google.api.DotnetSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.DotnetSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - if (object.renamedServices) { - if (typeof object.renamedServices !== "object") - throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); - message.renamedServices = {}; - for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) - message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); - } - if (object.renamedResources) { - if (typeof object.renamedResources !== "object") - throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); - message.renamedResources = {}; - for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) - message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); - } - if (object.ignoredResources) { - if (!Array.isArray(object.ignoredResources)) - throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); - message.ignoredResources = []; - for (var i = 0; i < object.ignoredResources.length; ++i) - message.ignoredResources[i] = String(object.ignoredResources[i]); - } - if (object.forcedNamespaceAliases) { - if (!Array.isArray(object.forcedNamespaceAliases)) - throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); - message.forcedNamespaceAliases = []; - for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) - message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); - } - if (object.handwrittenSignatures) { - if (!Array.isArray(object.handwrittenSignatures)) - throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); - message.handwrittenSignatures = []; - for (var i = 0; i < object.handwrittenSignatures.length; ++i) - message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); - } - return message; - }; - - /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.DotnetSettings} message DotnetSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DotnetSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.ignoredResources = []; - object.forcedNamespaceAliases = []; - object.handwrittenSignatures = []; - } - if (options.objects || options.defaults) { - object.renamedServices = {}; - object.renamedResources = {}; - } - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - var keys2; - if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { - object.renamedServices = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; - } - if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { - object.renamedResources = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; - } - if (message.ignoredResources && message.ignoredResources.length) { - object.ignoredResources = []; - for (var j = 0; j < message.ignoredResources.length; ++j) - object.ignoredResources[j] = message.ignoredResources[j]; - } - if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { - object.forcedNamespaceAliases = []; - for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) - object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; - } - if (message.handwrittenSignatures && message.handwrittenSignatures.length) { - object.handwrittenSignatures = []; - for (var j = 0; j < message.handwrittenSignatures.length; ++j) - object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; - } - return object; - }; - - /** - * Converts this DotnetSettings to JSON. - * @function toJSON - * @memberof google.api.DotnetSettings - * @instance - * @returns {Object.} JSON object - */ - DotnetSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DotnetSettings - * @function getTypeUrl - * @memberof google.api.DotnetSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.DotnetSettings"; - }; - - return DotnetSettings; - })(); - - api.RubySettings = (function() { - - /** - * Properties of a RubySettings. - * @memberof google.api - * @interface IRubySettings - * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common - */ - - /** - * Constructs a new RubySettings. - * @memberof google.api - * @classdesc Represents a RubySettings. - * @implements IRubySettings - * @constructor - * @param {google.api.IRubySettings=} [properties] Properties to set - */ - function RubySettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RubySettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.RubySettings - * @instance - */ - RubySettings.prototype.common = null; - - /** - * Creates a new RubySettings instance using the specified properties. - * @function create - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings=} [properties] Properties to set - * @returns {google.api.RubySettings} RubySettings instance - */ - RubySettings.create = function create(properties) { - return new RubySettings(properties); - }; - - /** - * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @function encode - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings} message RubySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RubySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings} message RubySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RubySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RubySettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.RubySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.RubySettings} RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RubySettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RubySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.RubySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.RubySettings} RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RubySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RubySettings message. - * @function verify - * @memberof google.api.RubySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RubySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.RubySettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.RubySettings} RubySettings - */ - RubySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.RubySettings) - return object; - var message = new $root.google.api.RubySettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.RubySettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.RubySettings - * @static - * @param {google.api.RubySettings} message RubySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RubySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this RubySettings to JSON. - * @function toJSON - * @memberof google.api.RubySettings - * @instance - * @returns {Object.} JSON object - */ - RubySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RubySettings - * @function getTypeUrl - * @memberof google.api.RubySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.RubySettings"; - }; - - return RubySettings; - })(); - - api.GoSettings = (function() { - - /** - * Properties of a GoSettings. - * @memberof google.api - * @interface IGoSettings - * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common - */ - - /** - * Constructs a new GoSettings. - * @memberof google.api - * @classdesc Represents a GoSettings. - * @implements IGoSettings - * @constructor - * @param {google.api.IGoSettings=} [properties] Properties to set - */ - function GoSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GoSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.GoSettings - * @instance - */ - GoSettings.prototype.common = null; - - /** - * Creates a new GoSettings instance using the specified properties. - * @function create - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings=} [properties] Properties to set - * @returns {google.api.GoSettings} GoSettings instance - */ - GoSettings.create = function create(properties) { - return new GoSettings(properties); - }; - - /** - * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @function encode - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings} message GoSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings} message GoSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GoSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.GoSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.GoSettings} GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GoSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.GoSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.GoSettings} GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GoSettings message. - * @function verify - * @memberof google.api.GoSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GoSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.GoSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.GoSettings} GoSettings - */ - GoSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.GoSettings) - return object; - var message = new $root.google.api.GoSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.GoSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.GoSettings - * @static - * @param {google.api.GoSettings} message GoSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GoSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this GoSettings to JSON. - * @function toJSON - * @memberof google.api.GoSettings - * @instance - * @returns {Object.} JSON object - */ - GoSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GoSettings - * @function getTypeUrl - * @memberof google.api.GoSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.GoSettings"; - }; - - return GoSettings; - })(); - - api.MethodSettings = (function() { - - /** - * Properties of a MethodSettings. - * @memberof google.api - * @interface IMethodSettings - * @property {string|null} [selector] MethodSettings selector - * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning - * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields - */ - - /** - * Constructs a new MethodSettings. - * @memberof google.api - * @classdesc Represents a MethodSettings. - * @implements IMethodSettings - * @constructor - * @param {google.api.IMethodSettings=} [properties] Properties to set - */ - function MethodSettings(properties) { - this.autoPopulatedFields = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodSettings selector. - * @member {string} selector - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.selector = ""; - - /** - * MethodSettings longRunning. - * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.longRunning = null; - - /** - * MethodSettings autoPopulatedFields. - * @member {Array.} autoPopulatedFields - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; - - /** - * Creates a new MethodSettings instance using the specified properties. - * @function create - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings=} [properties] Properties to set - * @returns {google.api.MethodSettings} MethodSettings instance - */ - MethodSettings.create = function create(properties) { - return new MethodSettings(properties); - }; - - /** - * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @function encode - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) - $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); - return writer; - }; - - /** - * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.MethodSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MethodSettings} MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.selector = reader.string(); - break; - } - case 2: { - message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) - message.autoPopulatedFields = []; - message.autoPopulatedFields.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MethodSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MethodSettings} MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodSettings message. - * @function verify - * @memberof google.api.MethodSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) { - var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); - if (error) - return "longRunning." + error; - } - if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { - if (!Array.isArray(message.autoPopulatedFields)) - return "autoPopulatedFields: array expected"; - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - if (!$util.isString(message.autoPopulatedFields[i])) - return "autoPopulatedFields: string[] expected"; - } - return null; - }; - - /** - * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings} MethodSettings - */ - MethodSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MethodSettings) - return object; - var message = new $root.google.api.MethodSettings(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.longRunning != null) { - if (typeof object.longRunning !== "object") - throw TypeError(".google.api.MethodSettings.longRunning: object expected"); - message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); - } - if (object.autoPopulatedFields) { - if (!Array.isArray(object.autoPopulatedFields)) - throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); - message.autoPopulatedFields = []; - for (var i = 0; i < object.autoPopulatedFields.length; ++i) - message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); - } - return message; - }; - - /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings - * @static - * @param {google.api.MethodSettings} message MethodSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.autoPopulatedFields = []; - if (options.defaults) { - object.selector = ""; - object.longRunning = null; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) - object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); - if (message.autoPopulatedFields && message.autoPopulatedFields.length) { - object.autoPopulatedFields = []; - for (var j = 0; j < message.autoPopulatedFields.length; ++j) - object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; - } - return object; - }; - - /** - * Converts this MethodSettings to JSON. - * @function toJSON - * @memberof google.api.MethodSettings - * @instance - * @returns {Object.} JSON object - */ - MethodSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodSettings - * @function getTypeUrl - * @memberof google.api.MethodSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.MethodSettings"; - }; - - MethodSettings.LongRunning = (function() { - - /** - * Properties of a LongRunning. - * @memberof google.api.MethodSettings - * @interface ILongRunning - * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay - * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier - * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay - * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout - */ - - /** - * Constructs a new LongRunning. - * @memberof google.api.MethodSettings - * @classdesc Represents a LongRunning. - * @implements ILongRunning - * @constructor - * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set - */ - function LongRunning(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LongRunning initialPollDelay. - * @member {google.protobuf.IDuration|null|undefined} initialPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.initialPollDelay = null; - - /** - * LongRunning pollDelayMultiplier. - * @member {number} pollDelayMultiplier - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.pollDelayMultiplier = 0; - - /** - * LongRunning maxPollDelay. - * @member {google.protobuf.IDuration|null|undefined} maxPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.maxPollDelay = null; - - /** - * LongRunning totalPollTimeout. - * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.totalPollTimeout = null; - - /** - * Creates a new LongRunning instance using the specified properties. - * @function create - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set - * @returns {google.api.MethodSettings.LongRunning} LongRunning instance - */ - LongRunning.create = function create(properties) { - return new LongRunning(properties); - }; - - /** - * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @function encode - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LongRunning.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) - $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); - if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) - $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) - $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LongRunning.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LongRunning message from the specified reader or buffer. - * @function decode - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MethodSettings.LongRunning} LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LongRunning.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 2: { - message.pollDelayMultiplier = reader.float(); - break; - } - case 3: { - message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LongRunning message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MethodSettings.LongRunning} LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LongRunning.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LongRunning message. - * @function verify - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LongRunning.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { - var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); - if (error) - return "initialPollDelay." + error; - } - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) - if (typeof message.pollDelayMultiplier !== "number") - return "pollDelayMultiplier: number expected"; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { - var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); - if (error) - return "maxPollDelay." + error; - } - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { - var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); - if (error) - return "totalPollTimeout." + error; - } - return null; - }; - - /** - * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings.LongRunning} LongRunning - */ - LongRunning.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MethodSettings.LongRunning) - return object; - var message = new $root.google.api.MethodSettings.LongRunning(); - if (object.initialPollDelay != null) { - if (typeof object.initialPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); - message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); - } - if (object.pollDelayMultiplier != null) - message.pollDelayMultiplier = Number(object.pollDelayMultiplier); - if (object.maxPollDelay != null) { - if (typeof object.maxPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); - message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); - } - if (object.totalPollTimeout != null) { - if (typeof object.totalPollTimeout !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); - message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); - } - return message; - }; - - /** - * Creates a plain object from a LongRunning message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.LongRunning} message LongRunning - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LongRunning.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.initialPollDelay = null; - object.pollDelayMultiplier = 0; - object.maxPollDelay = null; - object.totalPollTimeout = null; - } - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) - object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) - object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) - object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) - object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); - return object; - }; - - /** - * Converts this LongRunning to JSON. - * @function toJSON - * @memberof google.api.MethodSettings.LongRunning - * @instance - * @returns {Object.} JSON object - */ - LongRunning.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LongRunning - * @function getTypeUrl - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; - }; - - return LongRunning; - })(); - - return MethodSettings; - })(); - - /** - * ClientLibraryOrganization enum. - * @name google.api.ClientLibraryOrganization - * @enum {number} - * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value - * @property {number} CLOUD=1 CLOUD value - * @property {number} ADS=2 ADS value - * @property {number} PHOTOS=3 PHOTOS value - * @property {number} STREET_VIEW=4 STREET_VIEW value - * @property {number} SHOPPING=5 SHOPPING value - * @property {number} GEO=6 GEO value - * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value - */ - api.ClientLibraryOrganization = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; - values[valuesById[1] = "CLOUD"] = 1; - values[valuesById[2] = "ADS"] = 2; - values[valuesById[3] = "PHOTOS"] = 3; - values[valuesById[4] = "STREET_VIEW"] = 4; - values[valuesById[5] = "SHOPPING"] = 5; - values[valuesById[6] = "GEO"] = 6; - values[valuesById[7] = "GENERATIVE_AI"] = 7; - return values; - })(); - - /** - * ClientLibraryDestination enum. - * @name google.api.ClientLibraryDestination - * @enum {number} - * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value - * @property {number} GITHUB=10 GITHUB value - * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value - */ - api.ClientLibraryDestination = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; - values[valuesById[10] = "GITHUB"] = 10; - values[valuesById[20] = "PACKAGE_MANAGER"] = 20; - return values; - })(); - - /** - * LaunchStage enum. - * @name google.api.LaunchStage - * @enum {number} - * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value - * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value - * @property {number} PRELAUNCH=7 PRELAUNCH value - * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value - * @property {number} ALPHA=2 ALPHA value - * @property {number} BETA=3 BETA value - * @property {number} GA=4 GA value - * @property {number} DEPRECATED=5 DEPRECATED value - */ - api.LaunchStage = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; - values[valuesById[6] = "UNIMPLEMENTED"] = 6; - values[valuesById[7] = "PRELAUNCH"] = 7; - values[valuesById[1] = "EARLY_ACCESS"] = 1; - values[valuesById[2] = "ALPHA"] = 2; - values[valuesById[3] = "BETA"] = 3; - values[valuesById[4] = "GA"] = 4; - values[valuesById[5] = "DEPRECATED"] = 5; - return values; - })(); - - /** - * 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.FieldInfo = (function() { - - /** - * Properties of a FieldInfo. - * @memberof google.api - * @interface IFieldInfo - * @property {google.api.FieldInfo.Format|null} [format] FieldInfo format - */ - - /** - * Constructs a new FieldInfo. - * @memberof google.api - * @classdesc Represents a FieldInfo. - * @implements IFieldInfo - * @constructor - * @param {google.api.IFieldInfo=} [properties] Properties to set - */ - function FieldInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldInfo format. - * @member {google.api.FieldInfo.Format} format - * @memberof google.api.FieldInfo - * @instance - */ - FieldInfo.prototype.format = 0; - - /** - * Creates a new FieldInfo instance using the specified properties. - * @function create - * @memberof google.api.FieldInfo - * @static - * @param {google.api.IFieldInfo=} [properties] Properties to set - * @returns {google.api.FieldInfo} FieldInfo instance - */ - FieldInfo.create = function create(properties) { - return new FieldInfo(properties); - }; - - /** - * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @function encode - * @memberof google.api.FieldInfo - * @static - * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.format != null && Object.hasOwnProperty.call(message, "format")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.format); - return writer; - }; - - /** - * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.FieldInfo - * @static - * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldInfo message from the specified reader or buffer. - * @function decode - * @memberof google.api.FieldInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.FieldInfo} FieldInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.FieldInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.format = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.FieldInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.FieldInfo} FieldInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldInfo message. - * @function verify - * @memberof google.api.FieldInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.format != null && message.hasOwnProperty("format")) - switch (message.format) { - default: - return "format: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - return null; - }; - - /** - * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.FieldInfo - * @static - * @param {Object.} object Plain object - * @returns {google.api.FieldInfo} FieldInfo - */ - FieldInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.FieldInfo) - return object; - var message = new $root.google.api.FieldInfo(); - switch (object.format) { - default: - if (typeof object.format === "number") { - message.format = object.format; - break; - } - break; - case "FORMAT_UNSPECIFIED": - case 0: - message.format = 0; - break; - case "UUID4": - case 1: - message.format = 1; - break; - case "IPV4": - case 2: - message.format = 2; - break; - case "IPV6": - case 3: - message.format = 3; - break; - case "IPV4_OR_IPV6": - case 4: - message.format = 4; - break; - } - return message; - }; - - /** - * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.FieldInfo - * @static - * @param {google.api.FieldInfo} message FieldInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.format = options.enums === String ? "FORMAT_UNSPECIFIED" : 0; - if (message.format != null && message.hasOwnProperty("format")) - object.format = options.enums === String ? $root.google.api.FieldInfo.Format[message.format] === undefined ? message.format : $root.google.api.FieldInfo.Format[message.format] : message.format; - return object; - }; - - /** - * Converts this FieldInfo to JSON. - * @function toJSON - * @memberof google.api.FieldInfo - * @instance - * @returns {Object.} JSON object - */ - FieldInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldInfo - * @function getTypeUrl - * @memberof google.api.FieldInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.FieldInfo"; - }; - - /** - * Format enum. - * @name google.api.FieldInfo.Format - * @enum {number} - * @property {number} FORMAT_UNSPECIFIED=0 FORMAT_UNSPECIFIED value - * @property {number} UUID4=1 UUID4 value - * @property {number} IPV4=2 IPV4 value - * @property {number} IPV6=3 IPV6 value - * @property {number} IPV4_OR_IPV6=4 IPV4_OR_IPV6 value - */ - FieldInfo.Format = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FORMAT_UNSPECIFIED"] = 0; - values[valuesById[1] = "UUID4"] = 1; - values[valuesById[2] = "IPV4"] = 2; - values[valuesById[3] = "IPV6"] = 3; - values[valuesById[4] = "IPV4_OR_IPV6"] = 4; - return values; - })(); - - return FieldInfo; - })(); - - api.ResourceDescriptor = (function() { - - /** - * Properties of a ResourceDescriptor. - * @memberof google.api - * @interface IResourceDescriptor - * @property {string|null} [type] ResourceDescriptor type - * @property {Array.|null} [pattern] ResourceDescriptor pattern - * @property {string|null} [nameField] ResourceDescriptor nameField - * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history - * @property {string|null} [plural] ResourceDescriptor plural - * @property {string|null} [singular] ResourceDescriptor singular - * @property {Array.|null} [style] ResourceDescriptor style - */ - - /** - * Constructs a new ResourceDescriptor. - * @memberof google.api - * @classdesc Represents a ResourceDescriptor. - * @implements IResourceDescriptor - * @constructor - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - */ - function ResourceDescriptor(properties) { - this.pattern = []; - this.style = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceDescriptor type. - * @member {string} type - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.type = ""; - - /** - * ResourceDescriptor pattern. - * @member {Array.} pattern - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.pattern = $util.emptyArray; - - /** - * ResourceDescriptor nameField. - * @member {string} nameField - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.nameField = ""; - - /** - * ResourceDescriptor history. - * @member {google.api.ResourceDescriptor.History} history - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.history = 0; - - /** - * ResourceDescriptor plural. - * @member {string} plural - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.plural = ""; - - /** - * ResourceDescriptor singular. - * @member {string} singular - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.singular = ""; - - /** - * ResourceDescriptor style. - * @member {Array.} style - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.style = $util.emptyArray; - - /** - * Creates a new ResourceDescriptor instance using the specified properties. - * @function create - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance - */ - ResourceDescriptor.create = function create(properties) { - return new ResourceDescriptor(properties); - }; - - /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @function encode - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceDescriptor.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.pattern != null && message.pattern.length) - for (var i = 0; i < message.pattern.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); - if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && Object.hasOwnProperty.call(message, "history")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); - if (message.style != null && message.style.length) { - writer.uint32(/* id 10, wireType 2 =*/82).fork(); - for (var i = 0; i < message.style.length; ++i) - writer.int32(message.style[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. - * @function decode - * @memberof google.api.ResourceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceDescriptor.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - if (!(message.pattern && message.pattern.length)) - message.pattern = []; - message.pattern.push(reader.string()); - break; - } - case 3: { - message.nameField = reader.string(); - break; - } - case 4: { - message.history = reader.int32(); - break; - } - case 5: { - message.plural = reader.string(); - break; - } - case 6: { - message.singular = reader.string(); - break; - } - case 10: { - if (!(message.style && message.style.length)) - message.style = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.style.push(reader.int32()); - } else - message.style.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ResourceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceDescriptor message. - * @function verify - * @memberof google.api.ResourceDescriptor - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceDescriptor.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.pattern != null && message.hasOwnProperty("pattern")) { - if (!Array.isArray(message.pattern)) - return "pattern: array expected"; - for (var i = 0; i < message.pattern.length; ++i) - if (!$util.isString(message.pattern[i])) - return "pattern: string[] expected"; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - if (!$util.isString(message.nameField)) - return "nameField: string expected"; - if (message.history != null && message.hasOwnProperty("history")) - switch (message.history) { - default: - return "history: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.plural != null && message.hasOwnProperty("plural")) - if (!$util.isString(message.plural)) - return "plural: string expected"; - if (message.singular != null && message.hasOwnProperty("singular")) - if (!$util.isString(message.singular)) - return "singular: string expected"; - if (message.style != null && message.hasOwnProperty("style")) { - if (!Array.isArray(message.style)) - return "style: array expected"; - for (var i = 0; i < message.style.length; ++i) - switch (message.style[i]) { - default: - return "style: enum value[] expected"; - case 0: - case 1: - break; - } - } - return null; - }; - - /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ResourceDescriptor - * @static - * @param {Object.} object Plain object - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - */ - ResourceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceDescriptor) - return object; - var message = new $root.google.api.ResourceDescriptor(); - if (object.type != null) - message.type = String(object.type); - if (object.pattern) { - if (!Array.isArray(object.pattern)) - throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); - message.pattern = []; - for (var i = 0; i < object.pattern.length; ++i) - message.pattern[i] = String(object.pattern[i]); - } - if (object.nameField != null) - message.nameField = String(object.nameField); - switch (object.history) { - default: - if (typeof object.history === "number") { - message.history = object.history; - break; - } - break; - case "HISTORY_UNSPECIFIED": - case 0: - message.history = 0; - break; - case "ORIGINALLY_SINGLE_PATTERN": - case 1: - message.history = 1; - break; - case "FUTURE_MULTI_PATTERN": - case 2: - message.history = 2; - break; - } - if (object.plural != null) - message.plural = String(object.plural); - if (object.singular != null) - message.singular = String(object.singular); - if (object.style) { - if (!Array.isArray(object.style)) - throw TypeError(".google.api.ResourceDescriptor.style: array expected"); - message.style = []; - for (var i = 0; i < object.style.length; ++i) - switch (object.style[i]) { - default: - if (typeof object.style[i] === "number") { - message.style[i] = object.style[i]; - break; - } - case "STYLE_UNSPECIFIED": - case 0: - message.style[i] = 0; - break; - case "DECLARATIVE_FRIENDLY": - case 1: - message.style[i] = 1; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.ResourceDescriptor} message ResourceDescriptor - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceDescriptor.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.pattern = []; - object.style = []; - } - if (options.defaults) { - object.type = ""; - object.nameField = ""; - object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; - object.plural = ""; - object.singular = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.pattern && message.pattern.length) { - object.pattern = []; - for (var j = 0; j < message.pattern.length; ++j) - object.pattern[j] = message.pattern[j]; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - object.nameField = message.nameField; - if (message.history != null && message.hasOwnProperty("history")) - object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; - if (message.plural != null && message.hasOwnProperty("plural")) - object.plural = message.plural; - if (message.singular != null && message.hasOwnProperty("singular")) - object.singular = message.singular; - if (message.style && message.style.length) { - object.style = []; - for (var j = 0; j < message.style.length; ++j) - object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; - } - return object; - }; - - /** - * Converts this ResourceDescriptor to JSON. - * @function toJSON - * @memberof google.api.ResourceDescriptor - * @instance - * @returns {Object.} JSON object - */ - ResourceDescriptor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceDescriptor - * @function getTypeUrl - * @memberof google.api.ResourceDescriptor - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ResourceDescriptor"; - }; - - /** - * History enum. - * @name google.api.ResourceDescriptor.History - * @enum {number} - * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value - * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value - * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value - */ - ResourceDescriptor.History = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; - values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; - values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; - return values; - })(); - - /** - * Style enum. - * @name google.api.ResourceDescriptor.Style - * @enum {number} - * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value - * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value - */ - ResourceDescriptor.Style = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; - return values; - })(); - - return ResourceDescriptor; - })(); - - api.ResourceReference = (function() { - - /** - * Properties of a ResourceReference. - * @memberof google.api - * @interface IResourceReference - * @property {string|null} [type] ResourceReference type - * @property {string|null} [childType] ResourceReference childType - */ - - /** - * Constructs a new ResourceReference. - * @memberof google.api - * @classdesc Represents a ResourceReference. - * @implements IResourceReference - * @constructor - * @param {google.api.IResourceReference=} [properties] Properties to set - */ - function ResourceReference(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceReference type. - * @member {string} type - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.type = ""; - - /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.childType = ""; - - /** - * Creates a new ResourceReference instance using the specified properties. - * @function create - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference=} [properties] Properties to set - * @returns {google.api.ResourceReference} ResourceReference instance - */ - ResourceReference.create = function create(properties) { - return new ResourceReference(properties); - }; - - /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @function encode - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceReference.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); - return writer; - }; - - /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceReference message from the specified reader or buffer. - * @function decode - * @memberof google.api.ResourceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceReference} ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceReference.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - message.childType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ResourceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceReference} ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceReference.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceReference message. - * @function verify - * @memberof google.api.ResourceReference - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceReference.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.childType != null && message.hasOwnProperty("childType")) - if (!$util.isString(message.childType)) - return "childType: string expected"; - return null; - }; - - /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ResourceReference - * @static - * @param {Object.} object Plain object - * @returns {google.api.ResourceReference} ResourceReference - */ - ResourceReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceReference) - return object; - var message = new $root.google.api.ResourceReference(); - if (object.type != null) - message.type = String(object.type); - if (object.childType != null) - message.childType = String(object.childType); - return message; - }; - - /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ResourceReference - * @static - * @param {google.api.ResourceReference} message ResourceReference - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceReference.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = ""; - object.childType = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.childType != null && message.hasOwnProperty("childType")) - object.childType = message.childType; - return object; - }; - - /** - * Converts this ResourceReference to JSON. - * @function toJSON - * @memberof google.api.ResourceReference - * @instance - * @returns {Object.} JSON object - */ - ResourceReference.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceReference - * @function getTypeUrl - * @memberof google.api.ResourceReference - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ResourceReference"; - }; - - return ResourceReference; - })(); - - return api; - })(); - - google.protobuf = (function() { - - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - var protobuf = {}; - - protobuf.FileDescriptorSet = (function() { - - /** - * Properties of a FileDescriptorSet. - * @memberof google.protobuf - * @interface IFileDescriptorSet - * @property {Array.|null} [file] FileDescriptorSet file - */ - - /** - * Constructs a new FileDescriptorSet. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorSet. - * @implements IFileDescriptorSet - * @constructor - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - */ - function FileDescriptorSet(properties) { - this.file = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorSet file. - * @member {Array.} file - * @memberof google.protobuf.FileDescriptorSet - * @instance - */ - FileDescriptorSet.prototype.file = $util.emptyArray; - - /** - * Creates a new FileDescriptorSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance - */ - FileDescriptorSet.create = function create(properties) { - return new FileDescriptorSet(properties); - }; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.file != null && message.file.length) - for (var i = 0; i < message.file.length; ++i) - $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.file && message.file.length)) - message.file = []; - message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorSet message. - * @function verify - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.file != null && message.hasOwnProperty("file")) { - if (!Array.isArray(message.file)) - return "file: array expected"; - for (var i = 0; i < message.file.length; ++i) { - var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); - if (error) - return "file." + error; - } - } - return null; - }; - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - */ - FileDescriptorSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorSet) - return object; - var message = new $root.google.protobuf.FileDescriptorSet(); - if (object.file) { - if (!Array.isArray(object.file)) - throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); - message.file = []; - for (var i = 0; i < object.file.length; ++i) { - if (typeof object.file[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); - message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.file = []; - if (message.file && message.file.length) { - object.file = []; - for (var j = 0; j < message.file.length; ++j) - object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); - } - return object; - }; - - /** - * Converts this FileDescriptorSet to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorSet - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorSet - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; - }; - - return FileDescriptorSet; - })(); - - /** - * Edition enum. - * @name google.protobuf.Edition - * @enum {number} - * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value - * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value - * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value - * @property {number} EDITION_2023=1000 EDITION_2023 value - * @property {number} EDITION_2024=1001 EDITION_2024 value - * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value - * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value - * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value - * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value - * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value - * @property {number} EDITION_MAX=2147483647 EDITION_MAX value - */ - protobuf.Edition = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EDITION_UNKNOWN"] = 0; - values[valuesById[998] = "EDITION_PROTO2"] = 998; - values[valuesById[999] = "EDITION_PROTO3"] = 999; - values[valuesById[1000] = "EDITION_2023"] = 1000; - values[valuesById[1001] = "EDITION_2024"] = 1001; - values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; - values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; - values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; - values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; - values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; - values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; - return values; - })(); - - protobuf.FileDescriptorProto = (function() { - - /** - * Properties of a FileDescriptorProto. - * @memberof google.protobuf - * @interface IFileDescriptorProto - * @property {string|null} [name] FileDescriptorProto name - * @property {string|null} ["package"] FileDescriptorProto package - * @property {Array.|null} [dependency] FileDescriptorProto dependency - * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency - * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency - * @property {Array.|null} [messageType] FileDescriptorProto messageType - * @property {Array.|null} [enumType] FileDescriptorProto enumType - * @property {Array.|null} [service] FileDescriptorProto service - * @property {Array.|null} [extension] FileDescriptorProto extension - * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options - * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo - * @property {string|null} [syntax] FileDescriptorProto syntax - * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition - */ - - /** - * Constructs a new FileDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorProto. - * @implements IFileDescriptorProto - * @constructor - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - */ - function FileDescriptorProto(properties) { - this.dependency = []; - this.publicDependency = []; - this.weakDependency = []; - this.messageType = []; - this.enumType = []; - this.service = []; - this.extension = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.name = ""; - - /** - * FileDescriptorProto package. - * @member {string} package - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype["package"] = ""; - - /** - * FileDescriptorProto dependency. - * @member {Array.} dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.dependency = $util.emptyArray; - - /** - * FileDescriptorProto publicDependency. - * @member {Array.} publicDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.publicDependency = $util.emptyArray; - - /** - * FileDescriptorProto weakDependency. - * @member {Array.} weakDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.weakDependency = $util.emptyArray; - - /** - * FileDescriptorProto messageType. - * @member {Array.} messageType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.messageType = $util.emptyArray; - - /** - * FileDescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * FileDescriptorProto service. - * @member {Array.} service - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.service = $util.emptyArray; - - /** - * FileDescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.extension = $util.emptyArray; - - /** - * FileDescriptorProto options. - * @member {google.protobuf.IFileOptions|null|undefined} options - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.options = null; - - /** - * FileDescriptorProto sourceCodeInfo. - * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.sourceCodeInfo = null; - - /** - * FileDescriptorProto syntax. - * @member {string} syntax - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.syntax = ""; - - /** - * FileDescriptorProto edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.edition = 0; - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance - */ - FileDescriptorProto.create = function create(properties) { - return new FileDescriptorProto(properties); - }; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); - if (message.dependency != null && message.dependency.length) - for (var i = 0; i < message.dependency.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); - if (message.messageType != null && message.messageType.length) - for (var i = 0; i < message.messageType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.service != null && message.service.length) - for (var i = 0; i < message.service.length; ++i) - $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) - $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.publicDependency != null && message.publicDependency.length) - for (var i = 0; i < message.publicDependency.length; ++i) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); - if (message.weakDependency != null && message.weakDependency.length) - for (var i = 0; i < message.weakDependency.length; ++i) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); - if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message["package"] = reader.string(); - break; - } - case 3: { - if (!(message.dependency && message.dependency.length)) - message.dependency = []; - message.dependency.push(reader.string()); - break; - } - case 10: { - if (!(message.publicDependency && message.publicDependency.length)) - message.publicDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.publicDependency.push(reader.int32()); - } else - message.publicDependency.push(reader.int32()); - break; - } - case 11: { - if (!(message.weakDependency && message.weakDependency.length)) - message.weakDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.weakDependency.push(reader.int32()); - } else - message.weakDependency.push(reader.int32()); - break; - } - case 4: { - if (!(message.messageType && message.messageType.length)) - message.messageType = []; - message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.service && message.service.length)) - message.service = []; - message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 7: { - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 8: { - message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); - break; - } - case 12: { - message.syntax = reader.string(); - break; - } - case 14: { - message.edition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorProto message. - * @function verify - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message["package"] != null && message.hasOwnProperty("package")) - if (!$util.isString(message["package"])) - return "package: string expected"; - if (message.dependency != null && message.hasOwnProperty("dependency")) { - if (!Array.isArray(message.dependency)) - return "dependency: array expected"; - for (var i = 0; i < message.dependency.length; ++i) - if (!$util.isString(message.dependency[i])) - return "dependency: string[] expected"; - } - if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { - if (!Array.isArray(message.publicDependency)) - return "publicDependency: array expected"; - for (var i = 0; i < message.publicDependency.length; ++i) - if (!$util.isInteger(message.publicDependency[i])) - return "publicDependency: integer[] expected"; - } - if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { - if (!Array.isArray(message.weakDependency)) - return "weakDependency: array expected"; - for (var i = 0; i < message.weakDependency.length; ++i) - if (!$util.isInteger(message.weakDependency[i])) - return "weakDependency: integer[] expected"; - } - if (message.messageType != null && message.hasOwnProperty("messageType")) { - if (!Array.isArray(message.messageType)) - return "messageType: array expected"; - for (var i = 0; i < message.messageType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); - if (error) - return "messageType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.service != null && message.hasOwnProperty("service")) { - if (!Array.isArray(message.service)) - return "service: array expected"; - for (var i = 0; i < message.service.length; ++i) { - var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); - if (error) - return "service." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FileOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { - var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); - if (error) - return "sourceCodeInfo." + error; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - if (!$util.isString(message.syntax)) - return "syntax: string expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - */ - FileDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorProto) - return object; - var message = new $root.google.protobuf.FileDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object["package"] != null) - message["package"] = String(object["package"]); - if (object.dependency) { - if (!Array.isArray(object.dependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); - message.dependency = []; - for (var i = 0; i < object.dependency.length; ++i) - message.dependency[i] = String(object.dependency[i]); - } - if (object.publicDependency) { - if (!Array.isArray(object.publicDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); - message.publicDependency = []; - for (var i = 0; i < object.publicDependency.length; ++i) - message.publicDependency[i] = object.publicDependency[i] | 0; - } - if (object.weakDependency) { - if (!Array.isArray(object.weakDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); - message.weakDependency = []; - for (var i = 0; i < object.weakDependency.length; ++i) - message.weakDependency[i] = object.weakDependency[i] | 0; - } - if (object.messageType) { - if (!Array.isArray(object.messageType)) - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); - message.messageType = []; - for (var i = 0; i < object.messageType.length; ++i) { - if (typeof object.messageType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); - message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.service) { - if (!Array.isArray(object.service)) - throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); - message.service = []; - for (var i = 0; i < object.service.length; ++i) { - if (typeof object.service[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); - message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FileOptions.fromObject(object.options); - } - if (object.sourceCodeInfo != null) { - if (typeof object.sourceCodeInfo !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); - } - if (object.syntax != null) - message.syntax = String(object.syntax); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.dependency = []; - object.messageType = []; - object.enumType = []; - object.service = []; - object.extension = []; - object.publicDependency = []; - object.weakDependency = []; - } - if (options.defaults) { - object.name = ""; - object["package"] = ""; - object.options = null; - object.sourceCodeInfo = null; - object.syntax = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message["package"] != null && message.hasOwnProperty("package")) - object["package"] = message["package"]; - if (message.dependency && message.dependency.length) { - object.dependency = []; - for (var j = 0; j < message.dependency.length; ++j) - object.dependency[j] = message.dependency[j]; - } - if (message.messageType && message.messageType.length) { - object.messageType = []; - for (var j = 0; j < message.messageType.length; ++j) - object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.service && message.service.length) { - object.service = []; - for (var j = 0; j < message.service.length; ++j) - object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) - object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); - if (message.publicDependency && message.publicDependency.length) { - object.publicDependency = []; - for (var j = 0; j < message.publicDependency.length; ++j) - object.publicDependency[j] = message.publicDependency[j]; - } - if (message.weakDependency && message.weakDependency.length) { - object.weakDependency = []; - for (var j = 0; j < message.weakDependency.length; ++j) - object.weakDependency[j] = message.weakDependency[j]; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - object.syntax = message.syntax; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this FileDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; - }; - - return FileDescriptorProto; - })(); - - protobuf.DescriptorProto = (function() { - - /** - * Properties of a DescriptorProto. - * @memberof google.protobuf - * @interface IDescriptorProto - * @property {string|null} [name] DescriptorProto name - * @property {Array.|null} [field] DescriptorProto field - * @property {Array.|null} [extension] DescriptorProto extension - * @property {Array.|null} [nestedType] DescriptorProto nestedType - * @property {Array.|null} [enumType] DescriptorProto enumType - * @property {Array.|null} [extensionRange] DescriptorProto extensionRange - * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl - * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options - * @property {Array.|null} [reservedRange] DescriptorProto reservedRange - * @property {Array.|null} [reservedName] DescriptorProto reservedName - */ - - /** - * Constructs a new DescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a DescriptorProto. - * @implements IDescriptorProto - * @constructor - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - */ - function DescriptorProto(properties) { - this.field = []; - this.extension = []; - this.nestedType = []; - this.enumType = []; - this.extensionRange = []; - this.oneofDecl = []; - this.reservedRange = []; - this.reservedName = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DescriptorProto name. - * @member {string} name - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.name = ""; - - /** - * DescriptorProto field. - * @member {Array.} field - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.field = $util.emptyArray; - - /** - * DescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extension = $util.emptyArray; - - /** - * DescriptorProto nestedType. - * @member {Array.} nestedType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.nestedType = $util.emptyArray; - - /** - * DescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * DescriptorProto extensionRange. - * @member {Array.} extensionRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extensionRange = $util.emptyArray; - - /** - * DescriptorProto oneofDecl. - * @member {Array.} oneofDecl - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.oneofDecl = $util.emptyArray; - - /** - * DescriptorProto options. - * @member {google.protobuf.IMessageOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.options = null; - - /** - * DescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * DescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto} DescriptorProto instance - */ - DescriptorProto.create = function create(properties) { - return new DescriptorProto(properties); - }; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.field != null && message.field.length) - for (var i = 0; i < message.field.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nestedType != null && message.nestedType.length) - for (var i = 0; i < message.nestedType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.extensionRange != null && message.extensionRange.length) - for (var i = 0; i < message.extensionRange.length; ++i) - $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.oneofDecl != null && message.oneofDecl.length) - for (var i = 0; i < message.oneofDecl.length; ++i) - $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); - return writer; - }; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.field && message.field.length)) - message.field = []; - message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.nestedType && message.nestedType.length)) - message.nestedType = []; - message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - } - case 4: { - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.extensionRange && message.extensionRange.length)) - message.extensionRange = []; - message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); - break; - } - case 8: { - if (!(message.oneofDecl && message.oneofDecl.length)) - message.oneofDecl = []; - message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 7: { - message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); - break; - } - case 10: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DescriptorProto message. - * @function verify - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.field != null && message.hasOwnProperty("field")) { - if (!Array.isArray(message.field)) - return "field: array expected"; - for (var i = 0; i < message.field.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); - if (error) - return "field." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.nestedType != null && message.hasOwnProperty("nestedType")) { - if (!Array.isArray(message.nestedType)) - return "nestedType: array expected"; - for (var i = 0; i < message.nestedType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); - if (error) - return "nestedType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { - if (!Array.isArray(message.extensionRange)) - return "extensionRange: array expected"; - for (var i = 0; i < message.extensionRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); - if (error) - return "extensionRange." + error; - } - } - if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { - if (!Array.isArray(message.oneofDecl)) - return "oneofDecl: array expected"; - for (var i = 0; i < message.oneofDecl.length; ++i) { - var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); - if (error) - return "oneofDecl." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MessageOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto} DescriptorProto - */ - DescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto) - return object; - var message = new $root.google.protobuf.DescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.field) { - if (!Array.isArray(object.field)) - throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); - message.field = []; - for (var i = 0; i < object.field.length; ++i) { - if (typeof object.field[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); - message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.nestedType) { - if (!Array.isArray(object.nestedType)) - throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); - message.nestedType = []; - for (var i = 0; i < object.nestedType.length; ++i) { - if (typeof object.nestedType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); - message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.extensionRange) { - if (!Array.isArray(object.extensionRange)) - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); - message.extensionRange = []; - for (var i = 0; i < object.extensionRange.length; ++i) { - if (typeof object.extensionRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); - message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); - } - } - if (object.oneofDecl) { - if (!Array.isArray(object.oneofDecl)) - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); - message.oneofDecl = []; - for (var i = 0; i < object.oneofDecl.length; ++i) { - if (typeof object.oneofDecl[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); - message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.DescriptorProto} message DescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.field = []; - object.nestedType = []; - object.enumType = []; - object.extensionRange = []; - object.extension = []; - object.oneofDecl = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.field && message.field.length) { - object.field = []; - for (var j = 0; j < message.field.length; ++j) - object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); - } - if (message.nestedType && message.nestedType.length) { - object.nestedType = []; - for (var j = 0; j < message.nestedType.length; ++j) - object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.extensionRange && message.extensionRange.length) { - object.extensionRange = []; - for (var j = 0; j < message.extensionRange.length; ++j) - object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); - if (message.oneofDecl && message.oneofDecl.length) { - object.oneofDecl = []; - for (var j = 0; j < message.oneofDecl.length; ++j) - object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); - } - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this DescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto - * @instance - * @returns {Object.} JSON object - */ - DescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto"; - }; - - DescriptorProto.ExtensionRange = (function() { - - /** - * Properties of an ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @interface IExtensionRange - * @property {number|null} [start] ExtensionRange start - * @property {number|null} [end] ExtensionRange end - * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options - */ - - /** - * Constructs a new ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents an ExtensionRange. - * @implements IExtensionRange - * @constructor - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - */ - function ExtensionRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.start = 0; - - /** - * ExtensionRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.end = 0; - - /** - * ExtensionRange options. - * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.options = null; - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance - */ - ExtensionRange.create = function create(properties) { - return new ExtensionRange(properties); - }; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - case 3: { - message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - */ - ExtensionRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); - message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - object.options = null; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ExtensionRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - * @returns {Object.} JSON object - */ - ExtensionRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; - }; - - return ExtensionRange; - })(); - - DescriptorProto.ReservedRange = (function() { - - /** - * Properties of a ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @interface IReservedRange - * @property {number|null} [start] ReservedRange start - * @property {number|null} [end] ReservedRange end - */ - - /** - * Constructs a new ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents a ReservedRange. - * @implements IReservedRange - * @constructor - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - */ - function ReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReservedRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.start = 0; - - /** - * ReservedRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.end = 0; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance - */ - ReservedRange.create = function create(properties) { - return new ReservedRange(properties); - }; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReservedRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - */ - ReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this ReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - * @returns {Object.} JSON object - */ - ReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReservedRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; - }; - - return ReservedRange; - })(); - - return DescriptorProto; - })(); - - protobuf.ExtensionRangeOptions = (function() { - - /** - * Properties of an ExtensionRangeOptions. - * @memberof google.protobuf - * @interface IExtensionRangeOptions - * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption - * @property {Array.|null} [declaration] ExtensionRangeOptions declaration - * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features - * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification - */ - - /** - * Constructs a new ExtensionRangeOptions. - * @memberof google.protobuf - * @classdesc Represents an ExtensionRangeOptions. - * @implements IExtensionRangeOptions - * @constructor - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - */ - function ExtensionRangeOptions(properties) { - this.uninterpretedOption = []; - this.declaration = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRangeOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ExtensionRangeOptions declaration. - * @member {Array.} declaration - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.declaration = $util.emptyArray; - - /** - * ExtensionRangeOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.features = null; - - /** - * ExtensionRangeOptions verification. - * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.verification = 1; - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance - */ - ExtensionRangeOptions.create = function create(properties) { - return new ExtensionRangeOptions(properties); - }; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.declaration != null && message.declaration.length) - for (var i = 0; i < message.declaration.length; ++i) - $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.declaration && message.declaration.length)) - message.declaration = []; - message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); - break; - } - case 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.verification = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRangeOptions message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRangeOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message.declaration != null && message.hasOwnProperty("declaration")) { - if (!Array.isArray(message.declaration)) - return "declaration: array expected"; - for (var i = 0; i < message.declaration.length; ++i) { - var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); - if (error) - return "declaration." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.verification != null && message.hasOwnProperty("verification")) - switch (message.verification) { - default: - return "verification: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - */ - ExtensionRangeOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions(); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object.declaration) { - if (!Array.isArray(object.declaration)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); - message.declaration = []; - for (var i = 0; i < object.declaration.length; ++i) { - if (typeof object.declaration[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); - message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - switch (object.verification) { - case "DECLARATION": - case 0: - message.verification = 0; - break; - default: - if (typeof object.verification === "number") { - message.verification = object.verification; - break; - } - break; - case "UNVERIFIED": - case 1: - message.verification = 1; - break; - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRangeOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.declaration = []; - object.uninterpretedOption = []; - } - if (options.defaults) { - object.verification = options.enums === String ? "UNVERIFIED" : 1; - object.features = null; - } - if (message.declaration && message.declaration.length) { - object.declaration = []; - for (var j = 0; j < message.declaration.length; ++j) - object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); - } - if (message.verification != null && message.hasOwnProperty("verification")) - object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - * @returns {Object.} JSON object - */ - ExtensionRangeOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; - }; - - ExtensionRangeOptions.Declaration = (function() { - - /** - * Properties of a Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @interface IDeclaration - * @property {number|null} [number] Declaration number - * @property {string|null} [fullName] Declaration fullName - * @property {string|null} [type] Declaration type - * @property {boolean|null} [reserved] Declaration reserved - * @property {boolean|null} [repeated] Declaration repeated - */ - - /** - * Constructs a new Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @classdesc Represents a Declaration. - * @implements IDeclaration - * @constructor - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - */ - function Declaration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Declaration number. - * @member {number} number - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.number = 0; - - /** - * Declaration fullName. - * @member {string} fullName - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.fullName = ""; - - /** - * Declaration type. - * @member {string} type - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.type = ""; - - /** - * Declaration reserved. - * @member {boolean} reserved - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.reserved = false; - - /** - * Declaration repeated. - * @member {boolean} repeated - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.repeated = false; - - /** - * Creates a new Declaration instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance - */ - Declaration.create = function create(properties) { - return new Declaration(properties); - }; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); - if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); - if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); - if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); - return writer; - }; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.number = reader.int32(); - break; - } - case 2: { - message.fullName = reader.string(); - break; - } - case 3: { - message.type = reader.string(); - break; - } - case 5: { - message.reserved = reader.bool(); - break; - } - case 6: { - message.repeated = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Declaration message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Declaration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.fullName != null && message.hasOwnProperty("fullName")) - if (!$util.isString(message.fullName)) - return "fullName: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.reserved != null && message.hasOwnProperty("reserved")) - if (typeof message.reserved !== "boolean") - return "reserved: boolean expected"; - if (message.repeated != null && message.hasOwnProperty("repeated")) - if (typeof message.repeated !== "boolean") - return "repeated: boolean expected"; - return null; - }; - - /** - * Creates a Declaration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - */ - Declaration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - if (object.number != null) - message.number = object.number | 0; - if (object.fullName != null) - message.fullName = String(object.fullName); - if (object.type != null) - message.type = String(object.type); - if (object.reserved != null) - message.reserved = Boolean(object.reserved); - if (object.repeated != null) - message.repeated = Boolean(object.repeated); - return message; - }; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Declaration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.number = 0; - object.fullName = ""; - object.type = ""; - object.reserved = false; - object.repeated = false; - } - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.fullName != null && message.hasOwnProperty("fullName")) - object.fullName = message.fullName; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.reserved != null && message.hasOwnProperty("reserved")) - object.reserved = message.reserved; - if (message.repeated != null && message.hasOwnProperty("repeated")) - object.repeated = message.repeated; - return object; - }; - - /** - * Converts this Declaration to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - * @returns {Object.} JSON object - */ - Declaration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Declaration - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; - }; - - return Declaration; - })(); - - /** - * VerificationState enum. - * @name google.protobuf.ExtensionRangeOptions.VerificationState - * @enum {number} - * @property {number} DECLARATION=0 DECLARATION value - * @property {number} UNVERIFIED=1 UNVERIFIED value - */ - ExtensionRangeOptions.VerificationState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DECLARATION"] = 0; - values[valuesById[1] = "UNVERIFIED"] = 1; - return values; - })(); - - return ExtensionRangeOptions; - })(); - - protobuf.FieldDescriptorProto = (function() { - - /** - * Properties of a FieldDescriptorProto. - * @memberof google.protobuf - * @interface IFieldDescriptorProto - * @property {string|null} [name] FieldDescriptorProto name - * @property {number|null} [number] FieldDescriptorProto number - * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label - * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type - * @property {string|null} [typeName] FieldDescriptorProto typeName - * @property {string|null} [extendee] FieldDescriptorProto extendee - * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue - * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex - * @property {string|null} [jsonName] FieldDescriptorProto jsonName - * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options - * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional - */ - - /** - * Constructs a new FieldDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FieldDescriptorProto. - * @implements IFieldDescriptorProto - * @constructor - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - */ - function FieldDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.name = ""; - - /** - * FieldDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.number = 0; - - /** - * FieldDescriptorProto label. - * @member {google.protobuf.FieldDescriptorProto.Label} label - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.label = 1; - - /** - * FieldDescriptorProto type. - * @member {google.protobuf.FieldDescriptorProto.Type} type - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.type = 1; - - /** - * FieldDescriptorProto typeName. - * @member {string} typeName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.typeName = ""; - - /** - * FieldDescriptorProto extendee. - * @member {string} extendee - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.extendee = ""; - - /** - * FieldDescriptorProto defaultValue. - * @member {string} defaultValue - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.defaultValue = ""; - - /** - * FieldDescriptorProto oneofIndex. - * @member {number} oneofIndex - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.oneofIndex = 0; - - /** - * FieldDescriptorProto jsonName. - * @member {string} jsonName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.jsonName = ""; - - /** - * FieldDescriptorProto options. - * @member {google.protobuf.IFieldOptions|null|undefined} options - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.options = null; - - /** - * FieldDescriptorProto proto3Optional. - * @member {boolean} proto3Optional - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.proto3Optional = false; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance - */ - FieldDescriptorProto.create = function create(properties) { - return new FieldDescriptorProto(properties); - }; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && Object.hasOwnProperty.call(message, "label")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); - if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); - if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); - if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); - return writer; - }; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.number = reader.int32(); - break; - } - case 4: { - message.label = reader.int32(); - break; - } - case 5: { - message.type = reader.int32(); - break; - } - case 6: { - message.typeName = reader.string(); - break; - } - case 2: { - message.extendee = reader.string(); - break; - } - case 7: { - message.defaultValue = reader.string(); - break; - } - case 9: { - message.oneofIndex = reader.int32(); - break; - } - case 10: { - message.jsonName = reader.string(); - break; - } - case 8: { - message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); - break; - } - case 17: { - message.proto3Optional = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldDescriptorProto message. - * @function verify - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.label != null && message.hasOwnProperty("label")) - switch (message.label) { - default: - return "label: enum value expected"; - case 1: - case 3: - case 2: - break; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - break; - } - if (message.typeName != null && message.hasOwnProperty("typeName")) - if (!$util.isString(message.typeName)) - return "typeName: string expected"; - if (message.extendee != null && message.hasOwnProperty("extendee")) - if (!$util.isString(message.extendee)) - return "extendee: string expected"; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - if (!$util.isString(message.defaultValue)) - return "defaultValue: string expected"; - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - if (!$util.isInteger(message.oneofIndex)) - return "oneofIndex: integer expected"; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - if (!$util.isString(message.jsonName)) - return "jsonName: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FieldOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - if (typeof message.proto3Optional !== "boolean") - return "proto3Optional: boolean expected"; - return null; - }; - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - */ - FieldDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldDescriptorProto) - return object; - var message = new $root.google.protobuf.FieldDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - switch (object.label) { - default: - if (typeof object.label === "number") { - message.label = object.label; - break; - } - break; - case "LABEL_OPTIONAL": - case 1: - message.label = 1; - break; - case "LABEL_REPEATED": - case 3: - message.label = 3; - break; - case "LABEL_REQUIRED": - case 2: - message.label = 2; - break; - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_DOUBLE": - case 1: - message.type = 1; - break; - case "TYPE_FLOAT": - case 2: - message.type = 2; - break; - case "TYPE_INT64": - case 3: - message.type = 3; - break; - case "TYPE_UINT64": - case 4: - message.type = 4; - break; - case "TYPE_INT32": - case 5: - message.type = 5; - break; - case "TYPE_FIXED64": - case 6: - message.type = 6; - break; - case "TYPE_FIXED32": - case 7: - message.type = 7; - break; - case "TYPE_BOOL": - case 8: - message.type = 8; - break; - case "TYPE_STRING": - case 9: - message.type = 9; - break; - case "TYPE_GROUP": - case 10: - message.type = 10; - break; - case "TYPE_MESSAGE": - case 11: - message.type = 11; - break; - case "TYPE_BYTES": - case 12: - message.type = 12; - break; - case "TYPE_UINT32": - case 13: - message.type = 13; - break; - case "TYPE_ENUM": - case 14: - message.type = 14; - break; - case "TYPE_SFIXED32": - case 15: - message.type = 15; - break; - case "TYPE_SFIXED64": - case 16: - message.type = 16; - break; - case "TYPE_SINT32": - case 17: - message.type = 17; - break; - case "TYPE_SINT64": - case 18: - message.type = 18; - break; - } - if (object.typeName != null) - message.typeName = String(object.typeName); - if (object.extendee != null) - message.extendee = String(object.extendee); - if (object.defaultValue != null) - message.defaultValue = String(object.defaultValue); - if (object.oneofIndex != null) - message.oneofIndex = object.oneofIndex | 0; - if (object.jsonName != null) - message.jsonName = String(object.jsonName); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); - } - if (object.proto3Optional != null) - message.proto3Optional = Boolean(object.proto3Optional); - return message; - }; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.extendee = ""; - object.number = 0; - object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; - object.type = options.enums === String ? "TYPE_DOUBLE" : 1; - object.typeName = ""; - object.defaultValue = ""; - object.options = null; - object.oneofIndex = 0; - object.jsonName = ""; - object.proto3Optional = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.extendee != null && message.hasOwnProperty("extendee")) - object.extendee = message.extendee; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.label != null && message.hasOwnProperty("label")) - object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; - if (message.typeName != null && message.hasOwnProperty("typeName")) - object.typeName = message.typeName; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - object.defaultValue = message.defaultValue; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - object.oneofIndex = message.oneofIndex; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - object.jsonName = message.jsonName; - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - object.proto3Optional = message.proto3Optional; - return object; - }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FieldDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FieldDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; - }; - - /** - * Type enum. - * @name google.protobuf.FieldDescriptorProto.Type - * @enum {number} - * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value - * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value - * @property {number} TYPE_INT64=3 TYPE_INT64 value - * @property {number} TYPE_UINT64=4 TYPE_UINT64 value - * @property {number} TYPE_INT32=5 TYPE_INT32 value - * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value - * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value - * @property {number} TYPE_BOOL=8 TYPE_BOOL value - * @property {number} TYPE_STRING=9 TYPE_STRING value - * @property {number} TYPE_GROUP=10 TYPE_GROUP value - * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value - * @property {number} TYPE_BYTES=12 TYPE_BYTES value - * @property {number} TYPE_UINT32=13 TYPE_UINT32 value - * @property {number} TYPE_ENUM=14 TYPE_ENUM value - * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value - * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value - * @property {number} TYPE_SINT32=17 TYPE_SINT32 value - * @property {number} TYPE_SINT64=18 TYPE_SINT64 value - */ - FieldDescriptorProto.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "TYPE_DOUBLE"] = 1; - values[valuesById[2] = "TYPE_FLOAT"] = 2; - values[valuesById[3] = "TYPE_INT64"] = 3; - values[valuesById[4] = "TYPE_UINT64"] = 4; - values[valuesById[5] = "TYPE_INT32"] = 5; - values[valuesById[6] = "TYPE_FIXED64"] = 6; - values[valuesById[7] = "TYPE_FIXED32"] = 7; - values[valuesById[8] = "TYPE_BOOL"] = 8; - values[valuesById[9] = "TYPE_STRING"] = 9; - values[valuesById[10] = "TYPE_GROUP"] = 10; - values[valuesById[11] = "TYPE_MESSAGE"] = 11; - values[valuesById[12] = "TYPE_BYTES"] = 12; - values[valuesById[13] = "TYPE_UINT32"] = 13; - values[valuesById[14] = "TYPE_ENUM"] = 14; - values[valuesById[15] = "TYPE_SFIXED32"] = 15; - values[valuesById[16] = "TYPE_SFIXED64"] = 16; - values[valuesById[17] = "TYPE_SINT32"] = 17; - values[valuesById[18] = "TYPE_SINT64"] = 18; - return values; - })(); - - /** - * Label enum. - * @name google.protobuf.FieldDescriptorProto.Label - * @enum {number} - * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value - * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value - * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value - */ - FieldDescriptorProto.Label = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "LABEL_OPTIONAL"] = 1; - values[valuesById[3] = "LABEL_REPEATED"] = 3; - values[valuesById[2] = "LABEL_REQUIRED"] = 2; - return values; - })(); - - return FieldDescriptorProto; - })(); - - protobuf.OneofDescriptorProto = (function() { - - /** - * Properties of an OneofDescriptorProto. - * @memberof google.protobuf - * @interface IOneofDescriptorProto - * @property {string|null} [name] OneofDescriptorProto name - * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options - */ - - /** - * Constructs a new OneofDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an OneofDescriptorProto. - * @implements IOneofDescriptorProto - * @constructor - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - */ - function OneofDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.name = ""; - - /** - * OneofDescriptorProto options. - * @member {google.protobuf.IOneofOptions|null|undefined} options - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.options = null; - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance - */ - OneofDescriptorProto.create = function create(properties) { - return new OneofDescriptorProto(properties); - }; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofDescriptorProto message. - * @function verify - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.OneofOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - */ - OneofDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofDescriptorProto) - return object; - var message = new $root.google.protobuf.OneofDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.OneofDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - OneofDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; - }; - - return OneofDescriptorProto; - })(); - - protobuf.EnumDescriptorProto = (function() { - - /** - * Properties of an EnumDescriptorProto. - * @memberof google.protobuf - * @interface IEnumDescriptorProto - * @property {string|null} [name] EnumDescriptorProto name - * @property {Array.|null} [value] EnumDescriptorProto value - * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options - * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange - * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName - */ - - /** - * Constructs a new EnumDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumDescriptorProto. - * @implements IEnumDescriptorProto - * @constructor - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - */ - function EnumDescriptorProto(properties) { - this.value = []; - this.reservedRange = []; - this.reservedName = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.name = ""; - - /** - * EnumDescriptorProto value. - * @member {Array.} value - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.value = $util.emptyArray; - - /** - * EnumDescriptorProto options. - * @member {google.protobuf.IEnumOptions|null|undefined} options - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.options = null; - - /** - * EnumDescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * EnumDescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance - */ - EnumDescriptorProto.create = function create(properties) { - return new EnumDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.value != null && message.value.length) - for (var i = 0; i < message.value.length; ++i) - $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); - return writer; - }; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.value && message.value.length)) - message.value = []; - message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); - break; - } - case 4: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.value != null && message.hasOwnProperty("value")) { - if (!Array.isArray(message.value)) - return "value: array expected"; - for (var i = 0; i < message.value.length; ++i) { - var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); - if (error) - return "value." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - */ - EnumDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.value) { - if (!Array.isArray(object.value)) - throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); - message.value = []; - for (var i = 0; i < object.value.length; ++i) { - if (typeof object.value[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); - message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.value = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.value && message.value.length) { - object.value = []; - for (var j = 0; j < message.value.length; ++j) - object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; - }; - - EnumDescriptorProto.EnumReservedRange = (function() { - - /** - * Properties of an EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @interface IEnumReservedRange - * @property {number|null} [start] EnumReservedRange start - * @property {number|null} [end] EnumReservedRange end - */ - - /** - * Constructs a new EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @classdesc Represents an EnumReservedRange. - * @implements IEnumReservedRange - * @constructor - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - */ - function EnumReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumReservedRange start. - * @member {number} start - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.start = 0; - - /** - * EnumReservedRange end. - * @member {number} end - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.end = 0; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance - */ - EnumReservedRange.create = function create(properties) { - return new EnumReservedRange(properties); - }; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumReservedRange message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - */ - EnumReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this EnumReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - * @returns {Object.} JSON object - */ - EnumReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumReservedRange - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; - }; - - return EnumReservedRange; - })(); - - return EnumDescriptorProto; - })(); - - protobuf.EnumValueDescriptorProto = (function() { - - /** - * Properties of an EnumValueDescriptorProto. - * @memberof google.protobuf - * @interface IEnumValueDescriptorProto - * @property {string|null} [name] EnumValueDescriptorProto name - * @property {number|null} [number] EnumValueDescriptorProto number - * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options - */ - - /** - * Constructs a new EnumValueDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumValueDescriptorProto. - * @implements IEnumValueDescriptorProto - * @constructor - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - */ - function EnumValueDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.name = ""; - - /** - * EnumValueDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.number = 0; - - /** - * EnumValueDescriptorProto options. - * @member {google.protobuf.IEnumValueOptions|null|undefined} options - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.options = null; - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance - */ - EnumValueDescriptorProto.create = function create(properties) { - return new EnumValueDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.number = reader.int32(); - break; - } - case 3: { - message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumValueOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - */ - EnumValueDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumValueDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.number = 0; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumValueDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; - }; - - return EnumValueDescriptorProto; - })(); - - protobuf.ServiceDescriptorProto = (function() { - - /** - * Properties of a ServiceDescriptorProto. - * @memberof google.protobuf - * @interface IServiceDescriptorProto - * @property {string|null} [name] ServiceDescriptorProto name - * @property {Array.|null} [method] ServiceDescriptorProto method - * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options - */ - - /** - * Constructs a new ServiceDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a ServiceDescriptorProto. - * @implements IServiceDescriptorProto - * @constructor - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - */ - function ServiceDescriptorProto(properties) { - this.method = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.name = ""; - - /** - * ServiceDescriptorProto method. - * @member {Array.} method - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.method = $util.emptyArray; - - /** - * ServiceDescriptorProto options. - * @member {google.protobuf.IServiceOptions|null|undefined} options - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.options = null; - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance - */ - ServiceDescriptorProto.create = function create(properties) { - return new ServiceDescriptorProto(properties); - }; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.method != null && message.method.length) - for (var i = 0; i < message.method.length; ++i) - $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.method && message.method.length)) - message.method = []; - message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceDescriptorProto message. - * @function verify - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.method != null && message.hasOwnProperty("method")) { - if (!Array.isArray(message.method)) - return "method: array expected"; - for (var i = 0; i < message.method.length; ++i) { - var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); - if (error) - return "method." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ServiceOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - */ - ServiceDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceDescriptorProto) - return object; - var message = new $root.google.protobuf.ServiceDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.method) { - if (!Array.isArray(object.method)) - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); - message.method = []; - for (var i = 0; i < object.method.length; ++i) { - if (typeof object.method[i] !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); - message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.method = []; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.method && message.method.length) { - object.method = []; - for (var j = 0; j < message.method.length; ++j) - object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - ServiceDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; - }; - - return ServiceDescriptorProto; - })(); - - protobuf.MethodDescriptorProto = (function() { - - /** - * Properties of a MethodDescriptorProto. - * @memberof google.protobuf - * @interface IMethodDescriptorProto - * @property {string|null} [name] MethodDescriptorProto name - * @property {string|null} [inputType] MethodDescriptorProto inputType - * @property {string|null} [outputType] MethodDescriptorProto outputType - * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options - * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming - * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming - */ - - /** - * Constructs a new MethodDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a MethodDescriptorProto. - * @implements IMethodDescriptorProto - * @constructor - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - */ - function MethodDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.name = ""; - - /** - * MethodDescriptorProto inputType. - * @member {string} inputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.inputType = ""; - - /** - * MethodDescriptorProto outputType. - * @member {string} outputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.outputType = ""; - - /** - * MethodDescriptorProto options. - * @member {google.protobuf.IMethodOptions|null|undefined} options - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.options = null; - - /** - * MethodDescriptorProto clientStreaming. - * @member {boolean} clientStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.clientStreaming = false; - - /** - * MethodDescriptorProto serverStreaming. - * @member {boolean} serverStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.serverStreaming = false; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance - */ - MethodDescriptorProto.create = function create(properties) { - return new MethodDescriptorProto(properties); - }; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); - if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); - if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); - return writer; - }; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.inputType = reader.string(); - break; - } - case 3: { - message.outputType = reader.string(); - break; - } - case 4: { - message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); - break; - } - case 5: { - message.clientStreaming = reader.bool(); - break; - } - case 6: { - message.serverStreaming = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodDescriptorProto message. - * @function verify - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.inputType != null && message.hasOwnProperty("inputType")) - if (!$util.isString(message.inputType)) - return "inputType: string expected"; - if (message.outputType != null && message.hasOwnProperty("outputType")) - if (!$util.isString(message.outputType)) - return "outputType: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MethodOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - if (typeof message.clientStreaming !== "boolean") - return "clientStreaming: boolean expected"; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - if (typeof message.serverStreaming !== "boolean") - return "serverStreaming: boolean expected"; - return null; - }; - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - */ - MethodDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodDescriptorProto) - return object; - var message = new $root.google.protobuf.MethodDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.inputType != null) - message.inputType = String(object.inputType); - if (object.outputType != null) - message.outputType = String(object.outputType); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); - } - if (object.clientStreaming != null) - message.clientStreaming = Boolean(object.clientStreaming); - if (object.serverStreaming != null) - message.serverStreaming = Boolean(object.serverStreaming); - return message; - }; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.inputType = ""; - object.outputType = ""; - object.options = null; - object.clientStreaming = false; - object.serverStreaming = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.inputType != null && message.hasOwnProperty("inputType")) - object.inputType = message.inputType; - if (message.outputType != null && message.hasOwnProperty("outputType")) - object.outputType = message.outputType; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - object.clientStreaming = message.clientStreaming; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - object.serverStreaming = message.serverStreaming; - return object; - }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.MethodDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - MethodDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; - }; - - return MethodDescriptorProto; - })(); - - protobuf.FileOptions = (function() { - - /** - * Properties of a FileOptions. - * @memberof google.protobuf - * @interface IFileOptions - * @property {string|null} [javaPackage] FileOptions javaPackage - * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname - * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles - * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash - * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 - * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor - * @property {string|null} [goPackage] FileOptions goPackage - * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices - * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices - * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices - * @property {boolean|null} [deprecated] FileOptions deprecated - * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas - * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix - * @property {string|null} [csharpNamespace] FileOptions csharpNamespace - * @property {string|null} [swiftPrefix] FileOptions swiftPrefix - * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix - * @property {string|null} [phpNamespace] FileOptions phpNamespace - * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace - * @property {string|null} [rubyPackage] FileOptions rubyPackage - * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features - * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption - * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition - */ - - /** - * Constructs a new FileOptions. - * @memberof google.protobuf - * @classdesc Represents a FileOptions. - * @implements IFileOptions - * @constructor - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - */ - function FileOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.resourceDefinition"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileOptions javaPackage. - * @member {string} javaPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaPackage = ""; - - /** - * FileOptions javaOuterClassname. - * @member {string} javaOuterClassname - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaOuterClassname = ""; - - /** - * FileOptions javaMultipleFiles. - * @member {boolean} javaMultipleFiles - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaMultipleFiles = false; - - /** - * FileOptions javaGenerateEqualsAndHash. - * @member {boolean} javaGenerateEqualsAndHash - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenerateEqualsAndHash = false; - - /** - * FileOptions javaStringCheckUtf8. - * @member {boolean} javaStringCheckUtf8 - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaStringCheckUtf8 = false; - - /** - * FileOptions optimizeFor. - * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.optimizeFor = 1; - - /** - * FileOptions goPackage. - * @member {string} goPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.goPackage = ""; - - /** - * FileOptions ccGenericServices. - * @member {boolean} ccGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccGenericServices = false; - - /** - * FileOptions javaGenericServices. - * @member {boolean} javaGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenericServices = false; - - /** - * FileOptions pyGenericServices. - * @member {boolean} pyGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.pyGenericServices = false; - - /** - * FileOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.deprecated = false; - - /** - * FileOptions ccEnableArenas. - * @member {boolean} ccEnableArenas - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccEnableArenas = true; - - /** - * FileOptions objcClassPrefix. - * @member {string} objcClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.objcClassPrefix = ""; - - /** - * FileOptions csharpNamespace. - * @member {string} csharpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.csharpNamespace = ""; - - /** - * FileOptions swiftPrefix. - * @member {string} swiftPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.swiftPrefix = ""; - - /** - * FileOptions phpClassPrefix. - * @member {string} phpClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpClassPrefix = ""; - - /** - * FileOptions phpNamespace. - * @member {string} phpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpNamespace = ""; - - /** - * FileOptions phpMetadataNamespace. - * @member {string} phpMetadataNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpMetadataNamespace = ""; - - /** - * FileOptions rubyPackage. - * @member {string} rubyPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.rubyPackage = ""; - - /** - * FileOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.features = null; - - /** - * FileOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FileOptions .google.api.resourceDefinition. - * @member {Array.} .google.api.resourceDefinition - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; - - /** - * Creates a new FileOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - * @returns {google.protobuf.FileOptions} FileOptions instance - */ - FileOptions.create = function create(properties) { - return new FileOptions(properties); - }; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); - if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); - if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); - if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); - if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); - if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); - if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); - if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) - writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); - if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) - writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) - writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); - if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) - writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); - if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) - writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); - if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) - writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); - if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) - writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); - if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) - writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); - if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) - writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); - if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) - writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); - if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) - writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.javaPackage = reader.string(); - break; - } - case 8: { - message.javaOuterClassname = reader.string(); - break; - } - case 10: { - message.javaMultipleFiles = reader.bool(); - break; - } - case 20: { - message.javaGenerateEqualsAndHash = reader.bool(); - break; - } - case 27: { - message.javaStringCheckUtf8 = reader.bool(); - break; - } - case 9: { - message.optimizeFor = reader.int32(); - break; - } - case 11: { - message.goPackage = reader.string(); - break; - } - case 16: { - message.ccGenericServices = reader.bool(); - break; - } - case 17: { - message.javaGenericServices = reader.bool(); - break; - } - case 18: { - message.pyGenericServices = reader.bool(); - break; - } - case 23: { - message.deprecated = reader.bool(); - break; - } - case 31: { - message.ccEnableArenas = reader.bool(); - break; - } - case 36: { - message.objcClassPrefix = reader.string(); - break; - } - case 37: { - message.csharpNamespace = reader.string(); - break; - } - case 39: { - message.swiftPrefix = reader.string(); - break; - } - case 40: { - message.phpClassPrefix = reader.string(); - break; - } - case 41: { - message.phpNamespace = reader.string(); - break; - } - case 44: { - message.phpMetadataNamespace = reader.string(); - break; - } - case 45: { - message.rubyPackage = reader.string(); - break; - } - case 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1053: { - if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) - message[".google.api.resourceDefinition"] = []; - message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileOptions message. - * @function verify - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - if (!$util.isString(message.javaPackage)) - return "javaPackage: string expected"; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - if (!$util.isString(message.javaOuterClassname)) - return "javaOuterClassname: string expected"; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - if (typeof message.javaMultipleFiles !== "boolean") - return "javaMultipleFiles: boolean expected"; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - if (typeof message.javaGenerateEqualsAndHash !== "boolean") - return "javaGenerateEqualsAndHash: boolean expected"; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - if (typeof message.javaStringCheckUtf8 !== "boolean") - return "javaStringCheckUtf8: boolean expected"; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - switch (message.optimizeFor) { - default: - return "optimizeFor: enum value expected"; - case 1: - case 2: - case 3: - break; - } - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - if (!$util.isString(message.goPackage)) - return "goPackage: string expected"; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - if (typeof message.ccGenericServices !== "boolean") - return "ccGenericServices: boolean expected"; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - if (typeof message.javaGenericServices !== "boolean") - return "javaGenericServices: boolean expected"; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - if (typeof message.pyGenericServices !== "boolean") - return "pyGenericServices: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - if (typeof message.ccEnableArenas !== "boolean") - return "ccEnableArenas: boolean expected"; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - if (!$util.isString(message.objcClassPrefix)) - return "objcClassPrefix: string expected"; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - if (!$util.isString(message.csharpNamespace)) - return "csharpNamespace: string expected"; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - if (!$util.isString(message.swiftPrefix)) - return "swiftPrefix: string expected"; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - if (!$util.isString(message.phpClassPrefix)) - return "phpClassPrefix: string expected"; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - if (!$util.isString(message.phpNamespace)) - return "phpNamespace: string expected"; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - if (!$util.isString(message.phpMetadataNamespace)) - return "phpMetadataNamespace: string expected"; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - if (!$util.isString(message.rubyPackage)) - return "rubyPackage: string expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { - if (!Array.isArray(message[".google.api.resourceDefinition"])) - return ".google.api.resourceDefinition: array expected"; - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); - if (error) - return ".google.api.resourceDefinition." + error; - } - } - return null; - }; - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileOptions} FileOptions - */ - FileOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileOptions) - return object; - var message = new $root.google.protobuf.FileOptions(); - if (object.javaPackage != null) - message.javaPackage = String(object.javaPackage); - if (object.javaOuterClassname != null) - message.javaOuterClassname = String(object.javaOuterClassname); - if (object.javaMultipleFiles != null) - message.javaMultipleFiles = Boolean(object.javaMultipleFiles); - if (object.javaGenerateEqualsAndHash != null) - message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); - if (object.javaStringCheckUtf8 != null) - message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); - switch (object.optimizeFor) { - default: - if (typeof object.optimizeFor === "number") { - message.optimizeFor = object.optimizeFor; - break; - } - break; - case "SPEED": - case 1: - message.optimizeFor = 1; - break; - case "CODE_SIZE": - case 2: - message.optimizeFor = 2; - break; - case "LITE_RUNTIME": - case 3: - message.optimizeFor = 3; - break; - } - if (object.goPackage != null) - message.goPackage = String(object.goPackage); - if (object.ccGenericServices != null) - message.ccGenericServices = Boolean(object.ccGenericServices); - if (object.javaGenericServices != null) - message.javaGenericServices = Boolean(object.javaGenericServices); - if (object.pyGenericServices != null) - message.pyGenericServices = Boolean(object.pyGenericServices); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.ccEnableArenas != null) - message.ccEnableArenas = Boolean(object.ccEnableArenas); - if (object.objcClassPrefix != null) - message.objcClassPrefix = String(object.objcClassPrefix); - if (object.csharpNamespace != null) - message.csharpNamespace = String(object.csharpNamespace); - if (object.swiftPrefix != null) - message.swiftPrefix = String(object.swiftPrefix); - if (object.phpClassPrefix != null) - message.phpClassPrefix = String(object.phpClassPrefix); - if (object.phpNamespace != null) - message.phpNamespace = String(object.phpNamespace); - if (object.phpMetadataNamespace != null) - message.phpMetadataNamespace = String(object.phpMetadataNamespace); - if (object.rubyPackage != null) - message.rubyPackage = String(object.rubyPackage); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FileOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.resourceDefinition"]) { - if (!Array.isArray(object[".google.api.resourceDefinition"])) - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); - message[".google.api.resourceDefinition"] = []; - for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { - if (typeof object[".google.api.resourceDefinition"][i] !== "object") - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); - message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.FileOptions} message FileOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.resourceDefinition"] = []; - } - if (options.defaults) { - object.javaPackage = ""; - object.javaOuterClassname = ""; - object.optimizeFor = options.enums === String ? "SPEED" : 1; - object.javaMultipleFiles = false; - object.goPackage = ""; - object.ccGenericServices = false; - object.javaGenericServices = false; - object.pyGenericServices = false; - object.javaGenerateEqualsAndHash = false; - object.deprecated = false; - object.javaStringCheckUtf8 = false; - object.ccEnableArenas = true; - object.objcClassPrefix = ""; - object.csharpNamespace = ""; - object.swiftPrefix = ""; - object.phpClassPrefix = ""; - object.phpNamespace = ""; - object.phpMetadataNamespace = ""; - object.rubyPackage = ""; - object.features = null; - } - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - object.javaPackage = message.javaPackage; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - object.javaOuterClassname = message.javaOuterClassname; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - object.javaMultipleFiles = message.javaMultipleFiles; - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - object.goPackage = message.goPackage; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - object.ccGenericServices = message.ccGenericServices; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - object.javaGenericServices = message.javaGenericServices; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - object.pyGenericServices = message.pyGenericServices; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - object.javaStringCheckUtf8 = message.javaStringCheckUtf8; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - object.ccEnableArenas = message.ccEnableArenas; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - object.objcClassPrefix = message.objcClassPrefix; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - object.csharpNamespace = message.csharpNamespace; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - object.swiftPrefix = message.swiftPrefix; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - object.phpClassPrefix = message.phpClassPrefix; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - object.phpNamespace = message.phpNamespace; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - object.phpMetadataNamespace = message.phpMetadataNamespace; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - object.rubyPackage = message.rubyPackage; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { - object[".google.api.resourceDefinition"] = []; - for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) - object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); - } - return object; - }; - - /** - * Converts this FileOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FileOptions - * @instance - * @returns {Object.} JSON object - */ - FileOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileOptions - * @function getTypeUrl - * @memberof google.protobuf.FileOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileOptions"; - }; - - /** - * OptimizeMode enum. - * @name google.protobuf.FileOptions.OptimizeMode - * @enum {number} - * @property {number} SPEED=1 SPEED value - * @property {number} CODE_SIZE=2 CODE_SIZE value - * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value - */ - FileOptions.OptimizeMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "SPEED"] = 1; - values[valuesById[2] = "CODE_SIZE"] = 2; - values[valuesById[3] = "LITE_RUNTIME"] = 3; - return values; - })(); - - return FileOptions; - })(); - - protobuf.MessageOptions = (function() { - - /** - * Properties of a MessageOptions. - * @memberof google.protobuf - * @interface IMessageOptions - * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat - * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor - * @property {boolean|null} [deprecated] MessageOptions deprecated - * @property {boolean|null} [mapEntry] MessageOptions mapEntry - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features - * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption - * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource - */ - - /** - * Constructs a new MessageOptions. - * @memberof google.protobuf - * @classdesc Represents a MessageOptions. - * @implements IMessageOptions - * @constructor - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - */ - function MessageOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MessageOptions messageSetWireFormat. - * @member {boolean} messageSetWireFormat - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.messageSetWireFormat = false; - - /** - * MessageOptions noStandardDescriptorAccessor. - * @member {boolean} noStandardDescriptorAccessor - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.noStandardDescriptorAccessor = false; - - /** - * MessageOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecated = false; - - /** - * MessageOptions mapEntry. - * @member {boolean} mapEntry - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.mapEntry = false; - - /** - * MessageOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * MessageOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.features = null; - - /** - * MessageOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * MessageOptions .google.api.resource. - * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".google.api.resource"] = null; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - * @returns {google.protobuf.MessageOptions} MessageOptions instance - */ - MessageOptions.create = function create(properties) { - return new MessageOptions(properties); - }; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); - if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.messageSetWireFormat = reader.bool(); - break; - } - case 2: { - message.noStandardDescriptorAccessor = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 7: { - message.mapEntry = reader.bool(); - break; - } - case 11: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 12: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1053: { - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MessageOptions message. - * @function verify - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MessageOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - if (typeof message.messageSetWireFormat !== "boolean") - return "messageSetWireFormat: boolean expected"; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - if (typeof message.noStandardDescriptorAccessor !== "boolean") - return "noStandardDescriptorAccessor: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - if (typeof message.mapEntry !== "boolean") - return "mapEntry: boolean expected"; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); - if (error) - return ".google.api.resource." + error; - } - return null; - }; - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MessageOptions} MessageOptions - */ - MessageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MessageOptions) - return object; - var message = new $root.google.protobuf.MessageOptions(); - if (object.messageSetWireFormat != null) - message.messageSetWireFormat = Boolean(object.messageSetWireFormat); - if (object.noStandardDescriptorAccessor != null) - message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.mapEntry != null) - message.mapEntry = Boolean(object.mapEntry); - if (object.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MessageOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.resource"] != null) { - if (typeof object[".google.api.resource"] !== "object") - throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); - } - return message; - }; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.MessageOptions} message MessageOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MessageOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.messageSetWireFormat = false; - object.noStandardDescriptorAccessor = false; - object.deprecated = false; - object.mapEntry = false; - object.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - object[".google.api.resource"] = null; - } - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - object.messageSetWireFormat = message.messageSetWireFormat; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - object.mapEntry = message.mapEntry; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) - object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); - return object; - }; - - /** - * Converts this MessageOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MessageOptions - * @instance - * @returns {Object.} JSON object - */ - MessageOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MessageOptions - * @function getTypeUrl - * @memberof google.protobuf.MessageOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MessageOptions"; - }; - - return MessageOptions; - })(); - - protobuf.FieldOptions = (function() { - - /** - * Properties of a FieldOptions. - * @memberof google.protobuf - * @interface IFieldOptions - * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype - * @property {boolean|null} [packed] FieldOptions packed - * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype - * @property {boolean|null} [lazy] FieldOptions lazy - * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy - * @property {boolean|null} [deprecated] FieldOptions deprecated - * @property {boolean|null} [weak] FieldOptions weak - * @property {boolean|null} [debugRedact] FieldOptions debugRedact - * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention - * @property {Array.|null} [targets] FieldOptions targets - * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults - * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features - * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption - * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior - * @property {google.api.IFieldInfo|null} [".google.api.fieldInfo"] FieldOptions .google.api.fieldInfo - * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference - */ - - /** - * Constructs a new FieldOptions. - * @memberof google.protobuf - * @classdesc Represents a FieldOptions. - * @implements IFieldOptions - * @constructor - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - */ - function FieldOptions(properties) { - this.targets = []; - this.editionDefaults = []; - this.uninterpretedOption = []; - this[".google.api.fieldBehavior"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldOptions ctype. - * @member {google.protobuf.FieldOptions.CType} ctype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.ctype = 0; - - /** - * FieldOptions packed. - * @member {boolean} packed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.packed = false; - - /** - * FieldOptions jstype. - * @member {google.protobuf.FieldOptions.JSType} jstype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.jstype = 0; - - /** - * FieldOptions lazy. - * @member {boolean} lazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.lazy = false; - - /** - * FieldOptions unverifiedLazy. - * @member {boolean} unverifiedLazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.unverifiedLazy = false; - - /** - * FieldOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.deprecated = false; - - /** - * FieldOptions weak. - * @member {boolean} weak - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.weak = false; - - /** - * FieldOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.debugRedact = false; - - /** - * FieldOptions retention. - * @member {google.protobuf.FieldOptions.OptionRetention} retention - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.retention = 0; - - /** - * FieldOptions targets. - * @member {Array.} targets - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.targets = $util.emptyArray; - - /** - * FieldOptions editionDefaults. - * @member {Array.} editionDefaults - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.editionDefaults = $util.emptyArray; - - /** - * FieldOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.features = null; - - /** - * FieldOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FieldOptions .google.api.fieldBehavior. - * @member {Array.} .google.api.fieldBehavior - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; - - /** - * FieldOptions .google.api.fieldInfo. - * @member {google.api.IFieldInfo|null|undefined} .google.api.fieldInfo - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.fieldInfo"] = null; - - /** - * FieldOptions .google.api.resourceReference. - * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.resourceReference"] = null; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions} FieldOptions instance - */ - FieldOptions.create = function create(properties) { - return new FieldOptions(properties); - }; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); - if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) - writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); - if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) - writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); - if (message.targets != null && message.targets.length) - for (var i = 0; i < message.targets.length; ++i) - writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); - if (message.editionDefaults != null && message.editionDefaults.length) - for (var i = 0; i < message.editionDefaults.length; ++i) - $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); - if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) - $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); - if (message[".google.api.fieldInfo"] != null && Object.hasOwnProperty.call(message, ".google.api.fieldInfo")) - $root.google.api.FieldInfo.encode(message[".google.api.fieldInfo"], writer.uint32(/* id 291403980, wireType 2 =*/2331231842).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.ctype = reader.int32(); - break; - } - case 2: { - message.packed = reader.bool(); - break; - } - case 6: { - message.jstype = reader.int32(); - break; - } - case 5: { - message.lazy = reader.bool(); - break; - } - case 15: { - message.unverifiedLazy = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 10: { - message.weak = reader.bool(); - break; - } - case 16: { - message.debugRedact = reader.bool(); - break; - } - case 17: { - message.retention = reader.int32(); - break; - } - case 19: { - if (!(message.targets && message.targets.length)) - message.targets = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.targets.push(reader.int32()); - } else - message.targets.push(reader.int32()); - break; - } - case 20: { - if (!(message.editionDefaults && message.editionDefaults.length)) - message.editionDefaults = []; - message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); - break; - } - case 21: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1052: { - if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) - message[".google.api.fieldBehavior"] = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message[".google.api.fieldBehavior"].push(reader.int32()); - } else - message[".google.api.fieldBehavior"].push(reader.int32()); - break; - } - case 291403980: { - message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.decode(reader, reader.uint32()); - break; - } - case 1055: { - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldOptions message. - * @function verify - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ctype != null && message.hasOwnProperty("ctype")) - switch (message.ctype) { - default: - return "ctype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.packed != null && message.hasOwnProperty("packed")) - if (typeof message.packed !== "boolean") - return "packed: boolean expected"; - if (message.jstype != null && message.hasOwnProperty("jstype")) - switch (message.jstype) { - default: - return "jstype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.lazy != null && message.hasOwnProperty("lazy")) - if (typeof message.lazy !== "boolean") - return "lazy: boolean expected"; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - if (typeof message.unverifiedLazy !== "boolean") - return "unverifiedLazy: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.weak != null && message.hasOwnProperty("weak")) - if (typeof message.weak !== "boolean") - return "weak: boolean expected"; - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: boolean expected"; - if (message.retention != null && message.hasOwnProperty("retention")) - switch (message.retention) { - default: - return "retention: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.targets != null && message.hasOwnProperty("targets")) { - if (!Array.isArray(message.targets)) - return "targets: array expected"; - for (var i = 0; i < message.targets.length; ++i) - switch (message.targets[i]) { - default: - return "targets: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } - } - if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { - if (!Array.isArray(message.editionDefaults)) - return "editionDefaults: array expected"; - for (var i = 0; i < message.editionDefaults.length; ++i) { - var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); - if (error) - return "editionDefaults." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { - if (!Array.isArray(message[".google.api.fieldBehavior"])) - return ".google.api.fieldBehavior: array expected"; - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - switch (message[".google.api.fieldBehavior"][i]) { - default: - return ".google.api.fieldBehavior: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - } - if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) { - var error = $root.google.api.FieldInfo.verify(message[".google.api.fieldInfo"]); - if (error) - return ".google.api.fieldInfo." + error; - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { - var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); - if (error) - return ".google.api.resourceReference." + error; - } - return null; - }; - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions} FieldOptions - */ - FieldOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions) - return object; - var message = new $root.google.protobuf.FieldOptions(); - switch (object.ctype) { - default: - if (typeof object.ctype === "number") { - message.ctype = object.ctype; - break; - } - break; - case "STRING": - case 0: - message.ctype = 0; - break; - case "CORD": - case 1: - message.ctype = 1; - break; - case "STRING_PIECE": - case 2: - message.ctype = 2; - break; - } - if (object.packed != null) - message.packed = Boolean(object.packed); - switch (object.jstype) { - default: - if (typeof object.jstype === "number") { - message.jstype = object.jstype; - break; - } - break; - case "JS_NORMAL": - case 0: - message.jstype = 0; - break; - case "JS_STRING": - case 1: - message.jstype = 1; - break; - case "JS_NUMBER": - case 2: - message.jstype = 2; - break; - } - if (object.lazy != null) - message.lazy = Boolean(object.lazy); - if (object.unverifiedLazy != null) - message.unverifiedLazy = Boolean(object.unverifiedLazy); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.weak != null) - message.weak = Boolean(object.weak); - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - switch (object.retention) { - default: - if (typeof object.retention === "number") { - message.retention = object.retention; - break; - } - break; - case "RETENTION_UNKNOWN": - case 0: - message.retention = 0; - break; - case "RETENTION_RUNTIME": - case 1: - message.retention = 1; - break; - case "RETENTION_SOURCE": - case 2: - message.retention = 2; - break; - } - if (object.targets) { - if (!Array.isArray(object.targets)) - throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); - message.targets = []; - for (var i = 0; i < object.targets.length; ++i) - switch (object.targets[i]) { - default: - if (typeof object.targets[i] === "number") { - message.targets[i] = object.targets[i]; - break; - } - case "TARGET_TYPE_UNKNOWN": - case 0: - message.targets[i] = 0; - break; - case "TARGET_TYPE_FILE": - case 1: - message.targets[i] = 1; - break; - case "TARGET_TYPE_EXTENSION_RANGE": - case 2: - message.targets[i] = 2; - break; - case "TARGET_TYPE_MESSAGE": - case 3: - message.targets[i] = 3; - break; - case "TARGET_TYPE_FIELD": - case 4: - message.targets[i] = 4; - break; - case "TARGET_TYPE_ONEOF": - case 5: - message.targets[i] = 5; - break; - case "TARGET_TYPE_ENUM": - case 6: - message.targets[i] = 6; - break; - case "TARGET_TYPE_ENUM_ENTRY": - case 7: - message.targets[i] = 7; - break; - case "TARGET_TYPE_SERVICE": - case 8: - message.targets[i] = 8; - break; - case "TARGET_TYPE_METHOD": - case 9: - message.targets[i] = 9; - break; - } - } - if (object.editionDefaults) { - if (!Array.isArray(object.editionDefaults)) - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); - message.editionDefaults = []; - for (var i = 0; i < object.editionDefaults.length; ++i) { - if (typeof object.editionDefaults[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); - message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FieldOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.fieldBehavior"]) { - if (!Array.isArray(object[".google.api.fieldBehavior"])) - throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); - message[".google.api.fieldBehavior"] = []; - for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) - switch (object[".google.api.fieldBehavior"][i]) { - default: - if (typeof object[".google.api.fieldBehavior"][i] === "number") { - message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; - break; - } - case "FIELD_BEHAVIOR_UNSPECIFIED": - case 0: - message[".google.api.fieldBehavior"][i] = 0; - break; - case "OPTIONAL": - case 1: - message[".google.api.fieldBehavior"][i] = 1; - break; - case "REQUIRED": - case 2: - message[".google.api.fieldBehavior"][i] = 2; - break; - case "OUTPUT_ONLY": - case 3: - message[".google.api.fieldBehavior"][i] = 3; - break; - case "INPUT_ONLY": - case 4: - message[".google.api.fieldBehavior"][i] = 4; - break; - case "IMMUTABLE": - case 5: - message[".google.api.fieldBehavior"][i] = 5; - break; - case "UNORDERED_LIST": - case 6: - message[".google.api.fieldBehavior"][i] = 6; - break; - case "NON_EMPTY_DEFAULT": - case 7: - message[".google.api.fieldBehavior"][i] = 7; - break; - case "IDENTIFIER": - case 8: - message[".google.api.fieldBehavior"][i] = 8; - break; - } - } - if (object[".google.api.fieldInfo"] != null) { - if (typeof object[".google.api.fieldInfo"] !== "object") - throw TypeError(".google.protobuf.FieldOptions..google.api.fieldInfo: object expected"); - message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.fromObject(object[".google.api.fieldInfo"]); - } - if (object[".google.api.resourceReference"] != null) { - if (typeof object[".google.api.resourceReference"] !== "object") - throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); - } - return message; - }; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.FieldOptions} message FieldOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.targets = []; - object.editionDefaults = []; - object.uninterpretedOption = []; - object[".google.api.fieldBehavior"] = []; - } - if (options.defaults) { - object.ctype = options.enums === String ? "STRING" : 0; - object.packed = false; - object.deprecated = false; - object.lazy = false; - object.jstype = options.enums === String ? "JS_NORMAL" : 0; - object.weak = false; - object.unverifiedLazy = false; - object.debugRedact = false; - object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; - object.features = null; - object[".google.api.resourceReference"] = null; - object[".google.api.fieldInfo"] = null; - } - if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; - if (message.packed != null && message.hasOwnProperty("packed")) - object.packed = message.packed; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.lazy != null && message.hasOwnProperty("lazy")) - object.lazy = message.lazy; - if (message.jstype != null && message.hasOwnProperty("jstype")) - object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; - if (message.weak != null && message.hasOwnProperty("weak")) - object.weak = message.weak; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - object.unverifiedLazy = message.unverifiedLazy; - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - if (message.retention != null && message.hasOwnProperty("retention")) - object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; - if (message.targets && message.targets.length) { - object.targets = []; - for (var j = 0; j < message.targets.length; ++j) - object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; - } - if (message.editionDefaults && message.editionDefaults.length) { - object.editionDefaults = []; - for (var j = 0; j < message.editionDefaults.length; ++j) - object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); - } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { - object[".google.api.fieldBehavior"] = []; - for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) - object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) - object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); - if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) - object[".google.api.fieldInfo"] = $root.google.api.FieldInfo.toObject(message[".google.api.fieldInfo"], options); - return object; - }; - - /** - * Converts this FieldOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions - * @instance - * @returns {Object.} JSON object - */ - FieldOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldOptions - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions"; - }; - - /** - * CType enum. - * @name google.protobuf.FieldOptions.CType - * @enum {number} - * @property {number} STRING=0 STRING value - * @property {number} CORD=1 CORD value - * @property {number} STRING_PIECE=2 STRING_PIECE value - */ - FieldOptions.CType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STRING"] = 0; - values[valuesById[1] = "CORD"] = 1; - values[valuesById[2] = "STRING_PIECE"] = 2; - return values; - })(); - - /** - * JSType enum. - * @name google.protobuf.FieldOptions.JSType - * @enum {number} - * @property {number} JS_NORMAL=0 JS_NORMAL value - * @property {number} JS_STRING=1 JS_STRING value - * @property {number} JS_NUMBER=2 JS_NUMBER value - */ - FieldOptions.JSType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JS_NORMAL"] = 0; - values[valuesById[1] = "JS_STRING"] = 1; - values[valuesById[2] = "JS_NUMBER"] = 2; - return values; - })(); - - /** - * OptionRetention enum. - * @name google.protobuf.FieldOptions.OptionRetention - * @enum {number} - * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value - * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value - * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value - */ - FieldOptions.OptionRetention = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; - values[valuesById[1] = "RETENTION_RUNTIME"] = 1; - values[valuesById[2] = "RETENTION_SOURCE"] = 2; - return values; - })(); - - /** - * OptionTargetType enum. - * @name google.protobuf.FieldOptions.OptionTargetType - * @enum {number} - * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value - * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value - * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value - * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value - * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value - * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value - * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value - * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value - * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value - * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value - */ - FieldOptions.OptionTargetType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; - values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; - values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; - values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; - values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; - values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; - values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; - values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; - values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; - return values; - })(); - - FieldOptions.EditionDefault = (function() { - - /** - * Properties of an EditionDefault. - * @memberof google.protobuf.FieldOptions - * @interface IEditionDefault - * @property {google.protobuf.Edition|null} [edition] EditionDefault edition - * @property {string|null} [value] EditionDefault value - */ - - /** - * Constructs a new EditionDefault. - * @memberof google.protobuf.FieldOptions - * @classdesc Represents an EditionDefault. - * @implements IEditionDefault - * @constructor - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - */ - function EditionDefault(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.edition = 0; - - /** - * EditionDefault value. - * @member {string} value - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.value = ""; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance - */ - EditionDefault.create = function create(properties) { - return new EditionDefault(properties); - }; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.value = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EditionDefault message. - * @function verify - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - */ - EditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) - return object; - var message = new $root.google.protobuf.FieldOptions.EditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.value = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this EditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - * @returns {Object.} JSON object - */ - EditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; - }; - - return EditionDefault; - })(); - - return FieldOptions; - })(); - - protobuf.OneofOptions = (function() { - - /** - * Properties of an OneofOptions. - * @memberof google.protobuf - * @interface IOneofOptions - * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features - * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption - */ - - /** - * Constructs a new OneofOptions. - * @memberof google.protobuf - * @classdesc Represents an OneofOptions. - * @implements IOneofOptions - * @constructor - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - */ - function OneofOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.features = null; - - /** - * OneofOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - * @returns {google.protobuf.OneofOptions} OneofOptions instance - */ - OneofOptions.create = function create(properties) { - return new OneofOptions(properties); - }; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofOptions message. - * @function verify - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofOptions} OneofOptions - */ - OneofOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofOptions) - return object; - var message = new $root.google.protobuf.OneofOptions(); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.OneofOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.OneofOptions} message OneofOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) - object.features = null; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this OneofOptions to JSON. - * @function toJSON - * @memberof google.protobuf.OneofOptions - * @instance - * @returns {Object.} JSON object - */ - OneofOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofOptions - * @function getTypeUrl - * @memberof google.protobuf.OneofOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofOptions"; - }; - - return OneofOptions; - })(); - - protobuf.EnumOptions = (function() { - - /** - * Properties of an EnumOptions. - * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allowAlias] EnumOptions allowAlias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features - * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption - */ - - /** - * Constructs a new EnumOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumOptions. - * @implements IEnumOptions - * @constructor - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - */ - function EnumOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumOptions allowAlias. - * @member {boolean} allowAlias - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.allowAlias = false; - - /** - * EnumOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecated = false; - - /** - * EnumOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * EnumOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.features = null; - - /** - * EnumOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumOptions} EnumOptions instance - */ - EnumOptions.create = function create(properties) { - return new EnumOptions(properties); - }; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - message.allowAlias = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 6: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 7: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumOptions message. - * @function verify - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - if (typeof message.allowAlias !== "boolean") - return "allowAlias: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumOptions} EnumOptions - */ - EnumOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumOptions) - return object; - var message = new $root.google.protobuf.EnumOptions(); - if (object.allowAlias != null) - message.allowAlias = Boolean(object.allowAlias); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.EnumOptions} message EnumOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.allowAlias = false; - object.deprecated = false; - object.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - } - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - object.allowAlias = message.allowAlias; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumOptions - * @instance - * @returns {Object.} JSON object - */ - EnumOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumOptions"; - }; - - return EnumOptions; - })(); - - protobuf.EnumValueOptions = (function() { - - /** - * Properties of an EnumValueOptions. - * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features - * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact - * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption - */ - - /** - * Constructs a new EnumValueOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumValueOptions. - * @implements IEnumValueOptions - * @constructor - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - */ - function EnumValueOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.deprecated = false; - - /** - * EnumValueOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.features = null; - - /** - * EnumValueOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.debugRedact = false; - - /** - * EnumValueOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance - */ - EnumValueOptions.create = function create(properties) { - return new EnumValueOptions(properties); - }; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.deprecated = reader.bool(); - break; - } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.debugRedact = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueOptions message. - * @function verify - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - */ - EnumValueOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueOptions) - return object; - var message = new $root.google.protobuf.EnumValueOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.EnumValueOptions} message EnumValueOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object.features = null; - object.debugRedact = false; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumValueOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueOptions - * @instance - * @returns {Object.} JSON object - */ - EnumValueOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; - }; - - return EnumValueOptions; - })(); - - protobuf.ServiceOptions = (function() { - - /** - * Properties of a ServiceOptions. - * @memberof google.protobuf - * @interface IServiceOptions - * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features - * @property {boolean|null} [deprecated] ServiceOptions deprecated - * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption - * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost - * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes - * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion - */ - - /** - * Constructs a new ServiceOptions. - * @memberof google.protobuf - * @classdesc Represents a ServiceOptions. - * @implements IServiceOptions - * @constructor - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - */ - function ServiceOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.features = null; - - /** - * ServiceOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.deprecated = false; - - /** - * ServiceOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ServiceOptions .google.api.defaultHost. - * @member {string} .google.api.defaultHost - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.defaultHost"] = ""; - - /** - * ServiceOptions .google.api.oauthScopes. - * @member {string} .google.api.oauthScopes - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.oauthScopes"] = ""; - - /** - * ServiceOptions .google.api.apiVersion. - * @member {string} .google.api.apiVersion - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.apiVersion"] = ""; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - * @returns {google.protobuf.ServiceOptions} ServiceOptions instance - */ - ServiceOptions.create = function create(properties) { - return new ServiceOptions(properties); - }; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) - writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); - if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) - writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); - if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) - writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); - return writer; - }; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 34: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 33: { - message.deprecated = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1049: { - message[".google.api.defaultHost"] = reader.string(); - break; - } - case 1050: { - message[".google.api.oauthScopes"] = reader.string(); - break; - } - case 525000001: { - message[".google.api.apiVersion"] = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceOptions message. - * @function verify - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - if (!$util.isString(message[".google.api.defaultHost"])) - return ".google.api.defaultHost: string expected"; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - if (!$util.isString(message[".google.api.oauthScopes"])) - return ".google.api.oauthScopes: string expected"; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - if (!$util.isString(message[".google.api.apiVersion"])) - return ".google.api.apiVersion: string expected"; - return null; - }; - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceOptions} ServiceOptions - */ - ServiceOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceOptions) - return object; - var message = new $root.google.protobuf.ServiceOptions(); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.defaultHost"] != null) - message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); - if (object[".google.api.oauthScopes"] != null) - message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); - if (object[".google.api.apiVersion"] != null) - message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); - return message; - }; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.ServiceOptions} message ServiceOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object.features = null; - object[".google.api.defaultHost"] = ""; - object[".google.api.oauthScopes"] = ""; - object[".google.api.apiVersion"] = ""; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; - return object; - }; - - /** - * Converts this ServiceOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceOptions - * @instance - * @returns {Object.} JSON object - */ - ServiceOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceOptions - * @function getTypeUrl - * @memberof google.protobuf.ServiceOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceOptions"; - }; - - return ServiceOptions; - })(); - - protobuf.MethodOptions = (function() { - - /** - * Properties of a MethodOptions. - * @memberof google.protobuf - * @interface IMethodOptions - * @property {boolean|null} [deprecated] MethodOptions deprecated - * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel - * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features - * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption - * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http - * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature - * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo - */ - - /** - * Constructs a new MethodOptions. - * @memberof google.protobuf - * @classdesc Represents a MethodOptions. - * @implements IMethodOptions - * @constructor - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - */ - function MethodOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.methodSignature"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.deprecated = false; - - /** - * MethodOptions idempotencyLevel. - * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.idempotencyLevel = 0; - - /** - * MethodOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.features = null; - - /** - * MethodOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * MethodOptions .google.api.http. - * @member {google.api.IHttpRule|null|undefined} .google.api.http - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.http"] = null; - - /** - * MethodOptions .google.api.methodSignature. - * @member {Array.} .google.api.methodSignature - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; - - /** - * MethodOptions .google.longrunning.operationInfo. - * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.longrunning.operationInfo"] = null; - - /** - * Creates a new MethodOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - * @returns {google.protobuf.MethodOptions} MethodOptions instance - */ - MethodOptions.create = function create(properties) { - return new MethodOptions(properties); - }; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) - writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) - $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); - if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); - if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) - $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 33: { - message.deprecated = reader.bool(); - break; - } - case 34: { - message.idempotencyLevel = reader.int32(); - break; - } - case 35: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 72295728: { - message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); - break; - } - case 1051: { - if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) - message[".google.api.methodSignature"] = []; - message[".google.api.methodSignature"].push(reader.string()); - break; - } - case 1049: { - message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodOptions message. - * @function verify - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - switch (message.idempotencyLevel) { - default: - return "idempotencyLevel: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { - var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); - if (error) - return ".google.api.http." + error; - } - if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { - if (!Array.isArray(message[".google.api.methodSignature"])) - return ".google.api.methodSignature: array expected"; - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - if (!$util.isString(message[".google.api.methodSignature"][i])) - return ".google.api.methodSignature: string[] expected"; - } - if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { - var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); - if (error) - return ".google.longrunning.operationInfo." + error; - } - return null; - }; - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodOptions} MethodOptions - */ - MethodOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodOptions) - return object; - var message = new $root.google.protobuf.MethodOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - switch (object.idempotencyLevel) { - default: - if (typeof object.idempotencyLevel === "number") { - message.idempotencyLevel = object.idempotencyLevel; - break; - } - break; - case "IDEMPOTENCY_UNKNOWN": - case 0: - message.idempotencyLevel = 0; - break; - case "NO_SIDE_EFFECTS": - case 1: - message.idempotencyLevel = 1; - break; - case "IDEMPOTENT": - case 2: - message.idempotencyLevel = 2; - break; - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MethodOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.http"] != null) { - if (typeof object[".google.api.http"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); - message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); - } - if (object[".google.api.methodSignature"]) { - if (!Array.isArray(object[".google.api.methodSignature"])) - throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); - message[".google.api.methodSignature"] = []; - for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) - message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); - } - if (object[".google.longrunning.operationInfo"] != null) { - if (typeof object[".google.longrunning.operationInfo"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); - message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); - } - return message; - }; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.MethodOptions} message MethodOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.methodSignature"] = []; - } - if (options.defaults) { - object.deprecated = false; - object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; - object.features = null; - object[".google.longrunning.operationInfo"] = null; - object[".google.api.http"] = null; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) - object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); - if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { - object[".google.api.methodSignature"] = []; - for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) - object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) - object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); - return object; - }; - - /** - * Converts this MethodOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MethodOptions - * @instance - * @returns {Object.} JSON object - */ - MethodOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodOptions - * @function getTypeUrl - * @memberof google.protobuf.MethodOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodOptions"; - }; - - /** - * IdempotencyLevel enum. - * @name google.protobuf.MethodOptions.IdempotencyLevel - * @enum {number} - * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value - * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value - * @property {number} IDEMPOTENT=2 IDEMPOTENT value - */ - MethodOptions.IdempotencyLevel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; - values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; - values[valuesById[2] = "IDEMPOTENT"] = 2; - return values; - })(); - - return MethodOptions; - })(); - - protobuf.UninterpretedOption = (function() { - - /** - * Properties of an UninterpretedOption. - * @memberof google.protobuf - * @interface IUninterpretedOption - * @property {Array.|null} [name] UninterpretedOption name - * @property {string|null} [identifierValue] UninterpretedOption identifierValue - * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue - * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue - * @property {number|null} [doubleValue] UninterpretedOption doubleValue - * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue - * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue - */ - - /** - * Constructs a new UninterpretedOption. - * @memberof google.protobuf - * @classdesc Represents an UninterpretedOption. - * @implements IUninterpretedOption - * @constructor - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - */ - function UninterpretedOption(properties) { - this.name = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UninterpretedOption name. - * @member {Array.} name - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.name = $util.emptyArray; - - /** - * UninterpretedOption identifierValue. - * @member {string} identifierValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.identifierValue = ""; - - /** - * UninterpretedOption positiveIntValue. - * @member {number|Long} positiveIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * UninterpretedOption negativeIntValue. - * @member {number|Long} negativeIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * UninterpretedOption doubleValue. - * @member {number} doubleValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.doubleValue = 0; - - /** - * UninterpretedOption stringValue. - * @member {Uint8Array} stringValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.stringValue = $util.newBuffer([]); - - /** - * UninterpretedOption aggregateValue. - * @member {string} aggregateValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.aggregateValue = ""; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance - */ - UninterpretedOption.create = function create(properties) { - return new UninterpretedOption(properties); - }; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.name.length) - for (var i = 0; i < message.name.length; ++i) - $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); - if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); - if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); - if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) - writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); - if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); - return writer; - }; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - if (!(message.name && message.name.length)) - message.name = []; - message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); - break; - } - case 3: { - message.identifierValue = reader.string(); - break; - } - case 4: { - message.positiveIntValue = reader.uint64(); - break; - } - case 5: { - message.negativeIntValue = reader.int64(); - break; - } - case 6: { - message.doubleValue = reader.double(); - break; - } - case 7: { - message.stringValue = reader.bytes(); - break; - } - case 8: { - message.aggregateValue = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UninterpretedOption message. - * @function verify - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UninterpretedOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) { - if (!Array.isArray(message.name)) - return "name: array expected"; - for (var i = 0; i < message.name.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); - if (error) - return "name." + error; - } - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - if (!$util.isString(message.identifierValue)) - return "identifierValue: string expected"; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) - return "positiveIntValue: integer|Long expected"; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) - return "negativeIntValue: integer|Long expected"; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - if (typeof message.doubleValue !== "number") - return "doubleValue: number expected"; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) - return "stringValue: buffer expected"; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - if (!$util.isString(message.aggregateValue)) - return "aggregateValue: string expected"; - return null; - }; - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - */ - UninterpretedOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption) - return object; - var message = new $root.google.protobuf.UninterpretedOption(); - if (object.name) { - if (!Array.isArray(object.name)) - throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); - message.name = []; - for (var i = 0; i < object.name.length; ++i) { - if (typeof object.name[i] !== "object") - throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); - message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); - } - } - if (object.identifierValue != null) - message.identifierValue = String(object.identifierValue); - if (object.positiveIntValue != null) - if ($util.Long) - (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; - else if (typeof object.positiveIntValue === "string") - message.positiveIntValue = parseInt(object.positiveIntValue, 10); - else if (typeof object.positiveIntValue === "number") - message.positiveIntValue = object.positiveIntValue; - else if (typeof object.positiveIntValue === "object") - message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); - if (object.negativeIntValue != null) - if ($util.Long) - (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; - else if (typeof object.negativeIntValue === "string") - message.negativeIntValue = parseInt(object.negativeIntValue, 10); - else if (typeof object.negativeIntValue === "number") - message.negativeIntValue = object.negativeIntValue; - else if (typeof object.negativeIntValue === "object") - message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); - if (object.doubleValue != null) - message.doubleValue = Number(object.doubleValue); - if (object.stringValue != null) - if (typeof object.stringValue === "string") - $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); - else if (object.stringValue.length >= 0) - message.stringValue = object.stringValue; - if (object.aggregateValue != null) - message.aggregateValue = String(object.aggregateValue); - return message; - }; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.UninterpretedOption} message UninterpretedOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UninterpretedOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.name = []; - if (options.defaults) { - object.identifierValue = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.positiveIntValue = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.negativeIntValue = options.longs === String ? "0" : 0; - object.doubleValue = 0; - if (options.bytes === String) - object.stringValue = ""; - else { - object.stringValue = []; - if (options.bytes !== Array) - object.stringValue = $util.newBuffer(object.stringValue); - } - object.aggregateValue = ""; - } - if (message.name && message.name.length) { - object.name = []; - for (var j = 0; j < message.name.length; ++j) - object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - object.identifierValue = message.identifierValue; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (typeof message.positiveIntValue === "number") - object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; - else - object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (typeof message.negativeIntValue === "number") - object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; - else - object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - object.aggregateValue = message.aggregateValue; - return object; - }; - - /** - * Converts this UninterpretedOption to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption - * @instance - * @returns {Object.} JSON object - */ - UninterpretedOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UninterpretedOption - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; - }; - - UninterpretedOption.NamePart = (function() { - - /** - * Properties of a NamePart. - * @memberof google.protobuf.UninterpretedOption - * @interface INamePart - * @property {string} namePart NamePart namePart - * @property {boolean} isExtension NamePart isExtension - */ - - /** - * Constructs a new NamePart. - * @memberof google.protobuf.UninterpretedOption - * @classdesc Represents a NamePart. - * @implements INamePart - * @constructor - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - */ - function NamePart(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NamePart namePart. - * @member {string} namePart - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.namePart = ""; - - /** - * NamePart isExtension. - * @member {boolean} isExtension - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.isExtension = false; - - /** - * Creates a new NamePart instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance - */ - NamePart.create = function create(properties) { - return new NamePart(properties); - }; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); - return writer; - }; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.namePart = reader.string(); - break; - } - case 2: { - message.isExtension = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - if (!message.hasOwnProperty("namePart")) - throw $util.ProtocolError("missing required 'namePart'", { instance: message }); - if (!message.hasOwnProperty("isExtension")) - throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); - return message; - }; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NamePart message. - * @function verify - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NamePart.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (!$util.isString(message.namePart)) - return "namePart: string expected"; - if (typeof message.isExtension !== "boolean") - return "isExtension: boolean expected"; - return null; - }; - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - */ - NamePart.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) - return object; - var message = new $root.google.protobuf.UninterpretedOption.NamePart(); - if (object.namePart != null) - message.namePart = String(object.namePart); - if (object.isExtension != null) - message.isExtension = Boolean(object.isExtension); - return message; - }; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NamePart.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.namePart = ""; - object.isExtension = false; - } - if (message.namePart != null && message.hasOwnProperty("namePart")) - object.namePart = message.namePart; - if (message.isExtension != null && message.hasOwnProperty("isExtension")) - object.isExtension = message.isExtension; - return object; - }; - - /** - * Converts this NamePart to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - * @returns {Object.} JSON object - */ - NamePart.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NamePart - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; - }; - - return NamePart; - })(); - - return UninterpretedOption; - })(); - - protobuf.FeatureSet = (function() { - - /** - * Properties of a FeatureSet. - * @memberof google.protobuf - * @interface IFeatureSet - * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence - * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType - * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding - * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation - * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding - * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat - */ - - /** - * Constructs a new FeatureSet. - * @memberof google.protobuf - * @classdesc Represents a FeatureSet. - * @implements IFeatureSet - * @constructor - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - */ - function FeatureSet(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSet fieldPresence. - * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.fieldPresence = 0; - - /** - * FeatureSet enumType. - * @member {google.protobuf.FeatureSet.EnumType} enumType - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.enumType = 0; - - /** - * FeatureSet repeatedFieldEncoding. - * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.repeatedFieldEncoding = 0; - - /** - * FeatureSet utf8Validation. - * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.utf8Validation = 0; - - /** - * FeatureSet messageEncoding. - * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.messageEncoding = 0; - - /** - * FeatureSet jsonFormat. - * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.jsonFormat = 0; - - /** - * Creates a new FeatureSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - * @returns {google.protobuf.FeatureSet} FeatureSet instance - */ - FeatureSet.create = function create(properties) { - return new FeatureSet(properties); - }; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); - if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); - if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); - if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); - if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); - if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); - return writer; - }; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.fieldPresence = reader.int32(); - break; - } - case 2: { - message.enumType = reader.int32(); - break; - } - case 3: { - message.repeatedFieldEncoding = reader.int32(); - break; - } - case 4: { - message.utf8Validation = reader.int32(); - break; - } - case 5: { - message.messageEncoding = reader.int32(); - break; - } - case 6: { - message.jsonFormat = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSet message. - * @function verify - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - switch (message.fieldPresence) { - default: - return "fieldPresence: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.enumType != null && message.hasOwnProperty("enumType")) - switch (message.enumType) { - default: - return "enumType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - switch (message.repeatedFieldEncoding) { - default: - return "repeatedFieldEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - switch (message.utf8Validation) { - default: - return "utf8Validation: enum value expected"; - case 0: - case 2: - case 3: - break; - } - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - switch (message.messageEncoding) { - default: - return "messageEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - switch (message.jsonFormat) { - default: - return "jsonFormat: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSet} FeatureSet - */ - FeatureSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSet) - return object; - var message = new $root.google.protobuf.FeatureSet(); - switch (object.fieldPresence) { - default: - if (typeof object.fieldPresence === "number") { - message.fieldPresence = object.fieldPresence; - break; - } - break; - case "FIELD_PRESENCE_UNKNOWN": - case 0: - message.fieldPresence = 0; - break; - case "EXPLICIT": - case 1: - message.fieldPresence = 1; - break; - case "IMPLICIT": - case 2: - message.fieldPresence = 2; - break; - case "LEGACY_REQUIRED": - case 3: - message.fieldPresence = 3; - break; - } - switch (object.enumType) { - default: - if (typeof object.enumType === "number") { - message.enumType = object.enumType; - break; - } - break; - case "ENUM_TYPE_UNKNOWN": - case 0: - message.enumType = 0; - break; - case "OPEN": - case 1: - message.enumType = 1; - break; - case "CLOSED": - case 2: - message.enumType = 2; - break; - } - switch (object.repeatedFieldEncoding) { - default: - if (typeof object.repeatedFieldEncoding === "number") { - message.repeatedFieldEncoding = object.repeatedFieldEncoding; - break; - } - break; - case "REPEATED_FIELD_ENCODING_UNKNOWN": - case 0: - message.repeatedFieldEncoding = 0; - break; - case "PACKED": - case 1: - message.repeatedFieldEncoding = 1; - break; - case "EXPANDED": - case 2: - message.repeatedFieldEncoding = 2; - break; - } - switch (object.utf8Validation) { - default: - if (typeof object.utf8Validation === "number") { - message.utf8Validation = object.utf8Validation; - break; - } - break; - case "UTF8_VALIDATION_UNKNOWN": - case 0: - message.utf8Validation = 0; - break; - case "VERIFY": - case 2: - message.utf8Validation = 2; - break; - case "NONE": - case 3: - message.utf8Validation = 3; - break; - } - switch (object.messageEncoding) { - default: - if (typeof object.messageEncoding === "number") { - message.messageEncoding = object.messageEncoding; - break; - } - break; - case "MESSAGE_ENCODING_UNKNOWN": - case 0: - message.messageEncoding = 0; - break; - case "LENGTH_PREFIXED": - case 1: - message.messageEncoding = 1; - break; - case "DELIMITED": - case 2: - message.messageEncoding = 2; - break; - } - switch (object.jsonFormat) { - default: - if (typeof object.jsonFormat === "number") { - message.jsonFormat = object.jsonFormat; - break; - } - break; - case "JSON_FORMAT_UNKNOWN": - case 0: - message.jsonFormat = 0; - break; - case "ALLOW": - case 1: - message.jsonFormat = 1; - break; - case "LEGACY_BEST_EFFORT": - case 2: - message.jsonFormat = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.FeatureSet} message FeatureSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; - object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; - object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; - object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; - object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; - object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; - } - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; - if (message.enumType != null && message.hasOwnProperty("enumType")) - object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; - return object; - }; - - /** - * Converts this FeatureSet to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSet - * @instance - * @returns {Object.} JSON object - */ - FeatureSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSet - * @function getTypeUrl - * @memberof google.protobuf.FeatureSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSet"; - }; - - /** - * FieldPresence enum. - * @name google.protobuf.FeatureSet.FieldPresence - * @enum {number} - * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value - * @property {number} EXPLICIT=1 EXPLICIT value - * @property {number} IMPLICIT=2 IMPLICIT value - * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value - */ - FeatureSet.FieldPresence = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; - values[valuesById[1] = "EXPLICIT"] = 1; - values[valuesById[2] = "IMPLICIT"] = 2; - values[valuesById[3] = "LEGACY_REQUIRED"] = 3; - return values; - })(); - - /** - * EnumType enum. - * @name google.protobuf.FeatureSet.EnumType - * @enum {number} - * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value - * @property {number} OPEN=1 OPEN value - * @property {number} CLOSED=2 CLOSED value - */ - FeatureSet.EnumType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "OPEN"] = 1; - values[valuesById[2] = "CLOSED"] = 2; - return values; - })(); - - /** - * RepeatedFieldEncoding enum. - * @name google.protobuf.FeatureSet.RepeatedFieldEncoding - * @enum {number} - * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value - * @property {number} PACKED=1 PACKED value - * @property {number} EXPANDED=2 EXPANDED value - */ - FeatureSet.RepeatedFieldEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "PACKED"] = 1; - values[valuesById[2] = "EXPANDED"] = 2; - return values; - })(); - - /** - * Utf8Validation enum. - * @name google.protobuf.FeatureSet.Utf8Validation - * @enum {number} - * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value - * @property {number} VERIFY=2 VERIFY value - * @property {number} NONE=3 NONE value - */ - FeatureSet.Utf8Validation = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; - values[valuesById[2] = "VERIFY"] = 2; - values[valuesById[3] = "NONE"] = 3; - return values; - })(); - - /** - * MessageEncoding enum. - * @name google.protobuf.FeatureSet.MessageEncoding - * @enum {number} - * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value - * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value - * @property {number} DELIMITED=2 DELIMITED value - */ - FeatureSet.MessageEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "LENGTH_PREFIXED"] = 1; - values[valuesById[2] = "DELIMITED"] = 2; - return values; - })(); - - /** - * JsonFormat enum. - * @name google.protobuf.FeatureSet.JsonFormat - * @enum {number} - * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value - * @property {number} ALLOW=1 ALLOW value - * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value - */ - FeatureSet.JsonFormat = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; - values[valuesById[1] = "ALLOW"] = 1; - values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; - return values; - })(); - - return FeatureSet; - })(); - - protobuf.FeatureSetDefaults = (function() { - - /** - * Properties of a FeatureSetDefaults. - * @memberof google.protobuf - * @interface IFeatureSetDefaults - * @property {Array.|null} [defaults] FeatureSetDefaults defaults - * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition - * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition - */ - - /** - * Constructs a new FeatureSetDefaults. - * @memberof google.protobuf - * @classdesc Represents a FeatureSetDefaults. - * @implements IFeatureSetDefaults - * @constructor - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - */ - function FeatureSetDefaults(properties) { - this.defaults = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSetDefaults defaults. - * @member {Array.} defaults - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.defaults = $util.emptyArray; - - /** - * FeatureSetDefaults minimumEdition. - * @member {google.protobuf.Edition} minimumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.minimumEdition = 0; - - /** - * FeatureSetDefaults maximumEdition. - * @member {google.protobuf.Edition} maximumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.maximumEdition = 0; - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance - */ - FeatureSetDefaults.create = function create(properties) { - return new FeatureSetDefaults(properties); - }; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.defaults != null && message.defaults.length) - for (var i = 0; i < message.defaults.length; ++i) - $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); - if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); - return writer; - }; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.defaults && message.defaults.length)) - message.defaults = []; - message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); - break; - } - case 4: { - message.minimumEdition = reader.int32(); - break; - } - case 5: { - message.maximumEdition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetDefaults message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetDefaults.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.defaults != null && message.hasOwnProperty("defaults")) { - if (!Array.isArray(message.defaults)) - return "defaults: array expected"; - for (var i = 0; i < message.defaults.length; ++i) { - var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); - if (error) - return "defaults." + error; - } - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - switch (message.minimumEdition) { - default: - return "minimumEdition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - switch (message.maximumEdition) { - default: - return "maximumEdition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - */ - FeatureSetDefaults.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults(); - if (object.defaults) { - if (!Array.isArray(object.defaults)) - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); - message.defaults = []; - for (var i = 0; i < object.defaults.length; ++i) { - if (typeof object.defaults[i] !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); - message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); - } - } - switch (object.minimumEdition) { - default: - if (typeof object.minimumEdition === "number") { - message.minimumEdition = object.minimumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.minimumEdition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.minimumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.minimumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.minimumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.minimumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.minimumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.minimumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.minimumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.minimumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.minimumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.minimumEdition = 2147483647; - break; - } - switch (object.maximumEdition) { - default: - if (typeof object.maximumEdition === "number") { - message.maximumEdition = object.maximumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.maximumEdition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.maximumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.maximumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.maximumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.maximumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.maximumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.maximumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.maximumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.maximumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.maximumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.maximumEdition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetDefaults.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.defaults = []; - if (options.defaults) { - object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.defaults && message.defaults.length) { - object.defaults = []; - for (var j = 0; j < message.defaults.length; ++j) - object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; - return object; - }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults - * @instance - * @returns {Object.} JSON object - */ - FeatureSetDefaults.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetDefaults - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; - }; - - FeatureSetDefaults.FeatureSetEditionDefault = (function() { - - /** - * Properties of a FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @interface IFeatureSetEditionDefault - * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition - * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features - */ - - /** - * Constructs a new FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @classdesc Represents a FeatureSetEditionDefault. - * @implements IFeatureSetEditionDefault - * @constructor - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - */ - function FeatureSetEditionDefault(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSetEditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.edition = 0; - - /** - * FeatureSetEditionDefault features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.features = null; - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance - */ - FeatureSetEditionDefault.create = function create(properties) { - return new FeatureSetEditionDefault(properties); - }; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetEditionDefault message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetEditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - return null; - }; - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - */ - FeatureSetEditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetEditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.features = null; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - * @returns {Object.} JSON object - */ - FeatureSetEditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; - }; - - return FeatureSetEditionDefault; - })(); - - return FeatureSetDefaults; - })(); - - protobuf.SourceCodeInfo = (function() { - - /** - * Properties of a SourceCodeInfo. - * @memberof google.protobuf - * @interface ISourceCodeInfo - * @property {Array.|null} [location] SourceCodeInfo location - */ - - /** - * Constructs a new SourceCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a SourceCodeInfo. - * @implements ISourceCodeInfo - * @constructor - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - */ - function SourceCodeInfo(properties) { - this.location = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SourceCodeInfo location. - * @member {Array.} location - * @memberof google.protobuf.SourceCodeInfo - * @instance - */ - SourceCodeInfo.prototype.location = $util.emptyArray; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance - */ - SourceCodeInfo.create = function create(properties) { - return new SourceCodeInfo(properties); - }; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.location != null && message.location.length) - for (var i = 0; i < message.location.length; ++i) - $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.location && message.location.length)) - message.location = []; - message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SourceCodeInfo message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SourceCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) { - if (!Array.isArray(message.location)) - return "location: array expected"; - for (var i = 0; i < message.location.length; ++i) { - var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); - if (error) - return "location." + error; - } - } - return null; - }; - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - */ - SourceCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo) - return object; - var message = new $root.google.protobuf.SourceCodeInfo(); - if (object.location) { - if (!Array.isArray(object.location)) - throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); - message.location = []; - for (var i = 0; i < object.location.length; ++i) { - if (typeof object.location[i] !== "object") - throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); - message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SourceCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.location = []; - if (message.location && message.location.length) { - object.location = []; - for (var j = 0; j < message.location.length; ++j) - object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); - } - return object; - }; - - /** - * Converts this SourceCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo - * @instance - * @returns {Object.} JSON object - */ - SourceCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SourceCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; - }; - - SourceCodeInfo.Location = (function() { - - /** - * Properties of a Location. - * @memberof google.protobuf.SourceCodeInfo - * @interface ILocation - * @property {Array.|null} [path] Location path - * @property {Array.|null} [span] Location span - * @property {string|null} [leadingComments] Location leadingComments - * @property {string|null} [trailingComments] Location trailingComments - * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments - */ - - /** - * Constructs a new Location. - * @memberof google.protobuf.SourceCodeInfo - * @classdesc Represents a Location. - * @implements ILocation - * @constructor - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - */ - function Location(properties) { - this.path = []; - this.span = []; - this.leadingDetachedComments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Location path. - * @member {Array.} path - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.path = $util.emptyArray; - - /** - * Location span. - * @member {Array.} span - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.span = $util.emptyArray; - - /** - * Location leadingComments. - * @member {string} leadingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingComments = ""; - - /** - * Location trailingComments. - * @member {string} trailingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.trailingComments = ""; - - /** - * Location leadingDetachedComments. - * @member {Array.} leadingDetachedComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingDetachedComments = $util.emptyArray; - - /** - * Creates a new Location instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo.Location} Location instance - */ - Location.create = function create(properties) { - return new Location(properties); - }; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.span != null && message.span.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.span.length; ++i) - writer.int32(message.span[i]); - writer.ldelim(); - } - if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); - if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); - return writer; - }; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Location message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - if (!(message.span && message.span.length)) - message.span = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.span.push(reader.int32()); - } else - message.span.push(reader.int32()); - break; - } - case 3: { - message.leadingComments = reader.string(); - break; - } - case 4: { - message.trailingComments = reader.string(); - break; - } - case 6: { - if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) - message.leadingDetachedComments = []; - message.leadingDetachedComments.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Location message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Location.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.span != null && message.hasOwnProperty("span")) { - if (!Array.isArray(message.span)) - return "span: array expected"; - for (var i = 0; i < message.span.length; ++i) - if (!$util.isInteger(message.span[i])) - return "span: integer[] expected"; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - if (!$util.isString(message.leadingComments)) - return "leadingComments: string expected"; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - if (!$util.isString(message.trailingComments)) - return "trailingComments: string expected"; - if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { - if (!Array.isArray(message.leadingDetachedComments)) - return "leadingDetachedComments: array expected"; - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - if (!$util.isString(message.leadingDetachedComments[i])) - return "leadingDetachedComments: string[] expected"; - } - return null; - }; - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo.Location} Location - */ - Location.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) - return object; - var message = new $root.google.protobuf.SourceCodeInfo.Location(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.span) { - if (!Array.isArray(object.span)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); - message.span = []; - for (var i = 0; i < object.span.length; ++i) - message.span[i] = object.span[i] | 0; - } - if (object.leadingComments != null) - message.leadingComments = String(object.leadingComments); - if (object.trailingComments != null) - message.trailingComments = String(object.trailingComments); - if (object.leadingDetachedComments) { - if (!Array.isArray(object.leadingDetachedComments)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); - message.leadingDetachedComments = []; - for (var i = 0; i < object.leadingDetachedComments.length; ++i) - message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); - } - return message; - }; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.Location} message Location - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Location.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.path = []; - object.span = []; - object.leadingDetachedComments = []; - } - if (options.defaults) { - object.leadingComments = ""; - object.trailingComments = ""; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.span && message.span.length) { - object.span = []; - for (var j = 0; j < message.span.length; ++j) - object.span[j] = message.span[j]; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - object.leadingComments = message.leadingComments; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - object.trailingComments = message.trailingComments; - if (message.leadingDetachedComments && message.leadingDetachedComments.length) { - object.leadingDetachedComments = []; - for (var j = 0; j < message.leadingDetachedComments.length; ++j) - object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; - } - return object; - }; - - /** - * Converts this Location to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - * @returns {Object.} JSON object - */ - Location.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Location - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; - }; - - return Location; - })(); - - return SourceCodeInfo; - })(); - - protobuf.GeneratedCodeInfo = (function() { - - /** - * Properties of a GeneratedCodeInfo. - * @memberof google.protobuf - * @interface IGeneratedCodeInfo - * @property {Array.|null} [annotation] GeneratedCodeInfo annotation - */ - - /** - * Constructs a new GeneratedCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a GeneratedCodeInfo. - * @implements IGeneratedCodeInfo - * @constructor - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - */ - function GeneratedCodeInfo(properties) { - this.annotation = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GeneratedCodeInfo annotation. - * @member {Array.} annotation - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - */ - GeneratedCodeInfo.prototype.annotation = $util.emptyArray; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance - */ - GeneratedCodeInfo.create = function create(properties) { - return new GeneratedCodeInfo(properties); - }; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.annotation != null && message.annotation.length) - for (var i = 0; i < message.annotation.length; ++i) - $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.annotation && message.annotation.length)) - message.annotation = []; - message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GeneratedCodeInfo message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GeneratedCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.annotation != null && message.hasOwnProperty("annotation")) { - if (!Array.isArray(message.annotation)) - return "annotation: array expected"; - for (var i = 0; i < message.annotation.length; ++i) { - var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); - if (error) - return "annotation." + error; - } - } - return null; - }; - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - */ - GeneratedCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo(); - if (object.annotation) { - if (!Array.isArray(object.annotation)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); - message.annotation = []; - for (var i = 0; i < object.annotation.length; ++i) { - if (typeof object.annotation[i] !== "object") - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); - message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GeneratedCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.annotation = []; - if (message.annotation && message.annotation.length) { - object.annotation = []; - for (var j = 0; j < message.annotation.length; ++j) - object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); - } - return object; - }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - * @returns {Object.} JSON object - */ - GeneratedCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; - }; - - GeneratedCodeInfo.Annotation = (function() { - - /** - * Properties of an Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @interface IAnnotation - * @property {Array.|null} [path] Annotation path - * @property {string|null} [sourceFile] Annotation sourceFile - * @property {number|null} [begin] Annotation begin - * @property {number|null} [end] Annotation end - * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic - */ - - /** - * Constructs a new Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @classdesc Represents an Annotation. - * @implements IAnnotation - * @constructor - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - */ - function Annotation(properties) { - this.path = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Annotation path. - * @member {Array.} path - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.path = $util.emptyArray; - - /** - * Annotation sourceFile. - * @member {string} sourceFile - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.sourceFile = ""; - - /** - * Annotation begin. - * @member {number} begin - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.begin = 0; - - /** - * Annotation end. - * @member {number} end - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.end = 0; - - /** - * Annotation semantic. - * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.semantic = 0; - - /** - * Creates a new Annotation instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance - */ - Annotation.create = function create(properties) { - return new Annotation(properties); - }; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); - if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); - return writer; - }; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - message.sourceFile = reader.string(); - break; - } - case 3: { - message.begin = reader.int32(); - break; - } - case 4: { - message.end = reader.int32(); - break; - } - case 5: { - message.semantic = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Annotation message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Annotation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - if (!$util.isString(message.sourceFile)) - return "sourceFile: string expected"; - if (message.begin != null && message.hasOwnProperty("begin")) - if (!$util.isInteger(message.begin)) - return "begin: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.semantic != null && message.hasOwnProperty("semantic")) - switch (message.semantic) { - default: - return "semantic: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - */ - Annotation.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.sourceFile != null) - message.sourceFile = String(object.sourceFile); - if (object.begin != null) - message.begin = object.begin | 0; - if (object.end != null) - message.end = object.end | 0; - switch (object.semantic) { - default: - if (typeof object.semantic === "number") { - message.semantic = object.semantic; - break; - } - break; - case "NONE": - case 0: - message.semantic = 0; - break; - case "SET": - case 1: - message.semantic = 1; - break; - case "ALIAS": - case 2: - message.semantic = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Annotation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.path = []; - if (options.defaults) { - object.sourceFile = ""; - object.begin = 0; - object.end = 0; - object.semantic = options.enums === String ? "NONE" : 0; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - object.sourceFile = message.sourceFile; - if (message.begin != null && message.hasOwnProperty("begin")) - object.begin = message.begin; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.semantic != null && message.hasOwnProperty("semantic")) - object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; - return object; - }; - - /** - * Converts this Annotation to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - * @returns {Object.} JSON object - */ - Annotation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Annotation - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; - }; - - /** - * Semantic enum. - * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic - * @enum {number} - * @property {number} NONE=0 NONE value - * @property {number} SET=1 SET value - * @property {number} ALIAS=2 ALIAS value - */ - Annotation.Semantic = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NONE"] = 0; - values[valuesById[1] = "SET"] = 1; - values[valuesById[2] = "ALIAS"] = 2; - return values; - })(); - - return Annotation; - })(); - - return GeneratedCodeInfo; - })(); - - protobuf.Duration = (function() { - - /** - * Properties of a Duration. - * @memberof google.protobuf - * @interface IDuration - * @property {number|Long|null} [seconds] Duration seconds - * @property {number|null} [nanos] Duration nanos - */ - - /** - * Constructs a new Duration. - * @memberof google.protobuf - * @classdesc Represents a Duration. - * @implements IDuration - * @constructor - * @param {google.protobuf.IDuration=} [properties] Properties to set - */ - function Duration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Duration seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Duration nanos. - * @member {number} nanos - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.nanos = 0; - - /** - * Creates a new Duration instance using the specified properties. - * @function create - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration=} [properties] Properties to set - * @returns {google.protobuf.Duration} Duration instance - */ - Duration.create = function create(properties) { - return new Duration(properties); - }; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Duration message. - * @function verify - * @memberof google.protobuf.Duration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Duration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Duration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Duration} Duration - */ - Duration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Duration) - return object; - var message = new $root.google.protobuf.Duration(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.Duration} message Duration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Duration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Duration to JSON. - * @function toJSON - * @memberof google.protobuf.Duration - * @instance - * @returns {Object.} JSON object - */ - Duration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Duration - * @function getTypeUrl - * @memberof google.protobuf.Duration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Duration"; - }; - - return Duration; - })(); - - protobuf.Timestamp = (function() { - - /** - * Properties of a Timestamp. - * @memberof google.protobuf - * @interface ITimestamp - * @property {number|Long|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos - */ - - /** - * Constructs a new Timestamp. - * @memberof google.protobuf - * @classdesc Represents a Timestamp. - * @implements ITimestamp - * @constructor - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - */ - function Timestamp(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Timestamp seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Timestamp nanos. - * @member {number} nanos - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.nanos = 0; - - /** - * Creates a new Timestamp instance using the specified properties. - * @function create - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - * @returns {google.protobuf.Timestamp} Timestamp instance - */ - Timestamp.create = function create(properties) { - return new Timestamp(properties); - }; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Timestamp message. - * @function verify - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Timestamp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Timestamp} Timestamp - */ - Timestamp.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Timestamp) - return object; - var message = new $root.google.protobuf.Timestamp(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.Timestamp} message Timestamp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Timestamp.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Timestamp to JSON. - * @function toJSON - * @memberof google.protobuf.Timestamp - * @instance - * @returns {Object.} JSON object - */ - Timestamp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Timestamp - * @function getTypeUrl - * @memberof google.protobuf.Timestamp - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Timestamp"; - }; - - return Timestamp; - })(); - - protobuf.Any = (function() { - - /** - * Properties of an Any. - * @memberof google.protobuf - * @interface IAny - * @property {string|null} [type_url] Any type_url - * @property {Uint8Array|null} [value] Any value - */ - - /** - * Constructs a new Any. - * @memberof google.protobuf - * @classdesc Represents an Any. - * @implements IAny - * @constructor - * @param {google.protobuf.IAny=} [properties] Properties to set - */ - function Any(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Any type_url. - * @member {string} type_url - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.type_url = ""; - - /** - * Any value. - * @member {Uint8Array} value - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.value = $util.newBuffer([]); - - /** - * Creates a new Any instance using the specified properties. - * @function create - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny=} [properties] Properties to set - * @returns {google.protobuf.Any} Any instance - */ - Any.create = function create(properties) { - return new Any(properties); - }; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Any message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.type_url = reader.string(); - break; - } - case 2: { - message.value = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Any message. - * @function verify - * @memberof google.protobuf.Any - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Any.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type_url != null && message.hasOwnProperty("type_url")) - if (!$util.isString(message.type_url)) - return "type_url: string expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Any - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Any} Any - */ - Any.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Any) - return object; - var message = new $root.google.protobuf.Any(); - if (object.type_url != null) - message.type_url = String(object.type_url); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length >= 0) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.Any} message Any - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Any.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type_url = ""; - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - } - if (message.type_url != null && message.hasOwnProperty("type_url")) - object.type_url = message.type_url; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this Any to JSON. - * @function toJSON - * @memberof google.protobuf.Any - * @instance - * @returns {Object.} JSON object - */ - Any.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Any - * @function getTypeUrl - * @memberof google.protobuf.Any - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Any"; - }; - - return Any; - })(); - - protobuf.Empty = (function() { - - /** - * Properties of an Empty. - * @memberof google.protobuf - * @interface IEmpty - */ - - /** - * Constructs a new Empty. - * @memberof google.protobuf - * @classdesc Represents an Empty. - * @implements IEmpty - * @constructor - * @param {google.protobuf.IEmpty=} [properties] Properties to set - */ - function Empty(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Creates a new Empty instance using the specified properties. - * @function create - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty=} [properties] Properties to set - * @returns {google.protobuf.Empty} Empty instance - */ - Empty.create = function create(properties) { - return new Empty(properties); - }; - - /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Empty.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Empty.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Empty message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Empty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Empty} Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Empty.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Empty message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Empty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Empty} Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Empty.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Empty message. - * @function verify - * @memberof google.protobuf.Empty - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Empty.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Empty - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Empty} Empty - */ - Empty.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Empty) - return object; - return new $root.google.protobuf.Empty(); - }; - - /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.Empty} message Empty - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Empty.toObject = function toObject() { - return {}; - }; - - /** - * Converts this Empty to JSON. - * @function toJSON - * @memberof google.protobuf.Empty - * @instance - * @returns {Object.} JSON object - */ - Empty.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Empty - * @function getTypeUrl - * @memberof google.protobuf.Empty - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Empty"; - }; - - return Empty; - })(); - - protobuf.FieldMask = (function() { - - /** - * Properties of a FieldMask. - * @memberof google.protobuf - * @interface IFieldMask - * @property {Array.|null} [paths] FieldMask paths - */ - - /** - * Constructs a new FieldMask. - * @memberof google.protobuf - * @classdesc Represents a FieldMask. - * @implements IFieldMask - * @constructor - * @param {google.protobuf.IFieldMask=} [properties] Properties to set - */ - function FieldMask(properties) { - this.paths = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldMask paths. - * @member {Array.} paths - * @memberof google.protobuf.FieldMask - * @instance - */ - FieldMask.prototype.paths = $util.emptyArray; - - /** - * Creates a new FieldMask instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask=} [properties] Properties to set - * @returns {google.protobuf.FieldMask} FieldMask instance - */ - FieldMask.create = function create(properties) { - return new FieldMask(properties); - }; - - /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldMask.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.paths != null && message.paths.length) - for (var i = 0; i < message.paths.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); - return writer; - }; - - /** - * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldMask.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldMask message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldMask - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldMask} FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldMask.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.paths && message.paths.length)) - message.paths = []; - message.paths.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldMask message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldMask - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldMask} FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldMask.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldMask message. - * @function verify - * @memberof google.protobuf.FieldMask - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldMask.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.paths != null && message.hasOwnProperty("paths")) { - if (!Array.isArray(message.paths)) - return "paths: array expected"; - for (var i = 0; i < message.paths.length; ++i) - if (!$util.isString(message.paths[i])) - return "paths: string[] expected"; - } - return null; - }; - - /** - * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldMask - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldMask} FieldMask - */ - FieldMask.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldMask) - return object; - var message = new $root.google.protobuf.FieldMask(); - if (object.paths) { - if (!Array.isArray(object.paths)) - throw TypeError(".google.protobuf.FieldMask.paths: array expected"); - message.paths = []; - for (var i = 0; i < object.paths.length; ++i) - message.paths[i] = String(object.paths[i]); - } - return message; - }; - - /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.FieldMask} message FieldMask - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldMask.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.paths = []; - if (message.paths && message.paths.length) { - object.paths = []; - for (var j = 0; j < message.paths.length; ++j) - object.paths[j] = message.paths[j]; - } - return object; - }; - - /** - * Converts this FieldMask to JSON. - * @function toJSON - * @memberof google.protobuf.FieldMask - * @instance - * @returns {Object.} JSON object - */ - FieldMask.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldMask - * @function getTypeUrl - * @memberof google.protobuf.FieldMask - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldMask"; - }; - - return FieldMask; - })(); - - return protobuf; - })(); - - google.type = (function() { - - /** - * Namespace type. - * @memberof google - * @namespace - */ - var type = {}; - - type.Interval = (function() { - - /** - * Properties of an Interval. - * @memberof google.type - * @interface IInterval - * @property {google.protobuf.ITimestamp|null} [startTime] Interval startTime - * @property {google.protobuf.ITimestamp|null} [endTime] Interval endTime - */ - - /** - * Constructs a new Interval. - * @memberof google.type - * @classdesc Represents an Interval. - * @implements IInterval - * @constructor - * @param {google.type.IInterval=} [properties] Properties to set - */ - function Interval(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Interval startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.type.Interval - * @instance - */ - Interval.prototype.startTime = null; - - /** - * Interval endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.type.Interval - * @instance - */ - Interval.prototype.endTime = null; - - /** - * Creates a new Interval instance using the specified properties. - * @function create - * @memberof google.type.Interval - * @static - * @param {google.type.IInterval=} [properties] Properties to set - * @returns {google.type.Interval} Interval instance - */ - Interval.create = function create(properties) { - return new Interval(properties); - }; - - /** - * Encodes the specified Interval message. Does not implicitly {@link google.type.Interval.verify|verify} messages. - * @function encode - * @memberof google.type.Interval - * @static - * @param {google.type.IInterval} message Interval message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Interval.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(); - return writer; - }; - - /** - * Encodes the specified Interval message, length delimited. Does not implicitly {@link google.type.Interval.verify|verify} messages. - * @function encodeDelimited - * @memberof google.type.Interval - * @static - * @param {google.type.IInterval} message Interval message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Interval.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Interval message from the specified reader or buffer. - * @function decode - * @memberof google.type.Interval - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.type.Interval} Interval - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Interval.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Interval(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Interval message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.type.Interval - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.type.Interval} Interval - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Interval.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Interval message. - * @function verify - * @memberof google.type.Interval - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Interval.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - return null; - }; - - /** - * Creates an Interval message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.type.Interval - * @static - * @param {Object.} object Plain object - * @returns {google.type.Interval} Interval - */ - Interval.fromObject = function fromObject(object) { - if (object instanceof $root.google.type.Interval) - return object; - var message = new $root.google.type.Interval(); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.type.Interval.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.type.Interval.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - return message; - }; - - /** - * Creates a plain object from an Interval message. Also converts values to other types if specified. - * @function toObject - * @memberof google.type.Interval - * @static - * @param {google.type.Interval} message Interval - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Interval.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.startTime = null; - object.endTime = null; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - return object; - }; - - /** - * Converts this Interval to JSON. - * @function toJSON - * @memberof google.type.Interval - * @instance - * @returns {Object.} JSON object - */ - Interval.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Interval - * @function getTypeUrl - * @memberof google.type.Interval - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Interval.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.type.Interval"; - }; - - return Interval; - })(); - - return type; - })(); - - google.longrunning = (function() { - - /** - * Namespace longrunning. - * @memberof google - * @namespace - */ - var longrunning = {}; - - longrunning.Operations = (function() { - - /** - * Constructs a new Operations service. - * @memberof google.longrunning - * @classdesc Represents an Operations - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Operations(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; - - /** - * Creates new Operations service using the specified rpc implementation. - * @function create - * @memberof google.longrunning.Operations - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. - */ - Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.longrunning.Operations|listOperations}. - * @memberof google.longrunning.Operations - * @typedef ListOperationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse - */ - - /** - * Calls ListOperations. - * @function listOperations - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object - * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { - return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); - }, "name", { value: "ListOperations" }); - - /** - * Calls ListOperations. - * @function listOperations - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|getOperation}. - * @memberof google.longrunning.Operations - * @typedef GetOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls GetOperation. - * @function getOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object - * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { - return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "GetOperation" }); - - /** - * Calls GetOperation. - * @function getOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|deleteOperation}. - * @memberof google.longrunning.Operations - * @typedef DeleteOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteOperation. - * @function deleteOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object - * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { - return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteOperation" }); - - /** - * Calls DeleteOperation. - * @function deleteOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|cancelOperation}. - * @memberof google.longrunning.Operations - * @typedef CancelOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls CancelOperation. - * @function cancelOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object - * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { - return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "CancelOperation" }); - - /** - * Calls CancelOperation. - * @function cancelOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|waitOperation}. - * @memberof google.longrunning.Operations - * @typedef WaitOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls WaitOperation. - * @function waitOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object - * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { - return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "WaitOperation" }); - - /** - * Calls WaitOperation. - * @function waitOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Operations; - })(); - - longrunning.Operation = (function() { - - /** - * Properties of an Operation. - * @memberof google.longrunning - * @interface IOperation - * @property {string|null} [name] Operation name - * @property {google.protobuf.IAny|null} [metadata] Operation metadata - * @property {boolean|null} [done] Operation done - * @property {google.rpc.IStatus|null} [error] Operation error - * @property {google.protobuf.IAny|null} [response] Operation response - */ - - /** - * Constructs a new Operation. - * @memberof google.longrunning - * @classdesc Represents an Operation. - * @implements IOperation - * @constructor - * @param {google.longrunning.IOperation=} [properties] Properties to set - */ - function Operation(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Operation name. - * @member {string} name - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.name = ""; - - /** - * Operation metadata. - * @member {google.protobuf.IAny|null|undefined} metadata - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.metadata = null; - - /** - * Operation done. - * @member {boolean} done - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.done = false; - - /** - * Operation error. - * @member {google.rpc.IStatus|null|undefined} error - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.error = null; - - /** - * Operation response. - * @member {google.protobuf.IAny|null|undefined} response - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.response = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Operation result. - * @member {"error"|"response"|undefined} result - * @memberof google.longrunning.Operation - * @instance - */ - Object.defineProperty(Operation.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["error", "response"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Operation instance using the specified properties. - * @function create - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation=} [properties] Properties to set - * @returns {google.longrunning.Operation} Operation instance - */ - Operation.create = function create(properties) { - return new Operation(properties); - }; - - /** - * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @function encode - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation} message Operation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Operation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.done != null && Object.hasOwnProperty.call(message, "done")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.response != null && Object.hasOwnProperty.call(message, "response")) - $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation} message Operation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Operation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Operation message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.Operation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.Operation} Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Operation.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - } - case 3: { - message.done = reader.bool(); - break; - } - case 4: { - message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 5: { - message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Operation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.Operation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.Operation} Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Operation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Operation message. - * @function verify - * @memberof google.longrunning.Operation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Operation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.protobuf.Any.verify(message.metadata); - if (error) - return "metadata." + error; - } - if (message.done != null && message.hasOwnProperty("done")) - if (typeof message.done !== "boolean") - return "done: boolean expected"; - if (message.error != null && message.hasOwnProperty("error")) { - properties.result = 1; - { - var error = $root.google.rpc.Status.verify(message.error); - if (error) - return "error." + error; - } - } - if (message.response != null && message.hasOwnProperty("response")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.google.protobuf.Any.verify(message.response); - if (error) - return "response." + error; - } - } - return null; - }; - - /** - * Creates an Operation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.Operation - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.Operation} Operation - */ - Operation.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.Operation) - return object; - var message = new $root.google.longrunning.Operation(); - if (object.name != null) - message.name = String(object.name); - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.longrunning.Operation.metadata: object expected"); - message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); - } - if (object.done != null) - message.done = Boolean(object.done); - if (object.error != null) { - if (typeof object.error !== "object") - throw TypeError(".google.longrunning.Operation.error: object expected"); - message.error = $root.google.rpc.Status.fromObject(object.error); - } - if (object.response != null) { - if (typeof object.response !== "object") - throw TypeError(".google.longrunning.Operation.response: object expected"); - message.response = $root.google.protobuf.Any.fromObject(object.response); - } - return message; - }; - - /** - * Creates a plain object from an Operation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.Operation} message Operation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Operation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.metadata = null; - object.done = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); - if (message.done != null && message.hasOwnProperty("done")) - object.done = message.done; - if (message.error != null && message.hasOwnProperty("error")) { - object.error = $root.google.rpc.Status.toObject(message.error, options); - if (options.oneofs) - object.result = "error"; - } - if (message.response != null && message.hasOwnProperty("response")) { - object.response = $root.google.protobuf.Any.toObject(message.response, options); - if (options.oneofs) - object.result = "response"; - } - return object; - }; - - /** - * Converts this Operation to JSON. - * @function toJSON - * @memberof google.longrunning.Operation - * @instance - * @returns {Object.} JSON object - */ - Operation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Operation - * @function getTypeUrl - * @memberof google.longrunning.Operation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.Operation"; - }; - - return Operation; - })(); - - longrunning.GetOperationRequest = (function() { - - /** - * Properties of a GetOperationRequest. - * @memberof google.longrunning - * @interface IGetOperationRequest - * @property {string|null} [name] GetOperationRequest name - */ - - /** - * Constructs a new GetOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a GetOperationRequest. - * @implements IGetOperationRequest - * @constructor - * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set - */ - function GetOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetOperationRequest name. - * @member {string} name - * @memberof google.longrunning.GetOperationRequest - * @instance - */ - GetOperationRequest.prototype.name = ""; - - /** - * Creates a new GetOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance - */ - GetOperationRequest.create = function create(properties) { - return new GetOperationRequest(properties); - }; - - /** - * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetOperationRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetOperationRequest message. - * @function verify - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - */ - GetOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.GetOperationRequest) - return object; - var message = new $root.google.longrunning.GetOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.GetOperationRequest} message GetOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this GetOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.GetOperationRequest - * @instance - * @returns {Object.} JSON object - */ - GetOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; - }; - - return GetOperationRequest; - })(); - - longrunning.ListOperationsRequest = (function() { - - /** - * Properties of a ListOperationsRequest. - * @memberof google.longrunning - * @interface IListOperationsRequest - * @property {string|null} [name] ListOperationsRequest name - * @property {string|null} [filter] ListOperationsRequest filter - * @property {number|null} [pageSize] ListOperationsRequest pageSize - * @property {string|null} [pageToken] ListOperationsRequest pageToken - */ - - /** - * Constructs a new ListOperationsRequest. - * @memberof google.longrunning - * @classdesc Represents a ListOperationsRequest. - * @implements IListOperationsRequest - * @constructor - * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set - */ - function ListOperationsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListOperationsRequest name. - * @member {string} name - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.name = ""; - - /** - * ListOperationsRequest filter. - * @member {string} filter - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.filter = ""; - - /** - * ListOperationsRequest pageSize. - * @member {number} pageSize - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.pageSize = 0; - - /** - * ListOperationsRequest pageToken. - * @member {string} pageToken - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListOperationsRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance - */ - ListOperationsRequest.create = function create(properties) { - return new ListOperationsRequest(properties); - }; - - /** - * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); - return writer; - }; - - /** - * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 4: { - message.name = reader.string(); - break; - } - case 1: { - message.filter = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListOperationsRequest message. - * @function verify - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListOperationsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - */ - ListOperationsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.ListOperationsRequest) - return object; - var message = new $root.google.longrunning.ListOperationsRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListOperationsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - object.name = ""; - } - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this ListOperationsRequest to JSON. - * @function toJSON - * @memberof google.longrunning.ListOperationsRequest - * @instance - * @returns {Object.} JSON object - */ - ListOperationsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListOperationsRequest - * @function getTypeUrl - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; - }; - - return ListOperationsRequest; - })(); - - longrunning.ListOperationsResponse = (function() { - - /** - * Properties of a ListOperationsResponse. - * @memberof google.longrunning - * @interface IListOperationsResponse - * @property {Array.|null} [operations] ListOperationsResponse operations - * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken - */ - - /** - * Constructs a new ListOperationsResponse. - * @memberof google.longrunning - * @classdesc Represents a ListOperationsResponse. - * @implements IListOperationsResponse - * @constructor - * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set - */ - function ListOperationsResponse(properties) { - this.operations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListOperationsResponse operations. - * @member {Array.} operations - * @memberof google.longrunning.ListOperationsResponse - * @instance - */ - ListOperationsResponse.prototype.operations = $util.emptyArray; - - /** - * ListOperationsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.longrunning.ListOperationsResponse - * @instance - */ - ListOperationsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListOperationsResponse instance using the specified properties. - * @function create - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance - */ - ListOperationsResponse.create = function create(properties) { - return new ListOperationsResponse(properties); - }; - - /** - * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @function encode - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.operations != null && message.operations.length) - for (var i = 0; i < message.operations.length; ++i) - $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.operations && message.operations.length)) - message.operations = []; - message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListOperationsResponse message. - * @function verify - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListOperationsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.operations != null && message.hasOwnProperty("operations")) { - if (!Array.isArray(message.operations)) - return "operations: array expected"; - for (var i = 0; i < message.operations.length; ++i) { - var error = $root.google.longrunning.Operation.verify(message.operations[i]); - if (error) - return "operations." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - */ - ListOperationsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.ListOperationsResponse) - return object; - var message = new $root.google.longrunning.ListOperationsResponse(); - if (object.operations) { - if (!Array.isArray(object.operations)) - throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); - message.operations = []; - for (var i = 0; i < object.operations.length; ++i) { - if (typeof object.operations[i] !== "object") - throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); - message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListOperationsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.operations = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.operations && message.operations.length) { - object.operations = []; - for (var j = 0; j < message.operations.length; ++j) - object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListOperationsResponse to JSON. - * @function toJSON - * @memberof google.longrunning.ListOperationsResponse - * @instance - * @returns {Object.} JSON object - */ - ListOperationsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListOperationsResponse - * @function getTypeUrl - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; - }; - - return ListOperationsResponse; - })(); - - longrunning.CancelOperationRequest = (function() { - - /** - * Properties of a CancelOperationRequest. - * @memberof google.longrunning - * @interface ICancelOperationRequest - * @property {string|null} [name] CancelOperationRequest name - */ - - /** - * Constructs a new CancelOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a CancelOperationRequest. - * @implements ICancelOperationRequest - * @constructor - * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set - */ - function CancelOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CancelOperationRequest name. - * @member {string} name - * @memberof google.longrunning.CancelOperationRequest - * @instance - */ - CancelOperationRequest.prototype.name = ""; - - /** - * Creates a new CancelOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance - */ - CancelOperationRequest.create = function create(properties) { - return new CancelOperationRequest(properties); - }; - - /** - * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelOperationRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CancelOperationRequest message. - * @function verify - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CancelOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - */ - CancelOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.CancelOperationRequest) - return object; - var message = new $root.google.longrunning.CancelOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CancelOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this CancelOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.CancelOperationRequest - * @instance - * @returns {Object.} JSON object - */ - CancelOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CancelOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; - }; - - return CancelOperationRequest; - })(); - - longrunning.DeleteOperationRequest = (function() { - - /** - * Properties of a DeleteOperationRequest. - * @memberof google.longrunning - * @interface IDeleteOperationRequest - * @property {string|null} [name] DeleteOperationRequest name - */ - - /** - * Constructs a new DeleteOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a DeleteOperationRequest. - * @implements IDeleteOperationRequest - * @constructor - * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set - */ - function DeleteOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteOperationRequest name. - * @member {string} name - * @memberof google.longrunning.DeleteOperationRequest - * @instance - */ - DeleteOperationRequest.prototype.name = ""; - - /** - * Creates a new DeleteOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance - */ - DeleteOperationRequest.create = function create(properties) { - return new DeleteOperationRequest(properties); - }; - - /** - * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteOperationRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteOperationRequest message. - * @function verify - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - */ - DeleteOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.DeleteOperationRequest) - return object; - var message = new $root.google.longrunning.DeleteOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this DeleteOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.DeleteOperationRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; - }; - - return DeleteOperationRequest; - })(); - - longrunning.WaitOperationRequest = (function() { - - /** - * Properties of a WaitOperationRequest. - * @memberof google.longrunning - * @interface IWaitOperationRequest - * @property {string|null} [name] WaitOperationRequest name - * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout - */ - - /** - * Constructs a new WaitOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a WaitOperationRequest. - * @implements IWaitOperationRequest - * @constructor - * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set - */ - function WaitOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WaitOperationRequest name. - * @member {string} name - * @memberof google.longrunning.WaitOperationRequest - * @instance - */ - WaitOperationRequest.prototype.name = ""; - - /** - * WaitOperationRequest timeout. - * @member {google.protobuf.IDuration|null|undefined} timeout - * @memberof google.longrunning.WaitOperationRequest - * @instance - */ - WaitOperationRequest.prototype.timeout = null; - - /** - * Creates a new WaitOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance - */ - WaitOperationRequest.create = function create(properties) { - return new WaitOperationRequest(properties); - }; - - /** - * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) - $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitOperationRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WaitOperationRequest message. - * @function verify - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WaitOperationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.timeout != null && message.hasOwnProperty("timeout")) { - var error = $root.google.protobuf.Duration.verify(message.timeout); - if (error) - return "timeout." + error; - } - return null; - }; - - /** - * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - */ - WaitOperationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.WaitOperationRequest) - return object; - var message = new $root.google.longrunning.WaitOperationRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.timeout != null) { - if (typeof object.timeout !== "object") - throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); - message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); - } - return message; - }; - - /** - * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WaitOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.timeout = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.timeout != null && message.hasOwnProperty("timeout")) - object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); - return object; - }; - - /** - * Converts this WaitOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.WaitOperationRequest - * @instance - * @returns {Object.} JSON object - */ - WaitOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WaitOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; - }; - - return WaitOperationRequest; - })(); - - longrunning.OperationInfo = (function() { - - /** - * Properties of an OperationInfo. - * @memberof google.longrunning - * @interface IOperationInfo - * @property {string|null} [responseType] OperationInfo responseType - * @property {string|null} [metadataType] OperationInfo metadataType - */ - - /** - * Constructs a new OperationInfo. - * @memberof google.longrunning - * @classdesc Represents an OperationInfo. - * @implements IOperationInfo - * @constructor - * @param {google.longrunning.IOperationInfo=} [properties] Properties to set - */ - function OperationInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OperationInfo responseType. - * @member {string} responseType - * @memberof google.longrunning.OperationInfo - * @instance - */ - OperationInfo.prototype.responseType = ""; - - /** - * OperationInfo metadataType. - * @member {string} metadataType - * @memberof google.longrunning.OperationInfo - * @instance - */ - OperationInfo.prototype.metadataType = ""; - - /** - * Creates a new OperationInfo instance using the specified properties. - * @function create - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo=} [properties] Properties to set - * @returns {google.longrunning.OperationInfo} OperationInfo instance - */ - OperationInfo.create = function create(properties) { - return new OperationInfo(properties); - }; - - /** - * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @function encode - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); - if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); - return writer; - }; - - /** - * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OperationInfo message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.OperationInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.OperationInfo} OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.responseType = reader.string(); - break; - } - case 2: { - message.metadataType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OperationInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.OperationInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.OperationInfo} OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OperationInfo message. - * @function verify - * @memberof google.longrunning.OperationInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OperationInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.responseType != null && message.hasOwnProperty("responseType")) - if (!$util.isString(message.responseType)) - return "responseType: string expected"; - if (message.metadataType != null && message.hasOwnProperty("metadataType")) - if (!$util.isString(message.metadataType)) - return "metadataType: string expected"; - return null; - }; - - /** - * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.OperationInfo - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.OperationInfo} OperationInfo - */ - OperationInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.OperationInfo) - return object; - var message = new $root.google.longrunning.OperationInfo(); - if (object.responseType != null) - message.responseType = String(object.responseType); - if (object.metadataType != null) - message.metadataType = String(object.metadataType); - return message; - }; - - /** - * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.OperationInfo} message OperationInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OperationInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.responseType = ""; - object.metadataType = ""; - } - if (message.responseType != null && message.hasOwnProperty("responseType")) - object.responseType = message.responseType; - if (message.metadataType != null && message.hasOwnProperty("metadataType")) - object.metadataType = message.metadataType; - return object; - }; - - /** - * Converts this OperationInfo to JSON. - * @function toJSON - * @memberof google.longrunning.OperationInfo - * @instance - * @returns {Object.} JSON object - */ - OperationInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OperationInfo - * @function getTypeUrl - * @memberof google.longrunning.OperationInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.OperationInfo"; - }; - - return OperationInfo; - })(); - - return longrunning; - })(); - - google.rpc = (function() { - - /** - * Namespace rpc. - * @memberof google - * @namespace - */ - var rpc = {}; - - rpc.Status = (function() { - - /** - * Properties of a Status. - * @memberof google.rpc - * @interface IStatus - * @property {number|null} [code] Status code - * @property {string|null} [message] Status message - * @property {Array.|null} [details] Status details - */ - - /** - * Constructs a new Status. - * @memberof google.rpc - * @classdesc Represents a Status. - * @implements IStatus - * @constructor - * @param {google.rpc.IStatus=} [properties] Properties to set - */ - function Status(properties) { - this.details = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Status code. - * @member {number} code - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.code = 0; - - /** - * Status message. - * @member {string} message - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.message = ""; - - /** - * Status details. - * @member {Array.} details - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.details = $util.emptyArray; - - /** - * Creates a new Status instance using the specified properties. - * @function create - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus=} [properties] Properties to set - * @returns {google.rpc.Status} Status instance - */ - Status.create = function create(properties) { - return new Status(properties); - }; - - /** - * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encode - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.code != null && Object.hasOwnProperty.call(message, "code")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); - if (message.details != null && message.details.length) - for (var i = 0; i < message.details.length; ++i) - $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encodeDelimited - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Status message from the specified reader or buffer. - * @function decode - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.code = reader.int32(); - break; - } - case 2: { - message.message = reader.string(); - break; - } - case 3: { - if (!(message.details && message.details.length)) - message.details = []; - message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Status message. - * @function verify - * @memberof google.rpc.Status - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Status.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.code != null && message.hasOwnProperty("code")) - if (!$util.isInteger(message.code)) - return "code: integer expected"; - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - if (message.details != null && message.hasOwnProperty("details")) { - if (!Array.isArray(message.details)) - return "details: array expected"; - for (var i = 0; i < message.details.length; ++i) { - var error = $root.google.protobuf.Any.verify(message.details[i]); - if (error) - return "details." + error; - } - } - return null; - }; - - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.rpc.Status - * @static - * @param {Object.} object Plain object - * @returns {google.rpc.Status} Status - */ - Status.fromObject = function fromObject(object) { - if (object instanceof $root.google.rpc.Status) - return object; - var message = new $root.google.rpc.Status(); - if (object.code != null) - message.code = object.code | 0; - if (object.message != null) - message.message = String(object.message); - if (object.details) { - if (!Array.isArray(object.details)) - throw TypeError(".google.rpc.Status.details: array expected"); - message.details = []; - for (var i = 0; i < object.details.length; ++i) { - if (typeof object.details[i] !== "object") - throw TypeError(".google.rpc.Status.details: object expected"); - message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @function toObject - * @memberof google.rpc.Status - * @static - * @param {google.rpc.Status} message Status - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Status.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.details = []; - if (options.defaults) { - object.code = 0; - object.message = ""; - } - if (message.code != null && message.hasOwnProperty("code")) - object.code = message.code; - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - if (message.details && message.details.length) { - object.details = []; - for (var j = 0; j < message.details.length; ++j) - object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); - } - return object; - }; - - /** - * Converts this Status to JSON. - * @function toJSON - * @memberof google.rpc.Status - * @instance - * @returns {Object.} JSON object - */ - Status.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Status - * @function getTypeUrl - * @memberof google.rpc.Status - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.rpc.Status"; - }; - - return Status; - })(); - - return rpc; - })(); - - return google; - })(); - - return $root; -}); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.json b/owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.json deleted file mode 100644 index 15385d6317b..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/protos/protos.json +++ /dev/null @@ -1,4203 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "cloud": { - "nested": { - "batch": { - "nested": { - "v1alpha": { - "options": { - "csharp_namespace": "Google.Cloud.Batch.V1Alpha", - "go_package": "cloud.google.com/go/batch/apiv1alpha/batchpb;batchpb", - "java_multiple_files": true, - "java_outer_classname": "NotificationProto", - "java_package": "com.google.cloud.batch.v1alpha", - "objc_class_prefix": "GCB", - "php_namespace": "Google\\Cloud\\Batch\\V1alpha", - "ruby_package": "Google::Cloud::Batch::V1alpha" - }, - "nested": { - "BatchService": { - "options": { - "(google.api.default_host)": "batch.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "CreateJob": { - "requestType": "CreateJobRequest", - "responseType": "Job", - "options": { - "(google.api.http).post": "/v1alpha/{parent=projects/*/locations/*}/jobs", - "(google.api.http).body": "job", - "(google.api.method_signature)": "parent,job,job_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1alpha/{parent=projects/*/locations/*}/jobs", - "body": "job" - } - }, - { - "(google.api.method_signature)": "parent,job,job_id" - } - ] - }, - "GetJob": { - "requestType": "GetJobRequest", - "responseType": "Job", - "options": { - "(google.api.http).get": "/v1alpha/{name=projects/*/locations/*/jobs/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1alpha/{name=projects/*/locations/*/jobs/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "DeleteJob": { - "requestType": "DeleteJobRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v1alpha/{name=projects/*/locations/*/jobs/*}", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "google.cloud.batch.v1alpha.OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1alpha/{name=projects/*/locations/*/jobs/*}" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "google.cloud.batch.v1alpha.OperationMetadata" - } - } - ] - }, - "CancelJob": { - "requestType": "CancelJobRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1alpha/{name=projects/*/locations/*/jobs/*}:cancel", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "google.cloud.batch.v1alpha.CancelJobResponse", - "(google.longrunning.operation_info).metadata_type": "google.cloud.batch.v1alpha.OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1alpha/{name=projects/*/locations/*/jobs/*}:cancel", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.cloud.batch.v1alpha.CancelJobResponse", - "metadata_type": "google.cloud.batch.v1alpha.OperationMetadata" - } - } - ] - }, - "UpdateJob": { - "requestType": "UpdateJobRequest", - "responseType": "Job", - "options": { - "(google.api.http).patch": "/v1alpha/{job.name=projects/*/locations/*/jobs/*}", - "(google.api.http).body": "job", - "(google.api.method_signature)": "job,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1alpha/{job.name=projects/*/locations/*/jobs/*}", - "body": "job" - } - }, - { - "(google.api.method_signature)": "job,update_mask" - } - ] - }, - "ListJobs": { - "requestType": "ListJobsRequest", - "responseType": "ListJobsResponse", - "options": { - "(google.api.http).get": "/v1alpha/{parent=projects/*/locations/*}/jobs", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1alpha/{parent=projects/*/locations/*}/jobs" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetTask": { - "requestType": "GetTaskRequest", - "responseType": "Task", - "options": { - "(google.api.http).get": "/v1alpha/{name=projects/*/locations/*/jobs/*/taskGroups/*/tasks/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1alpha/{name=projects/*/locations/*/jobs/*/taskGroups/*/tasks/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListTasks": { - "requestType": "ListTasksRequest", - "responseType": "ListTasksResponse", - "options": { - "(google.api.http).get": "/v1alpha/{parent=projects/*/locations/*/jobs/*/taskGroups/*}/tasks", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1alpha/{parent=projects/*/locations/*/jobs/*/taskGroups/*}/tasks" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "CreateResourceAllowance": { - "requestType": "CreateResourceAllowanceRequest", - "responseType": "ResourceAllowance", - "options": { - "(google.api.http).post": "/v1alpha/{parent=projects/*/locations/*}/resourceAllowances", - "(google.api.http).body": "resource_allowance", - "(google.api.method_signature)": "parent,resource_allowance,resource_allowance_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1alpha/{parent=projects/*/locations/*}/resourceAllowances", - "body": "resource_allowance" - } - }, - { - "(google.api.method_signature)": "parent,resource_allowance,resource_allowance_id" - } - ] - }, - "GetResourceAllowance": { - "requestType": "GetResourceAllowanceRequest", - "responseType": "ResourceAllowance", - "options": { - "(google.api.http).get": "/v1alpha/{name=projects/*/locations/*/resourceAllowances/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1alpha/{name=projects/*/locations/*/resourceAllowances/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "DeleteResourceAllowance": { - "requestType": "DeleteResourceAllowanceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v1alpha/{name=projects/*/locations/*/resourceAllowances/*}", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "google.cloud.batch.v1alpha.OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1alpha/{name=projects/*/locations/*/resourceAllowances/*}" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "google.cloud.batch.v1alpha.OperationMetadata" - } - } - ] - }, - "ListResourceAllowances": { - "requestType": "ListResourceAllowancesRequest", - "responseType": "ListResourceAllowancesResponse", - "options": { - "(google.api.http).get": "/v1alpha/{parent=projects/*/locations/*}/resourceAllowances", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1alpha/{parent=projects/*/locations/*}/resourceAllowances" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "UpdateResourceAllowance": { - "requestType": "UpdateResourceAllowanceRequest", - "responseType": "ResourceAllowance", - "options": { - "(google.api.http).patch": "/v1alpha/{resource_allowance.name=projects/*/locations/*/resourceAllowances/*}", - "(google.api.http).body": "resource_allowance", - "(google.api.method_signature)": "resource_allowance,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1alpha/{resource_allowance.name=projects/*/locations/*/resourceAllowances/*}", - "body": "resource_allowance" - } - }, - { - "(google.api.method_signature)": "resource_allowance,update_mask" - } - ] - } - } - }, - "CreateJobRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "batch.googleapis.com/Job" - } - }, - "jobId": { - "type": "string", - "id": 2 - }, - "job": { - "type": "Job", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GetJobRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "batch.googleapis.com/Job" - } - } - } - }, - "DeleteJobRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "reason": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CancelJobRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "batch.googleapis.com/Job" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CancelJobResponse": { - "fields": {} - }, - "UpdateJobRequest": { - "fields": { - "job": { - "type": "Job", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListJobsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1 - }, - "filter": { - "type": "string", - "id": 4 - }, - "orderBy": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListJobsResponse": { - "fields": { - "jobs": { - "rule": "repeated", - "type": "Job", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "ListTasksRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "batch.googleapis.com/TaskGroup" - } - }, - "filter": { - "type": "string", - "id": 2 - }, - "orderBy": { - "type": "string", - "id": 5 - }, - "pageSize": { - "type": "int32", - "id": 3 - }, - "pageToken": { - "type": "string", - "id": 4 - } - } - }, - "ListTasksResponse": { - "fields": { - "tasks": { - "rule": "repeated", - "type": "Task", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "GetTaskRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "batch.googleapis.com/Task" - } - } - } - }, - "CreateResourceAllowanceRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "batch.googleapis.com/ResourceAllowance" - } - }, - "resourceAllowanceId": { - "type": "string", - "id": 2 - }, - "resourceAllowance": { - "type": "ResourceAllowance", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GetResourceAllowanceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "batch.googleapis.com/ResourceAllowance" - } - } - } - }, - "DeleteResourceAllowanceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "batch.googleapis.com/ResourceAllowance" - } - }, - "reason": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListResourceAllowancesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "batch.googleapis.com/ResourceAllowance" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListResourceAllowancesResponse": { - "fields": { - "resourceAllowances": { - "rule": "repeated", - "type": "ResourceAllowance", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "UpdateResourceAllowanceRequest": { - "fields": { - "resourceAllowance": { - "type": "ResourceAllowance", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "OperationMetadata": { - "fields": { - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "target": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "verb": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "statusMessage": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "requestedCancellation": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "apiVersion": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "Job": { - "options": { - "(google.api.resource).type": "batch.googleapis.com/Job", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/jobs/{job}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "uid": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "priority": { - "type": "int64", - "id": 3 - }, - "taskGroups": { - "rule": "repeated", - "type": "TaskGroup", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "schedulingPolicy": { - "type": "SchedulingPolicy", - "id": 5 - }, - "dependencies": { - "rule": "repeated", - "type": "JobDependency", - "id": 6 - }, - "allocationPolicy": { - "type": "AllocationPolicy", - "id": 7 - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 8 - }, - "status": { - "type": "JobStatus", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "notification": { - "type": "JobNotification", - "id": 10, - "options": { - "deprecated": true - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "logsPolicy": { - "type": "LogsPolicy", - "id": 13 - }, - "notifications": { - "rule": "repeated", - "type": "JobNotification", - "id": 14 - } - }, - "nested": { - "SchedulingPolicy": { - "values": { - "SCHEDULING_POLICY_UNSPECIFIED": 0, - "AS_SOON_AS_POSSIBLE": 1 - } - } - } - }, - "LogsPolicy": { - "fields": { - "destination": { - "type": "Destination", - "id": 1 - }, - "logsPath": { - "type": "string", - "id": 2 - }, - "cloudLoggingOption": { - "type": "CloudLoggingOption", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "CloudLoggingOption": { - "fields": { - "useGenericTaskMonitoredResource": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Destination": { - "values": { - "DESTINATION_UNSPECIFIED": 0, - "CLOUD_LOGGING": 1, - "PATH": 2 - } - } - } - }, - "JobDependency": { - "fields": { - "items": { - "keyType": "string", - "type": "Type", - "id": 1 - } - }, - "nested": { - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "SUCCEEDED": 1, - "FAILED": 2, - "FINISHED": 3 - } - } - } - }, - "JobStatus": { - "fields": { - "state": { - "type": "State", - "id": 1 - }, - "statusEvents": { - "rule": "repeated", - "type": "StatusEvent", - "id": 2 - }, - "taskGroups": { - "keyType": "string", - "type": "TaskGroupStatus", - "id": 4 - }, - "runDuration": { - "type": "google.protobuf.Duration", - "id": 5 - }, - "resourceUsage": { - "type": "ResourceUsage", - "id": 6 - } - }, - "nested": { - "InstanceStatus": { - "fields": { - "machineType": { - "type": "string", - "id": 1 - }, - "provisioningModel": { - "type": "AllocationPolicy.ProvisioningModel", - "id": 2 - }, - "taskPack": { - "type": "int64", - "id": 3 - }, - "bootDisk": { - "type": "AllocationPolicy.Disk", - "id": 4 - } - } - }, - "TaskGroupStatus": { - "fields": { - "counts": { - "keyType": "string", - "type": "int64", - "id": 1 - }, - "instances": { - "rule": "repeated", - "type": "InstanceStatus", - "id": 2 - } - } - }, - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "QUEUED": 1, - "SCHEDULED": 2, - "RUNNING": 3, - "SUCCEEDED": 4, - "FAILED": 5, - "DELETION_IN_PROGRESS": 6, - "CANCELLATION_IN_PROGRESS": 7, - "CANCELLED": 8 - } - } - } - }, - "ResourceUsage": { - "fields": { - "coreHours": { - "type": "double", - "id": 1 - } - } - }, - "JobNotification": { - "fields": { - "pubsubTopic": { - "type": "string", - "id": 1 - }, - "message": { - "type": "Message", - "id": 2 - } - }, - "nested": { - "Message": { - "fields": { - "type": { - "type": "Type", - "id": 1 - }, - "newJobState": { - "type": "JobStatus.State", - "id": 2 - }, - "newTaskState": { - "type": "TaskStatus.State", - "id": 3 - } - } - }, - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "JOB_STATE_CHANGED": 1, - "TASK_STATE_CHANGED": 2 - } - } - } - }, - "AllocationPolicy": { - "fields": { - "location": { - "type": "LocationPolicy", - "id": 1 - }, - "instance": { - "type": "InstancePolicy", - "id": 2, - "options": { - "deprecated": true - } - }, - "instances": { - "rule": "repeated", - "type": "InstancePolicyOrTemplate", - "id": 8 - }, - "instanceTemplates": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "deprecated": true - } - }, - "provisioningModels": { - "rule": "repeated", - "type": "ProvisioningModel", - "id": 4, - "options": { - "deprecated": true - } - }, - "serviceAccountEmail": { - "type": "string", - "id": 5, - "options": { - "deprecated": true - } - }, - "serviceAccount": { - "type": "ServiceAccount", - "id": 9 - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 6 - }, - "network": { - "type": "NetworkPolicy", - "id": 7 - }, - "placement": { - "type": "PlacementPolicy", - "id": 10 - }, - "tags": { - "rule": "repeated", - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "LocationPolicy": { - "fields": { - "allowedLocations": { - "rule": "repeated", - "type": "string", - "id": 1 - }, - "deniedLocations": { - "rule": "repeated", - "type": "string", - "id": 2 - } - } - }, - "Disk": { - "oneofs": { - "dataSource": { - "oneof": [ - "image", - "snapshot" - ] - } - }, - "fields": { - "image": { - "type": "string", - "id": 4 - }, - "snapshot": { - "type": "string", - "id": 5 - }, - "type": { - "type": "string", - "id": 1 - }, - "sizeGb": { - "type": "int64", - "id": 2 - }, - "diskInterface": { - "type": "string", - "id": 6 - } - } - }, - "AttachedDisk": { - "oneofs": { - "attached": { - "oneof": [ - "newDisk", - "existingDisk" - ] - } - }, - "fields": { - "newDisk": { - "type": "Disk", - "id": 1 - }, - "existingDisk": { - "type": "string", - "id": 2 - }, - "deviceName": { - "type": "string", - "id": 3 - } - } - }, - "Accelerator": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "count": { - "type": "int64", - "id": 2 - }, - "installGpuDrivers": { - "type": "bool", - "id": 3, - "options": { - "deprecated": true - } - }, - "driverVersion": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "InstancePolicy": { - "fields": { - "allowedMachineTypes": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "deprecated": true - } - }, - "machineType": { - "type": "string", - "id": 2 - }, - "minCpuPlatform": { - "type": "string", - "id": 3 - }, - "provisioningModel": { - "type": "ProvisioningModel", - "id": 4 - }, - "accelerators": { - "rule": "repeated", - "type": "Accelerator", - "id": 5 - }, - "bootDisk": { - "type": "Disk", - "id": 8 - }, - "disks": { - "rule": "repeated", - "type": "AttachedDisk", - "id": 6 - }, - "reservation": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "InstancePolicyOrTemplate": { - "oneofs": { - "policyTemplate": { - "oneof": [ - "policy", - "instanceTemplate" - ] - } - }, - "fields": { - "policy": { - "type": "InstancePolicy", - "id": 1 - }, - "instanceTemplate": { - "type": "string", - "id": 2 - }, - "installGpuDrivers": { - "type": "bool", - "id": 3 - }, - "installOpsAgent": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "blockProjectSshKeys": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "NetworkInterface": { - "fields": { - "network": { - "type": "string", - "id": 1 - }, - "subnetwork": { - "type": "string", - "id": 2 - }, - "noExternalIpAddress": { - "type": "bool", - "id": 3 - } - } - }, - "NetworkPolicy": { - "fields": { - "networkInterfaces": { - "rule": "repeated", - "type": "NetworkInterface", - "id": 1 - } - } - }, - "PlacementPolicy": { - "fields": { - "collocation": { - "type": "string", - "id": 1 - }, - "maxDistance": { - "type": "int64", - "id": 2 - } - } - }, - "ProvisioningModel": { - "values": { - "PROVISIONING_MODEL_UNSPECIFIED": 0, - "STANDARD": 1, - "SPOT": 2, - "PREEMPTIBLE": 3 - } - } - } - }, - "TaskGroup": { - "options": { - "(google.api.resource).type": "batch.googleapis.com/TaskGroup", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "taskSpec": { - "type": "TaskSpec", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "taskCount": { - "type": "int64", - "id": 4 - }, - "parallelism": { - "type": "int64", - "id": 5 - }, - "schedulingPolicy": { - "type": "SchedulingPolicy", - "id": 6 - }, - "allocationPolicy": { - "type": "AllocationPolicy", - "id": 7 - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 8 - }, - "taskEnvironments": { - "rule": "repeated", - "type": "Environment", - "id": 9 - }, - "taskCountPerNode": { - "type": "int64", - "id": 10 - }, - "requireHostsFile": { - "type": "bool", - "id": 11 - }, - "permissiveSsh": { - "type": "bool", - "id": 12 - }, - "runAsNonRoot": { - "type": "bool", - "id": 14, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "serviceAccount": { - "type": "ServiceAccount", - "id": 15, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "SchedulingPolicy": { - "values": { - "SCHEDULING_POLICY_UNSPECIFIED": 0, - "AS_SOON_AS_POSSIBLE": 1, - "IN_ORDER": 2 - } - } - } - }, - "ServiceAccount": { - "fields": { - "email": { - "type": "string", - "id": 1 - }, - "scopes": { - "rule": "repeated", - "type": "string", - "id": 2 - } - } - }, - "ComputeResource": { - "fields": { - "cpuMilli": { - "type": "int64", - "id": 1 - }, - "memoryMib": { - "type": "int64", - "id": 2 - }, - "gpuCount": { - "type": "int64", - "id": 3 - }, - "bootDiskMib": { - "type": "int64", - "id": 4 - } - } - }, - "StatusEvent": { - "fields": { - "type": { - "type": "string", - "id": 3 - }, - "description": { - "type": "string", - "id": 1 - }, - "eventTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "taskExecution": { - "type": "TaskExecution", - "id": 4 - }, - "taskState": { - "type": "TaskStatus.State", - "id": 5 - } - } - }, - "TaskExecution": { - "fields": { - "exitCode": { - "type": "int32", - "id": 1 - }, - "stderrSnippet": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "TaskStatus": { - "fields": { - "state": { - "type": "State", - "id": 1 - }, - "statusEvents": { - "rule": "repeated", - "type": "StatusEvent", - "id": 2 - }, - "resourceUsage": { - "type": "TaskResourceUsage", - "id": 3 - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "PENDING": 1, - "ASSIGNED": 2, - "RUNNING": 3, - "FAILED": 4, - "SUCCEEDED": 5, - "UNEXECUTED": 6 - } - } - } - }, - "TaskResourceUsage": { - "fields": { - "coreHours": { - "type": "double", - "id": 1 - } - } - }, - "Runnable": { - "oneofs": { - "executable": { - "oneof": [ - "container", - "script", - "barrier" - ] - } - }, - "fields": { - "container": { - "type": "Container", - "id": 1 - }, - "script": { - "type": "Script", - "id": 2 - }, - "barrier": { - "type": "Barrier", - "id": 6 - }, - "displayName": { - "type": "string", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "ignoreExitStatus": { - "type": "bool", - "id": 3 - }, - "background": { - "type": "bool", - "id": 4 - }, - "alwaysRun": { - "type": "bool", - "id": 5 - }, - "environment": { - "type": "Environment", - "id": 7 - }, - "timeout": { - "type": "google.protobuf.Duration", - "id": 8 - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 9 - } - }, - "nested": { - "Container": { - "fields": { - "imageUri": { - "type": "string", - "id": 1 - }, - "commands": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "entrypoint": { - "type": "string", - "id": 3 - }, - "volumes": { - "rule": "repeated", - "type": "string", - "id": 7 - }, - "options": { - "type": "string", - "id": 8 - }, - "blockExternalNetwork": { - "type": "bool", - "id": 9 - }, - "username": { - "type": "string", - "id": 10 - }, - "password": { - "type": "string", - "id": 11 - }, - "enableImageStreaming": { - "type": "bool", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Script": { - "oneofs": { - "command": { - "oneof": [ - "path", - "text" - ] - } - }, - "fields": { - "path": { - "type": "string", - "id": 1 - }, - "text": { - "type": "string", - "id": 2 - } - } - }, - "Barrier": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - } - } - }, - "TaskSpec": { - "fields": { - "runnables": { - "rule": "repeated", - "type": "Runnable", - "id": 8 - }, - "computeResource": { - "type": "ComputeResource", - "id": 3 - }, - "maxRunDuration": { - "type": "google.protobuf.Duration", - "id": 4 - }, - "maxRetryCount": { - "type": "int32", - "id": 5 - }, - "lifecyclePolicies": { - "rule": "repeated", - "type": "LifecyclePolicy", - "id": 9 - }, - "environments": { - "keyType": "string", - "type": "string", - "id": 6, - "options": { - "deprecated": true - } - }, - "volumes": { - "rule": "repeated", - "type": "Volume", - "id": 7 - }, - "environment": { - "type": "Environment", - "id": 10 - } - } - }, - "LifecyclePolicy": { - "fields": { - "action": { - "type": "Action", - "id": 1 - }, - "actionCondition": { - "type": "ActionCondition", - "id": 2 - } - }, - "nested": { - "ActionCondition": { - "fields": { - "exitCodes": { - "rule": "repeated", - "type": "int32", - "id": 1 - } - } - }, - "Action": { - "values": { - "ACTION_UNSPECIFIED": 0, - "RETRY_TASK": 1, - "FAIL_TASK": 2 - } - } - } - }, - "Task": { - "options": { - "(google.api.resource).type": "batch.googleapis.com/Task", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}/tasks/{task}" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "status": { - "type": "TaskStatus", - "id": 2 - } - } - }, - "Environment": { - "fields": { - "variables": { - "keyType": "string", - "type": "string", - "id": 1 - }, - "secretVariables": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "encryptedVariables": { - "type": "KMSEnvMap", - "id": 3 - } - }, - "nested": { - "KMSEnvMap": { - "fields": { - "keyName": { - "type": "string", - "id": 1 - }, - "cipherText": { - "type": "string", - "id": 2 - } - } - } - } - }, - "Volume": { - "oneofs": { - "source": { - "oneof": [ - "nfs", - "pd", - "gcs", - "deviceName" - ] - } - }, - "fields": { - "nfs": { - "type": "NFS", - "id": 1 - }, - "pd": { - "type": "PD", - "id": 2, - "options": { - "deprecated": true - } - }, - "gcs": { - "type": "GCS", - "id": 3 - }, - "deviceName": { - "type": "string", - "id": 6 - }, - "mountPath": { - "type": "string", - "id": 4 - }, - "mountOptions": { - "rule": "repeated", - "type": "string", - "id": 5 - } - } - }, - "NFS": { - "fields": { - "server": { - "type": "string", - "id": 1 - }, - "remotePath": { - "type": "string", - "id": 2 - } - } - }, - "PD": { - "fields": { - "disk": { - "type": "string", - "id": 1 - }, - "device": { - "type": "string", - "id": 2 - }, - "existing": { - "type": "bool", - "id": 3, - "options": { - "deprecated": true - } - } - } - }, - "GCS": { - "fields": { - "remotePath": { - "type": "string", - "id": 1 - } - } - }, - "CalendarPeriod": { - "values": { - "CALENDAR_PERIOD_UNSPECIFIED": 0, - "MONTH": 1, - "QUARTER": 2, - "YEAR": 3, - "WEEK": 4, - "DAY": 5 - } - }, - "ResourceAllowanceState": { - "values": { - "RESOURCE_ALLOWANCE_STATE_UNSPECIFIED": 0, - "RESOURCE_ALLOWANCE_ACTIVE": 1, - "RESOURCE_ALLOWANCE_DEPLETED": 2 - } - }, - "ResourceAllowance": { - "options": { - "(google.api.resource).type": "batch.googleapis.com/ResourceAllowance", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/resourceAllowances/{resource_allowance}", - "(google.api.resource).plural": "resourceAllowances", - "(google.api.resource).singular": "resourceAllowance" - }, - "oneofs": { - "resourceAllowance": { - "oneof": [ - "usageResourceAllowance" - ] - } - }, - "fields": { - "usageResourceAllowance": { - "type": "UsageResourceAllowance", - "id": 4 - }, - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "uid": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "notifications": { - "rule": "repeated", - "type": "Notification", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "UsageResourceAllowance": { - "fields": { - "spec": { - "type": "UsageResourceAllowanceSpec", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "status": { - "type": "UsageResourceAllowanceStatus", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "UsageResourceAllowanceSpec": { - "fields": { - "type": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "limit": { - "type": "Limit", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "Limit": { - "oneofs": { - "duration": { - "oneof": [ - "calendarPeriod" - ] - }, - "_limit": { - "oneof": [ - "limit" - ] - } - }, - "fields": { - "calendarPeriod": { - "type": "CalendarPeriod", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "limit": { - "type": "double", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "proto3_optional": true - } - } - } - } - } - }, - "UsageResourceAllowanceStatus": { - "fields": { - "state": { - "type": "ResourceAllowanceState", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "limitStatus": { - "type": "LimitStatus", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "report": { - "type": "ConsumptionReport", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "LimitStatus": { - "oneofs": { - "_limit": { - "oneof": [ - "limit" - ] - }, - "_consumed": { - "oneof": [ - "consumed" - ] - } - }, - "fields": { - "consumptionInterval": { - "type": "google.type.Interval", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "limit": { - "type": "double", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "consumed": { - "type": "double", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - } - } - }, - "PeriodConsumption": { - "oneofs": { - "_consumed": { - "oneof": [ - "consumed" - ] - } - }, - "fields": { - "consumptionInterval": { - "type": "google.type.Interval", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "consumed": { - "type": "double", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - } - } - }, - "ConsumptionReport": { - "fields": { - "latestPeriodConsumptions": { - "keyType": "string", - "type": "PeriodConsumption", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - } - } - }, - "Notification": { - "fields": { - "pubsubTopic": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - } - } - } - } - } - } - }, - "api": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", - "java_multiple_files": true, - "java_outer_classname": "ResourceProto", - "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true - }, - "nested": { - "http": { - "type": "HttpRule", - "id": 72295728, - "extend": "google.protobuf.MethodOptions" - }, - "Http": { - "fields": { - "rules": { - "rule": "repeated", - "type": "HttpRule", - "id": 1 - }, - "fullyDecodeReservedExpansion": { - "type": "bool", - "id": 2 - } - } - }, - "HttpRule": { - "oneofs": { - "pattern": { - "oneof": [ - "get", - "put", - "post", - "delete", - "patch", - "custom" - ] - } - }, - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "get": { - "type": "string", - "id": 2 - }, - "put": { - "type": "string", - "id": 3 - }, - "post": { - "type": "string", - "id": 4 - }, - "delete": { - "type": "string", - "id": 5 - }, - "patch": { - "type": "string", - "id": 6 - }, - "custom": { - "type": "CustomHttpPattern", - "id": 8 - }, - "body": { - "type": "string", - "id": 7 - }, - "responseBody": { - "type": "string", - "id": 12 - }, - "additionalBindings": { - "rule": "repeated", - "type": "HttpRule", - "id": 11 - } - } - }, - "CustomHttpPattern": { - "fields": { - "kind": { - "type": "string", - "id": 1 - }, - "path": { - "type": "string", - "id": 2 - } - } - }, - "methodSignature": { - "rule": "repeated", - "type": "string", - "id": 1051, - "extend": "google.protobuf.MethodOptions" - }, - "defaultHost": { - "type": "string", - "id": 1049, - "extend": "google.protobuf.ServiceOptions" - }, - "oauthScopes": { - "type": "string", - "id": 1050, - "extend": "google.protobuf.ServiceOptions" - }, - "apiVersion": { - "type": "string", - "id": 525000001, - "extend": "google.protobuf.ServiceOptions" - }, - "CommonLanguageSettings": { - "fields": { - "referenceDocsUri": { - "type": "string", - "id": 1, - "options": { - "deprecated": true - } - }, - "destinations": { - "rule": "repeated", - "type": "ClientLibraryDestination", - "id": 2 - } - } - }, - "ClientLibrarySettings": { - "fields": { - "version": { - "type": "string", - "id": 1 - }, - "launchStage": { - "type": "LaunchStage", - "id": 2 - }, - "restNumericEnums": { - "type": "bool", - "id": 3 - }, - "javaSettings": { - "type": "JavaSettings", - "id": 21 - }, - "cppSettings": { - "type": "CppSettings", - "id": 22 - }, - "phpSettings": { - "type": "PhpSettings", - "id": 23 - }, - "pythonSettings": { - "type": "PythonSettings", - "id": 24 - }, - "nodeSettings": { - "type": "NodeSettings", - "id": 25 - }, - "dotnetSettings": { - "type": "DotnetSettings", - "id": 26 - }, - "rubySettings": { - "type": "RubySettings", - "id": 27 - }, - "goSettings": { - "type": "GoSettings", - "id": 28 - } - } - }, - "Publishing": { - "fields": { - "methodSettings": { - "rule": "repeated", - "type": "MethodSettings", - "id": 2 - }, - "newIssueUri": { - "type": "string", - "id": 101 - }, - "documentationUri": { - "type": "string", - "id": 102 - }, - "apiShortName": { - "type": "string", - "id": 103 - }, - "githubLabel": { - "type": "string", - "id": 104 - }, - "codeownerGithubTeams": { - "rule": "repeated", - "type": "string", - "id": 105 - }, - "docTagPrefix": { - "type": "string", - "id": 106 - }, - "organization": { - "type": "ClientLibraryOrganization", - "id": 107 - }, - "librarySettings": { - "rule": "repeated", - "type": "ClientLibrarySettings", - "id": 109 - }, - "protoReferenceDocumentationUri": { - "type": "string", - "id": 110 - }, - "restReferenceDocumentationUri": { - "type": "string", - "id": 111 - } - } - }, - "JavaSettings": { - "fields": { - "libraryPackage": { - "type": "string", - "id": 1 - }, - "serviceClassNames": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "common": { - "type": "CommonLanguageSettings", - "id": 3 - } - } - }, - "CppSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "PhpSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "PythonSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "NodeSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "DotnetSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - }, - "renamedServices": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "renamedResources": { - "keyType": "string", - "type": "string", - "id": 3 - }, - "ignoredResources": { - "rule": "repeated", - "type": "string", - "id": 4 - }, - "forcedNamespaceAliases": { - "rule": "repeated", - "type": "string", - "id": 5 - }, - "handwrittenSignatures": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - }, - "RubySettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "GoSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "MethodSettings": { - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "longRunning": { - "type": "LongRunning", - "id": 2 - }, - "autoPopulatedFields": { - "rule": "repeated", - "type": "string", - "id": 3 - } - }, - "nested": { - "LongRunning": { - "fields": { - "initialPollDelay": { - "type": "google.protobuf.Duration", - "id": 1 - }, - "pollDelayMultiplier": { - "type": "float", - "id": 2 - }, - "maxPollDelay": { - "type": "google.protobuf.Duration", - "id": 3 - }, - "totalPollTimeout": { - "type": "google.protobuf.Duration", - "id": 4 - } - } - } - } - }, - "ClientLibraryOrganization": { - "values": { - "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, - "CLOUD": 1, - "ADS": 2, - "PHOTOS": 3, - "STREET_VIEW": 4, - "SHOPPING": 5, - "GEO": 6, - "GENERATIVE_AI": 7 - } - }, - "ClientLibraryDestination": { - "values": { - "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, - "GITHUB": 10, - "PACKAGE_MANAGER": 20 - } - }, - "LaunchStage": { - "values": { - "LAUNCH_STAGE_UNSPECIFIED": 0, - "UNIMPLEMENTED": 6, - "PRELAUNCH": 7, - "EARLY_ACCESS": 1, - "ALPHA": 2, - "BETA": 3, - "GA": 4, - "DEPRECATED": 5 - } - }, - "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 - } - }, - "fieldInfo": { - "type": "google.api.FieldInfo", - "id": 291403980, - "extend": "google.protobuf.FieldOptions" - }, - "FieldInfo": { - "fields": { - "format": { - "type": "Format", - "id": 1 - } - }, - "nested": { - "Format": { - "values": { - "FORMAT_UNSPECIFIED": 0, - "UUID4": 1, - "IPV4": 2, - "IPV6": 3, - "IPV4_OR_IPV6": 4 - } - } - } - }, - "resourceReference": { - "type": "google.api.ResourceReference", - "id": 1055, - "extend": "google.protobuf.FieldOptions" - }, - "resourceDefinition": { - "rule": "repeated", - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.FileOptions" - }, - "resource": { - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.MessageOptions" - }, - "ResourceDescriptor": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "pattern": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "nameField": { - "type": "string", - "id": 3 - }, - "history": { - "type": "History", - "id": 4 - }, - "plural": { - "type": "string", - "id": 5 - }, - "singular": { - "type": "string", - "id": 6 - }, - "style": { - "rule": "repeated", - "type": "Style", - "id": 10 - } - }, - "nested": { - "History": { - "values": { - "HISTORY_UNSPECIFIED": 0, - "ORIGINALLY_SINGLE_PATTERN": 1, - "FUTURE_MULTI_PATTERN": 2 - } - }, - "Style": { - "values": { - "STYLE_UNSPECIFIED": 0, - "DECLARATIVE_FRIENDLY": 1 - } - } - } - }, - "ResourceReference": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "childType": { - "type": "string", - "id": 2 - } - } - } - } - }, - "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": { - "fields": { - "file": { - "rule": "repeated", - "type": "FileDescriptorProto", - "id": 1 - } - } - }, - "Edition": { - "values": { - "EDITION_UNKNOWN": 0, - "EDITION_PROTO2": 998, - "EDITION_PROTO3": 999, - "EDITION_2023": 1000, - "EDITION_2024": 1001, - "EDITION_1_TEST_ONLY": 1, - "EDITION_2_TEST_ONLY": 2, - "EDITION_99997_TEST_ONLY": 99997, - "EDITION_99998_TEST_ONLY": 99998, - "EDITION_99999_TEST_ONLY": 99999, - "EDITION_MAX": 2147483647 - } - }, - "FileDescriptorProto": { - "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, - "options": { - "packed": false - } - }, - "weakDependency": { - "rule": "repeated", - "type": "int32", - "id": 11, - "options": { - "packed": false - } - }, - "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": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "field": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 2 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 6 - }, - "nestedType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 3 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 4 - }, - "extensionRange": { - "rule": "repeated", - "type": "ExtensionRange", - "id": 5 - }, - "oneofDecl": { - "rule": "repeated", - "type": "OneofDescriptorProto", - "id": 8 - }, - "options": { - "type": "MessageOptions", - "id": 7 - }, - "reservedRange": { - "rule": "repeated", - "type": "ReservedRange", - "id": 9 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 10 - } - }, - "nested": { - "ExtensionRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "ExtensionRangeOptions", - "id": 3 - } - } - }, - "ReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "ExtensionRangeOptions": { - "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": { - "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": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "options": { - "type": "OneofOptions", - "id": 2 - } - } - }, - "EnumDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "value": { - "rule": "repeated", - "type": "EnumValueDescriptorProto", - "id": 2 - }, - "options": { - "type": "EnumOptions", - "id": 3 - }, - "reservedRange": { - "rule": "repeated", - "type": "EnumReservedRange", - "id": 4 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 5 - } - }, - "nested": { - "EnumReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "EnumValueDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "EnumValueOptions", - "id": 3 - } - } - }, - "ServiceDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "method": { - "rule": "repeated", - "type": "MethodDescriptorProto", - "id": 2 - }, - "options": { - "type": "ServiceOptions", - "id": 3 - } - } - }, - "MethodDescriptorProto": { - "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": { - "fields": { - "javaPackage": { - "type": "string", - "id": 1 - }, - "javaOuterClassname": { - "type": "string", - "id": 8 - }, - "javaMultipleFiles": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "javaGenerateEqualsAndHash": { - "type": "bool", - "id": 20, - "options": { - "deprecated": true - } - }, - "javaStringCheckUtf8": { - "type": "bool", - "id": 27, - "options": { - "default": false - } - }, - "optimizeFor": { - "type": "OptimizeMode", - "id": 9, - "options": { - "default": "SPEED" - } - }, - "goPackage": { - "type": "string", - "id": 11 - }, - "ccGenericServices": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "javaGenericServices": { - "type": "bool", - "id": 17, - "options": { - "default": false - } - }, - "pyGenericServices": { - "type": "bool", - "id": 18, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 23, - "options": { - "default": false - } - }, - "ccEnableArenas": { - "type": "bool", - "id": 31, - "options": { - "default": true - } - }, - "objcClassPrefix": { - "type": "string", - "id": 36 - }, - "csharpNamespace": { - "type": "string", - "id": 37 - }, - "swiftPrefix": { - "type": "string", - "id": 39 - }, - "phpClassPrefix": { - "type": "string", - "id": 40 - }, - "phpNamespace": { - "type": "string", - "id": 41 - }, - "phpMetadataNamespace": { - "type": "string", - "id": 44 - }, - "rubyPackage": { - "type": "string", - "id": 45 - }, - "features": { - "type": "FeatureSet", - "id": 50 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 42, - 42 - ], - [ - 38, - 38 - ] - ], - "nested": { - "OptimizeMode": { - "values": { - "SPEED": 1, - "CODE_SIZE": 2, - "LITE_RUNTIME": 3 - } - } - } - }, - "MessageOptions": { - "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": { - "fields": { - "ctype": { - "type": "CType", - "id": 1, - "options": { - "default": "STRING" - } - }, - "packed": { - "type": "bool", - "id": 2 - }, - "jstype": { - "type": "JSType", - "id": 6, - "options": { - "default": "JS_NORMAL" - } - }, - "lazy": { - "type": "bool", - "id": 5, - "options": { - "default": false - } - }, - "unverifiedLazy": { - "type": "bool", - "id": 15, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "weak": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "debugRedact": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "retention": { - "type": "OptionRetention", - "id": 17 - }, - "targets": { - "rule": "repeated", - "type": "OptionTargetType", - "id": 19, - "options": { - "packed": false - } - }, - "editionDefaults": { - "rule": "repeated", - "type": "EditionDefault", - "id": 20 - }, - "features": { - "type": "FeatureSet", - "id": 21 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 18, - 18 - ] - ], - "nested": { - "CType": { - "values": { - "STRING": 0, - "CORD": 1, - "STRING_PIECE": 2 - } - }, - "JSType": { - "values": { - "JS_NORMAL": 0, - "JS_STRING": 1, - "JS_NUMBER": 2 - } - }, - "OptionRetention": { - "values": { - "RETENTION_UNKNOWN": 0, - "RETENTION_RUNTIME": 1, - "RETENTION_SOURCE": 2 - } - }, - "OptionTargetType": { - "values": { - "TARGET_TYPE_UNKNOWN": 0, - "TARGET_TYPE_FILE": 1, - "TARGET_TYPE_EXTENSION_RANGE": 2, - "TARGET_TYPE_MESSAGE": 3, - "TARGET_TYPE_FIELD": 4, - "TARGET_TYPE_ONEOF": 5, - "TARGET_TYPE_ENUM": 6, - "TARGET_TYPE_ENUM_ENTRY": 7, - "TARGET_TYPE_SERVICE": 8, - "TARGET_TYPE_METHOD": 9 - } - }, - "EditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "value": { - "type": "string", - "id": 2 - } - } - } - } - }, - "OneofOptions": { - "fields": { - "features": { - "type": "FeatureSet", - "id": 1 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "EnumOptions": { - "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": { - "fields": { - "deprecated": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "features": { - "type": "FeatureSet", - "id": 2 - }, - "debugRedact": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "ServiceOptions": { - "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": { - "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": { - "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": { - "fields": { - "fieldPresence": { - "type": "FieldPresence", - "id": 1, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_2023", - "edition_defaults.value": "EXPLICIT" - } - }, - "enumType": { - "type": "EnumType", - "id": 2, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "OPEN" - } - }, - "repeatedFieldEncoding": { - "type": "RepeatedFieldEncoding", - "id": 3, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "PACKED" - } - }, - "utf8Validation": { - "type": "Utf8Validation", - "id": 4, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "VERIFY" - } - }, - "messageEncoding": { - "type": "MessageEncoding", - "id": 5, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO2", - "edition_defaults.value": "LENGTH_PREFIXED" - } - }, - "jsonFormat": { - "type": "JsonFormat", - "id": 6, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "ALLOW" - } - } - }, - "extensions": [ - [ - 1000, - 1000 - ], - [ - 1001, - 1001 - ], - [ - 1002, - 1002 - ], - [ - 9990, - 9990 - ], - [ - 9995, - 9999 - ], - [ - 10000, - 10000 - ] - ], - "reserved": [ - [ - 999, - 999 - ] - ], - "nested": { - "FieldPresence": { - "values": { - "FIELD_PRESENCE_UNKNOWN": 0, - "EXPLICIT": 1, - "IMPLICIT": 2, - "LEGACY_REQUIRED": 3 - } - }, - "EnumType": { - "values": { - "ENUM_TYPE_UNKNOWN": 0, - "OPEN": 1, - "CLOSED": 2 - } - }, - "RepeatedFieldEncoding": { - "values": { - "REPEATED_FIELD_ENCODING_UNKNOWN": 0, - "PACKED": 1, - "EXPANDED": 2 - } - }, - "Utf8Validation": { - "values": { - "UTF8_VALIDATION_UNKNOWN": 0, - "VERIFY": 2, - "NONE": 3 - } - }, - "MessageEncoding": { - "values": { - "MESSAGE_ENCODING_UNKNOWN": 0, - "LENGTH_PREFIXED": 1, - "DELIMITED": 2 - } - }, - "JsonFormat": { - "values": { - "JSON_FORMAT_UNKNOWN": 0, - "ALLOW": 1, - "LEGACY_BEST_EFFORT": 2 - } - } - } - }, - "FeatureSetDefaults": { - "fields": { - "defaults": { - "rule": "repeated", - "type": "FeatureSetEditionDefault", - "id": 1 - }, - "minimumEdition": { - "type": "Edition", - "id": 4 - }, - "maximumEdition": { - "type": "Edition", - "id": 5 - } - }, - "nested": { - "FeatureSetEditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "features": { - "type": "FeatureSet", - "id": 2 - } - } - } - } - }, - "SourceCodeInfo": { - "fields": { - "location": { - "rule": "repeated", - "type": "Location", - "id": 1 - } - }, - "nested": { - "Location": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1 - }, - "span": { - "rule": "repeated", - "type": "int32", - "id": 2 - }, - "leadingComments": { - "type": "string", - "id": 3 - }, - "trailingComments": { - "type": "string", - "id": 4 - }, - "leadingDetachedComments": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - } - } - }, - "GeneratedCodeInfo": { - "fields": { - "annotation": { - "rule": "repeated", - "type": "Annotation", - "id": 1 - } - }, - "nested": { - "Annotation": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1 - }, - "sourceFile": { - "type": "string", - "id": 2 - }, - "begin": { - "type": "int32", - "id": 3 - }, - "end": { - "type": "int32", - "id": 4 - }, - "semantic": { - "type": "Semantic", - "id": 5 - } - }, - "nested": { - "Semantic": { - "values": { - "NONE": 0, - "SET": 1, - "ALIAS": 2 - } - } - } - } - } - }, - "Duration": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "Timestamp": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "Any": { - "fields": { - "type_url": { - "type": "string", - "id": 1 - }, - "value": { - "type": "bytes", - "id": 2 - } - } - }, - "Empty": { - "fields": {} - }, - "FieldMask": { - "fields": { - "paths": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - } - } - }, - "type": { - "options": { - "cc_enable_arenas": true, - "go_package": "google.golang.org/genproto/googleapis/type/interval;interval", - "java_multiple_files": true, - "java_outer_classname": "IntervalProto", - "java_package": "com.google.type", - "objc_class_prefix": "GTP" - }, - "nested": { - "Interval": { - "fields": { - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - } - } - } - } - }, - "longrunning": { - "options": { - "cc_enable_arenas": true, - "csharp_namespace": "Google.LongRunning", - "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", - "java_multiple_files": true, - "java_outer_classname": "OperationsProto", - "java_package": "com.google.longrunning", - "php_namespace": "Google\\LongRunning" - }, - "nested": { - "operationInfo": { - "type": "google.longrunning.OperationInfo", - "id": 1049, - "extend": "google.protobuf.MethodOptions" - }, - "Operations": { - "options": { - "(google.api.default_host)": "longrunning.googleapis.com" - }, - "methods": { - "ListOperations": { - "requestType": "ListOperationsRequest", - "responseType": "ListOperationsResponse", - "options": { - "(google.api.http).get": "/v1/{name=operations}", - "(google.api.method_signature)": "name,filter" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=operations}" - } - }, - { - "(google.api.method_signature)": "name,filter" - } - ] - }, - "GetOperation": { - "requestType": "GetOperationRequest", - "responseType": "Operation", - "options": { - "(google.api.http).get": "/v1/{name=operations/**}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=operations/**}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "DeleteOperation": { - "requestType": "DeleteOperationRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=operations/**}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=operations/**}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CancelOperation": { - "requestType": "CancelOperationRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).post": "/v1/{name=operations/**}:cancel", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=operations/**}:cancel", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "WaitOperation": { - "requestType": "WaitOperationRequest", - "responseType": "Operation" - } - } - }, - "Operation": { - "oneofs": { - "result": { - "oneof": [ - "error", - "response" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "metadata": { - "type": "google.protobuf.Any", - "id": 2 - }, - "done": { - "type": "bool", - "id": 3 - }, - "error": { - "type": "google.rpc.Status", - "id": 4 - }, - "response": { - "type": "google.protobuf.Any", - "id": 5 - } - } - }, - "GetOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "ListOperationsRequest": { - "fields": { - "name": { - "type": "string", - "id": 4 - }, - "filter": { - "type": "string", - "id": 1 - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListOperationsResponse": { - "fields": { - "operations": { - "rule": "repeated", - "type": "Operation", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "CancelOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "DeleteOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "WaitOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "timeout": { - "type": "google.protobuf.Duration", - "id": 2 - } - } - }, - "OperationInfo": { - "fields": { - "responseType": { - "type": "string", - "id": 1 - }, - "metadataType": { - "type": "string", - "id": 2 - } - } - } - } - }, - "rpc": { - "options": { - "cc_enable_arenas": true, - "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", - "java_multiple_files": true, - "java_outer_classname": "StatusProto", - "java_package": "com.google.rpc", - "objc_class_prefix": "RPC" - }, - "nested": { - "Status": { - "fields": { - "code": { - "type": "int32", - "id": 1 - }, - "message": { - "type": "string", - "id": 2 - }, - "details": { - "rule": "repeated", - "type": "google.protobuf.Any", - "id": 3 - } - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.cancel_job.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.cancel_job.js deleted file mode 100644 index db19d7b5b83..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.cancel_job.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START batch_v1alpha_generated_BatchService_CancelJob_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Job name. - */ - // const name = 'abc123' - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callCancelJob() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await batchClient.cancelJob(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCancelJob(); - // [END batch_v1alpha_generated_BatchService_CancelJob_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.create_job.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.create_job.js deleted file mode 100644 index 29d4db9cb4e..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.create_job.js +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, job) { - // [START batch_v1alpha_generated_BatchService_CreateJob_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent resource name where the Job will be created. - * Pattern: "projects/{project}/locations/{location}" - */ - // const parent = 'abc123' - /** - * ID used to uniquely identify the Job within its parent scope. - * This field should contain at most 63 characters and must start with - * lowercase characters. - * Only lowercase characters, numbers and '-' are accepted. - * The '-' character cannot be the first or the last one. - * A system generated ID will be used if the field is not set. - * The job.name field in the request will be ignored and the created resource - * name of the Job will be "{parent}/jobs/{job_id}". - */ - // const jobId = 'abc123' - /** - * Required. The Job to create. - */ - // const job = {} - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callCreateJob() { - // Construct request - const request = { - parent, - job, - }; - - // Run request - const response = await batchClient.createJob(request); - console.log(response); - } - - callCreateJob(); - // [END batch_v1alpha_generated_BatchService_CreateJob_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.create_resource_allowance.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.create_resource_allowance.js deleted file mode 100644 index b5856107cd7..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.create_resource_allowance.js +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, resourceAllowance) { - // [START batch_v1alpha_generated_BatchService_CreateResourceAllowance_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent resource name where the ResourceAllowance will be - * created. Pattern: "projects/{project}/locations/{location}" - */ - // const parent = 'abc123' - /** - * ID used to uniquely identify the ResourceAllowance within its parent scope. - * This field should contain at most 63 characters and must start with - * lowercase characters. - * Only lowercase characters, numbers and '-' are accepted. - * The '-' character cannot be the first or the last one. - * A system generated ID will be used if the field is not set. - * The resource_allowance.name field in the request will be ignored and the - * created resource name of the ResourceAllowance will be - * "{parent}/resourceAllowances/{resource_allowance_id}". - */ - // const resourceAllowanceId = 'abc123' - /** - * Required. The ResourceAllowance to create. - */ - // const resourceAllowance = {} - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callCreateResourceAllowance() { - // Construct request - const request = { - parent, - resourceAllowance, - }; - - // Run request - const response = await batchClient.createResourceAllowance(request); - console.log(response); - } - - callCreateResourceAllowance(); - // [END batch_v1alpha_generated_BatchService_CreateResourceAllowance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.delete_job.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.delete_job.js deleted file mode 100644 index 3f513786b47..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.delete_job.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START batch_v1alpha_generated_BatchService_DeleteJob_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Job name. - */ - // const name = 'abc123' - /** - * Optional. Reason for this deletion. - */ - // const reason = 'abc123' - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callDeleteJob() { - // Construct request - const request = { - }; - - // Run request - const [operation] = await batchClient.deleteJob(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteJob(); - // [END batch_v1alpha_generated_BatchService_DeleteJob_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.delete_resource_allowance.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.delete_resource_allowance.js deleted file mode 100644 index 5b3cf737119..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.delete_resource_allowance.js +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START batch_v1alpha_generated_BatchService_DeleteResourceAllowance_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. ResourceAllowance name. - */ - // const name = 'abc123' - /** - * Optional. Reason for this deletion. - */ - // const reason = 'abc123' - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callDeleteResourceAllowance() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await batchClient.deleteResourceAllowance(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteResourceAllowance(); - // [END batch_v1alpha_generated_BatchService_DeleteResourceAllowance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_job.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_job.js deleted file mode 100644 index 4a8b7580df0..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_job.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START batch_v1alpha_generated_BatchService_GetJob_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Job name. - */ - // const name = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callGetJob() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await batchClient.getJob(request); - console.log(response); - } - - callGetJob(); - // [END batch_v1alpha_generated_BatchService_GetJob_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_resource_allowance.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_resource_allowance.js deleted file mode 100644 index 0fbe3143354..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_resource_allowance.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START batch_v1alpha_generated_BatchService_GetResourceAllowance_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. ResourceAllowance name. - */ - // const name = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callGetResourceAllowance() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await batchClient.getResourceAllowance(request); - console.log(response); - } - - callGetResourceAllowance(); - // [END batch_v1alpha_generated_BatchService_GetResourceAllowance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_task.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_task.js deleted file mode 100644 index 4de5248d352..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.get_task.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START batch_v1alpha_generated_BatchService_GetTask_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Task name. - */ - // const name = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callGetTask() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await batchClient.getTask(request); - console.log(response); - } - - callGetTask(); - // [END batch_v1alpha_generated_BatchService_GetTask_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_jobs.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_jobs.js deleted file mode 100644 index 42a2ecc05b5..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_jobs.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main() { - // [START batch_v1alpha_generated_BatchService_ListJobs_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Parent path. - */ - // const parent = 'abc123' - /** - * List filter. - */ - // const filter = 'abc123' - /** - * Optional. Sort results. Supported are "name", "name desc", "create_time", - * and "create_time desc". - */ - // const orderBy = 'abc123' - /** - * Page size. - */ - // const pageSize = 1234 - /** - * Page token. - */ - // const pageToken = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callListJobs() { - // Construct request - const request = { - }; - - // Run request - const iterable = batchClient.listJobsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListJobs(); - // [END batch_v1alpha_generated_BatchService_ListJobs_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_resource_allowances.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_resource_allowances.js deleted file mode 100644 index db9329acf53..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_resource_allowances.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START batch_v1alpha_generated_BatchService_ListResourceAllowances_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Parent path. - */ - // const parent = 'abc123' - /** - * Optional. Page size. - */ - // const pageSize = 1234 - /** - * Optional. Page token. - */ - // const pageToken = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callListResourceAllowances() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = batchClient.listResourceAllowancesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListResourceAllowances(); - // [END batch_v1alpha_generated_BatchService_ListResourceAllowances_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_tasks.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_tasks.js deleted file mode 100644 index 8214c4fede3..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.list_tasks.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START batch_v1alpha_generated_BatchService_ListTasks_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of a TaskGroup from which Tasks are being requested. - * Pattern: - * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" - */ - // const parent = 'abc123' - /** - * Task filter, null filter matches all Tasks. - * Filter string should be of the format State=TaskStatus.State e.g. - * State=RUNNING - */ - // const filter = 'abc123' - /** - * Not implemented. - */ - // const orderBy = 'abc123' - /** - * Page size. - */ - // const pageSize = 1234 - /** - * Page token. - */ - // const pageToken = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callListTasks() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = batchClient.listTasksAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListTasks(); - // [END batch_v1alpha_generated_BatchService_ListTasks_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.update_job.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.update_job.js deleted file mode 100644 index 3b8066040b0..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.update_job.js +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(job, updateMask) { - // [START batch_v1alpha_generated_BatchService_UpdateJob_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The Job to update. - * Only fields specified in `updateMask` are updated. - */ - // const job = {} - /** - * Required. Mask of fields to update. - * The `jobs.patch` method can only be used while a job is in the `QUEUED`, - * `SCHEDULED`, or `RUNNING` state and currently only supports increasing the - * value of the first `taskCount` field in the job's `taskGroups` field. - * Therefore, you must set the value of `updateMask` to `taskGroups`. Any - * other job fields in the update request will be ignored. - * For example, to update a job's `taskCount` to `2`, set `updateMask` to - * `taskGroups` and use the following request body: - * ``` - * { - * "taskGroups":{ - * "taskCount": 2 - * } - * } - * ``` - */ - // const updateMask = {} - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callUpdateJob() { - // Construct request - const request = { - job, - updateMask, - }; - - // Run request - const response = await batchClient.updateJob(request); - console.log(response); - } - - callUpdateJob(); - // [END batch_v1alpha_generated_BatchService_UpdateJob_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.update_resource_allowance.js b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.update_resource_allowance.js deleted file mode 100644 index 0cdf6071c8f..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/batch_service.update_resource_allowance.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(resourceAllowance, updateMask) { - // [START batch_v1alpha_generated_BatchService_UpdateResourceAllowance_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The ResourceAllowance to update. - * Update description. - * Only fields specified in `update_mask` are updated. - */ - // const resourceAllowance = {} - /** - * Required. Mask of fields to update. - * Field mask is used to specify the fields to be overwritten in the - * ResourceAllowance resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * UpdateResourceAllowance request now only supports update on `limit` field. - */ - // const updateMask = {} - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Batch library - const {BatchServiceClient} = require('@google-cloud/batch').v1alpha; - - // Instantiates a client - const batchClient = new BatchServiceClient(); - - async function callUpdateResourceAllowance() { - // Construct request - const request = { - resourceAllowance, - updateMask, - }; - - // Run request - const response = await batchClient.updateResourceAllowance(request); - console.log(response); - } - - callUpdateResourceAllowance(); - // [END batch_v1alpha_generated_BatchService_UpdateResourceAllowance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/snippet_metadata_google.cloud.batch.v1alpha.json b/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/snippet_metadata_google.cloud.batch.v1alpha.json deleted file mode 100644 index a02256ec594..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/samples/generated/v1alpha/snippet_metadata_google.cloud.batch.v1alpha.json +++ /dev/null @@ -1,635 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-batch", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.batch.v1alpha", - "version": "v1alpha" - } - ] - }, - "snippets": [ - { - "regionTag": "batch_v1alpha_generated_BatchService_CreateJob_async", - "title": "BatchService createJob Sample", - "origin": "API_DEFINITION", - "description": " Create a Job.", - "canonical": true, - "file": "batch_service.create_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 84, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateJob", - "fullName": "google.cloud.batch.v1alpha.BatchService.CreateJob", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "job_id", - "type": "TYPE_STRING" - }, - { - "name": "job", - "type": ".google.cloud.batch.v1alpha.Job" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.batch.v1alpha.Job", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" - }, - "method": { - "shortName": "CreateJob", - "fullName": "google.cloud.batch.v1alpha.BatchService.CreateJob", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1alpha.BatchService" - } - } - } - }, - { - "regionTag": "batch_v1alpha_generated_BatchService_GetJob_async", - "title": "BatchService getJob Sample", - "origin": "API_DEFINITION", - "description": " Get a Job specified by its resource name.", - "canonical": true, - "file": "batch_service.get_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetJob", - "fullName": "google.cloud.batch.v1alpha.BatchService.GetJob", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.batch.v1alpha.Job", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" - }, - "method": { - "shortName": "GetJob", - "fullName": "google.cloud.batch.v1alpha.BatchService.GetJob", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1alpha.BatchService" - } - } - } - }, - { - "regionTag": "batch_v1alpha_generated_BatchService_DeleteJob_async", - "title": "BatchService deleteJob Sample", - "origin": "API_DEFINITION", - "description": " Delete a Job.", - "canonical": true, - "file": "batch_service.delete_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteJob", - "fullName": "google.cloud.batch.v1alpha.BatchService.DeleteJob", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "reason", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" - }, - "method": { - "shortName": "DeleteJob", - "fullName": "google.cloud.batch.v1alpha.BatchService.DeleteJob", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1alpha.BatchService" - } - } - } - }, - { - "regionTag": "batch_v1alpha_generated_BatchService_CancelJob_async", - "title": "BatchService cancelJob Sample", - "origin": "API_DEFINITION", - "description": " Cancel a Job.", - "canonical": true, - "file": "batch_service.cancel_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CancelJob", - "fullName": "google.cloud.batch.v1alpha.BatchService.CancelJob", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" - }, - "method": { - "shortName": "CancelJob", - "fullName": "google.cloud.batch.v1alpha.BatchService.CancelJob", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1alpha.BatchService" - } - } - } - }, - { - "regionTag": "batch_v1alpha_generated_BatchService_UpdateJob_async", - "title": "BatchService updateJob Sample", - "origin": "API_DEFINITION", - "description": " Update a Job.", - "canonical": true, - "file": "batch_service.update_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 87, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateJob", - "fullName": "google.cloud.batch.v1alpha.BatchService.UpdateJob", - "async": true, - "parameters": [ - { - "name": "job", - "type": ".google.cloud.batch.v1alpha.Job" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.batch.v1alpha.Job", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" - }, - "method": { - "shortName": "UpdateJob", - "fullName": "google.cloud.batch.v1alpha.BatchService.UpdateJob", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1alpha.BatchService" - } - } - } - }, - { - "regionTag": "batch_v1alpha_generated_BatchService_ListJobs_async", - "title": "BatchService listJobs Sample", - "origin": "API_DEFINITION", - "description": " List all Jobs for a project within a region.", - "canonical": true, - "file": "batch_service.list_jobs.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListJobs", - "fullName": "google.cloud.batch.v1alpha.BatchService.ListJobs", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.batch.v1alpha.ListJobsResponse", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" - }, - "method": { - "shortName": "ListJobs", - "fullName": "google.cloud.batch.v1alpha.BatchService.ListJobs", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1alpha.BatchService" - } - } - } - }, - { - "regionTag": "batch_v1alpha_generated_BatchService_GetTask_async", - "title": "BatchService getTask Sample", - "origin": "API_DEFINITION", - "description": " Return a single Task.", - "canonical": true, - "file": "batch_service.get_task.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetTask", - "fullName": "google.cloud.batch.v1alpha.BatchService.GetTask", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.batch.v1alpha.Task", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" - }, - "method": { - "shortName": "GetTask", - "fullName": "google.cloud.batch.v1alpha.BatchService.GetTask", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1alpha.BatchService" - } - } - } - }, - { - "regionTag": "batch_v1alpha_generated_BatchService_ListTasks_async", - "title": "BatchService listTasks Sample", - "origin": "API_DEFINITION", - "description": " List Tasks associated with a job.", - "canonical": true, - "file": "batch_service.list_tasks.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 75, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListTasks", - "fullName": "google.cloud.batch.v1alpha.BatchService.ListTasks", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.batch.v1alpha.ListTasksResponse", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" - }, - "method": { - "shortName": "ListTasks", - "fullName": "google.cloud.batch.v1alpha.BatchService.ListTasks", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1alpha.BatchService" - } - } - } - }, - { - "regionTag": "batch_v1alpha_generated_BatchService_CreateResourceAllowance_async", - "title": "BatchService createResourceAllowance Sample", - "origin": "API_DEFINITION", - "description": " Create a Resource Allowance.", - "canonical": true, - "file": "batch_service.create_resource_allowance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 85, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateResourceAllowance", - "fullName": "google.cloud.batch.v1alpha.BatchService.CreateResourceAllowance", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "resource_allowance_id", - "type": "TYPE_STRING" - }, - { - "name": "resource_allowance", - "type": ".google.cloud.batch.v1alpha.ResourceAllowance" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.batch.v1alpha.ResourceAllowance", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" - }, - "method": { - "shortName": "CreateResourceAllowance", - "fullName": "google.cloud.batch.v1alpha.BatchService.CreateResourceAllowance", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1alpha.BatchService" - } - } - } - }, - { - "regionTag": "batch_v1alpha_generated_BatchService_GetResourceAllowance_async", - "title": "BatchService getResourceAllowance Sample", - "origin": "API_DEFINITION", - "description": " Get a ResourceAllowance specified by its resource name.", - "canonical": true, - "file": "batch_service.get_resource_allowance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetResourceAllowance", - "fullName": "google.cloud.batch.v1alpha.BatchService.GetResourceAllowance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.batch.v1alpha.ResourceAllowance", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" - }, - "method": { - "shortName": "GetResourceAllowance", - "fullName": "google.cloud.batch.v1alpha.BatchService.GetResourceAllowance", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1alpha.BatchService" - } - } - } - }, - { - "regionTag": "batch_v1alpha_generated_BatchService_DeleteResourceAllowance_async", - "title": "BatchService deleteResourceAllowance Sample", - "origin": "API_DEFINITION", - "description": " Delete a ResourceAllowance.", - "canonical": true, - "file": "batch_service.delete_resource_allowance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 72, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteResourceAllowance", - "fullName": "google.cloud.batch.v1alpha.BatchService.DeleteResourceAllowance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "reason", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" - }, - "method": { - "shortName": "DeleteResourceAllowance", - "fullName": "google.cloud.batch.v1alpha.BatchService.DeleteResourceAllowance", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1alpha.BatchService" - } - } - } - }, - { - "regionTag": "batch_v1alpha_generated_BatchService_ListResourceAllowances_async", - "title": "BatchService listResourceAllowances Sample", - "origin": "API_DEFINITION", - "description": " List all ResourceAllowances for a project within a region.", - "canonical": true, - "file": "batch_service.list_resource_allowances.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListResourceAllowances", - "fullName": "google.cloud.batch.v1alpha.BatchService.ListResourceAllowances", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.batch.v1alpha.ListResourceAllowancesResponse", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" - }, - "method": { - "shortName": "ListResourceAllowances", - "fullName": "google.cloud.batch.v1alpha.BatchService.ListResourceAllowances", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1alpha.BatchService" - } - } - } - }, - { - "regionTag": "batch_v1alpha_generated_BatchService_UpdateResourceAllowance_async", - "title": "BatchService updateResourceAllowance Sample", - "origin": "API_DEFINITION", - "description": " Update a Resource Allowance.", - "canonical": true, - "file": "batch_service.update_resource_allowance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 80, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateResourceAllowance", - "fullName": "google.cloud.batch.v1alpha.BatchService.UpdateResourceAllowance", - "async": true, - "parameters": [ - { - "name": "resource_allowance", - "type": ".google.cloud.batch.v1alpha.ResourceAllowance" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.batch.v1alpha.ResourceAllowance", - "client": { - "shortName": "BatchServiceClient", - "fullName": "google.cloud.batch.v1alpha.BatchServiceClient" - }, - "method": { - "shortName": "UpdateResourceAllowance", - "fullName": "google.cloud.batch.v1alpha.BatchService.UpdateResourceAllowance", - "service": { - "shortName": "BatchService", - "fullName": "google.cloud.batch.v1alpha.BatchService" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/src/index.ts b/owl-bot-staging/google-cloud-batch/v1alpha/src/index.ts deleted file mode 100644 index 8208d9bc746..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/src/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 v1alpha from './v1alpha'; -const BatchServiceClient = v1alpha.BatchServiceClient; -type BatchServiceClient = v1alpha.BatchServiceClient; -export {v1alpha, BatchServiceClient}; -export default {v1alpha, BatchServiceClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_client.ts b/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_client.ts deleted file mode 100644 index c7897648928..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_client.ts +++ /dev/null @@ -1,2441 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); - -/** - * Client JSON configuration object, loaded from - * `src/v1alpha/batch_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './batch_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Google Batch Service. - * The service manages user submitted batch jobs and allocates Google Compute - * Engine VM instances to run the jobs. - * @class - * @memberof v1alpha - */ -export class BatchServiceClient { - 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; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - locationsClient: LocationsClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - batchServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of BatchServiceClient. - * - * @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://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @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 BatchServiceClient({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 BatchServiceClient; - 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 = 'batch.' + 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; - } - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process === 'object' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - jobPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - resourceAllowancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/resourceAllowances/{resource_allowance}' - ), - taskPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}/tasks/{task}' - ), - taskGroupPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}' - ), - }; - - // 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 = { - listJobs: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'jobs'), - listTasks: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'tasks'), - listResourceAllowances: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'resourceAllowances') - }; - - const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback) { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v1alpha/{name=projects/*/locations/*}',},{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1alpha/{name=projects/*}/locations',},{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1alpha/{name=projects/*/locations/*/operations/*}:cancel',body: '*',},{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1alpha/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1alpha/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1alpha/{name=projects/*/locations/*}/operations',}]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const deleteJobResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteJobMetadata = protoFilesRoot.lookup( - '.google.cloud.batch.v1alpha.OperationMetadata') as gax.protobuf.Type; - const cancelJobResponse = protoFilesRoot.lookup( - '.google.cloud.batch.v1alpha.CancelJobResponse') as gax.protobuf.Type; - const cancelJobMetadata = protoFilesRoot.lookup( - '.google.cloud.batch.v1alpha.OperationMetadata') as gax.protobuf.Type; - const deleteResourceAllowanceResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteResourceAllowanceMetadata = protoFilesRoot.lookup( - '.google.cloud.batch.v1alpha.OperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - deleteJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteJobResponse.decode.bind(deleteJobResponse), - deleteJobMetadata.decode.bind(deleteJobMetadata)), - cancelJob: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - cancelJobResponse.decode.bind(cancelJobResponse), - cancelJobMetadata.decode.bind(cancelJobMetadata)), - deleteResourceAllowance: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteResourceAllowanceResponse.decode.bind(deleteResourceAllowanceResponse), - deleteResourceAllowanceMetadata.decode.bind(deleteResourceAllowanceMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.batch.v1alpha.BatchService', 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.batchServiceStub) { - return this.batchServiceStub; - } - - // Put together the "service stub" for - // google.cloud.batch.v1alpha.BatchService. - this.batchServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.batch.v1alpha.BatchService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.batch.v1alpha.BatchService, - 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 batchServiceStubMethods = - ['createJob', 'getJob', 'deleteJob', 'cancelJob', 'updateJob', 'listJobs', 'getTask', 'listTasks', 'createResourceAllowance', 'getResourceAllowance', 'deleteResourceAllowance', 'listResourceAllowances', 'updateResourceAllowance']; - for (const methodName of batchServiceStubMethods) { - const callPromise = this.batchServiceStub.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.batchServiceStub; - } - - /** - * 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 'batch.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 'batch.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' - ]; - } - - 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 -- - // ------------------- -/** - * Create a Job. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name where the Job will be created. - * Pattern: "projects/{project}/locations/{location}" - * @param {string} request.jobId - * ID used to uniquely identify the Job within its parent scope. - * This field should contain at most 63 characters and must start with - * lowercase characters. - * Only lowercase characters, numbers and '-' are accepted. - * The '-' character cannot be the first or the last one. - * A system generated ID will be used if the field is not set. - * - * The job.name field in the request will be ignored and the created resource - * name of the Job will be "{parent}/jobs/{job_id}". - * @param {google.cloud.batch.v1alpha.Job} request.job - * Required. The Job to create. - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1alpha.Job|Job}. - * 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/v1alpha/batch_service.create_job.js - * region_tag:batch_v1alpha_generated_BatchService_CreateJob_async - */ - createJob( - request?: protos.google.cloud.batch.v1alpha.ICreateJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.batch.v1alpha.IJob, - protos.google.cloud.batch.v1alpha.ICreateJobRequest|undefined, {}|undefined - ]>; - createJob( - request: protos.google.cloud.batch.v1alpha.ICreateJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.batch.v1alpha.IJob, - protos.google.cloud.batch.v1alpha.ICreateJobRequest|null|undefined, - {}|null|undefined>): void; - createJob( - request: protos.google.cloud.batch.v1alpha.ICreateJobRequest, - callback: Callback< - protos.google.cloud.batch.v1alpha.IJob, - protos.google.cloud.batch.v1alpha.ICreateJobRequest|null|undefined, - {}|null|undefined>): void; - createJob( - request?: protos.google.cloud.batch.v1alpha.ICreateJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.batch.v1alpha.IJob, - protos.google.cloud.batch.v1alpha.ICreateJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.batch.v1alpha.IJob, - protos.google.cloud.batch.v1alpha.ICreateJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.batch.v1alpha.IJob, - protos.google.cloud.batch.v1alpha.ICreateJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.createJob(request, options, callback); - } -/** - * Get a Job specified by its resource name. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Job name. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1alpha.Job|Job}. - * 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/v1alpha/batch_service.get_job.js - * region_tag:batch_v1alpha_generated_BatchService_GetJob_async - */ - getJob( - request?: protos.google.cloud.batch.v1alpha.IGetJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.batch.v1alpha.IJob, - protos.google.cloud.batch.v1alpha.IGetJobRequest|undefined, {}|undefined - ]>; - getJob( - request: protos.google.cloud.batch.v1alpha.IGetJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.batch.v1alpha.IJob, - protos.google.cloud.batch.v1alpha.IGetJobRequest|null|undefined, - {}|null|undefined>): void; - getJob( - request: protos.google.cloud.batch.v1alpha.IGetJobRequest, - callback: Callback< - protos.google.cloud.batch.v1alpha.IJob, - protos.google.cloud.batch.v1alpha.IGetJobRequest|null|undefined, - {}|null|undefined>): void; - getJob( - request?: protos.google.cloud.batch.v1alpha.IGetJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.batch.v1alpha.IJob, - protos.google.cloud.batch.v1alpha.IGetJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.batch.v1alpha.IJob, - protos.google.cloud.batch.v1alpha.IGetJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.batch.v1alpha.IJob, - protos.google.cloud.batch.v1alpha.IGetJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getJob(request, options, callback); - } -/** - * Update a Job. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.batch.v1alpha.Job} request.job - * Required. The Job to update. - * Only fields specified in `updateMask` are updated. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. Mask of fields to update. - * - * The `jobs.patch` method can only be used while a job is in the `QUEUED`, - * `SCHEDULED`, or `RUNNING` state and currently only supports increasing the - * value of the first `taskCount` field in the job's `taskGroups` field. - * Therefore, you must set the value of `updateMask` to `taskGroups`. Any - * other job fields in the update request will be ignored. - * - * For example, to update a job's `taskCount` to `2`, set `updateMask` to - * `taskGroups` and use the following request body: - * ``` - * { - * "taskGroups":[{ - * "taskCount": 2 - * }] - * } - * ``` - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1alpha.Job|Job}. - * 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/v1alpha/batch_service.update_job.js - * region_tag:batch_v1alpha_generated_BatchService_UpdateJob_async - */ - updateJob( - request?: protos.google.cloud.batch.v1alpha.IUpdateJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.batch.v1alpha.IJob, - protos.google.cloud.batch.v1alpha.IUpdateJobRequest|undefined, {}|undefined - ]>; - updateJob( - request: protos.google.cloud.batch.v1alpha.IUpdateJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.batch.v1alpha.IJob, - protos.google.cloud.batch.v1alpha.IUpdateJobRequest|null|undefined, - {}|null|undefined>): void; - updateJob( - request: protos.google.cloud.batch.v1alpha.IUpdateJobRequest, - callback: Callback< - protos.google.cloud.batch.v1alpha.IJob, - protos.google.cloud.batch.v1alpha.IUpdateJobRequest|null|undefined, - {}|null|undefined>): void; - updateJob( - request?: protos.google.cloud.batch.v1alpha.IUpdateJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.batch.v1alpha.IJob, - protos.google.cloud.batch.v1alpha.IUpdateJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.batch.v1alpha.IJob, - protos.google.cloud.batch.v1alpha.IUpdateJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.batch.v1alpha.IJob, - protos.google.cloud.batch.v1alpha.IUpdateJobRequest|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({ - 'job.name': request.job!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateJob(request, options, callback); - } -/** - * Return a single Task. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Task name. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1alpha.Task|Task}. - * 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/v1alpha/batch_service.get_task.js - * region_tag:batch_v1alpha_generated_BatchService_GetTask_async - */ - getTask( - request?: protos.google.cloud.batch.v1alpha.IGetTaskRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.batch.v1alpha.ITask, - protos.google.cloud.batch.v1alpha.IGetTaskRequest|undefined, {}|undefined - ]>; - getTask( - request: protos.google.cloud.batch.v1alpha.IGetTaskRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.batch.v1alpha.ITask, - protos.google.cloud.batch.v1alpha.IGetTaskRequest|null|undefined, - {}|null|undefined>): void; - getTask( - request: protos.google.cloud.batch.v1alpha.IGetTaskRequest, - callback: Callback< - protos.google.cloud.batch.v1alpha.ITask, - protos.google.cloud.batch.v1alpha.IGetTaskRequest|null|undefined, - {}|null|undefined>): void; - getTask( - request?: protos.google.cloud.batch.v1alpha.IGetTaskRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.batch.v1alpha.ITask, - protos.google.cloud.batch.v1alpha.IGetTaskRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.batch.v1alpha.ITask, - protos.google.cloud.batch.v1alpha.IGetTaskRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.batch.v1alpha.ITask, - protos.google.cloud.batch.v1alpha.IGetTaskRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getTask(request, options, callback); - } -/** - * Create a Resource Allowance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name where the ResourceAllowance will be - * created. Pattern: "projects/{project}/locations/{location}" - * @param {string} request.resourceAllowanceId - * ID used to uniquely identify the ResourceAllowance within its parent scope. - * This field should contain at most 63 characters and must start with - * lowercase characters. - * Only lowercase characters, numbers and '-' are accepted. - * The '-' character cannot be the first or the last one. - * A system generated ID will be used if the field is not set. - * - * The resource_allowance.name field in the request will be ignored and the - * created resource name of the ResourceAllowance will be - * "{parent}/resourceAllowances/{resource_allowance_id}". - * @param {google.cloud.batch.v1alpha.ResourceAllowance} request.resourceAllowance - * Required. The ResourceAllowance to create. - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1alpha.ResourceAllowance|ResourceAllowance}. - * 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/v1alpha/batch_service.create_resource_allowance.js - * region_tag:batch_v1alpha_generated_BatchService_CreateResourceAllowance_async - */ - createResourceAllowance( - request?: protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.batch.v1alpha.IResourceAllowance, - protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest|undefined, {}|undefined - ]>; - createResourceAllowance( - request: protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.batch.v1alpha.IResourceAllowance, - protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest|null|undefined, - {}|null|undefined>): void; - createResourceAllowance( - request: protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest, - callback: Callback< - protos.google.cloud.batch.v1alpha.IResourceAllowance, - protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest|null|undefined, - {}|null|undefined>): void; - createResourceAllowance( - request?: protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.batch.v1alpha.IResourceAllowance, - protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.batch.v1alpha.IResourceAllowance, - protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.batch.v1alpha.IResourceAllowance, - protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.createResourceAllowance(request, options, callback); - } -/** - * Get a ResourceAllowance specified by its resource name. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. ResourceAllowance name. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1alpha.ResourceAllowance|ResourceAllowance}. - * 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/v1alpha/batch_service.get_resource_allowance.js - * region_tag:batch_v1alpha_generated_BatchService_GetResourceAllowance_async - */ - getResourceAllowance( - request?: protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.batch.v1alpha.IResourceAllowance, - protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest|undefined, {}|undefined - ]>; - getResourceAllowance( - request: protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.batch.v1alpha.IResourceAllowance, - protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest|null|undefined, - {}|null|undefined>): void; - getResourceAllowance( - request: protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest, - callback: Callback< - protos.google.cloud.batch.v1alpha.IResourceAllowance, - protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest|null|undefined, - {}|null|undefined>): void; - getResourceAllowance( - request?: protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.batch.v1alpha.IResourceAllowance, - protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.batch.v1alpha.IResourceAllowance, - protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.batch.v1alpha.IResourceAllowance, - protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getResourceAllowance(request, options, callback); - } -/** - * Update a Resource Allowance. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.batch.v1alpha.ResourceAllowance} request.resourceAllowance - * Required. The ResourceAllowance to update. - * Update description. - * Only fields specified in `update_mask` are updated. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. Mask of fields to update. - * - * Field mask is used to specify the fields to be overwritten in the - * ResourceAllowance resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * - * UpdateResourceAllowance request now only supports update on `limit` field. - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.cloud.batch.v1alpha.ResourceAllowance|ResourceAllowance}. - * 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/v1alpha/batch_service.update_resource_allowance.js - * region_tag:batch_v1alpha_generated_BatchService_UpdateResourceAllowance_async - */ - updateResourceAllowance( - request?: protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.batch.v1alpha.IResourceAllowance, - protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest|undefined, {}|undefined - ]>; - updateResourceAllowance( - request: protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.batch.v1alpha.IResourceAllowance, - protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest|null|undefined, - {}|null|undefined>): void; - updateResourceAllowance( - request: protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest, - callback: Callback< - protos.google.cloud.batch.v1alpha.IResourceAllowance, - protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest|null|undefined, - {}|null|undefined>): void; - updateResourceAllowance( - request?: protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.batch.v1alpha.IResourceAllowance, - protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.batch.v1alpha.IResourceAllowance, - protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.batch.v1alpha.IResourceAllowance, - protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'resource_allowance.name': request.resourceAllowance!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateResourceAllowance(request, options, callback); - } - -/** - * Delete a Job. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Job name. - * @param {string} [request.reason] - * Optional. Reason for this deletion. - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v1alpha/batch_service.delete_job.js - * region_tag:batch_v1alpha_generated_BatchService_DeleteJob_async - */ - deleteJob( - request?: protos.google.cloud.batch.v1alpha.IDeleteJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteJob( - request: protos.google.cloud.batch.v1alpha.IDeleteJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteJob( - request: protos.google.cloud.batch.v1alpha.IDeleteJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteJob( - request?: protos.google.cloud.batch.v1alpha.IDeleteJobRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteJob(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteJob()`. - * @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/v1alpha/batch_service.delete_job.js - * region_tag:batch_v1alpha_generated_BatchService_DeleteJob_async - */ - async checkDeleteJobProgress(name: string): Promise>{ - 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.deleteJob, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Cancel a Job. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Job name. - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v1alpha/batch_service.cancel_job.js - * region_tag:batch_v1alpha_generated_BatchService_CancelJob_async - */ - cancelJob( - request?: protos.google.cloud.batch.v1alpha.ICancelJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - cancelJob( - request: protos.google.cloud.batch.v1alpha.ICancelJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - cancelJob( - request: protos.google.cloud.batch.v1alpha.ICancelJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - cancelJob( - request?: protos.google.cloud.batch.v1alpha.ICancelJobRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.cancelJob(request, options, callback); - } -/** - * Check the status of the long running operation returned by `cancelJob()`. - * @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/v1alpha/batch_service.cancel_job.js - * region_tag:batch_v1alpha_generated_BatchService_CancelJob_async - */ - async checkCancelJobProgress(name: string): Promise>{ - 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.cancelJob, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Delete a ResourceAllowance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. ResourceAllowance name. - * @param {string} [request.reason] - * Optional. Reason for this deletion. - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v1alpha/batch_service.delete_resource_allowance.js - * region_tag:batch_v1alpha_generated_BatchService_DeleteResourceAllowance_async - */ - deleteResourceAllowance( - request?: protos.google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteResourceAllowance( - request: protos.google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteResourceAllowance( - request: protos.google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteResourceAllowance( - request?: protos.google.cloud.batch.v1alpha.IDeleteResourceAllowanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteResourceAllowance(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteResourceAllowance()`. - * @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/v1alpha/batch_service.delete_resource_allowance.js - * region_tag:batch_v1alpha_generated_BatchService_DeleteResourceAllowance_async - */ - async checkDeleteResourceAllowanceProgress(name: string): Promise>{ - 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.deleteResourceAllowance, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * List all Jobs for a project within a region. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Parent path. - * @param {string} request.filter - * List filter. - * @param {string} [request.orderBy] - * Optional. Sort results. Supported are "name", "name desc", "create_time", - * and "create_time desc". - * @param {number} request.pageSize - * Page size. - * @param {string} request.pageToken - * Page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.batch.v1alpha.Job|Job}. - * 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 `listJobsAsync()` - * 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. - */ - listJobs( - request?: protos.google.cloud.batch.v1alpha.IListJobsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.batch.v1alpha.IJob[], - protos.google.cloud.batch.v1alpha.IListJobsRequest|null, - protos.google.cloud.batch.v1alpha.IListJobsResponse - ]>; - listJobs( - request: protos.google.cloud.batch.v1alpha.IListJobsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.batch.v1alpha.IListJobsRequest, - protos.google.cloud.batch.v1alpha.IListJobsResponse|null|undefined, - protos.google.cloud.batch.v1alpha.IJob>): void; - listJobs( - request: protos.google.cloud.batch.v1alpha.IListJobsRequest, - callback: PaginationCallback< - protos.google.cloud.batch.v1alpha.IListJobsRequest, - protos.google.cloud.batch.v1alpha.IListJobsResponse|null|undefined, - protos.google.cloud.batch.v1alpha.IJob>): void; - listJobs( - request?: protos.google.cloud.batch.v1alpha.IListJobsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.batch.v1alpha.IListJobsRequest, - protos.google.cloud.batch.v1alpha.IListJobsResponse|null|undefined, - protos.google.cloud.batch.v1alpha.IJob>, - callback?: PaginationCallback< - protos.google.cloud.batch.v1alpha.IListJobsRequest, - protos.google.cloud.batch.v1alpha.IListJobsResponse|null|undefined, - protos.google.cloud.batch.v1alpha.IJob>): - Promise<[ - protos.google.cloud.batch.v1alpha.IJob[], - protos.google.cloud.batch.v1alpha.IListJobsRequest|null, - protos.google.cloud.batch.v1alpha.IListJobsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listJobs(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Parent path. - * @param {string} request.filter - * List filter. - * @param {string} [request.orderBy] - * Optional. Sort results. Supported are "name", "name desc", "create_time", - * and "create_time desc". - * @param {number} request.pageSize - * Page size. - * @param {string} request.pageToken - * Page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.batch.v1alpha.Job|Job} 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 `listJobsAsync()` - * 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. - */ - listJobsStream( - request?: protos.google.cloud.batch.v1alpha.IListJobsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listJobs.createStream( - this.innerApiCalls.listJobs as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listJobs`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Parent path. - * @param {string} request.filter - * List filter. - * @param {string} [request.orderBy] - * Optional. Sort results. Supported are "name", "name desc", "create_time", - * and "create_time desc". - * @param {number} request.pageSize - * Page size. - * @param {string} request.pageToken - * Page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.batch.v1alpha.Job|Job}. 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/v1alpha/batch_service.list_jobs.js - * region_tag:batch_v1alpha_generated_BatchService_ListJobs_async - */ - listJobsAsync( - request?: protos.google.cloud.batch.v1alpha.IListJobsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listJobs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listJobs.asyncIterate( - this.innerApiCalls['listJobs'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * List Tasks associated with a job. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of a TaskGroup from which Tasks are being requested. - * Pattern: - * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" - * @param {string} request.filter - * Task filter, null filter matches all Tasks. - * Filter string should be of the format State=TaskStatus.State e.g. - * State=RUNNING - * @param {string} request.orderBy - * Not implemented. - * @param {number} request.pageSize - * Page size. - * @param {string} request.pageToken - * Page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.batch.v1alpha.Task|Task}. - * 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 `listTasksAsync()` - * 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. - */ - listTasks( - request?: protos.google.cloud.batch.v1alpha.IListTasksRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.batch.v1alpha.ITask[], - protos.google.cloud.batch.v1alpha.IListTasksRequest|null, - protos.google.cloud.batch.v1alpha.IListTasksResponse - ]>; - listTasks( - request: protos.google.cloud.batch.v1alpha.IListTasksRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.batch.v1alpha.IListTasksRequest, - protos.google.cloud.batch.v1alpha.IListTasksResponse|null|undefined, - protos.google.cloud.batch.v1alpha.ITask>): void; - listTasks( - request: protos.google.cloud.batch.v1alpha.IListTasksRequest, - callback: PaginationCallback< - protos.google.cloud.batch.v1alpha.IListTasksRequest, - protos.google.cloud.batch.v1alpha.IListTasksResponse|null|undefined, - protos.google.cloud.batch.v1alpha.ITask>): void; - listTasks( - request?: protos.google.cloud.batch.v1alpha.IListTasksRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.batch.v1alpha.IListTasksRequest, - protos.google.cloud.batch.v1alpha.IListTasksResponse|null|undefined, - protos.google.cloud.batch.v1alpha.ITask>, - callback?: PaginationCallback< - protos.google.cloud.batch.v1alpha.IListTasksRequest, - protos.google.cloud.batch.v1alpha.IListTasksResponse|null|undefined, - protos.google.cloud.batch.v1alpha.ITask>): - Promise<[ - protos.google.cloud.batch.v1alpha.ITask[], - protos.google.cloud.batch.v1alpha.IListTasksRequest|null, - protos.google.cloud.batch.v1alpha.IListTasksResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listTasks(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of a TaskGroup from which Tasks are being requested. - * Pattern: - * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" - * @param {string} request.filter - * Task filter, null filter matches all Tasks. - * Filter string should be of the format State=TaskStatus.State e.g. - * State=RUNNING - * @param {string} request.orderBy - * Not implemented. - * @param {number} request.pageSize - * Page size. - * @param {string} request.pageToken - * Page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.batch.v1alpha.Task|Task} 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 `listTasksAsync()` - * 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. - */ - listTasksStream( - request?: protos.google.cloud.batch.v1alpha.IListTasksRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listTasks']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTasks.createStream( - this.innerApiCalls.listTasks as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listTasks`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Name of a TaskGroup from which Tasks are being requested. - * Pattern: - * "projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}" - * @param {string} request.filter - * Task filter, null filter matches all Tasks. - * Filter string should be of the format State=TaskStatus.State e.g. - * State=RUNNING - * @param {string} request.orderBy - * Not implemented. - * @param {number} request.pageSize - * Page size. - * @param {string} request.pageToken - * Page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.batch.v1alpha.Task|Task}. 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/v1alpha/batch_service.list_tasks.js - * region_tag:batch_v1alpha_generated_BatchService_ListTasks_async - */ - listTasksAsync( - request?: protos.google.cloud.batch.v1alpha.IListTasksRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listTasks']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTasks.asyncIterate( - this.innerApiCalls['listTasks'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * List all ResourceAllowances for a project within a region. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent path. - * @param {number} [request.pageSize] - * Optional. Page size. - * @param {string} [request.pageToken] - * Optional. Page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.batch.v1alpha.ResourceAllowance|ResourceAllowance}. - * 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 `listResourceAllowancesAsync()` - * 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. - */ - listResourceAllowances( - request?: protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.batch.v1alpha.IResourceAllowance[], - protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest|null, - protos.google.cloud.batch.v1alpha.IListResourceAllowancesResponse - ]>; - listResourceAllowances( - request: protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, - protos.google.cloud.batch.v1alpha.IListResourceAllowancesResponse|null|undefined, - protos.google.cloud.batch.v1alpha.IResourceAllowance>): void; - listResourceAllowances( - request: protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, - callback: PaginationCallback< - protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, - protos.google.cloud.batch.v1alpha.IListResourceAllowancesResponse|null|undefined, - protos.google.cloud.batch.v1alpha.IResourceAllowance>): void; - listResourceAllowances( - request?: protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, - protos.google.cloud.batch.v1alpha.IListResourceAllowancesResponse|null|undefined, - protos.google.cloud.batch.v1alpha.IResourceAllowance>, - callback?: PaginationCallback< - protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, - protos.google.cloud.batch.v1alpha.IListResourceAllowancesResponse|null|undefined, - protos.google.cloud.batch.v1alpha.IResourceAllowance>): - Promise<[ - protos.google.cloud.batch.v1alpha.IResourceAllowance[], - protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest|null, - protos.google.cloud.batch.v1alpha.IListResourceAllowancesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listResourceAllowances(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent path. - * @param {number} [request.pageSize] - * Optional. Page size. - * @param {string} [request.pageToken] - * Optional. Page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.batch.v1alpha.ResourceAllowance|ResourceAllowance} 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 `listResourceAllowancesAsync()` - * 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. - */ - listResourceAllowancesStream( - request?: protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listResourceAllowances']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listResourceAllowances.createStream( - this.innerApiCalls.listResourceAllowances as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listResourceAllowances`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent path. - * @param {number} [request.pageSize] - * Optional. Page size. - * @param {string} [request.pageToken] - * Optional. Page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.batch.v1alpha.ResourceAllowance|ResourceAllowance}. 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/v1alpha/batch_service.list_resource_allowances.js - * region_tag:batch_v1alpha_generated_BatchService_ListResourceAllowances_async - */ - listResourceAllowancesAsync( - request?: protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listResourceAllowances']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listResourceAllowances.asyncIterate( - this.innerApiCalls['listResourceAllowances'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the location. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 google.cloud.location.Location | Location}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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.name - * The resource that owns the locations collection, if applicable. - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link google.cloud.location.Location | Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * 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, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@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 { - 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, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@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, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified job resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @returns {string} Resource name string. - */ - jobPath(project:string,location:string,job:string) { - return this.pathTemplates.jobPathTemplate.render({ - project: project, - location: location, - job: job, - }); - } - - /** - * Parse the project from Job resource. - * - * @param {string} jobName - * A fully-qualified path representing Job resource. - * @returns {string} A string representing the project. - */ - matchProjectFromJobName(jobName: string) { - return this.pathTemplates.jobPathTemplate.match(jobName).project; - } - - /** - * Parse the location from Job resource. - * - * @param {string} jobName - * A fully-qualified path representing Job resource. - * @returns {string} A string representing the location. - */ - matchLocationFromJobName(jobName: string) { - return this.pathTemplates.jobPathTemplate.match(jobName).location; - } - - /** - * Parse the job from Job resource. - * - * @param {string} jobName - * A fully-qualified path representing Job resource. - * @returns {string} A string representing the job. - */ - matchJobFromJobName(jobName: string) { - return this.pathTemplates.jobPathTemplate.match(jobName).job; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified project resource name string. - * - * @param {string} project - * @returns {string} Resource name string. - */ - projectPath(project:string) { - return this.pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the project from Project resource. - * - * @param {string} projectName - * A fully-qualified path representing Project resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectName(projectName: string) { - return this.pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * Return a fully-qualified resourceAllowance resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} resource_allowance - * @returns {string} Resource name string. - */ - resourceAllowancePath(project:string,location:string,resourceAllowance:string) { - return this.pathTemplates.resourceAllowancePathTemplate.render({ - project: project, - location: location, - resource_allowance: resourceAllowance, - }); - } - - /** - * Parse the project from ResourceAllowance resource. - * - * @param {string} resourceAllowanceName - * A fully-qualified path representing ResourceAllowance resource. - * @returns {string} A string representing the project. - */ - matchProjectFromResourceAllowanceName(resourceAllowanceName: string) { - return this.pathTemplates.resourceAllowancePathTemplate.match(resourceAllowanceName).project; - } - - /** - * Parse the location from ResourceAllowance resource. - * - * @param {string} resourceAllowanceName - * A fully-qualified path representing ResourceAllowance resource. - * @returns {string} A string representing the location. - */ - matchLocationFromResourceAllowanceName(resourceAllowanceName: string) { - return this.pathTemplates.resourceAllowancePathTemplate.match(resourceAllowanceName).location; - } - - /** - * Parse the resource_allowance from ResourceAllowance resource. - * - * @param {string} resourceAllowanceName - * A fully-qualified path representing ResourceAllowance resource. - * @returns {string} A string representing the resource_allowance. - */ - matchResourceAllowanceFromResourceAllowanceName(resourceAllowanceName: string) { - return this.pathTemplates.resourceAllowancePathTemplate.match(resourceAllowanceName).resource_allowance; - } - - /** - * Return a fully-qualified task resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @param {string} task_group - * @param {string} task - * @returns {string} Resource name string. - */ - taskPath(project:string,location:string,job:string,taskGroup:string,task:string) { - return this.pathTemplates.taskPathTemplate.render({ - project: project, - location: location, - job: job, - task_group: taskGroup, - task: task, - }); - } - - /** - * Parse the project from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).project; - } - - /** - * Parse the location from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).location; - } - - /** - * Parse the job from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the job. - */ - matchJobFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).job; - } - - /** - * Parse the task_group from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the task_group. - */ - matchTaskGroupFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).task_group; - } - - /** - * Parse the task from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the task. - */ - matchTaskFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).task; - } - - /** - * Return a fully-qualified taskGroup resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} job - * @param {string} task_group - * @returns {string} Resource name string. - */ - taskGroupPath(project:string,location:string,job:string,taskGroup:string) { - return this.pathTemplates.taskGroupPathTemplate.render({ - project: project, - location: location, - job: job, - task_group: taskGroup, - }); - } - - /** - * Parse the project from TaskGroup resource. - * - * @param {string} taskGroupName - * A fully-qualified path representing TaskGroup resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTaskGroupName(taskGroupName: string) { - return this.pathTemplates.taskGroupPathTemplate.match(taskGroupName).project; - } - - /** - * Parse the location from TaskGroup resource. - * - * @param {string} taskGroupName - * A fully-qualified path representing TaskGroup resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTaskGroupName(taskGroupName: string) { - return this.pathTemplates.taskGroupPathTemplate.match(taskGroupName).location; - } - - /** - * Parse the job from TaskGroup resource. - * - * @param {string} taskGroupName - * A fully-qualified path representing TaskGroup resource. - * @returns {string} A string representing the job. - */ - matchJobFromTaskGroupName(taskGroupName: string) { - return this.pathTemplates.taskGroupPathTemplate.match(taskGroupName).job; - } - - /** - * Parse the task_group from TaskGroup resource. - * - * @param {string} taskGroupName - * A fully-qualified path representing TaskGroup resource. - * @returns {string} A string representing the task_group. - */ - matchTaskGroupFromTaskGroupName(taskGroupName: string) { - return this.pathTemplates.taskGroupPathTemplate.match(taskGroupName).task_group; - } - - /** - * 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.batchServiceStub && !this._terminated) { - return this.batchServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.locationsClient.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_client_config.json b/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_client_config.json deleted file mode 100644 index 6ac4ca807a8..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_client_config.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "interfaces": { - "google.cloud.batch.v1alpha.BatchService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "unavailable": [ - "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 - }, - "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateJob": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetJob": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "DeleteJob": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CancelJob": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateJob": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListJobs": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "GetTask": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "ListTasks": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "CreateResourceAllowance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetResourceAllowance": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "DeleteResourceAllowance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListResourceAllowances": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "UpdateResourceAllowance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_proto_list.json b/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_proto_list.json deleted file mode 100644 index cd5a69f0276..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/batch_service_proto_list.json +++ /dev/null @@ -1,8 +0,0 @@ -[ - "../../protos/google/cloud/batch/v1alpha/batch.proto", - "../../protos/google/cloud/batch/v1alpha/job.proto", - "../../protos/google/cloud/batch/v1alpha/notification.proto", - "../../protos/google/cloud/batch/v1alpha/resource_allowance.proto", - "../../protos/google/cloud/batch/v1alpha/task.proto", - "../../protos/google/cloud/batch/v1alpha/volume.proto" -] diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/gapic_metadata.json b/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/gapic_metadata.json deleted file mode 100644 index 4e922577356..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/gapic_metadata.json +++ /dev/null @@ -1,165 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.batch.v1alpha", - "libraryPackage": "@google-cloud/batch", - "services": { - "BatchService": { - "clients": { - "grpc": { - "libraryClient": "BatchServiceClient", - "rpcs": { - "CreateJob": { - "methods": [ - "createJob" - ] - }, - "GetJob": { - "methods": [ - "getJob" - ] - }, - "UpdateJob": { - "methods": [ - "updateJob" - ] - }, - "GetTask": { - "methods": [ - "getTask" - ] - }, - "CreateResourceAllowance": { - "methods": [ - "createResourceAllowance" - ] - }, - "GetResourceAllowance": { - "methods": [ - "getResourceAllowance" - ] - }, - "UpdateResourceAllowance": { - "methods": [ - "updateResourceAllowance" - ] - }, - "DeleteJob": { - "methods": [ - "deleteJob" - ] - }, - "CancelJob": { - "methods": [ - "cancelJob" - ] - }, - "DeleteResourceAllowance": { - "methods": [ - "deleteResourceAllowance" - ] - }, - "ListJobs": { - "methods": [ - "listJobs", - "listJobsStream", - "listJobsAsync" - ] - }, - "ListTasks": { - "methods": [ - "listTasks", - "listTasksStream", - "listTasksAsync" - ] - }, - "ListResourceAllowances": { - "methods": [ - "listResourceAllowances", - "listResourceAllowancesStream", - "listResourceAllowancesAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "BatchServiceClient", - "rpcs": { - "CreateJob": { - "methods": [ - "createJob" - ] - }, - "GetJob": { - "methods": [ - "getJob" - ] - }, - "UpdateJob": { - "methods": [ - "updateJob" - ] - }, - "GetTask": { - "methods": [ - "getTask" - ] - }, - "CreateResourceAllowance": { - "methods": [ - "createResourceAllowance" - ] - }, - "GetResourceAllowance": { - "methods": [ - "getResourceAllowance" - ] - }, - "UpdateResourceAllowance": { - "methods": [ - "updateResourceAllowance" - ] - }, - "DeleteJob": { - "methods": [ - "deleteJob" - ] - }, - "CancelJob": { - "methods": [ - "cancelJob" - ] - }, - "DeleteResourceAllowance": { - "methods": [ - "deleteResourceAllowance" - ] - }, - "ListJobs": { - "methods": [ - "listJobs", - "listJobsStream", - "listJobsAsync" - ] - }, - "ListTasks": { - "methods": [ - "listTasks", - "listTasksStream", - "listTasksAsync" - ] - }, - "ListResourceAllowances": { - "methods": [ - "listResourceAllowances", - "listResourceAllowancesStream", - "listResourceAllowancesAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/index.ts b/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/index.ts deleted file mode 100644 index fb53b495001..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/src/v1alpha/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {BatchServiceClient} from './batch_service_client'; diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-batch/v1alpha/system-test/fixtures/sample/src/index.js deleted file mode 100644 index b9ac0eb683e..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -/* eslint-disable node/no-missing-require, no-unused-vars */ -const batch = require('@google-cloud/batch'); - -function main() { - const batchServiceClient = new batch.BatchServiceClient(); -} - -main(); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-batch/v1alpha/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index c43e51952e7..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 {BatchServiceClient} from '@google-cloud/batch'; - -// check that the client class type name can be used -function doStuffWithBatchServiceClient(client: BatchServiceClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const batchServiceClient = new BatchServiceClient(); - doStuffWithBatchServiceClient(batchServiceClient); -} - -main(); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/system-test/install.ts b/owl-bot-staging/google-cloud-batch/v1alpha/system-test/install.ts deleted file mode 100644 index fd5bfdc71d5..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {packNTest} from 'pack-n-play'; -import {readFileSync} from 'fs'; -import {describe, it} from 'mocha'; - -describe('📦 pack-n-play test', () => { - - it('TypeScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'TypeScript user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() - } - }; - await packNTest(options); - }); - - it('JavaScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'JavaScript user can use the library', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() - } - }; - await packNTest(options); - }); - -}); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/test/gapic_batch_service_v1alpha.ts b/owl-bot-staging/google-cloud-batch/v1alpha/test/gapic_batch_service_v1alpha.ts deleted file mode 100644 index 1ef8a8bde46..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/test/gapic_batch_service_v1alpha.ts +++ /dev/null @@ -1,2938 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 batchserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos, LocationProtos} 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('v1alpha.BatchServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'batch.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient(); - 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 = batchserviceModule.v1alpha.BatchServiceClient.servicePath; - assert.strictEqual(servicePath, 'batch.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = batchserviceModule.v1alpha.BatchServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'batch.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'batch.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'batch.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 batchserviceModule.v1alpha.BatchServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'batch.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 batchserviceModule.v1alpha.BatchServiceClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'batch.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 batchserviceModule.v1alpha.BatchServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = batchserviceModule.v1alpha.BatchServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.batchServiceStub, undefined); - await client.initialize(); - assert(client.batchServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.batchServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.batchServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - 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 batchserviceModule.v1alpha.BatchServiceClient({ - 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('createJob', () => { - it('invokes createJob without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.CreateJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.CreateJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.Job() - ); - client.innerApiCalls.createJob = stubSimpleCall(expectedResponse); - const [response] = await client.createJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createJob without error using callback', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.CreateJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.CreateJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.Job() - ); - client.innerApiCalls.createJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createJob( - request, - (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.IJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createJob with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.CreateJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.CreateJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createJob(request), expectedError); - const actualRequest = (client.innerApiCalls.createJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createJob with closed client', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.CreateJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.CreateJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createJob(request), expectedError); - }); - }); - - describe('getJob', () => { - it('invokes getJob without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.GetJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.GetJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.Job() - ); - client.innerApiCalls.getJob = stubSimpleCall(expectedResponse); - const [response] = await client.getJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getJob without error using callback', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.GetJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.GetJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.Job() - ); - client.innerApiCalls.getJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getJob( - request, - (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.IJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getJob with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.GetJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.GetJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getJob(request), expectedError); - const actualRequest = (client.innerApiCalls.getJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getJob with closed client', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.GetJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.GetJobRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getJob(request), expectedError); - }); - }); - - describe('updateJob', () => { - it('invokes updateJob without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.UpdateJobRequest() - ); - request.job ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.UpdateJobRequest', ['job', 'name']); - request.job.name = defaultValue1; - const expectedHeaderRequestParams = `job.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.Job() - ); - client.innerApiCalls.updateJob = stubSimpleCall(expectedResponse); - const [response] = await client.updateJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateJob without error using callback', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.UpdateJobRequest() - ); - request.job ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.UpdateJobRequest', ['job', 'name']); - request.job.name = defaultValue1; - const expectedHeaderRequestParams = `job.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.Job() - ); - client.innerApiCalls.updateJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateJob( - request, - (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.IJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateJob with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.UpdateJobRequest() - ); - request.job ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.UpdateJobRequest', ['job', 'name']); - request.job.name = defaultValue1; - const expectedHeaderRequestParams = `job.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateJob(request), expectedError); - const actualRequest = (client.innerApiCalls.updateJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateJob with closed client', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.UpdateJobRequest() - ); - request.job ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.UpdateJobRequest', ['job', 'name']); - request.job.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateJob(request), expectedError); - }); - }); - - describe('getTask', () => { - it('invokes getTask without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.GetTaskRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.GetTaskRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.Task() - ); - client.innerApiCalls.getTask = stubSimpleCall(expectedResponse); - const [response] = await client.getTask(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getTask as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTask as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getTask without error using callback', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.GetTaskRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.GetTaskRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.Task() - ); - client.innerApiCalls.getTask = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getTask( - request, - (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.ITask|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getTask as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTask as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getTask with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.GetTaskRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.GetTaskRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getTask = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTask(request), expectedError); - const actualRequest = (client.innerApiCalls.getTask as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTask as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getTask with closed client', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.GetTaskRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.GetTaskRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getTask(request), expectedError); - }); - }); - - describe('createResourceAllowance', () => { - it('invokes createResourceAllowance without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ResourceAllowance() - ); - client.innerApiCalls.createResourceAllowance = stubSimpleCall(expectedResponse); - const [response] = await client.createResourceAllowance(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createResourceAllowance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createResourceAllowance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createResourceAllowance without error using callback', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ResourceAllowance() - ); - client.innerApiCalls.createResourceAllowance = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createResourceAllowance( - request, - (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.IResourceAllowance|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createResourceAllowance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createResourceAllowance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createResourceAllowance with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createResourceAllowance = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createResourceAllowance(request), expectedError); - const actualRequest = (client.innerApiCalls.createResourceAllowance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createResourceAllowance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createResourceAllowance with closed client', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.CreateResourceAllowanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createResourceAllowance(request), expectedError); - }); - }); - - describe('getResourceAllowance', () => { - it('invokes getResourceAllowance without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.GetResourceAllowanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.GetResourceAllowanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ResourceAllowance() - ); - client.innerApiCalls.getResourceAllowance = stubSimpleCall(expectedResponse); - const [response] = await client.getResourceAllowance(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getResourceAllowance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getResourceAllowance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getResourceAllowance without error using callback', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.GetResourceAllowanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.GetResourceAllowanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ResourceAllowance() - ); - client.innerApiCalls.getResourceAllowance = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getResourceAllowance( - request, - (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.IResourceAllowance|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getResourceAllowance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getResourceAllowance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getResourceAllowance with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.GetResourceAllowanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.GetResourceAllowanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getResourceAllowance = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getResourceAllowance(request), expectedError); - const actualRequest = (client.innerApiCalls.getResourceAllowance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getResourceAllowance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getResourceAllowance with closed client', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.GetResourceAllowanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.GetResourceAllowanceRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getResourceAllowance(request), expectedError); - }); - }); - - describe('updateResourceAllowance', () => { - it('invokes updateResourceAllowance without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest() - ); - request.resourceAllowance ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest', ['resourceAllowance', 'name']); - request.resourceAllowance.name = defaultValue1; - const expectedHeaderRequestParams = `resource_allowance.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ResourceAllowance() - ); - client.innerApiCalls.updateResourceAllowance = stubSimpleCall(expectedResponse); - const [response] = await client.updateResourceAllowance(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateResourceAllowance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateResourceAllowance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateResourceAllowance without error using callback', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest() - ); - request.resourceAllowance ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest', ['resourceAllowance', 'name']); - request.resourceAllowance.name = defaultValue1; - const expectedHeaderRequestParams = `resource_allowance.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ResourceAllowance() - ); - client.innerApiCalls.updateResourceAllowance = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateResourceAllowance( - request, - (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.IResourceAllowance|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateResourceAllowance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateResourceAllowance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateResourceAllowance with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest() - ); - request.resourceAllowance ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest', ['resourceAllowance', 'name']); - request.resourceAllowance.name = defaultValue1; - const expectedHeaderRequestParams = `resource_allowance.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateResourceAllowance = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateResourceAllowance(request), expectedError); - const actualRequest = (client.innerApiCalls.updateResourceAllowance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateResourceAllowance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateResourceAllowance with closed client', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest() - ); - request.resourceAllowance ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.UpdateResourceAllowanceRequest', ['resourceAllowance', 'name']); - request.resourceAllowance.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateResourceAllowance(request), expectedError); - }); - }); - - describe('deleteJob', () => { - it('invokes deleteJob without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.DeleteJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.DeleteJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteJob(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteJob without error using callback', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.DeleteJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.DeleteJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteJob( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteJob with call error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.DeleteJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.DeleteJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteJob(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteJob with LRO error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.DeleteJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.DeleteJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteJob(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteJobProgress without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - 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.checkDeleteJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteJobProgress with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('cancelJob', () => { - it('invokes cancelJob without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.CancelJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.CancelJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.cancelJob = stubLongRunningCall(expectedResponse); - const [operation] = await client.cancelJob(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.cancelJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes cancelJob without error using callback', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.CancelJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.CancelJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.cancelJob = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.cancelJob( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.cancelJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes cancelJob with call error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.CancelJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.CancelJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.cancelJob(request), expectedError); - const actualRequest = (client.innerApiCalls.cancelJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes cancelJob with LRO error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.CancelJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.CancelJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.cancelJob(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.cancelJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCancelJobProgress without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - 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.checkCancelJobProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCancelJobProgress with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCancelJobProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteResourceAllowance', () => { - it('invokes deleteResourceAllowance without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteResourceAllowance = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteResourceAllowance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteResourceAllowance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteResourceAllowance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteResourceAllowance without error using callback', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteResourceAllowance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteResourceAllowance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteResourceAllowance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteResourceAllowance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteResourceAllowance with call error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteResourceAllowance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteResourceAllowance(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteResourceAllowance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteResourceAllowance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteResourceAllowance with LRO error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.DeleteResourceAllowanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteResourceAllowance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteResourceAllowance(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteResourceAllowance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteResourceAllowance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteResourceAllowanceProgress without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - 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.checkDeleteResourceAllowanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteResourceAllowanceProgress with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteResourceAllowanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listJobs', () => { - it('invokes listJobs without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), - ]; - client.innerApiCalls.listJobs = stubSimpleCall(expectedResponse); - const [response] = await client.listJobs(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listJobs without error using callback', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), - ]; - client.innerApiCalls.listJobs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listJobs( - request, - (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.IJob[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listJobs with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listJobs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listJobs(request), expectedError); - const actualRequest = (client.innerApiCalls.listJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listJobsStream without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), - ]; - client.descriptors.page.listJobs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.batch.v1alpha.Job[] = []; - stream.on('data', (response: protos.google.cloud.batch.v1alpha.Job) => { - 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.listJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listJobs, request)); - assert( - (client.descriptors.page.listJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listJobsStream with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listJobs.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.batch.v1alpha.Job[] = []; - stream.on('data', (response: protos.google.cloud.batch.v1alpha.Job) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listJobs, request)); - assert( - (client.descriptors.page.listJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listJobs without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), - ]; - client.descriptors.page.listJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.batch.v1alpha.IJob[] = []; - const iterable = client.listJobsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listJobs with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listJobsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.batch.v1alpha.IJob[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listTasks', () => { - it('invokes listTasks without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListTasksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), - ]; - client.innerApiCalls.listTasks = stubSimpleCall(expectedResponse); - const [response] = await client.listTasks(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listTasks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTasks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listTasks without error using callback', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListTasksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), - ]; - client.innerApiCalls.listTasks = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listTasks( - request, - (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.ITask[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listTasks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTasks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listTasks with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListTasksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listTasks = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTasks(request), expectedError); - const actualRequest = (client.innerApiCalls.listTasks as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTasks as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listTasksStream without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListTasksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), - ]; - client.descriptors.page.listTasks.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listTasksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.batch.v1alpha.Task[] = []; - stream.on('data', (response: protos.google.cloud.batch.v1alpha.Task) => { - 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.listTasks.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTasks, request)); - assert( - (client.descriptors.page.listTasks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listTasksStream with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListTasksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listTasks.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listTasksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.batch.v1alpha.Task[] = []; - stream.on('data', (response: protos.google.cloud.batch.v1alpha.Task) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listTasks.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTasks, request)); - assert( - (client.descriptors.page.listTasks.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listTasks without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListTasksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), - ]; - client.descriptors.page.listTasks.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.batch.v1alpha.ITask[] = []; - const iterable = client.listTasksAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listTasks.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listTasks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listTasks with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListTasksRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListTasksRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listTasks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listTasksAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.batch.v1alpha.ITask[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listTasks.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listTasks.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listResourceAllowances', () => { - it('invokes listResourceAllowances without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListResourceAllowancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListResourceAllowancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), - ]; - client.innerApiCalls.listResourceAllowances = stubSimpleCall(expectedResponse); - const [response] = await client.listResourceAllowances(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listResourceAllowances as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listResourceAllowances as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listResourceAllowances without error using callback', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListResourceAllowancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListResourceAllowancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), - ]; - client.innerApiCalls.listResourceAllowances = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listResourceAllowances( - request, - (err?: Error|null, result?: protos.google.cloud.batch.v1alpha.IResourceAllowance[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listResourceAllowances as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listResourceAllowances as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listResourceAllowances with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListResourceAllowancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListResourceAllowancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listResourceAllowances = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listResourceAllowances(request), expectedError); - const actualRequest = (client.innerApiCalls.listResourceAllowances as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listResourceAllowances as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listResourceAllowancesStream without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListResourceAllowancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListResourceAllowancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), - ]; - client.descriptors.page.listResourceAllowances.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listResourceAllowancesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.batch.v1alpha.ResourceAllowance[] = []; - stream.on('data', (response: protos.google.cloud.batch.v1alpha.ResourceAllowance) => { - 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.listResourceAllowances.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listResourceAllowances, request)); - assert( - (client.descriptors.page.listResourceAllowances.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listResourceAllowancesStream with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListResourceAllowancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListResourceAllowancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listResourceAllowances.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listResourceAllowancesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.batch.v1alpha.ResourceAllowance[] = []; - stream.on('data', (response: protos.google.cloud.batch.v1alpha.ResourceAllowance) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listResourceAllowances.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listResourceAllowances, request)); - assert( - (client.descriptors.page.listResourceAllowances.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listResourceAllowances without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListResourceAllowancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListResourceAllowancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), - generateSampleMessage(new protos.google.cloud.batch.v1alpha.ResourceAllowance()), - ]; - client.descriptors.page.listResourceAllowances.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.batch.v1alpha.IResourceAllowance[] = []; - const iterable = client.listResourceAllowancesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listResourceAllowances.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listResourceAllowances.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listResourceAllowances with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.batch.v1alpha.ListResourceAllowancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.batch.v1alpha.ListResourceAllowancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listResourceAllowances.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listResourceAllowancesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.batch.v1alpha.IResourceAllowance[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listResourceAllowances.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listResourceAllowances.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation without error using callback', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.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 batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - 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 batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - 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 batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - 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 batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - describe('Path templates', () => { - - describe('job', () => { - const fakePath = "/rendered/path/job"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - }; - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.jobPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.jobPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('jobPath', () => { - const result = client.jobPath("projectValue", "locationValue", "jobValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.jobPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromJobName', () => { - const result = client.matchProjectFromJobName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.jobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromJobName', () => { - const result = client.matchLocationFromJobName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.jobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchJobFromJobName', () => { - const result = client.matchJobFromJobName(fakePath); - assert.strictEqual(result, "jobValue"); - assert((client.pathTemplates.jobPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('resourceAllowance', () => { - const fakePath = "/rendered/path/resourceAllowance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - resource_allowance: "resourceAllowanceValue", - }; - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.resourceAllowancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.resourceAllowancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('resourceAllowancePath', () => { - const result = client.resourceAllowancePath("projectValue", "locationValue", "resourceAllowanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.resourceAllowancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromResourceAllowanceName', () => { - const result = client.matchProjectFromResourceAllowanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.resourceAllowancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromResourceAllowanceName', () => { - const result = client.matchLocationFromResourceAllowanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.resourceAllowancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchResourceAllowanceFromResourceAllowanceName', () => { - const result = client.matchResourceAllowanceFromResourceAllowanceName(fakePath); - assert.strictEqual(result, "resourceAllowanceValue"); - assert((client.pathTemplates.resourceAllowancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('task', () => { - const fakePath = "/rendered/path/task"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - task_group: "taskGroupValue", - task: "taskValue", - }; - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.taskPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.taskPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('taskPath', () => { - const result = client.taskPath("projectValue", "locationValue", "jobValue", "taskGroupValue", "taskValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.taskPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTaskName', () => { - const result = client.matchProjectFromTaskName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.taskPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTaskName', () => { - const result = client.matchLocationFromTaskName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.taskPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchJobFromTaskName', () => { - const result = client.matchJobFromTaskName(fakePath); - assert.strictEqual(result, "jobValue"); - assert((client.pathTemplates.taskPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTaskGroupFromTaskName', () => { - const result = client.matchTaskGroupFromTaskName(fakePath); - assert.strictEqual(result, "taskGroupValue"); - assert((client.pathTemplates.taskPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTaskFromTaskName', () => { - const result = client.matchTaskFromTaskName(fakePath); - assert.strictEqual(result, "taskValue"); - assert((client.pathTemplates.taskPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('taskGroup', () => { - const fakePath = "/rendered/path/taskGroup"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - job: "jobValue", - task_group: "taskGroupValue", - }; - const client = new batchserviceModule.v1alpha.BatchServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.taskGroupPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.taskGroupPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('taskGroupPath', () => { - const result = client.taskGroupPath("projectValue", "locationValue", "jobValue", "taskGroupValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.taskGroupPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTaskGroupName', () => { - const result = client.matchProjectFromTaskGroupName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.taskGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromTaskGroupName', () => { - const result = client.matchLocationFromTaskGroupName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.taskGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchJobFromTaskGroupName', () => { - const result = client.matchJobFromTaskGroupName(fakePath); - assert.strictEqual(result, "jobValue"); - assert((client.pathTemplates.taskGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTaskGroupFromTaskGroupName', () => { - const result = client.matchTaskGroupFromTaskGroupName(fakePath); - assert.strictEqual(result, "taskGroupValue"); - assert((client.pathTemplates.taskGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/tsconfig.json b/owl-bot-staging/google-cloud-batch/v1alpha/tsconfig.json deleted file mode 100644 index c78f1c884ef..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2018", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts" - ] -} diff --git a/owl-bot-staging/google-cloud-batch/v1alpha/webpack.config.js b/owl-bot-staging/google-cloud-batch/v1alpha/webpack.config.js deleted file mode 100644 index 04a4c53960a..00000000000 --- a/owl-bot-staging/google-cloud-batch/v1alpha/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const path = require('path'); - -module.exports = { - entry: './src/index.ts', - output: { - library: 'BatchService', - filename: './batch-service.js', - }, - node: { - child_process: 'empty', - fs: 'empty', - crypto: 'empty', - }, - resolve: { - alias: { - '../../../package.json': path.resolve(__dirname, 'package.json'), - }, - extensions: ['.js', '.json', '.ts'], - }, - module: { - rules: [ - { - test: /\.tsx?$/, - use: 'ts-loader', - exclude: /node_modules/ - }, - { - test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]grpc/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]retry-request/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]gtoken/, - use: 'null-loader' - }, - ], - }, - mode: 'production', -}; diff --git a/packages/google-cloud-batch/protos/google/cloud/batch/v1/batch.proto b/packages/google-cloud-batch/protos/google/cloud/batch/v1/batch.proto index 8ab94854784..91b902cdb18 100644 --- a/packages/google-cloud-batch/protos/google/cloud/batch/v1/batch.proto +++ b/packages/google-cloud-batch/protos/google/cloud/batch/v1/batch.proto @@ -265,9 +265,10 @@ message OperationMetadata { // Output only. Identifies whether the user has requested cancellation // of the operation. Operations that have successfully been cancelled - // have [Operation.error][] value with a - // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - // `Code.CANCELLED`. + // have + // [google.longrunning.Operation.error][google.longrunning.Operation.error] + // value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. API version used to start the operation.